Overall Document Structure

Overall Document Structure #

Author: Erhua

Keywords: Overall Document Structure

In this section, we discuss the overall structure of a document.

First, let’s take a look at a diagram of the overall document structure.

Table of Length Variables:

Length Variable Explanation
\paperwidth \paperheight Width of the paper
\textwidth \textheight Width and height of the text area: commonly used for setting image sizes
\tomargin Additional top margin
\headheight Height of the header
\headsep Gap between header and text area
\marginparwidth Width of the margin note
\marginparsep Gap between margin note and text area
\footskip Vertical distance from the baseline of the last line of text to the baseline of the footer

All these parameters can be set directly using \setlength.

\setlength\textwidth{7in}
geometry Package #

The geometry package provides a relatively simple interface for setting page dimensions, so that we don’t have to worry too much about numerical calculations.

With geometry, we can easily set the page using the following length variables (taken from Liu Haiyang’s introduction):

For double-sided books, it can be set as follows:

\documentclass[draft]{book}
\usepackage{ctex}
\usepackage[bindingoffset = 8mm,top = 30mm, bottom = 30mm, inner = 20mm, outer = 45mm, marginparwidth = 30mm, headheight = 8mm, footskip = 18mm, showframe]{geometry}
\usepackage{lipsum}
\begin{document}
\Large\lipsum
\end{document}