diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/fancyvrb/fvrb-ex.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/fancyvrb/fvrb-ex.sty | 173 |
1 files changed, 173 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/fancyvrb/fvrb-ex.sty b/Master/texmf-dist/tex/latex/fancyvrb/fvrb-ex.sty new file mode 100644 index 00000000000..7a9a6167d18 --- /dev/null +++ b/Master/texmf-dist/tex/latex/fancyvrb/fvrb-ex.sty @@ -0,0 +1,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: +%% The files of this package "fvrb-ex" are released under the Artistic +%% License Version 2. A copy of that license is included in the file +%% artistic2.txt inside the fancyvrb package. This package consists of +%% the following files: +%% README fvrb-ex.dtx fvrb-ex.ins +%% +%% Denis Girou (CNRS/IDRIS - France) <Denis.Girou@idris.fr> +%% March 27, 1998 +%% +%% Package `fvrb-ex' +%% +\NeedsTeXFormat{LaTeX2e} +\def\fileversion{1.7} +\def\filedate{1998/03/26} +\ProvidesPackage{fvrb-ex}[\filedate] +\message{`fvrb-ex' v\fileversion, \filedate\space (Denis Girou)} +\RequirePackage{fancyvrb} +\DeclareOption{pstricks}{% +\ifx\PSTricksLoaded\endinput\else\input pstricks.tex\fi} +\DeclareOption{baw}{\def\ColorVersion{n}} +\DeclareOption{color}{\def\ColorVersion{y}} +\DeclareOption{bawcolor}{\def\ColorVersion{?}} +\ProcessOptions +\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`\£=12\catcode`\§=12\catcode`\µ=12% + \catcode`\¶=12}]{\jobname.tmp}} +\newcommand{\Below@Example}[1]{% +\VerbatimInput[gobble=0,commentchar=£,commandchars=§µ¶,numbersep=3pt]% + {\jobname.tmp} +\catcode`\£=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`\£=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=£,commandchars=§µ¶,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'. |