Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [fancyvrb]

{fancyvrb} is a package that provides sophisticated facilities for reading and writing verbatim TeX code.

3
votes
1answer
16 views

fancyvrb dynamic label

I load multiple source files into a document using the fancyvrb package. I found out how to include a static label. Now, I want to display the filename in the label (dynamic label based on input file)....
1
vote
0answers
20 views

Problem defining a fancyvrb verbatim environment within tcolorbox

I want to define an environment for verbatim text using fancyvrb functionality, but within an entitled frame drawn using tcolorbox. Here is an example: \documentclass{article} \usepackage{fancyvrb} \...
2
votes
1answer
58 views

Why Does fancyvrb Turn Comments into Non-comments?

When I execute the following code, I get a nice .pdf as a Result: \documentclass{minimal} \usepackage{fancyvrb} \begin{document} \begin{Verbatim} sdfsdfs \end{Verbatim} \end{document} Below is the ...
4
votes
2answers
74 views

How to renew verbatim to Verbatim from fancyvrb?

I am using pandoc to convert Markdown to Tex, pandoc will render code blocks to \begin{verbatim}CODE\end{verbatim}, and fvextra only works with \begin{Verbatim}[breaklines]. How can I make {verbatim} ...
3
votes
1answer
53 views

How can I wrap `\colorbox` around `\Verb[commandchars=\\\{\}]` by only changing the preamble?

This is a follow-up question to How can I use `\renewcommand` to wrap `\colorbox` around `\Verb`? I have TeX files which contain code like: \Verb|print("Hello World", end="")| The \Verb content ...
2
votes
1answer
53 views

How can I use `\renewcommand` to wrap `\colorbox` around `\Verb` by only changing the preamble?

