I'm trying to typeset a book, covering a world trip. Instead of standard page numbers, I want each page to correspond with a digit representing driven kilometers. Of course I can't manually set that on each page, but I know on certain pages (looking at my GPS tracks) what the kilometer reading on that page would be. So imagine I know 2-3 certain numbers per chapter. The rest needs to be interpolated and rounded (or simply post-comma digits dropped) and spaces out evenly between the pages with known "counter" pages. Any ideas on how to do that? :)

I would probably need a new command, like \thisPageKilometerReading{12345}. The rest could/should be done automatically. I could also set the max. kilometers which would always appear on the last page.

Hope this is not toooo much to wish for?

(I'm using XeLaTeX and a KOMA-Script document class.)


1 Answer 1


You can use the \markright macros that are meant to typeset the section/chapter marks in the header. We first make \section not modify \rightmark, then we introduce a new command to set the right mark, and by fancyhdr package we change the headers/footers. See the example:

\documentclass[12pt,a5paper]{article} % so that the pages are small


\fancyhead[LE,RO]{km \rightmark}

\usepackage{lipsum} % dummy text generator













  • I provided an example in article class, because (1) I'm not a KOMA user at all and (2) you didn't provided a MWE.
    – yo'
    Nov 2, 2012 at 10:02
  • This of course does not deal with the “The rest needs to be interpolated” request...
    – cgnieder
    Dec 28, 2012 at 14:21

You must log in to answer this question.