0

I want to remove page header but keeping the page number with even and odd order. This code is sample of very large code.

        % !TeX spellcheck = en_US

    \documentclass[11pt,twoside]{book}% Use this line for the print version of the thesis
    \usepackage[ngerman,american]{babel}
    \usepackage{blindtext}
    \begin{document}
     \pagestyle{headings}
    \mainmatter
    \include{chapter1}
     \pagestyle{plain}
    \include{chapter2}

    \end{document}

% content
Chapter1


    \chapter{Chapter1}
    \label{chp:1}
    \section{XXX}
    \Blindtext
    \section{YXX}
    \Blindtext

Chapter2


    \chapter{Chapter2}
     \section{XXX}
    \Blindtext
    \section{YXa}
    \Blindtext

I used \pagestyle{plain}. It works but shifts page number to to the bottom center of the page (5-8) which is wrong. I want to keep page number on left and right corner of the pages ( see page 2-4).

  • Other questions are:

**why Heading of Chapter 1&2 are appearing double.

Why page number 1 is on the bottom center of the page.**

2 Answers 2

2

It is very easy to redefine the plain pagestyle with titleps

\documentclass[11pt,twoside]{book}% Use this line for the print version of the thesis
\usepackage[ngerman,american]{babel}
\usepackage{blindtext}
\usepackage{titleps}
\renewpagestyle{plain} {%
\sethead{}{}{}
\setfoot[\thepage][][]{}{}{\thepage}
}
\pagestyle{plain}

\begin{document}

\mainmatter

\chapter{Chapter1}
\label{chp:1}
\section{XXX}
\Blindtext
\section{YXX}
\Blindtext

\chapter{Chapter2}
 \section{XXX}
\Blindtext
\section{YXa}
\Blindtext

\end{document}

enter image description here

1
\documentclass[11pt,twoside]{book}% Use this line for the print version of the thesis
    \usepackage[ngerman,american]{babel}
    \usepackage{blindtext}
\makeatletter
  \def\ps@plain{%
      \def\@oddfoot{\hfill\thepage}
\def\@evenfoot{\thepage\hfill}
      \def\@evenhead{}%
      \def\@oddhead{}%
}
  \def\ps@headings{%
      \let\@oddfoot\@empty\let\@evenfoot\@empty
      \def\@evenhead{\thepage\hfil}%
      \def\@oddhead{{}\hfil\thepage}%
      \let\@mkboth\markboth
}
\makeatother
    \begin{document}
     \pagestyle{headings}
    \mainmatter
    \include{chapter1}
     \pagestyle{plain}
    \include{chapter2}

    \end{document}
3
  • Hope the modified version is fine for you...please confirm...
    – MadyYuvi
    May 3, 2017 at 12:27
  • can you answer thesewhy Heading of Chapter 1&2 are appearing double. AND Why page number 1 is on the bottom center of the page.
    – user31177
    May 3, 2017 at 12:41
  • why page number 1 is on the bottom center of the page - In book.cls file, chapter opening page style was defined as "plain" so as per definition page number was coming in center of the page and please provide more details or screenshot for Chapter 1&2 are appearing double...
    – MadyYuvi
    May 3, 2017 at 12:51

You must log in to answer this question.

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