I am writing a document class for LaTeX and I want it to be generic. In this document class I redefine the \maketitle command to display a custom title page, and here I want to display some information, like the title, author, etc., but also some other informations. Here is how I display the title:
{\LARGE{\bf \@title}}\\
I’d like to create a new command that works similarly to \title or \author, how can I do that?
If you look at
latex.ltxyou can see that\titleis defined as follows:Those are low-level TeX commands.
\titleis a command that redefines\@titleto expand to the argument given to\title. In more modern LaTeX commands your own definition could look like this:It’s better to use
\PackageErroror\ClassErrorto show the error message. Or, if you want\footo be optional and be empty by default:If this is not inside a package, you’ll have to put it between
\makeatletterand\makeatotherbecause of the@signs.