{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

12
votes
2answers
4k views

Inline code and short verb with minted

I it possible to use minted for inline code and to add a short verb sing for minted? Like \lstMakeShortInline| in listings.sty? \documentclass{article} \usepackage{minted} \newminted{tex}{} ...
3
votes
2answers
85 views

Programming code listing: enumeration and left margin

I'd like to inlcude programming codes in LaTeX by using the verbatim package. For the code I use, the enumeration is continous. So if a new code starts, the numbers are ongoing, which should not be ...
16
votes
1answer
8k views

Center-align the verbatim environment

I am trying to center align the content of a figure that has verbatim text in it. But the verbatim text is always right-aligned: \begin{figure} \centering \begin{verbatim} some text here ...
1
vote
1answer
31 views

Wrap a verbatim table environmet

I have text with all sorts of characters in it that I want to use in a table so thought that verbatim might be suitable, but this doesn't seem to wrap. I've seen suggestions for listings but this ...
1
vote
0answers
29 views

xparse verbatim argument removing multiple space

I am trying to define a command, using xparse that take as input some verbatim code and cite it using listing. However, the eventual multiple white spaces or tabulations at the beginning of a lines ...
3
votes
1answer
18 views

LaTeX listings Package Only gives Unbreaking Spaces when in tex4ht

I am trying to make a programming e-book, but the listings package is converting all of the spaces in the listings to non-breaking spaces. I have tried breakatwhitespace as both true and false, as ...
9
votes
4answers
430 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} ...
3
votes
1answer
35 views

beamer, overlay in allt or fancyvrb

I'd like to highlight some text inside an alltt or verbatim or Verbatim (or whatever environment/package that would produce what I want) on some slides. So, I create a newcommand<> that does the ...
0
votes
0answers
29 views

Text formatting, how to generate everything not in plain text

I want to put some text in latex, which looks like { "wow": 15, "nice": 1 }, { "wow": 24, "nice": 1 }, But If i generate ...
1
vote
1answer
22 views

Extract Package question: Not present \Sectionformat statement is extracted

I use the solution shown here (thanks to Mike Renfro!) to extract a synopsis from my latex documents. Sadly I am struggling with the output of the headings. Basically the problem is that the extract ...
3
votes
2answers
117 views

Verbatim vs Listings for Thai Font

I have a problem about verbatim and listings. I need write some codes by using Thai font but it shows in picture \documentclass[12pt,a4paper,oneside]{book} \usepackage{verbatim} \usepackage{listings} ...
1
vote
0answers
24 views

How to use sagesilent (or verbatim) environment in pgffor loops?

I want to create different versions of an exam paper and corresponding sample solutions using sagetex. I need to assign variables for more involved computations, so I am reliant on the sagesilent ...
5
votes
3answers
2k views

parameter passing to \verb|| environment

