TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

What are the differences between verb and verbatim? Other than syntax, of course.

share|improve this question
There is always a certain character which cannot be part of \verb text. verbatim always starts and ends with a new line. – Stephan Lehmke Dec 11 '12 at 17:58
\verb is used "in line", while verbatim makes a display. – egreg Dec 11 '12 at 18:00
up vote 7 down vote accepted

From source2e:

The verbatim environment uses the fixed-width \ttfamily font, turns blanks into spaces, starts a new line for each carriage return (or sequence of consecutive carriage returns), and interprets every character literally. I.e., all special characters \, {, $, etc. are \catcode'd to "other".

The command \verb produces in-line verbatim text, where the argument is delimited by any pair of characters. E.g., \verb #...# takes "..." as its argument, and sets it verbatim in \ttfamily font. The *-variants of these commands are the same, except that spaces print as the TeXbook's space character instead of as blank spaces.

In particular, the character used to delimit the contents of \verb cannot appear in the verbatim text. Additionally, \verb is meant for in-line verbatim expressions and doesn't admit carriage returns as verbatim does; a carriage return inside \verb triggers the error

! LaTeX Error: \verb ended by end of line.

The verbatim environment always starts and ends with a new line.

verbatim applies a series of additional precautions; for example, a previous use of \parshape won't affect the contents of the verbatim environment.

share|improve this answer

Your Answer


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.