summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/siunitx
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2008-07-17 22:55:20 +0000
committerKarl Berry <karl@freefriends.org>2008-07-17 22:55:20 +0000
commit848dbb11f1b8a5adf31e6af8716456aeb12a7021 (patch)
tree1be171a2c3908d64cbaa6b548142cc753ed779a4 /Master/texmf-dist/source/latex/siunitx
parentf92b5dd10f840cfa7f2d1d57a12fc7c8eb1983e1 (diff)
tlcom 1.0f (17jul08)
git-svn-id: svn://tug.org/texlive/trunk@9644 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/siunitx')
-rw-r--r--Master/texmf-dist/source/latex/siunitx/siunitx.dtx76
1 files changed, 68 insertions, 8 deletions
diff --git a/Master/texmf-dist/source/latex/siunitx/siunitx.dtx b/Master/texmf-dist/source/latex/siunitx/siunitx.dtx
index 57eae2e27d3..0881810daa4 100644
--- a/Master/texmf-dist/source/latex/siunitx/siunitx.dtx
+++ b/Master/texmf-dist/source/latex/siunitx/siunitx.dtx
@@ -664,9 +664,9 @@ dcolumn, rccol and numprint packages.
%\subsection{Columns of units}
% As a complement to the |S| column, \currpkg also provides a second
% column type, |s|. This is intended for producing columns of units.
-% The letters chosen are intended to be similar to \cs{SI} and
-% \cs{si}, respectively. The alignment of material in |s| columns
-% is governed by the \opt{tabunitalign} option.
+% The letters chosen are intended to be similar to \cs{SI} and
+% \cs{si}, respectively. The alignment of material in |s| columns is
+% governed by the \opt{tabunitalign} option.
%\begin{LaTeXexample}[float]
% \begin{table}
% \centering
@@ -676,7 +676,7 @@ dcolumn, rccol and numprint packages.
% S[tabformat=1.2e-1,tabnumalign=centre]%
% s[tabunitalign=left]}
% \toprule
-% {Value} & \multicolumn{1}{c}{Unit} \\
+% {Value} & \multicolumn{1}{c}{Unit} \\
% \midrule
% 2.16e-5 & \metre\squared\per\second \\
% 2.83e-6 & \metre\squared\per\second \\
@@ -687,6 +687,30 @@ dcolumn, rccol and numprint packages.
% \end{table}
%\end{LaTeXexample}
%
+% As the \cs{si} macro can take literal or macro input, the |s|
+% column cannot validate the input. \emph{Everything} in an |s|
+% column is therefore passed to the \cs{si} macro for processing. To
+% prevent this, you have to use \cs{multicolumn}, as is shown in
+% \ref{tab:s-limits}. Notice that the braces do not prevent
+% processing and colouring of the cell contents.
+%\begin{LaTeXexample}[float]
+% \begin{table}
+% \centering
+% \caption{The \texttt{s} column processes everything}
+% \label{tab:s-limits}
+% \begin{tabular}{%
+% s[colourall,colour=orange]%
+% s[colourall,colour=orange]}
+% \toprule
+% {Unit} & \multicolumn{1}{c}{Unit}\\
+% \midrule
+% {m^3} & \multicolumn{1}{c}{\si{m^3}} \\
+% \kilogram & \kilogram \\
+% \bottomrule
+% \end{tabular}
+% \end{table}
+%\end{LaTeXexample}
+%
%\section{Angles}
%\DescribeMacro{\ang}
% Angles can be typeset using the \cs{ang} command. This takes two
@@ -2595,6 +2619,31 @@ dcolumn, rccol and numprint packages.
% \SI{10}{\myunit}
%\end{LaTeXexample}
%
+%\subsection{Passing unprocessed digits through an \texttt{S}
+% column}
+% The method used to detect numbers in an |S| column will pick up
+% material wrapped inside braces if there is more than a single
+% character inside the braces. If you want to pass a \emph{single}
+% numerical character without processing it, you need two sets of
+% braces (\ref{tab:S-limits}).
+%\begin{LaTeXexample}[float]
+% \begin{table}
+% \centering
+% \caption{Passing single digit characters}
+% \label{tab:S-limits}
+% \begin{tabular}{S[colourall,colour=orange]}
+% \toprule
+% {Heading} \\
+% \midrule
+% {1-2} \\
+% {1} \\
+% {{1}} \\
+% {{-}} \\ % Using {-} gives an error!
+% \bottomrule
+% \end{tabular}
+% \end{table}
+%\end{LaTeXexample}
+%
%\subsection{Limitations of \cs{mathrm}}
% The package uses the \cs{mathrm} font family by default to typeset
% output in maths mode. This however has a few side-effects. For
@@ -3121,11 +3170,11 @@ author.
% number, of course.
% \begin{macrocode}
\NeedsTeXFormat{LaTeX2e}
-\newcommand*{\si@svn@ver}{v1.0e}
+\newcommand*{\si@svn@ver}{v1.0f}
\def\si@svn@id$#1: #2.#3 #4 #5-#6-#7 #8 #9${%
\newcommand*{\si@svn@version}{%
#5/#6/#7\space\si@svn@ver\space}}
-\si@svn@id $Id: siunitx.dtx 101 2008-07-03 09:02:22Z joseph $
+\si@svn@id $Id: siunitx.dtx 106 2008-07-17 10:38:08Z joseph $
\ProvidesPackage{siunitx}
[\si@svn@version A comprehensive (SI) units package]
% \end{macrocode}
@@ -9496,14 +9545,16 @@ author.
\makeatletter
\endlinechar\m@ne
% \end{macrocode}
+%\changes{1.0f}{2008/07/17}{Fixed bug with colour and spacing}
% The various font families can now be set up. First a check is made
% in case there are nested calls to \cs{si@out@text}.
% \begin{macrocode}
\ifsi@fam@set\else
\expandafter\si@fam@set
\fi
- \si@colourcmd{\si@colour}%
- \text{\si@fam@italic\si@fam@bold\si@fam@text
+ \text{%
+ \si@colourcmd{\si@colour}%
+ \si@fam@italic\si@fam@bold\si@fam@text
% \end{macrocode}
% The correct mode is selected, and the input is handed off for
% typesetting.
@@ -12772,5 +12823,14 @@ author.
\patchcmd{\@addmarginpar}
{\@latex@warning@no@line {Marginpar on page \thepage\space moved}}
{\relax}{}{}
+\newcounter{argument}
+\g@addto@macro\endmacro{\setcounter{argument}{0}}
+\newcommand*\darg[1]{%
+ \stepcounter{argument}%
+ {\ttfamily\char`\#\theargument~:~}#1\par\noindent\ignorespaces}
+\newcommand*\doarg[1]{%
+ \stepcounter{argument}%
+ {\ttfamily\makebox[0pt][r]{[}%
+ \char`\#\theargument]:~}#1\par\noindent\ignorespaces}
%</jawltxdoc>
%\fi