All spacing commands in LaTeX (\vspace, \hspace, \setlength, etc.) accept a length with a unit. There are absolute units (fixed size) and relative units (that adapt to the font).
Absolute units
Absolute units have a fixed size, independent of the font or context.
| Unit | Name | Value | Common usage |
|---|---|---|---|
cm | Centimètre | 1 cm | Marges, espacements |
mm | Millimètre | 0.1 cm | Ajustements fins |
in | Pouce (inch) | 2.54 cm | Format US |
pt | Point typographique | 0.351 mm | Taille de police, filets |
bp | Big point (PostScript) | 0.353 mm | Images, PDF |
pc | Pica | 12 pt = 4.218 mm | Typographie classique |
Font-relative units
Relative units adapt to the current font size. They are preferable for documents that stay harmonious when you change the font size.
| Unit | Definition | At 12pt | Common usage |
|---|---|---|---|
em | Largeur du « M » | ~12pt | Indentation, espacements de texte |
ex | Hauteur du « x » | ~5pt | Ajustements verticaux fins |
mu | 1/18 em (maths) | ~0.67pt | Espacement en mode mathématique |
LaTeX elastic lengths
LaTeX defines predefined lengths that adapt to the document context. They are very useful for proportional spacing.
| Length | Description |
|---|---|
\textwidth | Largeur de la zone de texte |
\linewidth | Largeur de la ligne courante |
\columnsep | Espace entre colonnes |
\parindent | Indentation de paragraphe |
\parskip | Espace entre paragraphes |
\baselineskip | Espace entre lignes de base |
Practical examples
LaTeX
% Espacement en différentes unités
\hspace{1cm} 1 centimètre
\hspace{10mm} 10 millimètres (= 1cm)
\hspace{1em} 1 em (relatif à la police)
\hspace{72pt} 72 points (= 1 pouce)
% Image à 80% de la largeur du texte
% \includegraphics[width=0.8\textwidth]{image.png}
% Filet horizontal
\rule{\textwidth}{0.4pt} % trait fin sur toute la largeur
% Espace vertical de 2 fois la hauteur d'un x
\vspace{2ex}
Tip: em vs cm
Prefer
em and ex for text-related spacing (indentation, inner margins). Use cm and mm for fixed dimensions (page margins, image sizes). This way your document stays proportional if you change the font size.