I’m trying to do my own header for my own class with fancyhdr.
When my header is too large, the body of my document is written on top
of my header. When I compile I have a warning :
Package Fancyhdr Warning: \headheight is too small (12.0pt):
Make it at least 120.58968pt.
We now make it that large for the rest of the document.
This may cause the page layout to be inconsistent, however.
So I’m doing in my doc :
\addtolength{\headheight}{121pt}
\addtolength{\textheight}{-121pt}
And it’s ok. However I have to manually set the value to 121... Is there
any way to do it automatically, to make latex figure out/sets the
headheight alone ?
Thanks.
> Hello,
>
>
> I’m trying to do my own header for my own class with fancyhdr.
>
>
> When my header is too large, the body of my document is written on top
> of my header. When I compile I have a warning :
>
> Package Fancyhdr Warning: \headheight is too small (12.0pt):
> Make it at least 120.58968pt.
> We now make it that large for the rest of the document.
> This may cause the page layout to be inconsistent, however.
>
>
> So I’m doing in my doc :
>
> \addtolength{\headheight}{121pt}
> \addtolength{\textheight}{-121pt}
121pt for a header? That's about 10 lines. Are you sure that's a good
idea?
> And it’s ok. However I have to manually set the value to 121... Is there
> any way to do it automatically, to make latex figure out/sets the
> headheight alone ?
You can (like fancyhdr) measure the content and then set the height.
--
Ulrike Fischer
Well it’s to reserve a space (with a pspicture+text) on the top of each
page, where the reader will be able to write something (once the paper
has been printed). Is there any better way to do this ?
>> And it’s ok. However I have to manually set the value to 121... Is there
>> any way to do it automatically, to make latex figure out/sets the
>> headheight alone ?
>
> You can (like fancyhdr) measure the content and then set the height.
>
The problem is I only know the height of the pspicture, not of the text,
so how can I measure the content please ?
>>> And it’s ok. However I have to manually set the value to 121... Is there
>>> any way to do it automatically, to make latex figure out/sets the
>>> headheight alone ?
>>
>> You can (like fancyhdr) measure the content and then set the height.
>>
>
> The problem is I only know the height of the pspicture, not of the text,
> so how can I measure the content please ?
\documentclass{article}
\usepackage{fancyhdr,calc}
\pagestyle{fancy}
\fancyhf{}
\newcommand\mycontent{%
\begin{tabular}{l}
\rule{3cm}{4cm}\\
some text\\
and more
\end{tabular}}
\settototalheight\headheight{\mycontent}
\lhead{\mycontent}
\begin{document}
x
\end{document}
--
Ulrike Fischer
Thanks ! Where did you find this useful function which is
\settototalheight please ? :-)
>
> Thanks ! Where did you find this useful function which is
> \settototalheight please ? :-)
\settoheight, \settowidth and \settodepth are standard LaTeX commands,
\settototalheight (=\settoheight+\settodepth) is defined in calc.
--
Ulrike Fischer