I was trying to write a custom LaTeX class where I need to access the value of \@title. I wrote

\newcommand{\makeack}{Hello World  \@title World}

But the value of \@title is not printed when I use \makeack in the .tex file. But I could successfully use \@title in the modified \@maketitle I defined like


I am a beginner in writing classes.


The default document classes make the title-related macros (\@title, \@date and \@author) empty once you call \maketitle. If you wish to keep copies of them around, you need to store these elsewhere. One way would be to update the \title (and friends) macro to not only store its contents in \@title (yes, that's what \title does), but also in something for your use, like \stored@title, say:


The titling package does a similar thing, if you're interested.

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.