{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

9
votes
5answers
401 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 ...
9
votes
1answer
79 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 ...
0
votes
0answers
39 views

Ș and ș: the “character is uncodable in verbatim paragraphs” error

I am using LyX 2.1.2 and upon pressing ctrl+l to insert a new tex code and writing \title{Și e ușor} I got the error Character is uncodable in verbatim paragraphs referring to the two ...
1
vote
0answers
26 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
24 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
134 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
73 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
68 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
59 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
50 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} ...
2
votes
0answers
35 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
33 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 ...
2
votes
3answers
78 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 ...
3
votes
2answers
50 views

Verbatim and polyglossia

I use polyglossia in arabic tex files and I want to use the verbatim environment to write the Latex commands for a user's manual. All works well, with adding the command '\let\arabicfonttt\ttfamily' ...
1
vote
1answer
35 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
38 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
67 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 ...
13
votes
1answer
174 views

Comparison of LaTeX example typesetting packages?

I am writing a (longer) text on LaTeX usage, and I want to typeset some LaTeX source code together with its results – and I'm not sure how to achieve it. I am aware of this question, however, it only ...
2
votes
1answer
42 views

Break on special characters in inline verbatim

I'm using Pandoc to generate LaTeX. My text contains inline code spans (backticks in markdown) that are rendered as \texttt{...} in TeX. However, some of them are quite long and overflow the line, for ...
5
votes
3answers
140 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 ...
7
votes
2answers
2k views

Latex equivalent of <pre>

This is probably a simple question, but I can't find the answer anywhere. How can I tell tex (latex specifically) not to format a piece of text? I.e. I want to keep indentation, line breaks, etc.
5
votes
2answers
40 views

table with a column of verbatim

\documentclass{article} \usepackage{amsmath,array,booktabs,multirow} \begin{document} \begin{table}[!htb] \centering %\begin{tabular}{ l l } \begin{tabular}{ >{\verb=}l<{=} l } ...
1
vote
1answer
75 views

Latex Error: File `readarray.sty` not found

all, I tried to use \usepackage{verbatimbox,xcolor}, and when I tried to TeXify my tex file, an error message popped up (after install verbatimbox): ! Latex Error: File `readarray.sty` not found. ...
6
votes
2answers
309 views

Custom verbatim that sets all spaces (“ ”) as visible spaces (“␣”) that can line-break

It makes sense to typeset code in a monospaced font. Sometimes such code needs to be embedded in a paragraph context, and then it will be useful to allow it to linebreak. In order to visualize spaces ...
5
votes
3answers
1k views

newcommand for verbatim

I'm trying to write a \newcommand for verbatim: \newcommand{\codeline}[1]{\begin{verbatim}{#1}\end{verbatim}} and use it as \codeline{int foo;} but it gives an error "File ended while scanning ...
0
votes
0answers
41 views

Creating a document template that works with verbatim

I need to produce a lot of documents that all look like this: Question 1: Answer 1. -------------------------- Question 2: Answer 2. The end. There are always exactly two questions and two ...
1
vote
1answer
42 views

how to use verbatim within a list

I tried to use verbatim within a list like this: \begin{lstlisting} Search(HTMLpage, \begin{verbatim}``<TITLE>*</TITLE>''\end{verbatim}); Copy(HTMLpage); Paste(Title); \end{lstlisting} ...
2
votes
0answers
34 views

Polyglossia, French and verbatim

Using Polyglossia with setdefaultlanguage{french} breaks spacing in verbatim and \verb: \verb|a:b| typesets as a :b. Minimal working example, GitHub bug report. Before I delve into Polygloglossia's ...
3
votes
1answer
25 views

how to make the content within \verb different line

I tried to make the text contained within \verb different line by using \verb#<TITLE>*\\</TITLE>#, but the result is now what I expected: <TITLE>*\\</TITLE> since I want to ...
2
votes
1answer
25 views

Prefix on newlines in lstlisting environment

I've defined my own lstlisting environment with \lstnewenvironment. Now I'd like to prefix every new line of the code with arbitrary text (a bash cursor). Basically I'd like this \begin{commands} ...
1
vote
2answers
33 views

Vertical spaces in htlatex \ScriptEnv

I am using htlatex to generate the HTML version of book and I am having problems with vertical spacing. I have configured an environment like this: \ScriptEnv{tawny} ...
2
votes
1answer
37 views

htlatex inserting environment in verbatim

