Skip to main content

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
6 votes
1 answer
136 views

Syntax highlighting with lua

I would like to do syntax highlighting with lua but I am struggling with getting the listing content into lua. As far as I understand the \_prepareverbdata macro can be overwritten to inject color ...
pinsl's user avatar
  • 73
2 votes
0 answers
55 views

Frankenstein’s Conscience conflicting with tabular environment? How to patch?

I'm using compsci and friends for a LaTeX course. But the following MWE \documentclass{article} \usepackage{compsci} \begin{document} Well, the following works: ``\cs\_'' % but there's an extra ...
gildux's user avatar
  • 542
1 vote
1 answer
45 views

Decorating verbatim text in OpTeX

I want to decorate listings with a border and background color. Specifically I would like a similar appearance to this: How can this be achieved?
pinsl's user avatar
  • 73
1 vote
0 answers
21 views

codehigh, for verbatim text in tabularray table

In the tabularray package documentation is suggested that for the verbatim text in tables should be used \fakeverb instruction defined in the codehigh package instead of \verb. Using it I' faced with ...
Zarko's user avatar
  • 299k
0 votes
0 answers
30 views

Create alias of verbatim environment with optional arguments

I'd like to create an alias of the verbatim (xsim-based) environment \begin{CacheMeCode}{tikzpicture, optional arguments} \end{CacheMeCode} to \begin{tikzpicture}<optional arguments> \end{...
tobiasBora's user avatar
  • 8,854
1 vote
2 answers
37 views

`verbatim*` environment in a `minipage` defined by a `\newcommand` does not work

