{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

4
votes
1answer
77 views

Can you interpret macro parameters as verbatim?

Basically I want to define a macro whose parameter should be treated as a "script", meaning that I want to print it in a verbatim way including line breaks and special characters. Furthermore, I want ...
1
vote
1answer
30 views

“Paragraph ended before \verbatim@ was complete.” when trying to use verbatim in tabular

I have the following code in my Beamer slide code: \begin{frame} \frametitle{selections} \begin{tabular}{ll} sample 1 & \begin{minipage}{3in} \begin{verbatim} sample 2 \end{verbatim} ...
2
votes
1answer
26 views

How should multiline pieces of code be put into a table?

I have the following two pieces of information that I would like to present side-by-side in a Beamer slide. I think I'd like these two things in two cells of a two-column table. Is there a good way to ...
4
votes
2answers
58 views

Why \texttt and \verb giving errors when using with LaTeX commands inside their input

On latest version of MikTeX, following works: \begin{align*} \int sinxdx && \texttt{test line 1}\\ \int{sinx}dx && \texttt{test line 2}\\ \end{align*} But the following gives error: ...
8
votes
1answer
74 views

minipage with verbatim package doesn't compile

This is my code: \usepackage{verbatim} \newenvironment{listing} {\begin{minipage}{\linewidth}\verbatim} {\endverbatim\end{minipage}} However, it doesn't compile: Runaway argument? ! File ended ...
8
votes
3answers
91 views

Include a footnote in verbatim text

I have seen how to add verbatim text to a footnote: How to obtain verbatim text in a footnote? What I would like to do is the opposite, include a footnote in a verbatim section. I am using the memoir ...
0
votes
1answer
52 views

new \input{file} Package, Command wrapper: microtype .tex with reserved symbols

I know enough basics in LaTeX to produce a decent looking document. LaTeX makes it more difficult to NOT do that. But I don't know plainTeX or "@" and other advanced, cryptic programming tricks that ...
5
votes
1answer
51 views

Rewrite \begin{foo}\end{foo} to \begin{bar}{opts}\end{bar}?

I know this is likely a simple Latex macro question. I've got a large document with a ton of lstlisting blocks, and I'd like to use minted instead. That means turning blocks that look like this: ...
5
votes
1answer
36 views

When is verbatim content absolutely necessary?

Item 9 of this answer to Documents with typical LaTeX errors says: \verb and friends are delicate and should be handled with care. It deals with the advanced topic of category codes and is perhaps ...
14
votes
2answers
380 views

Nicely typesetting verbatim text

I want an environment in which LaTeX typesets the text just like it otherwise would, but without accepting any commands whatsoever while within this environment. None of the answers to this question ...
3
votes
1answer
44 views

How can I write verbatim code to a file with \immediate\write?

I'm using the technique described in egreg's answer to Efficient way to write backslash to a file to write LaTeX code in an external file: \newwrite\mywriter \NewEnviron{writethis} ...
0
votes
0answers
21 views

Verbatim Frame Incompatibility [duplicate]

It's driving me nuts that using verbatim causes the \end{frame} statement to throw an error. How do I fix this? LaTeX: \documentclass{beamer} \begin{document} \begin{frame} ...
0
votes
0answers
23 views

How to enable verbatim environment under self defined environment?

So I want to define an inline environment !foo!, and write foo into an exteral file. Here is my source code: \catcode`!=13 \newwrite\mmtlatexfile \immediate\openout\mmtlatexfile=\jobname.mmtlatex ...
1
vote
1answer
59 views

Macro/shortcut for defining text portion as code

I'm currently converting my thesis into LaTeX, and i have an issue: being an IT thesis, I have tons of code quotes. The problem is not about the blocks of code: they are not that many and i can wrap ...
2
votes
2answers
45 views

Changing verbatim input in beamer slide

I am trying to produce a presentation where code for a pair of arrays appear in the same position of a beamer slide. I tried something like this (with different combinations and braces) and did not ...
5
votes
2answers
191 views

How can I replace tabs with spaces before compiling .tex file?

I want to indent text in the verbatim environment. I want to do this with the tabulator. The problem is that verbatim does not work as advertised ("prints unmodified text"). It actually replaces the ...
1
vote
1answer
66 views

How to create LaTeX example codes using verbatim and large braces?

I read this question it's useful but isn't exactly what I need. My problem consists in create an array, table or something like that with two columns. In the left one I need to put LaTeX code with ...
2
votes
1answer
26 views

Verbatim without breaks

Hi I found a lot of questions which suggest something like How to box verbatim to prevent page break? to prevent breaks in a Verbatim environment. However this does not work for me as I display some ...
3
votes
1answer
38 views

texinfo - wrap long lines in code

I found a hint from Karl Berry written 4 years ago about how to get line wrapping in code samples, in texi2pdf output. I demonstrate that solution below. However, it would be interesting to know if ...
4
votes
1answer
26 views

Pass options in verbatim environment inside another environment

I want to define a new environment (here testenv), which is going to include text in verbatim mode. So, I have the code: \documentclass{article} \usepackage[english,greek]{babel} ...
1
vote
1answer
42 views

How to add verbatim in a float figure on right page?

I've discovered this post to define the command addfig{} to put figures on the right page. My problem is that it doesn't work if the figure is a verbatim element. Here is a minimal not working ...
11
votes
3answers
362 views

End \verbatim command

The verbatim environment is used to display LaTeX commands instead of having them executed. To display a single command in-line, the \verb|| command can be used. To display a whole block, we can use ...
1
vote
1answer
51 views

how to embed arbitrary code

I am using the listings package which does great things for C++, Java. but what about for a makefile, which isn't one of the supported languages? I just want the equivalent of listings, nothing ...
1
vote
0answers
35 views

How can I remove extra spaces in code passed through probsoln package?

This is an easy question to a potentially complicated situation. I'm using RStudio to write homework and exams using the probsoln package that embeds R code into the LaTeX directly. I am using knitr ...
4
votes
2answers
53 views

Multiline code listings in CWEB

Perhaps this is insane, but I would like to include code listings in a CWEB program, because the program is processing source code in another language. But how do I create multiline verbatim code ...
1
vote
0answers
58 views

How to add self defined environment to verbatim environments

Using the following code in emacs configuration file makes the listed environment as verbatim. (setq LaTeX-verbatim-environments-local '("Verbatim" "lstlisting")) How can I add following ...
0
votes
0answers
27 views

How to break a text in `\verb| |` mode [duplicate]

Let's say I have strings of symbols that are not in math mode but I'm trying to define kind of a language that is going to be used in a protoboard. So I have to explain how this language works but for ...
1
vote
1answer
41 views

Verbatim/listings in beamerposter?

I have prepared some nice posters using beamerposter, but now I came to a poster where I would like to add a few lines of code. By just adding [fragile] to the frame I get an error: File ended while ...
1
vote
1answer
73 views

How to write code examples in LyX?

I'm using LyX for Hebrew documents. When I add a Verbatim environment with English language, sometimes after a little editing the language change automatically to LaTeX and the compiled Verbatim text ...
5
votes
1answer
43 views

Concatenating files created with filecontents

I am creating a large number of data files "on the fly" using the filecontents package. I need to be able to concatenate these files in various permutations For example in the MWE below, I would ...
3
votes
1answer
66 views

Non-curly quotes in code?

Here is a quick question, how to use tex to print this ' symbol? An example is shown below: data 'a list = Nil | Cons (e, 'a list) I tried to use ' or `, but they all looks bad.. I am sorry but I ...
1
vote
1answer
44 views

Getting non-curly quote marks with PythonTeX 0.14

I'm unable to get the non-curly quotation marks ('upquotes') to print inside any of the PythonTeX (v=0.14) environments. Here's my MWE: \documentclass{article} \usepackage[T1]{fontenc} ...
3
votes
1answer
122 views

verbatiminput formatting of gretl output, minus sign missing

I'm preparing econometrics tutorials and this year we changed the software (now using gretl). I want to include regression output from a text file. However, the \verbatiminput command does not ...
1
vote
1answer
55 views

How could I write a Latex tag in source form in section name?

I tried to use \verb|| and \lstinline[language={[LaTeX]TeX}]{} and they failed. I just want to write a name of latex tags in section names for internal purposes. For example, I couldn't compile a ...
1
vote
0answers
22 views

define environment with Verbatim and options [closed]

I'm working on an edition, and I need to create some environments using verbatim. I use the fancyvrb package and when I write : \documentclass[9pt]{report} \usepackage{xltxtra, fontspec, xunicode, ...
1
vote
0answers
61 views

Verbatim vs Listings for Thai Font

I have a problem about verbatim and listings. I need write some codes by using Thai font but it shows in picture \documentclass[12pt,a4paper,oneside]{book} \usepackage{verbatim} \usepackage{listings} ...
5
votes
2answers
70 views

show content of token register as a string in the document

I'm trying to implement a command that can execute its argument, but also print it. To that end I'm dumping the argument into a toks register and use LuaTex to put it back with inactive catcodes; as ...
1
vote
0answers
17 views

how to put Verbatim inside minipage that has fbox around it? “Paragraph ended before \FV@BeginScanning was complete. }” [duplicate]

