{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

3
votes
1answer
126 views

minted fails with breaklines and obeytabs

The following example with a minted enviroment fails with the error message _minted-test/7587C145B52367AE51CACC4AFB0EC13D2F785CCAC2A2CC760CA216BD1781DF79.pygtex:3: Extra }, or forgotten \endgroup. [ ...
0
votes
0answers
66 views

Forcing page break of a minted listing with \centering on

I am using minted to create a code listing. I need the listing to be centered so according to this solution, I use the \RecustomVerbationEnvironment to escape the verbatim environment so that it can ...
4
votes
1answer
34 views

Double delimiters in listings

Using the listings package, one can define a format for some arbitrary set of delimiters and the characters enclosed within. However, when using double delimiters, the specified format doesn't apply ...
4
votes
1answer
84 views

Why does \verb|“”| in \index{} lead to an error?

\documentclass{article} \usepackage{index} \makeindex \begin{document} \begin{figure} \centering \fbox{Diagram placeholder} \caption{\index{quote (\verb|""|)}ok} \end{figure} \printindex \end{...
0
votes
0answers
22 views

Code is shifted to the right when we run the output

I'm writing a LaTeX document and I want to add my code to the document, but the output appears shifted to the right and some of the data do not appear this is the implementation: \begin{verbatim} ...
17
votes
1answer
556 views

How to display LaTeX code and the typeset version next to each other without repeating myself?

I would like to write some LaTeX code, and without repeating myself, I would like that to be used for displaying that particular piece of code as-is and its typeset version, next to each other. The ...
8
votes
1answer
106 views

How to generate robust verbatim bibliography data

I'm trying to generate a .bib-shaped "biblatex" database from a git change log. A typical(?) item looks like this: @gitcommit{f1750d6, author = {Brent Longborough}, date = {2013-12-15}, title = {...
2
votes
1answer
35 views

Forcing a page break in \VerbatimInput (fancyvrb)

How do I force a page break within a file included with \VerbatimInput? It's C code, and I would prefer a solution that is transparent to the C compiler - something like a form feed (^L) in the source....
1
vote
0answers
78 views

Exporting Eclipse language highlighting

Does anyone know how to insert verbatim code from Eclipse? Not just how to include a file but also keep it's highliting, I use some not-so-widespread languages so exporting it directly would be neat ...
2
votes
1answer
114 views

Error when using [fragile] in beamer [duplicate]

I've got a problem in beamer. When using the fragile option on a frame, the compilation does not work. For instance: \documentclass{beamer} \begin{document} \begin{frame}[fragile] Hello ...
2
votes
1answer
61 views

Verbatim overruns text block

The problem when I export the document to PDF there is some text at the end of the lines does not appear to the print page. How can I fix this? \begin{verbatim} //Add staff.php <link href="../...
3
votes
1answer
149 views

Pretty printing DTDs (Document Type Declaration)

I want to include a didactic, compact view of a DTD (Document Type Declaration) in my texts. DTDs are used to define the set of tags and attributes of a XML/SGML document -- some sort of a grammar of ...
3
votes
2answers
68 views

Using \VerbatimOut in a \newcommand -> FancyVerbError

I'm creating a class for exercices with questions and answerdocument. I have a command \question{} in which I write the question. And I create a box associated at the question in which the student ...
3
votes
1answer
88 views

\verbatiminput causes the rest of the code to be orange in the editor

\documentclass[a4paper, 11pt]{article} \usepackage[utf8]{inputenc} \DeclareUnicodeCharacter{FEFF}{} \usepackage{verbatim, amsmath} \begin{document} \verbatiminput{R1.txt} This text is ORANGE\\ $\...
2
votes
2answers
150 views

Inline verbatim with line breaks, colored font and highlighting

I'd like to be able to use inline verbatim text with the following features: Line breaks, as provided for example by package spverbatim, command \spverb; Colored font, as provide by package color; ...
2
votes
2answers
314 views

Use verbatim inside \newcommand [duplicate]

Probably this was already answered. But I did not find it. How can I use verbatim inside \newcommand{} or \begin{environment}...\end{environment}. In my MWE, the last two lines produce errors. \...
4
votes
2answers
128 views

Italic font for the entire verbatim section

How can I change the font format to italic within the verbatim environment ? \documentclass[a4paper]{article} \begin{document} \begin{Verbatim} @book{book; title = {title}; author = {author}; ...
2
votes
1answer
74 views

How to type apostrophes in verbatim material

How can I type an apostrophe in \verb mode? I've tried using \' and I've seen solutions that work in the verbatim environment, but I'm not sure how to do this inline. Thanks in advance!
3
votes
1answer
579 views

How to change verbatim text to Consolas?

How to change the verbatim text so that a zero shows up with a slash across it? I would like to know if the verbatim text can be changed to say Consolas? Here is my code: \documentclass{article} \...
2
votes
1answer
49 views

Large table in “programming” type font

In my code below, the table appears in a "programming" type font. If I have a larger table (like say in a text file), how can I import that table into my document without having to typing the whole ...
3
votes
1answer
97 views

Multiple line verbatim environment

I want to achieve the output shown below using multiple line verbatim My attempt so far is \documentclass[a5paper]{article} \usepackage{listings} \begin{document} \begin{lstlisting} 123 $\times$ ...
1
vote
1answer
277 views

Highlight text in verbatim environment [duplicate]

I want to highlight a certain element in this matrix from matlab output. How can I do this in the verbatim environment? \begin{verbatim} P = 1.0000 0.7000 0 0 0 0 ...
2
votes
1answer
116 views

Can the `verbatim` environment be used inside a custom environment definition?

I have the following code: \documentclass{minimal} \newenvironment{abc} {\begin{verbatim}} {\end{verbatim}} \begin{document} % This works. \begin{verbatim} abc \end{verbatim} % This does not work....
5
votes
2answers
332 views

Issue with special characters in Python code

I am trying to insert a Python code into a LaTeX document. The Python code (an example) is the following and contains many special characters (>, <, °): valeur = input('Veuillez entrer une valeur ...
4
votes
2answers
174 views

“Runaway argument?” just in the \input file

Update: Upon @egreg suggestion, the case shown below is the core of the problem and has nothing to do with include/input statements. I have a verbatim within toggle statements, which fails. A minimal ...
2
votes
1answer
128 views

No indent for verbatim environment

I would like to deactivate the indent for the verbatim environment, such that left margin is the same for everything. \documentclass{article} \usepackage{verbatimbox} \makeatletter \setcounter{...
3
votes
2answers
124 views

Write math and make a box with alltt environment

I tried looking up for this, but I have not found a way to do both at the same time. I would like to write math symbols in a verbatim like environment, for which I use alltt. But I would also like to ...
3
votes
3answers
335 views

Quote verbatim in Latex

I would like to quote some passages using the quote environment. However the quoted passage contains some math mode equations written in text format like "Your paper is worthless because x^2 +y^2 = 0."...
1
vote
1answer
54 views

Polish signs in verbatim beamer envir

I would like to get polish signs in the verbatim environment for the beamer document type, e.g. \begin{frame}[fragile] \frametitle{Napis- funkcja print} \begin{block}{Przyk\l ad} \begin{verbatim} &...
4
votes
2answers
139 views

Programming code listing: enumeration and left margin

I'd like to inlcude programming codes in LaTeX by using the verbatim package. For the code I use, the enumeration is continous. So if a new code starts, the numbers are ongoing, which should not be ...
2
votes
1answer
41 views

Suppressing the newline when entering an environment

Is there anyway to suppress the newline that is inserted when beginning an environment? For example, I would like \noindent{\bf 1.}\begin{verbatim}some code\end{verbatim} to appear as a single ...
2
votes
1answer
148 views

how to wrap a long terminal command without real line breaking?

this may look like a duplicate question to this one and many, but really I had a hardtime in finding the desired solution. The breaklines=true didn't work as it breaks the long command. Hence simple ...
0
votes
1answer
60 views

LaTeX command inline in the caption of a figure [duplicate]

I want the caption of a figure to contain a LaTeX command without it being executed: Using verbatim environment doesn't work in this case and throws errors. Please suggest a solution to this.
2
votes
0answers
29 views

How can I put a vertical line | within the \verb command [duplicate]

How can I put a vertical line | within the \verb command to get something like this
4
votes
1answer
112 views

Isolate Latex Environments [closed]

I want to build a framework for sharing latex mathematics exercises. When trying to assemble exercises from different authors into one "homework assignment", I have a problem. How can I deal with ...
1
vote
1answer
63 views

How to automatically escape special characters in your own environment?

I need to create my environment for examples of source codes. I want it to look like this: Code example: ------------------------------------------------ # This is the code example echo 'Hello' --...
4
votes
1answer
168 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 ...
3
votes
1answer
1k 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} \end{...
2
votes
1answer
54 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
275 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
122 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
336 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
90 views

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

I know enough LaTeX to produce great looking documents. LaTeX makes it more difficult to NOT do that. But I don't advanced LaTeX or TeX or plainTeX or "@" or other advanced, cryptic programming tricks,...
5
votes
1answer
71 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
55 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 ...
15
votes
2answers
521 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 ...
4
votes
1answer
124 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} {\immediate\...
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} \begin{...
1
vote
1answer
37 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
76 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 ...