LaTeX/Useful Measurement Macros

From Wikibooks, the open-content textbooks collection

Jump to: navigation, search


A list of macros and their values

Contents

[edit] Units

First, we introduce the LaTeX measurement units. You can choose from a variety of units.

pt a point is 1/72.27 inch, that means about 0.0138 inch or 0.3515 mm.
bp a big point is 1/72 inch, that means about 0.0139 inch or 0.3527 mm.
mm a millimeter
cm a centimeter
in inch
ex roughly the height of an 'x' in the current font
em roughly the width of an 'M' (note the uppercase) of the current font

[edit] Length 'macros'

Some length commands are;

\baselineskip 
The normal vertical distance between lines in a paragraph
\baselinestretch 
Multiplies \baselineskip
\columnsep 
The distance between columns
\columnwidth 
The width of the column
\evensidemargin 
The margin for 'even' pages (think of a printed booklet)
\linewidth 
The width of a line in the local environment
\oddsidemargin 
The margin for 'odd' pages (think of a printed booklet)
\pagewidth 
The width of the page
\pageheight 
The height of the page
\parindent 
The normal paragraph indentation
\parskip 
The extra vertical space between paragraphs
\tabcolsep 
The default separation between columns in a tabular environment
\textheight 
The height of text on the page
\textwidth 
The width of the text on the page
\topmargin 
The size of the top margin!
\unitlength 
Units of length in Picture Environment

[edit] Length manipulation macros

You can change the values of the variables defining the page layout with two commands. With this one you can set a new value:

\setlength{parameter}{length}

with this other one, you can add a value to the existing one:

\addtolength{parameter}{length}

See LaTeX/Page_Layout for samples using these.

[edit] Samples

Resize an image to take exactly half the text width :

\includegraphics[width=0.5\textwidth]{mygraphic}

Make distance between items larger (inside an itemize environment) :

\addtolength{\itemsep}{0.5\baselineskip}
Personal tools