tud-cd / tudscr

TUD-Script
Other
106 stars 23 forks source link

Putting additional info in `\thesis{}` command not working anymore #85

Closed ktnr closed 1 year ago

ktnr commented 1 year ago

With texlive 2021 we used the \thesis{} command to display information about the course it was written for:

\documentclass{tudscrreprt}

\title{tudscr Test}
\author{Max Mustermann}
\date{January 2023}

\begin{document}

\thesis{Seminar Paper \\ \normalfont\large\sffamily Seminar XY} % Error 1
%\thesis{Seminar Paper \\ \large Seminar XY} % Error 2
%\thesis{Seminar Paper \\ Seminar XY} % Works

\maketitle

\end{document}

and it worked fine. After updating to texlive 2022, the above command throws error 1:

Incomplete \iffalse; all text was ignored after line 20.

<inserted text> 
                \fi 
<*> main.tex

The file ended while I was skipping conditional text.
This kind of error happens when you say `\if...' and forget
the matching `\fi'. I've inserted a `\fi'; this might work.

! Emergency stop.
<*> main.tex

*** (job aborted, no legal \end found)

resp. error 2:

TeX capacity exceeded, sorry [input stack size=10000].

\@nomath ...e \@font@warning {Command \noexpand #1
                                                  invalid in math mode}\fi 
l.21 \thesis{Seminar Paper \\ \large Seminar XY}
                                                 % Error 2
If you really absolutely need more capacity,
you can ask a wizard to enlarge me.

Why does it not work anymore? Did the \thesis{} command become more restrictive with recent tudscr versions? Is there a different way to put and format additional info on the title page?

mrpiggi commented 1 year ago

This is and ever was a wrong usage of command \thesis{...} as any command for setting title fields is intended to be used with text only not containing any formatting command. The recommended way would be something like (note usage of \subject{} instead of \thesis{} as s seminar paper isn't a thesis)

\documentclass{tudscrreprt}
\begin{document}
\title{tudscr Test}
\date{January 2023}
\subject{seminar}
%\thesis{seminar}
\author{Max Mustermann}
\course{Seminar XY}
\maketitle
\end{document}

Nevertheless, I you are insisting in your style, you could use this as a workaround

\documentclass{tudscrreprt}
\begin{document}
\title{tudscr Test}
\date{January 2023}
\newsavebox\thesisbox
\savebox\thesisbox{\large\sffamily Seminar XY}
\thesis{Seminar Paper\\\usebox\thesisbox}
\author{Max Mustermann}
\course{Seminar XY}
\maketitle
\end{document}