{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
33 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 ...
0
votes
0answers
11 views

Change Language in Verbatim Environment

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 ...
17
votes
2answers
554 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 ...
10
votes
2answers
363 views

Macro \verb inside tabu environment

I would like to use the \verb command inside of a tabu enviroment. Here is my example \documentclass{article} \usepackage{tabu} \begin{document} \begin{tabu}{lll} a & \verb+\wedge+ & b\\ c ...
3
votes
1answer
60 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
33 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
72 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 ...
2
votes
1answer
56 views

Append verbatim material to a file

I am using the fancyvrb package. I'd like to create a verbatim-like environment that does the following two things: 1) Append the verbatim material as-is to a file that has already been opened. 2) ...
1
vote
1answer
37 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 ...
63
votes
3answers
59k views

When should one use \verb and when \texttt

Sometimes people here use \verb!A SHORT COMMAND! and sometimes \textt{A SHORT COMMAND}. I'm unsure when to use which. Are there any guidelines or arguments for \verbatim vs. \texttt?
1
vote
0answers
18 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
39 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
56 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 ...
4
votes
2answers
110 views

Show whitespace characters in monospace environments

I need to render an ASCII file for printing in a way that removes ambiguity if (very unlikely) one decides to type it in and validate the signatures. Essentially, I need a monospace typesetter that ...
1
vote
0answers
14 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
71 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
40 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
3answers
29 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} ...
2
votes
1answer
82 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{} ...
1
vote
0answers
20 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
47 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 ...
14
votes
2answers
473 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 ...
5
votes
1answer
39 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} ...
6
votes
1answer
69 views

Passing content as argument (or macro to be expanded) to verbatim environment

Is it possible to custom what it's inside a verbatim environment? Suppose I want to print as verbatim something to be calculated on the fly, inserted in a kind of verbatim template. Think for example ...
0
votes
0answers
50 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
54 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} ...
15
votes
1answer
40k views

In-line \verb — overfull hbox problem

I'm having a problem that I've had before and I'm tired of hacking my way through it and hope that there is some supported solution. I'll go ahead and create a document for example: \documentclass ...
13
votes
1answer
6k views

Center-align the verbatim environment

I am trying to center align the content of a figure that has verbatim text in it. But the verbatim text is always right-aligned: \begin{figure} \centering \begin{verbatim} some text here ...
1
vote
0answers
44 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 ...
1
vote
1answer
46 views

Beamer overlays with tikz nodes break verbatim whitespace handling

I can't get any of the verbatim environments (alltt, semiverbatim) to respect white space as soon as I place it in an overlay macro: \documentclass{beamer} \begin{document} \begin{frame}[fragile] ...
3
votes
0answers
33 views

Strange verbatim issue in beamer even after issuing `fragile` option [duplicate]

I am trying to develop a beamer tutorial in beamer. Let us suppose that we have the following code: \begin{frame}[fragile]{A slide with the table of contents} For having a slide with the table of ...
12
votes
4answers
363 views

How can I write % into a file?

How can I write % into an auxiliary file? % will not work, because LaTeX thinks that I start a comment with it (in the main file, not in the auxiliary file!), and \% will write \% into the file. How ...
4
votes
2answers
43 views

Empty groups {} when writing environment contents verbatim (but with expanded macros)

In answering this question, I noticed some trickiness regarding empty groups {} in an otherwise verbatim context. Suppose you capture the contents of an environment verbatim (as in that question), ...
2
votes
1answer
118 views

TikZ annotation inside listing inside TikZ node

In the below code, on the first frame I typeset a code snippet with verbatim, and all is well. On the second frame I want to add a TikZ annotation to the code snippet, but I have to switch back to ...
5
votes
2answers
83 views

Writing environments out to files and prepending/appending additional code

I am using the following code snippet to write environments out to files and run arbitrary commands (like python or Rscript). It works quite nice however I would like to write something to the file ...
1
vote
1answer
62 views

How to add labels in verbatim env. in Latex?

I'm writing master thesis where I need to include some parts of program code. This code needs to be commented and properly described in text below/above. I would like to add some specific labels in ...
2
votes
1answer
451 views

Potential problems from passing macro arguments to \verb

I've been working on a command that will typeset snippets of code within a paragraph. I'm aware of listings and company, but I want something that will just typeset the code verbatim and also allow ...
4
votes
2answers
128 views

Manually specifying a system TTF font seems to break curly/smart quotes

The following code... \documentclass{article} \usepackage{lipsum} \usepackage[a4paper, margin = 0.4in]{geometry} \usepackage{fontspec} \begin{document} \fontspec[Scale=3]{URW Bookman L Light} ...
5
votes
2answers
70 views

How do i put verbatim text as the body of a link?

Is there a way i can have verbatim text inside a link? \href{www.numpy.org}{\verb|numpy|} does not work. I tried using cprotect; \cprotect\href{www.numpy.org}{\verb|numpy|}, but then I end up with ...
4
votes
1answer
48 views

How to create a minimal working example for verbatim use in macro definition with cprotect?

cprotect can be used to use verbatim in a macro definition according to the package specification. Just like everything else in the world that doesn't provide an example it doesn't work in real life ...
3
votes
1answer
64 views

Getting WinEdt to ignore lstlisting

WinEdt 9.0 gives me incorrect TOC in its side panel when I use listings package to illustrate a piece of LaTeX code: How can I get WinEdt to ignore \begin{lstlisting} ...\end{lstlisting} (and ...
9
votes
5answers
517 views

how fancyvrb background color fill completely with fillcolor?

I'd like the whole Verbatim (fancyvrb) block to have a background color. How do I do it? The fancyvrb package does define a fillcolor -- but that only colors the area around the margin -- not the ...
11
votes
1answer
135 views

Expansion of verbatim material

I am passing a file name in the command line which contains underscores and would like to print the name of the file in the resulting PDF. So, need some expansion magic so that the output is: The ...
1
vote
2answers
41 views

Escaping “math” characters in boxed verb

When I want to print out some common "special meaning" characters, I use the \verb command, i.e. \verb?x^2 + 1? (No, I don't wan't to use the math mode, I want to print out that ^ character.) ...
4
votes
2answers
214 views

Difference between fixed-width and proportional typewriter fonts in listings?

In the MWE below, I wonder why does the pcr (Courier) font align in both escaped and unescaped versions and for whatever column setting of {listing} - while the cmtt (Computer Modern Teletype) aligns ...
3
votes
3answers
89 views

How to insert the inbuilt keywords in latex

I am creating a simple tutorial file to take a seminar. My problem is: I want to get the output as "\textbf is used for making the font bold". How can I get that? Likewise, i want to make this for ...
5
votes
1answer
114 views

Incorrect tree view of document structure with Winedt, VerbatimPlus and listings package

I´m having some trouble working with Winedt 8 and 9 and VerbatimPlus add-on. Here is my MWE. File "main.tex" \documentclass[a4paper]{article} \usepackage[utf8]{inputenc} % Codificação da entrada ...
3
votes
2answers
127 views

Problem with verbatim in a beamer frame

It seems that verbatim is not working properly. It produce an error and the output is not as I expected. Here is the latex code % !TEX encoding = UTF-8 Unicode \documentclass{beamer} ...
2
votes
2answers
65 views

How can a verbatim environment be centered using a basic LaTeX installation?

I want to centre some verbatim text in a reasonable way using only a basic LaTeX installation, i.e. the packages listings and fancyvrb are not available. \documentclass{article} \begin{document} ...