Managing spaces with Latex is not simple, in this tutorial, we will see how to manage horizontal spaces.

How to write horizontal space: qquad, hspace, thinspace , enspace, \, , ! , !! , !!! , : , \;

Latex horizontal spaces

Space definition Need amsmath Latex code Result
Default No   \(f q\)
Horizontal thin space No \, or \thinspace \(f \thinspace q\)
Horizontal negative thin space Yes ! or \negthinspace \(f\negthinspace q\)
Horizontal negative medium space Yes !! \(f\!\!q\)
Horizontal negative thick space Yes !!! \(f\!\!\!q\)
Horizontal medium space Yes : \(f\:q\)
Horizontal thick space Yes \; \(\;\)
Horizontal single space 0.5em No \enspace \(f\enspace q\)
Horizontal single space 1em No \quad \(f\quad q\)
Horizontal douqle space 2em No \qquad \(f\qquad q\)
Custom horizontal space sample No \hspace{3em} \(f\hspace{3em}q\)
Custom horizontal space sample No \hspace{-3em} \(f\hspace{-3em}q\)

Very important

  • No blank space before and after Latex commands: \, , ! , !! , !!! , : , \;
  • Add a blank space after \enspace, \thinspace, \quad, \qquad