0

I’m using TeXLive 2015 and the scrreprt document class.

Is there a command like \thesubtitle to print the subtitle as defined by \subtitle{…}? I get an ‘undefined control sequence’ error on \thesubtitle when compiling the following (either with lualatex or pdflatex).

\documentclass{scrreprt}

\title{T}
\subtitle{S}

\begin{document}
\thetitle, \thesubtitle
\end{document}

Here, \thetitle works as expected. Do I need to load a package to get \thesubtitle? Is there another command to do this?

(Can’t be the first one to run into this problem, but I couldn’t find anything in the last five minutes on the web.)

1

The "content" of \title and \subtitle is stored in the "internal" commands \@title and \@subtitle. To use them (not using \maketitle or similar command) in the document, you have to use \makeatletter (and \makeatother)

\documentclass{scrreprt}

\title{Title}
\subtitle{Subtitle}

\begin{document}
\makeatletter\@title, \@subtitle\makeatother
\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.