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 having problems with a custom footer in my document. On pages "v" and "x" in the front matter, the text shifts up slightly. The best I can figure is that the whitespace above those two page numbers is being absorbed for some reason. How do I force the page numbers to occupy the full height of a character, so that the footer does not shift from page to page?

Currently my footer is defined in a custom page style as:

\newcommand{\my@footer}{%
\parbox{\textwidth}{%
    \medskip
    \textcolor{blue}{
        \hrule width\textwidth height 1pt%
        \vskip 3bp%
        \hrule width\textwidth height 1.5bp}
    \smallskip

    \scriptsize Version X\hfill\small\thepage

    \hfill\textbf{\large Boilerplate}\hfill\null
}}

I previously tried creating this footer with fancyhdr, but was unable to figure out how to get everything in the right place on the page. This approach works, other than the slight vertical shift on the two pages in question. (This is a reproduction of someone else's MS Word template.)

share|improve this question
    
Welcome to TeX.sx! Please add a minimal working example (MWE) that illustrates your problem. –  diabonas Mar 30 '12 at 22:19

1 Answer 1

up vote 4 down vote accepted

Use \small\strut\thepage: TeX doesn't add interline skip between a rule and a box (and the \smallskip doesn't influence this decision). So when the page number is v or x its height is less than when it's 1. Therefore the

\scriptsize Version X\hfill\small\thepage

line will appear slightly higher on page v than on page 1.

With \scriptsize Version X\hfill\small\strut\thepage you force this line to always have the same height.

share|improve this answer
    
Thanks for the explanation! It looks perfect now. –  award Apr 2 '12 at 13:52

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.