# Multiple page number positions in one document

I'm working on a document with multiple page number styles. The introduction consists of Roman (I, II, III,...) page numbers, the actual text consists of page numbers in Arabic style (1, 2, 3,...), and the appendices pages are numbered with a hyphenated letter-number (A-1, A-2, A-3,..).

This is all going well, but here comes the problem.

The second appendix (B-1, B-2, B-3,...) consists of drawings (imported PDF files on full scale of an A4 page format). The page number and the drawing are overlapping. .

The page number is marked by the green rectangle and black rectangles consist of personal information that is blacked out.

Is it possible to move the page numbering (only for this appendix) to one of the positions marked with a red rectangle?

I'm using the fancyhdr package in a report document class (given by my boss).

• You could use the \newgeometry feature of the geometry package to change page margins on the fly. – Steven B. Segletes Aug 11 '15 at 16:23
• Welcome to TeX.SX! Please help us (and also you) and add a minimal working example (MWE), that illustrates your problem. Reproducing the problem and finding out what the issue is will be much easier when we see compilable code, starting with \documentclass and ending with \end{document}. – Bobyandbob Dec 17 '17 at 19:43

Whether you're setting the content yourself (through regular text, say) or including full-page PDFs from an external source (using pdfpages, say), I'd suggest setting a new page style where the page numbers are lowered into position.

Here's an example showing how it can be done if you're setting the text yourself (while I'm using article, it holds for other base classes as well):

\documentclass{article}

\usepackage{fancyhdr,lipsum}

\fancypagestyle{appendixA}{
\renewcommand{\footrulewidth}{0pt}% Remove footer rule
\fancyfoot[C]{A-\thepage}
}
\fancypagestyle{appendixB}{
\renewcommand{\footrulewidth}{0pt}% Remove footer rule
\fancyfoot[C]{\raisebox{-5\baselineskip}[0pt][0pt]{B-\thepage}}
}

\begin{document}

\sloppy % Just for this example

\pagestyle{appendixA}
\section*{Appendix A}
\lipsum[1-50]

\clearpage
\pagestyle{appendixB}
\section*{Appendix B}
\lipsum[1-50]

\end{document}


I define a specific page style for the differing footer-positioned page numbers, lowering them into position using \raisebox{<len>}[0pt][0pt]{<stuff>} (with <len> negative). [0pt][0pt] ensures that the resulting box doesn't have any height or depth and therefore won't impede on the baseline height (if that's an issue).

If you were including full-page PDFs via pdfpages, this is what things might look like:

\documentclass{article}

\usepackage{pdfpages,fancyhdr,lipsum}

\fancypagestyle{appendixA}{
\renewcommand{\footrulewidth}{0pt}% Remove footer rule
\fancyfoot[C]{A-\thepage}
}
\fancypagestyle{appendixB}{
\renewcommand{\footrulewidth}{0pt}% Remove footer rule
\fancyfoot[C]{\raisebox{-5\baselineskip}[0pt][0pt]{B-\thepage}}
}

\begin{document}

\sloppy % Just for this example

\pagestyle{appendixA}
\section*{Appendix A}
\lipsum[1-50]

\clearpage
\pagestyle{appendixB}
\section*{Appendix B}
\lipsum[1-3] % Some introductory text
\includepdf[
pagecommand = {\thispagestyle{appendixB}}
]{example-image-letter-numbered}% From //ctan.org/pkg/mwe

\end{document}


You have to set the page style specifically using \thispagestyle{<your page style} (using the pagecommand key-value) since the default is to use an empty page style with \includepdf.

Similar approaches can also be followed using graphicx and eso-pic, if needed.

• I assume that the "similar approaches" involve placing the page number at absolute page position (perhaps using textpos)? That's what I would do. – user139954 Apr 18 '18 at 16:19
• @RobtAll: Yes. eso-pic provides a similar technique for placing content in absolute positions on the page, and that content could be a external image (or page from a PDF) together with textual content. It's done before page shipout, so page numbering would be correct. – Werner Apr 18 '18 at 16:33