{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

5
votes
1answer
150 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
199 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
267 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
87 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
8
votes
1answer
630 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
304 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
462 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
156 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
929 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
7k 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
217 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
210 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
280 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
929 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
255 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
5k 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?
7
votes
3answers
990 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 ...
8
votes
1answer
204 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
289 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 ...
22
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
953 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
651 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
259 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
201 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
805 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
355 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} ...
3
votes
0answers
383 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 ...
12
votes
2answers
726 views

LaTeX Verbatim Source Code Beside the Typeset Output

I am a beginner to LaTeX, and I am reading Leslie Lamport's A Document Preparation System. In various places of his book, he puts the LaTeX source code beside the output obtained by running latex on ...
7
votes
1answer
1k views

Customize \verb!…! output in beamer

I apologize because I am sure this has been asked elsewhere however I couldn't find it anywhere. I would like to change my verbatim throughout a beamer presentation in the preamble. Actually I would ...
9
votes
4answers
214 views

\verb in csquotes

The following code gives me an error: \documentclass[ngerman]{article} \usepackage{babel,csquotes} \begin{document} \enquote{\verb|foo|} \end{document} I guess this is the classic "you can't use ...
4
votes
1answer
533 views

How to handle special characters in LaTeX?

I am working on one file which has some special chacters. König IR : KA}unig ,K ~ A}unig % : Comment in latex (so no text after this %) - : escape I get different output ...
4
votes
1answer
121 views

listing's lst@BeginWrite gobbles '->' and '=>' from input [closed]

I'm trying to write a package that takes verbatim input and appends it to several files. My current approach is based of off an answer by Martin Scharrer to a similar problem. The difficulty arises in ...
9
votes
3answers
372 views

typing \end{verbatim}

I am preparing a presentation in which I want to display the following as it is \begin{verbatim} foo \end{verbatim} For this I used \begin{verbatim} \begin{verbatim} foo \end{verbatim} ...
2
votes
2answers
483 views

Making more easy the itemized of item with tabulation system

Actually, isn’t not really a question. (Since my examinations get close, I don't really have the time to search for a solution to my problems.) Rather than using the common \item, I'd like to use ...
7
votes
1answer
223 views

Typeset text as written (similar to verbatim) within a custom command?

I'm trying to define a new command that puts text in a coloured background, reproduces it exactly how it's defined in the .tex file (in a similar way to verbatim), and won't force me to use ...
7
votes
2answers
757 views

How can I set stretch of verbatim to be different than “global” setting?

In my file I need to use 1.5 line stretch. But, as for verbatim I need it to be 1.0. What should I add to preamble to achieve that? \documentclass{article} \usepackage[nodisplayskipstretch]{setspace} ...
2
votes
1answer
765 views

\pause won't generate extra slides in a containsverbatim frame

It seems that the [containsverbatim] option when applied to a frame prevents beamer from generating intermediate slides if text animation is wanted in it. Only the first step of the animation is ...
6
votes
1answer
2k views

How to force line breaks within a fancyvrb verbatim environment?

Consider the following LaTeX document: \documentclass{article} \usepackage{fancyvrb} \DefineVerbatimEnvironment{example}{Verbatim}{commandchars=\\\{\}} \begin{document} \begin{example} Foo\\{}Bar ...
5
votes
4answers
2k views

Verbatim environment with background color (PDFLaTeX and tex4ht)

I need to make a verbatim environment with gray background color, such as: That needs to work with PDFTeX and tex4ht on an older TeX installation (from 2009 I believe). My approach so far is ...
7
votes
3answers
2k views

Putting in MATLAB codes in a box as figures? [duplicate]

how do I put MATLAB codes in a box or deal with them as if they are figures? Is there a way to do it within LaTeX itself? I am currently using the verbatim environment to present my codes and to be ...
3
votes
1answer
1k views

Custom divider between 2 minipage and lstlisting

I am using the following code to have 2 boxes beside each other for code comparison: \documentclass[12pt]{article} \usepackage{listings} \begin{document} \begin{singlespace} ...
3
votes
1answer
375 views

Color box with outline but some difference

\begin{boxedlaw}{6.4in} \colorbox[HTML]{F8E0E0}{ \begin{minipage}[c]{380px} \begin{center} \begine{verbatim} \# define LM_ENCA 18 //Port0 \# define LM_ENCB 17 ...
8
votes
3answers
347 views

Verbatim in environ’s \BODY

I’d like to print a TeX install guide for different OS, but the most text is the same for all OS. So I build the following \documentclass{article} \usepackage{environ} \newcommand{\mlw}[3]{} ...
10
votes
1answer
1k views

Displaying `\begin{verbatim}…\end{verbatim}` inside the environment verbatim

I would like to display \begin{verbatim}...\end{verbatim} inside the environment verbatim like in the folowing piece of code. Is it possible ? \begin{verbatim} Bla, bla, ...
5
votes
1answer
1k views

Problem with TikZ, beamer and verbatim

I'm trying to put verbatim text inside a node (in a beamer frame): \begin{frame}[fragile]{P} \tikzstyle{cell} = [rectangle, draw, thin , fill=black!10 , minimum size=5mm] \begin{tikzpicture}[node ...