I remember there was a LaTeX macro used internally to define commands that can only be used in the preamble, but I cannot remember its name nor look it up.

Which is that command, and how is it used?


The command you're looking for is \@onlypreamble:




\ACommand % ok


\ACommand % error



! LaTeX Error: Can be used only in preamble.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.

l.15 \ACommand
               % error

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.