[Tex/LaTex] Using a different page number footer in the introduction

header-footerpage-numbering

I'm using roman page numbers in my introduction section, but for the remainder of the document I use arabic numbers, and this custom footer:

\cfoot{\normalsize{\thepage~/~\pageref{LastPage}}}

This leads to ugliness like:

i/16

in the introduction.

How can I specify a different footer for the introduction?

Best Answer

You can issue a renewed \cfoot as needed to change the footer of the fancy page style. Here's a minimal example showing its usage:

enter image description here

\documentclass{article}
\usepackage{fancyhdr}% http://ctan.org/pkg/fancyhdr
\usepackage{lastpage}% http://ctan.org/pkg/lastpage
\usepackage{lipsum}% http://ctan.org/pkg/lipsum
\pagestyle{fancy}%
\begin{document}

\cfoot{\normalsize\thepage}% Show only page number in footer
\pagenumbering{roman}% Roman-numbered pages (start from i)
\section{Introduction}
\lipsum[1-15]

\clearpage
\cfoot{\normalsize\thepage~/~\pageref{LastPage}}% Show page / LastPage in footer
\pagenumbering{arabic}% Arabic-numbered pages (start from 1)
\section{Other sections}
\lipsum[16-30]
\end{document}

Renewing the footer (or header for that matter) will have an effect from "this page onward." That's why I issued \clearpage to restart the numbering and footer formatting on a fresh page. I assume you're doing the same.