verbatim, comment and fancyvrb in Scissor LaTeX
Mostly. The verbatim environment, \verb, fancyvrb's Verbatim and BVerbatim print text exactly as typed in a monospaced font, and the comment environment hides its content; fancyvrb's options are ignored, and \verbatiminput, \VerbatimInput, \Verb, \excludecomment, alltt and spverbatim do not work as in a TeX installation.
What the packages do
- The
verbatimenvironment and\verb|...|print text exactly as typed, in a monospaced font: no commands are run and every space is kept. Theverbatimpackage improves them and adds\verbatiminput{file}and acommentenvironment, whose content is skipped. commentprovides thecommentenvironment too, and\excludecomment{name}and\includecomment{name}to define environments you can switch on and off.fancyvrbaddsVerbatimwith options for frames, line numbers and font size,\Verb,\fvsetand\VerbatimInput.allttkeeps spaces and line breaks like verbatim, but still runs commands.
For code with syntax colours, see listings and minted.
What works here
| Command | In Scissor LaTeX | Notes |
|---|---|---|
\begin{verbatim}, \begin{verbatim*} | Works | Monospaced, as typed. verbatim* shows spaces as normal spaces, not as ␣. |
\verb|...|, \verb!...! | Works | Any delimiter. \verb* shows normal spaces. |
\begin{comment} | Works | The content is skipped, even if it is not valid LaTeX. |
\begin{Verbatim}, \begin{BVerbatim}, \begin{Verbatim*} (fancyvrb) | Partly | The text is printed as in verbatim; options such as frame=single or numbers=left are ignored. |
\fvset{...} | Left out | Ignored in the preamble; in the body it is skipped with a note and its options are printed. |
\Verb|...| (fancyvrb) | Not supported | Skipped with a note; the text is printed with its delimiters. Use \verb. |
\verbatiminput{file}, \VerbatimInput{file} | Not supported | Skipped with a note; the file name is printed. Paste the text into a verbatim environment. |
\excludecomment{name}, \includecomment{name} (comment) | Not supported | The new environments are unknown: their content is always printed. Only the comment environment itself is skipped. |
alltt | Partly | Commands inside work, but line breaks and extra spaces are lost and the text is not monospaced. |
spverbatim, moreverb's verbatimtab and listing | Not supported | Their content is read as ordinary LaTeX, not verbatim. Use verbatim. |
Examples
A verbatim block and inline \verb, with a comment environment that hides a draft paragraph:
verbatim, \verb and comment
Type \verb|\section{Results}| to start a section. The file
\verb|data_44.csv| holds the samples:
\begin{verbatim}
name, count
Erika Mustermann, 44
Hans Mustermann, 38
\end{verbatim}
\begin{comment}
This draft paragraph by John Doe is not printed.
\end{comment}
The table above lists two people.fancyvrb's Verbatim prints the text; the frame and line numbers are not drawn:
Verbatim: options are ignored
\begin{Verbatim}[frame=single, numbers=left]
for i in range(44):
print(i)
\end{Verbatim}Compatibility
- From a TeX installation to here: verbatim text and comments look the same. Text included with
\verbatiminputmust be pasted in, and fancyvrb frames and line numbers are missing. - From here to a TeX installation: documents compile there unchanged.
The full manuals are on CTAN: verbatim, comment, fancyvrb and alltt. See also Code listings.
Questions and answers
How do I comment out a block of text in LaTeX?
Put % at the start of each line, or wrap the block in \begin{comment} and \end{comment} with \usepackage{verbatim} or \usepackage{comment}. Both work here.
How do I show a file's content verbatim?
\verbatiminput does not read files here yet, and neither does \lstinputlisting from listings. Paste the content into a verbatim or lstlisting environment.
Every example on this page is typeset by Scissor LaTeX when the site is built. Last updated 2026-11-07.