What works: I have TeX files which contain code like: I want \texttt{this text} to have a background color. I want the \texttt to have a background color: I want \colorbox{lightgray}{\texttt{this ...
2
votes
2answers
78 views

Getting fancyvrb and mdframed to work togegher

I would like to format terminal output as follows: white text on black background commands written by the user are emphasized (slanted typewriter) Using a combination of mdframed and fancyvrb I got ...
1
vote
1answer
29 views

Is there any way to redefine fancyvrb Verbatim environment?

I am trying to comment out all Verbatim blocks that are generated from a jupyter notebook export to .tex \documentclass{article} \usepackage{verbatim} % for comment \usepackage{fancyvrb} \let\...
2
votes
1answer
32 views

Curly braces in fancyvrb

I am convinced that I have seen this on here before, but I am unable to find it. I am putting some code into a LaTeX document and I wish to add syntax colour to it. I have done this using fancyvrb ...
0
votes
1answer
49 views

Fixed position for my Verbatim [closed]

I use the fancyvrb package and I'd like that my Verbatim code is always written with 2pt indention. How can I do that?
8
votes
3answers
106 views

How to turn a Verbatim into an itemize environment?

I'm designing a class of documents that always has the same elements, among them two unordered lists, the contents of which need to be manually copy-pasted into the document. Since this is going to be ...
2
votes
0answers
51 views

Read out text file until first empty line is found [closed]

Im currently writing a manual for a package and wanted to include parts of a Matlab file. I was able to display the whole file with the listings package but my goal is to only display the first part ...
2
votes
1answer
40 views

extra new line added using tex4ht using BVerbatim

This is a minor issue and I can easily work around it, but thought to mention it just in case it is not supposed to happen. Using \usepackage{fancyvrb}, I needed to print lines one after the other of ...
0
votes
0answers
41 views

Default searching path for VerbatimInput in fancyvrb package

I write/collect some codes (e.g., C, R or Matlab) in a subdirectory named, say, myCodes. Then I want to use VerbatimInput from usepackage{fancyvrb} to list the codes in some absolute path way. I know ...
3
votes
1answer
89 views

Two Verbatims (fancyvrb) side by side with frame and uncovering lines

I'm wondering if there is a possibility to create in beamer two Verbatim environments side by side, each with the frame of the width of \textwidth and with gradually uncovering lines. More ...
1
vote
1answer
30 views

Using fancyvrb insid newenvironment together with other packages

I've found some examples on how to use the fancyvrb package inside a \newenvironment command. But they don't quite cover what I want to do. Here is the code I tried to make work: \newenvironment{...
2
votes
1answer
190 views

How to escape to latex within minted comments?

I am using the minted package for typesetting matlab source code. There is an escapeinside option for the listing environment provided by minted to escape to regular TeX commands. However, this does ...
2
votes
1answer
402 views

FancyVerb Error in using minted package with beamer

Could someone help me with the following error? I am trying to use minted package in beamer. FancyVerb Error: File ended while scanning use of \FancyVerbGetLine. This is a MWE that duplicates the ...
5
votes
2answers
347 views

How can I justify text with line number in Verbatim environment?

My minimal file is: \documentclass{article} \usepackage{fancyvrb} \usepackage{ragged2e} \usepackage{lipsum} \usepackage{pbox} \begin{document} \begin{Verbatim}[numbers=left,fontsize=\bf,commandchars=\...
2
votes
1answer
56 views

How can I use \hspace in fancyvrb package, without use the key space?

My minimal file is: \documentclass{article} \usepackage{fancyvrb} \begin{document} \begin{Verbatim}[numbers=left,fontsize=\bf] \begin{document} I want to have indent in the amount of hspace{34pt} at ...
5
votes
1answer
97 views

\verbatimInput prints unnecessary lines at the end

test.tex contains the following code \begin{itemize}[(i)] \item One \item Two \item Three \end{itemize} When I use this file using \verbatimInput it prints c@FancyVerbLi as the final line. \...
0
votes
0answers
63 views

Embed .txt file, abiding to defined margins

I am using this link to embed text files within my thesis. Include data from a .txt verbatim Unfortunately, the contents of the text file keeps ignoring the margins. I have tried using | and (/) ...
6
votes
2answers
88 views

Is it possible to use fancyvrb, eso-pic and TikZ simultaneously?

Consider the MWE \documentclass{article} \usepackage{fancyvrb} \usepackage{tikz} \usepackage{eso-pic} \AddToShipoutPictureFG{% \begin{tikzpicture}[remember picture, overlay] \node[anchor=...
2
votes
1answer
114 views

Include a file, verbatim, with a picture on every page

I want to include an arbitrary file, probably using the fancyvrb VerbatimInput command (or something similar). However, I want to put a LaTeX picture environment on every page, much in the way that ...
1
vote
0answers
1k views

File `fancyvrb.sty' not found. \RequirePackage

When I try to compile my tex file in TexStudio I get the following error code: File `fancyvrb.sty' not found. \RequirePackage The MiKTeX Console shows that the fancyvrb package is installed and it ...
3
votes
3answers
1k views

Latex environment to write in plain text mode

A paragraph I am writing contains a lot symbols such as "{" or "_". To display those symbols as text instead of command, I have to write them as "\{" and "\_". Otherwise, Latex will say there are ...
2
votes
1answer
62 views

Table inside fancyvrb with continuous colorbox?

So I'm trying to insert a table (with an image) in the middle of a \fancyvrb of R code. The \fancyvrb has a \colorbox around it in gray. Is there a way to get all three parts (verbatim pt1, table, ...
1
vote
0answers
25 views

Preventing empty lines at the start of a page with fancyvrb

I have some quite long code listings in a document which uses fancyvbr. These listings contain empty lines to visually divide the code in sections. If the listing breaks across a page, these empty ...
5
votes
2answers
216 views

issue with Verbatim

I have a \n in my code which is not compiling correctly in verbatim environment. \documentclass[]{article} \usepackage{fancyvrb} \usepackage{color} \begin{document} \begin{Verbatim}[commandchars = \...
1
vote
1answer
89 views

Using minted in l3doc documentation

When using minted in a .dtx file with l3doc in any way one will lose syntax highlighting as shown below (where the first and fourth segment are minted outputs and the second and third verbatim): You ...
5
votes
2answers
78 views

While loading fancyvrb, siunitx and bigfoot, I got input stack size=5000, TeX STOPPED: fatal errors occurred

If I try to build the following document: \documentclass{memoir} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage{fancyvrb} \usepackage{siunitx} \usepackage{bigfoot} \begin{...
1
vote
1answer
150 views

VerbatimInput gives error when file is too large [closed]

I use \VerbatimInput in package fancyvrb to wrap my text, which is loaded from external file. But when the external file is too large, it gives the following error: TeX capacity exceeded, sorry [...
2
votes
1answer
115 views

minted/fancyvrb environment as argument to TikZ command

I want to create a command, accepting an argument, which sets the content of the argument as a TikZ picture. Problem: The argument is a minted/FancyVrb environment. MWE: %!TEX OPTIONS = --shell-...
0
votes
1answer
67 views

Extra spaces when using fancyvrb with xeCJK

I am trying to typeset text including CJK ideographs in a verbatim environment. Because I want to indent my verbatim text slightly, I am using the fancyvrb package. Here's a MWE: \documentclass{...
2
votes
1answer
175 views

Latex upquote package fails with Noto fonts

I'm writing a document which contains fragments of XML typeset using the Verbatim environment from the fancyvrb package. The XML frequently contains double-quote characters; I don't greatly care ...
2
votes
1answer
261 views

\BVerbatimInput and \adjustbox : the information is cut at the end of the first page

\VerbatimInput calls a test.dat file, and produces the following output, where the long lines are not entirely seen: A solution for this is use \BVerbatimInput together with \begin{adjustbox}. This ...
4
votes
2answers
1k views

Verbatim environment with specified width (in characters)

I'd like to specify the dimensions of a boxed verbatim environment by providing the width in characters (e.g. to fit terminal dimensions). Is that possible? A solution using fancyvrb would be ...
4
votes
1answer
273 views

How to unset option to Verbatim environment

I am using the fancyvrb package to be able to have formatting (e.g., bold, color, etc.) in my verbatim environments. This is easy enough to do by giving the commandchars option as seen in this MWE: ...
3
votes
2answers
877 views

Changing font size in all fancyvrb from Jupyter Notebook (nbconvert)

I generated latex file from Jupyter Notebook using nbconvert. I need to change the font size in all Verbatim (fancyvrb) enviroments. I tried but nothing I know of works. Here is all the settings from ...
2
votes
1answer
176 views

Verbatim environment inserts a blank page with option [samepage=true]

I am using the fancyvrb package to add an RFC to my appendix. RFCs are preformatted with a defined site layout. I am using the Verbatim environment with the samepage=true option, to avoid breaking up ...
2
votes
1answer
99 views

Keep fvrb-ex's SideBySideExample environment result on single line

The fvrb-ex package, which uses the fancyvrb package, defines a SideBySideExample environment that, according to the documentation, "show the formatted result on the left and the verbatim text on the ...
0
votes
1answer
356 views

How use fancyvrb to show both result and verbatim text?

The documentation for fancyvrb claims: "you can build example environments (showing both result and verbatim text)...." How? For example, how should commands from fancyvrb be used to construct a ...
0
votes
1answer
212 views

fancyvrb error when using macros in Verbatim option

When using the firstnumber=... option in the Verbatim environment of fancyvrb, I found strange behavioral difference involved with macros. The following has no problem: \def\foo{2} \begin{Verbatim}[...
2
votes
1answer
108 views

How to preprocess code inside a listings (or fancyvrb) environment?

Suppose I want to make a shell environment to typeset examples of shell commands. I'd like to automate some details to remain consistent. For example, I need to automatically put a '$' at the ...
4
votes
1answer
283 views

tcolorbox with fancyvrb Verbatim inside enumerate

I have a fancyvrb Verbatim environment inside a tcolorbox. When I use that tcolorbox as an item in an enumerate environment, the item number goes inside the tcolorbox. For example, the second item in ...
6
votes
1answer
275 views

Is this a bug with fancyvrb, fancyhdr and fontspec?

Consider the following (hopefully minimal) non-working example and compile with luatex (TeXlive 2016): \documentclass{article} \usepackage{fontspec} \setmainfont{texgyrebonum-regular.otf} \usepackage{...
7
votes
2answers
3k views

Put line numbers inside fancyvrb environment

Line numbers generated for verbatim text by the fancyvrb package are put outside the verbatim environment: \documentclass{article} \usepackage{fancyvrb} \begin{document} \begin{Verbatim}[numbers=...
2
votes
2answers
307 views

Using fancyvrb to create a new verbatim environment in Isabelle

Following answer https://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
1answer
111 views

Conflict with unicode-math and listings

\documentclass{article} \usepackage{unicode-math} \usepackage{listings} \usepackage{fancyvrb} \begin{document} \lstset{fancyvrb} \begin{Verbatim}[commandchars=\\\{\}] \pm \end{Verbatim} \end{...
3
votes
2answers
143 views

Preventing page break between a Verbatim environment and an equation

I have a document in which displayed equations often appear immediately after an environment created using the fancyvrb package. How can I prevent page breaks from appearing in between? \...