5

Consider the code

\documentclass[openany]{book}
\usepackage{lipsum}
\usepackage{fancyhdr}
\usepackage{pgfpages}
\pgfpagesuselayout{2 on 1}

\begin{document}
\LARGE
\thispagestyle{empty}

\pagestyle{fancyplain}
\renewcommand{\headrulewidth}{0pt} % Removes line under header.

\lhead[{\emph{{\Large{\thepage}}}}]{LEFT}
\chead[{\emph{{\Large{MIDDLE}}}}]
{{\emph{\Large{MIDDLE}}}}
\rhead[RIGHT]{{\emph{{\Large{\thepage}}}}}

\chapter*{CHAPTER 1}\thispagestyle{empty}
\lipsum[1-4]

\chapter*{CHAPTER 2}
\lipsum[1-4]

\chapter*{CHAPTER 3}
\lipsum[1-2]
\end{document}

enter image description here

enter image description here

enter image description here

enter image description here

Aside from the fist page (Chpater 1) in which I have removed both the header and the page number at the bottom by \thispagestyle{empty}, the remaining seven pages contain both a header and a page number at the bottom of each page.

QUESTION: How may the above code be modified in order that for pages 2-8: No header appears for \chapter pages (pgs 4,7; just a page number centered at the bottom of the page), whilst only the header appears (no page number at the bottom) for non-chapter pages (pgs 2, 3, 5, 6, 8)?

Thank you.

1 Answer 1

6

Don't use \pagestyle{fancyplain}. It is obsolete, and it messes up your chapter opening pages. And use modern fancyhdr commands like \fancyhead, this is much clearer.

Then the chapter pages automatically get the plain pagestyle, which is what you want. I also removed the \thispagestyle{empty}, because I guess you would want the page number also on the first page. If not, just keep it.

\documentclass[openany]{book}
\usepackage{lipsum}
\usepackage{fancyhdr}
\usepackage{pgfpages}
\pgfpagesuselayout{2 on 1}

\begin{document}
\LARGE
%\thispagestyle{empty}

\pagestyle{fancy}
\renewcommand{\headrulewidth}{0pt} % Removes line under header.

\fancyhead[LE,RO]{\Large \thepage}
\fancyhead[LO]{LEFT}
\fancyhead[RE]{RIGHT}
\fancyhead[C]{\emph{\Large MIDDLE}}
\fancyfoot{}

\chapter*{CHAPTER 1}
%\thispagestyle{empty}
\lipsum[1-4]

\chapter*{CHAPTER 2}
\lipsum[1-4]

\chapter*{CHAPTER 3}
\lipsum[1-2]
\end{document}

enter image description here

3
  • Many thanks for posting this answer. The only question I have is how may I remove the lower page number on the Chapter 1 page? I tried un-commenting %\thispagestyle{empty}, but for some reason that doesn't work. Jan 26 at 18:11
  • All seems to be fine, if, as Werner pointed out in a comment to another answer, that if I include \thispagestyle{empty} before the first \chapter*, that will accomplish what I am looking for. Jan 26 at 18:51
  • You had two %\thispagestyle{empty}s. Jan 26 at 22:13

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.