4

I have a file called index.tex that looks like this:

\begin{theindex}
\item apple, 39
\item banana, 23
 ... lots more of this stuff stretching over say 4 pages
\end{theindex}

I include it in a MWE as follows:

\documentclass[12pt]{article}
\usepackage{lastpage}
\usepackage{fancyhdr}
\cfoot{}
\rfoot{Page \thepage/\pageref{LastPage}}
\pagestyle{fancy}

\begin{document}
hello \newpage
hello \newpage
hello \newpage

\include{index}

\end{document}

The problem is that the page style of the first index page is not fancy, it only indicates the page number in the cfoot.

What can be done to force this first page to have the same formatting of the rest of the document?

3

The theindex environment issues a \thispagestyle{plain} command. The easiest way to remove it is to do

\usepackage{etoolbox}
\patchcmd{\theindex}{\thispagestyle{plain}}{}{}{}

in your preamble.

| improve this answer | |

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.