Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I am looking at some LaTeX source, trying to find out what different things mean. I am also reading the memoir manual.

I have stumbled upon two backslashes being used at the end of lines, optionally with an extra "argument".

I have found out that in the verse environment, \\* prevents following page breaks. However I have also seen \\ and \\[8 mm] being used in a redefinition of the \renewcommand{\maketitle}. What does \\ have a general meaning in LaTeX?

share|improve this question

2 Answers 2

up vote 4 down vote accepted

\\ has the meaning of force a newline.
The optional argument, denoted by square brackets, has the meaning of adding that amount of space to the vertical separation between that and the following text in the same paragraph.

Check this code snippet out, notice where I have inserted line breaks in code and where they are in the text. TeX does not handle spaces the same as for instance Word or other text processing tools.

\documentclass{article}
\begin{document}
First paragraph

Second paragraph, notice the indentation.
Still on second paragraph.\\
Still on second paragraph, however with a forced line break\\[2 cm]
Still on second paragraph, however with a forced line break and 2 cm distance

Third paragraph.
\end{document}

And this produces the following output:

output

I should state that normally you should not use the line break. This is mainly due to aesthetics of the text, and as such if you require paragraphs without indentation or other spacing you should work around that problem, i.e. using \parskip and \parindent.

Try insert \parskip=1cm and \parindent=2cm right after \begin{document}. You should then notice different spacing.

share|improve this answer
    
Thanks, now I know what it means. I was seeing it in a template for creating title pages. –  fnurl Jan 18 '12 at 12:39

use \\ only in tabular like environments and never inside default text paragraphs, except in a poem.

 \\*[<any length>]

Starts a new line within a formular/tabular/paragraph. The starred version prevents a page break afterwards. The optional [length] changes the line feed, which may be negative.

If you want some more space between paragraphs use

... text ...

\vspace{length}% or \smallskip or \medskip or \bigskip
... text ...
share|improve this answer
    
Also the flushleft, center and flushright environments qualify for usage of \\ inside them. I agree that \\ should never be used to end a line in normal paragraphs (nor to "leave a blank line"). –  egreg Jan 18 '12 at 9:33
    
No, I do not agree that you should use it in such environments. –  Herbert Jan 18 '12 at 9:41
    
One can use flushright to typeset quotations in the style of the TeXbook. –  egreg Jan 18 '12 at 9:56
    
sure, but that's what I called "tabular-like" environments –  Herbert Jan 18 '12 at 10:01

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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