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.

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

I'm using the following settings for fancyhdr in a two-page book-derived documentclass:

\fancyhead[LO]{\sffamily \footnotesize \rightmark}
\fancyhead[RE]{\sffamily \footnotesize \leftmark}
\fancyfoot[LO]{\footnotesize \thepage~{\color{red}\vline}}
\fancyfoot[RE]{\footnotesize {\color{red}\vline}~\thepage}
\fancypagestyle{plain} {
 \fancyhf{} % get rid of headers on plain pages
 \renewcommand{\headrulewidth}{0pt} % and the line
 \renewcommand{\footrulewidth}{0pt} % and the line

But, somehow, the page number on even pages gets slightly below those on odd.

share|improve this question
up vote 3 down vote accepted

I'm not quite sure the reason for your problem, but it goes away if I change to \textcolor{red}{\vline} instead of {\color{red}\vline}.

share|improve this answer

This is a known problem: \color doesn't switch to horizontal mode (it doesn't "start a line"). So if you are in vertical mode (as you are e.g. at the start of a \parbox) the following text which starts horizontal mode is forced on a new line. You get this effect e.g. in \parbox or in p-cells of a tabular. The solution is either to use \textcolor as already suggested or to quite vmode before the color command.

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.