Questions tagged [verbatim]

{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.

Filter by
Sorted by
Tagged with
25
votes
7answers
40k views

How to draw box around text that contains a verbatim block?

Typically, to box in some text, I use the following: \fbox { \parbox{\linewidth}{ This is some text! Blah blah blah... } } However, say I have a verbatim block within that. It will never ...
7
votes
2answers
708 views

Aligning columns, but allowing for text inbetween

I need help aligning text that spans multiple lines where I have Verbatim code in between. Here is a mock example to show what I mean: Fruit Amount Apple $3.00 \begin{verbatim} ... ...
7
votes
2answers
3k views

Multicolumn verbatim

Is there someone who could help me with creating a table with some rows merged and verbatim text in it? I actually want to create 3x2 table. Like this \begin{tabular}{rr} \hline \multicolumn{2}{c}{...
4
votes
1answer
90 views

Tabular in dtx documentation

How to make table in .dtx documentation with vertical bars? % \begin{tabular}{c|c} % |sf| & \emph{mathsf}\\ % \end{tabular} fails, because |foo| is magic for verbatim.
13
votes
1answer
4k views

Changing font in tabular

I desperately need someone's help. For the past hour I was trying to perform a task so diabolically difficult, even the Hercules himself couldn't achieve: change the freaking font in a table. My ...
2
votes
1answer
428 views

Using `minted` environment inside a `tabu` table

I am trying to use a piece of highlighted code using the minted package inside a tabu table: \documentclass{article} \usepackage{minted} \usepackage{longtable} \usepackage{tabu} \begin{document} ...
6
votes
3answers
2k views

is it possible to define a verbatim{} command?

Is it possible to define a verbatim{} command that I could use instead of the environment? \begin{verbatim} \end{verbatim}
6
votes
4answers
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]{% {\...
5
votes
3answers
312 views

How could a verbatimtab environment in a figure environment be resized (perhaps using the package adjustbox)?

How could a verbatimtab environment in a figure environment be resized (perhaps using the package adjustbox)? I have some code something like the following: \begin{figure}[htb] \centering \...
5
votes
1answer
165 views

Inline verbatim text in ConTeXt

I am trying to typeset some TeX code inline with ConTeXt. In LaTeX, there's \verb to handle that, but I do not find the equivalent in ConTeXt. In the Wiki, there is some suggestion code: \def\...
2
votes
1answer
150 views

How can I show lines in verbatim

I use this code: \documentclass[12pt,a4paper]{article} \usepackage[dutch]{babel} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{lmodern} \begin{document} \begin{verbatim*} CREATE ...
0
votes
1answer
495 views

One-column Minted in two-column paper (new ACM Template)

The Association for Computing Machinery is currently transitioning to a unified LaTeX Class for all of their conference proceedings after August of 2017. I've got several Minted blocks of code, which ...
9
votes
1answer
2k views

How to format an email conversation?

I am currently writing my thesis and need to include a bunch of email conversions. I am using classicthesis. I wonder, how you would format stacked conversions. Moreover, how would you deal with the ...
3
votes
1answer
97 views

another breqn problem. Extra letters show up in title with cprotect package

Why are there extra letters printed in the following title only when adding breqn package and how to get rid of them? This shows up with texlive 2016 both pdflatex and lualatex \documentclass[11pt,...
3
votes
2answers
566 views

One verbatim column in pgfplotstable and a non-verbatim header

I wanted to create a pgfplotstable in which one column would be treated as verbatim. I first tried to straightforwardly use \verb but I almost expected this to fail spectacularly and it did. I found ...
3
votes
1answer
4k views

How to make all the entries in a table verbatim font

I have a large table in the tabular environment and I need to make all the text verbatim font. I know I can use \begin{verbatim}...\end{verbatim} for all the entries but they are just too much for me ...
8
votes
1answer
752 views

Determine width of verbatim characters

I would like to determine how many characters of the verbatim font that fits on a text line. Consider: \documentclass{article} \usepackage{fancyvrb} \begin{document} \noindent\hrulefill \begin{...
3
votes
1answer
1k views

Automatic hyphenation in verbatim text, with guidance

I would like to typeset verbatim text that can have linebreaks on certain text points. I know that spverbatim and listings can break at spaces, but sometimes this is not enough. Of course, no ...
0
votes
2answers
408 views

Collect contents of an environment (that contains verbatim content)

EDIT: Additional and specific information. There is some useful background info that should hopefully make clear exactly what I am doing, as well as the setting this is happening in which is relevant....
3
votes
1answer
534 views

Proportional font, word-wrapping verbatim

How can I get a xelatex-compatible verbatim-like environment which uses a proportional font and applies word wrapping? I would like to able to put in something like this... Proposition 2.3.13. ...
15
votes
1answer
801 views

Escaped characters in typewriter font

I know a number of ways to fix this (e.g. \usepackage[T1]{fontenc}), but I want to understand what's happening in the following example. \documentclass{article} \begin{document} \noindent \$ \% \&...
12
votes
1answer
8k views

How to typeset LaTeX code inside a Table environment?

I wanted to typeset LaTeX code directly into my document, but without it doing something, i.e., I just want to show my code in the output. Now, I know there is the verbatim environment for code, as ...
6
votes
2answers
2k views

How can I fix verbatim causing an extra newline inside a description list environment?

I'm trying to create a documentation listing similar to that used by MSDN. Here was my first attempt at that: \subsubsection{User Default Page URL} \begin{description} \item[Rationale] This is the ...
1
vote
2answers
1k views

Drawing a rectangle box around code fragment

How to produce the effect of drawing a rectangle box surrounded the code, and put it in the figure? (Any methods including non-tikz-pgf method that helps is welcome)
6
votes
2answers
995 views

Bold monospace font extra-large

I would like to print very large (e.g., font size 43) monospaced bold text. The methods I know don't seem to go together: \documentclass[10pt, a4paper]{article} \usepackage{anyfontsize} \font\btt=rm-...
4
votes
1answer
2k views

How to handle special characters in LaTeX?

I am working on one file which has some special chacters. König IR : KA}unig ,K ~ A}unig % : Comment in latex (so no text after this %) - : escape I get different output ...
19
votes
1answer
9k views

control vertical space before and after verbatim environment?

How do I control how much vertical space appears before and after a verbatim environment? With the following source (run through pdflatex): \documentclass[varwidth]{standalone} \begin{document} text ...
4
votes
0answers
125 views

Alternative to import package for other commands that include external files [closed]

The import package, specifically its subimport command, makes it possible to input another file while specifying a base directory, so that all further \inputs in the included file will be resolved ...
2
votes
1answer
207 views

How to get blank lines to show in a verbbox environment?

Minimum working example: \documentclass[12pt]{article} \usepackage{verbatimbox} \begin{document} \begin{verbbox} Line 1 Line 3 Line 5 Line 6 Line 7 \end{verbbox} \theverbbox \end{document} ...
7
votes
2answers
172 views

How do I get a token list with an end-of-line character in it?

The context of this question is that I have a command defined using xparse that slurps in a verbatim argument which can be long. I want to do a replacement on the resulting token list, but the token ...
4
votes
2answers
419 views

LaTex fails to break long line in lstlisting

I have this sample tex file which has a line with a very long word in it. \documentclass{article} \usepackage[T1]{fontenc} \usepackage{listings} \lstset{ breaklines=true, escapechar=@ } \...
0
votes
2answers
151 views

How to align multiple aligned env. containing \verb?

I need to align several R-syntax formulas as equations. I have a following code: \begin{align} &\begin{aligned} &\verb!tActKT ~ poly(I(1/nprocs), 3, raw=T) + poly(ndoms, 3, raw=T)!\\ &\...
14
votes
4answers
12k views

How can I indent verbatim blocks?

I have blocks surrounded by \begin{verbatim} and \end{verbatim}. I'd like to indent these about half an inch. I'm using pandoc to write pdfs via XeLaTeX and the default.latex pandoc template, so I'd ...
6
votes
3answers
338 views

Nested Array-like environment without Math-region

I'm working on my master thesis and I need to render some structures like this: Edit: Example doesn't use highlighting for the sake of simplification, but I would like to use specifically minted, not ...
5
votes
4answers
4k views

Verbatim frame latex with no waste

I have a frame/boarder round my Verbatim environment however the frame is extended to the page side, thus alot of wasted space. The following is my code: \begin{Verbatim}[frame=single] s=0 ...
2
votes
1answer
93 views

simple REPL output formatting (xstring and special characters)

I want to copy/paste REPL transcripts into an environment and get minimal highlighting of the input. Expected result: \begin{repl} > foo bar > baz < quux fnord \end{repl} should produce ...
14
votes
3answers
10k views

Use color in verbatim environment

Inside the verbatim environment, is it possible to use a different color, please? For example, I want a to be normal, i.e., black. But I want b to be red. \documentclass[]{article} \begin{document} ...
2
votes
1answer
458 views

verbatim font in align environment

Is it possible to use the font of verbatim environment in align environment, please? I need to do so for a block of coding which is mathematic formulae itself. Thanks. If you like an example, please ...
7
votes
1answer
1k views

etoolbox's iftoggle vs verbatim

My problem is that I can set up toggles, using etoolbox's \newtoggle{x}, set it to true with \toggletrue{x} and even use it with iftoggle{x}{this for true}{this for false}. However, if I try to put a ...
8
votes
1answer
4k views

How to underline text in verbatim environment?

Am I missing something, or is it simply not possible to underline text within a verbatim environment? \begin{verbatim} I want to underline the following word: word \end{verbatim} I guess I could ...
3
votes
1answer
315 views

Overlay with columns and verbatim environments

I want to show my text using the overlay function of Beamer. Following this sequence: Intro phrase 0 --> Item 1 --> Item 2 --> Code 4 and so on Moreover, I would like to know how to align ...
3
votes
1answer
79 views

Replace fragile option with \scantokens for beamer frames

When there is some verbatim code inside a beamer frame, we need to use fragile option. But this fragile option often makes inverse search jump to wrong file. Therefore I tried to replace fragile ...
2
votes
3answers
252 views

Verbatim Text Inside Environment which is inside a Boolean Condition

My code looks like this \documentclass{article} \usepackage{environ} \newcommand{\showsolution}{1} \NewEnviron{mysolution}{ \if\showsolution1 \fbox{\BODY} \fi} \begin{document} \begin{...
3
votes
1answer
54 views

Listings display modes

Till now I guessed that \lstinputlisting{file.ext} just reads the contents of a file and uses it in a lstlisting environment. The sample file below compiles fine, but if I replace the content of the ...
3
votes
2answers
7k views

Importing separate file (literally/verbatim) into my LaTeX file

I'm curious as to whether it's possible to insert an entire separate file into a LaTeX document as an inline command. For example, I have the following LaTeX code: \begin{Verbatim}[frame=single] %...
0
votes
0answers
293 views

Using dollar sign in custom verbatim environment causing error

Lets have this environment: \newsavebox{\FVerbBox} \newenvironment{FVerbatim} {\VerbatimEnvironment \begin{center} \begin{lrbox}{\FVerbBox} \begin{BVerbatim}} {\end{BVerbatim} \end{lrbox} ...
2
votes
2answers
420 views

How to italic the first letter of a word in \verb|| structure

How italic the first letter of a word in \verb|| structure? Suppose that I want have italic (or underscore) for G in \verb|Good|.
0
votes
0answers
18 views

Single quotes deformed in code section [duplicate]

The following verbatim section: \begin{verbatim} $ curl -i -G -X POST \ 'http://localhost:8888/deploy' \ --data-urlencode 'name=z' \ --data-urlencode 'code=function f(event, ...
1
vote
1answer
245 views

Break long lines with no whitespace inside verbatim

I am trying to typeset a long line from CSV file, that contains special characters but no whitespaces. Since I would like it to be visually different from surrounding text, I am using verbatim ...
1
vote
0answers
238 views

Make lstlisting more colorful [closed]

I find the result of lstlisting is not very impressive. Take C++ for example, it fails to distinguish keywords and typename, or variable names and namespace. Open any well-established code editor, ...