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

learn more… | top users | synonyms

3
votes
1answer
55 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
38 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? \...
0
votes
0answers
35 views

matlab-prettifier with fancyvrb-style of label / frame

I wonder how to make the frame line around caption of listing not being printed (top line being broken into two by caption in the middle) when matlab-prettifier (or listings package) are being used, ...
6
votes
1answer
95 views

How to use comma-separated argument list in Verbatim environment?

When I try this: \documentclass{article} \usepackage{fancyvrb} \usepackage{xcolor} \begin{document} \begin{Verbatim}[commandchars=\\\{\}] \textcolor[RGB]{255,0,0}{test} \end{Verbatim} \end{document} ...
6
votes
1answer
39 views

Font definition file loading during verbatim with fancyvrb

I am trying to define a verbatim-like command for regular expressions. I say verbatim-like because I’d like the regex operators to be typeset specially. The idea is that you can type a regular ...
2
votes
2answers
67 views

How to get continuos line numbers for minted code blocks

I use minted in following way: \documentclass[a4paper, 11pt, twoside]{article} \usepackage{xltxtra} \usepackage{xunicode} \usepackage{polyglossia} \usepackage[svgnames]{xcolor} % Syntax higlight \...
3
votes
1answer
81 views

FancyVerb error when % at end, when using \DefineVerbatimEnvironment

This MWE gives an error when % is at the end the line as show below \documentclass[11pt]{article}% \usepackage{fancyvrb} \DefineVerbatimEnvironment{Xsmall}{Verbatim}{fontsize=\small} \begin{document} ...
3
votes
1answer
69 views

knitr code chunks in footnotes

