The motivation for this question
Forgive me if this looks very basic to you but nobody has pointed out to me yet until now in a comment to a question that the \title
command (and thus the other two metadata commands \author
and \date
) should be placed in the preamble. My practice up to this point is to write them after \begin{document}
. In titling's \thetitle, \theauthor and \thedate don't work and Best practice on organising your preamble, user doncherry mentioned to write them "towards the end" of the preamble.
I consulted lshort again and it seems to go towards putting these in the preamble. Here is an example code taken from lshort (page 8 in the English version).
\documentclass[a4paper,11pt]{article}
% define the title
\author{H.~Partl}
\title{Minimalism}
\begin{document}
% generates the title
\maketitle
% insert the table of contents
\tableofcontents
\section{Some Interesting Words}
Well, and here begins my lovely article.
\section{Good Bye World}
\ldots{} and here it ends.
\end{document}
However, in some on-line tutorials like this one, they are written after \begin{document}
.
The question:
What is the standard practice and are there advantages or disadvantages to each of these usage?
I am aware, for example, of the answers in the above-mentioned posts; but apart from these, are there more things to consider? For one, I don't get compile errors or warnings in most cases. Although I can't remember when I had such compile errors when these commands are written elsewhere where they are not intended to be written.
sample2e.tex
notwithstanding, in section C.5.4 of lamport's manual, it states (p.181) "Information used to produce the title is obtained from the following declarations ... It's best to put these declarations in the preamble." (i don't agree with this for several reasons, including the action ofbabel
, but that's the official word.)