70 lines
2.6 KiB
TeX
70 lines
2.6 KiB
TeX
% ┌ ┐
|
|
% │ Counter numbering │
|
|
% └ ┘
|
|
\newcommand{\preEnvHook}[1]{%
|
|
\stepLabelNumber{combined}%
|
|
\ifthenelse{\equal{\numberingpreset}{combined}}{%
|
|
\ifthenelse{\equal{\printNumberingConfigForDescriptor{#1}}{default}}{
|
|
\stepLabelNumber{combined}%
|
|
}{}%
|
|
}{%
|
|
\ifthenelse{\equal{\printNumberingConfigForDescriptor{#1}}{combined}}{%
|
|
\stepLabelNumber{combined}%
|
|
}{}%
|
|
}%
|
|
}
|
|
|
|
% Decides on the numbering to use (combined or not)
|
|
\newcommand{\loadNumberingConfiguration}{%
|
|
\ifthenelse{\boolean{numberingDisabled}}{%
|
|
\renewcommand{\thetable}{\arabic{table}}
|
|
\renewcommand{\thefigure}{\arabic{figure}}
|
|
}{
|
|
\ifthenelse{\equal{\numberingpreset}{combined}}{%
|
|
\ifthenelse{\equal{\subsectionnumbering}{none}}{
|
|
\renewcommand{\thetable}{\arabic{combinednone}}
|
|
\renewcommand{\thefigure}{\arabic{combinednone}}
|
|
}{%
|
|
\renewcommand{\thetable}{\ssprinter.\arabic{combined\subsectionnumbering}}
|
|
\renewcommand{\thefigure}{\ssprinter.\arabic{combined\subsectionnumbering}}
|
|
}%
|
|
}{%
|
|
\ifthenelse{\equal{\numberingpreset}{separate}}{
|
|
\ifthenelse{\equal{\subsectionnumbering}{none}}{}{
|
|
\renewcommand{\thetable}{\ssprinter.\arabic{table}}
|
|
\renewcommand{\thefigure}{\ssprinter.\arabic{figure}}
|
|
}
|
|
}{%
|
|
\renewcommand{\thetable}{\arabic{table}}
|
|
\renewcommand{\thefigure}{\arabic{figure}}
|
|
}%
|
|
}%
|
|
}%
|
|
}
|
|
|
|
% Prints the preceding subsection numbers
|
|
\newcommand{\ssprinter}{\thesection}
|
|
\newcommand{\generateSubsection}{%
|
|
\ifthenelse{\equal{\subsectionnumbering}{section}}{%
|
|
\renewcommand{\ssprinter}{\thesection}
|
|
}{%
|
|
\ifthenelse{\equal{\subsectionnumbering}{subsection}}{%
|
|
\renewcommand{\ssprinter}{\thesubsection}
|
|
}{%
|
|
\ifthenelse{\equal{\subsectionnumbering}{subsubsection}}{%
|
|
\renewcommand{\ssprinter}{\thesubsubsection}
|
|
}{%
|
|
\ifthenelse{\equal{\subsectionnumbering}{paragraph}}{%
|
|
\renewcommand{\ssprinter}{\theparagraph}
|
|
}{
|
|
\renewcommand{\ssprinter}{}
|
|
}%
|
|
}%
|
|
}%
|
|
}%
|
|
}
|
|
\loadNumberingConfiguration
|
|
|
|
\AtBeginEnvironment{table}{\preEnvHook{table}}
|
|
\AtBeginEnvironment{figure}{\preEnvHook{figure}}
|