6

Because of some stupid format check requirement I need to add page number at the bottom of title page.

Here's a minimal working example that doesn't produce the page number on title page:

\documentclass{report}
\begin{document}
\author{test}
\title{mytitle}
\maketitle
\end{document}

What should I do to add page number to this title page?

1 Answer 1

7

You can patch \titlepage to change the default empty page style used there to plain:

\documentclass{report}
\usepackage{etoolbox}

\patchcmd{\titlepage}
  {\thispagestyle{empty}}
  {\thispagestyle{plain}}
  {}
  {}

\begin{document}
\author{test}
\title{mytitle}
\maketitle
\end{document}

Without the patching, you can redefine the environment as defined in report.cls:

\documentclass{report}

\makeatletter
\renewenvironment{titlepage}
    {%
      \if@twocolumn
        \@restonecoltrue\onecolumn
      \else
        \@restonecolfalse\newpage
      \fi
      \thispagestyle{plain}% the change was made here
      \setcounter{page}\@ne
    }%
    {\if@restonecol\twocolumn \else \newpage \fi
     \if@twoside\else
        \setcounter{page}\@ne
     \fi
    }
\makeatother

\begin{document}
\author{test}
\title{mytitle}
\maketitle
\end{document}
1
  • Thank you @Gonzalo. I prefer \pretocmd{\titlepage}{\thispagestyle{empty}}{}{} and \apptocmd{\titlepage}{\thispagestyle{plain}}{}{} which make the intension more clearly.
    – yegle
    Apr 8, 2014 at 16:34

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .