{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

1
vote
0answers
6 views

transform variable-content to verbatim-like representation inside a newcommand (used then as optional argument)

I spend 8 hours in solving this, made some progress but now face the enormous difficulties with verbatim stuff in latex. Any help would be great! My aim: the todonotes package offers an inline ...
4
votes
1answer
78 views

A Mathjax 'cheatsheet' in LaTeX [duplicate]

I would like to write a LaTeX document in which several Mathjax commands are shown as source code and compiled. So I want to have a list of items and have them show up on, for example, the left side ...
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
31 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 ...
3
votes
1answer
36 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
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 ...
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 ...
0
votes
1answer
38 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*} ...
2
votes
1answer
29 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+/~ ...
3
votes
1answer
58 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. [ ...
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 ...
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} ...
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
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 ...
1
vote
0answers
41 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 ...
2
votes
1answer
38 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
34 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
117 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 ...
3
votes
2answers
43 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
48 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
94 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; ...
2
votes
2answers
112 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
65 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
49 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!
3
votes
1answer
195 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
95 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
64 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
211 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
116 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 ...
2
votes
1answer
77 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 ...
3
votes
2answers
74 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 ...
3
votes
3answers
213 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 = ...
1
vote
1answer
35 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} ...
3
votes
2answers
87 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 ...
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 ...
2
votes
1answer
97 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 ...
0
votes
1answer
39 views

LaTeX command inline in the caption of a figure [duplicate]

I want the caption of a figure to contain a LaTeX command without it being executed: Using verbatim environment doesn't work in this case and throws errors. Please suggest a solution to this.
2
votes
0answers
29 views

How can I put a vertical line | within the \verb command [duplicate]

How can I put a vertical line | within the \verb command to get something like this
1
vote
1answer
49 views

How to automatically escape special characters in your own environment?

I need to create my environment for examples of source codes. I want it to look like this: Code example: ------------------------------------------------ # This is the code example echo 'Hello' ...
4
votes
1answer
126 views

Can you interpret macro parameters as verbatim?

Basically I want to define a macro whose parameter should be treated as a "script", meaning that I want to print it in a verbatim way including line breaks and special characters. Furthermore, I want ...
1
vote
1answer
424 views

“Paragraph ended before \verbatim@ was complete.” when trying to use verbatim in tabular

I have the following code in my Beamer slide code: \begin{frame} \frametitle{selections} \begin{tabular}{ll} sample 1 & \begin{minipage}{3in} \begin{verbatim} sample 2 \end{verbatim} ...
2
votes
1answer
39 views

How should multiline pieces of code be put into a table?

I have the following two pieces of information that I would like to present side-by-side in a Beamer slide. I think I'd like these two things in two cells of a two-column table. Is there a good way to ...
4
votes
2answers
161 views

Why \texttt and \verb giving errors when using with LaTeX commands inside their input

On latest version of MikTeX, following works: \begin{align*} \int sinxdx && \texttt{test line 1}\\ \int{sinx}dx && \texttt{test line 2}\\ \end{align*} But the following gives error: ...