diff options
author | Karl Berry <karl@freefriends.org> | 2022-02-02 21:40:02 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2022-02-02 21:40:02 +0000 |
commit | 318667b26e87038b4b703e3594bb740c2249d745 (patch) | |
tree | b014d77edc165777307793063521f61063b46cd8 /Master/texmf-dist/source | |
parent | e408dd8e486d9b4cf87601ee9674534a8e796475 (diff) |
fcolumn (2feb22)
git-svn-id: svn://tug.org/texlive/trunk@61855 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source')
-rw-r--r-- | Master/texmf-dist/source/latex/fcolumn/fcolumn.dtx | 595 | ||||
-rw-r--r-- | Master/texmf-dist/source/latex/fcolumn/fcolumn.ins | 6 |
2 files changed, 289 insertions, 312 deletions
diff --git a/Master/texmf-dist/source/latex/fcolumn/fcolumn.dtx b/Master/texmf-dist/source/latex/fcolumn/fcolumn.dtx index 26aaf7faff6..0aef28889c4 100644 --- a/Master/texmf-dist/source/latex/fcolumn/fcolumn.dtx +++ b/Master/texmf-dist/source/latex/fcolumn/fcolumn.dtx @@ -1,5 +1,5 @@ % \iffalse meta-comment -% Copyright (C) 2015--2021 by Edgar Olthof +% Copyright (C) 2015--2022 by Edgar Olthof % % This file may be distributed and/or modified under the % conditions of the LaTeX Project Public License, either @@ -14,13 +14,14 @@ % \fi % \iffalse %<package>\ProvidesPackage{fcolumn} -%<package> [2021/11/22 v1.4 Automatic Currency Package (EHTO)] +%<package> [2022/02/01 v1.4.1 Automatic Currency Package (EHTO)] %<package>\NeedsTeXFormat{LaTeX2e} %<package>\RequirePackage{array}[v2.4k] %<*driver> \documentclass{ltxdoc} -\usepackage{longtable} -\usepackage{fcolumn} +\usepackage{longtable} +\usepackage{dcolumn} +\usepackage{fcolumn} \usepackage{booktabs} \usepackage[tableposition=top,aboveskip=0pt]{caption} \DeclareCaptionStyle{normal}{labelfont={rm,bf,small},textfont={rm,small},% @@ -40,7 +41,7 @@ indention=0pt,labelsep=colon,justification=raggedright} %</driver> % \fi % \RecordChanges -% \CheckSum{1292} +% \CheckSum{1200} % \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 % Lower-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 @@ -80,6 +81,8 @@ indention=0pt,labelsep=colon,justification=raggedright} % backwards compatible to~1.2: it only adds functionality.} % \changes{v1.4}{2021/11/21}{More robust version on the extra formatting information: alternative % formatting after the comma (if any), instead of additional information. Corrected a few typos.} +% \changes{v1.4.1}{2022/01/31}{Definition needed for longtable only if that package is loaded. +% General update, streamlining code. Excess digits silently ignored when all zero.} % \GetFileInfo{fcolumn.sty} % \DoNotIndex{\@@endpbox,\@@startpbox,\@acol,\@arstrut,\@arstrutbox,\@classiv,\@classz,\@depth} % \DoNotIndex{\@firstampfalse,\@firstamptrue,\@gobble,\@halignto,\@height,\@mkpream,\@ne,\@nextchar} @@ -121,16 +124,15 @@ indention=0pt,labelsep=colon,justification=raggedright} % People in the Anglo-Saxon world would rather code % |\newcolumntype{f}{F{,}{.}{3,2}{}}| for the same input, yielding % $12{,}345{.}67$ as output for the number given above. The default -% value for |#3| is |3,2|, indicating -% that grouping of the integer part is by three digits, that a comma is -% used in the \TeX-source to indicate the decimal separator, and that -% the decimal part consists of two digits. -% If however, in your country or company grouping is done with a thinspace every -% four digits, that the separator in the source should be the character |p|, -% and there are three digits after the decimal mark---that happens to be a -% |\cdot|---, then simply specify |\newcolumntype{f}{F{\,}{\cdot}{4p3}{}}| in -% that case. The input could be 123456p78 then, yielding $12{\,}3456{\cdot}780$ -% as output. +% value for |#3| is |3,2|, indicating that grouping of the integer +% part is by three digits, that a comma is used in the \TeX-source to +% indicate the decimal mark, and that the decimal part consists of +% two digits. However, if in your country or company grouping is done +% with a thinspace every four digits, that the decimal mark in the +% source should be the character |p|, and there are three digits after +% the decimal mark---that happens to be a |\cdot|---, then simply specify +% |\newcolumntype{f}{F{\,}{\cdot}{4p3}{}}| in that case. The input could +% be 123456p78 then, yielding $12{\,}3456{\cdot}780$ as output. % % By default two digits are used for the decimal part, so if you really % want no decimal digits (in that case of course also skipping the decimal @@ -153,10 +155,10 @@ indention=0pt,labelsep=colon,justification=raggedright} % \toprule % properties & \leeg{31 dec 2014} & debts & \leeg{31 dec 2014}\\ % \midrule -% house & 200000 & equity capital& 50000 \\ -% bank account & -603,23 & mortgage & 150000 \\ -% savings & 28000 \\ -% cash & 145,85 & profit & 27542,62 \\ +% house & 200000 & equity capital & 50000 \\ +% bank account & -603,23 & mortgage & 150000 \\ +% savings & 28000 \\ +% cash & 145,85 & profit & 27542,62 \\ % \sumline % \bottomrule % \end{tabular} @@ -174,10 +176,10 @@ indention=0pt,labelsep=colon,justification=raggedright} %\toprule %properties & \leeg{31 dec 2014} & debts & \leeg{31 dec 2014}\\ %\midrule -%house & 200000 & equity capital& 50000 \\ -%bank account & -603,23 & mortgage & 150000 \\ -%savings & 28000 \\ -%cash & 145,85 & profit & 27542,62 \\ +%house & 200000 & equity capital & 50000 \\ +%bank account & -603,23 & mortgage & 150000 \\ +%savings & 28000 \\ +%cash & 145,85 & profit & 27542,62 \\ %\sumline %\bottomrule %\end{tabular} @@ -192,8 +194,8 @@ indention=0pt,labelsep=colon,justification=raggedright} % package~\cite{booktabs} was used, but that is not the point here. % % This package is heavily inspired by the |dcolumn| package by -% David Carlisle~\cite{dcolumn}, some constructions are more or less -% copied from that package. Version~1.4 (this version) incorporates the idea +% David Carlisle~\cite{dcolumn}; some constructions are more or less +% copied from that package. From version~1.3 onwards it incorporates the idea % of Christian Hoff of providing additional (formatting) information per column. % A rather contrived example is given in Table~\ref{tab:ex3}, combining colour and fonts. % \newcolumntype{q}[1]{F{.}{,}{3,2}{#1}} @@ -205,10 +207,10 @@ indention=0pt,labelsep=colon,justification=raggedright} % \toprule % properties & \leeg{31 dec 2014} & debts & \leeg{31 dec 2014}\\ % \midrule -% house & 200000 & equity capital& 50000 \\ -% bank account & -603,23 & mortgage & 150000 \\ -% savings & 28000 \\ -% cash & 145,85 & profit & 27542,62 \\ +% house & 200000 & equity capital & 50000 \\ +% bank account & -603,23 & mortgage & 150000 \\ +% savings & 28000 \\ +% cash & 145,85 & profit & 27542,62 \\ % \sumline % \bottomrule % \end{tabular} @@ -225,7 +227,7 @@ indention=0pt,labelsep=colon,justification=raggedright} %\begin{tabular}{@{}lq{\color{red}\mathsf,\mathbf}lq{\color{green}}@{}} %\multicolumn4c{\bfseries Balance sheet}\\ %... -%...(same financial contents as in Table 1) +%... (Same financial contents as in Table 1.) %... %\end{tabular} %\end{table} @@ -234,13 +236,13 @@ indention=0pt,labelsep=colon,justification=raggedright} % The font changing commands like |\mathsf| and |\mathbf| act on an argument, hence require % braces, but these are already provided internally for this purpose. For that reason this % type of commands must be given last, without braces (and if you don't specify a font -% changing command, these extra internal braces are just redundant). The argument to the +% changing command, these extra internal braces are just redundant). The fourth argument to the % new columntype may consist of two parts, separated by a comma. In that case, the part to % the left of the comma is applied to the data entered by the user and the right part % is applied to the result. The example in Table~\ref{tab:ex3} shows this: the bold font -% is only used in the |\sumline| and also the colour is back to the default (black). If -% you want formatting for the whole column, like green colour as in the last column of -% Table~\ref{tab:ex3}, leave out the comma. +% is only used in the |\sumline| and there is no colour specification, so that's back to +% the default (black). If you want formatting for the whole column, like green colour as +% in the last column of Table~\ref{tab:ex3}, leave out the comma. % % Note that changes in font size, e.g., ``|\huge|'' in ``|\huge\color{red}\mathbf|'' % as parameter to column type |q| are ignored by \LaTeX, since the formatting @@ -266,18 +268,21 @@ indention=0pt,labelsep=colon,justification=raggedright} %\midrule %\endfirsthead %\caption[]{\textit{(continued from previous page)\/}}\\ -%\midrule +%\toprule %properties & \leeg{31 dec 2014} & debts & \leeg{31 dec 2014}\\ %\midrule %\endhead +%\bottomrule %\multicolumn4{r@{}}{\small\textit{(Table continues on next page)\/}}\\ -%\midrule %\endfoot %\bottomrule %\endlastfoot +%house & 200000 & equity capital & 50000 \\ %... -%...(somewhat altered financial contents as in Table 1) +%... (Somewhat altered financial contents compared to +%... Table 1 to demonstrate the page break.) %... +%\sumline %\end{longtable} % \end{verbatim} % \end{table} @@ -295,35 +300,27 @@ indention=0pt,labelsep=colon,justification=raggedright} % \midrule % \endfirsthead % \caption[]{\textit{(continued from previous page)\/}}\\ -% \midrule +% \toprule % properties & \leeg{31 dec 2014} & debts & \leeg{31 dec 2014}\\ % \midrule % \endhead +% \bottomrule % \multicolumn4{r@{}}{\small\textit{(Table continues on next page)\/}}\\ -% \midrule % \endfoot % \bottomrule % \endlastfoot -% house & 200000 & equity capital& 50000 \\ -% bank account & -603,23 & mortgage & 150000 \\ -% savings 1 & 2000 \\ -% savings 2 & 2000 \\ -% savings 3 & 2000 \\ -% savings 4 & 2000 \\ -% savings 5 & 2000 \\ -% savings 6 & 2000 \\ -% savings 7 & 2000 \\ -% savings 8 & 2000 \\ -% savings 9 & 2000 \\ -% savings 10 & 2000 \\ -% savings 11 & 2000 \\ -% savings 12 & 2000 \\ -% savings 13 & 2000 \\ -% savings 14 & 2000 \\ -% cash & 145,85 & profit & 27542,62 \\ +% house & 200000 & equity capital & 50000 \\ +% bank account & -603,23 & mortgage & 150000 \\ +% savings 1 & 4000 \\ +% savings 2 & 4000 \\ +% savings 3 & 4000 \\ +% savings 4 & 4000 \\ +% savings 5 & 4000 \\ +% savings 6 & 4000 \\ +% savings 7 & 4000 \\ +% cash & 145,85 & profit & 27542,62 \\ % \sumline % \end{longtable} - % \section{Commands} % The user only needs to know six commands or constructions. These six are given here. % \begin{macro}{F} @@ -340,7 +337,7 @@ indention=0pt,labelsep=colon,justification=raggedright} % than just setting the input decimal mark. By default the input grouping % character is the dot, except when the dot is specified as input decimal % mark; in that case the comma is acting as input grouping character. With -% this convention the continental Europe and Anglo-Saxon part of the world +% this convention continental Europe and the Anglo-Saxon part of the world % is served. And using input grouping markers is optional anyway. % \end{macro} % \begin{macro}{\sumline} @@ -364,7 +361,7 @@ indention=0pt,labelsep=colon,justification=raggedright} % |\sumline|. Give, e.g., |\sumline[10pt]|, in case you want this spacing % to be 10\thinspace pt. And you may even give two options, like in % |\sumline[10pt][5pt]|, in which the second option is the extra space below -% the summary row. In fact that second option is the option to |\\| that is +% the summary row. In fact that second option is parsed to |\\|, that is % implicit in |\sumline|. % \end{macro} % \begin{macro}{\resetsumline} @@ -441,7 +438,7 @@ indention=0pt,labelsep=colon,justification=raggedright} % \end{macro} % \begin{macro}{\leeg} % If an |F|-column should be empty then simply leave it empty. If however -% it should not be empty but the entry should be treated as text---even +% it should not be empty but the entry should be treated as text---even % if it is a number---, this can be done with |\leeg|. It expects an % argument and this argument is typeset in the column. The common case is % where |p.m.| (\textit{pro memoria}) is entered. In contrast to v1.1.2 @@ -451,21 +448,21 @@ indention=0pt,labelsep=colon,justification=raggedright} % The automatic column balance check can also be done manually. If % |F|-columns~1 and~4 should balance and you want them to be checked, % then simply say |\checkfcolumns14|. With more than nine |F|-columns -% you may be forced to say something like |\checkfcolumns{10}{12}|. If +% you may be forced to say something like |\checkfcolumns{10}{12}|. If % |\checkfcolumns| is used, the automatic check is disabled. Multiple % |\checkfcolumns|s are supported; if |F|-columns~1, 2, and~3 should % balance, you specify |\checkfcolumns12| and |\checkfcolumns23|. % There is no explicit command to disable all checking, but -% |\checkfcolumns11| obviously also serves that purpose. +% |\checkfcolumns11| obviously does the trick. % \end{macro} % \begin{macro}{\ifstrict@ccounting} % In the rare occasion that a negative number occurs in a financial table, -% the sign of that number can be an explicit minus sign ($-$) or the number +% the sign of that number can be an explicit minus sign~($-$) or the number % is coloured red, or it is typeset between parentheses, and there may be % even other ways. By default (for aesthetic reasons) |fcolumn| typesets % it with a minus~sign, but strict accounting prescibes that the number % should be put between parentheses. The latter can be accomplished by -% setting |\strict@ccountingtrue|. But since this contains a non-letter, +% setting |\strict@ccountingtrue|, but since this contains a non-letter, % it is also possible to invoke |fcolumn| with the option |strict|, i.e., % |\usepackage[strict]{fcolumn}|, which sets this flag. % \end{macro} @@ -513,7 +510,7 @@ indention=0pt,labelsep=colon,justification=raggedright} % an amount expressed in cents (dollar cents, euro cents, centen, Pfennige, % centimes, kopecks, groszy) and typesets it as the amount in entire % currency units (dollars, euros, guldens, Marke, francs, rubles, z\l oty) -% with comma as decimal separator and the dot as grouping character +% with comma as decimal mark and the dot as grouping character % (thousand separator if the first part of |#1| is~3). % As explained, this can be changed. It uses two private booleans: % |\withs@p| and |\strict@ccounting|. The latter is used to typeset @@ -536,14 +533,14 @@ indention=0pt,labelsep=colon,justification=raggedright} % are always used within |$|s, so it is really a minus sign that is printed, not a hyphen. % All calculations are done with |\count0|, |\count1|, etc.\ i.e., without |F|-column-specific % \meta{count}s because it is all done locally. Leaving the tabular environment will -% restore their values. This is also true for the effect of |\FCform@t|, so that formatting -% information is local to this column. The reason for inserting the opening brace between -% |\FCform@t| and |\ifnum| (and the accompanying closing brace after |\fi|) is to facilitate -% the possible use of |\mathbf| or any other font changing command as the last item in |\FCform@t|. +% restore their values. This is also true for the effect of |\FCform@t|, so that +% formatting information is local to this column. The reason for inserting the |{| +% between |\FCform@t| and |\ifnum| (and the accompanying |}| just before finishing +% this definition) is to facilitate the possible use of |\mathbf| or any other font +% changing command as the last item in |\FCform@t|. % \begin{macrocode} -\def\g@ldm@cro#1\relax#2{\FCform@t{\ifnum#2<0 \ifstrict@ccounting (\else - -\fi \count2=-#2 \else\count2=#2 -\fi +\def\g@ldm@cro#1\relax#2{\FCform@t{\ifnum#2<0 \ifstrict@ccounting + (\else -\fi \count2=-#2 \else\count2=#2 \fi % \end{macrocode} % Calculate the entire currency units: this is the result of $x/a$ as integer % division, with $a=10^n$ and $n$ the part of |#1| after the separator (if any). @@ -613,7 +610,7 @@ indention=0pt,labelsep=colon,justification=raggedright} % |\count0| locally. This also implies that tail recursion is not % possible here, but that is not very important, as the largest number % (which is $2^{31}-1$) will only cause a threefold recursion using the -% default |3,2| (ninefold when using |1,0|, but who does that?). The +% default |3,2| (ninefold when using~|1,0|, but who does that?). The % largest amount this package can deal with is therefore 2.147.483.647 % (using |3,0|). For most people this is probably more than enough if % the currency is euros or dollars. And otherwise make clear that you @@ -623,8 +620,8 @@ indention=0pt,labelsep=colon,justification=raggedright} % would lead to a maximum of slightly more than 92.2\thinspace P\EUR{}; % about 100 times the current world economy~\cite{world_economy}. Yet % another method is to use Heiko Oberdiek's package |bigintcalc|: -% then only memory restrictions apply. This, however, requires a major -% rewrite of |fcolumn|. For now, version~1.4 sticks to the moderate amounts. +% then only memory restrictions apply. This, however, would require +% a major rewrite of |fcolumn|. % % There is no straightforward interpretation of |#1| being zero or % negative, therefore this is used as an indicator that no grouping @@ -705,7 +702,7 @@ indention=0pt,labelsep=colon,justification=raggedright} % First it checks whether there is a risk of overflow in this step. If % $A$ and $B$ are two \TeX-registers and $B$ is to be added to $A$, % overflow will not occur if one is (or both are) zero or if $A$ and~$B$ -% have different signs. Otherwise, be careful. Note that \TeX\ does not +% have different signs; otherwise be careful. Note that \TeX\ does not % check for overflow when performing an |\advance| (done in section~1238 % of Ref.~\cite{CandTB}), in contrast to |\multiply|, see section~105. % \begin{macrocode} @@ -722,9 +719,9 @@ indention=0pt,labelsep=colon,justification=raggedright} \global\advance\csname FCtot@\romannumeral\FCsc@l\endcsname by \count0 \ifx\FCs@gn\m@ne % \end{macrocode} -% They had the same sign: risk of overflow. Record the sign -% of |\count0| (and of the original total of this column; they were -% the same) in |\FCs@gn|. Table~\ref{tab:ex9} +% They have the same sign, hence risk of overflow. Record the sign +% of |\count0| (and of the original total of this column; we just established +% they were the same) in |\FCs@gn|. Table~\ref{tab:ex9} % \begin{table}[htb] % \def\PackageError#1#2#3{\PackageWarning{#1}{#2: #3}} % \caption{Examples on overflow.} @@ -735,8 +732,9 @@ indention=0pt,labelsep=colon,justification=raggedright} % income & \leeg{31 dec 2014} & \leeg{31 dec 2015} & \leeg{31 dec 2016} \\ % \midrule % item~1 & 20000000 & 20000000 &20000000 \\ -% item~2 & 10000000 & 2000000 &-2000000 \\ -% item~3 & 5000000 & -2000000 & 2000000 \\ +% item~2 & 10000000 & 2000000 &-1500000 \\ +% item~3 & 5000000 & -1500000 & 2000000 \\ +% \checkfcolumns12 % \checkfcolumns23 % \sumline % \bottomrule @@ -750,18 +748,19 @@ indention=0pt,labelsep=colon,justification=raggedright} % is correct in the end. Nevertheless, it is advised to swap the two % items that caused the overflow, as shown in the right |F|-column. % -% Since the absolute value of |\FCs@gn| is unity, no overflow will -% occur in the multiplication step below. +% Check that the sign of the updated column total is still correct. +% If so, |\FCs@gn| is reset (to |\@ne|) at the end of this chunk. % \begin{macrocode} \ifnum\count0>0 \let\FCs@gn\@ne \fi \count0=\csname FCtot@\romannumeral\FCsc@l\endcsname - \multiply\count0 by \FCs@gn + \ifnum\FCs@gn<0 \count0=-\count0 \fi \ifnum\count0<0 \let\FCs@gn=\m@ne \PackageError{fcolumn}{Register overflow}{Overflow occurred - in fcolumn \number\FCsc@l. You can press <enter> now and I'll - proceed,\MessageBreak but check your table. The offending entry is - indicated with an exclamation\MessageBreak mark in the output.}% + in fcolumn \number\FCsc@l.\MessageBreak You can press <enter> + now and I'll proceed, but check\MessageBreak your table. The + offending entry is indicated with an\MessageBreak exclamation + mark in the output.}% \else\let\FCs@gn=\@ne \fi \fi @@ -775,7 +774,7 @@ indention=0pt,labelsep=colon,justification=raggedright} % \end{macrocode} % \end{macro} % -% The \meta{count}s |\FC@l| and |\FC@r| capture the part to the left and to the +% The \meta{count}s |\FC@l| and |\FC@r| capture the parts to the left and to the % right of the decimal mark, respectively. % \begin{macrocode} \newcount\FC@l \newcount\FC@r @@ -786,6 +785,22 @@ indention=0pt,labelsep=colon,justification=raggedright} \def\assignform@t#1,#2,#3\assignform@t{\def\FCform@t{#1}% \def\FCform@tt{#2}\ifx\FCform@tt\@empty \def\FCform@tt{#1}\fi} % \end{macrocode} +% \begin{macro}{\m@thcodeswitch} +% As will be shown below, once the first digit, or sign, or decimal mark, or +% grouping character is scanned, the decimal digits should loose their +% activeness. That is done here for the digits in a rather blunt way, by putting their +% |\mathcode|s to zero if |#1| equals~0, since the actual |\mathcode| is not important---as +% long as it is not |"8000|---because the digits are not used for typesetting. +% (And even if they were; it's inside |\box0|, whose contents will be discarded.) +% When the |$| in |\e@fi| is encountered, the digits get back their original +% |\mathcode|s so that the actual typesetting in |\zetg@ld| is correct again. +% With a non-zero |#1| the activeness is switched on. +% \begin{macrocode} +\def\m@thcodeswitch#1{\count0=10 \loop\ifnum\count0>0 +\advance\count0 by \m@ne\mathcode\expandafter`\the\count0= +\ifnum#1=0 0 \else "8000 \fi\repeat} +% \end{macrocode} +% \end{macro} % \def\<#1>{\leavevmode\hbox{$\langle$#1\/$\rangle$}} % \begin{macro}{\b@fi} % The macro |\b@fi| provides the beginning of the financial column. It @@ -800,10 +815,9 @@ indention=0pt,labelsep=colon,justification=raggedright} % An intermediate macro |\sep@xt| to extract the first character % of |#1|, which in most cases will be the only character. % \begin{macrocode} -\def\sep@xt##1##2\end{\def\sep@rator{{##1}}}% -\sep@xt#1\end\def\decim@lmark{{#2}}% -\def\sp@l{#3}\assignform@t#4,,\assignform@t\global\advance\FCsc@l by - \@ne \global\FC@l=0 \global\FC@r=1 +\def\sep@xt##1##2\end{\def\sep@rator{{##1}}}\sep@xt#1\end +\def\decim@lmark{{#2}}\def\sp@l{#3}\assignform@t#4,,\assignform@t +\global\advance\FCsc@l by \@ne\global\FC@l=0 \global\FC@r=1 % \end{macrocode} % The value specified by the user is then captured by |\FC@l| and % this is done in a special way: |\FC@l| is assigned globally within @@ -817,12 +831,13 @@ indention=0pt,labelsep=colon,justification=raggedright} % \<integer constant>. Here \<sign> is a plus or minus character with % category code~12, \<integer constant> is a sequence of zero % or more (decimal) \<digit>s, and \<decimal mark> is the middel -% part of |#3|, i.e., the comma in |3,2| or the period in |3.2|. -% If the \<decimal mark> is absent with no space characters between -% the two \<integer constant> terms, these merge, making four redundant -% entries. One of the combinations is \<empty>, a sequence of exactly -% zero non-space tokens: this is the only combination that doesn't put -% anything in an |F|-column---and was the most difficult part to handle. +% part of |#3|, i.e., the comma in |3,2| or the period in |3.2|. If +% the \<decimal mark> is absent with no space characters between the +% two \<integer constant> terms, these merge, making four redundant +% entries. One of the combinations is \<empty>, a sequence of characters +% outside the ones that are made active, e.g., plain text or nothing at all: +% this is the only combination that doesn't put anything in an |F|-column---and +% was the most difficult part to handle. % % The minus sign must be captured separately, because in an entry like % |-0,07| the 7~cents are negative, but this cannot be seen from the @@ -831,22 +846,16 @@ indention=0pt,labelsep=colon,justification=raggedright} % |\ifnum-0<0| yields |false|. |\FCs@gn| is a general purpose flag. Its % first use is to capture the sign. % \begin{macrocode} -\let\FCs@gn=\@ne\relax \setbox0\hbox\bgroup$% +\let\FCs@gn=\@ne\relax \setbox0\hbox\bgroup$ % \end{macrocode} -% Do the scan inside a box and inside math mode. Start with -% defining all characters that may appear as the first one in an |F|-column -% as active. +% Do the scan inside a box and inside math mode. Start with defining all +% characters that may appear as the first one in an |F|-column as active; +% digits first. This needs a complicated |\edef| with accompanying |\noexpand| +% because the starting digit for |\FC@l| must be packed inside each definition. % \begin{macrocode} -\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} +\count@=10 \loop\ifnum\count@>0 \advance\count@ by \m@ne + \uccode`\~=\expandafter`\the\count@ \uppercase{\edef~}{\noexpand + \m@thcodeswitch0 \global\FC@l=\the\count@}\repeat % \end{macrocode} % For the input decimal mark something extra is needed: if it is the % first character in an |F|-column (like in |,07|), it should also @@ -854,14 +863,14 @@ indention=0pt,labelsep=colon,justification=raggedright} % is the first is easy, since in that case the |\mathcode|s of the % decimal digits is still |"8000|. The assignment to |\FC@r| starts % with~1, so that appended digits get captured correctly, even if they -% start with~0. Postprocessing of |\FC@r| is done in |\e@fi|. +% start with~0; postprocessing of |\FC@r| is done in |\e@fi|. % The input decimal mark switches itself off as active character, -% so at most one input decimal separator is allowed (N.B.: +% so at most one input decimal mark is allowed (N.B.: % this makes sense). % \begin{macrocode} \def\deactdecm@rk##1##2\relax{\mathcode`##1=0 }% \afterassignment\setucc@de\count@#3\relax -\uppercase{\def~}{\ifnum\mathcode`\0=\mathcode`- \restorem@thcodes\fi +\uppercase{\def~}{\ifnum\mathcode`\0="8000 \m@thcodeswitch0 \fi \afterassignment\deactdecm@rk\count@#3\relax \global\FC@r=1}% % \end{macrocode} % The input grouping character effectively expands to ``nothing, i.e., @@ -872,14 +881,14 @@ indention=0pt,labelsep=colon,justification=raggedright} % input decimal mark was encountered; that can be checked by looking % at its |\mathcode|. % -% The input grouping character is the dot |.|, except when that character +% The input grouping character is the dot ``|.|'', except when that character % was already chosen as input decimal mark. In that case, the grouping -% character will be the comma. This is easy to check because the |\uccode| +% character will be the comma. This is easy to check because the |\uccode| % of |`\~| is still preserved. % \begin{macrocode} \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 +\uppercase{\def~}{\ifnum\mathcode`\0="8000 \m@thcodeswitch0 \fi \afterassignment\d@cm\count@#3\relax % \end{macrocode} % The |\expandafter| below is necessary because the global assignment @@ -892,37 +901,28 @@ indention=0pt,labelsep=colon,justification=raggedright} % needed (it should be: a minus sign between digits screws up everything), % and start scanning the number. % \begin{macrocode} -\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}% +\uccode`\~=`+\relax \uppercase{\def~}{\ifnum\mathcode`\0="8000 +\m@thcodeswitch0 \fi\global\FC@l=0} +\uccode`\~=`-\relax \uppercase{\def~}{\ifnum\mathcode`\0="8000 +\m@thcodeswitch0 \fi\global\let\FCs@gn\m@ne \global\FC@l=0}% % \end{macrocode} -% Now actually activate all these codes. The first is simple, but -% after that, one can't say |"8000| anymore because |0| acts as active. -% But copying |\mathcode|s still works. +% Now actually activate all these codes. % \begin{macrocode} -\mathcode`-="8000 \mathcode`+=\mathcode`- \mathcode`.=\mathcode`- +\mathcode`-="8000 \mathcode`+="8000 \mathcode`.="8000 % \end{macrocode} % These three remain active until the |$| in |\e@fi| is encountered. % The following ones will, except in the \<empty> case, have their activeness % turned off at some time. % \begin{macrocode} -\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`- } +\m@thcodeswitch1 \def\actdecm@rk##1##2\relax{% +\ifx##1.\relax \mathcode`,="8000 \else \mathcode`##1="8000 \fi}% +\afterassignment\actdecm@rk\count@#3\relax} % \end{macrocode} % \end{macro} % \begin{macro}{\e@fi} % If the digits are still active then either nothing was entered or only % characters that did not deactivate the digits were entered. In -% either case the output should be \<empty>. To flag this outside +% both cases the output should be \<empty>. To flag this outside % the group that started with the opening |$| of |\b@fi|, |\FC@r| is set % globally to a negative value. This doesn't harm, because it didn't % contain relevant information anyway. Outside the group, the sign @@ -930,7 +930,7 @@ indention=0pt,labelsep=colon,justification=raggedright} % |\count|, but now it's documented. In effect, |\FC@r| can only be~|-1|, % |1|, or at least~|10|, so the comparison |\ifnum\FC@r>0| does not miss~0. % \begin{macrocode} -\def\e@fi{\ifnum\mathcode`\0=\mathcode`- \global\FC@r=\m@ne\fi$\egroup +\def\e@fi{\ifnum\mathcode`\0="8000 \global\FC@r=\m@ne\fi$\egroup \ifnum\FC@r>0 % \end{macrocode} % If there was no decimal mark or if there was a decimal mark but no @@ -941,22 +941,41 @@ indention=0pt,labelsep=colon,justification=raggedright} % \end{macrocode} % Next is a loop for bringing the decimal part in the correct way to % the integer part. The loop is performed the number of decimal -% digits to be printed (the~2 in |3,2| of the default setting). This also -% means that if you provided more decimal digits than this, the excess -% digit(s) will not be handled and a |\PackageWarning| will be given, -% showing these excess digits. This is truncation, not rounding! -% There is one situation in which this code doesn't catch all: -% when exactly one extra zero was provided. And in that case truncation -% is a no-op. +% digits to be printed (the~2 in |3,2| of the default setting). % \begin{macrocode} \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 + \expandafter\secd@xt\number\FC@r\secd@xt \advance\count0 by \m@ne \repeat - \ifnum\FC@r>10 +% \end{macrocode} +% This also means that if you provided more decimal digits than this, the excess +% digit(s) will not be handled. This is truncation, not rounding! If all +% truncated digits are zero, this truncation is a no-op and they are silently ignored, +% see the example Table~\ref{tab:ex10}, +% \begin{table}[htb] +% \newcolumntype{d}{D{,}{,}{-1}} +% \caption{Truncating excess digits.} +% \label{tab:ex10} +% \begin{tabular}{@{}ldfl@{}} +% \toprule +% composer & \multicolumn1c{raw entry} & \leeg{debt} & remark \\ +% \midrule +% Berg & 123,450 & 123,450 & ``0'' silently ignored \\ +% Eisler & 234,567 & 234,567 & ``7'' ignored with warning \\ +% Sch\"onberg & 345,6709 & 345,6709 & ``09'' ignored with warning \\ +% Webern & 2,3456 & 2,3456 & ``56'' ignored with warning \\ +% \sumline +% \bottomrule +% \end{tabular} +% \end{table} +% that was created with |@{}ldfl@{}| (|d| for centering on the decimal +% mark~\cite{dcolumn}) as tabular key. If, however, at least one of them is +% not zero, a |\PackageWarning| will be given, showing the excess digit(s). +% \begin{macrocode} + \ifnum\expandafter\@gobble\number\FC@r>0 \def\tw@l##1##2\relax{##2} - \PackageWarning{fcolumn}{Excess digit\ifnum\FC@r>100 s\fi\space + \PackageWarning{fcolumn}{Excess digit\ifnum\FC@r>19 s\fi\space ``\expandafter\tw@l\number\FC@r\relax'' in decimal part \MessageBreak ignored near or} \fi @@ -974,72 +993,48 @@ indention=0pt,labelsep=colon,justification=raggedright} % The second digit from the left is needed from a string of characters % representing a decimal number. The macro |\secd@xt| extracts that digit, % provided that the number has at least two digits, but that is guaranteed by -% |\e@fi|. That second digit is then added to |\FC@l|. A new number is -% assigned to |\FC@r|, that consists of the digits of |#1#3|. If |#3| was -% empty, 10 is assigned. In this way |\FC@r| is prepared for insertion in -% the next invocation of |\secd@xt|. In iterating: 1234 yields~134, yields~14, -% yields~10, stays~10, etc. +% |\e@fi|. That second digit is then added to |\FC@l|. +% A new number is assigned to |\FC@r|, that consists +% of the digits of |#1#3|. If |#3| was empty, 10 is assigned. In this way +% |\FC@r| is prepared for insertion in the next invocation of |\secd@xt|. +% In iterating: 1234 yields~134, yields~14, yields~10, stays~10, etc. % \begin{macrocode} -\def\secd@xt#1#2#3\end{\advance\FC@l by #2 +\def\secd@xt#1#2#3\secd@xt{\advance\FC@l by #2 \FC@r=#1#3 \ifnum\FC@r=1 \FC@r=10 \fi} % \end{macrocode} % \end{macro} -% \begin{macro}{\restorem@thcodes} -% As shown above, once the first digit, or sign, or decimal separator, or -% grouping character is scanned, the decimal digits should loose their -% activeness. That is done here in a rather blunt way, since the actual -% |\mathcode| is not important---as long as it is not |"8000|---because -% the digits are not used for typesetting (and even if they were; it's -% inside |\box0|, whose contents will be discarded). When the |$| -% in |\e@fi| is encountered, the digits get back their original -% |\mathcode|s so that the actual typesetting in |\zetg@ld| is -% correct again. -% \begin{macrocode} -\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 } -% \end{macrocode} -% \end{macro} % \subsection{Adaptations to existing macros} % \begin{macro}{\@array} % The definition of |\@array| had to be extended slightly because it should % also include |\@mksumline| (acting on the same |#2| as |\@mkpream| gets). % This change is transparant: it only adds functionality and if you don't % use that, you won't notice the difference. It starts by just copying the -% original definition from v2.4k of the |array| package~\cite{array}. +% original definition from v2.4k of the |array| package~\cite{array}, +% compacted. % \begin{macrocode} -\def\@array[#1]#2{% -\@tempdima \ht \strutbox -\advance \@tempdima by\extrarowheight -\setbox \@arstrutbox \hbox{\vrule - \@height \arraystretch \@tempdima - \@depth \arraystretch \dp \strutbox - \@width \z@}% +\def\@array[#1]#2{\@tempdima\ht\strutbox\advance\@tempdima by + \extrarowheight\setbox\@arstrutbox\hbox{\vrule\@height\arraystretch + \@tempdima\@depth\arraystretch\dp\strutbox\@width\z@}% % \end{macrocode} % Here comes the first change: after each |\\| (or |\cr| for that matter) % the \meta{count} |\FCsc@l| should be reset. This is easiest done with % |\everycr|, but |\everycr| is put to |{}| by |\ialign|, so that definition % should change. The resetting should be done globally. % \begin{macrocode} -\def\ialign{\everycr{\noalign{\global\FCsc@l=0 }}% - \tabskip\z@skip\halign} +\def\ialign{\everycr{\noalign{\global\FCsc@l=0 }}\tabskip\z@skip\halign} % \end{macrocode} % Then the definition is picked up again. % \begin{macrocode} -\begingroup -\@mkpream{#2}% -\xdef\@preamble{\noexpand \ialign \@halignto +\begingroup\@mkpream{#2}\xdef\@preamble{\noexpand\ialign\@halignto \bgroup\@arstrut\@preamble\tabskip\z@\cr}% \endgroup % \end{macrocode} -% The combination |\endgroup| followed by |\begingroup| seems redundant, -% but that is not the case: the |\endgroup| restores everything that was -% not |\global|. With the following |\begingroup| it is ensured that -% |\@mksumline| experiences the same settings as |\@mkpream| did. +% The combination |\endgroup| in the previous chunk followed by |\begingroup| +% in the next chunk seems redundant, but that is not the case: the |\endgroup| +% restores everything that was not |\global|. With the following |\begingroup| +% it is ensured that |\@mksumline| experiences the same settings as |\@mkpream| did. % \begin{macrocode} -\begingroup -\@mksumline{#2}% -\endgroup +\begingroup\@mksumline{#2}\endgroup % \end{macrocode} % As a side product of |\@mksumline| also the \meta{count}s for the totals % and \meta{dimen}s for the widths of the colums are created. The columns @@ -1049,14 +1044,9 @@ indention=0pt,labelsep=colon,justification=raggedright} % \end{macrocode} % From here on it is just the old definition of |array.sty|. % \begin{macrocode} -\@arrayleft -\if #1t\vtop \else \if#1b\vbox \else \vcenter \fi \fi -\bgroup -\let \@sharp ##\let \protect \relax -\lineskip \z@ -\baselineskip \z@ -\m@th -\let\\\@arraycr \let\tabularnewline\\\let\par\@empty \@preamble} +\@arrayleft\if #1t\vtop\else\if#1b\vbox\else\vcenter\fi\fi\bgroup +\let\@sharp ##\let\protect\relax\lineskip\z@\baselineskip\z@ +\m@th \let\\\@arraycr \let\tabularnewline\\\let\par\@empty \@preamble} % \end{macrocode} % Because |\@array| was changed here and it is this version that should % be used, |\@@array| should be |\let| equal to |\@array| again. @@ -1072,11 +1062,11 @@ indention=0pt,labelsep=colon,justification=raggedright} % is grammatically correct because it has already been screened by |\@mkpream|. % Furthermore, most entries will simply add nothing to |\s@ml@ne|, e.g., |@|, |!|, % and \verb+|+ can be fully ignored. Ampersands are only inserted by |c|, |l|, |r|, -% |p|, |m|, and |b|. So a specifier like |@{}lflf@{}| will yield the sumline -% |&\a&&\a\\|, (where |\a| is a macro that prints the desired result of the column, -% see below). Had the specifier been \verb+l|f||@{ }l|f+, then the same sumline must -% be constructed: all difficulties are already picked up and solved in the creation -% of the preamble. +% |p|, |m|, and |b|. So, if |\a| is a macro that prints the desired result of the +% column (see below), then a specifier like |@{}lflf@{}| will yield the sumline +% |&\a&&\a\\|. Had the specifier been \verb+l|f||@{ }l|f+, then the same +% sumline must be constructed: all difficulties are already picked up and +% solved in the creation of the preamble. % % In reality the sumline must be constructed from the expanded form of the % specifier, so |@{}lf@{}| will expand as @@ -1089,9 +1079,10 @@ indention=0pt,labelsep=colon,justification=raggedright} % \item ignore everything else; % \item close with a |\\|. % \end{compactitem} -% (In reality also the column check is inserted just before the |\\|, see -% |\aut@check|.) To discriminate, a special version of |\@testpach| could -% be written, but that is not necessary: |\@testpach| can do all the work, +% (For completeness' sake it should be mentioned that prior to the |\\| also the column +% check is inserted, see |\aut@check|.) +% To discriminate, a special version of |\@testpach|~\cite{array} +% could be written, but that is not necessary: |\@testpach| can do all the work, % although much of it will be discarded. Here speed is sacrificed for space % and this can be afforded because the creation of the sumline is done only % once per |\tabular| or |\longtable|. @@ -1108,9 +1099,8 @@ indention=0pt,labelsep=colon,justification=raggedright} % \end{macrocode} % Then |\@mkpream| is picked up again. % \begin{macrocode} -\@temptokena{#1}\@tempswatrue -\@whilesw\if@tempswa\fi{\@tempswafalse\the\NC@list}% -\count0\m@ne\let\the@toks\relax\prepnext@tok +\@temptokena{#1}\@tempswatrue\@whilesw\if@tempswa\fi{\@tempswafalse +\the\NC@list}\count0\m@ne\let\the@toks\relax\prepnext@tok % \end{macrocode} % Next is the loop over all tokens in the expanded form of the specifier. The change % with respect to |\@mkpream| is that the body of the loop is now only dealing @@ -1118,11 +1108,9 @@ indention=0pt,labelsep=colon,justification=raggedright} % what to do when constructing the preamble, so special definitions are created, see % below. % \begin{macrocode} -\expandafter \@tfor \expandafter \@nextchar - \expandafter :\expandafter =\the\@temptokena \do - {\@testpach - \ifcase \@chclass \@classfz \or \or \@classfii \or \or \or \or \or - \or \or \or \@classfx \fi\@lastchclass\@chclass}% +\expandafter\@tfor\expandafter\@nextchar\expandafter:\expandafter=\the +\@temptokena\do{\@testpach\ifcase\@chclass\@classfz\or\or\@classfii\or +\or\or\or\or\or\or\or\@classfx\fi\@lastchclass\@chclass}% % \end{macrocode} % And the macro is finished by applying the |\aut@check| and appending the % |\\| to the sumline. Note that the |\aut@check| is performed {\itshape @@ -1149,9 +1137,9 @@ indention=0pt,labelsep=colon,justification=raggedright} % \end{macrocode} % \end{macro} % \begin{macro}{\@classfz} -% Class~f0 is applicable for specifiers |c|, |l|, and |r|, and if the arguments of |p|, -% |m|, or |b| are given. The latter three cases, with |\@chnum| is 0, 1, or~2 should be -% ignored and the first three cases are now similar to class~f10. +% Class~f0 is applicable for specifiers |c|, |l|, and |r|, and if the arguments +% of |p|, |m|, or |b| are given. The latter three cases, with |\@chnum| is 0, +% 1, or~2 should be ignored and the first three cases are now similar to class~f10. % \begin{macrocode} \def\@classfz{\ifnum\@chnum<\thr@@ \@classfx\fi} % \end{macrocode} @@ -1170,14 +1158,15 @@ indention=0pt,labelsep=colon,justification=raggedright} \edef\t@stn{\string\e@fi} \ifx\t@stm\t@stn % \end{macrocode} -% If both tests yield |true|, i.e., we encountered a |<{\e@fi}| where we expect one to -% find, then add the macro to typeset everything. +% If both tests yield |true|, i.e., we encountered a |<{\e@fi}| where we expect +% one to find, then add the macro to typeset everything. % \begin{macrocode} \@addtosumline{\prr@sult} % \end{macrocode} -% But we're not done yet: in the following lines of code the appropriate \meta{count}s and -% \meta{dimen}s are created, if necessary. Note that |\FCsc@l| was set to~0 in the -% beginning of |\@mksumline|, so it is well-defined when |\@classfii| is used. +% But we're not done yet: in the following lines of code the appropriate +% \meta{count}s and \meta{dimen}s are created, if necessary. Note that +% |\FCsc@l| was set to~0 in the beginning of |\@mksumline|, so it is +% well-defined when |\@classfii| is used. % \begin{macrocode} \global\advance\FCsc@l by \@ne \ifnum\FCsc@l>\FCtc@l @@ -1217,7 +1206,7 @@ indention=0pt,labelsep=colon,justification=raggedright} \else \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>, + 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 @@ -1250,8 +1239,8 @@ indention=0pt,labelsep=colon,justification=raggedright} % \end{macrocode} % Then the information for the last line is computed. It is not sufficient % to calculate the width of the result (in points) to use that as the width -% of the rule separating the individual entries and the result. It may be -% that the sum is larger (in points) than any of the entries, e.g., when the +% of the rule separating the individual entries and the result. It may happen +% that the sum is wider (in points) than any of the entries, e.g., when the % result of $6+6$ (using specifier~|3,2|) is typeset. The width of the rule % should be equal to the width of |\hbox{$12{,}00$}| then. On the other % hand the width of the rule when summing $24$ and $-24$ should be that of @@ -1283,17 +1272,18 @@ FCtot@\romannumeral\FCsc@l\endcsname}$}% % a number in the table, e.g., |\leeg{p.m.}|, this definition is without % at-sign. By defining |\leeg| in this way, instead of |\multicolumn1r{}| % (which contains |\omit|), the default spacing in the column is retained. -% It has its normal effect on the column width, but doesn't alter the -% width of the sumrule. +% It doesn't alter the width of the sumrule, but has its normal effect on +% the column width, so be careful: don't insert the unabridged version of +% Romeo and Juliet~\cite{RJ} here. It is not typeset in math mode, nor +% does it use the extra (formatting) information of |#4| of the fcolumn, +% so you're completely free here. % \begin{macrocode} \def\leeg#1{$\egroup \let\e@fi=\relax #1} % \end{macrocode} % Note that anything may be given as argument to |\leeg|, so in principle -% it can also be used to cheat: |\leeg{0,03}| will insert |0,03| in the -% table but it doesn't increase the totals of that column by~3 (assuming -% |3,2| coding for the separations). But you won't cheat, won't you? -% It may affect the width, so be careful: don't insert the unabridged -% version of Romeo and Juliet~\cite{RJ} here. +% it can also be used to cheat: |\leeg{0,03}| will insert the text~|0,03| +% in the table but it doesn't increase the totals of that column by~3 +% (assuming |3,2| coding for the separations). But you won't cheat, won't you? % \end{macro} % \begin{macro}{\res@tsumline} % Since all changes to the totals and widths of the columns are global, @@ -1341,24 +1331,25 @@ FCtot@\romannumeral\FCsc@l\endcsname}$}% \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 + \advance\count1 by \@ne + \xdef\FC@chklist{\FC@chklist\number\count0,\number\count1;}% + \advance\count0 by\@ne \repeat - \fi + \fi \fi % \end{macrocode} % Then this list is peeled off and processed. % \begin{macrocode} \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 - \PackageWarning{fcolumn}{F-columns \number\count0 \space - and \number\count1 \space do not balance near or}% - \fi +\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 + \PackageWarning{fcolumn}{F-columns \number\count0 \space and + \number\count1 \space do not balance due to \string\sumline + \MessageBreak near or}% + \fi \repeat} % \end{macrocode} % When |\aut@check| is finished, |\FC@chklist| is empty again, i.e., well @@ -1386,83 +1377,69 @@ FCtot@\romannumeral\FCsc@l\endcsname}$}% % \end{macrocode} % \end{macro} % \subsection{Support for package longtable} -% Package |longtable| is used for tables that may span multiple pages. |fcolumn| and -% |longtable| work together as long as |longtable| is loaded first, so that |fcolumn| -% can adapt one definition of |longtable|. If |longtable| is not loaded, that definition -% is just that: a definition. If |longtable| is loaded before |fcolumn|, it is a -% redefinition, and it should be. For that reason the user is warned (not loading -% |longtable| is not an error if you don't use it) if |fcolumn| is loaded without prior -% loading of |longtable|. +% Package |longtable| is used for tables that may span multiple pages. The +% packages |fcolumn| and |longtable| work together provided |longtable| is +% loaded first, so that |fcolumn| can adapt one definition of |longtable|. If +% |longtable| is not loaded, it's a waste of memory having that definition, so +% it is only defined when necessary. For that reason the user is warned (not +% loading |longtable| is obviously not an error if you don't use it) if +% |fcolumn| is loaded without prior loading of |longtable|. % \begin{macrocode} \ifx\longtable\@undefined - \PackageWarningNoLine{fcolumn}{fcolumn is loaded without longtable. That's - OK, but\MessageBreak if you want to load longtable as well, make sure - \MessageBreak it is done before loading fcolumn} -\fi + \PackageWarningNoLine{fcolumn}{fcolumn is loaded without longtable. + That's OK, but\MessageBreak if you want to load longtable as well, + make sure \MessageBreak it is done before loading fcolumn}\else % \end{macrocode} % \begin{macro}{\LT@array} -% And here is the only definition of |longtable| that needs to be adapted a bit, to make -% |fcolumn| work with that package. -% \begin{macrocode} -\def\LT@array[#1]#2{% - \refstepcounter{table}\stepcounter{LT@tables}% - \if l#1 \LTleft\z@\LTright\fill - \else\if r#1 \LTleft\fill\LTright\z@ - \else\if c#1 \LTleft\fill\LTright\fill - \fi\fi\fi - \let\LT@mcol\multicolumn\let\LT@@tabarray\@tabarray\let\LT@@hl\hline - \def\@tabarray{\let\hline\LT@@hl \LT@@tabarray}% - \let\\\LT@tabularcr\let\tabularnewline\\% - \def\newpage{\noalign{\break}}% - \def\pagebreak{\noalign{\ifnum`}=0\fi\@testopt{\LT@no@pgbk-}4}% - \def\nopagebreak{\noalign{\ifnum`}=0\fi\@testopt\LT@no@pgbk4}% - \let\hline\LT@hline\let\kill\LT@kill\let\caption\LT@caption - \@tempdima\ht\strutbox\let\@endpbox\LT@endpbox - \ifx\extrarowheight\@undefined - \let\@acol\@tabacol\let\@classz\@tabclassz\let\@classiv\@tabclassiv - \def\@startpbox{\vtop\LT@startpbox}\let\@@startpbox - \@startpbox\let\@@endpbox\@endpbox\let\LT@LL@FM@cr\@tabularcr - \else - \advance\@tempdima\extrarowheight \col@sep\tabcolsep - \let\@startpbox\LT@startpbox\let\LT@LL@FM@cr\@arraycr - \fi - \setbox\@arstrutbox\hbox{\vrule\@height\arraystretch\@tempdima - \@depth\arraystretch\dp\strutbox\@width\z@}% - \let\@sharp##\let\protect\relax - \begingroup - \@mkpream{#2}% - \xdef\LT@bchunk{% - \global\advance\c@LT@chunks\@ne\global\LT@rows\z@ - \setbox\z@\vbox\bgroup\LT@setprevdepth\tabskip\LTleft - \noexpand\halign to\hsize\bgroup\tabskip\z@\@arstrut - \@preamble\tabskip\LTright\cr}% - \endgroup -% \end{macrocode} -% Until this line it was just the code for |\LT@array| from package |longtable|. -% The five lines of the next chunk are new to |\LT@array|. Their +% And here is the only definition of |longtable| that needs to be extended +% to make |fcolumn| work with that package. The lines are compacted a bit +% w.r.t.\ the original |longtable| code; if you want to study the +% code, have a look at the documentation~\cite{longtable}. +% \begin{macrocode} + \def\LT@array[#1]#2{\refstepcounter{table}\stepcounter{LT@tables}\if + l#1 \LTleft\z@\LTright\fill\else\if r#1 \LTleft\fill\LTright\z@\else + \if c#1 \LTleft\fill\LTright\fill\fi\fi\fi\let\LT@mcol\multicolumn + \let\LT@@tabarray\@tabarray\let\LT@@hl\hline\def\@tabarray{\let + \hline\LT@@hl\LT@@tabarray}\let\\\LT@tabularcr\let\tabularnewline\\ + \def\newpage{\noalign{\break}}\def\pagebreak{\noalign{\ifnum`}=0\fi + \@testopt{\LT@no@pgbk-}4}\def\nopagebreak{\noalign{\ifnum`}=0\fi + \@testopt\LT@no@pgbk4}\let\hline\LT@hline\let\kill\LT@kill\let\caption + \LT@caption\@tempdima\ht\strutbox\let\@endpbox\LT@endpbox\ifx + \extrarowheight\@undefined\let\@acol\@tabacol\let\@classz\@tabclassz + \let\@classiv\@tabclassiv\def\@startpbox{\vtop\LT@startpbox}\let + \@@startpbox\@startpbox\let\@@endpbox\@endpbox\let\LT@LL@FM@cr + \@tabularcr\else\advance\@tempdima\extrarowheight\col@sep\tabcolsep + \let\@startpbox\LT@startpbox\let\LT@LL@FM@cr\@arraycr\fi\setbox + \@arstrutbox\hbox{\vrule\@height\arraystretch\@tempdima\@depth + \arraystretch\dp\strutbox\@width\z@}\let\@sharp##\let\protect\relax + \begingroup\@mkpream{#2}\xdef\LT@bchunk{\global\advance\c@LT@chunks + \@ne\global\LT@rows\z@\setbox\z@\vbox\bgroup\LT@setprevdepth\tabskip + \LTleft\noexpand\halign to\hsize\bgroup\tabskip\z@\@arstrut\@preamble + \tabskip\LTright\cr}\endgroup +% \end{macrocode} +% Until this line it was just the code for |\LT@array| from package~|longtable|. +% The two lines of the next chunk are new to |\LT@array|. Their % purpose is the same as in |\@array| above. % \begin{macrocode} - \begingroup - \@mksumline{#2}% - \endgroup - \res@tsumline + \begingroup\@mksumline{#2}\endgroup\res@tsumline \everycr{\noalign{\global\FCsc@l=0 }}% % \end{macrocode} -% From here on |\LT@array| is picked up again. +% From here on |\LT@array| is picked up again, ending with the |\fi| that belongs +% to the |\ifx| that started this definition. % \begin{macrocode} - \expandafter\LT@nofcols\LT@bchunk&\LT@nofcols - \LT@make@row\m@th\let\par\@empty - \lineskip\z@\baselineskip\z@\LT@bchunk} + \expandafter\LT@nofcols\LT@bchunk&\LT@nofcols\LT@make@row\m@th\let + \par\@empty\lineskip\z@\baselineskip\z@\LT@bchunk} +\fi % \end{macrocode} % \end{macro} % That's it! % \section*{Acknowledgement} -% Thanks to Karl Berry for valuable comments regarding the consistency of -% the installation procedure of this version. Frank Mittelbach gave -% various useful suggestions for improving the input parsing as well as -% hints to make the package more \LaTeX-like. He also challenged me to make |fcolumn| -% compatible with |longtable|. Christian Hoff's request on column formatting triggered -% many happy hours of coding. +% Thanks to Karl Berry for valuable comments regarding the consistency of the +% installation procedure of this version. Frank Mittelbach gave various useful +% suggestions for improving the input parsing as well as hints to make the package +% more \LaTeX-like. He also challenged me to make |fcolumn| compatible with +% |longtable|. Christian Hoff's request on column formatting triggered many +% happy hours of coding. % \bibliographystyle{plain} % \begin{thebibliography}{9} % \itemsep0pt @@ -1470,7 +1447,7 @@ FCtot@\romannumeral\FCsc@l\endcsname}$}% % \parskip0pt % \bibitem{array} Frank Mittelbach and David Carlisle. % A new implementation of \LaTeX's |tabular| and |array| environment. -% \bibitem{booktabs} Simon Fear. Publication quality tables in \LaTeX. +% \bibitem{booktabs} Simon Fear. The |booktabs| package. Publication quality tables in \LaTeX. % \bibitem{dcolumn} David Carlisle. The |dcolumn| package. % \bibitem{longtable} David Carlisle. The |longtable| package. % \bibitem{world_economy} According to the IMF \url{www.imf.org}. diff --git a/Master/texmf-dist/source/latex/fcolumn/fcolumn.ins b/Master/texmf-dist/source/latex/fcolumn/fcolumn.ins index 993ad041c8f..d4074c15073 100644 --- a/Master/texmf-dist/source/latex/fcolumn/fcolumn.ins +++ b/Master/texmf-dist/source/latex/fcolumn/fcolumn.ins @@ -17,7 +17,7 @@ This is a generated file. -Copyright (C) 2015--2021 by Edgar Olthof +Copyright (C) 2015--2022 by Edgar Olthof This file may be distributed and/or modified under the conditions of the LaTeX Project Public License, either @@ -42,12 +42,12 @@ LaTeX version 1999/12/01 or later. \Msg{* fcolumn.sty *} \Msg{* *} \Msg{* into a directory searched by TeX. *} -\Msg{* To produce the documentation, type ``make'' or *} +\Msg{* To generate the documentation, type ``make'' or *} \Msg{* run the file fcolumn.dtx through LaTeX. Make sure *} \Msg{* the glossary and index are updated by makeindex: *} \Msg{* *} \Msg{* makeindex -s gglo.ist -o fcolumn.gls fcolumn.glo *} -\Msg{* makeindex -s gglo.ist -o fcolumn.ind fcolumn.idx *} +\Msg{* makeindex -s gind.ist -o fcolumn.ind fcolumn.idx *} \Msg{* *} \Msg{* and then LaTeX again; presto! *} \Msg{* *} |