Defining page size, margins and layout

You use packages and settings in the stylesheet to define the page size, margins and layout. This should be done before customizing headers and footers,

Setting Page Size

Page size is defined in the root file. In this example, I defined the page size to be 210mm x 295mm which is the standard A4 page size. You can also use letterpaper for US letter size.

1
\documentclass[a4paper,11pt,twoside]{book}

Using the book class, this command sets the page size (A4), base font size (11 pt) and pagination (double-sided).

Page Size and Margins and Layout

For defining all text/page measurements. 210x295mm is the standard A4 page size. 160x185mm is simply a text body size that resulted in pleasing margins.

The dvips option will be superceded if pdflatex is used, but is necessary in order to generate a correct PostScript bounding box under standard LaTeX.

1
2
3
\usepackage[vcentering,dvips]{geometry}

\geometry{papersize={210mm,295mm},total={160mm,185mm}}

geometry package

The geometry package has two arguments:

The \geometry command sets the papersize precisely, where

Defining Offsets for Headers and Footers

The page layout package geometry is also used to define the offsets for headers and footers. footskip defines the distance between the footer and body text Take care when modifying these settings.

You need to allow space for the headers and footer on the page. You set the left, right, top margins and mirror the margins for double-sided pages.

The following commands are used for an A4 page size.

1
2
3
4
5
\setlength\voffset{-1in}
\setlength\hoffset{-1in}
\setlength\topmargin{1cm}
\setlength\oddsidemargin{3cm}
\setlength{\evensidemargin}{3cm}

The height of the text flow on each page is defined using this command. The original setting for text height: 24.5. This changes it to: 23.5cm

1
\setlength\textheight{23.5cm}

The width of the text flow is defined using this command. The original setting for text height: 16cm. This changes it to 15cm.

1
\setlength\textwidth{15cm}

The distance between the footer and body text is defined using this command. footskip defines the distance between the footer and body text.

1
\setlength\footskip{1.0cm}

The height of the header and the distance between the header and body text is set with this command.

1
2
3
\setlength\headheight{1cm}

\setlength\headsep{1cm}

Paragraph settings

You can indent the first line of paragraphs using this command, if you need to do so for stylistic reasons. If you set the indentation to 0cm, paragraphs do not have an indentation.

1
\setlength{\parindent}{0cm}

You can set the spacing between paragraphs in points. Paragraph spacing is determined by the argument \parskip, which in this case is 3 pts.

1
\setlength{\parskip}{3pt}

Line spacing is determined by these commands. In the following example, line spacing is set to 1.5 using the \setspace package. Options are commented out.

1
2
3
4
5
6
7
8
\usepackage{setspace}

\singlespacing

%\onehalfspacing
%\doublespacing

\setstretch{1.1}

Alternately, you can use the command \baselinestretch but you can adjust the command using \renewcommand.

1
\renewcommand{\baselinestretch}{1.5}