Fancyvrb PDF
Fancyvrb PDF
Abstract This package provides very sophisticated facilities for reading and writing verbatim TEX code. Users can perform common tasks like changing font family and size, numbering lines, framing code examples, colouring text and conditionally processing text.
Contents
1 Introduction 2 Verbatim material in footnotes 3 Improved verbatim commands 4 Verbatim environments 4.1 Customization of verbatim environments . 4.1.1 Comments . . . . . . . . . . . . . . . . 4.1.2 Initial characters to suppress . . . . . 4.1.3 Customization of formatting . . . . . 4.1.4 Changing individual line formatting 4.1.5 Fonts . . . . . . . . . . . . . . . . . . . 4.1.6 Types and characteristics of frames . 1 3 3 4 4 4 4 5 5 6 6 7
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
4.1.7 Label for the environment . . . . . . . . . . 4.1.8 Line numbering . . . . . . . . . . . . . . . . . 4.1.9 Selection of lines to print . . . . . . . . . . . 4.1.10 Spaces and tab characters . . . . . . . . . . 4.1.11 Space between lines . . . . . . . . . . . . . . 4.1.12 Escape characters for inserting commands 4.1.13 Margins . . . . . . . . . . . . . . . . . . . . . 4.1.14 Overfull box messages . . . . . . . . . . . . 4.1.15 Page breaks . . . . . . . . . . . . . . . . . . . 4.1.16 Catcode characters . . . . . . . . . . . . . . . 4.1.17 Active characters . . . . . . . . . . . . . . . . 4.2 Different kinds of verbatim environments . . . . . 4.2.1 Verbatim environment . . . . . . . . . . . . 4.2.2 BVerbatim environment . . . . . . . . . . . . 4.2.3 LVerbatim environment . . . . . . . . . . . . 4.2.4 Personalized environments . . . . . . . . . .
. . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . .
9 10 12 13 14 14 15 16 16 16 16 17 17 17 17 18 18 20 21 21 22 22 22 23 23 23 23 24 27 28 29 34 34 36 38 39 44 60 62
5 Saving and restoring verbatim text and environments 6 Writing and reading verbatim les 7 Automatic pretty printing 8 Known problems 9 Thanks 10 Conclusion 11 Driver le 12 fancyvrb code 12.1 Preambule . . . . . . . . . . . . . . . 12.2 Errors . . . . . . . . . . . . . . . . . . 12.3 Verbatim footnotes . . . . . . . . . . 12.4 key=value . . . . . . . . . . . . . . . 12.5 Scanning . . . . . . . . . . . . . . . . 12.6 Codes . . . . . . . . . . . . . . . . . . 12.7 Preprocess line . . . . . . . . . . . . . 12.8 Scanning environments . . . . . . . 12.9 Check end . . . . . . . . . . . . . . . . 12.10Line-by-line scanning . . . . . . . . . 12.11Input . . . . . . . . . . . . . . . . . . . 12.12Formatting Common components 12.13List environments . . . . . . . . . . . 12.14BVerbatim . . . . . . . . . . . . . . . . 12.15Save verbatim . . . . . . . . . . . . .
. . . . . . . . . . . . . . .
. . . . . . . . . . . . . . .
. . . . . . . . . . . . . . .
. . . . . . . . . . . . . . .
. . . . . . . . . . . . . . .
. . . . . . . . . . . . . . .
. . . . . . . . . . . . . . .
. . . . . . . . . . . . . . .
. . . . . . . . . . . . . . .
. . . . . . . . . . . . . . .
. . . . . . . . . . . . . . .
. . . . . . . . . . . . . . .
. . . . . . . . . . . . . . .
. . . . . . . . . . . . . . .
. . . . . . . . . . . . . . .
. . . . . . . . . . . . . . .
. . . . . . . . . . . . . . .
. . . . . . . . . . . . . . .
. . . . . . . . . . . . . . .
. . . . . . . . . . . . . . .
. . . . . . . . . . . . . . .
. . . . . . . . . . . . . . .
63 64
1 Introduction
fancyvrb is the development of the verbatim macros of the fancybox package, Section 11 of [1]. It offers six kinds of extended functionality, compared to the standard A L TEX verbatim environment: 1. verbatim commands can be used in footnotes, 2. several verbatim commands are enhanced, 3. a variety of verbatim environments are provided, with many parameters to change the way the contents are printed; it is also possible to dene new customized verbatim environments, 4. a way is provided to save and restore verbatim text and environments, 5. there are macros to write and read les in verbatim mode, with the usual versatility, 6. you can build example environments (showing both result and verbatim text), with the same versatility as normal verbatim. The package works by scanning a line at a time from an environment or a le. This allows it to pre-process each line, rejecting it, removing spaces, numbering it, etc, before going on to execute the body of the line with the appropriate catcodes set.
_Yes!_
_verbatim_
\DefineShortVerb{\|} We can simply write \Verb+_verbatim_+ material using a single |_delimiter_| \UndefineShortVerb{\|} \DefineShortVerb{\+} And we can +_change_+ the character.
To make matters more versatile, we can nominate escape characters in verbatim text (using the \Verb macro or with a shortverb character dened), to perform formatting or similar tasks, using the commandchars parameter as shown for environments in paragraph 4.1.12.
4 Verbatim environments
Several verbatim environments are available, each with a lot of parameters to customize them. In the following examples we use the Verbatim environment, which is the equivalent of the standard verbatim. The parameters can be set globally using the \fvset macro or in an optional argument after the start of the environment2 ,3 .
1
2 3 4 5
\begin{Verbatim}[commentchar=!] % A comment Verbatim line. ! A comment that you will not see \end{Verbatim}
Take care to a special effect if the comment character is not the rst non blank one: it is because this character is in fact managed as the TEX comment one, that is to say that it gobble the newline character too. So, in this case, the current line will be joined with the next one and, more, the last one will be lost if it contain a comment, as fancyvrb print a line only after nding it end character, which will never occured in this case...
1 2
First line.
Second. 3
4 5
\begin{Verbatim}[commentchar=\%] First line. % First line Second. Third line. % Third line lost... \end{Verbatim}
gobble (integer) : number of characters to suppress at the beginning of each line (up
to a maximum of 9), mainly useful when environments are indented (Default: empty no character suppressed).
1 2 3
\begin{Verbatim} Verbatim line. \end{Verbatim} \begin{Verbatim}[gobble=2] Verbatim line. \end{Verbatim} \begin{Verbatim}[gobble=8] Verbatim line. \end{Verbatim}
4 5 6 7 8 9 10 11
formatcom (command) : command to execute before printing verbatim text (Default: empty).
4.1.4 Changing individual line formatting The macro \FancyVerbFormatLine denes the way each line is formatted. Its default value is \def\FancyVerbFormatLine#1{#1}, but we can redene it at our convenience (FancyVerbLine is the name of the line counter):
\renewcommand{\FancyVerbFormatLine}[1]{% \makebox[0cm][l]{$\Rightarrow$}#1} First verbatim line. 3 \begin{Verbatim} 4 First verbatim line. Second verbatim line. 5 Second verbatim line. Third verbatim line. 6 Third verbatim line. 7 \end{Verbatim}
1 2
1 2
3 4 5 6 7 8
\renewcommand{\FancyVerbFormatLine}[1]{% \ifodd\value{FancyVerbLine}% \MakeUppercase{#1}\else#1\fi} \begin{Verbatim} First verbatim line. Second verbatim line. Third verbatim line. \end{Verbatim}
4.1.5 Fonts
fontfamily (family name) : font family to use. tt, courier and helvetica are
pre-dened (Default: tt).
Verbatim line.
2 3
fontsize (font size) : size of the font to use (Default: auto the same as the current font). If you use the relsize package too, you can require a change of the size proportional to the current one (for instance: fontsize=\relsize{-2}).
1 2
Verbatim line.
3 4 5 6 7 8
Verbatim line.
fontshape (font shape) : font shape to use (Default: auto the same as the current
font).
Verbatim line.
2 3 4
A fontseries (series name) : L TEX font series to use (Default: auto the same as the
current font).
Verbatim line.
2 3 4
frame (none|leftline|topline|bottomline|lines|single) : type of frame around the verbatim environment (Default: none no frame). With leftline and single modes, A a space of a length given by the L TEX \fboxsep macro is added between the
left vertical line and the text.
1 2 3 4
\begin{Verbatim}[frame=leftline] Verbatim line. \end{Verbatim} \begin{Verbatim}[frame=topline] Verbatim line. \end{Verbatim} \begin{Verbatim}[frame=bottomline] Verbatim line. \end{Verbatim} \begin{Verbatim}[frame=lines] Verbatim line. \end{Verbatim} \begin{Verbatim}[frame=single] Verbatim line. \end{Verbatim}
5 6 7 8 9 10 11
12 13 14 15 16 17 18 19
framerule (dimension) : width of the rule of the frame (Default: 0.4pt if framing
specied).
Verbatim line.
2 3 4
framesep (dimension) : width of the gap between the frame and the text (Default: \fboxsep).
1
Verbatim line.
2 3 4
A rulecolor (color command) : color of the frame rule, expressed in the standard L TEX
Verbatim line.
2 3 4
llcolor (color command) : color used to ll the space between the frame and the text (its thickness is given by framesep) (Default: none no color).
1 2
Verbatim line.
3 4 5 6
3 4 5 6 7
\fvset{gobble=2} \begin{Verbatim}[frame=single, label=My text] First verbatim line. Second verbatim line. \end{Verbatim} \begin{Verbatim}[frame=topline, framesep=4mm, label=\fbox{\Large\emph{The code}}] First verbatim line. Second verbatim line. \end{Verbatim}
The code
First verbatim line. Second verbatim line.
8 9 10 11 12 13
is dened, which must be coherent with the kind of frame chosen (Default: none if the label is empty, topline if one label is dened and all if two are dened). Of course, some incompatible options (like frame=topline,labelposition=bottomline) will not print the label.
1 2
Text First verbatim line. Second verbatim line. Text Text First verbatim line. Second verbatim line.
3 4 5 6 7 8 9 10 11 12 13
\fvset{gobble=2} \begin{Verbatim}[frame=single, framesep=2mm, label=Text,labelposition=all] First verbatim line. Second verbatim line. \end{Verbatim} \begin{Verbatim}[frame=lines, label=Text,labelposition=topline] First verbatim line. Second verbatim line. \end{Verbatim}
1 2 3
\begin{Verbatim}[frame=bottomline, framesep=3mm, label=\textit{Code included}, labelposition=bottomline] First verbatim line. Second verbatim line. \end{Verbatim}
Beginning of code 8 First verbatim line. 9 \begin{Verbatim}[frame=lines, framesep=3mm, Second verbatim line. 10 End of code 11 label={[Beginning of code]End of code}] 12 First verbatim line. 13 Second verbatim line. 14 \end{Verbatim}
10
1 2
1 2
First verbatim line. Second verbatim line. First verbatim line. Second verbatim line.
1
3 4 5 6 7 2 8 9 10
\begin{Verbatim}[gobble=2,numbers=left] First verbatim line. Second verbatim line. \end{Verbatim} \begin{Verbatim}[gobble=2, numbers=right,numbersep=0pt] First verbatim line. Second verbatim line. \end{Verbatim}
numbersep (dimension) : gap between numbers and verbatim lines (Default: 12pt).
1
1 2
2 3 4 5
rstnumber (auto|last|integer) : number of the rst line (Default: auto numbering starts from 1). last means that the numbering is continued from the previous verbatim environment. If an integer is given, its value will be used to start the numbering.
1 2 3 4 1
5 6
\fvset{gobble=2, numbers=left,numbersep=3pt} \begin{Verbatim} Verbatim line. \end{Verbatim} \begin{Verbatim}[firstnumber=last] Verbatim line. \end{Verbatim} \begin{Verbatim}[firstnumber=100] Verbatim line. \end{Verbatim}
7 8
100
9 10 11 12 13
stepnumber (integer) : interval at which line numbers are printed (Default: 1 all
lines are numbered).
11
2 3 4 5 6
\begin{Verbatim}[gobble=2,numbers=left, numbersep=3pt,stepnumber=2] First verbatim line. Second verbatim line. Third verbatim line. \end{Verbatim}
The macro \theFancyVerbLine denes the typesetting style of the numbering, and the counter used is FancyVerbLine:
1 2 3
8.a First verbatim line. 8.b Second verbatim line. 8.c Third verbatim line.
4 5 6 7 8 9
\renewcommand{\theFancyVerbLine}{% \textcolor{red}{\small 8.\alph{FancyVerbLine}}} \begin{Verbatim}[gobble=2, numbers=left,numbersep=2pt] First verbatim line. Second verbatim line. Third verbatim line. \end{Verbatim}
1 2 1
3 4 5
\begin{Verbatim}[gobble=2,numbers=left, numbersep=3pt, numberblanklines=false] First verbatim line. Second verbatim line. \end{Verbatim}
6 7 8
rstline (integer) : rst line to print (Default: empty all lines from the rst are
printed).
12
1 2 2 3
3 4 5 6
\begin{Verbatim}[gobble=2,firstline=2, numbers=left,numbersep=2pt] First verbatim line. Second verbatim line. Third verbatim line. \end{Verbatim}
lastline (integer) : last line to print (Default: empty all lines until the last one are
printed).
1 2
3 4 5 6
\begin{Verbatim}[gobble=2,lastline=1, numbers=left,numbersep=2pt] First verbatim line. Second verbatim line. Third verbatim line. \end{Verbatim}
Instead of specifying a rstline at which to start printing a range of lines, you can dene a start string; the start of the range is the rst line that exactly equals the string. (The comparison is made before any characters are gobbled off the front of the line.) Similarly for a stop string. You can mix line-numbers and strings, e.g. start at rstline, and end at a stop string. Specifying the strings is a bit klunky. Initially you must dene the strings with \newcommand* as in: Second verbatim line.
1 2 3 4 5 6 7 8 9
\newcommand*\FancyVerbStartString{FROM} \newcommand*\FancyVerbStopString{TO} \begin{Verbatim}[gobble=2] First verbatim line. FROM Second verbatim line. TO Third verbatim line. \end{Verbatim}
To redene the strings, you must use \renewcommand*. 4.1.10 Spaces and tab characters
Verbatimline.
2 3
13
Verbatimline.
2 3
There are also some parameters to determine the way tab characters are interpreted (using tabs is in fact a rather old-fashioned style of coding):
showtabs (boolean) : explicitly show tab characters (Default: false tab characters
not shown).
obeytabs (boolean) : position characters according to the tabs (Default: false tab
characters are added to the current position).
parameter (Default: auto its current value just before the verbatim command).
1 2 3
4.1.12
\begin{Verbatim}[commandchars=\\\{\}] \textit{% This is a comment} First verbatim line. % This is a comment 3 \fbox{Second} verbatim line. First verbatim line. 4 5 \textcolor{red}{Third} verbatim line. Second verbatim line. Third verbatim line. 6 \end{Verbatim}
1 2 7
14
Using this way, it is also possible to put labels to be able, later, to make reference to some lines of the verbatim environments:
1
1 2 3
2 3 4 5 6 7 8 9
\begin{Verbatim}[commandchars=\\\{\}, numbers=left,numbersep=2pt] First verbatim line. Second line.\label{vrb:Important} Third verbatim line. \end{Verbatim} As I previously shown line~\ref{vrb:Important}, it is...
4.1.13
Margins
xleftmargin (dimension) : indentation to add at the start of each line (Default: 0pt
no left margin).
Verbatim line.
2 3 4
xrightmargin (dimension) : right margin to add after each line (Default: 0pt no
right margin).
Verbatim line.
2 3 4
resetmargins (boolean) : reset the left margin, which is useful if we are inside other
indented environments (Default: false no reset of the margin).
15
First item
2 3 4 5 6
Verbatim line.
Second item
7 8
Verbatim line.
9 10 11
\begin{itemize} \item First item \begin{Verbatim}[frame=single] Verbatim line. \end{Verbatim} \item Second item \begin{Verbatim}[frame=single, resetmargins=true] Verbatim line. \end{Verbatim} \end{itemize}
4.1.14
hfuzz (dimension) : value to give to the TEX \hfuzz dimension for text to format.
This can be used to avoid seeing some unimportant Overfull box messages (Default: 2pt). 4.1.15 Page breaks
samepage (boolean) : in very special circumstances, we may want to make sure that
a verbatim environment is not broken, even if it does not t on the current page. To avoid a page break, we can set the samepage parameter to true (Default: false). 4.1.16 Catcode characters
x=1/sqrt(z**2) !
1 z2
2 3 4
4.1.17
Active characters
16
boxwidth (auto|dimension) : size of the box used (Default: auto the width of the
longest line is used).
baseline (b|c|t) : position of the baseline (on the baseline, the center or the top
of the box) (Default: b).
1 2 3
4 5 6 7 8 9
\fvset{gobble=2} \begin{BVerbatim} First Second \end{BVerbatim} \begin{BVerbatim}[baseline=c] First Second \end{BVerbatim} \begin{BVerbatim}[boxwidth=2cm] First Second \end{BVerbatim} \begin{BVerbatim}[boxwidth=2cm, baseline=t] First Second \end{BVerbatim}
1 2 3
First Second
First Second
5 6 7 8 9
17
4.2.4 Personalized environments It is easy to dene personal customized environments. You can redene the existing ones using the \RecustomVerbatimEnvironment macro or create your own ones, using the \DefineVerbatimEnvironment macro4 . In each case, you specify the name of the new environment, the type of environment on which it is based, and a set of initial option values. The options can be overridden with an optional argument in the normal way:
1 2
3 4 5 6 7
\RecustomVerbatimEnvironment {Verbatim}{Verbatim} {gobble=2,frame=single} \begin{Verbatim} First verbatim line. Second verbatim line. \end{Verbatim} \DefineVerbatimEnvironment% {MyVerbatim}{Verbatim} {gobble=2,numbers=left,numbersep=2mm, frame=lines,framerule=0.8mm} \begin{MyVerbatim} First verbatim line. Second verbatim line. \end{MyVerbatim} \begin{MyVerbatim}[numbers=none, framerule=1pt] First verbatim line. Second verbatim line. \end{MyVerbatim}
1 2 3 4 1 2
5 6 7 8
9 10 11 12 13 14
\RecustomVerbatimCommand{\VerbatimInput}{VerbatimInput}{frame=lines}
18
I have saved _verbatim_ and reuse it later as many times as I want _verbatim_.
1 2 3 4 5
\DefineShortVerb{\|} \SaveVerb{Verb}|_verbatim_| I have saved \UseVerb{Verb} and reuse it later as many times as I want \UseVerb{Verb}.
A This also provides a solution to putting verbatim text inside L TEX commands which do not normally permit it:
1 2 3
_OK^
1 2
\MyCommand :
mand
my com-
3 4 5 6 7
In the same way, we can use and restore (in normal, boxed and LR mode, using
Verbatim line.
and
1 2 3 4
Verbatim line.
19
1 2 3 4 5 6 7 8
\begin{SaveVerbatim}[gobble=5]{VerbEnv} First Second \end{SaveVerbatim} \fbox{\BUseVerbatim{VerbEnv}} and \BUseVerbatim{VerbEnv}. \LUseVerbatim{VerbEnv} and \LUseVerbatim{VerbEnv}
st ond
9 10
1 2
\fvset{fontsize=\small} \VerbatimInput{hello.f90} \fvset{frame=single,numbers=left, numbersep=3pt} \VerbatimInput{hello.f90} \VerbatimInput[firstline=3, rulecolor=\color{green}] {hello.f90} \VerbatimInput[frame=lines, fontshape=sl,fontsize=\footnotesize] {hello.f90}
! A "hello" program program hello print *,"Hello world" end program hello program hello print *,"Hello world" end program hello
3 4 5 6 7 8
3 4 5
9 10 11 12 13
1 2 3 4 5
! A "hello" program program hello print *,"Hello world" end program hello
14
We can make use of the deneactive parameter to set the comment lines in the program text in a different style:
20
! A "hello" program
2 3
It is important to note that if the contents of the le does not t on the page, it will be automatically broken across pages as needed (unless the samepage parameter has been set to true). There is also a VerbatimOut environment to write verbatim text to an output le, in the same way:
1 2
1 2
3 4 5 6 7
8 Known problems
Vladimir VOLOVICH <[email protected]> reported that the special character \th, available with T1 encoding, cant be included as verbatim with fancyvrb. It can be true for other special characters too.
21
9 Thanks
For interesting comments and suggestions, we would like to thank specially (alphabetic order): Philippe ESPERET [email protected], Michael FRIENDLY [email protected], Rolf NIEPRASCHK niepraschk@ gmx.de and for bug reports Mario HASSLER [email protected], Mikhail KOLODIN [email protected], Andreas Matthias, Ulrich M. Schwarz, and Vladimir VOLOVICH <[email protected]>.
10 Conclusion
There are a few other possibilities that we have not described here. Note specially that it is possible to dene a customization le (fancyvrb.cfg) loaded at the end of the package, to store denitions of your customized commands and environments and to redene the attributes of existing ones.
References
A [1] Timothy VAN ZANDT, Documentation for fancybox: Box tips and tricks for L TEX. Available from CTAN: macros/latex/contrib/supported/fancybox, 1993.
[2] Timothy
VAN
macros/latex/contrib/supported/fancyvrb, 1998.
[3] Various authors (current maintainer: Michael PIEFEL), The LGrind package. Available from CTAN: support/lgrind, 1998. [4] Carsten HEINZ , The Listings package. Available from
CTAN:
macros/latex/contrib/supported/listings, 1996-1997.
11 Driver le
The next bit of code contains the documentation driver le for TEX, i.e., the le that will produce the documentation you are currently reading. It will be extracted from this le by the docstrip program.
1 driver 2 \documentclass{ltxdoc} 3 \GetFileInfo{fancyvrb.dtx} 4 \usepackage{color} 5 \usepackage{fancyvrb,shortvrb} 6 \usepackage[T1]{fontenc} 7 \usepackage[latin1]{inputenc} 8 \usepackage[charter]{mathdesign}
22
{\ChangeBartrue\usepackage[dvips,rightbars]{changebar}}{}
% Comment it for implementation details % Uncomment if your MakeIndex is pre-0.9 % Over and under full box warnings
\DocInput{fancyvrb.dtx}
22 \end{document} 23 /driver
12 fancyvrb code
<*fancyvrb>
12.1 Preambule
What we need. 24 \NeedsTeXFormat{LaTeX2e} Who we are.
25 \def\fileversion{2.7a,
26 \def\filedate{2008/02/07} 27 \ProvidesPackage{fancyvrb}[\filedate]
28 \message{Style
12.2 Errors
31 \def\FV@Error#1#2{% 32 33 34 35 \def\FV@eha{Your
\edef\@tempc{#2}\expandafter\errhelp\expandafter{\@tempc}% \errmessage{FancyVerb Error:^^J\space\space #1^^J}} command was ignored. Type <return> to continue.}
\VerbatimFootnotes
36 %% 37 %%
DG/SR modification begin - Jan. 21, 1998 Suggested by Bernard Gaulle to solve a compatibility problem with french 38 %% (it introduce the restriction to put \VerbatimFootnotes AFTER the preambule) 39 %%\def\VerbatimFootnotes{\let\@footnotetext\V@footnotetext} 40 \let\V@footnote\footnote 41 \def\VerbatimFootnotes{% 42 \let\@footnotetext\V@footnotetext% 43 \let\footnote\V@footnote} 44 %% DG/SR modification end
\V@footnotetext
45 \long\def\V@footnotetext{% 46 47
\afterassignment\V@@footnotetext \let\@tempa}
\V@@footnotetext
48 \def\V@@footnotetext{% 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
\insert\footins\bgroup \csname reset@font\endcsname \footnotesize \interlinepenalty\interfootnotelinepenalty \splittopskip\footnotesep \splitmaxdepth\dp\strutbox \floatingpenalty \@MM \hsize\columnwidth \@parboxrestore \edef\@currentlabel{\csname p@footnote\endcsname\@thefnmark}% \@makefntext{}% \rule{\z@}{\footnotesep}% \bgroup \aftergroup\V@@@footnotetext \ignorespaces}
\V@@@footnotetext
64 \def\V@@@footnotetext{\strut\egroup}
12.4 key=value
65 \RequirePackage{keyval}
Extensions to keyval.sty:
\define@booleankey{<family>}{<key>}{<iftrue>}{<iffalse>} Denes a <key> for <family> that executes: <iftrue> clause when value begins with t or T, or is omitted. <iffalse> clause otherwise.
\define@booleankey
66 \def\define@booleankey#1#2#3#4{% 67
\@namedef{KV@#1@#2@default}{#3}%
24
68 69
\@namedef{KV@#1@#2@false}{#4}% \@namedef{KV@#1@#2}##1{\KV@booleankey{##1}{#1}{#2}}}
\KV@booleankey
70 \def\KV@booleankey#1#2#3{% 71
\edef\@tempa{#1}\expandafter\KV@@booleankey\@tempa\relax\@nil{#2}{#3}}
\KV@@booleankey
72 \def\KV@@booleankey#1#2\@nil#3#4{% 73
\FV@None
74 \def\FV@None{none}
\FV@Auto
75 \def\FV@Auto{auto}
\fvset
76 \def\fvset#1{\setkeys{FV}{#1}}
\FV@Command
77 \def\FV@Command#1#2{% 78 79 80
\FV@@Command
81 \def\FV@@Command#1{% 82 83 84
\FV@GetKeyValues
85 \def\FV@GetKeyValues#1[#2]{% 86
\expandafter\def\expandafter\FV@KeyValues\expandafter{\FV@KeyValues,#2}#1}
25
\@CustomVerbatimCommand
87 \def\@CustomVerbatimCommand#1#2#3#4{%
\begingroup\fvset{#4}\endgroup % If there are errors, it easier to locate. DG/SR modification begin - Jan. 13, 1998 90 %% \def\@tempa##1##2\@nil{\def\@tempa{##2}}% 91 %% \expandafter\@tempa\string#3\@empty\@nil 92 %% \@ifundefined{FVC@\@tempa}% 93 \@ifundefined{FVC@#3}% 94 %% DG/SR modification end 95 {\FV@Error{Command \string#3 is not a FancyVerb command.}\@eha}% 96 {#1{#2}{\FV@Command{#4}{#3}}}}
88 89 %%
\CustomVerbatimCommand
97 \def\CustomVerbatimCommand{\@CustomVerbatimCommand\newcommand}
\RecustomVerbatimCommand
98 \def\RecustomVerbatimCommand{\@CustomVerbatimCommand\renewcommand}
\FV@Environment
99 \def\FV@Environment#1#2{% 100 101 102 103 104
\CustomVerbatimEnvironment
105 \def\CustomVerbatimEnvironment{\@CustomVerbatimEnvironment\newenvironment}
26
\RecustomVerbatimEnvironment
106 \def\RecustomVerbatimEnvironment{\@CustomVerbatimEnvironment\renewenvironment}
\@CustomVerbatimEnvironment
107 \def\@CustomVerbatimEnvironment#1#2#3#4{% 108 109 110 111 112
\begingroup\fvset{#4}\endgroup % If there are errors, it easier to locate. \@ifundefined{FVB@#3}% {\FV@Error{#3 is not a FancyVerb environment.}\@eha}% {#1{#2}{\FV@Environment{#4}{#3}}{\@nameuse{FVE@#3}}% #1{#2*}{\FV@Environment{#4,showspaces}{#3}}{\@nameuse{FVE@#3}}}}
\DefineVerbatimEnvironment
113 \def\DefineVerbatimEnvironment#1#2#3{% 114 115 116 117
Then commands or environments set key values with \FV@UseKeyValues, within a group.
\FV@UseKeyValues
118 \def\FV@UseKeyValues{% 119 120 121 122 123
12.5 Scanning
Scanning macros: read a line at a time from an environment or a le, save the line in \FV@Line, and execute \FV@PreProcessLine.
\FV@PreProcessLine:
Determines whether line is in a user-specied ranges, and if so, Strips the line of a user-specied no. of tokens, and Executes \FV@ProcessLine{<line>}. Two things are common to scanning an environment or reading a le: \FV@CatCodes = Change \catcodes. \FV@PreProcessLine = See above. 27
12.6 Codes
\FV@CatCodes
124 \def\FV@CatCodes{% 125 126 127 128 129
% % % % %
The usual stuff. See below. See below. A style hook. A user-defined hook.
\FV@ActiveWhiteSpace
130 \def\FV@ActiveWhiteSpace{% 131 132 133
\FV@CatCodesHook
134 \def\FV@CatCodesHook{}
\FV@AddToHook
135 \def\FV@AddToHook#1#2{% 136
\expandafter\def\expandafter#1\expandafter{#1#2\relax}}
\FancyVerbCodes
137 \define@key{FV}{codes}[]{\def\FancyVerbCodes{#1\relax}} 138 \define@key{FV}{codes*}{% 139
\FV@DefineCommandChars
149 \def\FV@DefineCommandChars#1#2#3{% 150 151
\def\FV@CommandChars{% \catcode#1=0\relax\catcode#2=1\relax\catcode#3=2\relax}}
152 \FV@AddToHook\FV@CatCodesHook\FV@CommandChars
28
\FV@CommentChar
153 \define@key{FV}{commentchar}[\%]{% 154 155 156 157 158 159
\afterassignment\FV@ParseStart\@tempcnta=0#1\relax\@nil{#1}}
\FV@ParseStart
164 \def\FV@ParseStart#1\relax\@nil#2{% 165 166 167 168 169 170
\KV@FV@firstline@default
171 \def\KV@FV@firstline@default{% 172 173
\FV@ParseStop
176 \def\FV@ParseStop#1\relax\@nil#2{% 177 178
\ifx\@nil#1\@nil \edef\FancyVerbStopNum{\the\@tempcnta}%
29
\KV@FV@lastline@default
183 \def\KV@FV@lastline@default{% 184 185
\let\FancyVerbStopNum\z@ \let\FancyVerbStopString\relax}
\FV@PreProcessLine
188 \def\FV@PreProcessLine{% 189 190
\global\advance\FV@CodeLineNo\@ne \FV@FindStartStop}
\FV@@PreProcessLine
191 \def\FV@@PreProcessLine{% 192 193 194
The denition of \FV@FindStartStop changes, so that we dont have to check irrelevant conditions with each line. Heres how it works; for simplicity we assume firstline and lastline have been specied, rather than start or stop strings. The rst time \FV@FindStartStop is called: 1. It calls \FV@DefineFindStart. (The name roughly means "dene \FV@FindStartStop to detect when weve reached the start of the specied range".) This checks the range parameters that have been specied, and then redenes \FV@FindStartStop (yes, the function that has called this code) to contain only the necessary checks, for efciency reasons: If we havent printed any lines yet, which is true when \FV@FindStartStop is rst called, we only need to check the current line-number against firstline, so we redene \FV@FindStartStop to be \FV@FindStartNum. If firstline isnt set, we only have to check the current line-number against lastline, so we redene \FV@FindStartStop to be \FV@DefineFindStop. (The name roughly means "dene \FV@FindStartStop to detect when weve reached the stop (end) of the specied range", but unlike the START case, it includes code (\FV@@PreProcessLine) to print the current line.) 30
2. It then calls the newly-dened \FV@FindStartStop to see if the current line being processed is within the range to be printed.
\FV@FindStartStop is redened once as described above, but it can be redened again: 1. When we have reached firstline, i.e. have entered the range to be printed, we redene \FV@FindStartStop to be \FV@DefineFindStop. (We know weve reached the start, so theres no point checking that again on future calls.) 2. When we reach lastline and have printed it, we wont want to print any more lines, so we redene \FV@FindStartStop to \relax so we do nothing (and do it efciently). Note that when firstline = lastline (= 6, say), it is \FV@FindStartNum (which \FV@FindStartStop has initially been redened to) that notices when we reach line 6, and prints it, and redenes \FV@FindStartStop to be \FV@DefineFindStop. Then we read line 7, so \FV@DefineFindStop has to check whether weve passed lastline, and therefore shouldnt print the current line, before redening \FV@FindStartStop to \relax as explained above. By contrast, when firstline is less than lastline (= 6, 8, say), when we reach line 8, \FV@DefineFindStop sees that were at the end of the range, and does print the line, before redening \FV@FindStartStop to \relax as above. This slight weirdness is because several of the macros are dening themselves and one another, resulting in a slightly weird execution ow.
\FV@FindStartStop
195 \def\FV@FindStartStop{\FV@DefineFindStart\FV@FindStartStop} 196 %% 197 %%
31
\FV@FindStartNum
209 \def\FV@FindStartNum{% 210 211 212 213
\FV@FindStartString
214 %% 216
215 \def\FV@FindStartString{%
\expandafter\FV@@FindStartString
\FV@@FindStartString
220 \def\FV@@FindStartString#1#2{% 221 \edef\@fooA{#1}\edef\@fooB{#2}% 222 223 224 225 } 226 %%
\FV@DefineFindStop
227 \def\FV@DefineFindStop{% 228 229 230 231 232 233 234 235 236
\FV@FindStopNum
237 \def\FV@FindStopNum{% 238 239 240 241 242 243 244 245 246 247 248
\ifnum\FancyVerbStopNum>\FV@CodeLineNo \else \let\FV@FindStartStop\relax \ifeof\FV@InFile\else \immediate\closein\FV@InFile \fi \fi \ifnum\FancyVerbStopNum<\FV@CodeLineNo \else \FV@@PreProcessLine \fi}
32
\FV@FindStopString
249 %% 251
250 \def\FV@FindStopString{%
\expandafter\FV@@FindStopString
\FV@@FindStopString
255 \def\FV@@FindStopString#1#2{% 256 \edef\@fooA{#1}\edef\@fooB{#2}%
\ifx\@fooA\@fooB \let\FV@FindStartStop\relax 259 \ifeof\FV@InFile\else 260 \immediate\closein\FV@InFile 261 \fi 262 \else 263 \expandafter\FV@@PreProcessLine 264 \fi} 265 %% SR modification end
257 258
Gobblings. \FV@Gobble does nothing, or strips some tokens from the line and A stores the result in \FV@Line again. We use L TEXs \renewcommand to dene a command for gobbling up to 9 arguments. This is not the same as removing 9 tokens, but is easier.
\FV@@Gobble
266 \def\FV@@Gobble{% 267 268 269
\FV@@@Gobble
270 \def\FV@@@Gobble#1\@nil#2\@@nil{\def\FV@Line{#1}}
\FV@Gobble
271 \define@key{FV}{gobble}{% 272 273 274 275 276 277 278 279 280 281 282
\@tempcnta=#1\relax \ifnum\@tempcnta<\@ne \let\FV@Gobble\relax \else \ifnum\@tempcnta>9 \FV@Error{gobble parameter must be less than 10}\FV@eha \else \renewcommand{\FV@@@@Gobble}[\@tempcnta]{}% \let\FV@Gobble\FV@@Gobble \fi \fi}
33
\FV@@@@Gobble
283 \def\FV@@@@Gobble{}
\KV@FV@gobble@default
284 \def\KV@FV@gobble@default{\let\FV@Gobble\relax} 285 \fvset{gobble}
\VerbatimEnvironment:
This saves the name of the current environment as \FV@EnvironName, if the latter is not already dened. Then \FV@CheckEnd knows how to nd the end as long as either: \begin and \end are not used within the denition of the environment, OR \VerbatimEnvironment is used in the denition before the rst \begin.
\VerbatimEnvironment
291 \def\VerbatimEnvironment{% 292
\ifx\FV@EnvironName\relax\xdef\FV@EnvironName{\@currenvir}\fi}
293 \let\FV@EnvironName\relax
!def!FV@CheckEnd#1[!FV@@CheckEnd#1\end{}!@nil]
If have their usual catcodes, we dene:
!def!FV@@CheckEnd#1\end#2#3!@nil[!def!@tempa[#2]]
34
!def!FV@@CheckEnd#1\end{#2}#3!@nil[!def!@tempa[#2]]
294 \begingroup 295 \catcode\!=0 296 \catcode\[=1 297 \catcode\]=2
Case i:
298 !gdef!FV@CheckEnd@i#1[!FV@@CheckEnd#1\end{}!@nil] 299 !gdef!FV@@CheckEnd@i#1\end#2#3!@nil[!def!@tempa[#2]!def!@tempb[#3]] 300 !gdef!FV@@@CheckEnd@i[\end{}]
Case ii:
301 \catcode!\=12 302 303 !gdef!FV@CheckEnd@ii#1[!FV@@CheckEnd#1\end{}!@nil] 304 !gdef!FV@@CheckEnd@ii#1\end#2#3!@nil[!def!@tempa[#2]!def!@tempb[#3]] 305 !gdef!FV@@@CheckEnd@ii[\end{}]
Case iii:
306 !catcode!{=12 307 !catcode!}=12 308 309 !gdef!FV@CheckEnd@iii#1[!FV@@CheckEnd#1\end{}!@nil] 310 !gdef!FV@@CheckEnd@iii#1\end{#2}#3!@nil[!def!@tempa[#2]!def!@tempb[#3]] 311 !gdef!FV@@@CheckEnd@iii[\end{}]
Case iv:
312 !catcode!\=0 313 314 !gdef!FV@CheckEnd@iv#1[!FV@@CheckEnd#1\end{}!@nil] 315 !gdef!FV@@CheckEnd@iv#1\end{#2}#3!@nil[!def!@tempa[#2]!def!@tempb[#3]] 316 !gdef!FV@@@CheckEnd@iv[\end{}] 317 \endgroup
\FV@BadCodes
318 \def\FV@BadCodes#1{% 319 320 321 322 323 324 325 326
\FV@Error {\string\catcode\space of \expandafter\@gobble\string#1 is wrong: \the\catcode#1}% {Only the following catcode values are allowed: ^^J\@spaces \expandafter\@gobble\string\\ \space\space --> 0 or 12. ^^J\@spaces \string{ \string} --> 1 and 2, resp., or both 12. ^^JTo get this error, either you are a hacker or you got bad advice.}% \def\FV@CheckEnd##1{\iftrue}}
\FV@DefineCheckEnd
327 \def\FV@DefineCheckEnd{% 328
\ifnum\catcode\\=\z@
35
329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360
\ifnum\catcode\{=\@ne \let\FV@CheckEnd\FV@CheckEnd@i \let\FV@@CheckEnd\FV@@CheckEnd@i \let\FV@@@CheckEnd\FV@@@CheckEnd@i \else \ifnum\catcode\{=12 \let\FV@CheckEnd\FV@CheckEnd@iv \let\FV@@CheckEnd\FV@@CheckEnd@iv \let\FV@@@CheckEnd\FV@@@CheckEnd@iv \else \FV@BadCodes\{% \fi \fi \else \ifnum\catcode\\=12 \ifnum\catcode\{=\@ne \let\FV@CheckEnd\FV@CheckEnd@ii \let\FV@@CheckEnd\FV@@CheckEnd@ii \let\FV@@@CheckEnd\FV@@@CheckEnd@ii \else \ifnum\catcode\{=12 \let\FV@CheckEnd\FV@CheckEnd@iii \let\FV@@CheckEnd\FV@@CheckEnd@iii \let\FV@@@CheckEnd\FV@@@CheckEnd@iii \else \FV@BadCodes\{% \fi \fi \else \FV@BadCodes\\% \fi \fi}
\FV@BeginScanning
361 \begingroup 362 \catcode\^^M=\active
\FV@BadBeginError
367 \def\FV@BadBeginError#1{% 368 369
\expandafter\@temptokena\expandafter{\@tempa}% \FV@Error
36
{Extraneous input \the\@temptokena between \string\begin{\FV@EnvironName}[<key=value>] and line end}% {This input will be discarded. Hit <return> to continue.}}
If \FancyVerbGetLine does not nd a ^^M, then we are at the end of the le, and \FV@EOF attempts to terminate the document. Otherwise, \FV@EOF is gobbled by \FancyVerbGetLine.
\FV@GetLine
373 %% 374 %%
DG/SR modification begin - May. 18, 1998 (added code to turn off ligatures) \def\FV@GetLine{\expandafter\FV@CheckScan\FancyVerbGetLine} 375 \def\FV@GetLine{\@noligs\expandafter\FV@CheckScan\FancyVerbGetLine} 376 %% DG/SR modification end
\FancyVerbGetLine
377 \begingroup 378 \catcode\^^M=\active 379 \gdef\FancyVerbGetLine#1^^M{%
\@nil% \FV@CheckEnd{#1}% 382 \ifx\@tempa\FV@EnvironName% % True if end is found 383 \ifx\@tempb\FV@@@CheckEnd\else\FV@BadEndError\fi% 384 \let\next\FV@EndScanning% 385 \else% 386 \def\FV@Line{#1}% 387 \def\next{\FV@PreProcessLine\FV@GetLine}% 388 \fi% 389 \next}% 390 \endgroup
380 381
\FV@BadEndError
391 \def\FV@BadEndError{% 392 393 394 395 396
\expandafter\@temptokena\expandafter{\@tempb}% \FV@Error {Extraneous input \the\@temptokena between \string\end{\FV@EnvironName} and line end}% {This input will be discarded. Type <return> to continue.}}
\FV@EndScanning
397 \def\FV@EndScanning{% 398 399 400
401 \@ifundefined{@currenvline}{\let\@currenvline\@empty}{}
\FV@CheckScan
402 \def\FV@CheckScan#1{\@ifnextchar\@nil{\@gobble}{\FV@EOF}} 403 \def\FV@CheckScan#1{\ifx\@nil#1\@empty\else\expandafter\FV@EOF\fi}
37
\FV@EOF
404 \def\FV@EOF{% 405 406 407 408 409 410 411
\FV@Error{Couldnt find \string\end{\FV@EnvironName} to end a verbatim environment\@currenvline.}% {Probably you mistyped the environment name or included an extraneous ^^Jspace, or are using an improperly defined verbatim environment. ^^JHit return and I will try to terminate this job.}% \FV@EndScanning \end{document}}
12.11 Input
412 \newread\FV@InFile
\FV@Input
413 \def\FV@Input#1{% 414 415 416 417 418 419 420 421
\immediate\openin\FV@InFile #1\relax \ifeof\FV@InFile \FV@Error{No verbatim file #1}\FV@eha \immediate\closein\FV@InFile \else \FV@CatCodes \expandafter\FV@@Input \fi}
TEX reports EOF when reading after the last newline character. Thus, we read to InLine, and if TEX reports EOF: If InLine=Empty, previous line was last line in le (le ends nl). Otherwise, InLine holds last line in le (le doesnt end in nl).
\def\FV@Line{}% \FV@ReadLine \ifeof\FV@InFile \ifx\FV@Line\@empty\else \FV@PreProcessLine \fi \immediate\closein\FV@InFile \else \FV@PreProcessLine \expandafter\FV@@Input \fi}
We also want to handle true comment characters correctly. This means that we keep accumulating text in InLine until we nd a ^^M (indicating that the line did not contain a comment character). 38
\FV@ReadLine
434 \begingroup 435 \catcode\^^M=\active 436 \gdef\FV@ReadLine{% 437 438 439 440
\FV@FormattingPrep
446 \def\FV@FormattingPrep{% 447 448 449 450 451 452
% Cancels special punctuation spacing. % See below. % See below. % A user-defined hook (formatcom parameter).
453 \expandafter\ifx\csname
selectfont\endcsname\relax
\FV@SetupFont
454 \def\FV@SetupFont{% 455 456 457 458 459 460 \else 461 462 \def\FV@SetupFont{% 463 464 465 466
39
\FV@FontShape \selectfont 469 %% DG/SR modification begin - May. 18, 1998 (added code to turn off ligatures) 470 \@noligs} 471 %% DG/SR modification end
467 468 472 \fi
\FV@FontSize
473 \define@key{FV}{fontsize}{% 474 475 476 477 478 479
\KV@FV@fontsize@default
480 \def\KV@FV@fontsize@default{\let\FV@FontSize\relax}
\FV@BaseLineStretch
481 \define@key{FV}{baselinestretch}[auto]{% 482 483 484 485 486 487
KV@FV@baselinestretch@default
488 \def\KV@FV@baselinestretch@default{\let\FV@BaseLineStretch\relax} 489 \define@key{FV}{fontfamily}{% 490 491 492
\FV@FontSeries
493 \define@key{FV}{fontseries}{% 494 495 496 497 498 499
\FV@FontShape
500 \define@key{FV}{fontshape}{% 501
\def\@tempa{#1}%
40
\FV@MakeActive
507 \def\FV@MakeActive#1{% 508 509 510 511
\FV@MakeUnActive
512 \def\FV@MakeUnActive{} 513 \begingroup 514 \catcode\=\active
\FV@fontfamily@tt
515 \gdef\FV@fontfamily@tt{%
\def\FV@FontScanPrep{\FV@MakeActive\}% SR modification begin - 1995 518 %% \def\FV@FontFamily{\tt{{\string}}}} 519 \def\FV@FontFamily{\ttfamily\edef{{\string}}}} 520 %% SR modification end
516 517 %%
\FV@fontfamily@cmtt
521 \gdef\FV@fontfamily@cmtt{% 522 523
\def\FV@FontScanPrep{\FV@MakeActive\}% \def\FV@FontFamily{\edef{{\string}}\fontfamily{cmtt}}}
524 \endgroup
\FV@fontfamily@cmtt-spanish
525 \@namedef{FV@fontfamily@cmtt-spanish}{% 526 527
\def\FV@FontScanPrep{}% \def\FV@FontFamily{\fontfamily{cmtt}}}
Fix me
\FV@fontfamily@courier
528 \@namedef{FV@fontfamily@courier}{%
\def\FV@FontScanPrep{}% SR modification begin - 1995 531 %% \def\FV@FontFamily{\fontfamily{rpcr}}} 532 \def\FV@FontFamily{\fontfamily{pcr}}} 533 %% SR modification end
529 530 %%
41
\FV@fontfamily@helvetica
534 \@namedef{FV@fontfamily@helvetica}{%
\def\FV@FontScanPrep{}% SR modification begin - 1995 537 %% \def\FV@FontFamily{\fontfamily{rphv}}} 538 \def\FV@FontFamily{\fontfamily{phv}}} 539 %% SR modification end
535 536 %% 540 \fvset{fontfamily=tt,fontsize=auto,fontshape=auto,fontseries=auto, 541
baselinestretch=auto}
\FV@DefineWhiteSpace
We just dene the active characters to be ordinary commands, which are easier to redene. We do with any macros that use verbatim text.
542 \begingroup 543 \catcode\
=\active
544 \catcode\^^I=\active
\FV@DefineWhiteSpace
545 \gdef\FV@DefineWhiteSpace{\def 546 \endgroup
{\FV@Space}\def^^I{\FV@Tab}}%
\FancyVerbDefineActive
547 \define@key{FV}{defineactive}[]{\def\FancyVerbDefineActive{#1\relax}} 548 \define@key{FV}{defineactive*}{% 549
\FV@Space:
\FV@Space
552 \define@booleankey{FV}{showspaces}% 553 554
555 {\catcode\
556 \fvset{showspaces=false}
\FV@Tab:
\FV@Tab
557 \def\FV@Tab{\hbox
to\FancyVerbTabSize\fontdimen2\font{\hss\FV@TabChar}}
\FancyVerbTabSize
558 \define@key{FV}{tabsize}{% 559 560 561
\@tempcnta=#1\relax \ifnum\@tempcnta>100 \FV@Error{Tab size too large: \the\@tempcnta. (Max size = 100)}\FV@eha
42
\FV@TabChar
565 \define@booleankey{FV}{showtabs}% 566 567
{\def\FV@TabChar{\FancyVerbTab}}% {\let\FV@TabChar\relax}
568 \fvset{tabsize=8,showtabs=false}
Here is a weak attempt at a tab character. It may exceed the width of a space character when the verbatim font is small. The only proper way to do this is making it part of the verbatim font.
\FancyVerbTab
569 \def\FancyVerbTab{% 570 571 572 573 574
575 \newbox\FV@TabBox
\FV@@ObeyTabsInit
576 \def\FV@@ObeyTabsInit{% 577 578 579 580 581 582 583
\@tempdimb=\FancyVerbTabSize\fontdimen\tw@\font \edef\FV@ObeyTabSize{\number\@tempdimb}% \advance\@tempdimb\fontdimen\tw@\font \advance\@tempdimb-\FancyVerbTabSize sp % Allow for rounding errors. \edef\FV@@ObeyTabSize{\number\@tempdimb}% \let\FV@ObeyTabs\FV@@ObeyTabs \let\FV@Tab\FV@TrueTab}
\FV@@ObeyTabs
584 \def\FV@@ObeyTabs#1{\setbox\FV@TabBox=\hbox{#1}\box\FV@TabBox} 585 \let\FV@ObeyTabs\relax
\FV@TrueTab
586 \def\FV@TrueTab{% 587 588 589 590 591 592
43
\FV@ObeyTabsInit
596 \define@booleankey{FV}{obeytabs}% 597 598
{\let\FV@ObeyTabsInit\FV@@ObeyTabsInit}% {\let\FV@ObeyTabsInit\relax}
599 \fvset{obeytabs=false}
\FancyVerbFormatCom
\FancyVerbFormatCom
600 \define@key{FV}{formatcom}[]{\def\FancyVerbFormatCom{#1\relax}} 601 \define@key{FV}{formatcom*}{% 602 603
\expandafter\def\expandafter\FancyVerbFormatCom\expandafter{% \FancyVerbFormatCom#1\relax}}
604 \fvset{formatcom}
\FancyVerbFormatLine
605 \def\FancyVerbFormatLine#1{\FV@ObeyTabs{#1}}
\FV@XLeftMargin
606 \define@key{FV}{xleftmargin}{\def\FV@XLeftMargin{#1}} 607 \let\FV@XLeftMargin\z@
\FV@XRightMargin
608 \define@key{FV}{xrightmargin}{\def\FV@XRightMargin{#1}} 609 \let\FV@XRightMargin\z@
\if@FV@ResetMargins
610 \define@booleankey{FV}{resetmargins}%
\FV@ListParameterHook
614 \define@key{FV}{listparameters}{\def\FV@ListParameterHook{#1}} 615 \def\FV@ListParameterHook{}
\FancyVerbHFuzz
616 \define@key{FV}{hfuzz}{%
44
\FV@InterLinePenalty
620 \define@booleankey{FV}{samepage}%
Lists:
\FV@List{} is a rewriting of \list{}{}\item[]. The rewrite gives me more control. I might not get the vertical spacing exactly the same, but it is more likely that it will get better than worse. The verbatim environment consists of a series of \hboxs inserted in vertical mode. We need to take care of the following:
leftmargin rightmargin topskip botskip toppenalty botpenalty interlinepenalties Note: A verbatim environment immediately after an \item starts on the same line as the \items label, unless we reset margins. The user can instead have the environment start on a new line by inserting \ between \item and the environment.
\FV@List
624 \def\FV@List#1{% 625 626 627 628 629 630 631 632 633 634 635 636 637 638
\begingroup \FV@UseKeyValues \FV@LeaveVMode \if@inlabel\else\setbox\@labels=\box\voidb@x\fi \FV@ListNesting{#1}% \FV@ListParameterHook \FV@ListVSpace \FV@SetLineWidth \FV@InterLinePenalty \let\FV@ProcessLine\FV@ListProcessLine@i \FV@CatCodes \FV@FormattingPrep \FV@ObeyTabsInit \FV@BeginListFrame}
After an in-line section (\if@noskipsec=T). After an \item command, if we reset margins. Then we end \vmode, using @noparlist as a ag if in vmode. (Not the usual meaning of @noparlist.)
\FV@LeaveVMode
639 \def\FV@LeaveVMode{% 640 641 642 643 644 645
\FV@ListNesting
646 \def\FV@ListNesting#1{% 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661
\if@FV@ResetMargins \@listdepth=\z@ \else \ifnum\@listdepth>5\relax \@toodeep \else \advance\@listdepth\@ne \fi \fi \rightmargin\z@ \csname @list\romannumeral\the\@listdepth\endcsname \ifnum#1=\z@ \rightmargin\z@ \leftmargin\z@ \fi}
<topskip> = \topsep + \partopsep + \parskip <botskip> = \topsep + \partopsep <toppenalty> = \@beginparpenalty <botpenalty> = \@endparpenalty
Vmode in label:
<topskip> = \parskip % Expected anyway. A <botskip> = \topsep + \partopsep % Omitted in L TEX a bug? <toppenalty> = None <botpenalty> = \@endparpenalty % Ditto.
46
MAX{\topsep (+\partopsep) + \parskip , \lastskip } (The usual \@item works the same way.)
\parskip is added afterwards by a new paragraph, if any. <botskip> == \@topsepadd
\FV@ListVSpace
662 \def\FV@ListVSpace{% 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681
\@topsepadd\topsep \if@noparlist\advance\@topsepadd\partopsep\fi \if@inlabel \vskip\parskip \else \if@nobreak \vskip\parskip \clubpenalty\@M \else \addpenalty\@beginparpenalty \@topsep\@topsepadd \advance\@topsep\parskip \addvspace\@topsep \fi \fi \global\@nobreakfalse \global\@inlabelfalse \global\@minipagefalse \global\@newlistfalse}
\FV@SetLineWidth
682 \def\FV@SetLineWidth{% 683 684 685 686 687 688 689 690 691
We have to insert the right interline penalties (\interlinepenalty, \clubpenalty, \widowpenalty). We could process the environment as one long paragraph and let TEX insert the penalties, but this might cause problems for a very long environment. Line 1 : Insert \@labels (maybe) plus current_line Line 2 : Save current line Line 3 : penalty = interline + club ; Insert last line ; Save current line. Line 4 : penalty = interline ; Insert last line ; Save current line. Then at the end: Next line = 1 : Add null line. Next line = 2 : Nothing. Next line = 3 : penalty = interline + club + widow ; Insert last line. Next line = 4 : penalty = interline + widow ; Insert last line.
\FV@ListProcessLine
692 \def\FV@ListProcessLine#1{%
\hbox to \hsize{% \kern\leftmargin 695 \hbox to \linewidth{% 696 \FV@LeftListNumber 697 \FV@LeftListFrame 698 \FancyVerbFormatLine{#1}\hss 699 %% DG/SR modification begin - Jan. 28, 1998 (for numbers=right add-on) 700 %% \FV@RightListFrame}% 701 \FV@RightListFrame 702 \FV@RightListNumber}% 703 %% DG/SR modification end 704 \hss}}
693 694
48
\FV@ListProcessLine@i
705 \def\FV@ListProcessLine@i#1{% 706 707 708 709 710 711
\FV@ListProcessLine@ii
712 \def\FV@ListProcessLine@ii#1{% 713 714
\setbox\@tempboxa=\FV@ListProcessLine{#1}% \let\FV@ProcessLine\FV@ListProcessLine@iii}
\FV@ListProcessLine@iii
715 \def\FV@ListProcessLine@iii#1{% 716 717 718 719
\FV@ListProcessLine@iv
720 \def\FV@ListProcessLine@iv#1{% 721 722 723
\FV@EndList
724 \def\FV@EndList{% 725 726 727 728 729
\FV@ListProcessLastLine
730 \def\FV@ListProcessLastLine{% 731 732 733 734 735 736 737 738 739 740 741 742
\ifx\FV@ProcessLine\FV@ListProcessLine@iv {\advance\interlinepenalty\widowpenalty\penalty\interlinepenalty}% \box\@tempboxa \else \ifx\FV@ProcessLine\FV@ListProcessLine@iii {\advance\interlinepenalty\widowpenalty \advance\interlinepenalty\clubpenalty \penalty\interlinepenalty}% \box\@tempboxa \else \ifx\FV@ProcessLine\FV@ListProcessLine@i \FV@Error{Empty verbatim environment}{}%
49
Verbatim
747 \def\FV@VerbatimBegin{\FV@List\z@} 748 \def\FV@VerbatimEnd{\FV@EndList}
\FVB@Verbatim
749 \def\FVB@Verbatim{\FV@VerbatimBegin\FV@Scan}
\FVE@Verbatim
750 \def\FVE@Verbatim{\FV@VerbatimEnd} 751 \DefineVerbatimEnvironment{Verbatim}{Verbatim}{}
With \UseVerbatim, we have to take care of some of the things \end{} would do.
\FV@UseVerbatim
752 \def\FV@UseVerbatim#1{% 753 754
\FV@VerbatimBegin#1\FV@VerbatimEnd \@doendpe\global\@ignorefalse\ignorespaces}
\VerbatimInput
755 \def\VerbatimInput{\FV@Command{}{VerbatimInput}}
\FVC@VerbatimInput
756 \def\FVC@VerbatimInput#1{\FV@UseVerbatim{\FV@Input{#1}}}
LVerbatim environment:
LVerbatim
757 \def\FV@LVerbatimBegin{\FV@List\@ne} 758 \def\FV@LVerbatimEnd{\FV@EndList}
\FVB@LVerbatim
759 \def\FVB@LVerbatim{\FV@LVerbatimBegin\FV@Scan}
\FVE@LVerbatim
760 \def\FVE@LVerbatim{\FV@LVerbatimEnd} 761 \DefineVerbatimEnvironment{LVerbatim}{LVerbatim}{}
\FV@LUseVerbatim
762 \def\FV@LUseVerbatim#1{% 763 764
\FV@LVerbatimBegin#1\FV@LVerbatimEnd \@doendpe\global\@ignorefalse\ignorespaces}
50
\LVerbatimInput
765 \def\LVerbatimInput{\FV@Command{}{LVerbatimInput}}
\FVC@LVerbatimInput
766 \def\FVC@LVerbatimInput#1{\FV@LUseVerbatim{\FV@Input{#1}}}
Frames:
\FV@Frame@none
767 \def\FV@Frame@none{% 768 769 770 771
\FV@Frame@single
772 \def\FV@Frame@single{% 773 774 775 776
\FV@Frame@lines
777 \def\FV@Frame@lines{% 778 779 780 781
\FV@Frame@topline
782 \def\FV@Frame@topline{% 783 784 785 786
\FV@Frame@bottomline
787 \def\FV@Frame@bottomline{% 788 789 790 791
\FV@Frame@leftline
792 %% 794 795
To define a frame with only a left line % To define the \FV@FrameFillLine macro (from \FV@BeginListFrame) \ifx\FancyVerbFillColor\relax
51
793 \def\FV@Frame@leftline{%
796 797 798 799 800 801 802 803 804 805 806 807
\let\FV@FrameFillLine\relax \else \@tempdima\FV@FrameRule\relax \multiply\@tempdima-\tw@ \edef\FV@FrameFillLine{% {\noexpand\FancyVerbFillColor{\vrule\@width\number\@tempdima sp}% \kern-\number\@tempdima sp}}% \fi \let\FV@BeginListFrame\relax \let\FV@LeftListFrame\FV@LeftListFrame@Single \let\FV@RightListFrame\relax \let\FV@EndListFrame\relax}
\FV@BeginListFrame@Single
808 \def\FV@BeginListFrame@Single{%
\lineskip\z@ \baselineskip\z@ 811 \ifx\FancyVerbFillColor\relax 812 \let\FV@FrameFillLine\relax 813 \else 814 \@tempdima\FV@FrameRule\relax 815 \multiply\@tempdima-\tw@ 816 \edef\FV@FrameFillLine{% 817 {\noexpand\FancyVerbFillColor{\vrule\@width\number\@tempdima sp}% 818 \kern-\number\@tempdima sp}}% 819 \fi 820 %% DG/SR modification begin - May. 19, 1998 821 %% \FV@SingleFrameLine 822 \FV@SingleFrameLine{\z@}% 823 %% DG/SR modification end 824 \penalty\@M 825 \FV@SingleFrameSep 826 \penalty\@M}
809 810
\FV@Label
827 %% 829 830 831 832 833 834 835
DG/SR modification begin - May. 19, 1998 \def\@tempa{#1}% \ifx\@tempa\FV@None \let\FV@LabelBegin\relax \let\FV@LabelEnd\relax \else \FV@Label@i#1\@nil% \fi}
828 \define@key{FV}{label}{%
\FV@Label@i
836 \def\FV@Label@i{\@ifnextchar[{\FV@Label@ii}{\FV@Label@ii[]}}
52
\FV@Label@ii
837 \def\FV@Label@ii[#1]#2\@nil{% 838 839 840 841 842 843 844 845
846 \fvset{label=none}
\FV@LabelPosition
847 \define@key{FV}{labelposition}[none]{% 848 849 850
\FV@LabelPosition@none
851 \def\FV@LabelPosition@none{% 852 853
\let\FV@LabelPositionTopLine\relax% \let\FV@LabelPositionBottomLine\relax}
\FV@LabelPosition@topline
854 \def\FV@LabelPosition@topline{% 855 856
\def\FV@LabelPositionTopLine{\@ne}% \let\FV@LabelPositionBottomLine\relax}
\FV@LabelPosition@bottomline
857 \def\FV@LabelPosition@bottomline{% 858 859
\let\FV@LabelPositionTopLine\relax% \def\FV@LabelPositionBottomLine{\@ne}}
\FV@LabelPosition@all
860 \def\FV@LabelPosition@all{% 861 862
\FV@SingleFrameLine
865 %% 866 %%
DG/SR modification begin - May. 19, 1998 \def\FV@SingleFrameLine{% 867 \def\FV@SingleFrameLine#1{% 868 %% DG/SR modification end 869 \hbox to\z@{% 870 \kern\leftmargin
53
DG/SR modification begin - Jun. 22, 1998 \ifnum#1=\z@ 873 \let\FV@Label\FV@LabelBegin 874 \else 875 \let\FV@Label\FV@LabelEnd 876 \fi 877 \ifx\FV@Label\relax 878 %% DG/SR modification end 879 \FancyVerbRuleColor{\vrule \@width\linewidth \@height\FV@FrameRule}% 880 %% DG/SR modification begin - Jun. 22, 1998 881 \else 882 \ifnum#1=\z@ 883 \setbox\z@\hbox{\strut\enspace\FV@LabelBegin\enspace\strut}% 884 \else 885 \setbox\z@\hbox{\strut\enspace\FV@LabelEnd\enspace\strut}% 886 \fi 887 \@tempdimb=\dp\z@ 888 \advance\@tempdimb -.5\ht\z@ 889 \@tempdimc=\linewidth 890 \advance\@tempdimc -\wd\z@ 891 \divide\@tempdimc\tw@ 892 \ifnum#1=\z@ % Top line 893 \ifx\FV@LabelPositionTopLine\relax 894 \FancyVerbRuleColor{\vrule \@width\linewidth \@height\FV@FrameRule}% 895 \else 896 \FV@FrameLineWithLabel 897 \fi 898 \else % Bottom line 899 \ifx\FV@LabelPositionBottomLine\relax 900 \FancyVerbRuleColor{\vrule \@width\linewidth \@height\FV@FrameRule}% 901 \else 902 \FV@FrameLineWithLabel 903 \fi 904 \fi 905 \fi 906 %% DG/SR modification end 907 \hss}}
872
871 %%
\FV@FrameLineWithLabel
908 %% 910 911
909 \def\FV@FrameLineWithLabel{%
\ht\z@\@tempdimb\dp\z@\@tempdimb% \FancyVerbRuleColor{% 912 \vrule \@width\@tempdimc \@height\FV@FrameRule 913 \raise\@tempdimb\box\z@ 914 \vrule \@width\@tempdimc \@height\FV@FrameRule}} 915 %% DG/SR modification end \FV@BeginListFrame@Lines
54
916 \def\FV@BeginListFrame@Lines{%
\begingroup \lineskip\z@skip 919 %% DG modification begin - June 18, 1997 (effect of \baselineskip too earlier) 920 %% \baselineskip\z@skip 921 %% \FV@SingleFrameLine 922 %% DG/SR modification begin - May. 19, 1998 923 %% \FV@SingleFrameLine 924 \FV@SingleFrameLine{\z@}% 925 %% DG/SR modification end 926 \kern-0.5\baselineskip\relax 927 \baselineskip\z@skip 928 %% DG modification end 929 \kern\FV@FrameSep\relax 930 \endgroup}%
917 918
\FV@EndListFrame@Lines
931 \def\FV@EndListFrame@Lines{%
\begingroup \baselineskip\z@skip 934 \kern\FV@FrameSep\relax 935 %% DG/SR modification begin - May. 19, 1998 936 %% \FV@SingleFrameLine 937 \FV@SingleFrameLine{\@ne}% 938 %% DG/SR modification end 939 \endgroup}
932 933
\FV@SingleFrameSep
940 \def\FV@SingleFrameSep{%
\hbox to \z@{% \kern\leftmargin 943 \hbox to\linewidth{% 944 \FancyVerbRuleColor{% 945 %% DG modification begin - June 18, 1997 (\FV@FrameSep missing) 946 \ifx\FancyVerbFillColor\relax 947 \vrule\@width 0pt\@height\FV@FrameSep\relax 948 \fi 949 %% DG modification end 950 \vrule\@width\FV@FrameRule\relax 951 \ifx\FancyVerbFillColor\relax 952 \hfil 953 \else 954 {\FancyVerbFillColor\leaders\hrule\@height\FV@FrameSep\hfil}% 955 \fi 956 %% DG modification begin - June 18, 1997 (\FV@FrameSep missing) 957 \ifx\FancyVerbFillColor\relax 958 \vrule\@width 0pt\@height\FV@FrameSep\relax 959 \fi 960 %% DG modification end
941 942
55
961 962
\vrule\@width\FV@FrameRule\relax}}% \hss}}
\FV@LeftListFrame@Single
963 \def\FV@LeftListFrame@Single{%
\strut {\FancyVerbRuleColor{\vrule \@width\FV@FrameRule}}% 966 \FV@FrameFillLine 967 %% DG modification begin - June 18, 1997 (to fill color on left side) 968 %% \kern\FV@FrameSep} 969 \ifx\FancyVerbFillColor\relax 970 \kern\FV@FrameSep 971 \else 972 {\noexpand\leavevmode\FancyVerbFillColor{\vrule\@width\FV@FrameSep}}% 973 \fi} 974 %% DG modification end
964 965
\FV@RightListFrame@Single
975 \def\FV@RightListFrame@Single{%
DG modification begin - June 18, 1997 (to fill color on right side) \kern\FV@FrameSep 978 \ifx\FancyVerbFillColor\relax 979 \kern\FV@FrameSep 980 \else 981 {\noexpand\leavevmode\FancyVerbFillColor{\vrule\@width\FV@FrameSep}}% 982 \fi 983 {\noexpand\leavevmode\FancyVerbRuleColor{\vrule\@width\FV@FrameRule}}} 984 %% DG modification end
977 %%
976 %%
\FV@EndListFrame@Single
985 \def\FV@EndListFrame@Single{%
\penalty\@M \FV@SingleFrameSep 988 \penalty\@M 989 %% DG/SR modification begin - May. 19, 1998 990 %% \FV@SingleFrameLine} 991 \FV@SingleFrameLine{\@ne}} 992 %% DG/SR modification end
986 987
\FV@FrameRule
993 \define@key{FV}{framerule}{% 994 995
\KV@FV@framerule@default
996 \def\KV@FV@framerule@default{\let\FV@FrameRule\fboxrule}
56
\FV@FrameSep
997 \define@key{FV}{framesep}{% 998 999
\KV@FV@framesep@default
1000 \def\KV@FV@framesep@default{\let\FV@FrameSep\fboxsep} 1001 \fvset{framerule,framesep}
\FancyVerbRuleColor
1002 \define@key{FV}{rulecolor}{% 1003 1004 1005 1006 1007 1008
\FancyVerbFillColor
1009 \define@key{FV}{fillcolor}{% 1010 1011 1012 1013 1014 1015
1016 \fvset{rulecolor=none,fillcolor=none}
\FV@Frame@double
1017 \def\FV@Frame@double{% 1018 1019 1020
1025 \fvset{frame=none}
1026 \newcounter{FancyVerbLine}
\FV@SetLineNo
1027 \define@key{FV}{firstnumber}[auto]{% 1028 1029
\def\@tempa{#1}\def\@tempb{auto}% \ifx\@tempa\@tempb
57
\def\FV@SetLineNo{% \c@FancyVerbLine\FV@CodeLineNo 1032 \advance\c@FancyVerbLine\m@ne}% 1033 \else 1034 \def\@tempb{last}% 1035 \ifx\@tempa\@tempb 1036 \let\FV@SetLineNo\relax 1037 \else 1038 %% DG/SR modification begin - Jan. 19, 1998 1039 %% \def\FV@SetLineNo{\c@FancyVerbLine#1}% 1040 \def\FV@SetLineNo{% 1041 \c@FancyVerbLine#1 1042 \advance\c@FancyVerbLine\m@ne}% 1043 %% DG/SR modification end 1044 \fi 1045 \fi}
1030 1031
\if@FV@NumberBlankLines
1046 \define@booleankey{FV}{numberblanklines}%
\FV@refstepcounter
1050 %%
DG/SR modification begin - May. 20, 1998 Adapted from latex.ltx 1052 \def\FV@refstepcounter#1{% 1053 %% DG/SR modification end 1054 \stepcounter{#1}% 1055 \protected@edef\@currentlabel 1056 {\csname p@#1\endcsname\arabic{FancyVerbLine}}}
1051 %%\def\refstepcounter#1{%
\FV@StepLineNo
1057 \def\FV@StepLineNo{% 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068
\FV@SetLineNo% \def\FV@StepLineNo{% \if@FV@NumberBlankLines% \FV@refstepcounter{FancyVerbLine}% \else% \ifx\FV@Line\empty% \else% \FV@refstepcounter{FancyVerbLine}% \fi% \fi}% \FV@StepLineNo}
58
\theFancyVerbLine
1069 %%
DG/SR modification begin - 1995 DG/SR modification end \@ifundefined{FV@Numbers@#1}% {\FV@Error{Numbers style #1 not defined.}\FV@eha}% {\@nameuse{FV@Numbers@#1}}}
(D.G. Dec. 20, 1995 and Jan. 28, 1998): Add-on to allow a step when printing the lines counter (stepnumber keyword) Add-on to allow the counter to be printed on right side (numbers=right)
\FV@Numbers@none
1077 %%
1078 %%\def\FV@Numbers@none{\let\FV@LeftListNumber\relax} 1079 \def\FV@Numbers@none{% 1080 \let\FV@LeftListNumber\relax 1081 \let\FV@RightListNumber\relax} 1082 \newcount\FV@StepNumber 1083 \define@key{FV}{stepnumber}{\FV@StepNumber#1}
\KV@FV@stepnumber@default
1084 \def\KV@FV@stepnumber@default{\FV@StepNumber\@ne} 1085 \fvset{stepnumber}
\FV@Numbers@left
1086 %% 1088 %% 1089 %%
1087 %%\def\FV@Numbers@left{%
\def\FV@LeftListNumber{\hbox to\z@{% \hss\theFancyVerbLine\kern\FV@NumberSep}}} 1090 \def\FV@Numbers@left{% 1091 %% DG/SR modification begin - Apr. 28, 1998 1092 \let\FV@RightListNumber\relax 1093 %% DG/SR modification end 1094 \def\FV@LeftListNumber{% 1095 \@tempcnta=\FV@CodeLineNo 1096 \@tempcntb=\FV@CodeLineNo 1097 \divide\@tempcntb\FV@StepNumber 1098 \multiply\@tempcntb\FV@StepNumber 1099 \ifnum\@tempcnta=\@tempcntb 1100 %% DG/SR modification begin - Apr. 28, 1998 1101 %% \hbox to\z@{\hss\theFancyVerbLine\kern\FV@NumberSep}% 1102 \if@FV@NumberBlankLines 1103 \hbox to\z@{\hss\theFancyVerbLine\kern\FV@NumberSep}% 1104 \else
59
\ifx\FV@Line\empty \else 1107 \hbox to\z@{\hss\theFancyVerbLine\kern\FV@NumberSep}% 1108 \fi 1109 \fi 1110 %% DG/SR modification end 1111 \fi}}
1105 1106
\FV@Numbers@right
1112 \def\FV@Numbers@right{%
DG/SR modification begin - Apr. 28, 1998 \let\FV@LeftListNumber\relax 1115 %% DG/SR modification end 1116 \def\FV@RightListNumber{% 1117 \@tempcnta=\FV@CodeLineNo 1118 \@tempcntb=\FV@CodeLineNo 1119 \divide\@tempcntb\FV@StepNumber 1120 \multiply\@tempcntb\FV@StepNumber 1121 \ifnum\@tempcnta=\@tempcntb 1122 %% DG/SR modification begin - Apr. 28, 1998 1123 %% \hbox to \z@{\kern\FV@NumberSep\theFancyVerbLine\hss}% 1124 \if@FV@NumberBlankLines 1125 \hbox to\z@{\kern\FV@NumberSep\theFancyVerbLine\hss}% 1126 \else 1127 \ifx\FV@Line\empty 1128 \else 1129 \hbox to\z@{\kern\FV@NumberSep\theFancyVerbLine\hss}% 1130 \fi 1131 \fi 1132 %% DG/SR modification end 1133 \fi}} 1134 %% DG modification end
1114
1113 %%
\FV@NumberSep
1135 \define@key{FV}{numbersep}{% 1136 1137
1138 \fvset{numbers=none,numbersep=12pt,firstnumber=auto}
12.14 BVerbatim
BVerbatim
1139 \def\FV@BVerbatimBegin{% 1140 1141 1142 1143
\FV@BeginVBox
1147 \def\FV@BeginVBox{% 1148 1149 1150
\FV@EndVBox
1151 \def\FV@EndVBox{\egroup\ifmmode$\fi\hfil\egroup}
\FV@boxwidth
1152 \define@key{FV}{boxwidth}{% 1153 1154 1155 1156 1157 1158 1159
\KV@FV@boxwidth@default
1160 \def\KV@FV@boxwidth@default{\let\FV@boxwidth\relax}
\FV@baseline
1161 \define@key{FV}{baseline}{% 1162 1163 1164
1165 \fvset{baseline=b,boxwidth}
\FV@BProcessLine
1166 \def\FV@BProcessLine#1{\hbox{\FancyVerbFormatLine{#1}}}
\FVB@BVerbatim
1167 \def\FVB@BVerbatim{\FV@BVerbatimBegin\FV@Scan}
\FVE@BVerbatim
1168 \def\FVE@BVerbatim{\FV@BVerbatimEnd} 1169 \DefineVerbatimEnvironment{BVerbatim}{BVerbatim}{}
\FV@BUseVerbatim
1170 \def\FV@BUseVerbatim#1{\FV@BVerbatimBegin#1\FV@BVerbatimEnd}
61
\BVerbatimInput
1171 \def\BVerbatimInput{\FV@Command{}{BVerbatimInput}}
\FVC@BVerbatimInput
1172 \def\FVC@BVerbatimInput#1{\FV@BUseVerbatim{\FV@Input{#1}}}
\FVB@SaveVerbatim
1174 \def\FVB@SaveVerbatim#1{%
\@bsphack \begingroup 1177 \FV@UseKeyValues 1178 %% \FV@BeginVBox 1179 %% \let\FV@ProcessLine\FV@BProcessLine 1180 %% \FV@FormattingPrep 1181 %% \FV@ObeyTabsInit% 1182 %% 1183 \def\SaveVerbatim@Name{#1}% 1184 \gdef\FV@TheVerbatim{}% 1185 \def\FV@ProcessLine##1{% 1186 \expandafter\gdef\expandafter\FV@TheVerbatim\expandafter{% 1187 \FV@TheVerbatim\FV@ProcessLine{##1}}}% 1188 \gdef\FV@TheVerbatim{}% 1189 \FV@Scan}
1175 1176
\FVE@SaveVerbatim
1190 \def\FVE@SaveVerbatim{% 1191 1192
\expandafter\global\expandafter\let \csname FV@SV@\SaveVerbatim@Name\endcsname\FV@TheVerbatim 1193 %% \expandafter\gdef 1194 %% \csname FV@SV@\SaveVerbatim@Name\endcsname{\FV@TheVerbatim} 1195 %% \FV@EndVBox 1196 %% \endgroup} 1197 \endgroup\@esphack}
SaveVerbatim
1198 \DefineVerbatimEnvironment{SaveVerbatim}{SaveVerbatim}{}
\FV@CheckIfSaved
1199 \def\FV@CheckIfSaved#1#2{% 1200 1201 1202
\@ifundefined{FV@SV@#1}% {\FV@Error{No verbatim text has been saved under name #1}\FV@eha}% {#2{\csname FV@SV@#1\endcsname}}}
62
\UseVerbatim
1203 \def\UseVerbatim{\FV@Command{}{UseVerbatim}}
\FVC@UseVerbatim
1204 \def\FVC@UseVerbatim#1{\FV@CheckIfSaved{#1}{\FV@UseVerbatim}}
\LUseVerbatim
1205 \def\LUseVerbatim{\FV@Command{}{LUseVerbatim}}
\FVC@LUseVerbatim
1206 \def\FVC@LUseVerbatim#1{\FV@CheckIfSaved{#1}{\FV@LUseVerbatim}}
\BUseVerbatim
1207 \def\BUseVerbatim{\FV@Command{}{BUseVerbatim}}
\FVC@BUseVerbatim
1208 \def\FVC@BUseVerbatim#1{\FV@CheckIfSaved{#1}{\FV@BUseVerbatim}}
\VerbatimOut
1210 \def\VerbatimOut{\FV@Environment{}{VerbatimOut}}
\FVB@VerbatimOut
1211 \def\FVB@VerbatimOut#1{%
\@bsphack \begingroup 1214 \FV@UseKeyValues 1215 \FV@DefineWhiteSpace 1216 \def\FV@Space{\space}% 1217 \FV@DefineTabOut 1218 \def\FV@ProcessLine{\immediate\write\FV@OutFile}% 1219 \immediate\openout\FV@OutFile #1\relax 1220 \let\FV@FontScanPrep\relax 1221 %% DG/SR modification begin - May. 18, 1998 (to avoid problems with ligatures) 1222 \let\@noligs\relax 1223 %% DG/SR modification end 1224 \FV@Scan}
1212 1213
\FVE@VerbatimOut
1225 \def\FVE@VerbatimOut{\immediate\closeout\FV@OutFile\endgroup\@esphack}
VerbatimOut
1226 \DefineVerbatimEnvironment{VerbatimOut}{VerbatimOut}{}
63
\FV@DefineTabOut
1227 \def\FV@DefineTabOut{% 1228 1229 1230 1231 1232 1233
\FV@Command
1234 \def\SaveVerb{\FV@Command{}{SaveVerb}}
\FVC@SaveVerb
1235 \begingroup 1236 \catcode\^^M=\active% 1237 \gdef\FVC@SaveVerb#1#2{%
\@namedef{FV@SV@#1}{}% \begingroup% 1240 \FV@UseKeyValues% 1241 \FV@CatCodes% 1242 \outer\def^^M{\FV@EOL}% 1243 \global\let\@tempg\FancyVerbAfterSave% 1244 \catcode#2=12% 1245 \def\@tempa{\def\FancyVerbGetVerb####1####2}% 1246 \expandafter\@tempa\string#2{\endgroup\@namedef{FV@SV@#1}{##2}\@tempg}% 1247 \FancyVerbGetVerb\FV@EOL}% 1248 \endgroup
1238 1239
\FV@EOL
1249 \def\FV@EOL{% 1250 1251 1252 1253 1254 1255 1256
\endgroup \FV@Error% {Could not find the end delimiter of a short verb command}% {You probably just forget the end delimiter of a \string\Verb\space or \string\SaveVerb^^J% command, or you broke the literal text across input lines.^^J% Hit <return> to procede.}}
64
\FancyVerbAfterSave
1257 \define@key{FV}{aftersave}{\def\FancyVerbAfterSave{#1}} 1258 \fvset{aftersave=}
\FV@UseVerb
1259 \def\FV@UseVerb#1{\mbox{\FV@UseKeyValues\FV@FormattingPrep#1}}
\UseVerb
1260 \def\UseVerb{\FV@Command{}{UseVerb}}
\FVC@UseVerb
1261 \def\FVC@UseVerb#1{% 1262 1263 1264
\Verb
1265 \def\Verb{\FV@Command{}{Verb}}
\FVC@Verb
1266 \begingroup 1267 \catcode\^^M=\active% 1268 \gdef\FVC@Verb#1{%
\begingroup% \FV@UseKeyValues% 1271 \FV@FormattingPrep% 1272 \FV@CatCodes% 1273 \outer\def^^M{}% 1274 \catcode#1=12% 1275 \def\@tempa{\def\FancyVerbGetVerb####1####2}% 1276 \expandafter\@tempa\string#1{\mbox{##2}\endgroup}% 1277 \FancyVerbGetVerb\FV@EOL}% 1278 \endgroup
1269 1270
\DefineShortVerb
1279 \def\DefineShortVerb{\FV@Command{}{DefineShortVerb}}
\FVC@DefineShortVerb
1280 \def\FVC@DefineShortVerb#1{% 1281 1282 1283 1284
\FVC@@DefineShortVerb
1285 \def\FVC@@DefineShortVerb#1{% 1286 1287
\begingroup \lccode\~=#1%
65
1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299
\lowercase{\gdef\@tempg{\edef~}\global\let\@temph~}% \endgroup \expandafter\let\csname FV@AC@\string#1\endcsname\@temph \expandafter\edef\csname FV@CC@\string#1\endcsname{\the\catcode#1}% \expandafter\let\csname FV@KV@\string#1\endcsname\FV@KeyValues \@tempg{% \let\noexpand\FV@KeyValues\expandafter\noexpand \csname FV@KV@\string#1\endcsname \noexpand\FVC@Verb\expandafter\@gobble\string#1}% \expandafter\def\expandafter\dospecials\expandafter{\dospecials\do#1}% \expandafter\def\expandafter\@sanitize\expandafter{\@sanitize\@makeother#1}% \catcode#1=\active}%
\UndefineShortVerb
1300 \def\UndefineShortVerb#1{% 1301 1302 1303 1304
\FV@UndefineShortVerb
1305 \def\FV@UndefineShortVerb#1{%
\catcode#1=\csname FV@CC@\string#1\endcsname DG/SR modification begin - Jun. 12, 1998 1308 \expandafter\let\csname FV@CC@\string#1\endcsname\relax 1309 %% DG/SR modification end 1310 \begingroup 1311 \lccode\~=#1% 1312 \lowercase{\gdef\@tempg{\let~}}% 1313 \endgroup 1314 \expandafter\@tempg\csname FV@AC@\string#1\endcsname 1315 \def\@tempa##1\do#1##2\@nil##3\@nil##4\@@nil{##3\def\dospecials{##1##2}\fi}% 1316 \expandafter\@tempa\dospecials\@nil\iftrue\@nil\do#1\@nil\iffalse\@nil\@@nil 1317 \def\@tempa##1\@makeother#1##2\@nil##3\@nil##4\@@nil{% 1318 ##3\def\@sanitize{##1##2}\fi}% 1319 \expandafter\@tempa\@sanitize\@nil\iftrue\@nil\do#1\@nil\iffalse\@nil\@@nil}
1306 1307 %%
Moving verbatim. Need to worry about using separate identier for this class of verbatim, and
\SaveMVerb
1320 \def\SaveMVerb{\FV@Command{}{SaveMVerb}}
\FVC@SaveMVerb
1321 \begingroup 1322 \catcode\^^M=\active% 1323 \gdef\FVC@SaveMVerb#1#2{% 1324 1325
{I will overwrite the old definition. Hit <return> to continue.}}% \global\@namedef{FV@SVM@#1}{}% 1328 \begingroup% 1329 \let\FV@SavedKeyValues\FV@KeyValues% 1330 \FV@UseKeyValues% 1331 \FV@CatCodes% 1332 \outer\def^^M{}% 1333 \global\let\@tempg\FancyVerbAfterSave% 1334 \catcode#2=12% 1335 \def\@tempa{\def\FancyVerbGetVerb####1####2}% 1336 \expandafter\@tempa\string#2{% 1337 \if@filesw 1338 \FV@DefineWhiteSpace% 1339 \let\FV@Space\space% 1340 \let\FV@Tab\space% 1341 \FV@MakeUnActive% 1342 \let\protect\string 1343 \immediate\write\@auxout{% 1344 \noexpand\SaveGVerb[\FV@SavedKeyValues]{#1}\string#2##2\string#2}% 1345 \fi 1346 \endgroup% 1347 \@namedef{FV@SV@#1}{##2}% 1348 \@tempg}% 1349 \FancyVerbGetVerb\FV@EOL}% 1350 \endgroup
1326 1327
\SaveGVerb
1351 \def\SaveGVerb{\FV@Command{}{SaveGVerb}}
\FVC@SaveGVerb
1352 \begingroup 1353 \catcode\^^M=\active% 1354 \gdef\FVC@SaveGVerb#1#2{%
\global\@namedef{FV@SVG@#1}{}% \begingroup% 1357 \FV@UseKeyValues% 1358 \FV@CatCodes% 1359 \outer\def^^M{}% 1360 \catcode#2=12% 1361 \def\@tempa{\def\FancyVerbGetVerb####1####2}% 1362 \expandafter\@tempa\string#2{\endgroup\global\@namedef{FV@SVG@#1}{##2}}% 1363 \FancyVerbGetVerb\FV@EOL}% 1364 \endgroup
1355 1356
\UseMVerb
1365 \def\UseMVerb{\protect\pUseMVerb}
\pUseMVerb
1366 \def\pUseMVerb{\FV@Command{}{pUseMVerb}}
67
\FVC@pUseMVerb
1367 \def\FVC@pUseMVerb#1{% 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377
\expandafter\ifx \csname FV@SVM@#1\endcsname\relax \expandafter\ifx \csname FV@SVG@#1\endcsname\relax \@warning{Moving verbatim text not defined for name #1}\FV@eha {\bf ??}% \else \FV@UseVerb{\@nameuse{FV@SVG@#1}}% \fi \else \FV@UseVerb{\@nameuse{FV@SVM@#1}}% \fi} documentclass\endcsname\relax
1378 \expandafter\ifx\csname
lrbox
1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390
\def\lrbox#1{% \edef\@tempa{% \endgroup \setbox#1\hbox{% \begingroup\aftergroup}% \def\noexpand\@currenvir{\@currenvir}}% %\def\noexpand\@currenvline{\on@line}}% \@tempa \@endpefalse \bgroup \ignorespaces} \def\endlrbox{\unskip\egroup} DG/SR modification begin DG/SR modification end Mar 21 2000
Unused code - dont take care! (DG/SR) Error messages to void: </fancyvrb>
Index
Numbers written in italic refer to the page where the corresponding entry is described; numbers underlined refer to the code line of the denition; numbers in roman refer to the code lines where the entry is used.
Symbols
68
\[ \{ \} \] \^
. . . . . . . . . . . . . . . . . . . . . . . . . 296 . . 142, 329, 334, 339, 344, 349, 354 . . . . . . . . . . . . . . . . . . . . . . . . . 142 . . . . . . . . . . . . . . . . . . . . . . . . . 297 101, 103, 104, 131, 133, 362, 378, 435, 544, 1236, 1267, 1322, 1353 \ . . . . . . . . . . . . . . . . . . . 514, 516, 522 \~ . . . . . . . . . . . . . . . . . . . . . 1287, 1311
. . . . .
. . . .
\FancyVerbRuleColor . . . . . . 879,
894, 900, 911, 944, 965, 983, 1002
\FancyVerbStopNum . . . . . . . . . . . .
. . . . . . . . . 178, 184, 229, 238, 245
\FancyVerbStopString . . . . . . . . .
. . . . . . . . . 179, 181, 185, 228, 253
60 68 50 62 50 63
\FV@@@@Gobble . . . . . . . . 268, 279, 283 \FV@@@CheckEnd 332, 337, 347, 352, 383 \FV@@@CheckEnd@i . . . . . . . . . . . . . 332 \FV@@@CheckEnd@ii . . . . . . . . . . . . 347 \FV@@@CheckEnd@iii . . . . . . . . . . . 352 \FV@@@CheckEnd@iv . . . . . . . . . . . . 337 \FV@@@Gobble . . . . . . . . . . . . . 267, 270 \FV@@CheckEnd . . . . 331, 336, 346, 351 \FV@@CheckEnd@i . . . . . . . . . . . . . . 331 \FV@@CheckEnd@ii . . . . . . . . . . . . . 346 \FV@@CheckEnd@iii . . . . . . . . . . . . 351 \FV@@CheckEnd@iv . . . . . . . . . . . . . 336 \FV@@Command . . . . . . . . . . . . 79, 80, 81 \FV@@FindStartString . . . . . 216, 220 \FV@@FindStopString . . . . . . 251, 255 \FV@@Gobble . . . . . . . . . . . . . . 266, 280 \FV@@Input . . . . . . . . . . . . . . . 420, 422 \FV@@ObeyTabs . . . . . . . . . . . . 582, 584 \FV@@ObeyTabsInit . . . . . . . . 576, 597 \FV@@ObeyTabSize . . . . . . . . . 581, 590 \FV@@PreProcessLine . . . . . . . . . .
. . . . . . . . . 191, 212, 230, 247, 263
\FancyVerbAfterSave 1243, 1257, 1333 \FancyVerbCodes . . . . . . . . . . 129, 137 \FancyVerbDefineActive . . . 451, 547 \FancyVerbFillColor . . . . . . . . . .
. . 795, 801, 811, 817, 946, 951, 954, 957, 969, 972, 978, 981, 1009 \FancyVerbFormatCom . . . . . . 452, 600 \FancyVerbFormatLine 605, 698, 1166 \FancyVerbGetLine . . . . 374, 375, 377 \FancyVerbGetVerb . . . 1245, 1247, 1275, 1277, 1335, 1349, 1361, 1363 \FancyVerbHFuzz . . . . . . . . . . 616, 691
\FV@@ReadLine . . . . . . . . . . . . 439, 441 \FV@ActiveWhiteSpace . . . . . 126, 130 \FV@AddToHook . . . . . . . . 135, 152, 160 \FV@Auto . . . . . . . 75, 475, 483, 495, 502 \FV@BadBeginError . . . . . . . . 364, 367 \FV@BadCodes . . . . . 318, 339, 354, 358 \FV@BadEndError . . . . . . . . . . 383, 391 \FV@baseline . . . . . . . . . . . 1150, 1161 \FV@BaseLineStretch 455, 463, 481, 488 \FV@BeginListFrame . . . . . . . 638,
768, 773, 778, 783, 788, 794, 804
\FV@BeginListFrame@Lines . . . . . .
. . . . . . . . . . . . . . . . 778, 783, 916
69
\FV@BeginVBox . . . . . 1142, 1147, 1178 \FV@boxwidth . . . . . . 1149, 1152, 1160 \FV@BProcessLine . . 1143, 1166, 1179 \FV@BUseVerbatim . . 1170, 1172, 1208 \FV@BVerbatimBegin 1139, 1167, 1170 \FV@BVerbatimEnd . . 1146, 1168, 1170 \FV@CatCodes . . . . . . . . . 124, 287,
419, 635, 1241, 1272, 1331, 1358
\FV@Error . . . . . . . . . . . . . . . . . 31,
95, 110, 277, 319, 369, 393, 405, 416, 561, 742, 849, 1023, 1075, 1201, 1251, 1263, 1283, 1302, 1325 \FV@FindStartNum . . . . . . . . . 204, 209 \FV@FindStartStop . . . . 190, 195, 204, 207, 230, 232, 235, 240, 258 \FV@FindStartString . . . . . . 207, 214 \FV@FindStopNum . . . . . . . . . . 232, 237 \FV@FindStopString . . . . . . . 235, 249 \FV@FontFamily 458, 465, 491, 518, 519, 523, 527, 531, 532, 537, 538 \FV@fontfamily@cmtt . . . . . . . . . . 521 \FV@fontfamily@cmtt-spanish . . . 525 \FV@fontfamily@courier . . . . . . . 528 \FV@fontfamily@helvetica . . . . . . 534 \FV@fontfamily@tt . . . . . . . . . . . . 515 \FV@FontScanPrep . . . . . . . . . 127, 491, 516, 522, 526, 529, 535, 1220 \FV@FontSeries . . . . . . . . . . . 466, 493 \FV@FontShape . . . . . . . . . . . . 467, 500 \FV@FontSize . . . . . 457, 464, 473, 480 \FV@FormattingPrep . . . . . . . . . . . . 446, 636, 1144, 1180, 1259, 1271 \FV@Frame@bottomline . . . . . . . . . 787 \FV@Frame@double . . . . . . . . . . . . 1017 \FV@Frame@leftline . . . . . . . . . . . 792 \FV@Frame@lines . . . . . . . . . . . . . . 777 \FV@Frame@none . . . . . . . . . . . . . . . 767 \FV@Frame@single . . . . . . . . . . . . . 772 \FV@Frame@topline . . . . . . . . . . . . 782 \FV@FrameBegin . . . . . . . . . . . . . . 1018 \FV@FrameBegin@double . . . . . . . 1018 \FV@FrameEnd . . . . . . . . . . . . . . . . 1020 \FV@FrameEnd@double . . . . . . . . . 1020 \FV@FrameFillLine . . . . . . . . . . . . . . . . . 794, 796, 800, 812, 816, 966 \FV@FrameLine . . . . . . . . . . . . . . . 1019 \FV@FrameLine@double . . . . . . . . 1019 \FV@FrameLineWithLabel 896, 902, 908 \FV@FrameRule . . . . . . . . . . . . . . . . . . 798, 814, 879, 894, 900, 912, 914, 950, 961, 965, 983, 993, 996 \FV@FrameSep . . . . . . . . . 929, 934, 945, 947, 954, 956, 958, 968, 970, 972, 977, 979, 981, 997, 1000 \FV@GetKeyValues . . . . . . . 83, 85, 103 \FV@GetLine . . . . . . . . . . 365, 373, 387 \FV@Gobble . . . . . . . . . . . 193, 271, 284
\FV@CatCodesHook . 128, 134, 152, 160 \FV@CheckEnd . . . . . . . . . . . . . . . . . \FV@CheckEnd@i . . . . . . . . . . . . . . . \FV@CheckEnd@ii . . . . . . . . . . . . . . \FV@CheckEnd@iii . . . . . . . . . . . . . \FV@CheckEnd@iv . . . . . . . . . . . . . . \FV@CheckIfSaved . . . . . . . . . . . . .
. . . . . 326, 330, 335, 345, 350, 381 330 345 350 335 . . . . . . . . . 1199, 1204, 1206, 1208
70
241, 242, 259, 260, 412, 414, 415, 417, 425, 429, 437, 438 \FV@Input . . . . . . . 413, 756, 766, 1172 \FV@InterLinePenalty . . . . . 620, 633 \FV@KeyValues . . . . . . . . 79, 80, 86, 100, 119, 121, 122, 1292, 1294, 1329 \FV@Label . . . . . . . . 827, 873, 875, 877 \FV@Label@i . . . . . . . . . . . . . . 834, 836 \FV@Label@ii . . . . . . . . . . . . . 836, 837 \FV@LabelBegin 831, 840, 842, 873, 883 \FV@LabelEnd . . . . . 832, 845, 875, 885 \FV@LabelPosition . . . . . . . . . . . . 847 \FV@LabelPosition@all . . . . . . . . 860 \FV@LabelPosition@bottomline . . 857 \FV@LabelPosition@none . . . . . . . 851 \FV@LabelPosition@topline . . . . . 854 \FV@LabelPositionBottomLine . . . . . . . . 843, 853, 856, 859, 862, 899 \FV@LabelPositionTopLine . . . . . . . . . . . . . . . 852, 855, 858, 861, 893 \FV@LeaveVMode . . . . . . . . . . . 627, 639 \FV@LeftListFrame . . . . . . . . . . . . . 697, 769, 774, 779, 784, 789, 805 \FV@LeftListFrame@Single . . . . . . . . . . . . . . . . . . . . . . 774, 805, 963 \FV@LeftListNumber . . . . . . . . . . . . 696, 1078, 1080, 1088, 1094, 1114 \FV@Line 194, 217, 252, 268, 270, 386, 423, 426, 442, 443, 1063, 1105, 1127 \FV@List . . . . . . . . . . . . . 624, 747, 757 \FV@ListNesting . . . . . . . . . . 629, 646 \FV@ListParameterHook . . . . 614, 630 \FV@ListProcessLastLine . . . 725, 730 \FV@ListProcessLine . . . . . . . . . . . . . . . . . . . 692, 710, 713, 718, 723 \FV@ListProcessLine@i 634, 705, 741 \FV@ListProcessLine@ii . . . 711, 712 \FV@ListProcessLine@iii 714, 715, 735 \FV@ListProcessLine@iv 719, 720, 731 \FV@ListVSpace . . . . . . . . . . . 631, 662 \FV@LUseVerbatim . . . . 762, 766, 1206 \FV@LVerbatimBegin . . . 757, 759, 763 \FV@LVerbatimEnd . . . . . 758, 760, 763 \FV@MakeActive . . . . . . . 507, 516, 522 \FV@MakeUnActive 509, 510, 512, 1341 \FV@None . 74, 144, 155, 830, 1004, 1011 \FV@Numbers@left . . . . . . . . . . . . 1086 \FV@Numbers@none . . . . . . . . . . . . 1077 \FV@Numbers@right . . . . . . . . . . . 1112
\FV@InFile
\FV@ObeyTabs . . . . . . . . . 582, 585, 605 \FV@ObeyTabsInit 596, 637, 1145, 1181 \FV@ObeyTabSize . . . . . . . . . . 578, 588 \FV@OutFile . . . 1209, 1218, 1219, 1225 \FV@ParseStart . . . . . . . . . . . 163, 164 \FV@ParseStop . . . . . . . . . . . . 175, 176 \FV@PreProcessLine 188, 387, 427, 431 \FV@ProcessLine . . . . . . 194, 634,
711, 714, 719, 731, 735, 741, 743, 1143, 1179, 1185, 1187, 1218 \FV@ReadLine . . . . . . . . . 424, 434, 444 \FV@refstepcounter 1050, 1061, 1065 \FV@RightListFrame . . . . . . . 700, 701, 770, 775, 780, 785, 790, 806 \FV@RightListFrame@Single . 775, 975 \FV@RightListNumber . . . . . . . . . . . . . . . . . . . . 702, 1081, 1092, 1116 \FV@SavedKeyValues . . . . . 1329, 1344 \FV@Scan 286, 749, 759, 1167, 1189, 1224 \FV@SetLineNo . . . . . . . . . . 1027, 1058 \FV@SetLineWidth . . . . . . . . . 632, 682 \FV@SetupFont . . . . . . . . . . . . 449, 454 \FV@SingleFrameLine 821, 822, 865, 921, 923, 924, 936, 937, 990, 991 \FV@SingleFrameSep . . . 825, 940, 987 \FV@Space . . . . . . . 545, 552, 1216, 1339 \FV@StepLineNo . . . . . . . . . . 192, 1057 \FV@StepNumber . . . . . . . . . . . . . . . 10821084, 1097, 1098, 1119, 1120 \FV@Tab 545, 557, 583, 1228, 1231, 1340 \FV@TabBox . . . . 575, 584, 589, 593595 \FV@TabChar . . . . . . . . . . 557, 565, 595 \FV@TheVerbatim . . . . . . . . . . . . . . . . . . 1184, 11861188, 1192, 1194 \FV@TrueTab . . . . . . . . . . . . . . 583, 586 \FV@UndefineShortVerb . . 1304, 1305 \FV@UseKeyValues . . . . . . . . . . . . . . . . . . . . 118, 626, 1141, 1177, 1214, 1240, 1259, 1270, 1330, 1357 \FV@UseVerb . . . 1259, 1264, 1373, 1376 \FV@UseVerbatim . . . . . 752, 756, 1204 \FV@VerbatimBegin . . . . 747, 749, 753 \FV@VerbatimEnd . . . . . . 748, 750, 753 \FV@XLeftMargin . . . . . . . . . . 606, 686 \FV@XRightMargin . . . . . . . . . 608, 687 \FVB@BVerbatim . . . . . . . . . . . . . . 1167 \FVB@LVerbatim . . . . . . . . . . . . . . . 759 \FVB@SaveVerbatim . . . . . . . . . . . 1174
71
\FVB@Verbatim . . . . . . . . . . . . . . . . 749 \FVB@VerbatimOut . . . . . . . . . . . . 1211 \FVC@@DefineShortVerb . . 1282, 1285 \FVC@BUseVerbatim . . . . . . . . . . . 1208 \FVC@BVerbatimInput . . . . . . . . . 1172 \FVC@DefineShortVerb . . . . . . . . 1280 \FVC@LUseVerbatim . . . . . . . . . . . 1206 \FVC@LVerbatimInput . . . . . . . . . . 766 \FVC@pUseMVerb . . . . . . . . . . . . . . 1367 \FVC@SaveGVerb . . . . . . . . . . . . . . 1352 \FVC@SaveMVerb . . . . . . . . . . . . . . 1321 \FVC@SaveVerb . . . . . . . . . . . . . . . 1235 \FVC@UseVerb . . . . . . . . . . . . . . . . 1261 \FVC@UseVerbatim . . . . . . . . . . . . 1204 \FVC@Verb . . . . . . . . . . . . . . 1266, 1296 \FVC@VerbatimInput . . . . . . . . . . . 756 \FVE@BVerbatim . . . . . . . . . . . . . . 1168 \FVE@LVerbatim . . . . . . . . . . . . . . . 760 \FVE@SaveVerbatim . . . . . . . . . . . 1190 \FVE@Verbatim . . . . . . . . . . . . . . . . 750 \FVE@VerbatimOut . . . . . . . . . . . . 1225 \fvset . . . . . . . . . . . . . . . . . . . . . . . 76
I
\pUseMVerb . . . . . . . . . . . . . . . . . . 1366
R
\SaveGVerb . . . . . . . . . . . . . 1344, 1351 \SaveMVerb . . . . . . . . . . . . . . . . . . 1320 \SaveVerb . . . . . . . . . . . . . . 1234, 1254 \SaveVerbatim . . . . . . . . . . . . . . . 1173 SaveVerbatim (environment) . . . . . . 62 \SaveVerbatim@Name 1183, 1192, 1194
T
\theFancyVerbLine . . . . . . . . . . . 1069
U
\if@FV@NumberBlankLines . . . . . . .
. . . . . . . . . 1046, 1060, 1102, 1124 \if@FV@ResetMargins . . . . . . . . . . 610 \InputIfFileExists . . . . . . . . . . 1394 K
\KV@@booleankey . . . . . . . . . . . . 71, 72 \KV@booleankey . . . . . . . . . . . . . 69, 70 \KV@do . . . . . . . . . . . . . . . . . . . . . . . 121 \KV@FV@baselinestretch@default 488 \KV@FV@boxwidth@default . . . . . . 1160 \KV@FV@firstline@default . . . . . . 171 \KV@FV@fontsize@default . . . . . . . 480 \KV@FV@framerule@default . . . . . . 996 \KV@FV@framesep@default . . . . . . 1000 \KV@FV@gobble@default . . . . . . . . 284 \KV@FV@lastline@default . . . . . . . 183 \KV@FV@stepnumber@default . . . . 1084 \KV@prefix . . . . . . . . . . . . . . . . . . . 120
\V@@@footnotetext . . . . . . . . . . 62, 64 \V@@footnotetext . . . . . . . . . . . 46, 48 \V@footnote . . . . . . . . . . . . . . . . 40, 43 \V@footnotetext . . . . . . . . . 39, 42, 45 \Verb . . . . . . . . . . . . . . . . . . 1253, 1265 Verbatim (environment) . . . . . . . . . . 50 \VerbatimEnvironment . . . . . 288, 291 \VerbatimFootnotes . . . . . . . . . . . 36 \VerbatimInput . . . . . . . . . . . . . . . 755 \VerbatimOut . . . . . . . . . . . . . . . . 1210 VerbatimOut (environment) . . . . . . . 63
Change History
v2.0 Beta General: shown by Timothy First version personally
VAN
ZANDT . . . . 1
72
v2.5 General: First public release. . . . . . . 1 v2.6 General: . Three bug corrected, options numberblanklines, label, labelposition and leftline added and few precisions. . . . . . . . . . . . . . . 1 Add leftline value for the frame parameter (idea taken from a requirement of Christophe Roudet on June 9, 1998). . . . . . . . . . . . 51 Add the label and labelposition parameters (suggested by Michael Friendly on May 15, 1998). . . . . 52 Add the numberblanklines parameter to allow to dont number empty lines (suggested by Philippe Esperet on April 25, 1998). . . . . . . . . . . . . . . . . . . . 58 Correct a bug for the ligature in
T1 encoding (reported by Mario Hassler on May 12, 1998). . . . . . 39 Correct a bug to undene the macro associated to short verbatim character (reported by Mikhail Kolodin on June 12, 1998). . . . . . . . . . . . . . . . . . . . 66 Correct a bug which didnt allow to use the label macro in verbatim env. (reported by Philippe Esperet on May 20, 1998). . . . . . . . . . . . 58 v2.7 General: DG/SR changed how fancyvrb.cfg included . . . . . . . . . . . . 1 v2.7a General: rstline bug . . . . . . . . . . . . 1 v2.8 General: xed bug with several trailing spaces (hv) . . . . . . . . . . . . . . 1
73