forked from wardvanwanrooij/thecbook
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fancyvrb.dtx
4580 lines (4573 loc) · 130 KB
/
fancyvrb.dtx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
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
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
% \iffalse meta-comment, etc.
%%
%% Package `fancyvrb'
%%
%% COPYRIGHT 1992-2010, by Timothy Van Zandt <tvz@zandtwerk.kellogg.nwu.edu>
%% 2010, by Herbert Voss <hvoss@tug.org>
%%
%% This package may be distributed under the terms of the LaTeX Project Public
%% License, as described in lppl.txt in the base LaTeX distribution.
%% Either version 1.0 or, at your option, any later version.
%%
%%
% \fi
% \changes{v2.8}{2010/05/15}{fixed bug with several trailing spaces (hv)}
% \changes{v2.7a}{2008/02/07}{NMM fixed lastline=firstline bug}
% \changes{v2.7}{2000/03/21}{DG/SR changed how fancyvrb.cfg included}
% \changes{v2.6}{1998/07/17}{. Three bug corrected, options numberblanklines,
% label, labelposition and leftline added and few
% precisions.}
% \changes{v2.5}{1998/01/28}{First public release.}
% \changes{v2.0 Beta}{1994/03/30}{First version personally shown by Timothy
% \textsc{van Zandt}.}
%
% \newif\ifPostScriptFonts
% \IfFileExists{times.sty}{\PostScriptFontstrue}{}
%
% \DoNotIndex{\\,\^}
% \DoNotIndex{\@@nil,\@M,\@MM,\@auxout,\@beginparpenalty,\@bsphack}
% \DoNotIndex{\@currentlabel,\@currenvir,\@currenvline,\@currsize}
% \DoNotIndex{\@defpar,\@doendpe,\@eha,\@empty,\@endparenv,\@endpefalse}
% \DoNotIndex{\@endpetrue,\@esphack,\@fooA,\@fooB,\@footnotetext,\@gobble}
% \DoNotIndex{\@height,\@ifnextchar,\@ifstar,\@ifundefined,\@ignorefalse}
% \DoNotIndex{\@inlabelfalse}
% \DoNotIndex{\@input,\@labels,\@listdepth,\@makefntext,\@makeother,}
% \DoNotIndex{\@minipagefalse,\@namedef,\@nameuse,\@ne,\@newlistfalse,}
% \DoNotIndex{\@nil,\@nobreakfalse,\@noparlistfalse,\@noparlisttrue}
% \DoNotIndex{\@parboxrestore,\@sanitize,\@spaces,\@tempa,\@tempb,\@tempboxa}
% \DoNotIndex{\@tempc,\@tempcnta,\@tempcntb,\@tempdima,\@tempdimb,\@tempdimc}
% \DoNotIndex{\@tempg,\@temph,\@temptokena,\@thefnmark,\@toodeep}
% \DoNotIndex{\@topsep,\@topsepadd,\@totalleftmargin,\@warning,\@width}
% \DoNotIndex{\active,\addpenalty,\addvspace,\advance}
% \DoNotIndex{\afterassignment,\aftergroup,\arabic}
% \DoNotIndex{\baselineskip,\baselinestretch,\begin,\begingroup,\bf,\bgroup}
% \DoNotIndex{\box,\c@FancyVerbLine,\catcode,\ChangeBartrue,\closein}
% \DoNotIndex{\closeout,\clubpenalty,\CodelineIndex,\columnwidth,\cr,\csname}
% \DoNotIndex{\date,\DeclareOption,\def,\define@booleankey,\define@key}
% \DoNotIndex{\divide,\do,\do@noligs,\DocInput,\documentclass,\dp,\dospecials}
% \DoNotIndex{\edef,\egroup,\else,\EnableCrossrefs,\end,\endcenter}
% \DoNotIndex{\endcsname,\endgroup,\endinput,\endlrbox,\endpspicture}
% \DoNotIndex{\enspace,\errhelp,\errmessage,\expandafter}
% \DoNotIndex{\fancyvrb@loaded,\fboxrule,\fboxsep,\fi,\filedate,\fileversion}
% \DoNotIndex{\floatingpenalty,\font,\fontdimen,\fontfamily,\fontseries}
% \DoNotIndex{\fontshape,\footins,\footnote,\footnotesep,\footnotesize}
% \DoNotIndex{\frenchspacing,\fvset}
% \DoNotIndex{\gdef,\GetFileInfo,\global,\hbadness,\hbox,\hfil,\hfuzz}
% \DoNotIndex{\hrule,\hsize,\hss,\ht,\iden,\if,\if@FV@ResetMargins,\if@filesw}
% \DoNotIndex{\if@inlabel,\if@nobreak,\if@noparlist,\if@noskipsec,\ifcase}
% \DoNotIndex{\ifChangeBar,\ifeof,\IfFileExists,\ifmmode,\iffalse,\ifnum}
% \DoNotIndex{\iftrue,\ifvmode,\ifvoid,\ifx,\ignorespaces,\immediate,\input}
% \DoNotIndex{\insert,\interfootnotelinepenalty,\interlinepenalty,\jobname}
% \DoNotIndex{\kern,\large,\lccode,\leaders,\leavevmode,\leftmargin,\let}
% \DoNotIndex{\lineskip,\linewidth,\long,\loop,\lowercase,\lrbox}
% \DoNotIndex{\m@ne,\m@th,\maketitle,\mathbf,\mathit,\mathnormal}
% \DoNotIndex{\mathsl,\mathtt,\mbox,\meaning,\message,\mid,\mskip}
% \DoNotIndex{\multiply,\NeedsTeXFormat,\newbox,\newcommand,\newcount}
% \DoNotIndex{\newcounter,\newenvironment,\newif,\newpsobject,\newread}
% \DoNotIndex{\newwrite,\next,\noexpand,\normalsize,\number}
% \DoNotIndex{\Oldmakeindex,\on@line,\OnlyDescription,\openin,\openout,\or}
% \DoNotIndex{\outer,\pUseMVerb,\par,\parindent,\parskip,\partopsep}
% \DoNotIndex{\penalty,\PrintChanges,\PrintIndex,\ProcessOptions,\protect}
% \DoNotIndex{\protected@edef,\ProvidesPackage,\raise,\rangle,\read}
% \DoNotIndex{\RecordChanges,\refstepcounter,\relax,\renewcommand}
% \DoNotIndex{\renewenvironment,\repeat,\RequirePackage,\rightmargin,\rm}
% \DoNotIndex{\rmfamily,\romannumeral,\rule}
% \DoNotIndex{\scriptscriptstyle,\scriptstyle,\section,\selectfont,\setbox}
% \DoNotIndex{\setcounter,\setkeys,\setlength,\small,\smallskip,\space}
% \DoNotIndex{\splitmaxdepth,\splittopskip,\stepcounter,\string,\strip,\strut}
% \DoNotIndex{\strutbox,\textbf,\textcolor,\textit,\textsc,\textsf,\textsl}
% \DoNotIndex{\texttt,\textwidth,\the,\theFancyVerbLine,\tiny,\title,\topsep}
% \DoNotIndex{\tt,\ttfamily,\ttyin,\tw@,\underline,\unhbox,\unitlength}
% \DoNotIndex{\unskip,\usepackage,\valign,\vbox,\vcenter}
% \DoNotIndex{\verbatim@nolig@list,\vfil,\voidb@x,\vrule,\vspace,\vskip}
% \DoNotIndex{\vtop,\wd,\widowpenalty,\write,\xdef,\z@,\z@skip}
%
% \setcounter{IndexColumns}{2}
%
% \newcommand{\FBoxPackage}{`\textsf{fancybox}'}
% \newcommand{\FVrbPackage}{`\textsf{fancyvrb}'}
%
% ^^A From ltugboat.cls
%
% ^^A Typeset the name of an environment
% \providecommand\env[1]{\textsf{#1}}
% \providecommand\clsname[1]{\textsf{#1}}
% \providecommand\pkgname[1]{\textsf{#1}}
% \providecommand\optname[1]{\textsf{#1}}
% \providecommand\progname[1]{\textsf{#1}}
%
% ^^A A list of options for a package/class
% \newenvironment{optlist}{\begin{description}%
% \renewcommand\makelabel[1]{%
% \descriptionlabel{\mdseries\optname{##1}}}%
% \itemsep0.25\itemsep}%
% {\end{description}}
%
% ^^A Utility macros
%
% ^^A Special dashes
% \def\thinskip{\hskip 0.16667em\relax}
% \def\endash{--}
% \def\emdash{\endash-}
% \def\d@sh#1#2{\unskip#1\thinskip#2\thinskip\ignorespaces}
% \def\dash{\d@sh\nobreak\endash}
% \def\Dash{\d@sh\nobreak\emdash}
%
% ^^A Example macros - adapted from the `fvrb-ex' package
% ^^A ---------------------------------------------------
%
% ^^A Take care that we use here the "Z" character as comment character,
% ^^A to avoid to use an 8 bit one which can cause portability problems.
% ^^A But we can't use any more the "Z" into the example environments
% ^^A of this documentation.
%
% \makeatletter
% \newcommand{\BeginExample}[1][0]{%
% \parindent=0pt
% \multiply\topsep by 2
% \VerbatimEnvironment
% \begin{VerbatimOut}[gobble=#1]{\jobname.tmp}}
%
% \newcommand{\BelowExample}[1]{%
% \VerbatimInput[gobble=4,commentchar=Z,numbersep=3pt,frame=single,
% numbers=left]{\jobname.tmp}
% \catcode`\Z=9\relax%
% #1\par}
%
% \newcommand{\SideBySide@Example}[1]{%
% \@tempdimb=\FV@XRightMargin
% \advance\@tempdimb -5mm
% \vspace{2mm}
% \begin{minipage}[c]{\@tempdimb}
% \fvset{xrightmargin=0pt}
% \catcode`\Z=9\relax%
% #1
% \end{minipage}%
% \@tempdimb=\textwidth
% \advance\@tempdimb -\FV@XRightMargin
% \advance\@tempdimb 5mm
% \begin{minipage}[c]{\@tempdimb}
% \VerbatimInput[commentchar=Z,numbersep=3pt,frame=single,
% numbers=left,xleftmargin=5mm,xrightmargin=0pt]{\jobname.tmp}
% \end{minipage}
% \vspace{2mm}}
%
% \def\Example{%
% \catcode`\^^M=\active
% \@ifnextchar[{\catcode`\^^M=5\Example@}{\catcode`\^^M=5\Example@@}}
% \def\Example@[#1]{\fvset{#1}\Example@@}
% \def\Example@@{\BeginExample}
% \def\endExample{%
% \end{VerbatimOut}%
% \BelowExample{\input{\jobname.tmp}}}
%
% \def\CenterExample{%
% \catcode`\^^M=\active
% \@ifnextchar[{\catcode`\^^M=5\CenterExample@}
% {\catcode`\^^M=5\CenterExample@@}}
% \def\CenterExample@[#1]{\fvset{#1}\CenterExample@@}
% \def\CenterExample@@{\BeginExample}
% \def\endCenterExample{%
% \end{VerbatimOut}%
% \center
% \BelowExample{\input{\jobname.tmp}}
% \endcenter}
%
% \def\SideBySideExample{%
% \catcode`\^^M=\active
% \@ifnextchar[{\catcode`\^^M=5\SideBySideExample@}%
% {\catcode`\^^M=5\SideBySideExample@@}}
% \def\SideBySideExample@[#1]{\fvset{#1}\SideBySideExample@@}
% \def\SideBySideExample@@{\BeginExample[4]}
% \def\endSideBySideExample{%
% \end{VerbatimOut}%
% \SideBySide@Example{\input{\jobname.tmp}}}
% \makeatother
%
% ^^A End of example macros from `fvrb-ex'
%
% ^^A For the possible index and changes log
% \setlength{\columnseprule}{0.6pt}
%
% ^^A Beginning of the documentation itself
%
% \title{The `\textsf{fancyvrb}' package\\Fancy Verbatims in \LaTeX}
% \author{Timothy Van Zandt\\Princeton University\\Princeton -- USA\\
% {\footnotesize \url{tvz@Princeton.EDU}}\\[5mm]
% {Packaging and documentation by}\\
% {\footnotesize Denis Girou (CNRS/IDRIS -- France),}\\[-2mm]
% {\footnotesize Sebastian Rahtz (Elsevier -- GB)}\\[-2mm]
% {\footnotesize and}\\[-2mm]
% {\footnotesize Herbert Vo\ss\ (FU Berlin -- DE)}
% }
% \date{Version 2.8\\ \today\\
% {\small Documentation revised \today}}
%
% \maketitle
%
% \begin{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.
% \end{abstract}
%
% \tableofcontents
%
% \section{Introduction}
%
% \FVrbPackage{} is the development of the \emph{verbatim} macros of the
% \FBoxPackage{} package, Section 11 of \cite{FancyBox}. It offers six kinds
% of extended functionality, compared to the standard \LaTeX{}
% \textsf{verbatim} environment:
%
% \begin{enumerate}
% \item verbatim commands can be used in footnotes,
% \item several verbatim commands are enhanced,
% \item a variety of verbatim environments are provided, with many
% parameters to change the way the contents are printed; it is also possible
% to define new customized verbatim environments,
% \item a way is provided to save and restore verbatim text and environments,
% \item there are macros to write and read files in verbatim mode, with the
% usual versatility,
% \item you can build \emph{example} environments (showing both result and
% verbatim text), with the same versatility as normal verbatim.
% \end{enumerate}
%
% The package works by scanning a line at a time from an environment or a
% file. 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.
%
% \section{Verbatim material in footnotes}
%
% \ifChangeBar\begin{changebar}\fi
% After a \cs{VerbatimFootnotes} macro declaration (to use after the
% preamble), it is possible to put verbatim commands and environments
% (the \LaTeX{} or \FVrbPackage{} ones) in footnotes, unlike in standard
% \LaTeX:
% \ifChangeBar\end{changebar}\fi
%
% \begin{Example}
% \VerbatimFootnotes
% We can put verbatim\footnote{\verb+_Yes!_+} text in footnotes.
% \end{Example}
%
% \section{Improved verbatim commands}
%
% The \cs{DefineShortVerb} macro allows us to define a special character as
% an abbreviation to enclose verbatim text and the \cs{UndefineShortVerb}
% macro suppresses the special meaning of the specified character (the same
% \ifChangeBar\begin{changebar}\fi
% functionalities are provided in the \LaTeX{} `\textsf{shortvrb}' package):
% \ifChangeBar\end{changebar}\fi
%
% \fvset{xrightmargin=4.8cm}
%
% \begin{SideBySideExample}
% \DefineShortVerb{\|}
% We can simply write \Verb+_verbatim_+
% material using a single |_delimiter_|
% \UndefineShortVerb{\|}
% \DefineShortVerb{\+}
% And we can +_change_+ the character.
% \end{SideBySideExample}
%
% To make matters more versatile, we can nominate \emph{escape} characters
% in verbatim text (using the \cs{Verb} macro or with a `shortverb' character
% defined), to perform formatting or similar tasks, using the
% \texttt{commandchars} parameter as shown for environments in paragraph
% \ref{sec:commandchars}.
%
% \section{Verbatim environments}
%
% Several verbatim environments are available, each with a lot of
% parameters to customize them. In the following examples we use the
% \texttt{Verbatim} environment, which is the equivalent of the standard
% \texttt{verbatim}. The parameters can be set globally using the \cs{fvset}
% macro or in an optional argument after the start of the
% environment\footnote{For clarification in this paper, note that we
% generally indent each verbatim line with two
% spaces.}$^,$\footnote{This mechanism uses the
% `\textbf{keyval}' package from the standard \LaTeX{} graphics
% distribution, written by David \textsc{Carlisle}.}.
%
% \begin{SideBySideExample}
% \begin{Verbatim}
% First verbatim line.
% Second verbatim line.
% \end{Verbatim}
% \end{SideBySideExample}
%
% \subsection{Customization of verbatim environments}
%
% \ifChangeBar\begin{changebar}\fi
% The appearance of verbatim environments can be changed in many and
% varied ways; here we list the keys that can be set.
% \ifChangeBar\end{changebar}\fi
%
% \subsubsection{Comments}
%
% \begin{optlist}
% \item[commentchar (character)]: character to define comments in the
% verbatim code, so that lines starting with this character will not be
% printed (\emph{Default: empty}).
% \end{optlist}
%
% \begin{SideBySideExample}
% \begin{Verbatim}[commentchar=!]
% % A comment
% Verbatim line.
% ! A comment that you will not see
% \end{Verbatim}
% \end{SideBySideExample}
%
% \ifChangeBar\begin{changebar}\fi
% Take care to a special effect if the comment character is not the first
% 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 \FVrbPackage{} print a
% line only after finding it end character, which will never occured in this
% case...
%
% \begin{SideBySideExample}
% \begin{Verbatim}[commentchar=\%]
% First line. % First line
% Second.
% Third line. % Third line lost...
% \end{Verbatim}
% \end{SideBySideExample}
% \ifChangeBar\end{changebar}\fi
%
% \subsubsection{Initial characters to suppress}
%
% \begin{optlist}
% \item[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
% (\emph{Default: empty} \Dash no character suppressed).
% \end{optlist}
%
% \begin{SideBySideExample}
% \begin{Verbatim}
% Verbatim line.
% \end{Verbatim}
%
% \begin{Verbatim}[gobble=2]
% Verbatim line.
% \end{Verbatim}
%
% \begin{Verbatim}[gobble=8]
% Verbatim line.
% \end{Verbatim}
% \end{SideBySideExample}
%
% \subsubsection{Customization of formatting}
%
% \begin{optlist}
% \item[formatcom (command)]: command to execute before printing verbatim
% text
% (\emph{Default: empty}).
% \end{optlist}
%
% \begin{SideBySideExample}
% \begin{Verbatim}[formatcom=\color{red}]
% First verbatim line.
% Second verbatim line.
% \end{Verbatim}
% \end{SideBySideExample}
%
% \subsubsection{Changing individual line formatting}
%
% \ifChangeBar\begin{changebar}\fi
% The macro \cs{FancyVerbFormatLine} defines the way each line is formatted.
% Its default value is \verb+\def\FancyVerbFormatLine#1{#1}+, but we can
% redefine it at our convenience (\texttt{FancyVerbLine} is the name of the
% line counter):
% \ifChangeBar\end{changebar}\fi
%
% {\fvset{fontsize=\small}
% \begin{SideBySideExample}
% Z\fvset{fontsize=\normalsize}
% \renewcommand{\FancyVerbFormatLine}[1]{%
% \makebox[0cm][l]{$\Rightarrow$}#1}
% \begin{Verbatim}
% First verbatim line.
% Second verbatim line.
% Third verbatim line.
% \end{Verbatim}
% \end{SideBySideExample}
%
% \begin{SideBySideExample}
% \renewcommand{\FancyVerbFormatLine}[1]{%
% \ifodd\value{FancyVerbLine}%
% \MakeUppercase{#1}\else#1\fi}
% \begin{Verbatim}
% First verbatim line.
% Second verbatim line.
% Third verbatim line.
% \end{Verbatim}
% \end{SideBySideExample}
% }
%
% \subsubsection{Fonts}
%
% \begin{optlist}
% \item[fontfamily (family name)]: font family to use.
% \texttt{tt}, \texttt{courier} and \texttt{helvetica} are pre-defined
% (\emph{Default:~tt}).
% \end{optlist}
%
% \ifPostScriptFonts ^^A We can guess that PostScript fonts are available
% \begin{SideBySideExample}
% \begin{Verbatim}[fontfamily=helvetica]
% Verbatim line.
% \end{Verbatim}
% \end{SideBySideExample}
% \else
% \begin{quote}
% \textbf{\large Warning!} PostScript fonts seems not available on your
% platform (we are looking for the file \texttt{times.sty}, so we will
% not show the examplaes using such PostScript fonts.
% \end{quote}
% \fi
%
% \ifChangeBar\begin{changebar}\fi
% \begin{optlist}
% \item[fontsize (font size)]: size of the font to use
% (\emph{Default: auto} \Dash the same as the current font). If you use the
% `\textsf{relsize}' package too, you can require a change of the size
% proportional to the current one (for instance:
% \verb+fontsize=\relsize{-2}+).
% \end{optlist}
% \ifChangeBar\end{changebar}\fi
%
% \ifPostScriptFonts ^^A We can guess that PostScript fonts are available
% \begin{SideBySideExample}
% \begin{Verbatim}[fontsize=\small]
% Verbatim line.
% \end{Verbatim}
%
% \begin{Verbatim}[fontfamily=courier,
% fontsize=\large]
% Verbatim line.
% \end{Verbatim}
% \end{SideBySideExample}
% \else
% \begin{SideBySideExample}
% \begin{Verbatim}[fontsize=\small]
% Verbatim line.
% \end{Verbatim}
% \end{SideBySideExample}
% \fi
%
% \begin{optlist}
% \item[fontshape (font shape)]: font shape to use
% (\emph{Default: auto} \Dash the same as the current font).
% \end{optlist}
%
% \ifPostScriptFonts ^^A We can guess that PostScript fonts are available
% \begin{SideBySideExample}
% \begin{Verbatim}[fontfamily=courier,
% fontshape=it]
% Verbatim line.
% \end{Verbatim}
% \end{SideBySideExample}
% \else
% \begin{SideBySideExample}
% \begin{Verbatim}[fontshape=it]
% Verbatim line.
% \end{Verbatim}
% \end{SideBySideExample}
% \fi
%
% \begin{optlist}
% \item[fontseries (series name)]: \LaTeX{} font `series' to use
% (\emph{Default: auto} \Dash the same as the current font).
% \end{optlist}
%
% \ifPostScriptFonts ^^A We can guess that PostScript fonts are available
% \begin{SideBySideExample}
% \begin{Verbatim}[fontfamily=courier,
% fontseries=b]
% Verbatim line.
% \end{Verbatim}
% \end{SideBySideExample}
% \else
% \begin{SideBySideExample}
% \begin{Verbatim}[fontseries=b]
% Verbatim line.
% \end{Verbatim}
% \end{SideBySideExample}
% \fi
%
% \subsubsection{Types and characteristics of frames}
%
% \ifChangeBar\begin{changebar}\fi
% \begin{optlist}
% \item[frame
% (none$\mid$leftline$\mid$topline$\mid$bottomline$\mid$lines$\mid$single)]:
% type of frame around the verbatim environment
% (\emph{Default: none} \Dash no frame). With \textsf{leftline} and
% \textsf{single} modes, a space of a length given by the \LaTeX{}
% \cs{fboxsep} macro is added between the left vertical line and the text.
% \end{optlist}
% \ifChangeBar\end{changebar}\fi
%
% ^^A Problem at the top of a page...
% \ifChangeBar\leavevmode\mbox{}\begin{changebar}\fi
% \begin{SideBySideExample}
% \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}
% \end{SideBySideExample}
% \ifChangeBar\end{changebar}\fi
%
% \begin{optlist}
% \item[framerule (dimension)]: width of the rule of the frame
% (\emph{Default: 0.4pt if framing specified}).
% \end{optlist}
%
% \begin{SideBySideExample}
% \begin{Verbatim}[frame=single,
% framerule=1mm]
% Verbatim line.
% \end{Verbatim}
% \end{SideBySideExample}
%
% \begin{optlist}
% \item[framesep (dimension)]: width of the gap between the frame and
% the text (\emph{Default: \cs{fboxsep}}).
% \end{optlist}
%
% \begin{SideBySideExample}
% \begin{Verbatim}[frame=single,
% framesep=5mm]
% Verbatim line.
% \end{Verbatim}
% \end{SideBySideExample}
%
% \begin{optlist}
% \item[rulecolor (color command)]: color of the frame rule, expressed
% in the standard \LaTeX{} way
% (\emph{Default: black}).
% \end{optlist}
%
% \begin{SideBySideExample}
% \begin{Verbatim}[frame=single,
% rulecolor=\color{red}]
% Verbatim line.
% \end{Verbatim}
% \end{SideBySideExample}
%
% \begin{optlist}
% \item[fillcolor (color command)]: color used to fill the space
% between the frame and the text (its thickness is given by
% \texttt{framesep})
% (\emph{Default: none} \Dash no color).
% \end{optlist}
%
% \begin{SideBySideExample}
% \begin{Verbatim}[frame=single,
% framerule=1mm,framesep=3mm,
% rulecolor=\color{red},
% fillcolor=\color{yellow}]
% Verbatim line.
% \end{Verbatim}
% \end{SideBySideExample}
%
% \ifChangeBar\leavevmode\mbox{}\begin{changebar}\fi
% \subsubsection{Label for the environment}
%
% \begingroup
% \newcommand{\Vitem}{\SaveVerb[aftersave={\item[\UseVerb{Vitem}]}]{Vitem}}
% \DefineShortVerb{\|}
% \begin{optlist}
% \Vitem|label ({[string]string})|: label(s) to print on top, bottom or
% both frame lines of the environment to describe it content
% (\emph{Default: empty} \Dash no label).
% If the label(s) contains special characters, as a comma or an equal sign,
% it must be put inside a group. If only one string is given, it will be
% used for both top and bottom lines (if the two are printed), but if an
% optional first label is given too, this one will be used for the top line
% and the second one for the bottom line. Note also that, if another value
% than \textsf{topline}, \textsf{bottomline}, \textsf{lines} or
% \textsf{single} is used for the \textsf{frame} parameter, the label(s)
% will not be printed.
% \end{optlist}
% \endgroup
% \ifChangeBar\end{changebar}\fi
%
% ^^A Problem at the top of a page...
% \ifChangeBar\leavevmode\mbox{}\begin{changebar}\fi
% \begin{SideBySideExample}
% \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}
% \end{SideBySideExample}
%
% \begin{optlist}
% \item[labelposition (none$\mid$topline$\mid$bottomline$\mid$all)]:
% position where to print the label if one is defined, which must be
% coherent with the kind of frame chosen
% (\emph{Default: none if the label is empty, topline if one label is
% defined and all if two are defined}).
% Of course, some incompatible options (like
% \textsf{frame=topline,labelposition=bottomline}) will not print the
% label.
% \end{optlist}
% \ifChangeBar\end{changebar}\fi
%
% ^^A Problem at the top of a page...
% \ifChangeBar\leavevmode\mbox{}\begin{changebar}\fi
% \begin{SideBySideExample}
% \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}
% \end{SideBySideExample}
%
% \begin{SideBySideExample}
% \begin{Verbatim}[frame=bottomline,
% framesep=3mm,
% label=\textit{Code included},
% labelposition=bottomline]
% First verbatim line.
% Second verbatim line.
% \end{Verbatim}
%
% \begin{Verbatim}[frame=lines,
% framesep=3mm,
% label={[Beginning of code]End of code}]
% First verbatim line.
% Second verbatim line.
% \end{Verbatim}
% \end{SideBySideExample}
% \ifChangeBar\end{changebar}\fi
%
% \subsubsection{Line numbering}
%
% \begin{optlist}
% \item[numbers (none$\mid$left$\mid$right)]: numbering of the verbatim lines
% (\emph{Default: none} \Dash no numbering). If requested, this numbering is
% done \emph{outside} the verbatim environment.
% \end{optlist}
%
% \begin{SideBySideExample}
% \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}
% \end{SideBySideExample}
%
% \begin{optlist}
% \item[numbersep (dimension)]: gap between numbers and verbatim lines
% (\emph{Default: 12pt}).
% \end{optlist}
%
% \begin{SideBySideExample}
% \begin{Verbatim}[gobble=2,
% numbers=left,numbersep=2pt]
% First verbatim line.
% Second verbatim line.
% \end{Verbatim}
% \end{SideBySideExample}
%
% \begin{optlist}
% \item[firstnumber (auto$\mid$last$\mid$integer)]: number of the first line
% (\emph{Default: auto} \Dash numbering starts from 1). \textsf{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.
% \end{optlist}
%
% \begin{SideBySideExample}
% \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}
% \end{SideBySideExample}
%
% \begin{optlist}
% \item[stepnumber (integer)]: interval at which line numbers are printed
% (\emph{Default:~1} \Dash all lines are numbered).
% \end{optlist}
%
% \begin{SideBySideExample}
% \begin{Verbatim}[gobble=2,numbers=left,
% numbersep=3pt,stepnumber=2]
% First verbatim line.
% Second verbatim line.
% Third verbatim line.
% \end{Verbatim}
% \end{SideBySideExample}
%
% The macro \cs{theFancyVerbLine} defines the typesetting style of the
% numbering, and the counter used is \texttt{FancyVerbLine}:
%
% \begin{SideBySideExample}
% \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}
% \end{SideBySideExample}
%
% \ifChangeBar\begin{changebar}\fi
% \begin{optlist}
% \item[numberblanklines (boolean)]: to number or not the empty lines
% (really empty or containing blank characters only)
% (\emph{Default: true} \Dash all lines are numbered).
% \end{optlist}
%
% \begin{SideBySideExample}
% \begin{Verbatim}[gobble=2,numbers=left,
% numbersep=3pt,
% numberblanklines=false]
% First verbatim line.
%
%
% Second verbatim line.
% \end{Verbatim}
% \end{SideBySideExample}
% \ifChangeBar\end{changebar}\fi
%
% \subsubsection{Selection of lines to print}
%
% \begin{optlist}
% \item[firstline (integer)]: first line to print
% (\emph{Default: empty} \Dash all lines from the first are printed).
% \end{optlist}
%
% \begin{SideBySideExample}
% \begin{Verbatim}[gobble=2,firstline=2,
% numbers=left,numbersep=2pt]
% First verbatim line.
% Second verbatim line.
% Third verbatim line.
% \end{Verbatim}
% \end{SideBySideExample}
%
% \begin{optlist}
% \item[lastline (integer)]: last line to print
% (\emph{Default: empty} \Dash all lines until the last one are printed).
% \end{optlist}
%
% \begin{SideBySideExample}
% \begin{Verbatim}[gobble=2,lastline=1,
% numbers=left,numbersep=2pt]
% First verbatim line.
% Second verbatim line.
% Third verbatim line.
% \end{Verbatim}
% \end{SideBySideExample}
%
% % Instead of specifying a firstline at which to start printing a range
% of lines, you can define a start string; the start of the range is
% the first 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
% firstline, and end at a stop string. Specifying the strings is a
% bit klunky. Initially you must define the strings with
% \cs{newcommand*} as in:
% \begin{SideBySideExample}
% \newcommand*\FancyVerbStartString{FROM}
% \newcommand*\FancyVerbStopString{TO}
% \begin{Verbatim}[gobble=2]
% First verbatim line.
% FROM
% Second verbatim line.
% TO
% Third verbatim line.
% \end{Verbatim}
% \end{SideBySideExample}
%
% \noindent To redefine the strings, you must use \cs{renewcommand*}.
% \subsubsection{Spaces and tab characters}
%
% \begin{optlist}
% \item[showspaces (boolean)]: print a special character representing each
% space
% (\emph{Default: false} \Dash spaces not shown).
% \end{optlist}
%
% \begin{SideBySideExample}
% \begin{Verbatim}[showspaces=true]
% Verbatim line.
% \end{Verbatim}
% \end{SideBySideExample}
%
% In practice, all verbatim environments have a~\texttt{*} variant, which
% sets \texttt{showspaces=true}:
%
% \begin{SideBySideExample}
% \begin{Verbatim*}
% Verbatim line.
% \end{Verbatim*}
% \end{SideBySideExample}
%
% 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):
%
% \begin{optlist}
% \item[showtabs (boolean)]: explicitly show tab characters
% (\emph{Default: false} \Dash tab characters not shown).
% \end{optlist}
%
% \begin{optlist}
% \item[obeytabs (boolean)]: position characters according to the tabs
% (\emph{Default: false} \Dash tab characters are added to the current
% position).
% \end{optlist}
%
% \begin{optlist}
% \item[tabsize (integer)]: number of spaces given by a tab character
% (\emph{Default:~8}).
% \end{optlist}
%
% \subsubsection{Space between lines}
%
% \begin{optlist}
% \item[baselinestretch (auto$\mid$dimension)]: value to give to the usual
% `baselinestretch' \LaTeX{} parameter
% (\emph{Default: auto} \Dash its current value just before the verbatim
% command).
% \end{optlist}
%
% \begin{SideBySideExample}
% \begin{Verbatim}[baselinestretch=2]
% First verbatim line.
% Second verbatim line.
% \end{Verbatim}
% \end{SideBySideExample}
%
% \subsubsection{Escape characters for inserting commands}
%
% \begin{optlist}
% \item[commandchars (three characters)]: characters which define the
% character which starts a macro and marks the beginning and end of a group;
% thus lets us introduce \emph{escape} sequences in verbatim code. Of
% course, it is better to choose special characters which are not used in
% the verbatim text! (\emph{Default: empty}).
% \label{sec:commandchars}
% \end{optlist}
%
% \begin{SideBySideExample}
% \begin{Verbatim}[commandchars=\\\{\}]
% \textit{% This is a comment}
% First verbatim line.
% \fbox{Second} verbatim line.
% \textcolor{red}{Third} verbatim line.
% \end{Verbatim}
%
% \begin{Verbatim}[commandchars=+\[\]]
% +textit[\textbf{Verbatim} line].
% \end{Verbatim}
% \end{SideBySideExample}
%
% \ifChangeBar\begin{changebar}\fi
% Using this way, it is also possible to put labels to be able, later, to
% make reference to some lines of the verbatim environments:
%
% \begin{SideBySideExample}
% \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...
% \end{SideBySideExample}
% \ifChangeBar\end{changebar}\fi
%
% \subsubsection{Margins}
%
% \begin{optlist}
% \item[xleftmargin (dimension)]: indentation to add at the start of each
% line
% (\emph{Default:~0pt} \Dash no left margin).
% \end{optlist}
%
% \begin{SideBySideExample}
% \begin{Verbatim}[frame=single,
% xleftmargin=5mm]
% Verbatim line.
% \end{Verbatim}
% \end{SideBySideExample}
%
% \begin{optlist}
% \item[xrightmargin (dimension)]: right margin to add after each line
% (\emph{Default:~0pt} \Dash no right margin).
% \end{optlist}
%
% \begin{SideBySideExample}
% \begin{Verbatim}[frame=single,
% xrightmargin=1cm]
% Verbatim line.
% \end{Verbatim}
% \end{SideBySideExample}
%
% \begin{optlist}
% \item[resetmargins (boolean)]: reset the left margin, which is useful if
% we are inside other indented environments (\emph{Default: false} \Dash no
% reset of the margin).
% \end{optlist}
%
% {%
% \DefineVerbatimEnvironment{Verbatim}{Verbatim}{gobble=0,numbers=none}
% \begin{SideBySideExample}
% \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}
% \end{SideBySideExample}
% }
%
% \subsubsection{Overfull box messages}
%
% \begin{optlist}
% \item[hfuzz (dimension)]: value to give to the \TeX{} \cs{hfuzz} dimension
% for text to format. This can be used to avoid seeing some unimportant
% \emph{Overfull box} messages (\emph{Default:~2pt}).
% \end{optlist}
%
% \subsubsection{Page breaks}
%
% \begin{optlist}