Welcome to the UK List of
TeX Frequently Asked Questions
on the Web

Searching

The index of Frequently Asked Questions about TeX is searchable.

Please enter your keyword here:   then press here: ,    or:
Google

“No line here to end”

The error

! LaTeX Error: There's no line here to end.

See the LaTeX manual or LaTeX Companion for explanation.

appears when you give LaTeX a \\ command at a time when it’s not expecting it; it is a line-breaking command, and is confused if LaTeX isn’t building a paragraph when you give the command. A common case is where you’ve decided you want the label of a list item to be on a line of its own, and written (for example):

\begin{description}
\item[Very long label] \\
  Text...
\end{description}

The proper solution to the problem is to write a new sort of description environment, that does just what you’re after. (The LaTeX Companion offers a rather wide selection of variants of these things.)

A straightforward solution, which avoids the warning, is to write:

\begin{description}
\item[Very long label] \leavevmode \\
  Text...
\end{description}

which starts a paragraph before forcing a break. The expdlist package provides the same functionality with its \breaklabel command, and mdwlist provides it via its \desclabelstyle command.

The other common occasion for the message is when you’re using the center (or flushleft or flushright) environment, and have decided you need extra separation between lines in the environment:

\begin{center}
  First (heading) line\\
  \\
  body of the centred text...
\end{center}

The solution here is plain: use the \\ command in the way it’s supposed to be used, to provide more than just a single line break space. \\ takes an optional argument, which specifies how much extra space to add; the required effect in the text above can be had by saying:

\begin{center}
  First (heading) line\\[\baselineskip]
  body of the centred text...
\end{center}

You can use \leavevmode, as above:

\begin{center}
  First (heading) line\\
  \leavevmode\\
  body of the centred text...
\end{center}

but that is just as tiresome to type as \\ with an optional argument, and can not be recommended.

expdlist.sty
macros/latex/contrib/expdlist (or browse the directory)
mdwlist.sty
Distributed as part of macros/latex/contrib/mdwtools (or browse the directory); catalogue entry

This answer last edited: 2014-01-13


Go to previous question, or next question

Go to FAQ home.

URL for this question: http://www.tex.ac.uk/cgi-bin/texfaq2html?label=noline

Comments, suggestions, or error reports? - see “how to improve the FAQ”.

This is FAQ version 3.28, released on 2014-06-10.