Questions tagged [verbatim]

{verbatim} is about macros and environments like “\verb” and “verbatim” which implement some form of verbatim mode, i.e. change the {catcodes}. A popular package is {fancyvrb}. For questions about the {listings} or the {minted} package, use the respective tag instead.

is about macros and environments like \verb and verbatim which implement some form of verbatim mode, i.e. change the . A popular package is .

For questions about the or the package, use the respective tag instead.

1132 questions
28
votes
2 answers

Verbatim inside a command

I have a question about a Verbatim, I want to write a word inside of the subsubsection title. I got an error. How can I fix it?: \subsubsection{The \verb+@interface+ Section}
Isai
  • 4,153
28
votes
1 answer

escape `|' in \verb

In LaTeX, if I use \verb, how can I escape |? For example, I want to display ab|bc: \verb|ab[]bc|. What should replace []?
WIZARDELF
  • 1,325
  • 3
  • 14
  • 16
24
votes
2 answers

Latex equivalent of

This is probably a simple question, but I can't find the answer anywhere. How can I tell tex (latex specifically) not to format a piece of text? I.e. I want to keep indentation, line breaks, etc.
Xodarap
  • 1,005
24
votes
5 answers

How to use "`" in the same way it is used on the SE websites?

On any SE post one can use the backtick symbol ("`") in order to mark some text as being a piece of code, or computer output. For example: void main(). Is there a way to make use of "`" the same way in a LaTeX document?
Remi.b
  • 471
21
votes
2 answers

Inserting LaTeX code into LaTeX

I have a problem with adding text into a LaTeX document. I have a LaTeX document about LaTeX and I need to insert some code snippets. I need to add "\usepackage{musixtex}" as a text, which should be displayed as a text. Do you know how?
Waypoint
20
votes
4 answers

How can I indent verbatim blocks?

I have blocks surrounded by \begin{verbatim} and \end{verbatim}. I'd like to indent these about half an inch. I'm using pandoc to write pdfs via XeLaTeX and the default.latex pandoc template, so I'd like not to create a new environment, but to…
Jonathan
  • 752
17
votes
1 answer

Displaying `\begin{verbatim}...\end{verbatim}` inside the environment verbatim

I would like to display \begin{verbatim}...\end{verbatim} inside the environment verbatim like in the folowing piece of code. Is it possible ? \begin{verbatim} Bla, bla, \begin{verbatim}...\end{verbatim} Bla, bla,... \end{verbatim}
projetmbc
  • 13,315
16
votes
2 answers

LaTeX Verbatim Source Code Beside the Typeset Output

I am a beginner to LaTeX, and I am reading Leslie Lamport's A Document Preparation System. In various places of his book, he puts the LaTeX source code beside the output obtained by running latex on the source. Even more interestingly, in order to…
Rich
  • 505
12
votes
5 answers

How to indent code in \begin{verbatim}

I have code. I used \begin{verbatim} \end{verbatim}. My code contains indentation to organize the code. But the verbatim does not add spaces. When I try to add vertical spaces using \quad, the command \quad appears as it is. How can I indent my…
user6875880
  • 2,183
11
votes
3 answers

typing \end{verbatim}

I am preparing a presentation in which I want to display the following as it is \begin{verbatim} foo \end{verbatim} For this I used \begin{verbatim} \begin{verbatim} foo \end{verbatim} \end{verbatim} But the first \end{verbatim} ends the…
11
votes
3 answers

Preserve leading whitespace in verbatim environment

The following code (as a small example): \begin{verbatim} ##### ######### …
Charles
  • 133
10
votes
1 answer

Separate Verbatim into two columns

Is it possible to split a long verbatim simply into 2 columns? For example: \begin{verbatim} a a a b b \end{verbatim} result displayed (b starting at the middle of the page): a b a b a
user23710
  • 1,491
9
votes
2 answers

How to get whole tex in the output document file with actual output?

Consider the following LaTeX document \documentclass{article} \usepackage{enumerate} \begin{document} \begin{enumerate}[(a)] \item Here is the 1st line. \item Here is the 2nd line. \end{enumerate} \end{document} It gives the following…
Soumitra Sen
  • 2,995
8
votes
4 answers

Printing LaTeX command without compiling it

How could I write a command in LaTeX, so after compiling it will be shown as a text in PDF and not executed? For Example, I would write \it This is how you write in italic and the compiled pdf would contain the exact same text between the quotation…
user44697
  • 183
8
votes
2 answers

Why can't curly braces be used as a delimiter for \verb? i.e. \verb{foo}

When I try to do the following: \documentclass{article} \begin{document} Hello \verb{foo}. \end{document} …
user28291
  • 155
1
2 3 4 5 6 7 8