Page Layoutgeometry | Margins not set as specified

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
Post Reply
seroland86
Posts: 1
Joined: Sun Oct 14, 2012 1:56 pm

geometry | Margins not set as specified

Post by seroland86 »

I am using the geometry package to set margins of my document. Unfortunately the given values are not being implemented as expected. What I need is the following:

left margin: 4.0cm
right margin: 2.0cm
top margin: 2.5cm
bottom margin: 1.0cm

Finally I got it working but with totally different values in the definition. Can somebody explain why this is and give a proper solution so that I can put the values from above into the definition and the outputs really is like that?

Here is my document:

Code: Select all

\documentclass[11pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage{graphicx}
\usepackage{microtype}
\usepackage[printonlyused]{acronym}
\usepackage{fancyhdr}
\usepackage{lipsum}
\usepackage[nottoc,numbib]{tocbibind}
\usepackage{geometry}
\geometry
{
	top=15.5mm,
	bottom=30mm,
	left=35mm,
	right=25mm,
	headsep=5.5mm,
	footskip=10mm
}

% include metadata
\input{srkssa_meta}
% header definition
\setlength{\headheight}{15.5mm}
\pagestyle{fancy}
\fancyhf{}
\lhead{\fontsize{10}{10} \selectfont \ThesisTitle}
\rfoot{\fontsize{10}{10} \selectfont \thepage}

\begin{document}
% start trailer
\thispagestyle{empty}
\input{srkssa_titlepage}	% titlepage
\newpage
\pagenumbering{roman}
\setcounter{page}{2}
\addcontentsline{toc}{section}{Eidesstattliche Erklärung}
\input{srkssa_auo}			% assertion under oath
\newpage
\tableofcontents			% table of content
\newpage
\addcontentsline{toc}{section}{Abbildungsverzeichnis}
\listoffigures				% list of figures
\newpage
\addcontentsline{toc}{section}{Abkürzungsverzeichnis}
\section*{Abkürzungsverzeichnis}
\input{srkssa_acronyms}		% list of acronyms
\newpage

% start main
\pagenumbering{arabic}
\setcounter{page}{1}
\input{srkssa_intro}		% introduction
\newpage
\input{srkssa_sor}			% stage of research
\newpage
\input{srkssa_gws}			% gpu-warp sort
\newpage
\input{srkssa_summary}		% summary
\newpage
\input{__temp}				% temp
\newpage
\include{lipsum}			% lipsum
\newpage
\renewcommand\refname{Literaturverzeichnis}
\bibliographystyle{plain}
\bibliography{srkssa_literature}
\end{document}
Thanks in advance!

Sebastian

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

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

geometry | Margins not set as specified

Post by localghost »

For setting up the specified margins you should take some important things into account.
  • Are the header and footer part of the text body or are they to be shifted into the vertical margins (top and bottom)?
  • Is a binding correction (or binding offset) for the inner margin (left margin in a one-sided document) to be regarded?
  • Does the problem occur only in the printed document?
I have no problem with the desired margins if I include the header and footer into the text body (see below).

Code: Select all

\documentclass[11pt,a4paper,ngerman]{article}
\usepackage[T1]{fontenc}
\usepackage{selinput}
\SelectInputMappings{
  adieresis={ä},
  germandbls={ß},
  Euro={€}
}
\usepackage{babel}
\usepackage{geometry}
\geometry{
  top=25mm,
  bottom=10mm,
  left=40mm,
  right=20mm,
  includeheadfoot,
  headsep=5.5mm,
  footskip=10mm
}
\usepackage{fancyhdr}
\usepackage{lmodern}
\usepackage[babel]{microtype}
\usepackage{blindtext}

\pagestyle{fancy}
\fancyhf{}
\lhead{\small Thesis Title}
\rfoot{\small \thepage}

\begin{document}
  \blinddocument
\end{document}
Finally your declaration of \headheight could be a bit problematic. For details about the geometry package you should consult its manual.

By the way, this is a very strange type area. Does not look very professional.


Best regards and welcome to the board
Thorsten
Post Reply