The error
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):! LaTeX Error: There's no line here to end. See the LaTeX manual or LaTeX Companion for explanation.
\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:
which starts a paragraph before forcing a break. The expdlist package provides the same functionality with its\begin{description} \item[Very long label] \leavevmode \\ Text... \end{description}
\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:
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\\ \\ body of the centred text... \end{center}
\begin{center} First (heading) line\\[\baselineskip] body of the centred text... \end{center}
You can use \leavevmode
, as above:
but that is just as tiresome to type as \ with an optional argument, and can not be recommended.\begin{center} First (heading) line\\ \leavevmode\\ body of the centred text... \end{center}
This answer last edited: 2014-01-13
This question on the Web: http://www.tex.ac.uk/cgi-bin/texfaq2html?label=noline