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}

enter image description here

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.

Share:
26,388

Related videos on Youtube

Adam
Author by

Adam

Updated on August 29, 2022

Comments

  • Adam
    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
      Admin over 7 years
      Just leave an empty line after Are and remove the `\\`
    • egreg
      egreg over 7 years
      You might want to use \\[15cm], but you're misusing the tool anyway. There is very rarely need for \\ in normal text.
    • A Feldman
      A Feldman over 7 years
      You could also use \par instead of `\\` after "Are".
    • A Feldman
      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
    samcarter_is_at_topanswers.xyz over 7 years
    ugly code does exist uglycode.com
  • David Carlisle
    David Carlisle over 3 years
    this is completely wrong