diff options
author | Karl Berry <karl@freefriends.org> | 2019-05-02 22:36:42 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2019-05-02 22:36:42 +0000 |
commit | bf8dedec03ea810ec4a50f1f1993134a47729640 (patch) | |
tree | 16bb4e1ef38615904743dd72fc6627443c371341 /Master/texmf-dist/tex/latex/fcolumn/fcolumn.sty | |
parent | c334b6a3c7a2b6b53e9f3e26f795391362789d90 (diff) |
fcolumn (26apr19)
git-svn-id: svn://tug.org/texlive/trunk@50937 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/fcolumn/fcolumn.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/fcolumn/fcolumn.sty | 271 |
1 files changed, 182 insertions, 89 deletions
diff --git a/Master/texmf-dist/tex/latex/fcolumn/fcolumn.sty b/Master/texmf-dist/tex/latex/fcolumn/fcolumn.sty index 88a33413bce..479dff097a2 100644 --- a/Master/texmf-dist/tex/latex/fcolumn/fcolumn.sty +++ b/Master/texmf-dist/tex/latex/fcolumn/fcolumn.sty @@ -8,7 +8,7 @@ %% %% This is a generated file. %% -%% Copyright (C) 2015 by Edgar Olthof +%% Copyright (C) 2015--2019 by Edgar Olthof %% %% This file may be distributed and/or modified under the %% conditions of the LaTeX Project Public License, either @@ -19,81 +19,164 @@ %% %% and version 1.3 or later is part of all distributions of %% LaTeX version 1999/12/01 or later. -\NeedsTeXFormat{LaTeX2e} \ProvidesPackage{fcolumn} - [2015/09/20 v1.1.1 Automatic Currency Package (EO)] -\RequirePackage{array} + [2019/04/24 v1.2 Automatic Currency Package (EHTO)] +\NeedsTeXFormat{LaTeX2e} +\RequirePackage{array}[v2.4k] +\newif\ifstrict@ccounting \strict@ccountingfalse +\DeclareOption{strict}{\strict@ccountingtrue} +\ProcessOptions \newcolumntype{F}[3]{>{\b@fi{#1}{#2}{#3}}r<{\e@fi}} \newcolumntype{f}{F{.}{,}{3,2}} -\newcount\FCsc@l \FCsc@l=0 -\newcount\FCtc@l \FCtc@l=0 +\newcount\FCsc@l \FCsc@l=0 \newcount\FCtc@l \FCtc@l=0 \newif\ifwiths@p -\newif\ifstrictaccounting \strictaccountingfalse \def\geldm@cro#1#2{\withs@pfalse -\afterassignment\g@ldm@cro\count@#2\relax{#1}} -\def\g@ldm@cro#1\relax#2{% -\ifnum#2<0 \ifstrictaccounting(\else-\fi\count2=-#2 \else\count2=#2 \fi -\count3=\ifx\relax#1\relax2 \else \@gobble#1\relax\fi -\count4=\count3 -\loop - \ifnum\count3>0 \divide\count2 by 10 \advance\count3 by \m@ne +\afterassignment\g@ldm@cro\count@#1\relax{#2}} +\def\g@ldm@cro#1\relax#2{\ifnum#2<0 \ifstrict@ccounting (\else -\fi + \count2=-#2 \else\count2=#2 +\fi +\count4=\ifx\relax#1\relax 2 \else \@gobble#1\relax\fi +\count3=0 +\loop\ifnum\count3<\count4 + \divide\count2 by 10 \advance\count3 by \@ne \repeat \g@ldens{\the\count@}% -\ifnum\count4>0\decim@lmark - \ifnum#2>0 \count2=-#2\else\count2=#2 \fi - \count3=\count4 - \loop - \ifnum\count3>0 \divide\count2 by 10 \advance\count3 by \m@ne - \repeat - \loop - \ifnum\count3<\count4 \multiply\count2 by 10 \advance\count3 by \@ne - \repeat - \ifnum#2>0 \advance\count2 by #2 - \else \advance\count2 by -#2 - \fi - \zerop@d{\number\count3}{\number\count2}% +\ifnum\count3>0\decim@lmark + \ifnum#2>0 \count2=-#2\else\count2=#2 \fi + \loop\ifnum\count3>0 + \divide\count2 by 10 \advance\count3 by \m@ne + \repeat + \loop\ifnum\count3<\count4 + \multiply\count2 by 10 \advance\count3 by \@ne + \repeat + \ifnum#2>0 \advance\count2 by #2 + \else \advance\count2 by -#2 + \fi + \zerop@d{\number\count3}{\number\count2}% \fi -\ifnum#2<0 \ifstrictaccounting\rlap{)}\fi\fi} +\ifx\FCs@gn\m@ne \ifnum#2<0 \ifstrict@ccounting + \rlap{)~!}\else\rlap{~!}\fi\else\ifstrict@ccounting + \rlap{\phantom{)}~!}\else\rlap{~!}\fi\fi +\else \ifnum#2<0 \ifstrict@ccounting\rlap{)}\fi\fi +\fi} \def\g@ldens#1{{\count3=\count2 \count0=#1 -\loop - \ifnum\count0>0 - \divide\count2 by 10 - \advance\count0 by \m@ne +\ifnum\count0<1 \count0=3 \fi +\loop \ifnum\count0>0 \divide\count2 by 10 \advance\count0 by \m@ne \repeat \ifnum\count2>0 \g@ldens{#1}\fi \count0=#1 -\loop - \ifnum\count0>0 - \multiply\count2 by 10 - \advance\count0 by\m@ne +\ifnum\count0<1 \count0=3 \fi +\loop \ifnum\count0>0 \multiply\count2 by 10 \advance\count0 by \m@ne \repeat \count2=-\count2 \advance\count2 by \count3 \du@zendprint{#1}}} -\def\du@zendprint#1{\ifwiths@p\sep@rator\zerop@d{#1}{\number\count2}% - \else\zerop@d{1}{\number\count2}\fi \global\withs@ptrue} +\def\du@zendprint#1{\ifwiths@p\ifnum#1>0 \sep@rator\fi + \zerop@d{#1}{\number\count2}% +\else\zerop@d1{\number\count2}\fi\global\withs@ptrue} \def\zerop@d#1#2{{\count0=1 \count1=#2 -\loop - \divide \count1 by 10 - \ifnum\count1>0 \advance\count0 by\@ne -\repeat -\loop - \ifnum\count0<#1\relax 0\advance\count0 by\@ne +\loop \divide \count1 by 10 \ifnum\count1>0 \advance\count0 by \@ne \repeat -\number#2}} -\def\zetg@ld#1#2{\global\advance\csname -FCtot@\romannumeral\FCsc@l\endcsname by #1 +\ifnum#1>0 + \loop \ifnum\count0<#1\relax 0\advance\count0 by \@ne + \repeat +\else + \advance\count0 by -3 + \loop \ifnum\count0<0 0\advance\count0 by \@ne + \repeat +\fi\number#2}} +\def\zetg@ld#1#2{\count0=#2\relax \let\FCs@gn=\@ne +\ifnum\count0<0 + \ifnum\csname FCtot@\romannumeral\FCsc@l\endcsname<0 + \let\FCs@gn=\m@ne + \fi +\fi +\ifnum\count0>0 + \ifnum\csname FCtot@\romannumeral\FCsc@l\endcsname>0 + \let\FCs@gn=\m@ne + \fi +\fi +\global\advance\csname FCtot@\romannumeral\FCsc@l\endcsname by \count0 +\ifx\FCs@gn\m@ne + \ifnum\count0>0 \let\FCs@gn\@ne \fi + \count0=\csname FCtot@\romannumeral\FCsc@l\endcsname + \multiply\count0 by \FCs@gn + \ifnum\count0<0 + \let\FCs@gn=\m@ne + \PackageError{fcolumn}{Register overflow}{Overflow occurred + in fcolumn \number\FCsc@l. Check your table.}% + \else\let\FCs@gn=\@ne + \fi +\fi \setbox0=\hbox{$\geldm@cro{#1}{#2}$}% \ifdim\wd0>\csname FCwd@\romannumeral\FCsc@l\endcsname \global\csname FCwd@\romannumeral\FCsc@l\endcsname=\wd0 \fi\unhbox0} -\newcount\bedr@g -\def\b@fi#1#2#3{\def\sep@rator{{#1}}\def\decim@lmark{{#2}}% -\def\sp@l{#3}\let\ignorespaces=\@empty \let\unskip=\@empty -\global\advance\FCsc@l by \@ne -\setbox0=\hbox\bgroup\global\bedr@g=} -\def\e@fi{ 123\relax\egroup\ifdim\wd0>\z@ - \zetg@ld{\number\bedr@g}{\sp@l}% +\newcount\FC@l \newcount\FC@r +\def\FC@chklist{} +\def\setucc@de#1#2\relax{\uccode`\~=`#1 } +\def\b@fi#1#2#3{% +\def\sep@xt##1##2\end{\def\sep@rator{{##1}}}% +\sep@xt#1\end\def\decim@lmark{{#2}}% +\def\sp@l{#3}\global\advance\FCsc@l by \@ne +\global\FC@l=0 \global\FC@r=1 +\let\FCs@gn=\@ne\relax \setbox0\hbox\bgroup$% +\uccode`\~=`0\relax \uppercase{\def~}{\restorem@thcodes \global\FC@l=0} +\uccode`\~=`1\relax \uppercase{\def~}{\restorem@thcodes \global\FC@l=1} +\uccode`\~=`2\relax \uppercase{\def~}{\restorem@thcodes \global\FC@l=2} +\uccode`\~=`3\relax \uppercase{\def~}{\restorem@thcodes \global\FC@l=3} +\uccode`\~=`4\relax \uppercase{\def~}{\restorem@thcodes \global\FC@l=4} +\uccode`\~=`5\relax \uppercase{\def~}{\restorem@thcodes \global\FC@l=5} +\uccode`\~=`6\relax \uppercase{\def~}{\restorem@thcodes \global\FC@l=6} +\uccode`\~=`7\relax \uppercase{\def~}{\restorem@thcodes \global\FC@l=7} +\uccode`\~=`8\relax \uppercase{\def~}{\restorem@thcodes \global\FC@l=8} +\uccode`\~=`9\relax \uppercase{\def~}{\restorem@thcodes \global\FC@l=9} +\def\deactdecm@rk##1##2\relax{\mathcode`##1=0 }% +\afterassignment\setucc@de\count@#3\relax +\uppercase{\def~}{\ifnum\mathcode`\0=\mathcode`- \restorem@thcodes\fi +\afterassignment\deactdecm@rk\count@#3\relax \global\FC@r=1}% +\def\d@cm##1##2{\count@=\mathcode`##1 } +\ifnum\uccode`\~=`. \uccode`\~=`,\relax\else \uccode`\~=`.\relax\fi +\uppercase{\def~}{\ifnum\mathcode`\0=\mathcode`- \restorem@thcodes\fi +\afterassignment\d@cm\count@#3\relax +\ifnum\count@=\mathcode`- \expandafter\global\FC@l=\the\FC@l +\else \expandafter\global\FC@r=\the\FC@r\fi}% +\uccode`\~=`+\relax +\uppercase{\def~}{\ifnum\mathcode`\0=\mathcode`- +\restorem@thcodes\fi\global\FC@l=0}% +\uccode`\~=`-\relax +\uppercase{\def~}{\ifnum\mathcode`\0=\mathcode`- +\restorem@thcodes\fi\global\let\FCs@gn\m@ne \global\FC@l=0}% +\mathcode`-="8000 \mathcode`+=\mathcode`- \mathcode`.=\mathcode`- +\def\actdecm@rk##1##2\relax{\ifx##1.\relax \mathcode`,=\mathcode`- +\else \mathcode`##1=\mathcode`- \fi}% +\afterassignment\actdecm@rk\count@#3\relax +\mathcode`\0=\mathcode`- \mathcode`\1=\mathcode`- +\mathcode`\2=\mathcode`- \mathcode`\3=\mathcode`- +\mathcode`\4=\mathcode`- \mathcode`\5=\mathcode`- +\mathcode`\6=\mathcode`- \mathcode`\7=\mathcode`- +\mathcode`\8=\mathcode`- \mathcode`\9=\mathcode`- } +\def\e@fi{\ifnum\mathcode`\0=\mathcode`- \global\FC@r=\m@ne\fi$\egroup +\ifnum\FC@r>0 + \ifnum\FC@r<10 \multiply\FC@r by 10 \fi + \def\i@ts##1##2{\count0=##2} + \afterassignment\i@ts\count@\sp@l + \loop\ifnum\count0>0 \multiply\FC@l by 10 + \expandafter\secd@xt\number\FC@r\end \advance\count0 by \m@ne + \repeat + \ifnum\FC@r>10 + \def\tw@l##1##2\relax{##2} + \PackageWarning{fcolumn}{Excess digit\ifnum\FC@r>100 s\fi\space + ``\expandafter\tw@l\number\FC@r\relax'' in decimal part + \MessageBreak ignored} + \fi + \ifx\FCs@gn\m@ne\relax \FC@l=-\FC@l \fi + \zetg@ld{\sp@l}{\FC@l}% \fi} +\def\secd@xt#1#2#3\end{\advance\FC@l by #2 +\FC@r=#1#3 \ifnum\FC@r<10 \multiply\FC@r by 10 \fi} +\def\restorem@thcodes{\mathcode`\0=0 \mathcode`\1=0 +\mathcode`\2=0 \mathcode`\3=0 \mathcode`\4=0 \mathcode`\5=0 +\mathcode`\6=0 \mathcode`\7=0 \mathcode`\8=0 \mathcode`\9=0 } \def\@array[#1]#2{% \@tempdima \ht \strutbox \advance \@tempdima by\extrarowheight @@ -121,7 +204,7 @@ FCtot@\romannumeral\FCsc@l\endcsname by #1 \m@th \let\\\@arraycr \let\tabularnewline\\\let\par\@empty \@preamble} \let\@@array=\@array -\def\@mksumline#1{\gdef\sumline{}\@lastchclass 4 \@firstamptrue +\def\@mksumline#1{\gdef\s@ml@ne{}\@lastchclass 4 \@firstamptrue \global\FCsc@l=0 \let\prr@sult=\relax \@temptokena{#1} @@ -137,8 +220,8 @@ FCtot@\romannumeral\FCsc@l\endcsname by #1 \or \or \@classfii \or \or \or \or \or \or \or \or \@classfx \fi \@lastchclass\@chclass}% -\xdef\sumline{\sumline\noexpand\aut@check\noexpand\\}} -\def\@addtosumline#1{\xdef\sumline{\sumline #1}} +\xdef\s@ml@ne{\s@ml@ne\noexpand\aut@check\noexpand\\}} +\def\@addtosumline#1{\xdef\s@ml@ne{\s@ml@ne #1}} \def\@classfx{\if@firstamp \@firstampfalse \else \@addtosumline &\fi} \def\@classfz{\ifnum\@chnum<\thr@@ \@classfx\fi} \def\@classfii{\ifnum\@lastchclass=8 @@ -151,56 +234,66 @@ FCtot@\romannumeral\FCsc@l\endcsname by #1 \expandafter\ifx\csname FCtot@\romannumeral\FCsc@l\endcsname\relax \expandafter\newcount\csname FCtot@\romannumeral\FCsc@l\endcsname \else - \message{^^JWarning: FCtot@\romannumeral\FCsc@l \space is already - defined and it may not even be a <count>. I'll proceed, - but with fingers crossed. } + \PackageError{fcolumn}{Name clash for <count>}{\expandafter\csname + FCtot@\romannumeral\FCsc@l\endcsname is already defined and it may + not even be a <count>. If you're\MessageBreak sure it is a <count>, + you can press <enter> now and I'll proceed, but things\MessageBreak + will get overwritten.}% \fi \expandafter\ifx\csname FCwd@\romannumeral\FCsc@l\endcsname\relax \expandafter\newdimen\csname FCwd@\romannumeral\FCsc@l\endcsname \global\FCtc@l=\FCsc@l \else - \message{^^JWarning: FCwd@\romannumeral\FCsc@l \space is already - defined and it may not even be a <dimen>. I'll proceed, - but with fingers crossed. } + \PackageError{fcolumn}{Name clash for <dimen>}{\expandafter\csname + FCwd@\romannumeral\FCsc@l\endcsname is already defined and it may + not even be a <dimen>. If you're\MessageBreak sure it is a <dimen>, + you can press <enter> now and I'll proceed, but things\MessageBreak + will get overwritten.}% \fi \fi \fi \fi} -\def\leeg#1{ 234\relax\egroup \let\e@fi=\relax \setbox0=\hbox{#1}% -\ifdim\wd0>\csname FCwd@\romannumeral\FCsc@l\endcsname - \global\csname FCwd@\romannumeral\FCsc@l\endcsname=\wd0 -\fi\unhbox0} -\def\prr@sult{ 345\relax\egroup \let\e@fi=\relax -\setbox0=\hbox{$\geldm@cro{\number\csname -FCtot@\romannumeral\FCsc@l\endcsname}{\sp@l}$}% +\newdimen\s@mlinesep +\def\sumline{\@ifnextchar[\s@mline{\s@mline[2pt]}} +\def\s@mline[#1]{\global\s@mlinesep=#1 \s@ml@ne} +\def\prr@sult{$\egroup \let\e@fi=\relax +\setbox0=\hbox{$\geldm@cro{\sp@l}{\number\csname +FCtot@\romannumeral\FCsc@l\endcsname}$}% \ifdim\wd0>\csname FCwd@\romannumeral\FCsc@l\endcsname \global\csname FCwd@\romannumeral\FCsc@l\endcsname=\wd0 \fi \vbox{\hrule width \csname FCwd@\romannumeral\FCsc@l\endcsname -\vskip2pt +\vskip\s@mlinesep \hbox to \csname FCwd@\romannumeral\FCsc@l\endcsname{\hfil\unhbox0}}} -\def\aut@check{\ifodd\FCsc@l\else \count0=\@ne \count1=\FCsc@l - \divide\count1 by \tw@ \advance\count1 by \@ne - \loop - \ifnum\csname FCtot@\romannumeral\count0\endcsname= - \csname FCtot@\romannumeral\count1\endcsname\else - \message{^^JWarning: F-columns \number\count0 \space - and \number\count1 \space do not balance! }% - \fi - \ifnum\count1=\FCsc@l\else - \advance\count0 by\@ne \advance\count1 by\@ne - \repeat -\fi } -\def\checkfcolumns#1#2{\noalign{\ifnum\csname FCtot@\romannumeral#1 -\endcsname=\csname FCtot@\romannumeral#2\endcsname\else - \message{^^JWarning: F-columns #1 and #2 do not balance! }% -\fi}} +\def\leeg#1{$\egroup \let\e@fi=\relax #1} \def\res@tsumline{\FCsc@l=\FCtc@l\loop\ifnum\FCsc@l>0 \global\csname FCtot@\romannumeral\FCsc@l\endcsname=0 \global\csname FCwd@\romannumeral\FCsc@l\endcsname=\z@ - \advance\FCsc@l by \m@ne -\repeat} + \advance\FCsc@l by \m@ne\repeat} \def\resetsumline{\noalign{\res@tsumline}} +\def\aut@check{\ifx\@empty\FC@chklist\relax + \ifodd\FCsc@l\else + \count0=\@ne \count1=\FCsc@l + \divide\count1 by \tw@ + \loop\ifnum\count1<\FCsc@l + \advance\count1 by \@ne + \xdef\FC@chklist{\FC@chklist\number\count0,\number\count1;}% + \advance\count0 by\@ne + \repeat + \fi +\fi +\loop + \ifx\FC@chklist\@empty\let\FCs@gn=\@ne\else\let\FCs@gn=\m@ne\fi + \ifx\FCs@gn\m@ne + \expandafter\fre@t\FC@chklist\end + \ifnum\csname FCtot@\romannumeral\count0\endcsname= + \csname FCtot@\romannumeral\count1\endcsname\else + \PackageWarningNoLine{fcolumn}{F-columns \number\count0 \space + and \number\count1 \space do not balance}% + \fi +\repeat} +\def\fre@t#1,#2;#3\end{\count0=#1 \count1=#2 \xdef\FC@chklist{#3}} +\def\checkfcolumns#1#2{\noalign{\xdef\FC@chklist{\FC@chklist #1,#2;}}} \endinput %% %% End of file `fcolumn.sty'. |