Page Layoutfancyhdr | Interferences with Change in Page Geometry

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
Post Reply
jakob
Posts: 4
Joined: Fri Dec 09, 2011 5:13 pm

fancyhdr | Interferences with Change in Page Geometry

Post by jakob »

Hi all,

I have rather a question than a problem since it is not super necessary for my layout. I couldn't find any similar topic, but I apologize if I've overseen an analogous problem.

I am using two sided book class which results in a slight asymmetric layout of the pages. this is fine, now i wanted to change only the title page to a more centered style, setting both margins to the same width. i tried to do that with the geometry package, e.g.

Code: Select all

\newgeometry{left=1cm, right=1cm}
title page
\restoregeometry
The strange thing is, every time i insert those two lines, even if there is no code whatsoever in between, fancyhydr gives me the head height error for the rest of the document.

Code: Select all

Package Fancyhdr Warning: \headheight is too small (12.0pt): 
 Make it at least 14.49998pt.
I don't get this error if i erase the two lines which are supposed to change the margin width for only the first page. I don't get it.

So now I wanted to create a minimal example, and i get the error message even without changing geometry for the title page. So clearly something is wrong, but why do i not get the error for my full document?

Code: Select all

\documentclass[a4paper, 12pt]{book}

\usepackage[T1]{fontenc} 
\usepackage[utf8]{inputenc} 
\usepackage[ngerman, english]{babel} 
\usepackage{fancyhdr} % headings and footers. 
\usepackage[a4paper]{geometry}

\begin{document}

\pagestyle{fancy}
\renewcommand{\chaptermark}[1]{\markboth{#1}{}} 
\renewcommand{\chaptername}{}
\renewcommand{\sectionmark}[1]{\markright{#1}{}} 
\fancyfoot{} %clear foot
\fancyfoot[LE,RO]{\thepage}
\fancypagestyle{plain}{ %for chapter titles
	\fancyhf{} 
	\fancyfoot[LE,RO]{\thepage}
	\renewcommand{\headrulewidth}{0pt}
	}

\pagestyle{empty}
\newgeometry{left=1cm, right=1cm}
\vspace*{2cm}
\begin{otherlanguage*}{ngerman}
\begin{center}
\LARGE
my thesis title\\[3cm]
\normalsize
\end{center}
\end{otherlanguage*}
\restoregeometry
\cleardoublepage

\pagestyle{fancy}
\chapter{Lorem ipsum}
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
\cleardoublepage
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.

\end{document}
I could obviously avoid the error by simply using

Code: Select all

\usepackage[a4paper, headheight=15pt]{geometry}
but i also want to understand why i get it in the first place...

thanks for any feedback,
jakob

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Post Reply