[Tex/LaTex] Should I place \title, \author, \date in the preamble or after \begin{document}

best practicespreambletitles

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.

Best Answer

Conceptually, these are 'meta-data' about the document, rather than part of the document itself. As such, I prefer to set them in the preamble.

As others have noted there is no technical reason to prefer one method over the other with the standard classes and in the absence of packages which alter category codes. With classes which issue \maketitle automatically, it may however be essential to set \author, etc. in the preamble. The same is true if the meta-data is being picked up by for example hyperref for addition to the PDF information.