I happen to write the following code over and over again. {\color{blue}\verb|>|} {\footnotesize\verb|HI|} So, I came up with the following code to make it a command. \newcommand{\result}[2]{% ...
0
votes
1answer
37 views

First row of column has same height as text in a multirow column

In this example, why is the lorem1 cell three lines long ... corresponding to the 3 lines in verbatim? How can I get the two lorem rows to be of equal height? Thanks in advance! \begin{table*} ...
3
votes
1answer
57 views

minted fails with breaklines and obeytabs

The following example with a minted enviroment fails with the error message _minted-test/7587C145B52367AE51CACC4AFB0EC13D2F785CCAC2A2CC760CA216BD1781DF79.pygtex:3: Extra }, or forgotten \endgroup. [ ...
2
votes
1answer
28 views

Tabularx printing regex incorrectly

When printing regex in a tabularx environment, spaces get inserted after each character class. Is there any way to fix this? MWE: \usepackage{tabularx} Outside table: \verb~/\d+/~ ...
0
votes
0answers
30 views

Forcing page break of a minted listing with \centering on

I am using minted to create a code listing. I need the listing to be centered so according to this solution, I use the \RecustomVerbationEnvironment to escape the verbatim environment so that it can ...
4
votes
1answer
29 views

Double delimiters in listings

Using the listings package, one can define a format for some arbitrary set of delimiters and the characters enclosed within. However, when using double delimiters, the specified format doesn't apply ...
2
votes
1answer
27 views

Forcing a page break in \VerbatimInput (fancyvrb)

How do I force a page break within a file included with \VerbatimInput? It's C code, and I would prefer a solution that is transparent to the C compiler - something like a form feed (^L) in the ...
4
votes
1answer
76 views

Why does \verb|“”| in \index{} lead to an error?

\documentclass{article} \usepackage{index} \makeindex \begin{document} \begin{figure} \centering \fbox{Diagram placeholder} \caption{\index{quote (\verb|""|)}ok} \end{figure} \printindex ...
0
votes
0answers
20 views

Code is shifted to the right when we run the output

I'm writing a LaTeX document and I want to add my code to the document, but the output appears shifted to the right and some of the data do not appear this is the implementation: \begin{verbatim} ...
2
votes
2answers
93 views

Inline verbatim with line breaks, colored font and highlighting

I'd like to be able to use inline verbatim text with the following features: Line breaks, as provided for example by package spverbatim, command \spverb; Colored font, as provide by package color; ...
17
votes
1answer
504 views

How to display LaTeX code and the typeset version next to each other without repeating myself?

I would like to write some LaTeX code, and without repeating myself, I would like that to be used for displaying that particular piece of code as-is and its typeset version, next to each other. The ...
8
votes
1answer
87 views

How to generate robust verbatim bibliography data

I'm trying to generate a .bib-shaped "biblatex" database from a git change log. A typical(?) item looks like this: @gitcommit{f1750d6, author = {Brent Longborough}, date = {2013-12-15}, title = ...
2
votes
1answer
95 views

how to wrap a long terminal command without real line breaking?

this may look like a duplicate question to this one and many, but really I had a hardtime in finding the desired solution. The breaklines=true didn't work as it breaks the long command. Hence simple ...
1
vote
0answers
38 views

Exporting Eclipse language highlighting

Does anyone know how to insert verbatim code from Eclipse? Not just how to include a file but also keep it's highliting, I use some not-so-widespread languages so exporting it directly would be neat ...
12
votes
1answer
2k views

Beamer error driving me nuts

OK, I've been staring at this for an hour. I know there's an error in this frame, as the document compiles fine if I put \end{document} in the frame before this. But this frame gives an error File ...
2
votes
1answer
37 views

Error when using [fragile] in beamer [duplicate]

I've got a problem in beamer. When using the fragile option on a frame, the compilation does not work. For instance: \documentclass{beamer} \begin{document} \begin{frame}[fragile] Hello ...
2
votes
1answer
33 views

Verbatim overruns text block

The problem when I export the document to PDF there is some text at the end of the lines does not appear to the print page. How can I fix this? \begin{verbatim} //Add staff.php <link ...
3
votes
1answer
116 views

Pretty printing DTDs (Document Type Declaration)

I want to include a didactic, compact view of a DTD (Document Type Declaration) in my texts. DTDs are used to define the set of tags and attributes of a XML/SGML document -- some sort of a grammar of ...
0
votes
4answers
1k views

Write LaTeX with LaTeX [duplicate]

Possible Duplicate: Typesetting LaTeX Source Code Hi all, i would like to know suggestions on how can I write an explicative text of LaTeX using LaTeX. Till now I use ...
3
votes
2answers
42 views

Using \VerbatimOut in a \newcommand -> FancyVerbError

I'm creating a class for exercices with questions and answerdocument. I have a command \question{} in which I write the question. And I create a box associated at the question in which the student ...
3
votes
1answer
47 views

\verbatiminput causes the rest of the code to be orange in the editor

\documentclass[a4paper, 11pt]{article} \usepackage[utf8]{inputenc} \DeclareUnicodeCharacter{FEFF}{} \usepackage{verbatim, amsmath} \begin{document} \verbatiminput{R1.txt} This text is ORANGE\\ ...
2
votes
2answers
108 views

Use verbatim inside \newcommand [duplicate]

Probably this was already answered. But I did not find it. How can I use verbatim inside \newcommand{} or \begin{environment}...\end{environment}. In my MWE, the last two lines produce errors. ...
4
votes
2answers
63 views

Italic font for the entire verbatim section

How can I change the font format to italic within the verbatim environment ? \documentclass[a4paper]{article} \begin{document} \begin{Verbatim} @book{book; title = {title}; author = {author}; ...
2
votes
1answer
46 views

How to type apostrophes in verbatim material

How can I type an apostrophe in \verb mode? I've tried using \' and I've seen solutions that work in the verbatim environment, but I'm not sure how to do this inline. Thanks in advance!
1
vote
0answers
24 views

how to put Verbatim inside minipage that has fbox around it? “Paragraph ended before \FV@BeginScanning was complete. }” [duplicate]

I am surprised that I get an error when I add Verbatim to content of minipage that had \fbox around it. Removing the \fbox removes the error. But I need to put frame around the minipage. I can't use ...
3
votes
1answer
190 views

How to change verbatim text to Consolas?

How to change the verbatim text so that a zero shows up with a slash across it? I would like to know if the verbatim text can be changed to say Consolas? Here is my code: \documentclass{article} ...
2
votes
1answer
48 views

Large table in “programming” type font

In my code below, the table appears in a "programming" type font. If I have a larger table (like say in a text file), how can I import that table into my document without having to typing the whole ...
3
votes
1answer
31 views

Multiple line verbatim environment

I want to achieve the output shown below using multiple line verbatim My attempt so far is \documentclass[a5paper]{article} \usepackage{listings} \begin{document} \begin{lstlisting} 123 $\times$ ...
1
vote
1answer
89 views

Highlight text in verbatim environment [duplicate]

I want to highlight a certain element in this matrix from matlab output. How can I do this in the verbatim environment? \begin{verbatim} P = 1.0000 0.7000 0 0 0 0 ...
2
votes
1answer
75 views

No indent for verbatim environment

I would like to deactivate the indent for the verbatim environment, such that left margin is the same for everything. \documentclass{article} \usepackage{verbatimbox} \makeatletter ...
2
votes
1answer
63 views

Can the `verbatim` environment be used inside a custom environment definition?

I have the following code: \documentclass{minimal} \newenvironment{abc} {\begin{verbatim}} {\end{verbatim}} \begin{document} % This works. \begin{verbatim} abc \end{verbatim} % This does not ...
5
votes
2answers
199 views

Issue with special characters in Python code

I am trying to insert a Python code into a LaTeX document. The Python code (an example) is the following and contains many special characters (>, <, °): valeur = input('Veuillez entrer une valeur ...
4
votes
2answers
111 views

“Runaway argument?” just in the \input file

Update: Upon @egreg suggestion, the case shown below is the core of the problem and has nothing to do with include/input statements. I have a verbatim within toggle statements, which fails. A minimal ...
3
votes
3answers
206 views

Quote verbatim in Latex

I would like to quote some passages using the quote environment. However the quoted passage contains some math mode equations written in text format like "Your paper is worthless because x^2 +y^2 = ...
0
votes
1answer
78 views

new \input{file} Package, Command wrapper: microtype .tex with reserved symbols

I know enough LaTeX to produce great looking documents. LaTeX makes it more difficult to NOT do that. But I don't advanced LaTeX or TeX or plainTeX or "@" or other advanced, cryptic programming ...
3
votes
2answers
71 views

Write math and make a box with alltt environment

I tried looking up for this, but I have not found a way to do both at the same time. I would like to write math symbols in a verbatim like environment, for which I use alltt. But I would also like to ...
1
vote
1answer
33 views

Polish signs in verbatim beamer envir

I would like to get polish signs in the verbatim environment for the beamer document type, e.g. \begin{frame}[fragile] \frametitle{Napis- funkcja print} \begin{block}{Przyk\l ad} \begin{verbatim} ...
2
votes
1answer
40 views

Suppressing the newline when entering an environment

Is there anyway to suppress the newline that is inserted when beginning an environment? For example, I would like \noindent{\bf 1.}\begin{verbatim}some code\end{verbatim} to appear as a single ...