vspace not working after linebreak
26,388
\vspace
if used mid paragraph, as here, stores the vertical space in a special place (a vadjust node) which is then inserted after the paragraph has been broken into lines, after the line on which the space is added. in your example the \vspace
is added in the last line of the paragraph so the space comes after the paragraph. Compare
\documentclass{article}
\begin{document}
\noindent
Hallo \\
How \\
Are \\
You?
xxxxx
\noindent
Hallo \\
How \\
Are \\
\vspace{15cm}You?
xxxxx
\end{document}
to add a space at the linebreak you should use
\\[3cm]
but it is almost always wrong to use \\
at all apart from its use in tables.
Related videos on Youtube
Author by
Adam
Updated on August 29, 2022Comments
-
Adam about 1 year
For this minimal example
\documentclass{article} \begin{document} \noindent Hallo \\ How \\ Are \\ \vspace{15cm}You? \end{document}
There is no vertical space created between the word Are and You. How can I add vertical space between them? Using \vspace* did not work either.
-
Admin over 7 yearsJust leave an empty line after
Are
and remove the `\\` -
egreg over 7 yearsYou might want to use
\\[15cm]
, but you're misusing the tool anyway. There is very rarely need for\\
in normal text. -
A Feldman over 7 yearsYou could also use
\par
instead of `\\` after "Are". -
A Feldman over 7 years@egreg actually I tried '\vspace[15cm]You?' and it seemed to work, and I have no idea why.
-
-
samcarter_is_at_topanswers.xyz over 7 yearsugly code does exist uglycode.com
-
David Carlisle over 3 yearsthis is completely wrong