0

When I want to have a space between lines I use \\~\\ or \newline

For example

    Hello this is an example

    \\~\\

   Goodbye

I get the error there is no line to end here.

What am I doing wrong?

4

If you really want to skip a line, use

First line

\medskip

last line

A larger space is obtained with \bigskip

  • I thought \medskip was defined by the document class, is it always guaranteed (assuming the user hasn't redefined it) to be the equivalent of skipping a line? – Au101 Jul 25 '16 at 21:25
  • 1
    @Au101 Not strictly “skipping a line”, but it leaves a visible amount of white space. It's not necessary (and I'd not recommend it) to have a full “blank line”. – egreg Jul 25 '16 at 21:32
1

You should not skip lines in this manner, you're better off using \vspace.

however, to answer your question, what you have there actually is

First line

\newline
~
\newline

last line

The first newline does not have a line to end. so it should simply be

First line

~\\

last line
  • I think the mention of \vspace should come right at the start. The line skipping is not recomendable at all. – Johannes_B Jul 25 '16 at 9:24
  • I agree, edited accordingly – Elad Den Jul 25 '16 at 9:31
  • 1
    This answer is wrong – egreg Jul 25 '16 at 9:35
  • 2
    while that avoids the error message the markup ~\\ is still completely wrong and would for example produce something that looks like vertical space but is in fact a paragraph with no text that is not dropped at a page break, and as always if you end a paragraph with \\ you will get underfull; box 10000 warnings. – David Carlisle Jul 25 '16 at 9:43
  • 1
    And the recommendations in the sharelatex page are wrong as well – egreg Jul 25 '16 at 9:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.