Tagged Questions

{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

3
votes
2answers
367 views

Print $ inside \tt

How do I print a $ inside \tt? I tried escaping with a backslash, but didn't work. \tt{\$} throws an error. ! Argument of \OT1\^ has an extra } Update Sorry, the issue was not with $, but ...
2
votes
0answers
159 views

Animate swaps of elements in beamer [closed]

I need a nice way to show sequential swaps of two elements in verbatim. By swaps I mean two elements changing their positions with each other. Is there any specific command in beamer to animate this? ...
3
votes
2answers
435 views

Using \input in a fancyvrb verbatim environment - problem with hyphens

I've set up a custom environment with DefineVerbatimEnvironment. Within that environment I'd like to \input{} files, which works all fine and well until one of them includes a hyphen. Here's an ...
10
votes
5answers
719 views

Is there any package similar to verbatim but with support for icons?

I am looking for a package that provides verbatim environments but also supports different background color, frame style and icons (tips, error, warning etc.) shown on the upper-left corner.
5
votes
1answer
323 views

is it possible to add line numbers to input files read using \verbatiminput?

I know one can use \usepackage{listings} which supports line numbers. And I use that for pdf files. But I also generate HTML using Latex2html, and l2h does not support this package. It only supports ...
12
votes
2answers
975 views

Using \lstinline inside a \item

I know about the fragility of verbatim-like commands, and that they should not be used as an argument of another macro, but a need to write a description environment in which the terms to be defined ...
8
votes
1answer
803 views

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 ...
3
votes
1answer
2k views

Changing color of text snippet in a verbatim environment

Is it possible to change color of part of the text that is in a verbatim environment? Lets say I have this verbatim section. I want to change the color of the marked lines into blue. ...
3
votes
1answer
425 views

Automatic hyphenation in verbatim text, with guidance

I would like to typeset verbatim text that can have linebreaks on certain text points. I know that spverbatim and listings can break at spaces, but sometimes this is not enough. Of course, no ...
2
votes
1answer
828 views

How to make all the entries in a table verbatim font

I have a large table in the tabular environment and I need to make all the text verbatim font. I know I can use \begin{verbatim}...\end{verbatim} for all the entries but they are just too much for me ...
3
votes
1answer
121 views

Why do I get different accents?

1) \begin{ttfamily}\verb 'OR'1'='1 \end{ttfamily} 2) \begin{ttfamily}\verb SELECT userid FROM CMSUsers WHERE user = 'foo' AND password = 'bar'; \end{ttfamily} I'd like to have the accents like the ...
4
votes
1answer
448 views

How to display (inline) LaTeX commands properly?

When writing about LaTeX, I tend to use \verb, which could look like that: \documentclass{article} \usepackage{lipsum} \begin{document} Lorem ipsum dolor sit amet, consectetuer adipiscing elit. ...
6
votes
1answer
178 views

Percent signs disappearing from verbatim block (ltxdoc class)

Is the following expected: \documentclass{ltxdoc} \begin{document} \begin{verbatim} % why is my percent sign gone? \relax % not here \end{verbatim} \end{document}
2
votes
0answers
34 views

Verbatim environment inside footnote [duplicate]

Possible Duplicate: How to obtain verbatim text in a footnote? I would like to have a verbatim environment inside a footnote. The following does not work. main text ...
20
votes
2answers
465 views

Incompatibility between verbatim and tabu? (Danger of using \scantokens in a package)

