From f4edadfb71516f69b11060db846a8d500528cdc7 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Wed, 22 Aug 2012 23:07:49 +0000 Subject: bchart (22aug12) git-svn-id: svn://tug.org/texlive/trunk@27496 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/tex/latex/bchart/bchart.sty | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) (limited to 'Master/texmf-dist/tex/latex/bchart') diff --git a/Master/texmf-dist/tex/latex/bchart/bchart.sty b/Master/texmf-dist/tex/latex/bchart/bchart.sty index 212d4feac4e..c8332593bf3 100644 --- a/Master/texmf-dist/tex/latex/bchart/bchart.sty +++ b/Master/texmf-dist/tex/latex/bchart/bchart.sty @@ -1,8 +1,8 @@ %------------------------------------------------------------------------------- % bchart (LaTeX package) %------------------------------------------------------------------------------- -% Version: 0.1.1 -% Date: 16 March 2012 +% Version: 0.1.2 +% Date: 22 August 2012 % Author: Tobias Kuhn %------------------------------------------------------------------------------- @@ -19,6 +19,11 @@ \newlength{\bcwidth} +% Global Arguments + +\newcommand{\bcfontstyle}{\sf} + + % Chart Arguments \newcommand{\bcunit}{} @@ -82,19 +87,19 @@ \draw (0,\bcpos) rectangle ($##2-\bcmin*(\bcwidth/\bcrange,0) + (0,\bcpos-5mm)$); \ifthenelse{\equal{\bcplainbar}{true}}{}{ % Write value: - \node[anchor=west] at ($##2-\bcmin*(\bcwidth/\bcrange,0) + (0,\bcpos-2.5mm)$) {\sf \bcbarvalue}; + \node[anchor=west] at ($##2-\bcmin*(\bcwidth/\bcrange,0) + (0,\bcpos-2.5mm)$) {\bcfontstyle\bcbarvalue}; } % Write text: - \node[anchor=west] at (0,\bcpos-2.5mm) {\sf \bcbartext}; + \node[anchor=west] at (0,\bcpos-2.5mm) {\bcfontstyle\bcbartext}; % Write label: - \node[anchor=east] at (0,\bcpos-2.5mm) {\sf \bcbarlabel}; + \node[anchor=east] at (0,\bcpos-2.5mm) {\bcfontstyle\bcbarlabel}; % Move vertical position downward: \addtolength{\bcpos}{-5mm} }% % Labels: \newcommand{\bclabel}[1]{ % Write label: - \node[anchor=east] at (0,\bcpos) {\sf ##1}; + \node[anchor=east] at (0,\bcpos) {\bcfontstyle##1}; }% % General skips: \newcommand{\bcskip}[2][]{ @@ -103,7 +108,7 @@ % Read parameters: \setkeys{bcskip}{##1} % Write label: - \node[anchor=east] at ($(0,\bcpos) - 0.5*(0,##2)$) {\sf \bcskiplabel}; + \node[anchor=east] at ($(0,\bcpos) - 0.5*(0,##2)$) {\bcfontstyle\bcskiplabel}; % Move vertical position downward: \addtolength{\bcpos}{-##2} }% @@ -147,20 +152,20 @@ % Draw start value and set position for x-axis label: \draw (0,\bcpos) -- (0,\bcpos-1mm); \node[anchor=north] (n) at (0,\bcpos-1mm) - {\sf \bcstripunit{\dimexpr\bcmin pt\relax}\bcunit}; + {\bcfontstyle\bcstripunit{\dimexpr\bcmin pt\relax}\bcunit}; \coordinate (labelpos) at (n.south); % Draw other values: \foreach \x in \bcsteps { \ifthenelse{\equal{\x}{0}}{}{ \draw ($\x*(\bcwidth/\bcrange,0) + (0,\bcpos)$) -- ($\x*(\bcwidth/\bcrange,0) + (0,\bcpos-1mm)$); \node[anchor=north] at ($\x*(\bcwidth/\bcrange,0) + (0,\bcpos-1mm)$) - {\sf \bcstripunit{\dimexpr\bcmin pt+\x pt\relax}\bcunit}; + {\bcfontstyle\bcstripunit{\dimexpr\bcmin pt+\x pt\relax}\bcunit}; } } } % Write x-axis label: \ifthenelse{\equal{\getbcxlabel}{}}{}{ - \node[anchor=north,inner sep=0.5mm] at ($0.5*(\bcwidth,0) + (labelpos)$) {\sf \getbcxlabel}; + \node[anchor=north,inner sep=0.5mm] at ($0.5*(\bcwidth,0) + (labelpos)$) {\bcfontstyle\getbcxlabel}; } \end{tikzpicture}% } -- cgit v1.2.3