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/doc/latex/bchart/CHANGES.txt | 3 ++ Master/texmf-dist/doc/latex/bchart/bchart.pdf | Bin 141445 -> 154679 bytes Master/texmf-dist/doc/latex/bchart/bchart.tex | 38 ++++++++++++++++++++++--- Master/texmf-dist/tex/latex/bchart/bchart.sty | 25 +++++++++------- 4 files changed, 52 insertions(+), 14 deletions(-) (limited to 'Master/texmf-dist') diff --git a/Master/texmf-dist/doc/latex/bchart/CHANGES.txt b/Master/texmf-dist/doc/latex/bchart/CHANGES.txt index dd24339b477..f7b70418503 100644 --- a/Master/texmf-dist/doc/latex/bchart/CHANGES.txt +++ b/Master/texmf-dist/doc/latex/bchart/CHANGES.txt @@ -1,6 +1,9 @@ Changelog for bchart ==================== +Version 0.1.2: +- Customizable font style + Version 0.1.1: - New "value" option for bars - Discussion of known issue with "Dimension too large" error diff --git a/Master/texmf-dist/doc/latex/bchart/bchart.pdf b/Master/texmf-dist/doc/latex/bchart/bchart.pdf index 430cd442c95..baf4d889d33 100644 Binary files a/Master/texmf-dist/doc/latex/bchart/bchart.pdf and b/Master/texmf-dist/doc/latex/bchart/bchart.pdf differ diff --git a/Master/texmf-dist/doc/latex/bchart/bchart.tex b/Master/texmf-dist/doc/latex/bchart/bchart.tex index 9e0447c6dd8..68a87ea7a4a 100644 --- a/Master/texmf-dist/doc/latex/bchart/bchart.tex +++ b/Master/texmf-dist/doc/latex/bchart/bchart.tex @@ -7,10 +7,10 @@ \title{ \texttt{bchart}: Simple Bar Charts in \LaTeX \medskip\\ - \large Version 0.1.1 + \large Version 0.1.2 } \author{Tobias Kuhn} -\date{16 March 2012} +\date{22 August 2012} \begin{document} @@ -97,6 +97,36 @@ The \texttt{plain}-flag hides all marks: \bcbar{1.8} \end{bchart} \end{quote} +The font style is sans-serif by default. This can be changed by redefining the command \texttt{bcfontstyle}: +\begin{quote}\small +\begin{verbatim} +\renewcommand{\bcfontstyle}{\bfseries} +\begin{bchart}[max=10,step=1] + \bcbar{5.7} +\end{bchart} +\end{verbatim} +\end{quote} +\begin{quote} +\renewcommand{\bcfontstyle}{\bfseries} +\begin{bchart}[max=10,step=1] + \bcbar{5.7} +\end{bchart} +\end{quote} +With an empty argument, the default font of the document is used: +\begin{quote}\small +\begin{verbatim} +\renewcommand{\bcfontstyle}{} +\begin{bchart}[max=10,step=1] + \bcbar{5.7} +\end{bchart} +\end{verbatim} +\end{quote} +\begin{quote} +\renewcommand{\bcfontstyle}{} +\begin{bchart}[max=10,step=1] + \bcbar{5.7} +\end{bchart} +\end{quote} \section{Bars} @@ -221,7 +251,7 @@ With the \texttt{bcskip}-command, skips of arbitrary size can be inserted: \section{Labels} -The x-axis can be labelled by calling the \texttt{bcxlabel}-command: +The x-axis can be labeled by calling the \texttt{bcxlabel}-command: \begin{quote}\small \begin{verbatim} \begin{bchart}[step=200,max=1000] @@ -391,7 +421,7 @@ When using fractions in the \texttt{step}-option, sometimes rounding errors beco \bcbar{0.76} \end{bchart} \end{quote} -As a workaround, the \texttt{steps}-option can be used instead, where all marks must be listed explicitely: +As a workaround, the \texttt{steps}-option can be used instead, where all marks must be listed explicitly: \begin{quote}\small \begin{verbatim} \begin{bchart}[steps={0.2,0.4,0.6,0.8,1},max=1] 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