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.

Filter by
Sorted by
Tagged with
6
votes
2answers
1k 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 } ...
6
votes
2answers
3k views

Superscripts in verbatim environment

I have some lines in a verbatim environment ... \begin{verbatim} line 1 * line 2 line 3 * line 4 line 5 \end{verbatim} ... at the beginning of some lines I want to add a number ...
5
votes
3answers
19k views

How to indent code in \begin{verbatim}

I have code. I used \begin{verbatim} \end{verbatim}. My code contains indentation to organize the code. But the verbatim does not add spaces. When I try to add vertical spaces using \quad, the ...
5
votes
2answers
314 views

Greek and Latin letters in verbatim

I want to write a code snippet where the commands are in greek and variables are in latin. I use the verbatim command but automatically the latin characters are translated to their greek equivalent. I ...
5
votes
0answers
132 views

How can I use scintillua lexers to replace minted or listings with luatex?

Scintilla is a text editor. Scintillua adds dynamic Lua LPeg lexers to Scintilla for multiple languages. According to the documentation, Scintillua can be used as a library: Using Scintillua as a ...
5
votes
2answers
197 views

How to show < and > correctly in output?

I am trying to write some XML tags as part of my text but I can not get the < and > symbols to come out right in the output. What am I missing? I have tried both <tag> and \<tag\>, the ...
5
votes
2answers
381 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 ...
4
votes
1answer
337 views

Lstinline macro inside another environment

Why does the MWE below compile with errors only if I use ths \lstnewenvironment line? And how to define the verbatim macro inside an environment? I heard it's possible using plain TeX? \documentclass{...
4
votes
2answers
440 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' ...
4
votes
1answer
2k views

inputenc error with unicode chars and verbatim

I am writing a package where I need to save the contents of several environments in verbatim mode to an auxiliary file. Then the auxiliary file is processed by an external program. In the next ...
4
votes
3answers
4k views

Preserve leading whitespace in verbatim environment

The following code (as a small example): \begin{verbatim} ##### ...
3
votes
2answers
2k views

How do I tell alltt environment to wrap text?

I have an already formatted text (space-wise) that is also being colored etc, so I am using alltt environment to print it. The text is code actually, but I am not using listings because I don't want ...
3
votes
1answer
1k views

lrbox with border in beamer

Can I have border around a \lrbox in beamer? I have a minipage inside the lrbox. I know I can use \fbox. Update Sorry for the confusion. I need a border around the block of data, it is inside a ...
3
votes
1answer
2k views

Change background colour of {verbatim} environment

In an existing document which is not to be modified (except for the preamble), all instances of \begin{verbatim}...\end{verbatim} should have their contents rendered not only in a monospaced font but ...
3
votes
3answers
2k views

Latex environment to write in plain text mode

A paragraph I am writing contains a lot symbols such as "{" or "_". To display those symbols as text instead of command, I have to write them as "\{" and "\_". Otherwise, Latex will say there are ...
2
votes
1answer
711 views

Wrapping text in tables which contains underscores

