summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2008-07-01 01:02:08 +0000
committerKarl Berry <karl@freefriends.org>2008-07-01 01:02:08 +0000
commit3162035fb38abf635f76f77824771f7d052ce335 (patch)
tree3f9dcb8f3828d39c3d072a54ab0bf9bd17e7cba3 /Master/texmf-dist/source/latex
parente1848a4a89ee2b1e434745fb3f820583d84bee95 (diff)
siunitx update (25jun08)
git-svn-id: svn://tug.org/texlive/trunk@9132 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex')
-rw-r--r--Master/texmf-dist/source/latex/siunitx/siunitx.dtx106
1 files changed, 74 insertions, 32 deletions
diff --git a/Master/texmf-dist/source/latex/siunitx/siunitx.dtx b/Master/texmf-dist/source/latex/siunitx/siunitx.dtx
index 11807b95c74..abfea4627b8 100644
--- a/Master/texmf-dist/source/latex/siunitx/siunitx.dtx
+++ b/Master/texmf-dist/source/latex/siunitx/siunitx.dtx
@@ -228,7 +228,7 @@ dcolumn, rccol and numprint packages.
%</driver>
% \fi
%
-%\CheckSum{9442}
+%\CheckSum{9503}
%
% \CharacterTable
% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
@@ -2587,16 +2587,15 @@ dcolumn, rccol and numprint packages.
% to force maths processing, and \cs{text} (from the \AMS\TeX\
% bundle) to ensure text mode.
%
-%\subsection{Using \texttt{.}~in units}
-% To use a literal |.| in a unit, it has to be protected from
-% expansion. Using \cs{text} will not work here (in contrast to
-% \SIstyle). A robust command is needed:
+%\subsection{Using \texttt{.} and fixed spaces in units}
+% To use a literal |.| in a unit, it has to be within an extra set of
+% braces. This does not need any extra protection, unlike the
+% situation with \SIstyle (for example, no \cs{text} macro is
+% needed). The fixed space (|~|) is more problematic: set
+% \opt{unitspace=space} to get a full space here.
%\begin{LaTeXexample}
-% \newunit{\myunit}{V~vs.~NHE}%
-% \SI{10}{\myunit}\\
-% \DeclareRobustCommand*{\MyUnit}{V~vs.~NHE}
-% \renewunit[unitspace=space]{\myunit}{\MyUnit}
-% \SI{20}{\myunit}
+% \newunit[unitspace=space]{\myunit}{V~vs{.}~NHE}%
+% \SI{10}{\myunit}
%\end{LaTeXexample}
%
%\subsection{Limitations of \cs{mathrm}}
@@ -3125,11 +3124,11 @@ author.
% number, of course.
% \begin{macrocode}
\NeedsTeXFormat{LaTeX2e}
-\newcommand*{\si@svn@ver}{v1.0b}
+\newcommand*{\si@svn@ver}{v1.0d}
\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 88 2008-06-23 08:25:52Z joseph $
+\si@svn@id $Id: siunitx.dtx 97 2008-06-25 11:11:46Z joseph $
\ProvidesPackage{siunitx}
[\si@svn@version A comprehensive (SI) units package]
% \end{macrocode}
@@ -4682,6 +4681,7 @@ author.
% \end{macrocode}
%\end{macro}
%\end{macro}
+%\changes{v1.0c}{2008/06/25}{Fixed excess loading of maths fonts}
%\begin{macro}{\si@textmu}
%\begin{macro}{\si@mathsmu}
% For the \si{\micro} symbol, some direct loading of symbols is
@@ -4693,12 +4693,16 @@ author.
\DeclareFontSubstitution{TS1}{cmr}{m}{n}
\DeclareTextSymbol{\si@textmu}{TS1}{181}
\DeclareTextSymbolDefault{\si@textmu}{TS1}
-\DeclareFontFamily{OML}{eur}{\skewchar\font127}
-\DeclareFontShape{OML}{eur}{m}{n}%
- {<5> <6> <7> <8> <9> gen * eurm %
- <10><10.95><12><14.4><17.28><20.74><24.88>eurm10}{}
-\DeclareSymbolFont{greek}{OML}{eur}{m}{n}
-\DeclareMathSymbol{\si@mathsmu}{\mathord}{greek}{"16}
+\@ifpackageloaded{upgreek}
+ {}
+ {\DeclareFontFamily{OML}{eur}{\skewchar\font'177}
+ \DeclareFontShape{OML}{eur}{m}{n}{%
+ <-6> eurm5 <6-8> eurm7 <8-> eurm10}{}}
+\AtBeginDocument{
+ \@ifpackageloaded{upgreek}
+ {\let\si@mathsmu\upmu}
+ {\DeclareSymbolFont{si@greek}{OML}{eur}{m}{n}
+ \DeclareMathSymbol{\si@mathsmu}{\mathord}{si@greek}{"16}}}
% \end{macrocode}
%\end{macro}
%\end{macro}
@@ -4991,7 +4995,7 @@ author.
%\begin{macro}{\si@fix@medium}
%\begin{macro}{\si@fix@thick}
%\begin{macro}{\si@fix@space}
-%\changes{1.0a}{2008/06/20}{Fixed problem with \opt{space} option}
+%\changes{v1.0a}{2008/06/20}{Fixed problem with \opt{space} option}
% First, there are the various space macros. To allow both \opt{med}
% and \opt{medium} to be used as a space description, two macros are
% needed for the same output.
@@ -5146,7 +5150,6 @@ author.
\fi}{}
\@ifpackageloaded{upgreek}
{\si@log@debug{Redefining symbols using upgreek}%
- \renewcommand*{\si@mathsmu}{\upmu}%
\renewcommand*{\si@mathsOmega}{\Upomega}}{}
\fi}
% \end{macrocode}
@@ -7635,7 +7638,7 @@ author.
%\begin{macro}{\si@tab@gettok@S}
%\begin{macro}{\si@tab@othertok}
%\begin{macro}{\si@tab@gettok@s}
-%\changes{1.0a}{2008/06/20}{Fixed issues with alignment of
+%\changes{v1.0a}{2008/06/20}{Fixed issues with alignment of
% \texttt{s} column contents}
%\begin{macro}{\si@tab@next}
% The two collection macros are very similar. Both compare the
@@ -7733,7 +7736,8 @@ author.
%\end{macro}
%\end{macro}
%\begin{macro}{\si@tab@end@S}
-%\changes{1.0a}{2008/06/20}{Fixed mixed number/text column alignment}
+%\changes{v1.0a}{2008/06/20}{Fixed mixed number/text column
+% alignment}
%\begin{macro}{\si@tab@rfill}
%\begin{macro}{\si@tab@lfill}
%\begin{macro}{\si@tab@end@s}
@@ -9193,29 +9197,67 @@ author.
%\end{macro}
%
%\begin{macro}{\si@unt@out}
+%\changes{v1.0d}{2008/06/25}{Sanitise one level of unit input
+% only}
% The final part of the units system is the output routine. This has
% to cope with units not only as macros but also as direct input
% (\SIstyle-type input). Non-Latin characters are also handled
-% cleanly. As usual, \cs{scantokens} is used to make life easier.\\
+% cleanly. The \cs{scantokens} system deals with everything except
+% full stops; these are left out so that a single level system can be
+% used \latin{via} a token register.\\
%\cs{si@unt@out}\marg{unit}
% \begin{macrocode}
\begingroup
\catcode`\~=\active
\catcode`\.=\active
\gdef\si@unt@out#1{%
+ \si@temptoks{#1}%
+ \si@unt@fullstop
+ \def.{\ensuremath{\si@unitsep}}%
+ \def~{\ensuremath{\si@unitspace}}%
+ \expandafter\protected@edef\expandafter\si@tempa
+ \expandafter{\the\si@temptoks}%
\begingroup
\si@unt@nonlatin
\makeatletter
- \catcode`\~=\active
- \catcode`\.=\active
- \def~{\ensuremath{\si@unitspace}}%
- \def.{\ensuremath{\si@unitsep}}%
\endlinechar\m@ne
- \si@out{\scantokens{#1}}%
+ \expandafter\si@out\expandafter{%
+ \expandafter\scantokens\expandafter{\si@tempa}}%
\endgroup}
\endgroup
% \end{macrocode}
%\end{macro}
+%\begin{macro}{\si@unt@fullstop}
+%\begin{macro}{\si@unt@stp}
+% Two macros modified from \pkg{kvsetkeys} to deal with a single
+% level of active full stops only.
+% \begin{macrocode}
+\begingroup
+ \catcode`\.=\active
+ \catcode`\&=12\relax
+ \begingroup
+ \lccode`\.=`\.\relax
+ \lccode`\&=`\.\relax
+ \lowercase{\endgroup
+ \gdef\si@unt@fullstop{%
+ \si@temptoks\expandafter{\expandafter}\expandafter
+ \si@unt@stp\the\si@temptoks&\@nil}
+ \gdef\si@unt@stp#1&#2\@nil{%
+ \edef\si@tempa{\the\si@temptoks}%
+ \ifx\si@tempa\@empty
+ \expandafter\@firstoftwo
+ \else
+ \expandafter\@secondoftwo
+ \fi
+ {\si@temptoks{#1}}
+ {\si@temptoks\expandafter{\the\si@temptoks.#1}}%
+ \si@ifmtarg{#2}
+ {}
+ {\si@unt@stp#2\@nil}}}
+\endgroup
+% \end{macrocode}
+%\end{macro}
+%\end{macro}
%\begin{macro}{\si@unt@nonlatin}
% To handle non-Latin symbols in the input, a single macro is
% provided. If \XeTeX\ is in use, this can be detected immediately.
@@ -9391,7 +9433,7 @@ author.
% \end{macrocode}
%\end{macro}
%\begin{macro}{\si@loc@ltol}
-%\changes{1.0a}{2008/06/20}{\pkg{babel} support fixed for default
+%\changes{v1.0a}{2008/06/20}{\pkg{babel} support fixed for default
% document language}
% The necessary loading for language modules occurs.\\
%\cs{si@loc@ltol}\marg{list}
@@ -9448,11 +9490,11 @@ author.
%\cs{si@out}\marg{text}
% \begin{macrocode}
\begingroup
- \catcode`\^=\active\relax
- \catcode`\-=\active\relax
+ \catcode`\^=\active
+ \catcode`\-=\active
\gdef\si@out#1{%
\begingroup
- \catcode`\^=\active\relax
+ \catcode`\^=\active
\makeatletter
\endlinechar\m@ne
% \end{macrocode}