37

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}
1
  • When you also use footers of fancyhdr, make sure that you also add includeheadfoot to the geometry package as described here.
    – user45786
    Jul 29, 2016 at 22:16

1 Answer 1

52

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}
4
  • 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, 2012 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. Dec 2, 2012 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, 2012 at 0:54
  • In case you are coming to this answer because you are writing in Markdown (or Rmarkdown) and converting to TeX via pandoc, note that you can put both the headheight= argument and the headsep= argument underneath your geometry: line in the YAML (make sure to tab in once and put each argument on its own line)!
    – mikoontz
    Aug 25, 2021 at 15:44

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .