{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
505 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
292 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
451 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 ...
13
votes
2answers
818 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
154 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
307 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
158 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] ...
2
votes
1answer
282 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
1k 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
427 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 ...
5
votes
2answers
296 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
119 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
193 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
492 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
180 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
101 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 ...
5
votes
2answers
326 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
129 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
915 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
194 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
232 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
1k 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
83 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
7
votes
1answer
564 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 ...
12
votes
1answer
279 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 \$ \% ...
1
vote
1answer
1k views

Frame line width within DefineVerbatimEnvironment

I am trying to define an environment which requires a frame line as wide as \textwidth \DefineVerbatimEnvironment% {code}{Verbatim}{...,frame=lines,% xleftmargin=7pt,fontsize=...} I ...
4
votes
1answer
402 views

How to handle % character in LaTeX?

I am working on special character handling and my text is having % as one the special character which is treated as comment and anything after that is not printed. I m using verb as suggested in my ...
4
votes
3answers
142 views

How to make use of the previous plain value of a cell as an argument for \verb and a macro name in the next columns?

I have explored the source codes of siunitx manual. It is too complicated for a newbie. My objective is to avoid repeating, ampere for example, in each column of the following table. I just want to ...
8
votes
1answer
807 views

Maple package for Latex

I'm translating the book PHYSICS WITH MAPLE by Wang. It contains some codes and outputs from Maple of course. I was wondering do we have a package such as mcode or matlab-to-tikz ( MATLAB) for Maple ...
7
votes
2answers
5k views

How to put code in beamer two column

I was trying to put code and a figure side by side in a beamer presentation. I tried two methods - one said in beamer documentation and other in standard LaTeX. But couldn't get the output. The two ...
2
votes
1answer
197 views

Pagebreak and Verbatim environments

Given the following piece of code: \documentclass{article} \usepackage[T1]{fontenc} \usepackage{fancyvrb} \DefineVerbatimEnvironment{shell}{Verbatim}{ commandchars=\%\{\}, label=\shelltitle, ...
8
votes
1answer
2k views

Inline LaTeX code and result of the code (similar to showexpl)

I would like to write a macro that works somewhat like showexpl but just reproduces the LaTeX code and the results of the code in a way that I can use inline. \documentclass{article} ...
2
votes
1answer
201 views

automatically cope with special characters in LaTeX hyperlink anchor caption

I am generating LaTeX code in an automated way and have run into a problem I'm not quite sure how to solve. The problem occurs when I am generating a clickable contents page using hyperlinks. File ...
8
votes
1answer
1k views

I need a customized verbatim environment

I would need a verbatim environment with the following behaviour: It is centered (left and right distance to the page edge should be equal). It can be much wider than the regular text, almost using ...
3
votes
1answer
256 views

How to set the Top Margin for a custom Verbatim environment (fancyvrb)

From the fancyvrb documentation, it looks like I can set left and right margins (paragraph 4.1.13) only. How can I set the top margin for my environment? More specifically, given that I have a frame ...
2
votes
1answer
843 views

Example environment with numbering, caption, “verbatim” content

I need to use an example environment like the following. \begin{example}[My Caption, mylabel] My example text \end{example} It should show the text inside a verbatim environment, the caption (like ...
2
votes
1answer
234 views

dvips: warning: no config file for `amz'

I have submitted a PDF manuscript to a conference and I get the feedback that my fonts in the verbatim environment either look hideous or they are not rendered at all. The manuscript looks nice on my ...
9
votes
1answer
4k views

Boldface and subscripts in verbatim mode?

How do I create boldface and subscripts in verbatim mode? I've seen mention of a fancyvrb package that might be able to help. Can anyone provide working LaTeX code, either with or without fancyvrb?
6
votes
3answers
881 views

How to properly display backticks in verbatim environment?

I am preparing a beamer presentation where I need to display some markdown code involving backticks. Specifically, I want to show backticks in the verbatim environment. However, LaTeX renders them as ...
7
votes
1answer
185 views

todonotes and verbatim

I want to put some comments about actual code into my document, and for that I thought I'd use \verb or \begin{verbatim}, but it turns out that the todonotes package does not like that: ...
3
votes
1answer
261 views

Command right after closing a verbatim environment

I need to use a form of a verbatim environment, so that after the closing of the environment, there immediately follows another command. In particular I need something like the following - assuming ...
21
votes
2answers
1k views

Ensure verbatim code block is copy/paste-able

After rendering a document containing this code block \begin{verbatim} if [ ! -d .git ]; then git init; fi # Initialises a new Git repository, if doesn't already exist. if [ ! -f README.md ]; ...
4
votes
2answers
830 views

How to cross-reference inside of a verbatim (or listings) environment

I would like to reference other parts of my document (e.g. equations, figures) inside of some source code. Is there an escape sequence such that \ref will be parsed instead of printed as a literal ...
2
votes
1answer
579 views

Change background colour of {verbatim} environment

In an existing document which is not to be modified (except for the preamble), all instances of \begin{verbatim}...\end{verbatim} should have their contents rendered not only in a monospaced font but ...
1
vote
2answers
247 views

Is it possible to use the verbatim environment in an XY-pic node?

Is it possible to use the verbatim environment (i.e. \begin{verbatim}...\end{verbatim}) in an XY-pic node? If so, please could you provide a MWE (Minimal Working Example)? Update for those who want ...
4
votes
0answers
193 views

Is it possible to use the `verbatim` environment in a dot2tex node?

Is it possible to use the verbatim environment (i.e. \begin{verbatim}...\end{verbatim}) in a dot2tex node? If so, please could you provide a MWE? Update: this is the closest I've got so far: ...
3
votes
1answer
722 views

Alternative way to print source code [duplicate]

Possible Duplicate: Syntax Coloring in LaTeX I want to add source code of my program in document but verbatim really bugs me. All that ugly fonts and stuff.
2
votes
1answer
333 views

Tufte-Latex sidenote breaks indentation in alltt

I'm trying to the the alltt environment in tufte-book. My problem is that \sidenote seems to break the indentation in alltt. \documentclass{tufte-book} \usepackage{alltt} \begin{document} ...
2
votes
0answers
350 views

Xelatex, verbatim and hyphenation [closed]

I have the following problem with XeLatex, Russian language, hyphenation and verbatim. Consider the following tex file (text below). It is compiled with XeLaTex, and before verbatim hyphenation is ...