With the following MWE \documentclass{article} \usepackage{verbatim} \usepackage{tabu} \makeatletter \renewcommand\verbatim@processline {% \begin{tabu}to\textwidth{|l|X[-1,l]|} ...
3
votes
1answer
673 views

Prevent LaTeX from inserting a new line [closed]

How do I prevent LaTeX from inserting a new line? Here's the code: bla bla bla \begin{verbatim}C:\Program Files\Product Name\Some other extensions\mail box name\end{verbatim} The output is: ...
10
votes
4answers
1k views

How can I have a verbatim text in specific sized box?

I am trying to typset the following \resizebox{0.95\textwidth}{!}{% \begin{verbatim} require( "lattice" ) require( "grid" ) \end{verbatim} } I have a lot more to add to this box, and it needs ...
2
votes
1answer
211 views

issues after verbatim section

I'm havin an issue which I cannot solve. If I have a subsubsection containing text with a verbatim section in between, the first line after the verbatim section is not aligned properly. If I put a ...
7
votes
1answer
980 views

lstlisting in a newenvironment

I have a problem with the lstlisting package. I want to define an \newenvironment with one obligatory parameter, which will be the caption name for the lstlisting. I will also have other lstlisting ...
3
votes
1answer
87 views

Verb end of the line alignement

I have a problem when I use the command \verb|detectionFinProgramme|. I don't know how to manage LaTex to get a normal alignement at the end of the line. Does someone have a solution ? Thanks in ...
6
votes
3answers
1k views

remove double spacing inside {verbatim}

I'm using the uwthesis class which generally typesets with a lot of space between lines. This is generally fine, however, I want to override the spacing in certain examples which appear in the ...
2
votes
1answer
379 views

What are the differences between verb and verbatim?

What are the differences between verb and verbatim? Other than syntax, of course.
2
votes
2answers
739 views

Verbatim inside tikz node [duplicate]

Possible Duplicate: Problem with TikZ, beamer and verbatim Is it possible to use verbatim-like environments inside a tikz node? This MWE gives an error: \documentclass{article} ...
5
votes
3answers
1k views

newcommand for verbatim

I'm trying to write a \newcommand for verbatim: \newcommand{\codeline}[1]{\begin{verbatim}{#1}\end{verbatim}} and use it as \codeline{int foo;} but it gives an error "File ended while scanning ...
1
vote
1answer
659 views

\verbatim environment compatible with lingmacros \enumsentence

Using the verbatim environment inside an \enumsentence fails. Here is a MWE: \documentclass{article} \usepackage{lingmacros} \begin{document} \enumsentence{ \begin{verbatim} foo \end{verbatim} } ...
3
votes
1answer
332 views

Proportional font, word-wrapping verbatim

How can I get a xelatex-compatible verbatim-like environment which uses a proportional font and applies word wrapping? I would like to able to put in something like this... Proposition 2.3.13. ...
5
votes
1answer
554 views

colored full width box with some verbatim text inside?

I would like to create a text box of "reminders" for my readers. I'd like the box to be gray, go full text width, and have both normal and verbatim text in it. Reminder ensure blah blah ...
15
votes
2answers
2k views

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}
2
votes
2answers
172 views

Unindent code inserted with \lstinputlisting

Is it possible to unindent the code inserted using \lstinputlisting? In particular I'd like to be able to unindent by a fixed amount of whitespace. I have to write a relation on a OS scripting course ...
5
votes
3answers
1k views

verbatim subscript in mathmode

I want to produce a formula in Math-Mode which is something like \pi_{film_title}(\sigma_{release_year > 2006}(film)) where film_title, release_year, and film are in verbatim so far I was using ...
4
votes
1answer
408 views

etoolbox's iftoggle vs verbatim

My problem is that I can set up toggles, using etoolbox's \newtoggle{x}, set it to true with \toggletrue{x} and even use it with iftoggle{x}{this for true}{this for false}. However, if I try to put a ...
5
votes
1answer
225 views

Why does verb throw an error using in multicolumn command?

I encounter an error when using the \verb command within the multicolumn command. I reduced the problem to the example below: \documentclass{article} \begin{document} \begin{table}[htb] ...
3
votes
1answer
371 views

Polyglossia and Verbatim problem

After having some hyphenation problems with my text (in greek and english) I changed some of my packages. In the beggining I was using: \usepackage{mathspec} \usepackage{xgreek} ...
8
votes
2answers
2k views