I want to get htlatex to put some text into my HTML file verbatim. The problem is that it keeps redo-ing my spacing. So, for example, I use a cf.cfg like this. \Preamble{html} \ConfigureEnv{tawny} ...
3
votes
1answer
19 views

catchfilebetweentags bug with \verb command

With example \RequirePackage{filecontents} \begin{filecontents*}{main.tex} %<*example> \verb|This is an example| %</example> \end{filecontents*} \documentclass{article} ...
6
votes
1answer
55 views

Code listing inside of tabu environment

I'm trying to insert a small code listing into a tabu table, however I'm unable to build a PDF. The code I'm trying to use (well- a simplified form of it) is as follows: % !TEX encoding = UTF-8 ...
3
votes
1answer
42 views

Displaying verbatim content with \tl_to_str:*

\documentclass{article} \usepackage{expl3} \ExplSyntaxOn \begin{document} \tl_to_str:n { testing _ things } \par \tl_set:Nn \l_tmpa_tl { testing _ things } \tl_to_str:N \l_tmpa_tl \end{document} ...
1
vote
0answers
45 views

Define environment with two sections and verbatim

I'am writing a class for the standardization of some documents and I want the interface to be smoothly as possible. One of the things I need is define an environment that produces something like this. ...
3
votes
1answer
107 views

A templating system in LaTeX [closed]

I need to generate quite a few LaTeX files in an automated way. I do not want to use any templating engine in Python or Elisp (two languages I'm probably most comfortable with); I'd prefer to do it ...
7
votes
1answer
88 views

What characters can delimit the argument of \verb?

I have seen \verb's argument delimited by many characters. I started out with " ", then I saw it done with # # and verified it worked, and I just saw it done with | | right here in egreg's answer. So ...
3
votes
1answer
1k views

verbatim environment does not work with beamer

I want my Java code to be typeset in a monospaced font, so I am using the verbatim environment. LaTeX commands are highlighted in Eclipse, but as soon as I use the verbatim environment everything ...
3
votes
3answers
107 views

Clash between verbatim and libertine

I have a document with some verbatim in it and I wanted to change the font to libertine, but this also changes the verbatim parts. Is there a way to keep the verbatim parts in computer-y font while ...
16
votes
3answers
230 views

Fancy code environment

I'm writing a small tutorial about LaTeX. So I'd like to insert some code and obtain the result on the right. I'm almost there. I got the desired output but I'd like something more clear, that is, ...
2
votes
2answers
104 views

you can't use `macro parameter character #` in horizontal line

I have the following latex code that I tried to decorate a fragment of html code: [``temperatures'', ``root'', ``\verb#*<TABLE*<TABLE*</TR>#</TABLE>*#''] but I got error message ...
3
votes
1answer
39 views

verbatim text in tables and macros [duplicate]

I have a cheatsheet with a table that looks like \begin{tabular}{l|l} $k > 0$ & \verb+k > 0+ \\ $k \geq 0$ & \verb+k \geq 0+ \\ $\sum_l$ & \verb+\sum_l+ \\ %etc ...
11
votes
2answers
236 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| & ...
14
votes
1answer
149 views

Workaround for open lualatex bug in \scantokens?

As package author I am in need of writing a manual with lots of examples. Now I started to make heavy use of lualatex in order to speed up operations which take a long time in TeX (of my package, not ...
0
votes
1answer
51 views

Showing/Hiding verbatim environment based on boolean condition

I would like to show and hide a verbatim or spverbatim environment based on a boolean condition (sth. like \showenv). I tried the solutions proposed at Hide custom environment content based on ...
6
votes
3answers
159 views

What's the best way to provide a verbatim command for additional active characters?

I've noticed that the \verb command does not react well to addtional active characters. E.g. \documentclass{minimal} \begin{document} \catcode`\/=\active \verb§/§ \end{document} will fail. ...
3
votes
1answer
68 views

New environment based on two existing environments (mdframed, spverbatim)

I would like to define an environment that puts verbatim text using the spverbatim package into a frame defined by the mdframed package. Here's my (naive) approach: \documentclass{scrreprt} ...
3
votes
1answer
68 views

Dump command as readable text?

Is it possible to dump the expanded form of a command as text? E.g. when I write a macro \newcommand{\mytest}[1]{\texttt{#1}} I would want to define a macro \mydump such that ...
4
votes
3answers
743 views

help me write verbatim

I'm trying to write HMX_Y, and because someone out there (mr. or ms. TeX) thinks this is a math notation, I have to use verbatim function to convince him (or her) otherwise. So far I've been using ...