LaTeX handles layout automatically, but you often need to adjust vertical spacing, horizontal spacing, paragraph indentation, or force a line break. Here are all the essential commands.
Vertical spacing with \vspace
The \vspace{length} command inserts vertical space. The shortcuts \smallskip, \medskip and \bigskip offer predefined spacings.
Première ligne.
\smallskip % petit espace (~3pt)
Après smallskip.
\medskip % espace moyen (~6pt)
Après medskip.
\bigskip % grand espace (~12pt)
Après bigskip.
\vspace{1.5cm} % espace personnalisé
Après 1.5cm d'espace.
\vspace{-5mm} % espace négatif (rapproche)
Texte rapproché du précédent.
\vspace*{} (with star) to keep the space even at the top or bottom of a page. Without the star, LaTeX may remove spacing at page breaks. Horizontal spacing with \hspace
The \hspace{length} command inserts horizontal space. In math mode, \, \; \quad and \qquad are more convenient.
Texte\hspace{2cm}avec 2cm d'espace.
Gauche \hfill Droite % pousse à droite
En maths : $a \, b \; c \quad d \qquad e$
Exercice :\hfill /20 % note à droite
| Command | Size | Typical usage |
|---|---|---|
\, | 3/18 em | Petit espace en maths |
\; | 5/18 em | Espace moyen en maths |
\quad | 1 em | Séparation de formules |
\qquad | 2 em | Grande séparation |
\hspace{1cm} | Personnalisé | Espace sur mesure |
\hfill | Extensible | Pousser à droite |
Paragraph indentation
By default, LaTeX indents the first word of each paragraph (except the first after a heading). Use \noindent for one paragraph, or \setlength{\parindent}{0pt} in the preamble to remove indentation globally.
Paragraphe normal avec indentation automatique.
\noindent Ce paragraphe n'est pas indenté.
\noindent\hspace{3em} Indentation personnalisée.
% Dans le préambule pour supprimer globalement :
% \setlength{\parindent}{0pt}
% \setlength{\parskip}{6pt} % ajouter un espace entre paragraphes à la place
\setlength{\parindent}{0pt}, add space between paragraphs with \setlength{\parskip}{6pt} so paragraphs remain visually separated. Line and page breaks
A simple line break in the source code does not produce a line break in the PDF. You need a blank line for a new paragraph, or \\ for a break without a new paragraph.
Ces deux lignes dans le source
sont sur une seule ligne dans le PDF.
Nouveau paragraphe (après une ligne vide).
Saut de ligne forcé :\\
Suite sans nouveau paragraphe.
Encore du texte ici.\\[1cm]
Suite après 1cm d'espace vertical.
\newpage % saut de page