{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
0answers
77 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
97 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
58 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
143 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
60 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
83 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
135 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
283 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
119 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
71 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
529 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
79 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
253 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
102 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
315 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
161 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
114 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
117 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
313 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
53 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
131 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
40 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
140 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
58 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
110 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
60 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
160 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 ...
2
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
52 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
255 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
121 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
318 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
88 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
70 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 ...
14
votes
2answers
507 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
115 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
75 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 ...
4
votes
2answers
92 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
355 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
229 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
34 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
71 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
71 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} \usepackage[utf8]{...
1
vote
1answer
62 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
4k 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 ...