Line-break inside a `\verb'

I have set my text editor to wrap text at 76 columns. When including verbatim text in-line, my text editor did an auto-word-wrap and I ended up with something that looked like: \item Just another ...
5
votes
2answers
532 views

Is there a non-verbatim form of lstinline from the listings package?

I'm using the listings package with beamer and I'd like to try to avoid making frames fragile where possible. I know that many of my frames will need to be fragile but there are some where the ...
7
votes
2answers
664 views

How to treat verbatim as a block that can be referenced just like a figure?

This code for example: \begin{verbatim} int main() { } \end{verbatim} How to add a label below it to be referenced? int main() { } [code 1]
2
votes
1answer
131 views

Verbatim alignment in XePersian

Verbatim environment is right-aligned when using XePersian package, so I have to wrap it in latin environment. So I decide to create a new environment: \newenvironment{faverbatim} ...
2
votes
2answers
215 views

Inserting RTL text in verbatim environment

How I can insert Persian text in verbatim environment when using XePersin package ( v11.138, 2012/05/03). Following code dose not work: \begin{verbatim} <!DOCTYPE book PUBLIC "-//OASIS//DTD ...
5
votes
1answer
587 views

Alias for verbatim environment

I'm trying to create an alias for the verbatim environment like this: \newcommand{\vb}[1]{\begin{verbatim} #1 \end{verbatim}} So I can use it like this: \vb{ word. } But when using it, I ...
3
votes
1answer
242 views

passing text to alltt embeded in command (extra newline needed)

I wanted to close alltt inside a command (to add some ornaments around the text), but the spaces that were used for putting the monospaced text into columns was not preserved. I found the solution ...
6
votes
1answer
104 views

Use a symbol in a formula that's been defined over elsewhere

In my document preamble, I'm using: \usepackage{fancyvrb} \DefineShortVerb{\|} It means I can indicate that things are to be rendered as code with |This_is_monospaced|, but now I'm trying to use ...
6
votes
2answers
471 views

verb inside lstlisting caption

I try to do this: \begin{lstlisting}[language=Perl,caption={text {\verb+myverb+} some more text}] ... \end{lstlisting} But it gives me something like: Undefined control sequence ... some more ...
5
votes
1answer
175 views

verbatim environment does not work with powerdot

I'm trying to include a verbatim environment in a powerdot slide as follows, but that does not work: \documentclass{powerdot} \begin{document} \begin{slide}{title of the slide} \begin{itemize} ...
3
votes
1answer
1k views

alltt package's \alltt{} makes a newline

alltt causes a line break (newline). How do i suppress this? I want something to the effect of \verb+HELLO+ in that it does what \begin{verbatim} \end{verbatim} does except doesn't cause the line to ...
4
votes
1answer
207 views

The command \string does not print curly braces of its argument

While printing the List of Symbols, I would like, in a draft, to print the definition commands as well. For instance, consider the following commands: \providecommand{\perm}{\ensuremath{\pi}} ...
2
votes
1answer
280 views

How to use listings inside pgfplots captions?

I need to add a (general) listings code in a plot caption. For some reason listings (inline) doesn't interact well with \addlegendentry, what can I do to make the same code work outside and inside an ...
2
votes
2answers
2k views

Can a beamer frame have both [containsverbatim] and hidden/shown block options? [duplicate]

Possible Duplicate: \pause won't generate extra slides in a containsverbatim frame I use lstlisting environments in my beamer frames, but I would also like to have blocks with ...
3
votes
0answers
89 views

subimport and verbatim packages [closed]

The subimport in the import package does not seem to work with the importing commands in the verbatim package such as VerbatimInput. Is there a workaround or another package that works better? -js
9
votes
1answer
744 views

How to format an email conversation?

I am currently writing my thesis and need to include a bunch of email conversions. I am using classicthesis. I wonder, how you would format stacked conversions. Moreover, how would you deal with the ...
13
votes
1answer
342 views

Escaped characters in typewriter font

I know a number of ways to fix this (e.g. \usepackage[T1]{fontenc}), but I want to understand what's happening in the following example. \documentclass{article} \begin{document} \noindent \$ \% ...