Sarmate.net Sarmate.net
Home Features Pricing Documentation Contact
Log in Sign up

Spacing and line breaks in LaTeX

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.

LaTeX
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.
Tip: \vspace* Use \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.

LaTeX
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
CommandSizeTypical usage
\,3/18 emPetit espace en maths
\;5/18 emEspace moyen en maths
\quad1 emSéparation de formules
\qquad2 emGrande séparation
\hspace{1cm}PersonnaliséEspace sur mesure
\hfillExtensiblePousser à 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.

LaTeX
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
Best practice If you remove indentation globally with \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.

LaTeX
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

Try it in Sarmate

Edit, compile and download your LaTeX documents directly in your browser.

Open the editor