{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
1answer
171 views

Displaying (source)Code in research article [duplicate]

I have this urgent need to display two pieces of code side by side for comparison in my article. Displaying a code, I've couple of requirement Should indent properly Output should be syntax ...
1
vote
1answer
78 views

Using verbatim in a definition [duplicate]

I actually need to store some verbatim text in a definition so I can reuse it several times. Here is a very short snippet: % here I store verbatim text \def\foo{ bar \verb'baz' spam } % now I ...
4
votes
1answer
353 views

How can I create wrapper macro for lstinline?

Using \lstinline I can include inline code snippets in a paragraph. I would like to provide a macro that selects formatting, etc, for lstinline so I can just do, say, \codeinline{snippet}. I had ...
3
votes
1answer
389 views

lrbox with border in beamer

Can I have border around a \lrbox in beamer? I have a minipage inside the lrbox. I know I can use \fbox. Update Sorry for the confusion. I need a border around the block of data, it is inside a ...
2
votes
2answers
34 views

verbatim within… a package delivers a string from a file and that string needs to be printed without interpretation

The csvtools package warns in its documentation from interpretable inputs but offers no solution as far as I can see. This Code generates a table \documentclass{article} \usepackage{csvtools} ...
1
vote
2answers
2k views

Importing separate file into my LaTeX file

I'm curious as to whether it's possible to insert an entire separate file into a LaTeX document as an inline command. For example, I have the following LaTeX code: \begin{Verbatim}[frame=single] ...
1
vote
2answers
276 views

Drawing a rectangle box around code fragment

How to produce the effect of drawing a rectangle box surrounded the code, and put it in the figure? (Any methods including non-tikz-pgf method that helps is welcome)
1
vote
1answer
389 views

Listings: use greek letters

Is it possible (and if yes, of course, and how) to use Greek letters within lstlisting (of the listings package)? \epsilon, for instance, puts of course exactly that and not a Greek epsilon. I have ...
1
vote
0answers
109 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
4k 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
156 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
414 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
176 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
766 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
777 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
344 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
155 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
396 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
657 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
294 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 ...
10
votes
2answers
830 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
687 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
392 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
645 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
119 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
340 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
166 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
32 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
426 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
586 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
195 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 ...
6
votes
1answer
762 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
82 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 ...
1
vote
1answer
343 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
643 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} ...
4
votes
2answers
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
610 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
314 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
513 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 ...
14
votes
2answers
1k 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
164 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
360 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
190 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
330 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
485 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 ...