I'm speaking about the article
document class only, because report
and book
deal with titles in a different way.
Obviously, the titlepage
environment triggers a new page after it, and it resets the page counter to start at 1 over again. As long as you don't use \maketitle
on your titlepage
, the page style is set to empty
, i.e. no page number is shown on the title page. If, however, you do use \maketitle
within the titlepage
environment, that sets the pagestyle to plain
(page number in the footer) again, resulting in two consecutive pages numbered "1".
If we go a step further and use hyperref
, which is pretty standard package, we get a warning about the page number 1 being used twice:
pdfTeX warning (ext4): destination with the same identifier (name{page.1}) has been already used, duplicate ignored
This shows how titlepage
messes up internal references slightly.
This question is not about how to fix the things titlepage
messes up, I've got all that figured out; I'm rather wondering what the point of using titlepage
in a non-trivial document is – besides the nice semantic markup in the source. I could as well just use \newpage
, considering that I've got to fix the page numbering at any rate. So:
What precisely does the titlepage
environment do and what are its benefits?
If you want to see the phenomena I described, here's a MWE for you to copy. The lines appended with % *
might be interesting to comment out.
\documentclass{article}
\usepackage{hyperref}% *
\author{John Doe}
\title{Foo Bar}
\begin{document}
\begin{titlepage}
\maketitle% *
Baz
\end{titlepage}
Hello World
\end{document}
Edit:
Thanks to Werner for the answer. I haven't accepted it though because I'm still not really clear on some things. Let me clarify my question – it'd be great if Werner or someone else could elaborate a bit on them:
- What exactly does the
titlepage
environment (not the document class option) inarticle
do; what macros and environments does it change and how? I looked intoarticle.cls
but I didn't understand all of the relevant parts. - What is the point of using this environment after all? Why don't I just write
\newpage
after the title page?
Edit 2:
It'd be interesting to hear if you personally are actually using the titlepage
environment and perhaps to see a small example in which it is used advantageously.
titlepage
withmaketitle
.maketitle
based on the idea ofdocumentclass
and withtitlepage
you can define your own title. Everydocumentclass
has the optiontitlepage
.