{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
2answers
87 views

Verbatim has different margins than BVerbatim

I am changing some Verbatim blocks to BVerbatim to avoid page breaks in the middle of some short source code examples: \documentclass[a4paper]{book} \usepackage[T1]{fontenc} \usepackage{fancyvrb} ...
1
vote
0answers
67 views

To modify Verbatim generated by sphinx-python

I would like to define \renewenvironment (later will put it in preamble in conf.py) so that tcolorbox appears around Verbatim code. Here is a sample of Verbatim: ...
6
votes
1answer
97 views

Verbatim code environment dash dash

I have the following environment for displaying code: Which works pretty fine but now I have the problem that -- becomes an en dash inside that environment. For example here: I tried also {-}{-} and ...
5
votes
1answer
86 views

Set line spacing everywhere but in verbatim blocks

Is it possible to change the linespacing of a document except for inside verbatim blocks? \usepackage{setspace} \onehalfspacing The above results in more readable paragraphs, but the code snippets ...
13
votes
2answers
222 views

Getting verbatim with soft grey background, as in tex.stackexchange

Given a verbatim as on below, \begin{verbatim} This is an awesome verbatim \end{verbatim} which is displayed with no background on the compiled pdf page : This is an awesome verbatim I would ...
3
votes
1answer
81 views

verbatim with Arabic script

I try to put together guidelines for linguists. One part concernes typesetting right to left text with the bidi package. I want to use verbatim for the code, but the Persian characters are not printed ...
7
votes
2answers
2k views

Verbatim in beamer showing error: “File ended while scanning use of \@xverbatim.”

I am using Texmaker and MiKTeX on Windows 7. I have the following beamer code, \documentclass{beamer} \theme{AnnArbor} \begin{document} \begin{frame} \begin{verbatim} ...
9
votes
2answers
229 views

How can I encode the current document as a QR code with pst-barcode?

\documentclass{article} \usepackage{pst-barcode} \begin{document} \begin{pspicture} \psbarcode{\input{\jobname.tex}}{}{qrcode} \end{pspicture} \end{document} I tried placing \expandafters before ...
9
votes
1answer
502 views

How to typeset LaTeX code inside a Table environment?

I wanted to typeset LaTeX code directly into my document, but without it doing something, i.e., I just want to show my code in the output. Now, I know there is the verbatim environment for code, as ...
4
votes
2answers
100 views

Shrinking verbatim text

Heiko Oberdiek helped me a lot by finding a solution for shrinking text when needed. I want to apply this method to verbatim text as in the example below, but this is somehow forbidden (Something's ...
5
votes
3answers
101 views

How could a verbatimtab environment in a figure environment be resized (perhaps using the package adjustbox)?

How could a verbatimtab environment in a figure environment be resized (perhaps using the package adjustbox)? I have some code something like the following: \begin{figure}[htb] \centering ...
6
votes
2answers
196 views

Bold monospace font extra-large

I would like to print very large (e.g., font size 43) monospaced bold text. The methods I know don't seem to go together: \documentclass[10pt, a4paper]{article} \usepackage{anyfontsize} ...
6
votes
1answer
122 views

Formating verbatim (not using listing package)

Considering the following verbatim: \begin{verbatim} ...
3
votes
3answers
157 views

How to put lots of brackets

I want to show all valid bracketed strings made from {} [] (). This is the intended output: {[()]} {[]()} {[]}() {([])} {()[]} {()}[] {}[()] {}[]() {}([]) {}()[] [{()}] [{}()] [{}]() [({})] [(){}] ...
3
votes
1answer
161 views

Hyphenation when using \verb command

I'm having a problem using \verb command. Usually when I want some verbatim font in the current line (not in a new paragraph) I use the \verb command, not the verbatim environment. So, when I use ...
2
votes
1answer
129 views

Handle % character in verbatim inside a grey box

I found this snippet on the internet which is used to produce a text area inside a greybox. \newcommand\greybox[1]{% \vskip\baselineskip% \par\noindent\colorbox{lightgray}{% ...
6
votes
1answer
217 views

How to scale a verbatim block in a user-defined environment?

In order to produce an ereader-friendly PDF with small page dimensions, I'd like to scale down some oversize verbatim blocks such as program output with lines too long for the small page. Then readers ...
4
votes
1answer
120 views

How to globally set \verb font style to match the default document style?

I would like to set the \verb{} font so to correspond to the current family and size of my document. That is, the output must be indistinguishable by the rest of the text body whatever style is set as ...
8
votes
2answers
167 views

Allow source code to wrap around a figure

I would like to be able to wrap source code around a figure. Here's a MWE that should make it clear what I have in mind: \documentclass{article} \usepackage{wrapfig} \usepackage{listings} ...
3
votes
3answers
987 views

How to set font size for all verbatims in Beamer presentation?

I'm trying to read through the Beamer manual, but I don't even really know what I'm looking for, so please help. How do I change globally (but even if it is a per-frame, it will be still good) size ...
1
vote
0answers
50 views

displaying tex file from external file [duplicate]

I have som .tex with are input for a program, how do I display this files? Is there any way to input it, or do i have to write it alle in or make a screen shot?! I'm gonna be chaining these files a ...
0
votes
0answers
16 views

Using \begin{verbatim} inside an fbox [duplicate]

I can't seem to be able to merge my fbox with my verbatim environment. This is the pseudo-code: \fbox{ \begin{verbatim} Some text other text here . \end{verbatim} }
1
vote
1answer
99 views

Using `minted` environment inside a `tabu` table

I am trying to use a piece of highlighted code using the minted package inside a tabu table: \documentclass{article} \usepackage{minted} \usepackage{longtable} \usepackage{tabu} \begin{document} ...
4
votes
1answer
100 views

Tikz + Verbatim + Sphinx , output drawn twice with slight offset. Works great Tikz + Verbatim

I'm working on a piece of software that outputs IPython Notebooks as tex documents. One of my requirements is to be able to draw code input output blocks that look like the Notebook's UI. ...
5
votes
1answer
137 views

Getting Math Operators to work in verbatim

I'm very new to Latex and I'm looking to simply have math operators appear with in verbatim tags as follows: \begin{verbatim} 24: max:=0 25: for i:=n downto 1 do 26: found:=false 27: ...
5
votes
2answers
89 views

How to locate the verbatim text in centre of the page?

Here is an code that i want to display in verbatim mode. But the displayed code is locate at the left of the page. \begin{singlespace} \begin{verbatim} Imread('filename'); \end{verbatim} ...
8
votes
1answer
103 views

Formatting code fragments extracted from file with minted

I would like to use the catchfilebetweentags package to grab code snippets from a source file and use minted to highlight them. Imagine I have the following in program.scala: //<a def ...
3
votes
1answer
66 views

Using collect to gather content with listings, comments or verbatims

I was looking into a way to set up a project with multiple files, in which several files could declare content to be included in different sections of the main tex document. After this Q&A, I ...
3
votes
1answer
243 views

LaTeX complaining commands in Verbatim

Known Fact: Have read this LaTeX complaining about illegal parameter number With a Verbatim environment, every LaTeX commands will be handled as plain text. However, I need a working command in the ...
2
votes
0answers
92 views

Deciding whether to end a line with a character or not in lstlisting [closed]

I need to write a document where there are written inputs and outputs of unix command line interface software (through bash). For example I need to show something like: $ git log --pretty=format:"%h ...
9
votes
2answers
165 views

Print small TeX code verbatim and render it

To write some documentation, I would like the ability to define a command such as \showcase{x^{y}\in\Omega} which expands to something roughly equivalent to \verb|x^{y}\in\Omega| & ...
3
votes
1answer
162 views

Color Text and BG of Verbatim, without affecting `fancyvrb` line numbers

The MWE below aims to color the text and background of a Verbatim environment. \documentclass{article} \usepackage{fancyvrb} \usepackage{color} \usepackage{calc} ...
7
votes
1answer
106 views

Incorporate asymptote environment into macro

I'm trying to write a macro (ideally an environment, but a command would do) that takes a piece of Asymptote code, displays it in a verbatim environment, and then runs it through an asy environment. ...
3
votes
1answer
176 views

How can I center a Sweave verbatim chunk?

I have a very simple sweave chunk with two lines, like this: <<results=verbatim>>== quantile(foo$bar) @ How can I center this element? I've tried embracing the chunk with \begin{center} ...
5
votes
1answer
118 views

difficulties getting lrbox to cooperate with Verbatim environment

This is a follow up to an earlier question of mine: local commands are not recognized when trying to define a wrapper lrbox If I write \documentclass{article} \usepackage{fancyvrb} ...
2
votes
1answer
258 views

Putting math inside a verbatim environment without altering the formatting

In a verbatim code listing, I want to use inline math in comments with the same formatting that I get for inline math in body text. I can use a math environment, but the spacing is weird. In this ...
3
votes
2answers
194 views

One verbatim column in pgfplotstable and a non-verbatim header

I wanted to create a pgfplotstable in which one column would be treated as verbatim. I first tried to straightforwardly use \verb but I almost expected this to fail spectacularly and it did. I found ...
3
votes
1answer
167 views

Indentation with beamer fontspec and alltt

The following document mangles the indentation of the second line of the alltt (the pipe/bar character does not occur under the equals of the previous line). \documentclass[14pt]{beamer} ...
4
votes
1answer
221 views

Replace lstlisting with verbatim depending on a boolean

I use latex2rtf to convert latex documents to .rtf and thence to MS-word (see this thread). To do this, I set up a custom class and limit which packages are used as latex2rtf only accepts a limited ...
2
votes
1answer
196 views

Verbatim Linebreaks

I would like to enable automatic line breaking in Verbatim environment; besides I do not want to use lstlisting as it will not have exactly the same font shapes as Verbatim and some other special ...
8
votes
2answers
2k views

How to center verbatim [duplicate]

\begin{figure} \centerline \begin{verbatim} for (int a = 0; a < 10; a++) for (int b = 0; b < 10; b++) ... \end{verbatim} \caption{C++ code} \end{figure} I would like the figure to be ...
0
votes
1answer
51 views

Is there a package (or command) to escape filesystem paths? [duplicate]

I see this is one option: c:$\backslash$subd1$\backslash$subsubd1 for representing c:\subd1\subsubd1 is there something that leaves the TeX a bit more human-readable, such as ...
11
votes
1answer
341 views

Changing font in tabular

I desperately need someone's help. For the past hour I was trying to perform a task so diabolically difficult, even the Hercules himself couldn't achieve: change the freaking font in a table. My ...
4
votes
1answer
983 views

Automatically wrap the text in verbatim

In tex environment, when I try to use the verbatim function using verbatim packages, sometimes the longer text in the line tend to be cut off. How can I resize the text to fit into the line or ...
7
votes
1answer
159 views

How to write “a” in semiverbatim environment with ngerman without writing “{}a”?

\documentclass{beamer} \usepackage[T1]{fontenc} \usepackage{lmodern} \usepackage[utf8]{inputenc} \usepackage[ngerman]{babel} \begin{document} \begin{frame}[fragile]{Umlauts} \begin{semiverbatim} ...
6
votes
2answers
101 views

How do I get a token list with an end-of-line character in it?

The context of this question is that I have a command defined using xparse that slurps in a verbatim argument which can be long. I want to do a replacement on the resulting token list, but the token ...
2
votes
1answer
78 views

Sweave.sty causing error in verbatim environment?

folks-- The following throws an error, shown below \documentclass{book} \usepackage{Sweave} \begin{document} \begin{verbatim} data ds; infile 'dir_location\filename.csv" ...
2
votes
1answer
74 views

Import author list from a txt file in latex

I'm trying to import author list to my latex article. But keep getting errors. Here is my code: \documentclass{article} \usepackage{verbatim} \title{\verbatiminput{title.txt}} ...
0
votes
0answers
70 views

verbatim environment fails on ' and `? [duplicate]

\begin{verbatim} infile 'dir_location\filename.csv' delimiter=","; \end{verbatim} throws an error on the first '. What the H?
6
votes
2answers
343 views

Highlight \verb in inline text

I'm new in LaTeX and I'm searching for solution to highlight verbatim text inside paragraph (for example, it is like on this page, where code is highlighted). Can anyone help me with this? Let say, ...