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

1
vote
0answers
126 views

Help with verbatim-like environments [closed]

I am writing a script for LaTeX shallow parsing (assuming that there are no complicated definitions in the preamble). First of all I decided to check the document for in-line verbatims and comments, ...
12
votes
1answer
5k views

center /verbatim text in /figure

I'm trying to center a the content of a figure that has verbatim text in it, but the verbatim text is always right-aligned: \begin{figure} \centering \begin{verbatim} some text here ...
5
votes
1answer
165 views

Saving in macros plus \scantokens as an alternative to external files

I am generating a lot of TeX code automatically using Python scripts. I've been saving the TeX code to file, and then bringing those files into my documents at the appropriate places via \input. ...
5
votes
1answer
528 views

Escaping special LaTeX characters in user-defined input text

Background Users can provide text, which is transformed using XSL into a LaTeX document. The XSL template that transforms the XML document (containing user-defined text) currently resembles: ...
7
votes
1answer
199 views

Generating code examples

I would like to make a table showing some custom commands that I have defined. It would be nice if I could do something like the following. \documentclass{article} ...
4
votes
2answers
1k views

Set color to output from verbatim

I want to show the output from verbatim in blue color. I have this: \newcommand{\blockcode}[1]{\ttfamily\small#1} {\blockcode \begin{verbatim} alias vi="vim" \end{verbatim}} which works fine. ...
0
votes
1answer
907 views

Use verbatim inside \texttt

Why can't I use \begin{verbatim} inside \texttt? \texttt{ \small \begin{verbatim} iab <key> <expansion> <key> is the string which should be expanded to <expansion> ...
3
votes
2answers
371 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
160 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
456 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
735 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
330 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 ...
13
votes
2answers
1k 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 ...
9
votes
1answer
835 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
439 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
878 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
122 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
472 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
183 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
35 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
473 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
685 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
212 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
1k 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
88 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 ...
3
votes
1answer
389 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
773 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
669 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
339 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
569 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
174 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
416 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
236 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
377 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
541 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
731 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
135 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
216 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
599 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
244 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
492 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
179 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} ...