{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.

learn more… | top users | synonyms

5
votes
3answers
492 views

Display “.\integrate blah” in monospaced font (like \texttt and \verb)

I'm trying to display the following: .\integrate blah in a monospaced font. For everything else I've wanted to put in a monospace font, \texttt or \verb has worked fine, but it doesn't with this. ...
17
votes
4answers
3k views

Getting those %#!^& signs in the footnote!

This is basically an expanded version of part of Control command arguments . The original questioner there wants to redefine \href so that all the links end up in foonotes (rather than in the main ...
2
votes
2answers
1k views

LaTeX verbatim environment inside lists

I am using LaTeX and I have a verbatim environment inside an enumerate one. However, there is much whitespace between the verbatim text and the following list item. What I have now is something like ...
15
votes
1answer
4k views

Verbatim environment and line-breaking

I've been wondering about how to display simple codes. I used verbatim and then found the fancyvrb package which added a lot of nice little features, but then I inserted some code with a long line and ...
9
votes
3answers
605 views

Hyperref using the wrong language script for \url?

In a mixed language document, I try to use a URL. Here is minimal input demonstrating \documentclass{article} % compile with xelatex \usepackage{hyperref} \usepackage{polyglossia} ...
9
votes
2answers
1k views

How do I backcolor in verbatim?

I have some code I want to typeset as verbatim (lstlisting would be ok as well) - but I want to highlight some parts of it via a different background color, i.e. something like this: \begin{verbatim} ...
5
votes
1answer
2k views

FancyVerb error for Sweave output in Beamer

I'm having trouble including Sweave output in my Beamer file. Specifically, the Soutput environment is causing problems (it runs if I comment those lines out, but, of course, the table is not ...
2
votes
2answers
635 views

ignorespace and unskip in verbatim/listings?

I am writing a \bashDemo macro that will (a) execute its argument in a shell, e.g., bash, script, and (b) display the argument in a listings. So, \bashDemo ls -ls > myfiles \END will both run ls ...
15
votes
1answer
1k views

beamer's fragile frame as default

Is there a way to specify fragile mode as default for all frames? Now I know how to define a fragile frame: \begin{frame}[fragile].
7
votes
2answers
517 views

Aligning columns, but allowing for text inbetween

I need help aligning text that spans multiple lines where I have Verbatim code in between. Here is a mock example to show what I mean: Fruit Amount Apple $3.00 \begin{verbatim} ... ...
12
votes
1answer
627 views

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 []?
14
votes
1answer
35k views

In-line \verb — overfull hbox problem

I'm having a problem that I've had before and I'm tired of hacking my way through it and hope that there is some supported solution. I'll go ahead and create a document for example: \documentclass ...
5
votes
3answers
585 views

Verbatim in Marginnote doesn't work

I have a really sort quastion. The following Code is not working: \documentclass{memoir} \usepackage{verbatim} \usepackage{marginnote} \begin{document} Lorem ipsum dolor sit amet, consetetur ...
11
votes
3answers
1k views

How to pass an optional argument to an environment with verbatim content?

This is an attempt to make clear what happened in this question of xport (now deleted, sorry). The now deleted question included code that tried to make my answer to this question of xport work for ...
7
votes
1answer
813 views

verbatim with black background and white text

How could I set up a verbatim-environment which has black background white text in scriptsize ?
1
vote
1answer
244 views

How to make my unusual environment accept one argument?

I cannot find a good title to express my question. Therefore, please parse the following code first. Minimal Code \documentclass[dvips,dvipsnames,cmyk,table]{book} ...
4
votes
2answers
2k views

How to add indentation to all verbatim environment?

I have a style where all paragraphs have indentation of about 5cm. Verbatim environment does not have any indentation to the combination of paragraphs and verbatim environments does not look good. ...
14
votes
3answers
7k views

How to include verbatim in a figure caption?

I would like to include verbatim in a caption of a figure. I only want part of it to be verbatim, not the entire caption. The simple approach does not work because verbatim is not allowed in arguments ...
0
votes
2answers
732 views

Combination of \verb and \texttt

Also I read: When should one use \verb!! and when \texttt{} My issue at hand is that I would like to write a little more than just "small pieces" (wording in linked question) of program code, but ...
10
votes
1answer
2k views

verbatim useable with a newenvironment definition?

I'm trying to create a simple newenvironment allowing me to display source code in a verbatim text block with a caption, numbering etc. The solution I'm after is with the in-built LaTeX verbatim ...
12
votes
1answer
2k views

fancy verbatim - bold letters for the first 4 columns

I am writing a book on Python and IPython. I want to insert in this book code listings of Python and IPython. For the code itself I have no problem customizing listings for my intents. Including ...
2
votes
2answers
2k views

Making Verbatim and Beamer play nice

I'm writing a beamer presentation on basic math type-setting in latex and I've been trying to use verbatim to display how math equations are typed. Using fragile this works, but I still get several ...
11
votes
1answer
1k views

Alternatives to $\backslash$

Background Instead of marking up the text with bold or emphasis, I read (and agree) that it is better to define a command, or environment, that describes the content. Then apply text formatting ...
7
votes
2answers
2k views

Latex equivalent of <pre>

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.
4
votes
2answers
371 views

showexpl LTXexample and references inside enumerate

I've used the wonderful LTXexample environment defined by showexpl to illustrate some LaTeX basics. However, the following code confuses it: the reference remains ?? no matter how many times I ...
10
votes
5answers
9k views

How to draw box around text that contains a verbatim block?

Typically, to box in some text, I use the following: \fbox { \parbox{\linewidth}{ This is some text! Blah blah blah... } } However, say I have a verbatim block within that. It will ...
7
votes
5answers
901 views

How does one automatically escape a sequence of text, like “verbatim” but without the formatting?

I want to escape TeX codes on a range of text; this is for a macro providing slightly neater URL formatting. The code I have now is, \newcommand{\serifurl}[2]{\textsf{\href{#1://#2}{#2}}} where the ...
8
votes
1answer
840 views

Line length in fancyvrb

What I'm doing: Typsetting source code using pygments. What is happening: the code typsets fine, but because pygments puts the code into a Verbatim environment, some of the lines are far too long. ...
5
votes
1answer
3k views

Using listings and subfigure together

I am writing a document in which code listings and diagrams appear side-by-side frequently. I am using the listings package for the code and \includegraphics for the diagrams. I want to put them both ...
3
votes
1answer
349 views

Verbatim inside def in eplain

How can I use \verbatim inside my own \def with eplain? The eplain reference suggests to change catcodes to accomplish this, but doesn't provide an example of this. Crarification: I would like to ...
6
votes
1answer
6k views

LaTeX ignoring tabs in verbatim

I need to write a whole bunch of pseudo code and I got annoyed using all the "\ >\=" with the \begin{tabbing} command, so I decided to use \begin{verbatim} instead. This was working fine for me until ...
54
votes
2answers
46k views

When should one use \verb and when \texttt

Sometimes people here use \verb!A SHORT COMMAND! and sometimes \textt{A SHORT COMMAND}. I'm unsure when to use which. Are there any guidelines or arguments for \verbatim vs. \texttt?
15
votes
2answers
3k views

Verbatim description list item

How do I make an item in a description list verbatim? \verb in \item[] seems to be not allowed: \begin{description} \item[\verb+list comprehension [f a | a <- M a]+] bla bla bla ...
11
votes
3answers
793 views

unicode \begin{verbatim} with cmtt?

A lot of leading-edge programming languages (like Coq and Agda) allow nearly unrestricted use of unicode symbols in program text, so you can have math characters like $\otimes$ (Unicode U+2A02) as ...
5
votes
3answers
909 views

is it possible to define a verbatim{} command?

Is it possible to define a verbatim{} command that I could use instead of the environment? \begin{verbatim} \end{verbatim}
5
votes
3answers
2k views

parameter passing to \verb|| environment

I happen to write the following code over and over again. {\color{blue}\verb|>|} {\footnotesize\verb|HI|} So, I came up with the following code to make it a command. \newcommand{\result}[2]{% ...
4
votes
3answers
743 views

help me write verbatim

I'm trying to write HMX_Y, and because someone out there (mr. or ms. TeX) thinks this is a math notation, I have to use verbatim function to convince him (or her) otherwise. So far I've been using ...
30
votes
5answers
5k views

How to obtain verbatim text in a footnote?

I want to employ a \verb command in a footnote. But, when I run pdflatex on \documentclass{article} \begin{document} I want this.\footnote{\verb|But, it does not work!|} \end{document} I get ...
23
votes
4answers
13k views

Verbatim environment that can break too long lines?

I want to generate a PDF of user-submitted text using LaTeX. To handle crazy user input, I first thought about using the verbatim package, but of course it doesn't break up too long lines. Is there ...