[Tex/LaTex] vspace equivalent of newline


I am writing one report using LaTeX and R. I just found \vspace can be used for \newline. May I know how much \vspace == \newline?

 \vspace{x cm} = \newline
  x = ?

Best Answer

There is no such relationship between \vspace and \newline!

\vspace semantics

  • in vertical mode (between paragraphs) \vspace adds an additional vertical space as defined by the argument
  • in horizontal mode (within a paragraph) \vspace adds an additional vertical space between lines after the end of the current line, i.e., it doesn't act on the current point in the paragraph unless that happens to be a natural line break by chance.
  • in either case the extra space with be dropped if it falls into a page break (\vspace* in contrast keeps the space always).

\newline semantics

  • in vertical mode \newline simply generates and error: "! LaTeX Error: There's no line here to end."
  • in horizontal mode it ends the current line at the current point and starts a new one.
  • if two \newline commands come directly after each other they result in an empty line but with an additional warning message: "Underfull \hbox (badness 10000) in paragraph at..." so this is not necessarily the best way to generate empty lines.

The command \\ works (in most environments) similar to \newline but allows to specify an optional argument that defines the extra space that should be added after the current line. Thus in a normal paragraph \\[\baselineskip] would generate an empty line and so would \vspace{\baselineskip}\linebreak. Notice that the \vspacehas to come first, otherwise it would apply not after the line with the linebreak but one line later!