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: Single vs double-sided documents | Spacing | Headers & footers
LaTeX Units Overview
Absolute Units
Fixed measurements that don’t change based on font or context.Relative Units
Units that scale with font size or document context.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
Common Patterns
Debugging Length Issues
Measuring and Displaying
FAQ
When should I use em/ex vs pt/cm?
When should I use em/ex vs pt/cm?
Use relative units (
em, ex) when spacing should scale with the font (e.g., paragraph spacing, indents). Use absolute units (pt, cm) for fixed physical dimensions (e.g., margins, figure sizes).Why does spacing look different after changing font size?
Why does spacing look different after changing font size?
em and ex scale with the current font, so changes to font size affect spacing. For fixed spacing independent of font, use absolute units like pt or cm.How do I measure current lengths in my document?
How do I measure current lengths in my document?
Use
\the\length to print a value (e.g., \the\textwidth) and packages like layouts to visualize page geometry. See the Debugging section for examples.Best way to set margins?
Best way to set margins?
Use the
geometry package and specify margins in cm/mm for clarity. For responsive layouts, consider percentages of \paperwidth/\paperheight.Quick Reference
Essential Length Commands
Common Length Variables
Next: Learn about Headers and footers to customize page headers and footers, or explore Page numbering for advanced numbering schemes.
