{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.
3
votes
1answer
95 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
91 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 ...
4
votes
2answers
169 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
72 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
344 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 ...
0
votes
0answers
36 views
Verbatim environment — line breaking? [duplicate]
Possible Duplicate:
Verbatim environment and line-breaking
How do I make this two lines not overpass the page limit?
\documentclass[11pt,a4paper]{book}
\begin{document}
\begin{verbatim}
...
4
votes
1answer
157 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
179 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 ...
1
vote
2answers
404 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
58 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
4
votes
0answers
262 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 ...
11
votes
1answer
176 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
409 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
186 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
99 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
443 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 ...
5
votes
2answers
1k 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
106 views
Pagebreak and Verbatim environments
Given the following piece of code:
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage{fancyvrb}
\DefineVerbatimEnvironment{shell}{Verbatim}{
commandchars=\%\{\},
label=\shelltitle,
...
7
votes
1answer
803 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
139 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
583 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
155 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
388 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
128 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 ...
7
votes
1answer
2k 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?
5
votes
3answers
440 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
136 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
144 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 ...
16
votes
2answers
671 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
370 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
280 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
198 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
127 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
415 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
250 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
241 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 ...
11
votes
2answers
469 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
586 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
163 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
337 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
97 views
listing's lst@BeginWrite gobbles '->' and '=>' from input
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
219 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
306 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
172 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
465 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
405 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 ...
4
votes
1answer
815 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
...
4
votes
4answers
882 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
...
6
votes
2answers
796 views
Putting in MATLAB codes in a box as figures?
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
641 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}
...

