# How to ensure that margins are correct - geometry package is not working properly

I must prepare my thesis to meet following criteria:

• A4 paper,
• all margins must be equal to 2,5 cm,
• font must be Times New Roman, 12 points,
• page numbering on the bottom of the page, in the middle

I used geometry package (line: \usepackage[a4paper,left=2.5cm,right=2.5cm,top=2.5cm,bottom=2.5cm]{geometry}) to set properly margins. Unfortunately, publishing house requested to amend top and bottom margins, because they're too small. I used screen ruler application and I can confirm that something is wrong. Could you suggest solution? I tried to change order of loading packages, but it doesn't help.

My minimal working example is as follows:

\documentclass[twoside,12pt]{mwbk} % polish counterpart of book class

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage{blindtext} % package for generating some dummy text
\usepackage{apalike}
\let\bibhang\relax
\usepackage[round]{natbib}
\usepackage{amsmath, amssymb}
\usepackage{floatrow}
\floatsetup[table]{capposition=top}
\floatsetup[figure]{capposition=bottom}

\usepackage{polski}
\usepackage[english, polish]{babel}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\def\UrlBreaks{\do\/\do-}

\usepackage{longtable,booktabs}

\usepackage{graphicx}
\graphicspath{ {grafika/} {ObrazkiZRaportuZDyzagregacji/figures/} }

\raggedbottom % Solution from: https://tex.stackexchange.com/questions/36423/random-unwanted-space-between-paragraphs

\usepackage[all]{nowidow}

\usepackage[lang=english]{bicaption}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%% THERE's an issue

% MARGINS must be equal 2,5 cm
\usepackage[a4paper,left=2.5cm,right=2.5cm,top=2.5cm,bottom=2.5cm]{geometry}

% MUST be Times
\usepackage{times}
\usepackage{mathptmx}
\urlstyle{same}

\usepackage{fancyhdr}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{document}

\section{Introduction}

\pagestyle{fancy}
\fancyfoot[CE,CO]{\thepage}

\blindtext[10]

\begin{figure}[h!]
\centering
\includegraphics[scale=1.7]{universe.jpg}
\bicaption{Kosmos}{The Universe}
\label{fig:univerise}
\end{figure}

\section{Conclusion}
I always thought something was fundamentally wrong with the universe'' \citep{adams1995hitchhiker}

\bibliographystyle{papalike}
\twocolumn
{\footnotesize \bibliography{references}}
\end{document}


and the result PDF (I run 'Screen Ruler' app to show margins):

and bottom margins seems to be too small - let me cite publishing house: "Margins - bottom margins are a little too small (it is 1 cm, should be 2.5 cm)"

• So you mean the head and foot should be within the vertical margins (not the usual understanding of margins in terms of geometry)? – TeXnician Jun 16 '17 at 11:04
• Try includehead and includefoot. – TeXnician Jun 16 '17 at 11:05
• Add the option includeheadfoot to geometry. By default the margins are relative to the main body. And since all margins are equal, you can shorten the option to a simple margin=2.5cm. – Bernard Jun 16 '17 at 11:05

As you want the header and footer included within the text body you have to use either includehead and includefoot or includeheadfoot as options for geometry.

Btw: Your document does not compile without disabling caption's compatibility mode.

\PassOptionsToPackage{compatibility=false}{caption}
\documentclass[twoside,12pt]{mwbk} % polish counterpart of book class

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage{blindtext} % package for generating some dummy text
\usepackage{apalike}
\let\bibhang\relax
\usepackage[round]{natbib}
\usepackage{amsmath, amssymb}
\usepackage{floatrow}
\floatsetup[table]{capposition=top}
\floatsetup[figure]{capposition=bottom}

\usepackage{polski}
\usepackage[english, polish]{babel}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\def\UrlBreaks{\do\/\do-}

\usepackage{longtable,booktabs}

\usepackage[demo]{graphicx}

\raggedbottom % Solution from: https://tex.stackexchange.com/questions/36423/random-unwanted-space-between-paragraphs

\usepackage[all]{nowidow}

\usepackage[lang=english]{bicaption}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%% THERE's an issue

% MARGINS must be equal 2,5 cm

% MUST be Times
\usepackage{times}
\usepackage{mathptmx}
\urlstyle{same}

\usepackage{fancyhdr}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{document}

\section{Introduction}

\pagestyle{fancy}
\fancyfoot[CE,CO]{\thepage}

\blindtext[10]

\begin{figure}[h!]
\centering
\includegraphics[scale=1.7]{universe.jpg}
\bicaption{Kosmos}{The Universe}
\label{fig:univerise}
\end{figure}

\section{Conclusion}
I always thought something was fundamentally wrong with the universe'' \citep{adams1995hitchhiker}

\bibliographystyle{papalike}
\twocolumn
{\footnotesize \bibliography{references}}
\end{document}

• Regarding 'disabling caption's compatibility mode' ---> I am using bicaption, I do not load caption package at all, because it is managed by bicaption. I am aware that there's a warning (caused by using mwbk class instead of book with bicaption), but it compile (at least on my computer and on the ShareLaTeX). – matandked Jun 16 '17 at 11:12
• @matandked For me on TL17 it raised an error. But that was just an annotation. Important is the rest of the answer. – TeXnician Jun 16 '17 at 11:15