Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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?

share|improve this question

1 Answer 1

up vote 6 down vote accepted

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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.