%%
%% This is file `fcolumn.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% fcolumn.dtx  (with options: `package,tagging')
%% 
%% Copyright (C) 2015--2026 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}
          [2026/05/27 v1.4.6 Automatic Currency Package (EHTO)]
\NeedsTeXFormat{LaTeX2e}
\RequirePackage{array}[v2.6d]
\DeclareRelease{v1.4.2}{2023-07-25}{fcolumn-2023-07-25.sty}
\DeclareRelease{v1.4.4}{2026-01-26}{fcolumn-2026-01-16.sty}
\DeclareCurrentRelease{v1.4.6}{2026-05-27}
\NeedsTeXFormat{LaTeX2e}[2025/06/01]
\newif\ifminusr@d \minusr@dfalse
\newif\ifstrict@ccounting \strict@ccountingfalse
\DeclareOption{red}{\minusr@dtrue}
\DeclareOption{strict}{\strict@ccountingtrue}
\ProcessOptions \ifminusr@d \ifstrict@ccounting \minusr@dfalse
\PackageWarningNoLine{fcolumn}{Option `red' is reset due to use
 of `strict'}\else\usepackage{color}\fi\fi
\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{\ifstrict@ccounting\def\bm@nus{(}
 \def\em@nus{)}\else\def\em@nus{}\ifminusr@d\def\bm@nus{\color{red}}
 \else\def\bm@nus{-}\fi\fi\FCform@t{\ifnum#2<0 \bm@nus\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 \rlap{\em@nus~!}
 \else\rlap{\phantom{\em@nus}~!}\fi
\else\ifnum#2<0 \rlap{\em@nus}\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
  \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\space near or at line \the\inputlineno.
   You can press\MessageBreak <enter> now and I'll proceed, but
   check your table. The offending entry\MessageBreak is indicated
   with an exclamation 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\assignform@t{\def\FCform@t{#1}%
 \def\FCform@tt{#2}\ifx\FCform@tt\@empty \def\FCform@tt{#1}\fi}
\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}
\def\b@fi#1#2#3#4{\sep@xt#1\sep@xt\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
 \m@th
 \let\FCs@gn=\@ne\relax \setbox0\hbox\bgroup$
 \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
 \afterassignment\setucc@de\count@#3\relax
 \uppercase{\def~}{\ifnum\mathcode`\0="8000 \m@thcodeswitch0 \fi
 \afterassignment\deactdecm@rk\count@#3\relax \global\FC@r=1}
 \ifnum\uccode`\~=`. \uccode`\~=`,\relax\else \uccode`\~=`.\relax\fi
 \uppercase{\def~}{\ifnum\mathcode`\0="8000 \m@thcodeswitch0 \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="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}
 \mathcode`-="8000 \mathcode`+="8000 \mathcode`.="8000
 \m@thcodeswitch1 \afterassignment\actdecm@rk\count@#3\relax}
\def\sep@xt#1#2\sep@xt{\def\sep@rator{#1}}
\def\actdecm@rk#1#2\relax{\ifx#1.\relax \mathcode`,="8000
 \else \mathcode`#1="8000 \fi}
\def\deactdecm@rk#1#2\relax{\mathcode`#1=0 }%
\def\d@cm#1#2{\count@=\mathcode`#1 }
\def\e@fi{\ifnum\mathcode`\0="8000 \global\FC@r=\m@ne\fi$\egroup
 \ifnum\FC@r>0
  \ifnum\FC@r=1 \FC@r=10 \fi
  \afterassignment\i@ts\count@\sp@l
  \loop\ifnum\count0>0 \multiply\FC@l by 10 \expandafter\secd@xt
  \number\FC@r\secd@xt \advance\count0 by \m@ne \repeat
  \ifnum\expandafter\@gobble\number\FC@r>0
    \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
 \ifx\FCs@gn\m@ne\relax\FC@l=-\FC@l\fi\zetg@ld{\sp@l}{\FC@l}\fi}
\def\i@ts#1#2{\count0=#2} \def\tw@l#1#2\relax{#2}
\def\secd@xt1#1#2\secd@xt{\advance\FC@l by #1
 \FC@r=1#2 \ifnum\FC@r=1 \FC@r=10 \fi}
\def\@mksumline#1{\gdef\s@ml@ne{}\@lastchclass 4 \@firstamptrue
 \global\FCsc@l=\z@\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\else
  \expandafter\fre@t\FC@chklist\fre@t
  \FC@l=\csname FCtot@\romannumeral\count0\endcsname
  \advance\FC@l by -\csname FCtot@\romannumeral\count1\endcsname
  \ifnum\FC@l=0 \else \ifnum\FC@l<0 \FC@l=-\FC@l \fi
   \PackageWarning{fcolumn}{Representations of F-columns \number
   \count0 \space and \number\count1 \space differ by\MessageBreak
   \number\FC@l\space due to \string\sumline\space near or}%
  \fi
 \repeat}
\def\fre@t#1,#2;#3\fre@t{\count0=#1 \count1=#2 \xdef\FC@chklist{#3}}
\def\checkfcolumns#1#2{\noalign{\xdef\FC@chklist{\FC@chklist #1,#2;}}}
\IfFormatAtLeastF{2026-06-01}{\NewHookWithArguments{tbl/init}{2}
 \NewHookWithArguments{tbl/row/end}{1}}
\AddToHookWithArguments{tbl/init}{\begingroup\@mksumline{#2}%
 \res@tsumline\endgroup}
\AddToHook{tbl/row/end}{\global\FCsc@l\z@}
\ExplSyntaxOn
\IfFormatAtLeastF{2026-06-01}{\def\@array[#1]#2{\@tempdima\ht
 \strutbox\advance\@tempdima by \extrarowheight\setbox\@arstrutbox
 \hbox{\vrule\@height\arraystretch\@tempdima\@depth\arraystretch
 \dp\strutbox\@width\z@}%
 \tbl_init_cell_data_for_table:
 \begingroup\@mkpream{#2}%
 \tbl_count_table_cols:
 \xdef\@preamble{\noexpand\ar@ialign\@halignto
 \bgroup\@arstrut
 \UseTaggingSocket{tbl/row/begin}
 \tbl_init_cell_data_for_row:
 \@preamble\tabskip\z@\cr}\endgroup
 \UseHookWithArguments{tbl/init}{2}{}{#2}
 \@arrayleft\if #1t\vtop\else\if#1b\vbox\else\vcenter\fi\fi
 \bgroup\let\@sharp ##\let\protect\relax\lineskip\z@\baselineskip\z@
 \mathsurround \z@ \let\\\@arraycr \let\tabularnewline\\\let\par\@empty
 \UseTaggingSocket{tbl/init}
 \@preamble}
\let\@@array=\@array\def\ar@ialign{\everycr{\noalign{%
 \tbl_if_row_was_started:T{\UseTaggingSocket{tbl/row/end}}
 \tbl_update_cell_data_for_next_row:
 \UseHook{tbl/row/end}{}
}}\tabskip\z@skip\halign}}
\IfFormatAtLeastF{2026-06-01}{\AtBeginDocument{\def\LT@array[#1]#2{%
  \UseTaggingSocket{tbl/init}\tl_if_empty:eTF{\LTcaptype}%
  {\tl_gset:Ne\@currentHref{LT@tables.\theHLT@tables}}{%
  \@kernel@refstepcounter{\LTcaptype}\stepcounter{LT@tables}
  \tl_gset:Ne\@currentHref{\LTcaptype.\cs_if_exist_use:c
  {theH\LTcaptype}}}\tbl_gzero_row_count:
  \UseTaggingSocket{tbl/longtable/init}
  \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\let\multicolumn\LT@mcol
  \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}%
  \tbl_count_table_cols:
  \xdef\LT@bchunk{%
  \tbl_inbetween_rows:
  \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
  \UseTaggingSocket{tbl/row/begin}\tbl_init_cell_data_for_row:
  \@preamble
  \tabskip\LTright\cr}\endgroup
  \expandafter\LT@nofcols\LT@bchunk&\LT@nofcols
  \UseHookWithArguments{tbl/init}{2}{}{#2}
  \LT@make@row\mathsurround\z@\let\par\@empty\everycr{\noalign{%
  \__tbl_trace:n {--longtable-->~chunk~row:~ \the\LT@rows\space
  row:~ \the\g__tbl_row_int \space column:~ \the\g__tbl_col_int}
  \tbl_if_row_was_started:T {%
  \UseHook{tbl/row/end}{}
  \UseTaggingSocket{tbl/row/end}
  \tbl_inbetween_rows:}\int_compare:nNnT\LT@rows<\LTchunksize
  {\tbl_gincr_row_count:} % Next is row about to start
  }}\lineskip\z@\baselineskip\z@\LT@bchunk}}}
\ExplSyntaxOff
\endinput
%%
%% End of file `fcolumn.sty'.
