{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
40 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} ...
0
votes
0answers
20 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} ...
0
votes
0answers
23 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
58 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 ...
2
votes
2answers
41 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
178 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
64 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
26 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
31 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
24 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} ...
1
vote
1answer
40 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
338 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
49 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
34 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
49 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
54 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
27 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
34 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
69 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 ...
5
votes
1answer
41 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
65 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
41 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
113 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
54 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
55 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
68 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
129 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
63 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
101 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
38 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
35 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
55 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
54 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
497 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
57 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
57 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
72 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
61 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
154 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
96 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
81 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
61 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
139 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
97 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
61 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 ...