I am surprised that I get an error when I add Verbatim to content of minipage that had \fbox around it. Removing the \fbox removes the error. But I need to put frame around the minipage. I can't use ...
5
votes
1answer
155 views

How to stop verbatim from converting tabs to spaces?

I am using verbatim to put some sample code in my document: \begin{verbatim} [start] printf{"Start command received"}; [stop] printf{"Stop command received"}; \end{verbatim} I ...
1
vote
2answers
70 views

How to prevent double quotes when using the verbatim package and fontenc?

Is there a way to disable LaTeX's transformation of all double quotes e.g. '' `` << >> into formatted double quotes when using the verbatim package in conjunction with fontenc and ...
2
votes
1answer
104 views

Colored LaTeX command in verbatim

MWE, \documentclass[a4paper,11pt]{book} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage{lmodern} \title{} \author{} \begin{document} \maketitle \tableofcontents \chapter{} ...
2
votes
3answers
40 views

How can I get the same margin to a verbatim environment as the fleqn option gives to equation

When I use a verbatim environment, I'd like to have some margin, of the same length as those provided by the fleqn option when using an equation environment. \documentclass[11pt,fleqn]{article} ...
1
vote
0answers
37 views

word wrapping line question

I have a text that looks like {attribute_1=1, ARRAY=[ { "x" : 180 , "y" : 175 , "z" : 176} , { "x" : 179 , "y" : 176 , "z" : 177} , { "x" : 178 , "y" : 177 , "z" : 178} , { "x" : 177 , "y" : 177 , ...
1
vote
1answer
57 views

How can I create a command or environment that starts and stops verbatim?

I am writing a simple LaTeX guide, aimed at editors of a student paper. The paper is for students of mathematics and physics at my university, and so we use LaTeX. Anyways, I want to include lots of ...
5
votes
1answer
65 views

Vanishing spaces between words inside a QRcode

When the text of a QRcode comes from a \newcommand{\TextInsideQRcode}, the spaces between the words vanish. Is there a way to maintain the spaces between the words ? \documentclass[]{article} ...
14
votes
2answers
510 views

History of the command \verb

Recently I inherited some LaTeX code for a CV that contained an e-mail address typed with \verb}john.smith@uni.org}. This snippet was in the middle of an multicol environment (so it was within several ...
0
votes
0answers
58 views

Automatically show verbatim content of a custom environment

I've defined an environment with \newenvironment, which I am mainly using for tikz diagrams. I have it set to dynamically change the margins, vertically and horizontally center the diagrams, and put ...
4
votes
1answer
58 views

Insert a function by “Verbatim”, but not start a new line

I want to insert a function using verbatim so that my code looks like in a good way (different than regular text). When I insert a function, I always start a new line. Could I insert the function just ...
0
votes
0answers
38 views

Framing and colorizing a LaTeX command [duplicate]

I normally use \verb|\LaTeXe| to typeset the command \LaTeXe in my document. But now I want to frame or/and colorize the command \LaTeXe. How can we do that? \documentclass{article} ...
1
vote
0answers
80 views

Add verbatim code to longtable caption

I'd like to add a caption containing verbatim characters using \verb to a long table using the package longtable. The reason for this is that I want to improve the LaTeX output of pandoc, which uses ...