Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [verbatim]

{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.

0
votes
1answer
50 views

What is the advantage of using a pseudocode package instead of simply putting code inside of a verbatim block? [closed]

What are the advantages of using a pseudocode package (like algorithm2e) above simply putting code inside of a verbatim block? Edit: In order to make the question less vague, I will say this: ...
2
votes
1answer
79 views

Why enclose a \verb block with curly braces?

Why would you enclose a \verb block with curly braces? Does it change anything? Consider the following examples: The \verb|acmart| document is \verb|orange| and \verb|blue|. Use the {\verb|verb|} ...
3
votes
3answers
61 views

How can I put every `verbatim` environment inside a `Shaded` environment by changing the preamble only?

Unfortunately, I have a lot of TeX code which should look different that it does not, but I cannot modify its code body. However, I can modify the preamble and for example, I have learned that I can ...
0
votes
0answers
29 views

Change language inside verbatim environment

I have the following: \documentclass[a4paper]{article} %% Language and font encodings \usepackage[greek, english]{babel} \usepackage[iso-8859-7]{inputenc} \usepackage{amsfonts} \usepackage{amsmath} ...
4
votes
2answers
52 views

How to renew verbatim to Verbatim from fancyvrb?

I am using pandoc to convert Markdown to Tex, pandoc will render code blocks to \begin{verbatim}CODE\end{verbatim}, and fvextra only works with \begin{Verbatim}[breaklines]. How can I make {verbatim} ...
2
votes
3answers
33 views

\verb and align

I am getting an error when I am using the verb command in align. I prefer not to use \texttt because the underscore isn't the right length for a single underscore or a double underscore - the right ...
0
votes
0answers
24 views

Listings not breaking long lines with breaklines=true and breakatwhitespace=false

I have the following code in my Markdown: ```{latex-fontsize=scriptsize} $ ./my-new-application create app_example creating app_example Generating <path-to-app-src>/new-application/...
3
votes
0answers
37 views

Suppress Fira Code ligatures involving “{” and “}” in verbatim

I am trying to improve the current implementation (v0.1b) of the lstfiracode package. In particular, I wish to achieve the opposite of Use Fira Code font with ligatures in code listings. ...
3
votes
1answer
38 views

How can I wrap `\colorbox` around `\Verb[commandchars=\\\{\}]` by only changing the preamble?

This is a follow-up question to How can I use `\renewcommand` to wrap `\colorbox` around `\Verb`? I have TeX files which contain code like: \Verb|print("Hello World", end="")| The \Verb content ...
2
votes
1answer
43 views

How can I use `\renewcommand` to wrap `\colorbox` around `\Verb` by only changing the preamble?

What works: I have TeX files which contain code like: I want \texttt{this text} to have a background color. I want the \texttt to have a background color: I want \colorbox{lightgray}{\texttt{this ...
2
votes
1answer
49 views

Escape lots of backslashes and other special characters

I'm trying to write a Unix command in LaTeX, but it seems to be stuck on special characters. Is there a way to escape backslashes, accolades, dollar signs etc.? The command is the following $(python -...
2
votes
1answer
34 views

Minted Linenos not working after using RecustomVerbatimEnvironment

Currently I am trying to work with the minted package. My aim is to have a code snippet with the numbering for each line, which is centered in a figure. My top level configuration looks like ...
2
votes
1answer
38 views

Hebrew within sourcecode

I need to include LaTeX source code, which contains Hebrew text, within an Hebrew document. I tried doing so within a verbatim environment, but Hebrew words appear in opposite order. Any solution ...
1
vote
1answer
31 views

lualatex using vebatim package

This was working and I don't see what has changed, but the code below is now throwing a "Missing \endcsname inserted" error. If I just press Return, lualatex continues, reads the text file myfile.lua,...
2
votes
1answer
114 views

How to write č,ć,ž,š,đ in verbatim?

I have a problem with verbatim, it can't read my Serbian language symbols like č, ć, ž, š, đ. If I try \begin{verbatim} č,ć,ž,š,đ \end{verbatim} I get blank space, also if I try with \v{c},\'{c},\...
2
votes
2answers
62 views

Getting fancyvrb and mdframed to work togegher

I would like to format terminal output as follows: white text on black background commands written by the user are emphasized (slanted typewriter) Using a combination of mdframed and fancyvrb I got ...
0
votes
1answer
36 views

nomenclature and \verb|text|

I tried different solutions but without result I have configured arara on texstudio to be able to use the nomenclature package. \usepackage[refpage,intoc,italian]{nomencl} \makenomenclature \...
0
votes
1answer
26 views

Command verbatiminput error with Keyboard character used is undefined

This is the probit.txt file I use the verbatim package to insert some text file. In particular using the command, \verbatiminput{probit.txt}. But there are some characters in the text file that cause ...
2
votes
1answer
65 views

How to keep the correct line numbering when using ConTeXt vim module?

Consider the following code: \usemodule[vim] \definevimtyping [somecode] [numbering=yes,lines=split] \starttext \startsomecode Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam ...
4
votes
3answers
49 views

\verb in label or pin of a tikz node

The documentation of tikz gives following example containing the \verb command in the node text (Section 2.21 Adding Text, v3): \begin{tikzpicture} \draw (0,0) rectangle (2,2); \draw (0.5,0.5) node [...
0
votes
1answer
22 views

executable code containing symbol `'` inserted with verbatim on pdf. Error while copying back into a text editor

I'm trying to insert Octave code in a pdf. However, there is a problem with the sign ' (which means transposition in Octave code). However when I copy the code from the generated pdf, the code doesn't ...
1
vote
1answer
32 views

Some very odd behaviour of \verb and \verbatim in connection with TeXMaker

I cannot but assume that whatever <text> is placed between the delimiters (in this case +) in \verb+<text>+ and \verbatim+<text>+ has no effect whatsoever on the world outside the ...
1
vote
1answer
30 views

How to include a file with the verbatim environment

I would like to include a file within the verbatim environment but this of course doesn't work: \begin{verbatim} \input{file.tex} \end{verbatim} Is there way of getting LaTeX to execute \input ...
1
vote
2answers
128 views

AucTeX issue with BVerbatim in newenvironment

I have the following newenvironment command: \newenvironment{code} { \VerbatimEnvironment \begin{mdframed}[ backgroundcolor=black!70, leftmargin=1, rightmargin=1, innerleftmargin=4, ...
1
vote
1answer
32 views

Code using verbatim doesn't work when copied back in a text editor

I'm trying to use verbatim to copy the implementation of an algorithm written in octave. For this I introduced the following lines in latex \begin{verbatim} F = @(z) [z(1) + 2*z(2) - 2; 2*z(2)*z(3)^2 ...
1
vote
1answer
55 views

How can I create a callout box that does not conflict with verbatim?

My goal is to make a small box in the top-right of the page that holds a small table. This serves as an "infobox" much like the ones seen on wikipedia pages. I've implemented this using wrapfigure ...
0
votes
0answers
26 views

Pythontex : automatic importation of a figure

I would like to define a command showing the last figure saved by pythontex on a png file (Figurecount.png) where count is a Python counter numbering the figure. Next I use includegraphics to import ...
0
votes
0answers
22 views

Increase paragraph spacing in text delimited by {alltt}

In the next code the expression @obj.info will return a string with paragraphs of text in it. How can I do to increase the space between those paragraphs? \begin{alltt} \begin{flushleft} \parbox{18....
1
vote
1answer
25 views

How to use boolean to toggle display of environment that may contain verbatim?

I'd like to create an environment solution that either displays its contents or nothing depending on whether the boolean solutions is set. Currently I'm trying: \documentclass{article} \usepackage{...
1
vote
1answer
27 views

tcblisting apparently not a verbatim environment

MWE % arara: pdflatex \documentclass{article} \usepackage{tcolorbox} \tcbuselibrary{listings} \begin{document} \begin{tcblisting}{listing options={language=ruby}} "hello #{world}" \end{tcblisting} \...
3
votes
1answer
189 views

How do I set a background color and font for inline verb text?

I wish to customize the verb command such that I can customize the font and color, as well as set a rounded colored rectangle as background. I found this in the Tcolorbox manual: \DeclareTotalTCBox{\...
1
vote
1answer
69 views

\verb illegal in command argument in \begin{align*}

I am trying to generate a set of aligned equations that looks like, (note: random and variable are supposed to be pseudo-code) However, instead I got this along with an error, that says, \verb ...
0
votes
1answer
39 views

Fixed position for my Verbatim [closed]

I use the fancyvrb package and I'd like that my Verbatim code is always written with 2pt indention. How can I do that?
3
votes
2answers
92 views

Without loading fontspec, \verb* cannot produce visible space under XeLaTeX

\verb* fails to produce visible space, under XeLaTeX. The problem repairs if package fontspec is loaded. By the way, \textvisiblespace produces visible space under both occasions. Moreover, \verb* ...
6
votes
1answer
142 views

How does \verb* set the visible space?

I'm trying to understand how \verb* works under the hood, especially where the mapping for the visible space character comes into play. Let's have a look at the definitions first: \verb: macro:->\...
5
votes
2answers
62 views

Why doesn't upquote work with tabularx?

Why doesn't upquote work with tabularx? \documentclass{article} \usepackage{upquote} \usepackage{tabularx} \begin{document} This works: \begin{tabular}{c} Inline \verb|`code`| \\ \end{tabular} ...
0
votes
1answer
29 views

linebreaks in lstlisting and verbatim environment

longline*.txt files contain some text and in some files the text is inserted in an environment as indicated in the filename. The following script: \documentclass{article} \usepackage{listings} \...
1
vote
1answer
51 views

Using \verb and \begin{verbatim} / \end{verbatim} in NewEnviron

Consider the following MWE: \documentclass[a4paper]{article} \usepackage{environ} \NewEnviron{myitemize} { \show\BODY \begin{itemize} \BODY \end{itemize} } \begin{document} \begin{itemize} \item \...
2
votes
1answer
55 views

insert code listings in the scope of \foreach

In the following code \documentclass[a4paper]{article} \usepackage{listings} \usepackage{tikz} \begin{document} \foreach\a in {x, y}{ \begin{verbatim} ...
9
votes
3answers
521 views

A pseudocode environment allowing for mathmode and UTF-8 characters?

My usual goto for writing pseudocode is the listings package, but unfortunately, I find myself writing a document in my native language (portuguese) and I need to write UTF-8 characters in pseudocode, ...
0
votes
0answers
39 views

\UseVerbatim equivalent for lstlisting

The package fancyvrb provides \begin{SaveVerbatim} and \UseVerbatim, which does almost exactly what I need. I want to use this with a custom lstlisting environment. The environment looks exactly how I ...
0
votes
2answers
237 views

How to insert normal-font text inside verbatim?

In the ISO C++ standard papers, blocks of code are displayed in a verbatim-like environment, but the comments inside the code are in normal font. For example: The comments "7.3.5, CommonReference:" ...
3
votes
1answer
56 views

\comment (verbatim-package) inside \parbox throws errors - What is the problem?

I have defined my own environment - lets call it 'myenv' - which shows and hides its content based on some global settings. I'm using the \comment and \endcomment commands from the verbatim package, ...
0
votes
1answer
175 views

how to print all comments in a document

I have used the verbatim package to comment out significant parts of my tex file. 1) I now wish to see these comments in my pdf document when I compile... in a different colour (say red), without ...
0
votes
2answers
60 views

Code listings: shaded background

How do I make sure that my verbatim text output examples have a shaded gray background? \usepackage{alltt} \usepackage{color} .... {\small\begin{alltt} \# mycommand install \# mycommand configure \# ...
3
votes
2answers
97 views

How can I print “$ formulae $” as itself?

If I type $ formulae $, then the result will be formulae But I want to type "$ formulae $" expression itself, so the result will be $ formulae $ (I mean the result include $ expressions!) Thanks ...
5
votes
2answers
122 views

If first line is empty in verbatim environment remove it

My verbatim environments are generated automatically. As a consequence some have empty first line - but not all. Is it possible to redefine verbatim env. and force it to remove first empty line if ...
2
votes
0answers
49 views

Read out text file until first empty line is found [closed]

Im currently writing a manual for a package and wanted to include parts of a Matlab file. I was able to display the whole file with the listings package but my goal is to only display the first part ...
11
votes
2answers
209 views

Why not catcode11 (letter) but catcode12 (other) is used for verbatim?

What would happen if catcodes were changed to 11 (letter) instead of 12 (other) in verbatim environment or something similar? Will any problems happen? Or, are there any advantages to use catcode12 ...
1
vote
0answers
60 views

Root in verbatim environment

First: This is a a question similar to the one here and will (hopefully) be the last of these kind of questions from me. How do I write a pixelated n-th root sign with a number "under" it as input in ...