{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

5
votes
2answers
25 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
48 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
26 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
40 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
48 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
26 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
24 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
48 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 ...
4
votes
1answer
39 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
63 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
35 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
91 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
49 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
50 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
59 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
98 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
50 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
92 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
33 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
26 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
51 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
48 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
488 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
54 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
56 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
52 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
53 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
34 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 ...
4
votes
2answers
45 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
140 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
89 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
76 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
59 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) ...
4
votes
2answers
135 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
82 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
58 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 ...
11
votes
1answer
138 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 ...
3
votes
1answer
69 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 ...
1
vote
2answers
43 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.) ...
5
votes
1answer
122 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
3answers
94 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 ...
6
votes
1answer
73 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 ...
2
votes
0answers
46 views

Verbatim and Bacground&TikZ compatibility problems

If to compile below MWE, you'll get next error: According the error message, the problem is tikz and calc library package, which looks like links with background package. Also, you will not find ...
3
votes
3answers
131 views

verbatim text with C code

I'm trying to typeset a lot of C code in the latest ConTeXt (MKIV). It tried: \startC printf("Hello, world\n"); \stopC only to find that \startC macro is undefined. It is defined in ...
1
vote
1answer
42 views

Boxed equation on the right and its verbatim on the left

How to write a verbatim form of an equation on the left and its output form on the right inside a box?
2
votes
0answers
39 views

Is there a solution to the differences between listings and verbatim [duplicate]

My code is here, \documentclass{article} \usepackage{listings,xcolor} \lstnewenvironment{code} {\lstset{language={Matlab}, lineskip=-1pt, belowskip=3pt, breaklines=true, ...
4
votes
1answer
104 views

How can I get a macro (e.g. for a function parameter) to gracefully expand within a listing?

I try to pass a parameter to code environment (lstlisting): \documentclass{standalone} \usepackage{listings} \def\parameter{home/Desktop/example_01/} \begin{document} \begin{lstlisting} \parameter ...