My issue is to include verbatim output from knitr Sweave code chunks in footnotes. The BVerbatim environment (fancyvrb) gives me the formatting that I want. (NB: one needs to put \VerbatimFootnotes ...
3
votes
2answers
60 views

Using \VerbatimOut in a \newcommand -> FancyVerbError

I'm creating a class for exercices with questions and answerdocument. I have a command \question{} in which I write the question. And I create a box associated at the question in which the student ...
6
votes
2answers
146 views

formatting certain texts in \fancyvrb environments automatically

I have for example the following Verbatim environment from the fancyvrb package: \begin{Verbatim} >>> 1+1 2 >>> \end{Verbatim} Whenever ">>>" appears, I want to color it blue. ...
2
votes
1answer
50 views

Spacing between custom verbatim environments

I have a document that uses multiple custom verbatim environments, created using the fancyvrb package. Spacing around these is controlled by my own code; I have disabled the spacing added by fancyvrb ...
2
votes
1answer
65 views

TypeWriter font have no effect with polyglossia package

Using XeLaTeX engine, MWE1 works fine with fontspec and ucharclasses package. But when I change fontspec to polyglossia (MWE2), there is no TypeWriter font effect. Moreover, the first sentence of ...
15
votes
2answers
417 views

Showing nice indentation of Python code

I use pythontex to typeset my Python listings. I'd like to have some kind of L-shaped lines, like the ones I added in the image below to clearly exhibit the indentation level of every line of code. ...
0
votes
1answer
97 views

Greek letters in fancyvrb verbatim on OS X using xelatex

How can I get greek letters, such as λ, to appear inside Verbatim? Which font should I use? I am on OS X, using xelatex, and currently using \fvset{fontfamily=Monaco(0),fontsize=\footnotesize,...
1
vote
0answers
26 views

Latex error- file 'fancyvrb.sty' not found [duplicate]

I am using Miktex2.9 and Texniccenter and error is coming 'fancyvrb.sty' not found, so what to do can i download it , if yes after downloading where to put the file so that after running the ...
1
vote
1answer
106 views

Getting non-curly quote marks with PythonTeX 0.14

I'm unable to get the non-curly quotation marks ('upquotes') to print inside any of the PythonTeX (v=0.14) environments. Here's my MWE: \documentclass{article} \usepackage[T1]{fontenc} \usepackage{...
3
votes
1answer
248 views

fancyvrb error with math escapes and prime (')

I've recently noticed a few cases where fancyvrb math escapes fail. This works fine: \documentclass{article} \usepackage{fancyvrb} \begin{document} \begin{Verbatim}[commandchars=\\\{\},codes={\...
3
votes
0answers
337 views

fancyvrb + listings inside a list

I'm trying to put Verbatim environment from fancyvrb package, with activated interface to listings package, inside enumerate environment. When Verbatim environment is first element in \item, item's ...
3
votes
1answer
76 views

Append verbatim material to a file

I am using the fancyvrb package. I'd like to create a verbatim-like environment that does the following two things: 1) Append the verbatim material as-is to a file that has already been opened. 2) ...
3
votes
1answer
109 views

Prevent ligature in verbatim text

I was looking at Problem with hyphen in URL when using fancyvrb with hyperref but cannot quite understand the solution so cannot apply it to my problem. I am getting an unwanted ligature in verbatim ...
4
votes
2answers
194 views

How can I automatically replace subscripts and highlight GoTo labels?

I have to show a lot of autogenerated code throughout my document. The generated code represents loops with explicit block labels and gotos. The following code applies function f to each element of ...
5
votes
3answers
911 views

Shift Verbatim environment to the left using \hspace

I pasted some code into a document in a Verbatim environment from fancyvrb. Because it is within two nested enumerate environments, the code is indented quite far over. As a result, one long line of ...
5
votes
2answers
451 views

How can I get straight single quotes in a custom Verbatim command?

I use the \Verb command from the fancyvrb pacakge for in-text verbatim fragments. To get straight single quotes, I also loaded the upquote package. Unfortunately, this does not work when I use a ...
7
votes
1answer
176 views

How can I change a glyph in a Verbatim environment?

I have a document which contains example program code in Verbatim environments. The caret symbol produced by typing ^ looks too flat to me, so I defined a macro to produce a sharper version. \...
11
votes
2answers
802 views

How to suppress extra vertical space before/after fancy Verbatim environments?

I am using fancyvrb's DefineVerbatimEnvironment to create differently-styled verbatim environments for user input and output. When two or more of these follow each other, there is extra vertical space ...
7
votes
2answers
1k views

Inconsolata italics?

Please see http://stackoverflow.com/questions/23975828/how-to-specify-non-standard-font-in-fancyvrb-verbatim/ for the start of this discussion. I am using fancyvrb to create a fancy Verbatim ...
2
votes
2answers
605 views

How to specify non-standard font in fancyvrb Verbatim?

I am using Inconsolata for code in paragraphs, and would like to use it for code in verbatim environments as well. I have tried using fancyvrb's Verbatim environment to do this, but cannot get any ...
6
votes
2answers
2k views

How do I center a boxed 'Verbatim'?

Here's a MWE: \documentclass[12pt]{article} \usepackage{fancyvrb} %=== \begin{document} \begin{Verbatim}[fontsize=\small, frame=single, xrightmargin=5cm] Text. \end{Verbatim} \end{document} I'...
4
votes
1answer
82 views

fancyvrb: multiple actives

this works great---well, I stole it right out of the docs: { \catcode`!=\active \begin{Verbatim}[defineactive=\def!{\color{red}\bf}] black ! red black \end{Verbatim} } now I would ...
5
votes
1answer
364 views

Alternative commandchars in fancyvrb

In my Verbatim I need to specify colour for my code. In this answer (fancyvrb alternate commandchars and \textcolor) the solution is to put this code in the preamble: \newcommand*{\fvtextcolor}[1]{\...
5
votes
1answer
309 views

Only draw part of a borderline in tcolorbox

I want to tune the type of tcolorbox that I'm making. I want specifically to only draw a border on one side of the image, similar to how minted allows to draw only a border on one side by specifying ...
12
votes
3answers
360 views

Is there a way to make a certain character in a Verbatim have a certain formatting?

I am writing this report on a computing simulation of the Ising model. I am pressenting lattice configuration samples, which are just an array of "+" and "-". This is done in order to visualize the ...
3
votes
1answer
326 views

fancyvrb inline verbatim with \newcommand and \CustomVerbatimCommand

I've just registered. This is my first question to this site. I am trying to make a verbatim command for inline code. This has been asked and answered many times before, but I never found a direct ...
14
votes
2answers
267 views

Dash in Environment Name

I'm trying to make a verbatim environment called "my-environ" \documentclass{article} \usepackage{fancyvrb} \DefineVerbatimEnvironment{myenviron}{Verbatim}{numbers=left,frame=lines,label=My Environ,...
5
votes
1answer
155 views

How to have fancyvrb number every other line starting with the first?

The following MWE using fancyvrb produces line numbers every other line, starting on the second line, like so: Writing some test 2 third line 4 fourth line fifth line so the numbers are 2, 4, ...
2
votes
1answer
139 views

Custom verbatim commands writing into index

I have created a custom fancyvrb command via \CustomVerbatimCommand{\afun}{Verb}{} to use for writing programming language functions, say \afun|object.method.blah|, etc. I would like to automatically ...
2
votes
1answer
90 views

Source code customization for specific words?

I'd like to highlight some specific words for HTML5 code manually in LaTeX. In other words, I don't want to define an exact structure for highlighting the language, but do the highlights only for the ...
6
votes
1answer
259 views

too much space between two environment create with tcolorbox

i want write a maple book, see this example code in that book: ‎\documentclass{article}‎ ‎\usepackage{tcolorbox,fancyvrb}‎ ‎\tcbuselibrary{skins,breakable}‎‎ ‎‎ ‎‎‎‎‎‎%--------------------------------...
10
votes
5answers
988 views

how fancyvrb background color fill completely with fillcolor?

I'd like the whole Verbatim (fancyvrb) block to have a background color. How do I do it? The fancyvrb package does define a fillcolor -- but that only colors the area around the margin -- not the ...
8
votes
2answers
138 views

Break line within a macro while writing to a file

I am trying to use (La)TeX as a macro pre-processor for a programming language. My idea is to use the VerbatimOut environment from the fancyvrb package to output essentially verbatim text, but using @ ...
4
votes
1answer
302 views

How to handle listings, fancyvrb, newfloat and caption?

I am planning a "small thesis" for university which will need to display lots of code (C, C++, gnuplot, LaTeX, ...) - thus I spent this evening reading about listings and fancyvrb. The latter I've ...
3
votes
1answer
306 views

Coloring or Bolding multiple lines in fancyvrb integration with listings

I would like to apply latex commands on a bunch of lines in a Verbatim environment with listings, especially make bold or color a block of code. I am able to do that for a single line, but not for ...
6
votes
1answer
2k views

LaTeX commands in Verbatim using fancyvrb and listings

I am trying to use LaTeX commands like \textbf, \textit, \textcolor in fancyvrb combined with listings. Especially I want to bold and color any text or entire blocks of Java code (not just keywords) ...
4
votes
2answers
519 views

Integrating listings with fancyvrb

I am trying to use fancyvrb with listings and I get an error saying l.2 ...{Verbatim}[formatcom={\lstset{style=Java}}] Package Listings Error: language java undefined. \documentclass{...
0
votes
0answers
25 views

How to install fancyvrb within mactex? [duplicate]

I like to use http://www.ctan.org/pkg/fancyvrb with http://tug.org/mactex but its not clear to me how to install it within mactex ?
6
votes
2answers
348 views

How to add a phantom character to the beginning of a verbatim block

I am trying to understand the commandchars of fancyverb's Verbatim: \documentclass{article} \usepackage{fancyvrb} \begin{document} \phantom{foo} \begin{Verbatim}[commandchars=\\\!\!] \phantom{bar} ...
2
votes
1answer
502 views

Can I use Beamer's \alert<x>{…} inside fancyvrb Verbatim with overlay?

I would like to use Beamer's \alert<x>{...} command inside of a Verbatim environment (from the fancyvrb package) to highlight the text. I've found that when the \alert command is inside the ...
4
votes
1answer
588 views

How to wrap floated minted listing in my own environment?

Here's what I'd like to do: \begin{code}{c}{Hello World in C}% I would prefer the caption to be optional #include <stdio.h> int main(void) { printf("Hello, world!\n"); return 0; } \end{...
7
votes
2answers
6k views

You can't use `macro parameter character #' in restricted horizontal mode. [duplicate]

I get a strange error with a \Verb escape in a footnote: \documentclass{article} \usepackage{fancyvrb} \begin{document} Works inline \Verb!S#Var! but doesn't in footnote. % \footnote{No really, it ...
6
votes
2answers
100 views

get rid of whitespace when using in Verb in tabu*

Is there any way, to get rid of the extra whitespace between the command and the curly braces when using a Verb in a tabu*? \documentclass{article} \usepackage{fancyvrb, tabu} \begin{document} \begin{...