[Tex/LaTex] How to avoid the geometry package to change to top/bottom margins

geometrymargins

For my master thesis, i need to print recto verso with margins 4cm and 1 cm (left and right). So I use the following package:

\usepackage[inner=4cm,outer=1cm]{geometry}

However, this increases my bottom margin (with about 1 cm i'm guessing) which ruins my entire document. How can I avoid this package to influence the other margins (when i don't even define them explicitly)?

Best Answer

If I run this sample document

\documentclass{book}
\usepackage[a4paper,pass,verbose]{geometry}

\usepackage{lipsum}

\begin{document}
\lipsum
\end{document}

I get, in the log file and on the console, the relevant lengths:

* \textheight=550.0pt
* \topmargin=22.0pt
* \headheight=12.0pt
* \headsep=18.06749pt

Rounding \headsep is irrelevant, so I'll use 18pt:

\documentclass{book}
\usepackage[a4paper,verbose]{geometry}
\geometry{
  inner=4cm,outer=1cm,
  top=\dimexpr1in+22pt+12pt+18pt,% standard offset+topmargin+headheight+headsep
  headheight=12pt,
  headsep=18pt,
  textheight=550pt,
}

\usepackage{lipsum}

\begin{document}
\lipsum
\end{document}

This prints

* \textheight=550.0pt
* \topmargin=22.0pt
* \headheight=12.0pt
* \headsep=18.0pt

which agrees with the standard setup.

With \documentclass[11pt,a4paper]{book} (the twoside and openright options are on by default), the values obtained in the first step are

* \textheight=595.80026pt
* \topmargin=24.0pt
* \headheight=12.0pt
* \headsep=19.8738pt

so the change should be

\documentclass[11pt]{book}
\usepackage[a4paper,verbose]{geometry}
\geometry{
  inner=4cm,outer=1cm,
  top=\dimexpr 1in+24pt+12pt+19.8738pt,% standard offset+topmargin+headheight+headsep
  headheight=12pt,
  headsep=19.8738pt,
  textheight=595.80026pt,
}
\usepackage{lipsum}

\begin{document}
\lipsum
\end{document}

with this setup I get as output

* \textheight=595.80026pt
* \topmargin=24.0pt
* \headheight=12.0pt
* \headsep=19.8738pt

Note that, in any case, LaTeX just looks at the values of \topmargin, \headheight, \headsep and \textheight; the bottom margin is whatever remains.

This is the output I get for the first page with the new settings

enter image description here

and this is the output without loading geometry

enter image description here