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 am using LyX to layout a collection of essays.

There is one page-number-position per spread in the design. Please find the example below. Instead of showing 59, is it possible to show 58—59? I am using fancyhead to define the current example. my code as follow:

\renewcommand*{\chapterpagestyle}{fancy}
\fancyhead{}%
\fancyfoot{}%
\fancyhead[CE]{\rmfamily \small \leftmark}
\fancyhead[CO]{\rmfamily \small\thepage }
\fancyhead[RO, LE]{\rmfamily \small }
\renewcommand{\headrulewidth}{0pt}

Example of the task

share|improve this question
    
I think it would be funny to display 58-59 on the right page. This would esentially mean that this page has two pagenumbers. Instead I would either drop the page number in the footer and use CO,CE as options for\thepage, or I'd push it in the margin, but again display it on both pages –  Martin H Aug 23 '12 at 11:48
    
@TorbjørnT. I've used similar "dirty trick" before, and they do not anything when done correctly ;) Of course, you can use tempcntra to avoid manipulation with page counter, but it seems not ot be necessary. –  yo' Aug 23 '12 at 11:50

1 Answer 1

up vote 2 down vote accepted

You can change the corresponding line to

\fancyhead[CO]{%
  \rmfamily\small
  \addtocounter{page}{-1}%
  \thepage
  \addtocounter{page}{1}%
  --\thepage
}

We simply substract 1 from coutner page, print the page number, and add this 1 back so that we can print the current page number and we do not mess the page numbering.

share|improve this answer
    
If you needed special treatment of page one so that it does not show 0--1, don't hesitate to request it! –  yo' Aug 23 '12 at 11:51
    
fantastic! works very well! thank you! –  Shi Yuan Aug 23 '12 at 11:54

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.