LaTeX error "No \title given": cause and fix
\maketitle prints the title block, but no \title{...} was set before it.
Why it happens
- The document calls
\maketitleand has no\titleline. \title{...}comes after\maketitle.
How to fix it
- Set the title in the preamble:
\title{My Report}. An empty\title{}is accepted too. - If the document should have no title block, delete
\maketitle. - A missing
\authoronly gives the warning "No \author given". Without\date, LaTeX prints the date of the run;\date{}leaves the date out.
A document that produces the message
\documentclass{article}
\author{Ada Lovelace}
\begin{document}
\maketitle
Text.
\end{document}The corrected document
\documentclass{article}
\title{Notes on the Analytical Engine}
\author{Ada Lovelace}
\begin{document}
\maketitle
Text.
\end{document}Both documents were compiled with pdfLaTeX from TeX Live 2023. The first produces the message, the second compiles without an error.
Finding the line in the editor
The editor lists every error and warning of a compile run with file and line. Select an entry and the cursor jumps to that line. See Error list with jump to the line.