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
|
%%
%% This is file `fvrb-ex.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% fvrb-ex.dtx (with options: `fvrb-ex')
%%
%% IMPORTANT NOTICE:
%%
%% For the copyright see the source file.
%%
%% Any modified versions of this file must be renamed
%% with new filenames distinct from fvrb-ex.sty.
%%
%% For distribution of the original source see the terms
%% for copying and modification in the file fvrb-ex.dtx.
%%
%% This generated file may be distributed as long as the
%% original source files, as listed above, are part of the
%% same distribution. (The sources need not necessarily be
%% in the same archive or directory.)
%%
%% Package `fvrb-ex' (`fvrb-ex', `hbaw' and `hcolor')
%%
%% COPYING:
%% 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.
%%
%% Denis Girou (CNRS/IDRIS - France) <Denis.Girou@idris.fr> March 27, 1998
%%
%% Package `fvrb-ex'
%%
\NeedsTeXFormat{LaTeX2e}
\def\fileversion{1.9}
\def\filedate{2010/05/16}
\ProvidesPackage{fvrb-ex}[\filedate]
\message{`fvrb-ex' v\fileversion, \filedate\space (Denis Girou)}
\newif\ifpstricks\pstricksfalse
\let\LoadPStricks=\relax
\DeclareOption{pstricks}{\def\LoadPStricks{\RequirePackage{pstricks}}\pstrickstrue}
\DeclareOption{baw}{\def\ColorVersion{n}}
\DeclareOption{color}{\def\ColorVersion{y}}
\DeclareOption{bawcolor}{\def\ColorVersion{?}}
\ProcessOptions\relax
\LoadPStricks
\ifpstricks\RequirePackage{pstricks}\fi
\RequirePackage{fancyvrb}
\newread\ttyin
\def\iden#1{#1}
\def\strip#1#2 \@gobble{\def #1{#2}}
\def\@defpar{\par}
\def\@gobble#1{}
\def\Ask#1#2{%
\message{#2}\read\ttyin to #1\ifx#1\@defpar\def#1{}\else
\iden{\expandafter\strip\expandafter#1#1\@gobble\@gobble} \@gobble\fi}
\def\Answer@Yes{y}
\def\Answer@No{n}
\def\Question@Mark{?}
\def\Question@Color{Color version? (y=yes)}
\def\Highlight@Attributes{} % Default=nothing
\def\NoHighlight@Attributes{} % Default=nothing
\ifx\ColorVersion\Answer@Yes
\RequirePackage{color} % Standard LaTeX `color' package
\RequirePackage{hcolor} % Color version
\fi
\ifx\ColorVersion\Answer@No
\RequirePackage{color} % Standard LaTeX `color' package
\RequirePackage{hbaw} % Black and white version
\fi
\ifx\ColorVersion\Question@Mark
\Ask\ColorVersion{^^J\Question@Color}
\ifx\ColorVersion\Answer@Yes
\RequirePackage{color} % Standard LaTeX `color' package
\RequirePackage{hcolor} % Color version
\else
\RequirePackage{color} % Standard LaTeX `color' package
\RequirePackage{hbaw} % Black and white version
\fi
\fi
\fvset{gobble=2}
\newif\ifFvrbEx@Grid
\def\Example{%
\catcode`\^^M=\active
\@ifnextchar[{\catcode`\^^M=5\Example@}{\catcode`\^^M=5\Begin@Example}}
\def\endExample{%
\end{VerbatimOut}%
\Below@Example{\input{\jobname.tmp}}}
\def\Example@[#1]{\fvset{#1}\Begin@Example}
\def\CenterExample{%
\catcode`\^^M=\active
\@ifnextchar[{\catcode`\^^M=5\Example@}{\catcode`\^^M=5\Begin@Example}}
\def\endCenterExample{%
\end{VerbatimOut}%
\center
\Below@Example{\input{\jobname.tmp}}
\endcenter}
\def\SideBySideExample{%
\catcode`\^^M=\active
\@ifnextchar[{\catcode`\^^M=5\Example@}%
{\catcode`\^^M=5\Begin@Example}}
\def\endSideBySideExample{%
\end{VerbatimOut}%
\SideBySide@Example{\input{\jobname.tmp}}}
\newcommand{\Begin@Example}{%
\parindent=0pt
\multiply\topsep by 2
\VerbatimEnvironment
\begin{VerbatimOut}[codes={\catcode`\^^a3=12\catcode`\^^a7=12\catcode`\^^b5=12%
\catcode`\^^b6=12}]{\jobname.tmp}}
\newcommand{\Below@Example}[1]{%
\VerbatimInput[gobble=0,commentchar=^^a3,commandchars=^^a7^^b5^^b6,numbersep=3pt]%
{\jobname.tmp}
\catcode`\^^a3=9\relax%
\NoHighlight@Attributes % To suppress possible highlighting
\ifFvrbEx@Grid\vspace{5pt}\fi
#1%
\ifFvrbEx@Grid\vspace{5pt}\fi
\par}
\newcommand{\SideBySide@Example}[1]{%
\@tempdimb=\FV@XRightMargin
\advance\@tempdimb -5mm
\begin{minipage}[c]{\@tempdimb}
\fvset{xrightmargin=0pt}
\catcode`\^^a3=9\relax%
\NoHighlight@Attributes % To suppress possible highlighting
#1
\end{minipage}%
\@tempdimb=\textwidth
\advance\@tempdimb -\FV@XRightMargin
\advance\@tempdimb 5mm
\begin{minipage}[c]{\@tempdimb}
\VerbatimInput[gobble=0,commentchar=^^a3,commandchars=^^a7^^b5^^b6,numbersep=3pt,
xleftmargin=5mm,xrightmargin=0pt]{\jobname.tmp}
\end{minipage}}
\ifx\PSTricksLoaded\endinput
\newcommand{\showgrid}{\FvrbEx@Gridtrue}
\newpsobject{FvrbExGrid}{psgrid}{subgriddiv=0,griddots=10,gridlabels=7pt}
\def\PCenterExample{\@ifnextchar[{\Pst@Example}{\Pst@@Example}}
\def\endPCenterExample{%
\end{VerbatimOut}%
\Below@Example{%
\center
\expandafter\pspicture\Picture@Size
\ifFvrbEx@Grid\FvrbExGrid\fi\relax
\input{\jobname.tmp}%
\endpspicture
\endcenter
\smallskip}}
\def\PSideBySideExample{\@ifnextchar[{\Pst@Example}{\Pst@@Example}}
\def\endPSideBySideExample{%
\end{VerbatimOut}%
\SideBySide@Example{%
\ifFvrbEx@Grid\vspace{5pt}\fi
\expandafter\pspicture\Picture@Size
\ifFvrbEx@Grid\FvrbExGrid\fi\relax
\input{\jobname.tmp}%
\endpspicture
\ifFvrbEx@Grid\vspace{5pt}\fi
\smallskip}}
\def\Pst@Example[#1]{\fvset{#1}\Pst@@Example}
\def\Pst@@Example#1(#2,#3){%
\catcode`\^^M=\active
\@ifnextchar({\catcode`\^^M=5\Pst@@@Example(#2,#3)}
{\catcode`\^^M=5\Pst@@@Example(0,0)(#2,#3)}}
\def\Pst@@@Example(#1,#2)(#3,#4){%
\def\Picture@Size{(#1,#2)(#3,#4)}%
\Begin@Example}
\fi % End \ifx\PSTricksLoaded
\endinput
%%
%% End of file `fvrb-ex.sty'.
|