I have lots of text in multiple columns in tables which contains items with underscores. However, these do not wrap around a fixed column width, so I get: Here is my code: \documentclass[12pt]{...
0
votes
1answer
83 views

How can I define a new function in LaTeX (easy way to add \verb!word!)

How can I define a new function in LaTeX? I want something like this: %Current: \verb!word! I want something like this to do the same: \vb_word Or an easy way to add this function. I have more than ...
17
votes
2answers
997 views

Tex capacity exceeded compiling only 50 lines latex file (pdftex), seg. fault (lualatex)

This is one of the strangest things I've seen in Latex (and I have seen many strange things). 50 lines of code, almost all of it is verbatim. Any small change to the verbatim can cause the error to ...
16
votes
2answers
8k views

Line-break inside a `\verb'

I have set my text editor to wrap text at 76 columns. When including verbatim text in-line, my text editor did an auto-word-wrap and I ended up with something that looked like: \item Just another ...
15
votes
1answer
827 views

Escaped characters in typewriter font

I know a number of ways to fix this (e.g. \usepackage[T1]{fontenc}), but I want to understand what's happening in the following example. \documentclass{article} \begin{document} \noindent \$ \% \&...
10
votes
2answers
1k views

Beamer and verbatim sync

I'm preparing a beamer presentation to show some basic TikZ stuff. I would like to have a two columns slide, where on the left I have the TikZ figure, and on the right the generating code. BUT, I also ...
10
votes
3answers
647 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, ...
10
votes
1answer
526 views

todonotes and verbatim

I want to put some comments about actual code into my document, and for that I thought I'd use \verb or \begin{verbatim}, but it turns out that the todonotes package does not like that: \...
10
votes
2answers
721 views

Macro \verb inside tabu environment

I would like to use the \verb command inside of a tabu enviroment. Here is my example \documentclass{article} \usepackage{tabu} \begin{document} \begin{tabu}{lll} a & \verb+\wedge+ & b\\ c ...
9
votes
3answers
10k views

encoding problem with \verbatiminput : Package inputenc Error: Unicode char \u8: not set up for use with LaTeX

I'm trying to import some logs files using \verbatiminput to do a automatic report from our logs. I got some encoding problem. My objective: import some logs files with various special char (included ...
9
votes
1answer
587 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 ...
8
votes
1answer
1k views

Line length in fancyvrb

What I'm doing: Typsetting source code using pygments. What is happening: the code typsets fine, but because pygments puts the code into a Verbatim environment, some of the lines are far too long. ...
8
votes
1answer
7k views

Using \verbatiminput on filenames with underscores

I'm trying to include some source files using \verbatiminput{}. Some of these filenames have underscores in them. This works fine by default. But if I try to include the underscore package so that I ...
7
votes
1answer
1k views

listing package and vbox warning

I have this many (see below) underfull warnings that are caused by using the listing package and creating \begin{lstlisting}\end{} to make code appear presentable. Is there a may to fix the warnings? ...
7
votes
2answers
3k views

Multicolumn verbatim

Is there someone who could help me with creating a table with some rows merged and verbatim text in it? I actually want to create 3x2 table. Like this \begin{tabular}{rr} \hline \multicolumn{2}{c}{...
7
votes
1answer
307 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. \...
6
votes
1answer
185 views

Raise character in verbatim mode

Consider the following code (see here for the original code): \documentclass[ a4paper, 11pt ]{article} \usepackage[varg]{newpxmath} \usepackage[ hmargin = 2.4cm, vmargin = 3cm ]{geometry} \...
6
votes
1answer
185 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:->\...
6
votes
4answers
202 views

Expand multiple math-tokens before detokenize

I am a long time Latex user and over the last few weeks I am involved in a project that needs to do the following: I want to put in verbatim some math latex code that may include user-defined macros. ...
6
votes
2answers
4k views

How do I center a boxed 'Verbatim'?

Here's a MWE: \documentclass[12pt]{article} \usepackage{fancyvrb} %=== \begin{document} \begin{Verbatim}[fontsize=\small, frame=single, xrightmargin=5cm] Text. \end{Verbatim} \end{document} I'm ...
6
votes
2answers
890 views

Why can't curly braces be used as a delimiter for \verb? i.e. \verb{foo}

When I try to do the following: \documentclass{article} \begin{document} Hello \verb{foo}. \end{...
6
votes
2answers
587 views

In the verbatim environment, how can I display an 'if' statement I declared as '\ifcondition'?

I have declared a couple of if commands of the form \newif\iffinal \newif\ifsolutions Now I want to write about it in the same document! So I want to write something like \iffinal (...) \...
6
votes
2answers
2k views

How to display accents inside verbatim command

I have the following piece of code: \newenvironment{mylisting} {\begin{list}{}{\setlength{\leftmargin}{1em}}\item\scriptsize\bfseries} {\end{list}} \newenvironment{mytinylisting} {\...
5
votes
3answers
947 views

Verbatim in Marginnote doesn't work

I have a really sort quastion. The following Code is not working: \documentclass{memoir} \usepackage{verbatim} \usepackage{marginnote} \begin{document} Lorem ipsum dolor sit amet, consetetur ...
5
votes
3answers
2k views

\verb in custom command

I have \newcommand\dd[2]{\item[\texttt{#1}] #2} and later I have \dd{bc}{text \verb#$(echo 5+4 | bc)# text \verb#$((5+4))# text} and I get ! You can't use `macro parameter character #' in math ...
5
votes
1answer
3k views

alltt package's \alltt{} makes a newline

alltt causes a line break (newline). How do i suppress this? I want something to the effect of \verb+HELLO+ in that it does what \begin{verbatim} \end{verbatim} does except doesn't cause the line to ...
5
votes
2answers
3k views

Verbatim inside tikz node [duplicate]

Possible Duplicate: Problem with TikZ, beamer and verbatim Is it possible to use verbatim-like environments inside a tikz node? This MWE gives an error: \documentclass{article} \usepackage{tikz} ...
5
votes
1answer
2k views

A verbatim column in tabular environment

I want to build a table with a column of verbatim, but I don't want to use \verb command for every line (too many rows), how should I do it? I tried to use array package to define new column type but ...
5
votes
4answers
4k views

Verbatim frame latex with no waste

I have a frame/boarder round my Verbatim environment however the frame is extended to the page side, thus alot of wasted space. The following is my code: \begin{Verbatim}[frame=single] s=0 ...
5
votes
1answer
168 views

Inline verbatim text in ConTeXt

I am trying to typeset some TeX code inline with ConTeXt. In LaTeX, there's \verb to handle that, but I do not find the equivalent in ConTeXt. In the Wiki, there is some suggestion code: \def\...
5
votes
1answer
18k views

LaTeX getting “Missing } inserted” error

I'm getting "Missing } inserted" error, when compiling with pdflatex and I really don't understand why. This is occurring in a beamer frame. Maybe someone comes up with something useful. \...
5
votes
0answers
302 views

Using cprotect and environments with multiple arguments

Is there a way to use the cprotect package's \cprotEnv command to use verbatim inside environments that have optional or multiple arguments? My motivation for this question: I am working with ...
5
votes
1answer
348 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 \...
5
votes
1answer
191 views

How can I mimic the output of syntax macros (\marg, \oarg, etc.) without using the ltxdoc class?

I have come to realize that the pleasant style (argument in italics, enclosed by angle brackets) of macro descriptions in numerous package documentations is actually produced by a number of special ...
5
votes
1answer
172 views

How to print a verbatim block at its end automatically in LuaLaTeX?

This is a follow-up question to this answer by Mico. I try to adjust his Lua code to my needs and line numbering already works. Actually there is one real usability issue and that's my question: How ...