2

I'm trying to update a old template. Therefore I want to replace the vmargin package by the geometry package:

Code before:

\setpapersize{A4}
\setmarginsrb{3cm}{1cm}{3cm}{1cm}{6mm}{7mm}{5mm}{15mm}

Code after:

\geometry{a4paper,left=30mm,top=10mm,right=30mm,bottom=10mm,headheight=6mm,headsep=7mm,foot=5mm,footskip=15mm}

However, the margins are not the same. For example, the header line is much higher than before. Is there a way, to get the same margins by using the geometry package?

Thomas

  • 1
    Welcome to TeX.SX! Switching to geometry is indeed a good choice. – egreg Oct 17 '17 at 15:41
4

The difference in height is as a result of includeheadfoot. Add this option to your geometry specification.


As an example showcasing the similar output, consider the following code using vmargin:

\documentclass{article}

\usepackage{vmargin,showframe}
\setpapersize{A4}
\setmarginsrb{3cm}{1cm}{3cm}{1cm}{6mm}{7mm}{5mm}{15mm}

\begin{document}

Here is some text.

\end{document}

Assume the output is vmargin_exampe.pdf. Now compile:

enter image description here

\documentclass{article}

\usepackage{geometry,pdfpages}
\geometry{
  a4paper,showframe,
  left=30mm,top=10mm,right=30mm,bottom=10mm,
  headheight=6mm,headsep=7mm,foot=5mm,footskip=15mm,
  includeheadfoot
}
\begin{document}
Here is some text.

\clearpage

\includepdf{vmargin_example}

\end{document}
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.