Still a novice at LaTeX - I was attempting to define a custom command for creating minipages of a certain width using this code: \newcommand{\col}[2]{\begin{minipage}{#1\linewidth}#2\end{minipage}} ...
invisi.'s user avatar
  • 13
5 votes
2 answers
287 views

Has the handling of whitespace by \alltt changed recently (i.e. since 2021)?

after moving to a new computer (and installing a current (2024) texlive system), I noticed that the layout in my document was messed up in several places. After some experimenting, it turned out that ...
Jan's user avatar
  • 357
4 votes
3 answers
167 views

Indentation of verbatim environment result in additional empty line before the following content, why?

At first, I added an indent to the verbatim environment, code is shown below: \documentclass{article} \begin{document} Some text before the verbatim environment. \begin{verbatim*} % <--...
On_My_Way's user avatar
0 votes
0 answers
27 views

Removing spaces before ```center```

\documentclass[12pt] {article} \usepackage{palatino} \usepackage{fancyvrb} \usepackage{authblk} \usepackage{fancyhdr} \usepackage{titlesec} \def\baselinestretch{2.0} \titleformat{\paragraph}{\...
Manjoy Das's user avatar
2 votes
1 answer
54 views

verbatim mode and carriage return character tokens

This question refers to how the program TeX creates tokens after reading a line of a .tex-file. It does actually not refer to writing macros or doing typesetting work which takes place in stages after ...
user avatar
1 vote
1 answer
121 views

Macro with verbatim argument

Is it possible to define a macro \foo such that it can accept verbatim code like: \foo{cos(16 % 2)} without interpreting them as latex code first? I know I can use an environment for that, but I ...
tobiasBora's user avatar
  • 8,854
0 votes
0 answers
16 views

Insert pagebreak in \begin{center} with \begin{BVerbatim}

\documentclass[12pt] {article} \usepackage{amsmath} \usepackage[breakable]{tcolorbox} \usepackage{fancyvrb} \usepackage{fancyhdr} \def\baselinestretch{2.0} \usepackage{tocloft} \def\toright#1{\...
Manjoy Das's user avatar
0 votes
0 answers
33 views

Importing parts of a .txt file in LaTeX document [duplicate]

Can you define which lines and columns from a .txt file to show up in LaTeX? I tried the \lstinputlisting command where it seems I can only limit the output to specific lines and not columns as well, ...
Charles TeXavier's user avatar
0 votes
0 answers
32 views

Sphinx Verbatim (Code block) inside mdframed environment

My code-block don`t break on new page when a use code-block inside mdframed environmen: \begin{mdframed} \begin{sphinxVerbatim}[commandchars=\\\{\}] Tablespaces: PRIMARY (1) Full path: /home/test/...
Ольга Зайчук's user avatar
0 votes
1 answer
58 views

How do I keep my code example from going off the page

I am trying to add a code example with the ability to caption it at the end but it keeps going off the page to the right (see image). I have tried different verbatim and verbox and floats after hours ...
Wakey344's user avatar
2 votes
3 answers
202 views

Typing grave accent for double quotes

I'm writing a little document on LaTeX to explain how to type LaTeX to some of my fellow colleagues. What's giving me a headache are double quotes. As an alternative to \textquotedblleft text \...
Laura F.'s user avatar
  • 116
1 vote
2 answers
106 views

Bold font style in \verb environment

I'm looking to get a \verb string to output with bold font style as well as word wrapping. The closest I've come is by using the commented code rather than the currently live one. I realize I'm ...
JTShakes's user avatar
0 votes
0 answers
54 views

v-type argument in \NewDocumentCommand ignores spaces

Consider the following code: \documentclass{article} \usepackage{listings} \NewDocumentCommand{\hey}{v}{\lstinline|#1|\ignorespaces} \begin{document} \hey|a |b \lstinline|a |b \end{document} Why ...
Gargantuar's user avatar
  • 1,134
0 votes
0 answers
31 views

Biblatex/Memoize: Error if cited bib entry includes verbatim field

If Biblatex is used with the current version of Memoize, citing any entry containing a verbatim field results in compilation failure. I've reported this as a bug, but is it possible to workaround the ...
cfr's user avatar
  • 205k
0 votes
1 answer
57 views

How to define a \verb-like command that can be used in table and headings?

I want to define a \verb-like command, \keyword, for example, to make the following code work as desired. Can anybody help me? \documentclass{article} \usepackage{float} \usepackage{newverbs} \...
Stackexchanger's user avatar
0 votes
0 answers
80 views

! LaTeX Error: Environment Verbatim undefined in Texlive in Linux Mint

I'm using Texmaker with Texlive in Linux Mint 21.3 Cinnamon to write an article with some Python code. Then I got a problem: ! LaTeX Error: Environment Verbatim undefined in Texlive in Linux Mint The ...
trequartista's user avatar
  • 1,890
1 vote
1 answer
51 views

memoir, verbatim: how to remove blank space symbol in verbatim text

Why the following MWE produce the following result: \documentclass{memoir} \begin{document} why in the verbatim text is shown blank space symbol \verb!verbatim text!? \end{document} How to remove ...
Zarko's user avatar
  • 299k
1 vote
1 answer
85 views

tabularray: Using \fakeverb in the cmd argument

I have a table with cells that include characters which I want to treat as verbatim. Section 6.2 of the tabularray documentation states that we can wrap the contents of cells in \fakeverb{} to ...
Vincent's user avatar
  • 157
2 votes
1 answer
24 views

Left aligning Verbatim / fancyvrb environment with beamer slide

I would like to have the content of the Verbatim environment to be on the left of this beamer slide. However, whatever I try it always gets centered. How can I control the position of the start of the ...
tomka's user avatar
  • 305
4 votes
1 answer
104 views

How to format description label with a command (enumitem)

I have to make list environment based on description that should be used to describe C functions. For example: % !TeX program = lualatex \documentclass[11pt]{report} \usepackage{enumitem} \usepackage{...
Vladyslav Rehan's user avatar
0 votes
1 answer
34 views

VerbatimOut crashes on special symbols inside if-then-else

This code compiles just fine with lualatex, xelatex, and pdflatex: \documentclass{article} \usepackage{fancyvrb} \begin{document} \begin{VerbatimOut}{x.txt} ^^_ \end{VerbatimOut} \end{document} ...
yegor256's user avatar
  • 12.1k
3 votes
2 answers
350 views

Including emojis in verbatim

This is a follow-up question to this one on arbitrary size pages. How would one include emojis in a verbatim environment? E.g. \begin{verbatim} |-------+--------+-------------------------------------+-...
Olivier Bégassat's user avatar
0 votes
1 answer
57 views

Arbitrary size pages

Is it possible to create a latex document where some pages have a unique size [width & depth] that basically is the right size to contain all the data from some input file? More details. I am ...
Olivier Bégassat's user avatar
0 votes
0 answers
64 views

How to get straight single quotes in verbatim and and codeexample

I have in my documentation stuff like print('abc'), but it is turned into print(’abc’) (note the changed quote), which breaks compilation. How could I make the environments \begin{codeexample} and \...
tobiasBora's user avatar
  • 8,854
0 votes
1 answer
32 views

Reconstruction of a Pseudocode Observing Horizontal Spacing and Alignment

In an attempt to reconstruct the following picture, I have tried verbatim environment as below: \documentclass[11pt]{book} \usepackage{algcompatible} \usepackage{algorithm} \usepackage{mathrsfs} \...
mali1234's user avatar
  • 135
0 votes
1 answer
60 views

Why did my center works so weird

I wanna include some code in my text so I use center+BVerbatim environment, but it shifts my code in a weird way. Here's my code. %%% 一个文档 % 导言:文件格式设置 \documentclass[UTF8]{ctexart} % 该文档为中文文档,...
Toby's user avatar
  • 23
1 vote
1 answer
105 views

Limiting the width of the verbatim text [closed]

Hello Stack Exchangers I am trying to limit the width of the verbatim text and the 'line 5' is out of the margins of the page. The example is showed in the picture where the rest of the lines are ...
alphabounce_1228's user avatar
8 votes
2 answers
234 views

Get rid of extra white space inserted when using \verb with tabularx

I noticed a peculiar behavior of tabularx when using \verb. The following minimal working example illustrates the problem. Note the wicked extra space introduced between test and {123}. \documentclass{...
normanius's user avatar
  • 443
0 votes
1 answer
42 views

Why does the vertical (line) spacing scrunch up for certain paragraphs? [duplicate]

I'm writing a series of notes, and I've begun to see the vertical (line) spacing of certain paragraphs to substantially decrease compared to others. I've attached a photo to describe what I mean. The ...
TheProgrammer's user avatar
4 votes
0 answers
38 views

When verbatim is loaded, \verb behaves as \verb*

With recent versions of LaTeX, when the package verbatim is loaded, the standard command \verb always behaves as \verb*. Is it a feature or a bug? \documentclass{article} \usepackage{verbatim} \begin{...
F. Pantigny's user avatar
  • 42.4k
0 votes
1 answer
49 views

Verbatim coloring but keep brackets

I have this code: \begin{Verbatim}[commandchars=\\\{\}] > \textcolor{names}{A}={\textcolor{numbers}{6},\textcolor{numbers}{75},\textcolor{numbers}{46}} > \textcolor{names}{B}={\textcolor{...
Alix Blaine's user avatar
2 votes
3 answers
141 views

Formatting regular expression code in the argument of \verb

I have some difficulties with formatting regular expressions in the argument of \verb. Thank you for any help. \documentclass[11pt]{book} \usepackage[paperwidth=16cm, paperheight=24cm]{geometry} \...
cProg's user avatar
  • 591
0 votes
0 answers
60 views

How to make an environment created with newtcblisting behave the same as one created by the minted environment?

I have declared a new envrionment in a class file like this (the complete file exists here): \renewcommand{\theFancyVerbLine}{\parbox{10pt}{\centering\footnotesize\arabic{FancyVerbLine}}} \...
Sujal Singh's user avatar
1 vote
1 answer
29 views

Minted + new environment that can be turned off

I am writing a notebook for some students where I would like to provide optional solutions to coding exercises. I know that, in principle, I can use a custom environment solutions that contains code ...
qubert's user avatar
  • 21
4 votes
2 answers
201 views

verbatim not aligned properly - XeLaTeX

I've tried with: \documentclass{article} \usepackage{fontspec}% \usepackage[bold-style=TeX]{unicode-math}% \setmainfont[Ligatures=TeX, Path = ./ , UprightFont= MinionPro-Regular.otf, BoldFont= ...
MadyYuvi's user avatar
  • 13.9k
1 vote
2 answers
119 views

Verbatim environment in \newcommand

I want to make two commands for \begin{verbatim} and \end{verbatim} to make it shorter like this: \newcommand{\bv}{\begin{verbatim}} \newcommand{\ev}{\end{verbatim}} I have already done the similar ...
Vladimir's user avatar
  • 589
0 votes
0 answers
25 views

How do I change the typeface in the \verbatim environment? [duplicate]

I am aware that this question has been asked before but it has not been answered to my satisfaction. It has been posted as an answer here (Change typeface of verbatim environment) that the only way to ...
ElGranGeek's user avatar
0 votes
0 answers
56 views

Replace syntax brackets by visible brackets

General overview I have a BibTeX entry of the document I am working on itself, and I put this deffinition in a variable to be able to use it everywhere I whant. The goal is to print on the document ...
fauve's user avatar
  • 2,531
1 vote
1 answer
51 views

\Verbatim inside tabular produces double hashtags

I have a long table which should have a verbatim enviroment on the left side. MWE: \documentclass{article} \usepackage{float} \usepackage{tabularx} \usepackage{array} \usepackage{graphicx} \...
Ceriana's user avatar
  • 75
0 votes
0 answers
12 views

Custom lstlisting command changed verbatim font size

I've copied a custom lstlisting command that makes it look like Mathematica code. This is that code below: \usepackage{babel} \usepackage{beramono} \usepackage[T1]{fontenc} \usepackage{color} \...
Michael Adrian Javier's user avatar
1 vote
1 answer
69 views

pgf: codeexample with verbatim code

I'm using pgfmanual to document a library and the nice looking codeexample environment to typeset a code block + the result. However, I'd like to use it when the code contains verbatim code. Is it ...
tobiasBora's user avatar
  • 8,854
1 vote
1 answer
55 views

How to make new environment using an existing environment? File ended while scanning use of \FancyVerbGetLine

I have a setup that works OK as is. I needed to make this code as an environment so less typing. When I do that I get an error. Here is the original setup \documentclass[12pt,titlepage]{article} \...
Nasser's user avatar
  • 20.3k
3 votes
3 answers
466 views

Why are my newlines turned into \Omega?

If I use ^^J or \iow_newline:, it prints a \Omega instead of a newline. Any idea what I got wrong? \documentclass{article} \ExplSyntaxOn \NewDocumentCommand{\printTwiceWithNewline}{v}{ \...
tobiasBora's user avatar
  • 8,854
3 votes
1 answer
169 views

Print LaTeX3 string verbatim

I can’t find a way to print the content of a LaTeX3 string and/or a text verbatim (or to be more precise, I found a solution by writing the content to a file and then displaying the verbatim content ...
tobiasBora's user avatar
  • 8,854
1 vote
0 answers
30 views

Redirecting \write to and \input from lua variable

Beamer manages frames with catcode-changing content by first writing the content of the frame to a .vrb file, then reading it again (several times, as needed, if I understand correctly). In LuaLaTeX, ...
ysalmon's user avatar
  • 1,160

1
2 3 4 5
23