Key concept: LaTeX uses different units for different purposes. Understanding when to use each unit type will help you create professional, consistent documents.Related topics: Page layout | Spacing | Document design
LaTeX Units Overview
Absolute Units
Fixed measurements that don’t change based on font or context.Unit | Name | Equivalent | Best Used For |
---|---|---|---|
pt | Point | 1 pt = 1/72.27 inch | Font sizes, line widths |
pc | Pica | 1 pc = 12 pt | Typography measurements |
in | Inch | 1 in = 72.27 pt | Page dimensions |
cm | Centimeter | 1 cm = 28.45 pt | Metric page layout |
mm | Millimeter | 1 mm = 2.845 pt | Precise measurements |
bp | Big point | 1 bp = 1/72 inch | PostScript compatibility |
dd | Didot point | 1 dd = 1.07 pt | European typography |
cc | Cicero | 1 cc = 12 dd | European typography |
sp | Scaled point | 1 sp = 1/65536 pt | Internal calculations |
Relative Units
Units that scale with font size or document context.Unit | Name | Relative To | Best Used For |
---|---|---|---|
em | Em | Current font size | Font-dependent spacing |
ex | Ex | Height of letter ‘x’ | Vertical spacing |
en | En | Half the width of ‘M’ | Horizontal spacing |
mu | Math unit | 1/18 em in math mode | Math spacing |
Basic Length Usage
Setting Lengths
Measuring Existing Elements
Practical Applications
Page Layout Dimensions
Font-Relative Spacing
Advanced Length Operations
Length Arithmetic
Conditional Lengths
Spacing Commands
Horizontal Spacing
Vertical Spacing
Length Variables and Customization
Document-Wide Settings
Creating Length Commands
Math Mode Spacing
Math Units
Units in Different Contexts
Tables and Figures
Custom Environments
Best Practices
Unit selection guidelines:
- Use
em
for font-dependent spacing - Scales automatically with font changes - Use
ex
for vertical spacing - Based on lowercase letter height - Use
pt
for precise control - When exact measurements are needed - Use
cm/mm
for page layout - Intuitive for physical dimensions - Use relative units when possible - Better for responsive designs
- Avoid mixing unit systems - Stick to metric OR imperial consistently
Common Patterns
Debugging Length Issues
Measuring and Displaying
Quick Reference
Essential Length Commands
Command | Purpose | Example |
---|---|---|
\hspace{length} | Horizontal space | \hspace{2cm} |
\vspace{length} | Vertical space | \vspace{1ex} |
\setlength{\variable}{length} | Set length variable | \setlength{\parindent}{2em} |
\addtolength{\variable}{length} | Modify length | \addtolength{\textwidth}{-2cm} |
\newlength{\variable} | Create length variable | \newlength{\mywidth} |
Common Length Variables
Variable | Description |
---|---|
\textwidth | Width of text area |
\textheight | Height of text area |
\paperwidth | Paper width |
\paperheight | Paper height |
\baselineskip | Line spacing |
\parindent | Paragraph indentation |
\parskip | Space between paragraphs |
Next: Learn about Headers and footers to customize page headers and footers, or explore Page numbering for advanced numbering schemes.