{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

0
votes
0answers
15 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
29 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] ...
17
votes
1answer
538 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 ...
1
vote
0answers
18 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
21 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 ...
8
votes
1answer
315 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}
5
votes
0answers
90 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
29 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? ...
3
votes
3answers
622 views

you can't use `macro parameter character #` in horizontal line

I have the following latex code that I tried to decorate a fragment of html code: [``temperatures'', ``root'', ``\verb#*<TABLE*<TABLE*</TR>#</TABLE>*#''] but I got error message ...
3
votes
1answer
100 views

Getting WinEdt to ignore lstlisting

WinEdt 9.0 gives me incorrect TOC in its side panel when I use listings package to illustrate a piece of LaTeX code: How can I get WinEdt to ignore \begin{lstlisting} ...\end{lstlisting} (and ...
4
votes
0answers
39 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
115 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 ...
4
votes
2answers
47 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
1k 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 ...
4
votes
2answers
45 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} ...
17
votes
2answers
1k views

Getting verbatim with soft grey background, as in tex.stackexchange

Given a verbatim as on below, \begin{verbatim} This is an awesome verbatim \end{verbatim} which is displayed with no background on the compiled pdf page : This is an awesome verbatim I would ...
1
vote
2answers
1k views

How to configure the verbatim text?

In LaTex, I use \verbatim to add a block of text. But the problem is that the verbatim text doesn't follow the page style, and it exceeds the page boundary if the text is long. The result is shown as ...
3
votes
1answer
34 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
52 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 ...
7
votes
1answer
344 views

Redefine verbatim environment

I have a text with source code, which I would like to display. I am using pandoc, so I have to use either verbatim or listings enviroment. Unfortunately, I can't use listings package (due to ...
8
votes
3answers
3k 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 ...
4
votes
2answers
81 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 ...
1
vote
1answer
38 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 ...
8
votes
3answers
157 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: ...
3
votes
2answers
136 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} ...
4
votes
1answer
172 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
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 ...
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}{} ...
18
votes
1answer
9k 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
35 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
41 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
23 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
506 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
59 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
34 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
45 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 ...
6
votes
3answers
3k 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
46 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
73 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
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+/~ ...
0
votes
0answers
45 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 ...
2
votes
1answer
29 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
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
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
124 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; ...
8
votes
1answer
98 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
123 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
63 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 ...