[Tex/LaTex] Question about spacing \hspace and \vspace

spacing

I have been using \hspace and \vspace in my latex documents lately. I was surprised when \hspace{1em} didn't work and found out that I needed to use \hspace*{1em} to force latex to put the space requested.
My question is why does latex sometimes ignores \hspace{1em}

Best Answer

When TeX breaks a line it discards white space (glue) that would come at the start of a line. This is why you get an inter-word space or a line break between words, not both. So if the \hspace comes at the beginning of a line the space gets added by LaTeX but discarded by the TeX paragraph breaker. The * version arranges to put a non-discardable invisible item in fromt of the space so the space is never first thing on the line (even though it looks like it is). \vspace and \vspace* the same with respect to vertical space discarded at a page break.