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

learn more… | top users | synonyms

14
votes
2answers
200 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 ...
11
votes
3answers
365 views

fancyvrb ShortVerb and tikz incompatibity

I've been working on a document that has a lot of little verbatim bits so I'm using fancyvrb \DeflneShortVerb{\|}. Now I want to add a tikz picture, and the whole thing fails. It there a simple way ...
11
votes
3answers
243 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 ...
11
votes
2answers
258 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} ...
11
votes
2answers
168 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 ...
8
votes
2answers
2k views

Background color for fancyvrb

For reasons unclear to me, fancyvrb doesn't have a background option. However, the minted package, which it is based on, has one, which suggests it should not be too difficult to add. The relevant ...
7
votes
4answers
245 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
81 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 @ ...
6
votes
2answers
204 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 ...
6
votes
1answer
624 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) ...
6
votes
2answers
63 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} ...
6
votes
1answer
802 views

Problem about program code included in LaTeX

I have some Matlab code which I would like to include in my LaTeX document. I use fancyvrb package, based on which I define a new environment called code. An complete and minimum example is: ...
6
votes
2answers
1k 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
141 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} ...
6
votes
1answer
397 views

Determine number of lines in a verbatim environment

I'm trying to implement two new key-value pairs for the fancyvrb package: head= and tail= specify how many lines to display: That is, head=10, tail=5 specifies to print the first 10 lines of the ...
5
votes
3answers
586 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.} ...
5
votes
1answer
93 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}‎‎ ‎‎ ...
5
votes
2answers
92 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} ...
5
votes
1answer
86 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 ...
5
votes
1answer
795 views

Colored line numbers with algorithmicx?

The fancyvrb allows me to customize line number style which I find very useful. I'm using it to give line numbers a different color and then use that same color in the text describing the code. I ...
5
votes
1answer
52 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, ...
5
votes
1answer
151 views

Retrieve em-width from another font

I’m trying to align verbatim segments with their outputs. Consider this MWE: \documentclass{article} \usepackage{lmodern} \usepackage{fancyvrb} ...
5
votes
1answer
197 views

fancyvrb and \overfullrule

I know I can use \overfullrule=5pt to get overfull lines marked with a black marker, but using the Verbatim environment from the fancyvrb package the overfull lines are not marked. For example, ...
5
votes
1answer
414 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 ...
4
votes
3answers
729 views

Error using \usepackage{fancyvrb, fancybox}

With TeX Live 2009, with this MWE. \documentclass{article} \usepackage{fancyvrb, fancybox} \begin{document} \begin{Verbatim}[frame=single] auto eth0 \end{Verbatim} \end{document} I ...
4
votes
2answers
106 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} ...
4
votes
1answer
2k views

inputenc error with unicode chars and verbatim

I am writing a package where I need to save the contents of several environments in verbatim mode to an auxiliary file. Then the auxiliary file is processed by an external program. In the next ...
4
votes
1answer
128 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 ...
4
votes
1answer
34 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
2answers
159 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. ...
4
votes
2answers
345 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} ...
4
votes
1answer
132 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 ...
4
votes
1answer
115 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
138 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 ...
3
votes
1answer
388 views

fancyvrb, helvetica and underscore… is it just me?

Ran into some weirdness with fancyvrb, helvetica and _. Here's a MWE (for me): \documentclass{article} \usepackage{fancyvrb} \begin{document} \begin{Verbatim}[fontfamily=helvetica] Oh no! It's a ...
3
votes
2answers
111 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
2answers
574 views

Reduce space between Sinput and Soutput

I'm using Sweave in the book document class, and I'm getting really huge spacing between Sinput and Soutput evironments. \documentclass[11pt]{book} \usepackage{Sweave} \usepackage{boxedminipage} ...
3
votes
1answer
321 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}|} ...
3
votes
1answer
518 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} ...
3
votes
1answer
935 views

New command using inline verbatim

I would like to define a command using verbatim like in the commented line in the following code. \documentclass{article} \usepackage{amsmath,amsfonts,amssymb} % ...
3
votes
1answer
27 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: ...
3
votes
1answer
156 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 ...
3
votes
1answer
565 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} ...
3
votes
1answer
280 views

How to set the Top Margin for a custom Verbatim environment (fancyvrb)

From the fancyvrb documentation, it looks like I can set left and right margins (paragraph 4.1.13) only. How can I set the top margin for my environment? More specifically, given that I have a frame ...
3
votes
2answers
718 views

“Missing number, treated as zero” with fancyvrb package

I was trying to use the package fancyvrb. However with \usepackage{breqn} \usepackage{fancyvrb} \DefineVerbatimEnvironment{code}{Verbatim}{fontsize=\small} ...
3
votes
1answer
134 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 ...
3
votes
1answer
142 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; } ...
3
votes
1answer
183 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} ...
3
votes
1answer
263 views

Moving from fancyvrb to listing – need to reconstruct my font settings

I have happily used the fancyvrb package with the Verbatim environment so far, but I want to change my figures to use the listing package with the lstlisting environment in order to have bold-faced ...
3
votes
1answer
232 views

fancybox conflict with fancyvrb? [duplicate]

Possible Duplicate: Error using \usepackage{fancyvrb, fancybox} I try to implement a simple environment to highlight source code in LaTeX. My solution is : use VerbatimOut to write text ...