summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/fcolumn/fcolumn.sty
blob: 88a33413bce7b55f5f8f3a1457f166c414ae1968 (plain)
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
%%
%% 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 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.
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{fcolumn}
          [2015/09/20 v1.1.1 Automatic Currency Package (EO)]
\RequirePackage{array}
\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
\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
\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}%
\fi
\ifnum#2<0 \ifstrictaccounting\rlap{)}\fi\fi}
\def\g@ldens#1{{\count3=\count2 \count0=#1
\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
\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\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
\repeat
\number#2}}
\def\zetg@ld#1#2{\global\advance\csname
FCtot@\romannumeral\FCsc@l\endcsname by #1
\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}%
\fi}
\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\sumline{}\@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\sumline{\sumline\noexpand\aut@check\noexpand\\}}
\def\@addtosumline#1{\xdef\sumline{\sumline #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
    \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. }
   \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. }
   \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}$}%
\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
\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\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}}
\endinput
%%
%% End of file `fcolumn.sty'.