TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

In Showcase of beautiful typography done in TeX & friends Marc van Dongen shows his book LaTeX and Friends, http://tex.stackexchange.com/a/46348/15360.

He uses a specific page header as can be seen in the pictures he shows us.

Page number <vertical rule> Chapter number


Chapter name <vertical rule> Page number

I really like it and would like to get the same format or very similar to it if possible and was wondering how this can be achieved?

enter image description here

share|improve this question
up vote 7 down vote accepted

One option using fancyhdr and the offsets provided by the package. Using


the headers are offset by an amount equal to \marginparsep+\marginparwidth to the right on odd-numbered pages and to the left on even-numbered ones. Then the actual headers are placed using


A complete example code:




\chapter{Test chapter}


enter image description here

share|improve this answer
Instead of \enspace\enspace you could use \quad. By the way, I don't know where I read it (and how “important” it is) but \enskip is the LaTeX preferred way, instead of \enspace. – Manuel May 26 '14 at 1:48
@Manuel I changed to \quad. In this case, there's no difference between \enspace and \enskip; both are kernel commands: the former is a \kern: \def\enspace{\kern.5em } the other is a \hskip: \def\enskip{\hskip.5em\relax}. – Gonzalo Medina May 26 '14 at 1:57
Using \enspace may be dangerous if it happens to fall at where a paragraph should start, because it would issue a vertical space; \enskip would start horizontal mode, instead, but allowing a line break. A header is normally typeset in restricted horizontal mode, so there's no difference between the two, in that case. – egreg May 26 '14 at 9:27

I've tried to rebuild this with pure komascript and came to this solution:


%setting lengths

% scrlayer definitions
\cohead{\raggedleft{\headmark} \hspace{\chapterHeaderSkip}}
\cehead{\hspace{\chapterHeaderSkip} \raggedright{\headmark} }


enter image description here

share|improve this answer

Your Answer


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.