4

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?

6

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}
  • Thank you @Gonzalo. I prefer \pretocmd{\titlepage}{\thispagestyle{empty}}{}{} and \apptocmd{\titlepage}{\thispagestyle{plain}}{}{} which make the intension more clearly. – yegle Apr 8 '14 at 16:34

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.