W3cubDocs

/LaTeX

\\

Synopsis, one of:

\\
\\[morespace]

or one of:

\\*
\\*[morespace]

End the current line. The optional argument morespace specifies extra vertical space to be inserted before the next line. This is a rubber length (see Lengths) and can be negative. The text before the line break is set at its normal length, that is, it is not stretched to fill out the line width. This command is fragile (see \protect).

The starred form, \\*, tells LaTeX not to start a new page between the two lines, by issuing a \nobreak.

\title{My story: \\[0.25in]
       a tale of woe}

Explicit line breaks in the main text body are unusual in LaTeX. In particular, don’t start new paragraphs with \\. Instead leave a blank line between the two paragraphs. And don’t put in a sequence of \\’s to make vertical space. Instead use \vspace{length}, or \leavevmode\vspace{length}, or \vspace*{length} if you want the space to not be thrown out at the top of a new page (see \vspace).

The \\ command is mostly used outside of the main flow of text such as in a tabular or array environment or in an equation environment.

The \\ command is a synonym for \newline (see \newline) under ordinary circumstances (an example of an exception is the p{...} column in a tabular environment; see tabular).

The \\ command is a macro, and its definition changes by context so that its definition in normal text, a center environment, a flushleft environment, and a tabular are all different. In normal text when it forces a linebreak it is essentially a shorthand for \newline. It does not end horizontal mode or end the paragraph, it just inserts some glue and penalties so that when the paragraph does end a linebreak will occur at that point, with the short line padded with white space.

You get ‘LaTeX Error: There's no line here to end’ if you use \\ to ask for a new line, rather than to end the current line. An example is if you have \begin{document}\\ or, more likely, something like this.

\begin{center}
  \begin{minipage}{0.5\textwidth}
  \\
  In that vertical space put your mark.
  \end{minipage}
\end{center}

Fix it by replacing the double backslash with something like \vspace{\baselineskip}.

© 2007–2018 Karl Berry
Public Domain Software
http://latexref.xyz/_005c_005c.html