Skip to content

Multi line header does not play well with geometry headsep parameter #11

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
awa5114 opened this issue Aug 18, 2021 · 1 comment
Open

Comments

@awa5114
Copy link

awa5114 commented Aug 18, 2021

I would like to use the geometry package alongside fancyhdr. To control the distance between header and main text in my article documentclass, this question recommends use of the headsep parameter:

\documentclass[11pt, a4paper]{article}
\usepackage[includehead, headsep=5pt]{geometry}
\usepackage{fontspec}
\usepackage{fancyhdr}


\pagestyle{fancy}
\fancyhf{}
\fancyhead[C]{A header}%\\a new line in the header}

\renewcommand{\headrulewidth}{1.5pt}

\begin{document}
  \section*{Education}

\end{document}

This seems to work fine, and modifying the headsep indeed modifies the distance between the header and the section title.
enter image description here
However, it so happens that my header is multi-line. as soon as I uncomment line 9 as follows:

\fancyhead[C]{A header\\a new line in the header}

The section title clashes with the header, which I do not want.
enter image description here
How can I get headsep to remain aware that my header is now multi line?

@davidcarlisle
Copy link
Member

as noted in comments on this question, the problem is not headsep but headheight it is a user-setable length that you need to set to be at least the height of the actual content. Especially if as here you change the heading adding tall content after the page head has been set up then there is not really anything geometry can do here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants