{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

2
votes
1answer
18 views

How to tell alltt not to skip lines at beginning/end?

It seems like there is no option for specifying that, like a hack for verbatim I found on tex.stackexchange: \usepackage{etoolbox}% \makeatletter \preto{\@verbatim}{\topsep=0pt \partopsep=0pt} ...
13
votes
2answers
492 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 ...
1
vote
1answer
37 views

How to tell latex to write as the text in texmaker?

I intend to attach my C code in my report. However, the code has a lot of special characters that create an error in compilation {, # and so on. Any package to circumvent this issue. For example: ...
3
votes
1answer
39 views

How can I redefine verbatim to wrap lines (add break before or after spaces)?

Before continuing, I would like to inform readers that I know it is generally discouraged to reimplement functionality that packages already support. Automatically wrap the text in verbatim has an ...
1
vote
0answers
15 views

Colouring in-line text within verbatim environment

I wish colour some selected text within the verbatim environment. These texts may not occupy a whole line, but rather be a small part of a line. An illustration is given below. Say for example, in ...
4
votes
2answers
77 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} ...
0
votes
0answers
17 views

\end tag ignored in frame [duplicate]

I have the following slide in a document of class beamer. \begin{frame}{Modular Design} \begin{lstlisting} <code> \end{lstlisting} \end{frame} This however returns these ...
3
votes
1answer
33 views

Use verbatim with \only in beamer [duplicate]

I want to have a frame to showing text and then data ( in verbatim ). And I cant compile it. I made this minimum working example : \documentclass{beamer} \begin{document} \begin{frame}[fragile] ...
1
vote
0answers
22 views

line breaks and word wraps for unpredictable character strings

I am writing python to parse and process lots n lots of files to build a final report of results from information in the files. I am using python to write the latex file, then converting the latex ...
3
votes
2answers
22 views

Conditional formating of a verbatim type argument

I write problem sets whose answer keys contain matlab code. To accomplish this, I'm using matlab-prettifier, but I need to condition the output on whether I'm outputing the problem set questions or ...
3
votes
2answers
31 views

verbatim inside macro with color

Consider the following minimal non-working example (comment the line with the \test{..} to compile. I'd like to have a \verb+something+ inside my \test{} environment. How can I achieve that? ...
8
votes
1answer
321 views

what is the differences between “\verb” and “\tt”

I am wondering the diffference between \verb and \tt. For example \verb|difference| appears the same with \tt{difference}
6
votes
0answers
49 views

Exception from code syntax highlighting in listings

EDIT: The question is not really relevant for me any more, I decided to instead use the highlight package in R to export Code as LaTeX output. This still requires manual modifications, but at least I ...
4
votes
2answers
51 views

searching for a verbatim package for paragraphs that use reserved characters

I'm looking for a LaTeX package that enables an environment sort of like "verbatim" in that it prints each and every unicode character exactly as typed, but... 1> does NOT replicate linebreaks 2> ...
4
votes
2answers
53 views

\MakeShortVerb{\§} and \usepackage[utf8]{inputenc}

I have a book published more than 10 years ago. It contains the following code in its preamble: \documentclass{article} \usepackage[cp1251]{inputenc} \usepackage[T1,T2A]{fontenc} ...
5
votes
0answers
92 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 ...
3
votes
2answers
50 views

TODONOTES and \reserved@a - nested itemize/enumerate environments

I am having a problem trying to insert come environments into inline todo notes... This MWE should demonstrate. \documentclass{article} \usepackage{todonotes} \usepackage{verbatim} ...
4
votes
1answer
54 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 ...
0
votes
0answers
22 views

How to customize `\verb|…|`? [duplicate]

I would like to customize the output of \verb|...|. For some reasons, I just need to stick to the command \verb|...|, nothing else. Can I customize the output styles of the command? I'd like to change ...
4
votes
2answers
83 views

How can I insert complex regular expressions into tabularx cells?

I'm trying to create a table with two columns, in which the second one is representing lots of regular expression with all the character you could imagine. I tried with \verb|text| command, but it ...
8
votes
3answers
163 views

How to use \verb or something similar inside a \newcommand

The command \displaygraphics[width-1in]{figure=some_fig.pdf} will display a graphic. Sometimes I want to typeset when I do not have the graphics files available, so I want to do something like: ...
1
vote
0answers
15 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
187 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
36 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
46 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
25 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
70 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
35 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
56 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
42 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
47 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
31 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
89 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
49 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
33 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
80 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
22 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
544 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
100 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
31 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
70 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
69 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
52 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
138 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
57 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
76 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
130 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
251 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
107 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
59 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!