1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
|
%%
%% This is file `fcolumn.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% fcolumn.dtx (with options: `package')
%%
%% This is a generated file.
%%
%% Copyright (C) 2015--2021 by Edgar Olthof
%%
%% This file may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either
%% version 1.3 of this license or (at your option) any later
%% version. The latest version of this license is in
%%
%% http://www.latex-project.org/lppl.txt
%%
%% and version 1.3 or later is part of all distributions of
%% LaTeX version 1999/12/01 or later.
\ProvidesPackage{fcolumn}
[2021/01/14 v1.3 Automatic Currency Package (EHTO)]
\NeedsTeXFormat{LaTeX2e}
\RequirePackage{array}[v2.4k]
\newif\ifstrict@ccounting \strict@ccountingfalse
\DeclareOption{strict}{\strict@ccountingtrue}
\ProcessOptions
\newcolumntype{F}[4]{>{\b@fi{#1}{#2}{#3}{#4}}r<{\e@fi}}
\newcolumntype{f}{F{.}{,}{3,2}{}}
\newcount\FCsc@l \FCsc@l=0 \newcount\FCtc@l \FCtc@l=0
\newif\ifwiths@p
\def\geldm@cro#1#2{\withs@pfalse
\afterassignment\g@ldm@cro\count@#1\relax{#2}}
\def\g@ldm@cro#1\relax#2{\FCform@t{\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\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
\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
\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
\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\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
\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. 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.}%
\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\FC@l \newcount\FC@r
\def\setucc@de#1#2\relax{\uccode`\~=`#1 }
\def\assignform@t#1,#2,#3\end{\def\FCform@t{#1}\def\FCform@tt{#1#2}}
\def\b@fi#1#2#3#4{%
\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,,\end \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 \FC@r=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
\setbox \@arstrutbox \hbox{\vrule
\@height \arraystretch \@tempdima
\@depth \arraystretch \dp \strutbox
\@width \z@}%
\def\ialign{\everycr{\noalign{\global\FCsc@l=0 }}%
\tabskip\z@skip\halign}
\begingroup
\@mkpream{#2}%
\xdef\@preamble{\noexpand \ialign \@halignto
\bgroup\@arstrut\@preamble\tabskip\z@\cr}%
\endgroup
\begingroup
\@mksumline{#2}%
\endgroup
\res@tsumline
\@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}
\let\@@array=\@array
\def\@mksumline#1{\gdef\s@ml@ne{}\@lastchclass 4 \@firstamptrue
\global\FCsc@l=0
\let\prr@sult=\relax
\@temptokena{#1}\@tempswatrue
\@whilesw\if@tempswa\fi{\@tempswafalse\the\NC@list}%
\count0\m@ne\let\the@toks\relax\prepnext@tok
\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}%
\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
\edef\t@stm{\expandafter\string\@nextchar}
\edef\t@stn{\string\e@fi}
\ifx\t@stm\t@stn
\@addtosumline{\prr@sult}
\global\advance\FCsc@l by \@ne
\ifnum\FCsc@l>\FCtc@l
\expandafter\ifx\csname FCtot@\romannumeral\FCsc@l\endcsname\relax
\expandafter\newcount\csname FCtot@\romannumeral\FCsc@l\endcsname
\else
\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
\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}
\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 \let\FCform@t=\FCform@tt
\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
\vskip\s@mlinesep
\hbox to \csname FCwd@\romannumeral\FCsc@l\endcsname{\hfil\unhbox0}}}
\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}
\def\resetsumline{\noalign{\res@tsumline}}
\def\FC@chklist{}
\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;}}}
\ifx\longtable\@undefined
\PackageWarning{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
\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
\begingroup
\@mksumline{#2}%
\endgroup
\res@tsumline
\everycr{\noalign{\global\FCsc@l=0 }}%
\expandafter\LT@nofcols\LT@bchunk&\LT@nofcols
\LT@make@row\m@th\let\par\@empty
\lineskip\z@\baselineskip\z@\LT@bchunk}
\endinput
%%
%% End of file `fcolumn.sty'.
|