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

learn more… | top users | synonyms

3
votes
1answer
33 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
149 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
136 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 ...
4
votes
2answers
127 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
120 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
255 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 ...
6
votes
2answers
434 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
128 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 ...
5
votes
2answers
316 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} ...
4
votes
1answer
47 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 ...
4
votes
1answer
64 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: ...
5
votes
1answer
134 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
267 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 ...
2
votes
0answers
130 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
218 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 ...
5
votes
1answer
75 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
62 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
67 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 ...
5
votes
1answer
124 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}‎‎ ‎‎ ...
9
votes
5answers
423 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 ...
7
votes
2answers
93 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
161 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
174 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
1k 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
253 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. ...
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
176 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
223 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
222 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; } ...
6
votes
2answers
2k 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
71 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} ...
4
votes
1answer
165 views

Tikz + Verbatim + Sphinx , output drawn twice with slight offset. Works great Tikz + Verbatim

I'm working on a piece of software that outputs IPython Notebooks as tex documents. One of my requirements is to be able to draw code input output blocks that look like the Notebook's UI. ...
4
votes
1answer
174 views

fancyvrb and multicols together

I am using fancyvrb to list code in a multicols situation. I number the code using: \begin{Verbatim}[numbers=left] When the code is in the left column, this is good, but not when it is in the right ...
3
votes
1answer
220 views

Color Text and BG of Verbatim, without affecting `fancyvrb` line numbers

The MWE below aims to color the text and background of a Verbatim environment. \documentclass{article} \usepackage{fancyvrb} \usepackage{color} \usepackage{calc} ...
2
votes
1answer
112 views

Customised counter macro in fancyvrb

I am using the fancyvrb package in LaTeX2e. I have chosen to display line numbers as I am displaying some code. (The code I am displaying is Maple, which unfortunately is not supported by the ...
1
vote
1answer
109 views

Extend keyword list for fancyvrb / listings, based on a given language

I use fancyvrb and listings packages, and I have defined a language scala, which is the default to use. In one occasion, I have an extension of that language, escala, which adds additional keywords. ...
3
votes
1answer
446 views

how to use fancyvrb Verbatim in tabularx?

When using tabular and p it is possible to insert Verbatim block in a table using minipage \documentclass[]{article}% \usepackage{fancyvrb} \begin{document} \begin{tabular}{|p{2in}|p{3in}|} ...
5
votes
1answer
171 views

How to make letter spacing in verbatim/fancyvrb look like listings

I've just noticed that the spacing between letters is different in verbatim vs. lstlisting environments: Given that I add the option columns=flexible to the lstlisting environment, the spacing in ...
1
vote
1answer
90 views

What is the counter name for verbments?

I'm trying to use the verbments package with the cleveref package. I need to find the name of the counter which is usually used for \ref{listing_label} to be able to define the name cleveref uses for ...
5
votes
2answers
437 views

Problem with hyphen in URL when using fancyvrb with hyperref

There seems to be a problem using a hyphen in a URL inside a fancyvrb Verbatim environment when using the hyperref package. The Problem The following document: \documentclass{article} ...
5
votes
3answers
778 views

Use sans-serif in a verbatim environment?

What is the right way get fancyvrb’s verbatim environment (or any other variation) to use \textsf as the font? I can do it with: \begin{Verbatim}[commandchars=\\\{\}] \textsf{Here’s some textsf.} ...
11
votes
2answers
314 views

How can I define a new minted environment with optional arguments?

I have the following mwe: % arara: pdflatex: { shell: true } % arara: pdflatex: { shell: true } \documentclass{article} \usepackage{minted} \usepackage{listings} \usepackage{caption} ...
1
vote
0answers
255 views

code-block directive causing error Empty verbatim environment [closed]

When I use directive .. code-block:: c in rst on Ubuntu 12.04 version and compile using latexpdf Error: (/usr/share/texmf-texlive/tex/latex/psnfss/t1pcr.fd) ! FancyVerb Error: Empty verbatim ...
3
votes
2answers
136 views

Babel spanish option and fancyvrb incompatibility

The following MWE compiles without problems \documentclass{article} \usepackage[english]{babel} \usepackage{amsmath} \usepackage{fancyvrb} \begin{document} \SaveVerb{x>y}|x > y| ...
3
votes
1answer
193 views

Block element characters (pmboxdraw) are shown too wide in verbatim and Verbatim (fancyvrb) environments

I want to put source code into verbatim and Verbatim (fancyvrb) environments that uses box-drawing characters from codepage 850 (0xDB, 0xDC, 0xDF) (see http://en.wikipedia.org/wiki/Code_page_850). By ...
4
votes
2answers
114 views

How to embed verbatim in pspicture?

I'm trying to insert a QR code at the beginning of my thesis with the contents being the BibTeX entry for it. Any way of embedding the raw text in \psbarcode? \documentclass[a4paper,12pt]{minimal} ...
2
votes
1answer
252 views

label for package: fancyvrb

I have a latex code for a computer program code like as specified in here. I want to write a label to this code. I searched for it but was unable to find how to add label for the source code. Any help ...
3
votes
1answer
680 views

Using math mode escapes with listings enabled fancyvrb

I am trying to escape math mode within Verbatim, using this answer. This works fine, until I use the listings package with fancyvrb=true \documentclass{article} \usepackage{fancyvrb} ...
5
votes
1answer
523 views

Combining DefineVerbatimEnvironment with UseVerbatim

I would like to combine the power of \DefineVerbatimEnvironment with \UseVerbatim within a combined beamer presentation and handout scenario. I have already defined the environment coding, and now I ...
3
votes
1answer
754 views

Using same font for \texttt and \Verb

I would like to configure my document to use exactly the same font for \texttt and \Verb. I got as far as this, which still misses making \ttdefault smaller: \documentclass{article} ...