Page Layout

The geometry directive provides an easy and flexible interface to customize page layout. It uses the LaTeX geometry package and it's description here is a (modified) part of the geometry package documentation.

The geometry directive implements auto-centering and auto-balancing mechanisms so that the users have only to give the least description for the page layout. In this case, what you have to do is just

{geometry:a4paper}

In addition to this centering problem, setting margins from each edge of the paper is also troublesome. However, with geometry package, you can do

{geometry:margin=1.5in}

if you want to set each margin 1.5in from each edge of the paper.

Lengths can be written in

Layout Dimensions

To realize a straightforward setting for page layout, the following page structure is introduced: A paper contains a total body (printable area) and margins. The total body consists of a body (text area), a header, a footer and a marginal note which is optional. There are four margins: left-, right-, top- and bottom-margin.

paper: total-body (printable area) and margins
total-body: head, body(text area), foot and marginal notes
margins: left-, right-, top- and bottom-margin

Each margin is measured from the corresponding edge of a paper. For example, left-margin means a horizontal distance between the left edge of the paper and that of the total body. The dimensions for paper, totalbody and margins have the following relations.

paperwidth = left + width + right
paperheight = top + height + bottom

Option List

Table 5-1. Options for geometry directive

landscapeswitches the paper orientation to landscape mode
portraitswitches the paper orientation to portrait mode
twosideswitches on two-sided printing. In this mode, specified left and right margins are switched over in each odd-numbered page.
reversempmakes the marginal notes appear in the left margin
noheadeliminates spaces for the head of page
nofooteliminates spaces for the foot of page
noheadfooteliminates spaces for the head and foot of page
a4paper, a5paper,letterpaper, legalpaperspecifies paper name. They must be used with no values.
paperwidthwidth of the paper. paperwidth=<paperwidth>
paperheightheight of the paper. paperheight=<paperheight>
widthwidth of the total body. width=<width>or totalwidth=<width>. This dimension should not be confused with textwidth, because width includes the width of marginal notes
heightheight of the total body (including header and footer). height=<height>
leftleft margin of the total body. In other words, the distance between the left edge of the paper and that of the total body.left=<leftmargin>
rightright margin of the total body. right=<rightmargin>
toptop margin of the total body. top=<topmargin>
bottombottom margin of the total body. bottom=<bottommargin>
marginsets all margins of the total body. margin=<margin>
textwidthmodifies width of text (body). textwidth=<width>
textheightmodifies height of text (body). textheight=<height>
marginparmodifies width of the marginal notes. marginpar=<length>
marginparsepmodifies separation between body and marginal notes. marginparsep=<length>
headmodifies height of header. head=<length>
headsepmodifies separation between header and text (body). headsep=<length>
footmodifies distance separation between baseline of last line of text and baseline of footer. foot=<length>

Examples

Set the height of the total body to be 10in, the bottom-margin 2cm, and the width default. The top-margin will be calculated automatically:

{geometry:height=10in,bottom=2cm}

or

{g:height=10in,bottom=2cm}

or

{geometry:height=10in}
{g:bottom:=2cm}

Set the left-, right-, and top-margin 3cm, 2cm and 2.5in respectively. The page header is not used.

{geometry:left=3cm,right=2cm, nohead,
 top=2.5in}

or

{geometry:left=3cm}
{geometry:right=2cm}
{geometry:nohead}
{geometry:top=2.5in}

or

{g:left=3cm,right=2cm}
{g:nohead, top=2.5in}

and so on ...

Modify the width of marginal notes to 3cm and include marginal notes when adjusting horizontal partition

{geometry:marginpar=3cm}
{geometry:marginpar=3cm, reversemp}

makes the marginal notes appear in the left margin.

Use A5 paper in landscape mode.

{geometry:a5paper, landscape}