I want to have different headers/footers, depending on what "part" I have, which is defined in the "mPart" variable...
I'm using the following code to distinguish between the parts:
\newcommand{\PartEinleitung}{0}
\newcommand{\PartHauptteil}{1}
\newcommand{\PartAppendix}{2}
\newcommand{\mPart}{}
\newcommand{\setPart}[1]{\renewcommand{\mPart}{#1}}
\newcommand{\mWriter}{}
\newcommand{\setWriter}[1]{\renewcommand{\mWriter}{#1}}
\ifnum\mPart=\PartEinleitung
\rofoot*{\small\color{gray} Seite \thepage~von \pageref{LastPageEinleitung}}
\fi
\ifnum\mPart=\PartHauptteil
\rehead*{\headmark}
\lehead*{\mWriter}
\rofoot*{\small\color{gray} Seite \thepage~von \pageref{LastPageHauptteil}}
\fi
The error is:
Missing number, treated as zero. \ifnum\mPart=
Hope you can help me, thank you!
\ifxinstead of\ifnum? – TeXnician Dec 03 '17 at 18:40\rehead*{\ifx\mPart\PartHauptteil\headmark\fi}. At the time you're trying to set those headers your variables don't have the intended contents. – Skillmon Dec 03 '17 at 18:52\ifnumin LaTeX; see theifthenpackage or theetoolboxpackage. And I'm sureexpl3also offers constructs. – Martin Schröder Dec 04 '17 at 15:50\ifnumin LaTeX? I use it all the time, in preference to the theifthenpackage. – Steven B. Segletes Dec 04 '17 at 15:52ifthen). Thus, it seems to me that, as created, Lamport's LaTeX envisions the use of TeX's comparison primitives. – Steven B. Segletes Dec 04 '17 at 17:37