Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I have a book I'm laying out in pdflatex. The page numbers are on the outer corners of the pages (along with some other header and footer stuff.)

Occasionally, the document has a full-page image inserted like a plate, where that page has no style at all, just the image. The catch is that these pages also shouldn't be counted for page numbers, so that you get

page 54 page with image page 55

I've got it skipping the page for page numbering purposes, but it doesn't skip the page for determining whether it's a right or left handed page, which means that after an image page the page numbers seem to jump from the outer corners to the inner corners.

The code I'm using is this:

%end of page 54

\newpage
\thispagestyle{empty}
%insert image
\newpage
\setcounter{page}{55}

%begin page 55 content

(with the details of inserting the page hand-waved away since each image is a slightly different size and needs unique handling.)

(And the outer margin is close enough to the gutter margin that I can't tell if the margins are correctly flip-flopping as well, but I think they are.)

So, how do I tell TeX to keep the page numbers in the right place after skipping a page?

share|improve this question
add comment

3 Answers

up vote 5 down vote accepted

In a twoside layout even pages are always on the left side and odd pages on the right side. If you insert one unnumbered page this get out of sync. So you must also insert its (unnumbered) back.

share|improve this answer
    
Well, hey. That was easy, and actually much closer to the "old-school plate" look I was going for. –  Electrons_Ahoy Jan 17 '11 at 21:39
    
aren't left and right inverted in your answer? At least for left-to-right writing. :-) –  egreg Jun 3 '11 at 17:03
    
@egreg Yes seems so. (I'm one of the people who always says "turn left" when they mean "turn right") –  Ulrike Fischer Jun 3 '11 at 19:08
    
corrected. :-) –  egreg Jun 3 '11 at 21:02
add comment

This is a non-answer, but meant seriously: Don't do it! If you have a full-page image, then it's indeed a good idea not to print a page number on that page. Nevertheless, the page should be counted. If I'd buy your book and discover the messy page numbering, I'd find it annoying.

There is one case where it's good not to count the pages with images, namely if you have several pages in a row that just contain images. But this should be an even number of pages.

share|improve this answer
add comment

This answer does what you want, but it has nasty side effects, which may be hard to fix. Page references (e.g. in table of contents) will be messed up.

Use the fancyhdr package to set the header so that it displays the page number minus the number of plates that have been encountered.

\documentclass[twoside]{article}
\usepackage{fancyhdr}

\newcounter{displaypage}

\newcommand{\mypageno}{%
 \setcounter{displaypage}{\thepage}
 \addtocounter{displaypage}{\thestepback}
 \thedisplaypage
}

\pagestyle{fancy}
\fancyhead[LO,RE]{\mypageno}
\fancyhead[LE,RO]{}
\fancyfoot{}

\newcounter{stepback}
\setcounter{stepback}{0}

\newcommand{\platepage}{%
  \thispagestyle{empty}
  This is a plate page.
  \addtocounter{stepback}{-1}
}

\begin{document}
A \eject
B \eject
C \eject
\platepage \eject
E \eject
F \eject
\platepage \eject
G \eject
H \eject
I
\end{document}
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.