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.

is it possible to define different \headerheight for head and foot respectively? For example, there is a logo image in the header which needs a large \headerheight and only text is in foot which needs a small \headerheight. Or does it have two variables to control the heights of foot and head respectively?

share|improve this question

2 Answers 2

if you want to see your page layout with the given values, then print it:

\documentclass[twoside]{article}
\usepackage{layout}
\begin{document}

\layout

\end{document}

enter image description here

share|improve this answer

The height of the header is given by \headheight (not \headerheight). The distance between the baseline of the header and the top of the page text is then given by \headersep.

The height of the footer is defined differently. The dimension \footskip states in what distance the baseline of the footer is set to the bottom of the page text. Have a look at the manuals of fancyhdr and geometry, both show a nice drawing explaining all page related dimensions.

If you use fancyhdr for your header and footer it tells you automatically which dimension is to small and to what value you have to set it. This can then be done using geometry:

\documentclass{article}
\usepackage[head=30pt,foot=<..>]{geometry}
\usepackage{fancyhdr}

\fancyhead{}
\fancyfoot{}
\fancyhead[c]{\Huge LOGO}
\fancyfoot[c]{Some normal text}
\pagestyle{fancy}
% Disable header and footer rules
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}

\begin{document}
 Text ...
\end{document}

Without the head= setting fancyhdr showed the following warning:

Package Fancyhdr Warning: \headheight is too small (12.0pt): 
 Make it at least 30.0pt.
 We now make it that large for the rest of the document.
 This may cause the page layout to be inconsistent, however.
share|improve this answer
    
@Martin defining the values for head and foot in geometry does work. thanks. i have another question. how can i know the exact height value, e.g., 30pt in your example? one way is that i don't define \headheight then i get the value from the warning. however, i generate tex source files of calculate sheets from my own program. it is a bundle of files. if i update the height value manually, it will be depressing. i can get the height value by \settototalheight\headheight{\maxof{\leftheadercalc}{\rightheadercalc}{\midhead‌​ercalc}}. so how can i set this value to head in geometry? –  warem Feb 13 '11 at 14:01
    
@Martin due to character limit, i have to split my comment into two pieces. in above comment, \leftheadercalc, \rightheadercalc, \midheadercalc are newcommand definition of the real content of head. in tex, how to set value to a variable especially it is in preamble. –  warem Feb 13 '11 at 14:07
    
@warem: Funny geometry should work. However AFAIK it stoes sets the head= value in \headheight and foot= in \footskip. Check its manual again for the details. –  Martin Scharrer Feb 13 '11 at 14:13
    
@Martin what is the meaning of "AFAIK"? on the other hand, i found i had made a concept mistake. the foot height is controlled by footskip.:( –  warem Feb 14 '11 at 9:26
    
@waren: AFAIK = As Far As I Know; and IMHO = In My Humble Opinion. And I state that the footer height is controlled by \footskip in my answer. –  Martin Scharrer Feb 14 '11 at 9: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.