space in latex equation code example

Example 1: latex space in math mode

\; - a thick space.
\: - a medium space.
\, - a thin space.
\! - a negative thin space.

Example 2: give space in latex

Horizontal \hspace{1cm} spaces can be inserted manually. Useful 
to control the fine-tuning in the layout of pictures.

Left Side \hfill Right Side

Example 3: space latex math

Spaces in mathematical mode.

\begin{align*}
f(x) &= x^2\! +3x\! +2 \\
f(x) &= x^2+3x+2 \\
f(x) &= x^2\, +3x\, +2 \\
f(x) &= x^2\: +3x\: +2 \\
f(x) &= x^2\; +3x\; +2 \\
f(x) &= x^2\ +3x\ +2 \\
f(x) &= x^2\quad +3x\quad +2 \\
f(x) &= x^2\qquad +3x\qquad +2
\end{align*}

Tags:

Misc Example