GeneralPage numbers on certain pages

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
c0nny
Posts: 10
Joined: Sat Jun 28, 2008 12:28 pm

Page numbers on certain pages

Post by c0nny »

Hi there,

I'm using the following document class and header style

\documentclass[12pt, a4paper, titlepage, twoside, openany]{book}

\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}

\fancyhead[LO]{{\footnotesize\sffamily\itshape\rightmark}}
\fancyhead[LE]{{\footnotesize\sffamily\itshape\leftmark}}
\fancyhead[RE,RO]{\thepage}
\renewcommand{\headrulewidth}{0.0pt}
\addtolength{\evensidemargin}{1cm}
\addtolength{\voffset}{-0.4cm}

\fancypagestyle{plain}{%
\fancyhead{} %get rid of the headers on plain pages
\renewcommand{\headrulewidth}{0.0pt} % and the line
}


and I want to insert additional page numbers at the bottom of my abstract page for example, i.e. \fancyfoot[C]{\thepage}.
How can I set that for just a single page?

thanks!

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

c0nny
Posts: 10
Joined: Sat Jun 28, 2008 12:28 pm

Re: Page numbers on certain pages

Post by c0nny »

seems like I found it myself

I change the definition of \fancypagestyle{plain}

\fancypagestyle{plain}{%
\fancyhead{} %get rid of the headers on plain pages
\renewcommand{\headrulewidth}{0.0pt} % and the line
\fancyfoot[C]{\thepage}
}

and change it back to

\fancypagestyle{plain}{%
\fancyhead{} %get rid of the headers on plain pages
\renewcommand{\headrulewidth}{0.0pt} % and the line
}

after the frontmatter so that I have no numbers on the first side of proper chapters!
Ted
Posts: 94
Joined: Sat Jun 23, 2007 4:11 pm

Page numbers on certain pages

Post by Ted »

c0nny wrote:\documentclass[12pt, a4paper, titlepage, twoside, openany]{book}
...
and I want to insert additional page numbers at the bottom of my abstract page for example, i.e. \fancyfoot[C]{\thepage}.
How can I set that for just a single page?
You may want to look into the memoir document class, which is a drop-in replacement for book and has terrific documentation.
With memoir, you can do things like this:

Code: Select all

\copypagestyle{special}{plain}
\makeevenfoot{special}{}{\thepage}{}
\makeoddfoot{special}{}{\thepage}{}
The first line creates a new page style called special that is a copy of the plain pagestyle. The second and third lines modify the special pagestyle (which is a copy of plain) by placing the page number in the middle of the footer. Later, you can do

Code: Select all

\thispagestyle{special}
to have only that page marked with that style.

memoir absorbs the functionality of the fancyhdr package (and many other packages) and adds to it.

If I was doing this with fancyhdr, I would do something similar. That is, I could copy one page style to another, add a page number in the center, and then use \thispagestyle to change only the abstract to that special page style. I have little doubt that someone else will post that solution exactly. However, it's much easier to do the same thing in memoir, and you pick up so much else too.
-- Ted [home/blog]
Post Reply