31

How would one increase the height of the \fancyhead{} so that the text in the main body, doesn't collide with the title?

I have the following MWE:

\documentclass[a4paper,10pt,oneside]{article}
\usepackage{fancyhdr}
\usepackage[english]{babel} % Required to compile in Windows
\usepackage[letterspace=150]{microtype}
\usepackage{fontspec}

\pagestyle{fancy}
\setmainfont {Adobe Garamond Pro} % Main document font

\renewcommand{\headrulewidth}{0pt}

\fancyhead[C]{
    \addfontfeature{LetterSpace=20.0}\fontsize{30}{30}\selectfont\scshape Foo Bar Camp Names\\[5mm]
}

\begin{document}
\section*{Foo}
\end{document}

However, the section foo starts right in the header, therefore I want to add some vspace in between header and main body. I tried \vspace, \bigskip, and all other sorts of vertical space commands, but none worked.

Updated MWE:

\documentclass[a4paper,10pt,oneside]{article}
\usepackage{marvosym} % Allows the use of symbols
\usepackage[english]{babel} % Required to compile in Windows
\usepackage[letterspace=150]{microtype}
\usepackage{fontspec}
\usepackage{fancyhdr}
%\usepackage[headheight=110pt]{geometry}

\pagestyle{fancy}
\setmainfont {Adobe Garamond Pro} % Main document font

\renewcommand{\headrulewidth}{0pt}
\setlength{\headheight}{110pt} 

\fancyhead[C]{
    \addfontfeature{LetterSpace=20.0}\fontsize{30}{30}\selectfont\scshape Foo Bar Camp Names\\
}

\fancyfoot[C]{
    \lsstyle
    \scshape{
        \renewcommand{\\}{\ {\large\textperiodcentered}\ }
        Foo Street \\Bar\\Foocountry
    }\\
    {\Large\Letter} foo@bar.com \ {\Large\Telefon} (+001) 000-0000000
}

\begin{document}
\date{} % hide date
\section*{Foo Bar}
\end{document}
  • When you also use footers of fancyhdr, make sure that you also add includeheadfoot to the geometry package as described here. – user45786 Jul 29 '16 at 22:16
45

You log file says (in the warning)

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

Hence a safe head height will be around 110pt. To change this, you can use

\setlength{\headheight}{110pt} 

or

\usepackage[headheight=110pt,showframe]{geometry}

Code:

\documentclass[a4paper,10pt,oneside]{article}
\usepackage{fancyhdr}
\usepackage[english]{babel} % Required to compile in Windows
\usepackage[letterspace=150]{microtype}
\usepackage{fontspec}
%\setlength{\headheight}{110pt} %%or

\usepackage[headheight=110pt]{geometry}


\pagestyle{fancy}
\setmainfont {Adobe Garamond Pro} % Main document font

\renewcommand{\headrulewidth}{0pt}

\fancyhead[C]{
    \addfontfeature{LetterSpace=20.0}\fontsize{30}{30}\selectfont\scshape Foo Bar Camp Names\\[5mm] %% why this 5mm vertical space??
}

\begin{document}
\section*{Foo}
\end{document}

enter image description here

As a side note, I did not understand the reason for 5mm vertical space you left in the header. I think you tried to correct the spacing. If so, better way is to use geometry and adjust head height. Without this 5mm the head height of 65pt is sufficient.

Update:

To answer the comments below:

\documentclass[a4paper,10pt,oneside]{article}
\usepackage{marvosym} % Allows the use of symbols
\usepackage[english]{babel} % Required to compile in Windows
\usepackage[letterspace=150]{microtype}
\usepackage{fontspec}
\usepackage{fancyhdr}
\usepackage[top=1.5in,bottom=1in,right=1in,left=1in,headheight=65pt]{geometry}

\pagestyle{fancy}
\setmainfont {Adobe Garamond Pro} % Main document font

\renewcommand{\headrulewidth}{0pt}
%\setlength{\headheight}{95pt}

\fancyhead[C]{
    \addfontfeature{LetterSpace=20.0}\fontsize{30}{30}\selectfont\scshape Foo Bar Camp Names
}

\fancyfoot[C]{
    \lsstyle
    \scshape{
        \renewcommand{\\}{\ {\large\textperiodcentered}\ }
        Foo Street \\Bar\\Foocountry
    }\\
    {\Large\Letter} foo@bar.com \ {\Large\Telefon} (+001) 000-0000000
}

\begin{document}
\date{} % hide date
\section*{Foo Bar}
\end{document}

enter image description here

The gap between the header and the main body is decided by the length headsep. This can be controlled by the option (to geometry) as headsep=1cm (change the length 1cm as needed):

\usepackage[top=1.5in,bottom=1in,right=1in,left=1in,headheight=65pt,headsep=1cm]{geometry}
  • Thanks! The 5mm was a remainder from my actual code, where I had a second headline. My LaTeX parser didn't give me the warning you got... weird. – cherrung Dec 2 '12 at 11:50
  • 2
    @cherrung -- when you say your latex parser didn't give the warning, do you mean on your screen, or did you look in the log? the log contains a lot more information than what's shipped out to the screen, and sometimes it's really important. – barbara beeton Dec 2 '12 at 13:27
  • @cherrung: See the updated answer. You can adjust the headsep. Give suitable values as you need. Also play with other values like the margin. – user11232 Dec 3 '12 at 0:54

protected by Community Sep 11 '17 at 7:57

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

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