Tagged Questions

{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

0
votes
0answers
26 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.) ...
5
votes
1answer
64 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
71 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 ...
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
75 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
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
65 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
173 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 ...
3
votes
2answers
58 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
1answer
39 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
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 } ...
2
votes
2answers
48 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' ...
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} ...
0
votes
0answers
40 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
72 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. ...
2
votes
0answers
32 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 ...
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} ...
3
votes
1answer
23 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
36 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
18 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
52 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 ...
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
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} ...
7
votes
1answer
87 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
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 ...
2
votes
2answers
99 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
38 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 ...
6
votes
3answers
157 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. ...
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 ...
3
votes
1answer
67 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 ...
3
votes
1answer
65 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
106 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 ...
2
votes
1answer
52 views

How to use UNC path

I struggle a bit with UNC paths in latex. My paths looks something like \\server\folder\folder I found this. Which recommends to change \ to /. Thats not really a solution. I put the path in ...
0
votes
1answer
95 views

How can I include the R source code in the appendix?

I really have no idea how to include the R code into latex, so I only can provide my R code. I would like to put it in the appendix. I am really looking forward to your help. Thx! The codes will show ...
14
votes
1answer
148 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 ...
5
votes
1answer
117 views

Why does `! Missing $ inserted.` occur when using \verb in beamer?

When I use \verb+...+ within beamer I get ! Missing $ inserted. <inserted text> $ l.6 \end{frame} ? What is going wrong and how do I fix this problem? A minimal example is ...
4
votes
1answer
191 views

Verbatim inside a minipage inside a tikz node — beamer class

I am trying to get a boxed text as part of a tikz node. I found an example here that I am trying to follow, but it is giving me an error: Argument of \@xverbatim has an extra }. I can't figure it out. ...
3
votes
1answer
109 views

How to copy/paste multiple spaces from lstlistings?

This is a continuation of a question that I asked already: How to copy/paste from lstlistings?. The solution presented there does not work if the text within the lstlistings environment contains ...
4
votes
1answer
71 views

Why do some spacing commands work correctly after end commands, and others don't?

Why is it that \begin{verbatim} some verbatim \end{verbatim}\bigskip will work without errors, but if I changed the ending line to \end{verbatim}\\[1\baselineskip] I'll get errors? Am I ...
0
votes
1answer
26 views

Why can't I use multiplie verbboxes? [closed]

I am writing some documentation for a testing framework I am using at work and I use verb boxes to show code and add comments/captions that pertain specifically to that code. But I am getting the ...
2
votes
1answer
40 views

I have included verbatim to show a small section of code, how can I add a comment/caption for this verbatim?

I am writing some documentation on a tool I am using at work and I have included some code that has a comment to explain what a particular line is there for, this comment runs off the page if I leave ...
7
votes
1answer
119 views

How can I change a glyph in a Verbatim environment?

I have a document which contains example program code in Verbatim environments. The caret symbol produced by typing ^ looks too flat to me, so I defined a macro to produce a sharper version. ...
2
votes
1answer
57 views

macro to showcase newly defined macros

I have the following MWE which takes an argument and prints it verbatim. I have obtained the code from this answer. \documentclass{article} \makeatletter \newcommand{\myverb}{% \begingroup % ...
5
votes
1answer
120 views

New environment for minipage and colorbox

I would like to create a new environment that would automate the following code: \setbox0=\hbox{\begin{minipage}{5.8in} \color{black} \begin{verbatim} <Some verbatim text here> \end{verbatim} ...