{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
19 views

\verb illegal in command argument in task

Following this: Make two-columned list start at same line as its section, I did: \documentclass{article} \usepackage{cprotect} \usepackage{tasks} \begin{document} \section{Languages} \...
4
votes
1answer
25 views

Display wrapped unix commands that can be selected with double click

Not sure if this is possible at all. I have to display UNIX commands in a user manual, some of them quite long. These will not fit in a single line so they have to wrap. To display them I tried both ...
3
votes
2answers
36 views

xelatex — remove line spacing in verbatim environment

I am using a lot the verbatim environments. Today I notice that there is a really disturbing (and too large) space between lines in verbatim environment : How can I remove them ? EDIT (xelatex): ...
1
vote
1answer
20 views

Incorrect accent after \verb

I have following snippet of code: \documentclass[11pt, a4paper]{article} \begin{document} \newcommand{\test}[0]{`\verb£Test£'} \test `\verb£Test£' \end{document} The second scenario works as I ...
1
vote
2answers
24 views

Using fancyvrb to create a new verbatim environment in Isabelle

Following answer http://tex.stackexchange.com/a/114672/27523 I used fancyvrb to define a new verbatim environment -- I will use it to specify some font later, now I want to make it work at all. I ...
3
votes
2answers
67 views

How can I recreate this code example given in this pdf? Vertical lines in verbatim?

I'm referring to the pdf linked here. Specifically, how can I recreate this part on the first page? I'm guessing it's using the verbatim environment somehow, but how can I get those vertical lines ...
2
votes
0answers
37 views

Formatting Code around Line Breaks

I am typing up a sentence which contains code, and \verb's ignorance of line breaks is annoying me. This code is very short, and it does not make sense to give it its own line, but I also do not think ...
4
votes
3answers
104 views

Preserve leading whitespace in verbatim environment

The following code (as a small example): \begin{verbatim} ##### ...
2
votes
1answer
36 views

Use \(end)comment instead of \begin/\end{comment}

In my document, the comment environment works fine, but \comment and \endcomment stop processing of what comes next in the document: \documentclass{article} \usepackage{verbatim} \begin{document} X \...
9
votes
2answers
68 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: ...
3
votes
1answer
33 views

How to use Verbatim inside tabu table?

I changed my longtable to use tabu and now I am getting lots of errors. It turned out tabu does not like Verbatim inside the table, but according to documenations, tabu* is supposed to do that, but I ...
0
votes
0answers
39 views

How to display a LaTeX code of a mathematical formula in the output (the code itself eg: $x^2$) [duplicate]

I want to make a table with two columns. Heading for one column is the mathematical expression and in the other one it's the corresponding LaTeX command. How to display the command of x^2 which is $x^...
4
votes
1answer
40 views

How to add a todo notes in verbatim environment?

I need to describe the header of a .ctl file. For this purpose, I am using verbatim package for displaying the header. My command lines are below: \begin{verbatim} dset ^newcase_d01_2612.dat options ...
3
votes
1answer
72 views

How to typeset shell like output in Latex

I'm trying to achieve a output as shown below with latex NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sda 8:0 0 32G 0 disk ├─sda1 8:1 0 99M 0 part /boot └─sda2 8:2 0 31,9G 0 ...
3
votes
1answer
30 views

difference between \verb and \NewDocumentCommand verb

This MWE \documentclass{article} \usepackage{xparse} \begin{document} \NewDocumentCommand{\myVerbatim}{v}{#1} \myVerbatim|This is some text, which can contain $\sin(x)$ or code or $$| \verb|...
9
votes
2answers
100 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 ...
3
votes
2answers
126 views

tcolorbox with fancy text

Driven from Let's get fancy: Text like tag? , I wrote this code: \documentclass{article} \usepackage{tcolorbox} \definecolor{mycolor}{rgb}{0.122, 0.435, 0.698} \newtcbox{\mybox}{nobeforeafter,...
2
votes
1answer
27 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} \...
17
votes
2answers
613 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
56 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
68 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
20 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
88 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
45 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
26 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
385 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
57 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
54 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
63 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} \usepackage[english,...
5
votes
0answers
96 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
66 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} \begin{document}...
4
votes
1answer
66 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
85 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
188 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
18 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 option,...
4
votes
1answer
244 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
39 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
49 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
26 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
83 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
36 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
67 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
48 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
53 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+/~ \begin{tabularx}{...
3
votes
1answer
125 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. [ ...