{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
81 views

How to get bengali font script as output written within verbatim package?

\documentclass{article} \usepackage{verbatim} \begin{document} \begin{verbatim} $\alpha=\beta$ Here is my text. এখানে আমার টেক্সট । \end{verbatim} \end{document} This gives the following output ...
9
votes
4answers
329 views

How to redefine an environment to produce no output?

I am using the verbatim environment with \begin{verbatim} XXXX \end{verbatim} I would like the option of redefining the verbatim environment so that nothing between \begin{verbatim} and ...
5
votes
2answers
228 views

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}. ...
8
votes
2answers
131 views

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} ...
0
votes
0answers
38 views

verbatim in two columns [duplicate]

I have a 2 column document that I wish to add some verbatim to. However, when its added it spans both columns instead of remaining in one (what I need it to do). Is there any way to do this? or an ...
0
votes
1answer
130 views

wrap listings package - Problem with verbatim argument

I would like to define a command that wraps a lstlisting environment in some other environments (esp. a minipage). I understand that working with verbatim arguments is a difficult task. I tried the ...
2
votes
1answer
127 views

Ceiling function within verbatim in latex

I am preparing a latex document. Inside the body of a function I need to use the ceiling function. How will I use the ceiling function inside verbatim? \begin{verbatim} Method a(b) . . ...
0
votes
1answer
113 views

How to print any command on the PDF document exactly like in the TeX file?

\documentclass{article} \begin{document} My text. \end{document} Here 'My text' is the output.But I want to get the following output: \begin{document} My text \end{document} Is there any way ...
2
votes
1answer
103 views

too many curly brace using verbdef

I would like to create an inline verbatim text for a regular expression. The verbdef package does not like when I put curly braces into its second argument. I tried with escaping backslashes but that ...
3
votes
1answer
493 views

Using math mode escapes with listings enabled fancyvrb

I am trying to escape math mode within Verbatim, using this answer. This works fine, until I use the listings package with fancyvrb=true \documentclass{article} \usepackage{fancyvrb} ...
2
votes
1answer
193 views

verbatim environment inside algorithm2e

I need to output prolog style inside algorithm2e and It seems that I cannot use \verb inside algo2e. How can I use \verb or verbatim for only one line inside algorithm2e in Latex?
1
vote
1answer
164 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
75 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 ...
3
votes
1answer
278 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
349 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
33 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
1k 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
251 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
323 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
100 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, ...
10
votes
1answer
3k 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
148 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
363 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
169 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
629 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
662 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
322 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
151 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
363 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
598 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
262 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 ...
8
votes
1answer
709 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
573 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
1k 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
334 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
520 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
118 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
241 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
151 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
28 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
376 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
477 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
775 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
177 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 ...
4
votes
1answer
582 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
76 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
834 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
304 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
493 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
901 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 ...