5

I'm using documentclass report with options twoside and openright. The pagestyle is headings. This is a minimal working example:

\documentclass[twoside,openright]{report}
 \usepackage{blindtext}
 \pagestyle{headings}
 \begin{document}
  \chapter{Chapter}
   \blindtext \blindtext
   \section{Section}
    \blindtext \blindtext
 \end{document}

Why is the page number at the first page of the chapter centered at the bottom and not on the right even though the document style headings works on all other pages? How to move the page number on the first page of a chapter to the right side as it should be using the document option openright?

4

By default the pages where chapters start are decorated with page style plain. That is why you get that behavior. If you want to change it, you have to redefine the page style plain like :

\documentclass[twoside,openright]{report}
 \usepackage{blindtext}
 \pagestyle{headings}

  \makeatletter
 \let\ps@plain\ps@headings
 \makeatother

 \begin{document}
  \chapter{Chapter}
   \blindtext \blindtext
   \section{Section}
    \blindtext \blindtext
 \end{document}
2

If you want to use different styles in different parts of your work, you can use the following code, which renews the command \thispagestyle{plain}.

In the following example, the page style is "headings" for all pages in the preface and acknowledgements section, including the title pages. In the rest of the document, title pages have the page style "empty" and all other pages have the page style headings.

\documentclass[twoside,english]{book}
\usepackage{babel}
\usepackage{blindtext}
\usepackage{emptypage}          % no headlines on empty pages

% ***************************************************************
\newcommand\plainstyle{empty}% variable for page style
\newcommand\pagestyleTitlepages[1]{\renewcommand\plainstyle{#1}}
\let\thispagestyleold\thispagestyle
\renewcommand\thispagestyle[1]{%
  \def\textparam{#1}%
  \def\isplain{plain}%
  \ifx\textparam\isplain%
    \thispagestyleold{\plainstyle}%
  \else%
    \thispagestyleold{#1}%
  \fi%
}
% ***************************************************************

\begin{document}
  \chapter*{Preface}
  \pagenumbering{Roman}
  \pagestyleTitlepages{headings}

  \blindtext \blindtext \blindtext \blindtext \blindtext

  \chapter*{Acknowledgements}
  \blindtext

  \chapter{Chapter one}
  \pagenumbering{arabic}
  \pagestyleTitlepages{empty}

   \blindtext \blindtext
   \section{Section}
    \blindtext \blindtext

  \chapter{Chapter two}
   \blindtext \blindtext
   \section{Section}
    \blindtext \blindtext

 \end{document}

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.