1

I'm putting my headers in the outer margins where they shouldn't take up any vertical space. I though to achieve this by using \vbox to 0pt{...}, but fancyhdr isn't buying. Here is the error message:

Package Fancyhdr Warning: \headheight is too small (12.0pt): 
Make it at least 15.60004pt.
We now make it that large for the rest of the document.
This may cause the page layout to be inconsistent, however.

I have no idea where this figure of 15.60004pt is coming from or how to write the header in such a way as not to take up any vertical space. MWE enclosed; the key macro is \nrlefthead. (The example is not quite minimal, but replacing all the named lengths with literal lengths would make it hard to read.)

\documentclass[twoside]{book}

\newdimen\blockwidth
\newdimen\blockheight

\blockwidth=120mm
\blockheight=220mm

\usepackage{etex}

\usepackage[twoside,top=10mm,body={\blockwidth,\blockheight}]{geometry}

\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}
\fancyhead[EL]{\nrlefthead}
\renewcommand\headrulewidth{0pt}

\newdimen\nrheaddrop
\nrheaddrop=1.5in

\newdimen\nrleftheadrightmargin
\setlength\nrleftheadrightmargin{-20mm}

\newdimen\myheadwidth
\setlength{\myheadwidth}{180pt}

\newcommand\nrlefthead{%
  \vbox to 0pt{\vspace*{\nrheaddrop}%
               \llap{\parbox{\myheadwidth}%
                         {\raggedright\noindent\itshape
                         \nouppercase{\leftmark}}%
                         \hspace*{\nrleftheadrightmargin}}%
               \vss}}


\renewcommand\chaptermark[1]{\markboth{#1}{}}


\usepackage{lipsum}

\begin{document}

\chapter{An innocuous title}

\lipsum[23-30]
\end{document}
4

Avoid \vbox if you don't know about it.

\documentclass[twoside]{book}

\newdimen\blockwidth
\newdimen\blockheight

\blockwidth=120mm
\blockheight=220mm

\usepackage[twoside,top=10mm,body={\blockwidth,\blockheight}]{geometry}

\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}
\fancyhead[EL]{\nrlefthead}
\renewcommand\headrulewidth{0pt}

\newdimen\nrheaddrop
\nrheaddrop=1.5in

\newdimen\nrleftheadrightmargin
\setlength\nrleftheadrightmargin{-20mm}

\newdimen\myheadwidth
\setlength{\myheadwidth}{180pt}

\newcommand\nrlefthead{%
  \parbox[t][0pt]{\textwidth}{%
    \vspace*{\nrheaddrop}%
    \llap{%
      \parbox[b]{\myheadwidth}{%
        \raggedright\noindent\itshape
        \nouppercase{\leftmark}%
      }%
      \hspace*{\nrleftheadrightmargin}%
    }%
  }%
}


\renewcommand\chaptermark[1]{\markboth{#1}{}}


\usepackage{lipsum}

\begin{document}

\chapter{An innocuous title}

\lipsum[23-50]
\end{document}
  • That's great! I am an old plain \TeX hacker from way back, and I still use those commands habitually. For my education, why did the \vbox to 0pt{...} fail? – Norman Ramsey Dec 3 '19 at 20:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.