"Fossies" - the Fresh Open Source Software Archive

Member "hevea-2.35/html/fancyvrb.hva" (16 Jan 2021, 4642 Bytes) of package /linux/www/hevea-2.35.tar.gz:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 \@primitives{fancyvrb}
    2 \usepackage{keyval}
    3 %%%%%%%% Helper
    4 \def\verb@table#1{\@open{table}{#1}\@open{tr}{}\@open{td}{}}
    5 \def\verb@elbat{\@close{td}\@close{tr}\@close{table}}
    6 %%%%%%%%% Font size
    7 \define@key{fancyvrb}{fontsize}{\def\verb@size{#1}}
    8 \def\verb@size{}
    9 \define@key{fancyvrb}{fontshape}{\def\verb@shape{\csname #1shape\endcsname}}
   10 \def\verb@shape{}
   11 %%%%%%% Labels
   12 \def\verb@label@
   13   #1{\@open{tr}{}\@open{th}{style="text-align:center" colspan=3}#1\@close{th}\@close{tr}}
   14 \def\verb@toplabel{}\def\verb@bottomlabel{}
   15 \def\verb@deftop#1{\def\verb@toplabel{\ifverb@top\verb@horiz@line\verb@label@{#1}\fi}}
   16 \def\verb@defbottom#1{\def\verb@bottomlabel{\ifverb@bottom\verb@label@{#1}\verb@horiz@line\fi}}
   17 \newcommand{\verb@labelkey}[2][]
   18   {\def\verb@test{#1}%
   19   \ifx\verb@test\@empty\def\verb@label{#2}\else
   20   \def\verb@label{#1}\def\verb@labelbis{#2}\fi}
   21 \newcommand{\verb@labels}[2][]
   22   {\def\verb@test{#1}%
   23   \ifx\verb@test\@empty\verb@deftop{#2}\else
   24   \verb@deftop{#1}\verb@defbottom{#2}\fi}
   25 \define@key{fancyvrb}{label}{\@callopt{\verb@labelkey}{#1}}
   26 \def\verb@labelpos{default}
   27 \define@key{fancyvrb}{labelposition}{\def\verb@labelpos{#1}}
   28 %%%%%%% Framing
   29 \def\verb@framesize{2}
   30 \define@key{fancyvrb}{framerule}{\def\verb@framesize{\@getlength{#1}}}
   31 \def\verb@framesep{1}
   32 \define@key{fancyvrb}{framesep}{\def\verb@framesep{\@getlength{#1}}}
   33 \def\verb@rulecolor{black}
   34 \def\verb@rulecolor@key
   35 #1{\def\verb@rulecolor{{\let\color\@getcolor#1}}}
   36 \define@key{fancyvrb}{rulecolor}{\verb@rulecolor@key{#1}}
   37 \def\verb@fillcolor@key
   38 #1{\def\verb@fillcolor{{\let\color\@getcolor{}BGCOLOR=#1{}}}}
   39 \define@key{fancyvrb}{fillcolor}{\verb@fillcolor@key{#1}}
   40 \def\verb@fillcolor{}
   41 \def\verb@horiz@line
   42   {\@open{tr}{}\verb@vert@line[3]\@close{tr}}
   43 \newcommand{\verb@vert@line}[1][1]
   44   {\@open{td}{style="background-color:\verb@rulecolor{}" colspan="\@getprint{#1}"}%
   45    \verb@table{style="border-spacing:\verb@framesize;border:0;border-collapse:separate" class="cellpadding0"}
   46    \verb@elbat\@close{td}}
   47 \define@key{fancyvrb}{frame}{\def\verb@frame{#1}}
   48 \def\verb@frame{none}
   49 \def\begin@frame@{\@open{table}{style="border:0;border-spacing:0" class="cellpadding0"}\verb@toplabel\@open{tr}{}\@open{td}{}\@open{table}{\@getprint{\verb@fillcolor} style="border:0;border-spacing:0" class="cellpadding0"
   50  }\ifverb@top\verb@horiz@line\fi\@open{tr}{}\ifverb@left\verb@vert@line\fi\@open{td}{}\@open{table}{style="border:0;border-spacing:0"}\@open{tr}{}\@open{td}{style="padding:\verb@framesep"}}
   51 \def\end@frame@{\@close{td}\@close{tr}\@close{table}\@close{td}\ifverb@right\verb@vert@line\fi\@close{tr}\ifverb@bottom\verb@horiz@line\fi\@close{table}\@close{td}\@close{tr}\verb@bottomlabel\@close{table}}
   52 \newif\ifverb@left\newif\ifverb@bottom\newif\ifverb@top\newif\ifverb@right
   53 \def\reset@frame
   54   {\setcounter{verb@count}{0}%
   55   \verb@leftfalse\verb@bottomfalse\verb@topfalse\verb@rightfalse%
   56   \def\verb@toplabel{}\def\verb@bottomlabel{}}
   57 \def\verb@labelmaker#1#2{\ifu#2\else#1#2\fi}
   58 \def\check@labels
   59   {\ifthenelse{\equal{\verb@labelpos}{topline}}
   60     {\verb@labelmaker{\verb@deftop}{\verb@label}}{}%
   61   \ifthenelse{\equal{\verb@labelpos}{bottomline}}
   62     {\verb@labelmaker{\verb@defbottom}{\verb@label}%
   63     \verb@labelmaker{\verb@defbottom}{\verb@labelbis}}{}%
   64   \ifthenelse{\equal{\verb@labelpos}{all}}
   65     {\verb@labelmaker{\verb@deftop}{\verb@label}%
   66     \verb@labelmaker{\verb@defbottom}{\verb@label}%
   67     \verb@labelmaker{\verb@defbottom}{\verb@labelbis}}{}%
   68   \ifthenelse{\equal{\verb@labelpos}{default}}
   69     {\verb@labelmaker{\verb@deftop}{\verb@label}%
   70     \verb@labelmaker{\verb@defbottom}{\verb@labelbis}}{}}
   71 \def\check@frame
   72   {\reset@frame%
   73    \ifthenelse{\equal{\verb@frame}{lines}}{\verb@toptrue\verb@bottomtrue}{}%
   74    \ifthenelse{\equal{\verb@frame}{leftline}}{\verb@lefttrue}{}%
   75    \ifthenelse{\equal{\verb@frame}{topline}}{\verb@toptrue}{}%
   76    \ifthenelse{\equal{\verb@frame}{bottomline}}{\verb@bottomtrue}{}%
   77    \ifthenelse{\equal{\verb@frame}{single}}
   78      {\verb@toptrue\verb@bottomtrue\verb@lefttrue\verb@righttrue}{}%
   79    \ifthenelse{\equal{\verb@frame}{none}}
   80       {\let\begin@frame\@empty\let\end@frame\@empty}
   81       {\check@labels\let\begin@frame\begin@frame@\let\end@frame\end@frame@}}
   82 %%%%%%%%% Line numbers
   83 \newcounter{verb@count}
   84 \newcommand{\verb@startline}{\stepcounter{verb@count}\theverb@count}
   85 %%%%%%%%%% User command
   86 \newcommand{\fvset}[1]{\@setkeys{fancyvrb}{#1}}
   87 \newenvironment{Verbatim}[1][]
   88   {\@setkeys{fancyvrb}{#1}%
   89   \def\endVerbatim{\@endVerbatim\end@frame}%
   90   \check@frame\begin@frame\verb@shape\verb@size\@Verbatim}
   91   {}
   92 \newcommand{\VerbatimInput}[1]
   93   {\@scaninput{\begin{Verbatim}}{#1}{\end{Verbatim}}}