Page size, Margins
The page dimensions in a LaTeX document are highly configurable and there is a package offering a simple way to change the length and layout of various elements in a document.
Last updated
The page dimensions in a LaTeX document are highly configurable and there is a package offering a simple way to change the length and layout of various elements in a document.
Last updated
geometry
packageThe geometry
package offers a simple way to change the length and layout of different elements such as the paper size, margins, footnote, header, orientation, etc.
Let's look at and example: Suppose I want to create a page with a4
paper size, margin of 2 inches, text area should not exceed 6 inches wide and 8 inches high. This is how you do it in .
And this is the result:
geometry
syntaxBefore talking about what parameters geometry
accepts, let's look at the layout of a standard document. You can do this by importing the layout
package and use \layout
in the document environment.
Below are parameters that geometry
accepts and their visualization:
textwidth
- element 8
textheight
- element 7
left
(lmargin
, inner)
- change the length of the left margin (element 1 and 3)
right
(rmargin
, outer)
- change the length of the right margin (element 9 and 10)
top
(tmargin)
- element 2 and 6
bottom
(bmargin)
- the length between the bottom edge and the document baseline.
headheight
- height of the header
headsep
- distance between header and the text body - element 6
total
- defines the dimension of body
paperwidth/paperheight
- actually change the size of the paper (for demonstration purpose only)
For reference and example: