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.

Why is it that

\begin{verbatim}
some verbatim
\end{verbatim}\bigskip

will work without errors, but if I changed the ending line to

\end{verbatim}\\[1\baselineskip]

I'll get errors?

Am I misunderstanding a basic concept of LaTex or?

share|improve this question

migrated from meta.tex.stackexchange.com Jul 30 at 16:25

This question came from our discussion, support, and feature requests site for users of TeX, LaTeX, ConTeXt, and related typesetting systems.

    
Was that supposed to be \\[1\baselineskip]? –  Torbjørn T. Jul 30 at 16:32
1  
The error you get is There's no line here to end which should be self explaining: \end{verbatim} ends a paragraph and \\ is not legal between paragraphs. I'd place \bigskip (or \vspace{\baselineskip}, if you prefer) below \end{verbatim}, not on the same line. But why would you want a big space below the verbatim text? –  egreg Jul 30 at 16:51
    
I have the feeling that you might be interested in package parskip. Possible? –  Johannes_B Jul 30 at 16:51

1 Answer 1

up vote 8 down vote accepted

verbatim is a display environment so after it you are in vertical (par) mode so you can use vertical spacing commands such as \bigskip (although you should almost never need to do this, the correct spacing should be specified in your class file).

Conversely \\ is a command to be used in horizontal (LR) mode it forces a break in the current line. There is no current line at that point so you get an error. Use of \\ outside tables is almost always incorrect even when it doesn't generate an error.

share|improve this answer
    
Outside tables and equations surely? –  Ian Thompson Jul 30 at 20:44
    
@IanThompson yes well outside alignments –  David Carlisle Jul 30 at 20:54

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.