Questions tagged [fancyvrb]

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

Filter by
Sorted by
Tagged with
3 votes
2 answers
68 views

Inline verbatim text keeping the same font as normal text

My software automatically creates LaTeX documents. I need to display some text that I have no control over (it will be provided by the user), so it can contain problematic characters (like _ or \ or $ ...
user avatar
  • 449
0 votes
1 answer
32 views

Increase space between lines (not globally) by using fancyvrb

My codes are follows: \documentclass{book} \usepackage{xcolor} \usepackage{fancyvrb}% \DefineVerbatimEnvironment{Highlighting}{Verbatim}{fontsize=\small,commandchars=\\\{\}} \newcommand{\DecValTok}[1]{...
user avatar
  • 10.9k
0 votes
1 answer
27 views

Error in package fancyvrb: Too many }'s

When I include the package fancyvrb via \usepackage{fancyvrb} or other packages that make use of that package (for example minted), I get the error Missing \endscname inserted (line 535 of fancyvrb....
user avatar
5 votes
1 answer
379 views

Scale down verbatim environment even further

I am using the fancyvrb package. Even though I set the font size to \tiny, it still doesn't properly fit in a single slide. I was wondering is there a way to scale it down even further. Thank you \...
user avatar
  • 499
8 votes
3 answers
475 views

Minted ` \begin{minted}{...}` KO but `\inputminted` OK

Since a few days I can't color anymore python code with minted; I don't have any error message in the log file, only the minted output doesn't appear in the pdf file. On the other hand, everything ...
user avatar
  • 693
0 votes
2 answers
47 views

Extension defaults to .tex in VerbatimOut environment

When I try to write a file with some name for example a (then read it afterwards) \usepackage{fancyvrb} ......... \begin{VerbatimOut}{a} file content here... \end{VerbatimOut} % process the file ...
user avatar
  • 1,414
1 vote
1 answer
77 views

How can I add additional spacing between some lines in `minted`?

I would like to add a little separation between some lines of code for readibility. Consider this MWE: \documentclass{article} \usepackage{minted} \begin{document} \begin{minted}[linenos]{python} ...
user avatar
  • 585
1 vote
1 answer
25 views

Unable to use listing with toptesi

Everytime I open a new listing the compiler complaints about it. Try to compile the following example % !TEX options = -shell-escape \documentclass[% corpo=12pt, twoside, oldstyle, tipotesi=...
user avatar
2 votes
1 answer
34 views

Problem changing fancyvrb's default font

I would like to change the default font for fancyvrb in the following MWE. % arara: xelatex: { shell: true } \documentclass{article} \usepackage[svgnames]{xcolor} \usepackage{fontspec} ...
user avatar
  • 1,473
2 votes
3 answers
108 views

How to make a macro that prints verbatim text?

I'm trying to do automatic linebreaking right now with verbatim, and I have this setup. \usepackage{fancyvrb} \usepackage{fvextra} \begin{Verbatim}[breaklines=true,numbers=left,breakafter=\},...
user avatar
1 vote
2 answers
43 views

Behavior of environment with optional argument changes when optional argument is not passed

Recently, when I've been working with environments with an optional argument, I've noticed that the behavior changes when I introduce a set of square braces, even when there is nothing inside them. ...
user avatar
1 vote
1 answer
47 views

verbatim environment or lstlisting as part of newenvironment with samepage and \ill?

I'd like to make a "codeillustration" environment that's something like: \newenvironment{codeillustration}[1]{ \begin{samepage} {\ill{#1}} \VerbatimEnvironment \begin{Verbatim}{\end{Verbatim}...
user avatar
  • 223
5 votes
1 answer
76 views

Unicode characters within VerbatimOut of fancyvrb

Consider the following example, in which the sentence Ceci est un résumé. is written into the file \jobname.mytmp and then being read back. \documentclass{article} \usepackage{fancyvrb} \begin{...
user avatar
  • 4,515
3 votes
2 answers
104 views

Using \VerbatimInput with text files that contain Greek and English

I have to include some text files in my document, which are reports derived from another program. The text in these files is mixed (Greek and English). I'm using the fancyvrb package to include the ...
user avatar
  • 89
0 votes
0 answers
57 views

Force to unindent default code

I want to unindent the default indent by mmacells. Here you can see the input and output are indented, and i want to force them to the left start. How to do that? Using \noindent and hspace*{-.5cm} ...
user avatar
4 votes
1 answer
108 views

line number not works for fancyvrb with SaveVerbatim

The following code tells every thing \documentclass{article} \usepackage{fancyvrb} \begin{SaveVerbatim}{FOO} However, if I define an reusable Verbatim by SaveVerbatim, line number failed ...
user avatar
  • 184
1 vote
1 answer
102 views

Define an environment with verbatim body, that removes TAB characters and writes it to a file with VerbatimOut

I'm coding a LaTeX interface for mscgen (another one) and I'm using fancyvrb::VerbatimOut inside a newenvironment to output a part of the tex file into an external file, process it, then import the ...
user avatar
  • 145
0 votes
2 answers
70 views

can't pass optional arguments to a \newenvironment using fancyvrb

I am trying to define a new script environment built on fancyvrb's Verbatim environment. Preamble: \usepackage{fancyvrb} \newenvironment{script}[1][firstnumber=1] {\VerbatimEnvironment\...
user avatar
  • 111
1 vote
1 answer
156 views

About verbatim in LaTeX (and LuaTeX)

What I intend to do... Initially, I wanted to write a series of environments that help me typeset verbatim environments. For example, I would like \begin{myverb}{stylea} \end{myverb} to be equivalent ...
user avatar
  • 4,600
2 votes
3 answers
282 views

How can one construct a macro that contains a pythontex or fancyvrb environment?

Goal: I want to create a command that executes pythontex code blocks from within a macro. Application: I have a macro that typesets some equations. I'd like for a side-effect of their use to be the ...
user avatar
  • 143
0 votes
1 answer
60 views

How do I fix the error \FvrbEx@ColoredBox undefined when using the Seminar.sty [closed]

The following code from TUG generates the error in the title \document-class{seminar} \begin{document} \begin{slide} foo \end{slide} \end{document}
user avatar
1 vote
1 answer
180 views

Resolving a FancyVerb error when making a new code environment

full MWE presented at the end I am creating my own code environment with minted for a text I am writing. It is enumerable, as well as reference-able. Everything works fine and the document compiles ...
user avatar
2 votes
1 answer
606 views

Change font size in verbatim and Verbatim using scaling

This question is closely related to several other questions here, but I believe it hasn't been asked (or answered) exactly like this. Is it possible to change the font size in verbatim and Verbatim ...
user avatar
  • 727
1 vote
1 answer
316 views

\Verb{} in fvextra: Highlighting \Verb{} text to be able to break at the end of line

Searching through various packages documentation and this site I have found how to write inline verbatim text, that is (when neccessary) broken at the end of line. For this feature, I am using \Verb{} ...
user avatar
2 votes
1 answer
636 views

\inputminted inside listing environment is flush left

I want to include part of the following file, foo.py, using \inputminted in a listing environment. def foo(a, b): return a + b def bar(a, b) return a - b However, if this listing ...
user avatar
1 vote
1 answer
445 views

(fancyvrb) Error when finishing environment followed by text

I'm trying to compare he different packages that support verbatim content and I noticed that there is a small, but, big difference in behavior when closing the environment followed by text (not a new ...
user avatar
4 votes
1 answer
204 views

Reference to label of third line in Verbatim env jumps to wrong position

I want to make reference to lines in Verbatim environment provided by fancyvrb pacakge, and make the reference a hyperlink which jumps to the right position where corresponding label is defined, ...
user avatar
  • 20.4k
0 votes
0 answers
27 views

Fancyvrb watermark/footer at the end how to remove it?

\begin{figure} \subfloat[Role specification for a user U$_{i}$]{{ \fbox{\begin{minipage}{17.6em} \VerbatimInput[fontsize=\relsize{-2.5},baselinestretch=1]{RoleUser.txt} \end{minipage}} }}% \qquad ...
user avatar
3 votes
1 answer
122 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)....
user avatar
  • 177
2 votes
0 answers
90 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} \...
user avatar
2 votes
1 answer
122 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 ...
user avatar
4 votes
2 answers
380 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} ...
user avatar
  • 143
3 votes
1 answer
199 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 ...
user avatar
  • 437
2 votes
1 answer
320 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 ...
user avatar
  • 437
2 votes
2 answers
228 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 ...
user avatar
1 vote
1 answer
75 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\...
user avatar
  • 13
2 votes
1 answer
189 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 ...
user avatar
  • 495
0 votes
1 answer
273 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?
user avatar
8 votes
3 answers
625 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 ...
user avatar
2 votes
0 answers
78 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 ...
user avatar
2 votes
1 answer
52 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 ...
user avatar
  • 18k
1 vote
0 answers
158 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 ...
user avatar
4 votes
1 answer
360 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 ...
user avatar
  • 315
1 vote
1 answer
133 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{...
user avatar
  • 13
3 votes
1 answer
2k 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 ...
user avatar
3 votes
1 answer
2k 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 ...
user avatar
  • 5,180
5 votes
2 answers
1k 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=\...
user avatar
2 votes
1 answer
204 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 ...
user avatar
5 votes
1 answer
257 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. \...
user avatar
  • 163
0 votes
0 answers
181 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 (/) ...
user avatar