Thursday, November 1, 2012

Units in LaTeX

Discrete units

These are your basic units, like inches, centimeters, and points. Conversion of units from here and here.

These tables show the relative sizes of each unit:

Relative sizes of units in LaTeX, inches

Relative sizes of units in LaTeX, cm

Units defined relative to font sizes

There also are sizes that are relative to the current font face and font size. The size ex is usually the same as the height of an "x", and the size em is usually (but less often) equal to the width of an "M".

Since these are relative to your font, don't be surprised if your attempts look different than mine. Just like their absolute sizes, the size of ex relative to em is not consistent across fonts.

Examples of font-relative units

Units defined relative to document

There also are units that have definitions relative to your document. These are determined based on your documentclass, and can also be explicitly changed.

A list of these and how to change them is available here. Some of the sizes are illustrated here.


commandsize

\paperwidthWidth of page
\paperheightHeight of page
\textwidthWidth of text
\textheightHeight of text
\linewidthWidth of a line, usually equal to \textwidth, but varies with environment
\columnwidthWidth of a column, usually same as \linewidth
\columnsepDistance between columns
\tabcolsepSeparation between columns in a tabular environment
\parindentParagraph indentation
\parskipThe extra vertical space between paragraphs
\baselineskipVertical distance between lines in a paragraph
\baselinestretchMultiplies \baselineskip
\unitlengthUnits of length in a picture environment
\topmarginSize of top margin
\evensidemarginMargin of even pages
\oddsidemarginMargin of odd pages
Document size commands in LaTeX

Next, we'll learn how to use these units to add white space.


--
This post is one part of my series on LaTeX.

No comments:

Post a Comment