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
11 votes
5 answers
3k views

Is there any package similar to verbatim but with support for icons?

I am looking for a package that provides verbatim environments but also supports different background color, frame style and icons (tips, error, warning etc.) shown on the upper-left corner.
user1285419's user avatar
  • 1,121
11 votes
4 answers
39k views

Decreasing font size in verbatim

How can I modify the following command to make it work? \newcommand{\code}[1]{\begingroup \fontsize{10pt}{10pt}\selectfont \begin{verbatim} #1 \end{verbatim} \endgroup} I currently get the following ...
Rose Perrone's user avatar
11 votes
5 answers
4k 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 ...
niksirat's user avatar
  • 607
11 votes
3 answers
2k views

typing \end{verbatim}

I am preparing a presentation in which I want to display the following as it is \begin{verbatim} foo \end{verbatim} For this I used \begin{verbatim} \begin{verbatim} foo \end{verbatim} \end{...
Dr. Dinesh J. Karia's user avatar
11 votes
3 answers
3k views

Include a footnote in verbatim text

I have seen how to add verbatim text to a footnote: How to obtain verbatim text in a footnote? What I would like to do is the opposite, include a footnote in a verbatim section. I am using the memoir ...
Lucina's user avatar
  • 269
11 votes
3 answers
2k views

How to make this verbatim code look nice?

I am doing some slides using Beamer. One of this slides is pure code \begin{frame}[fragile] \begin{verbatim} > dim(X) #dimension of our matrix X [1] 2194 12276 > length(Y) # length of ...
Donbeo's user avatar
  • 261
11 votes
5 answers
8k views

Have verbatim code as an equation

I have a little snippet of program code / input that needs to be rendered with the exact layout as typed in (verbatim). Is it possible to have this as an equation? I tried to nest the Verbatim ...
FUZxxl's user avatar
  • 2,414
11 votes
3 answers
2k views

How can I redefine the \verb|...| command?

I'd like to redefine the \verb|...| command so that it had a light-gray background and a little bit darker border around it, and a little bit of padding to make this background "box" noticable. Anyone ...
user avatar
11 votes
2 answers
331 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 ...
agnagic's user avatar
  • 535
11 votes
2 answers
431 views

tcolorbox breaks the verbatim definition of ltugboat documentclass

This code: \documentclass{ltugboat} \usepackage{tcolorbox} \begin{document} \begin{verbatim}[\small] \documentclass{article} \usepackage{tikzduck} \begin{document} \begin{...
CarLaTeX's user avatar
  • 62.5k
11 votes
2 answers
734 views

Doesn't the verbatim environment work with the standalone class?

I have the following code, which is as minimal as it could possibly be ( standalone 2015/07/15 v1.2): \documentclass{standalone} \begin{document} \begin{verbatim} Ciao \end{verbatim} \end{document} ...
Massimo Ortolano's user avatar
11 votes
3 answers
11k views

Preserve leading whitespace in verbatim environment

The following code (as a small example): \begin{verbatim} ##### ...
Charles's user avatar
  • 133
11 votes
1 answer
983 views

Point to a Verbatim Line using TikZ

I'm trying to use TikZ in beamer to point to a line of code. Here's what I have so far: \documentclass{beamer} \usepackage{tikz} \usepackage{fancyvrb} \begin{document} \begin{frame}[fragile,t] \...
recluze's user avatar
  • 4,201
11 votes
1 answer
13k views

Changing color of text snippet in a verbatim environment

Is it possible to change color of part of the text that is in a verbatim environment? Lets say I have this verbatim section. I want to change the color of the marked lines into blue. \begin{verbatim}...
Valentino Ru's user avatar
  • 1,767
11 votes
2 answers
636 views

Listings for plain tex

Is there a package to produce syntax-colored blocks of source code in plain TeX ? A listings equivalent ? Or (maybe) some macro to produce a colored tex input for some given source code ? Is it ...
NoWhereMan's user avatar
11 votes
1 answer
2k views

I need a customized verbatim environment

I would need a verbatim environment with the following behaviour: It is centered (left and right distance to the page edge should be equal). It can be much wider than the regular text, almost using ...
user17106's user avatar
  • 907
10 votes
3 answers
1k 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, ...
Robly18's user avatar
  • 202
10 votes
3 answers
6k views

verbatim and overlays

I am trying to display a verbatim environment in an overlay. I have the following code but it is giving errors: \only<2->{ \begin{verbatim} Select T3.Subject From T as T1, T as T2, T as T3 ...
ozsu's user avatar
  • 2,385
10 votes
2 answers
636 views

Overlay red rectangles on top of verbatim text

I am using Beamer to prepare a presentation. In some slide I need to print a great deal of verbatim text and, also, I need to draw some red rectangles on top of it. What would be the most ...
stathisk's user avatar
  • 427
10 votes
2 answers
834 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 ...
konze's user avatar
  • 343
10 votes
2 answers
4k views

Highlight \verb in inline text

I'm new in LaTeX and I'm searching for solution to highlight verbatim text inside paragraph (for example, it is like on this page, where code is highlighted). Can anyone help me with this? Let say, ...
Phantom's user avatar
  • 103
10 votes
2 answers
13k views

How to put code in beamer two column

I was trying to put code and a figure side by side in a beamer presentation. I tried two methods - one said in beamer documentation and other in standard LaTeX. But couldn't get the output. The two ...
tex's user avatar
  • 3,445
10 votes
2 answers
30k views

Change typeface of verbatim environment

I am new here and the following code is what I am testing. Is it possible to change the typeface of the words from a .txt file? Thank you for any kind help! \documentclass[a4paper]{article} \...
周明暘's user avatar
  • 209
10 votes
1 answer
1k views

Why does \verb take its argument between pipes || rather than braces {}?

Is there something fundamentally different about \verb compared to other commands or is it just a design choice?
user2229219's user avatar
10 votes
1 answer
352 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 ...
Peter Grill's user avatar
10 votes
4 answers
3k views

How can I have numbered verbatim environments?

How can I have an automatically numbered verbatim environment, just like equations? I tried putting it like this: \begin{equation} \begin{verbatim} bla... bla... bla... \end{verbatim} \end{equation} ...
Ariel's user avatar
  • 223
10 votes
1 answer
5k views

Separate Verbatim into two columns

Is it possible to split a long verbatim simply into 2 columns? For example: \begin{verbatim} a a a b b \end{verbatim} result displayed (b starting at the middle of the page): a b a ...
user23710's user avatar
  • 1,491
10 votes
1 answer
138 views

\NewDocumentEnvironment eats the first non-letter token when used for verbatim environment

I was messing around with creating verbatim environment saving its contents to a file like the one described in verbatim package documentation (end of section 2.2), but using latex3 features. It ...
nim's user avatar
  • 335
10 votes
1 answer
865 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: \...
mSSM's user avatar
  • 3,152
10 votes
1 answer
3k views

How to format an email conversation?

I am currently writing my thesis and need to include a bunch of email conversions. I am using classicthesis. I wonder, how you would format stacked conversions. Moreover, how would you deal with the ...
JJD's user avatar
  • 1,977
10 votes
2 answers
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 ...
Dror's user avatar
  • 22.6k
9 votes
4 answers
9k views

Verbatim environment with background color (PDFLaTeX and tex4ht)

I need to make a verbatim environment with gray background color, such as: That needs to work with PDFTeX and tex4ht on an older TeX installation (from 2009 I believe). My approach so far is \...
topskip's user avatar
  • 37k
9 votes
4 answers
519 views

\verb in csquotes

The following code gives me an error: \documentclass[ngerman]{article} \usepackage{babel,csquotes} \begin{document} \enquote{\verb|foo|} \end{document} I guess this is the classic "you can't use ...
topskip's user avatar
  • 37k
9 votes
3 answers
1k views

Hyperref using the wrong language script for \url?

In a mixed language document, I try to use a URL. Here is minimal input demonstrating \documentclass{article} % compile with xelatex \usepackage{hyperref} \usepackage{polyglossia} \setmainlanguage{...
Yossi Gil's user avatar
  • 16k
9 votes
3 answers
11k views

remove double spacing inside {verbatim}

I'm using the uwthesis class which generally typesets with a lot of space between lines. This is generally fine, however, I want to override the spacing in certain examples which appear in the ...
apexofservice's user avatar
9 votes
4 answers
4k views

Is it possible to use a non-monospace font in verbatim environments?

I know it runs contrary to a lot of the point, but I'd like to experiment with different fonts to see which I like better. I can't seem to find any reference to a way to do this, if it's at all ...
Mirrana's user avatar
  • 2,601
9 votes
3 answers
4k views

Merging bib files from within LaTeX

I have two .bib files that I want to use in my bibliography. Entries do not overlap. I have found quite a few forum topics on that, but none of them really satisfied me. So my idea is to merge the two ...
Heinrich's user avatar
  • 123
9 votes
2 answers
317 views

Preserving (and Controlling) Expandedness

In most cases, by the time output gets to your screen, arguments are fully expanded and my question is moot. But sometimes (verbatim being a common example), one wishes to operate on arguments with ...
Steven B. Segletes's user avatar
9 votes
1 answer
5k views

How to write text within \begin{verbatim} and \end{verbatim} in same line?

I am stuck on the following problem and don't know how to solve it. Here is my problem : \documentclass{article} \begin{document} \begin{verbatim}'\hfill\end{verbatim} MKS' which puts the word '...
Md Kutubuddin Sardar's user avatar
9 votes
2 answers
2k views

How do I backcolor in verbatim?

I have some code I want to typeset as verbatim (lstlisting would be ok as well) - but I want to highlight some parts of it via a different background color, i.e. something like this: \begin{verbatim} ...
maxschlepzig's user avatar
  • 12.1k
9 votes
2 answers
2k views

Inline links in code listings

I would like to include links inside source code listings by providing URLs within the listing source text. That is, I would like to be able to generate something that looks like the following: with ...
Patrick Sanan's user avatar
9 votes
1 answer
2k views

verbatim environment does not produce monospace

I use quite a lot packages in my document and I cannot find which one's fault is that verbatim does not produce monospaces. Anyway, if I knew this, I have no idea how to solve problems when packages ...
Pavasaris's user avatar
  • 2,971
9 votes
3 answers
3k views

Include Sweave input as verbatim

How do I keep Sweave from compiling things in a verbatim environment? For example: \documentclass{article} \begin{document} \begin{verbatim} <<>>= 1+1 @ \end{verbatim} \end{document} ...
Sacha Epskamp's user avatar
9 votes
1 answer
1k views

How can I create wrapper macro for lstinline?

Using \lstinline I can include inline code snippets in a paragraph. I would like to provide a macro that selects formatting, etc, for lstinline so I can just do, say, \codeinline{snippet}. I had ...
starfry's user avatar
  • 585
9 votes
1 answer
4k views

Inline LaTeX code and result of the code (similar to showexpl)

I would like to write a macro that works somewhat like showexpl but just reproduces the LaTeX code and the results of the code in a way that I can use inline. \documentclass{article} \usepackage{...
tgkolda's user avatar
  • 704
9 votes
2 answers
275 views

How to get whole tex in the output document file with actual output?

Consider the following LaTeX document \documentclass{article} \usepackage{enumerate} \begin{document} \begin{enumerate}[(a)] \item Here is the 1st line. \item Here is the 2nd line. \end{enumerate} ...
Soumitra Sen's user avatar
  • 2,995
9 votes
1 answer
4k views

Use minted for plain-text? (without syntax-highlighting) [duplicate]

I'm possibly too lazy to find how to do it without minted, but since I already use minted and I want top keep it's styles it applies to code boxes (like background color, the line break features, ...
rugk's user avatar
  • 1,090
9 votes
2 answers
3k 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 ...
maurera's user avatar
  • 381
9 votes
2 answers
2k 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 ...
Lover of Structure's user avatar
9 votes
3 answers
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 ...
Loda's user avatar
  • 265

1 2
3
4 5
23