2

I want the title page to display the page number 1 and every page after that to have a page number with no breaks. What do I need to change?

\documentclass[pdftex,12pt,a4paper]{report}

\usepackage[pdftex]{graphicx}

\newcommand{\HRule}{\rule{\linewidth}{0.5mm}}

\begin{document}

\input{./title.tex}
\clearpage
\tableofcontents
\chapter{Chapter One}
\section{Abstract}
test
\end{document}

title.tex:

\begin{titlepage}
\begin{center}

\textsc{\LARGE University of Beer}\\[1.5cm]

This thesis is Submitted to UoB\\[0.5cm]
For the degree of Doctor of Philosophy\\[0.5cm]

% Title
\HRule \\[0.4cm]
{ \huge \bfseries Finance \\[0.4cm] }

\HRule \\[1.5cm]


\begin{minipage}{0.45\textwidth}
\begin{flushleft} \large
\emph{Author:}\\
John \textsc{Smith}
\end{flushleft}
\end{minipage}
\begin{minipage}{0.45\textwidth}
\begin{flushright} \large
\emph{Supervisor:} \\
Prof.~John \textsc{Smith Snr}
\end{flushright}
\end{minipage}

\vfill
% Bottom of the page
{\large \today}

\end{center}
\end{titlepage}
  • 2
    So, even for the first page of a chapter? If so, add \makeatletter \let\ps@empty\ps@plain \makeatother to your preamble. – Werner Sep 20 '14 at 16:36
  • 1
    What do you mean by page number with no breaks? Continuing page numbers without intermediate reset? – user31729 Sep 20 '14 at 16:37
  • 1
    Is that minipage really necessary? – user31729 Sep 20 '14 at 16:37
  • @Christian I copied it from the web if it can be simplified I would be happy to do it – Bazman Sep 20 '14 at 16:39
  • 1
    @Bazman: Werner's suggestion should work, but I believe that titlepage internally uses a \pagenumbering command, which resets the page number! – user31729 Sep 20 '14 at 16:48
1

I added an automatic \stepcounter{page} explicitly at the end of the titlepage environment using the \xpatchcmd from egreg's xpatch package. In conjunction with the suggestion by Werner about the \ps@empty command, this should provide the desired feature.

Since titlepage is an environment, there is an automatic \endtitlepage command/hook, which is called at the end of the command, so it's sufficient to append the \stepcounter command to \endtitlepage

\documentclass[pdftex,12pt,a4paper]{report}

\usepackage[pdftex]{graphicx}

\usepackage{xpatch}

\xapptocmd{\endtitlepage}{\clearpage\stepcounter{page}}{}{}%


% Taken from Werner's comment
\makeatletter 
\let\ps@empty\ps@plain%
\makeatother

\newcommand{\HRule}{\rule{\linewidth}{0.5mm}}

\begin{document}

\input{./title.tex}
%\clearpage
\tableofcontents
\chapter{Chapter One}
\section{Abstract}
test
\end{document}

The title.tex file is untouched and should be used from the OP above.

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.