0

I have to write an official document following some precise instructions:

  • top margin: 3;

  • bottom margin: 2.5;

  • left margin 2.5;

  • right margin: 2.5;

  • header distance from border: 1.25;

  • footer distance from border: 1.25;

The thing is, I can't find the right commands to do it.

By far, I have written this:

\geometry{vmargin={3cm,2.5cm}}
\geometry{hmargin={2.5cm,2.5cm}}

How can I add the header and the footer's distances from the border?

Looking online, I found this:

\geometry{top = 1.25cm, bottom = 1.25cm}

but I don't think it works properly.

Can anybody help me please?

5
  • 2
    See illustration in geometry documentation, page 3 figure 1: show, how you still can use headsep and headheight (if needed), and footskip. For your example, if I correctly understood your descriotion of page layout:: \documentclass{article} \usepackage[hmargin={2.5cm,2.5cm},vmargin={3cm,2.5cm}, headheight=1.25cm, %headsep=1.25cm, footskip=1.25cm, showframe]{geometry} \begin{document} hello! \end{document}
    – Zarko
    Commented May 21, 2020 at 10:20
  • Dear @Zarko, thanks for you answer! I'm trying to use it as it is in my file. I don't know why, but now it gives me error on the following lines ``` \theoremstyle{example} \newtheorem{es}{Esempio}[chapter]``` Do you think these are correlated? By removing your line it doesn't give me any error Commented May 21, 2020 at 10:34
  • 1
    No it is not correlated. For more help we need to see an file example which reproduce your problem. Ask new question and show it.
    – Zarko
    Commented May 21, 2020 at 10:59
  • Thank you very much! Commented May 21, 2020 at 12:25
  • It should be noted that the definition of top and bottom changes with nohead, nofoot and/or noheadfoot. Commented May 21, 2020 at 13:00

2 Answers 2

1

This works (precision better than 0.1mm): demo with a4 paper:

\documentclass[a4paper, 12pt]{article}
\usepackage[showframe]{geometry}
\geometry{margin=2.5cm, top=3cm, headsep=1.75cm, footskip=1.25cm}
\usepackage{lipsum}

\begin{document}

\lipsum[1-3]

\end{document} 

enter image description here

6
  • 1
    It gives me this error: LaTeX Error: Option clash for package geometry. See the LaTeX manual or LaTeX Companion for explanation. Type H <return> for immediate help. ... l.54 \geometry {margin=2.5cm, top=3cm, headsep=1.25cm, footskip=1.25cm} Commented May 21, 2020 at 12:28
  • You have the error for this very document?
    – Bernard
    Commented May 21, 2020 at 12:30
  • No, for mine. I just copy part of your lines into mine Commented May 21, 2020 at 12:34
  • 1
    This means geometry is already loaded by another package , or your document class with other options. Could you post a minimal example code reproducing the problem?
    – Bernard
    Commented May 21, 2020 at 12:39
  • I accidentaly wrote it in another part of the document. Thank you very much for your help!! Commented May 21, 2020 at 12:46
0

If you want to go old school:

The 1in top and side margin is built into the TeX engine itself.

\setlength{\topmargin}{\dimexpr 1.25cm-1in}
\setlength}\headsep}{\dimexpr 3cm-1in-\topmargin-\headheight}
\setlength{\textheight}{\dimexpr \paperheight-3cm-1in-\topmargin-\headheight-\headsep}
\setlength{\footskip}{\paperheight-1.25cm-1in-\topmargin-\headheight-\headsep-\textheight}
\setlength{\oddsidemargin}{\dimexpr 2.5cm-1in}
\setlength{\evensidemargin}{\oddsidemargin}% both oneside and twoside, in this case
\setlength{\textwidth}{\dimexpr \paperwidth-2.5cm-1in-\oddsidemargin}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .