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
|
%%
%% This is file `xkvview.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% xkeyval.dtx (with options: `xkvview')
%%
%% ---------------------------------------
%% Copyright (C) 2004-2022 Hendri Adriaens
%% ---------------------------------------
%%
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either version 1.3
%% of this license or (at your option) any later version.
%% The latest version of this license is in
%% http://www.latex-project.org/lppl.txt
%% and version 1.3 or later is part of all distributions of LaTeX
%% version 2003/12/01 or later.
%%
%% This work has the LPPL maintenance status "maintained".
%%
%% This Current Maintainer of this work is Hendri Adriaens.
%%
%% This work consists of the file xkeyval.dtx and derived files
%% keyval.tex, xkvtxhdr.tex, xkeyval.sty, xkeyval.tex, xkvview.sty,
%% xkvltxp.sty, xkvutils.tex, pst-xkey.tex, pst-xkey.sty, xkveca.cls,
%% xkvecb.cls, xkvesa.sty, xkvesb.sty, xkvesc.sty, xkvex1.tex,
%% xkvex2.tex, xkvex3.tex and xkvex4.tex.
%%
%% The following files constitute the xkeyval bundle and must be
%% distributed as a whole: readme, xkeyval.pdf, keyval.tex,
%% pst-xkey.sty, pst-xkey.tex, xkeyval.sty, xkeyval.tex, xkvview.sty,
%% xkvltxp.sty, xkvtxhdr.tex, xkvutils.tex, pst-xkey.dtx and xkeyval.dtx.
%%
\NeedsTeXFormat{LaTeX2e}[1995/12/01]
\ProvidesPackage{xkvview}%
[2008/08/10 v1.5 viewer utility for xkeyval (HA)]
\RequirePackage{xkeyval}
\RequirePackage{longtable}
\DeclareOptionX*{%
\PackageWarning{xkvview}{Unknown option `\CurrentOption'}%
}
\ProcessOptionsX
\newif\ifXKVV@vwkey
\newif\ifXKVV@colii
\newif\ifXKVV@coliii
\newif\ifXKVV@coliv
\newif\ifXKVV@colv
\newwrite\XKVV@out
\let\XKVV@db\@empty
\define@cmdkeys[XKVV]{xkvview}[XKVV@]{%
prefix,family,type,default,file,columns,wcolsep,weol}[\@nil]
\define@boolkeys[XKVV]{xkvview}[XKVV@]{view,vlabels,wlabels}[true]
\presetkeys[XKVV]{xkvview}{prefix,family,type,default,file,%
columns,wcolsep=&,weol=\\,view,vlabels=false,wlabels=false}{}
\def\XKVV@tabulate#1#2#3{%
\def\XKV@tempa{#3}%
\@onelevel@sanitize\XKV@tempa
\XKV@addtolist@x\XKVV@db{#1=\ifx\XKV@prefix\@empty\else\expandafter
\XKVV@t@bulate\XKV@prefix\fi=\XKV@tfam=#2=\XKV@tempa}%
}
\def\XKVV@t@bulate#1@{#1}
\def\XKV@define@key#1{%
\@ifnextchar[{\XKV@d@fine@k@y{#1}}{%
\XKVV@tabulate{#1}{ordinary}{[none]}%
\expandafter\def\csname\XKV@header#1\endcsname####1%
}%
}
\def\XKV@d@fine@k@y#1[#2]{%
\XKVV@tabulate{#1}{ordinary}{#2}%
\XKV@define@default{#1}{#2}%
\expandafter\def\csname\XKV@header#1\endcsname##1%
}
\def\XKV@define@cmdkey#1#2[#3]#4{%
\ifXKV@st
\XKVV@tabulate{#2}{command}{#3}%
\XKV@define@default{#2}{#3}%
\else
\XKVV@tabulate{#2}{command}{[none]}%
\fi
\def\XKV@tempa{\expandafter\def\csname\XKV@header#2\endcsname####1}%
\begingroup\expandafter\endgroup\expandafter\XKV@tempa\expandafter
{\expandafter\def\csname#1#2\endcsname{##1}#4}%
}
\def\XKV@d@fine@ch@icekey#1[#2]{%
\XKVV@tabulate{#1}{choice}{#2}%
\XKV@define@default{#1}{#2}%
\XKV@d@fine@ch@ic@key{#1}%
}
\def\XKV@d@fine@ch@ic@key#1{%
\XKVV@tabulate{#1}{choice}{[none]}%
\ifXKV@pl\XKV@afterelsefi
\expandafter\XKV@d@f@ne@ch@ic@k@y
\else\XKV@afterfi
\expandafter\XKV@d@f@ne@ch@ic@key
\fi
\csname\XKV@header#1\endcsname
}
\def\XKV@d@f@ne@b@olkey#1#2#3#4#5{%
\expandafter\newif\csname if#3\endcsname
\ifXKV@st
\XKVV@tabulate{#2}{boolean}{#4}%
\XKV@define@default{#2}{#4}%
\else
\XKVV@tabulate{#2}{boolean}{[none]}%
\fi
\ifXKV@pl
\def#1##1{\XKV@pltrue\XKV@sttrue
\XKV@checkchoice[\XKV@resa]{##1}{true,false}#5%
}%
\else
\def#1##1{\XKV@plfalse\XKV@sttrue
\XKV@checkchoice[\XKV@resa]{##1}{true,false}#5%
}%
\fi
}
\def\xkvview#1{%
\setkeys[XKVV]{xkvview}{#1}%
\ifx\XKVV@default\@nnil\else\@onelevel@sanitize\XKVV@default\fi
\ifx\XKVV@columns\@nnil
\count@5
\XKVV@coliitrue\XKVV@coliiitrue\XKVV@colivtrue\XKVV@colvtrue
\else
\count@\@ne
\@expandtwoargs\in@{,prefix,}{,\XKVV@columns,}%
\ifin@\advance\count@\@ne\XKVV@coliitrue\else\XKVV@coliifalse\fi
\@expandtwoargs\in@{,family,}{,\XKVV@columns,}%
\ifin@\advance\count@\@ne\XKVV@coliiitrue\else\XKVV@coliiifalse\fi
\@expandtwoargs\in@{,type,}{,\XKVV@columns,}%
\ifin@\advance\count@\@ne\XKVV@colivtrue\else\XKVV@colivfalse\fi
\@expandtwoargs\in@{,default,}{,\XKVV@columns,}%
\ifin@\advance\count@\@ne\XKVV@colvtrue\else\XKVV@colvfalse\fi
\fi
\ifXKVV@view
\protected@edef\XKV@tempa{\noexpand\begin{longtable}[l]{%
*\the\count@ l}\normalfont Key\ifXKVV@colii&\normalfont Prefix%
\fi\ifXKVV@coliii&\normalfont Family\fi\ifXKVV@coliv&\normalfont
Type\fi\ifXKVV@colv&\normalfont Default\fi\\\noexpand\hline
\noexpand\endfirsthead\noexpand\multicolumn{\the\count@}{l}{%
\normalfont\emph{Continued from previous page}}\\\noexpand\hline
\normalfont Key\ifXKVV@colii&\normalfont Prefix\fi\ifXKVV@coliii
&\normalfont Family\fi\ifXKVV@coliv&\normalfont Type\fi
\ifXKVV@colv&\normalfont Default\fi\\\noexpand\hline\noexpand
\endhead\noexpand\hline\noexpand\multicolumn{\the\count@}{r}{%
\normalfont\emph{Continued on next page}}\\\noexpand\endfoot
\noexpand\hline\noexpand\endlastfoot
}%
\XKV@toks\expandafter{\XKV@tempa}%
\fi
\ifx\XKVV@file\@nnil\else\immediate\openout\XKVV@out\XKVV@file\fi
\XKV@for@o\XKVV@db\XKV@tempa{%
\XKVV@vwkeytrue\expandafter\XKVV@xkvview\XKV@tempa\@nil
}%
\ifXKVV@view
\addto@hook\XKV@toks{\end{longtable}}%
\begingroup\ttfamily\the\XKV@toks\endgroup
\fi
\ifx\XKVV@file\@nnil\else\immediate\closeout\XKVV@out\fi
}
\def\XKVV@xkvview#1=#2=#3=#4=#5\@nil{%
\ifx\XKVV@prefix\@nnil\else
\def\XKV@tempa{#2}%
\ifx\XKV@tempa\XKVV@prefix\else\XKVV@vwkeyfalse\fi
\fi
\ifx\XKVV@family\@nnil\else
\def\XKV@tempa{#3}%
\ifx\XKV@tempa\XKVV@family\else\XKVV@vwkeyfalse\fi
\fi
\ifx\XKVV@type\@nnil\else
\def\XKV@tempa{#4}%
\ifx\XKV@tempa\XKVV@type\else\XKVV@vwkeyfalse\fi
\fi
\ifx\XKVV@default\@nnil\else
\def\XKV@tempa{#5}%
\ifx\XKV@tempa\XKVV@default\else\XKVV@vwkeyfalse\fi
\fi
\ifXKVV@vwkey
\ifXKVV@view
\edef\XKV@tempa{%
#1\ifXKVV@colii\fi\ifXKVV@coliii\fi
\ifXKVV@coliv\fi\ifXKVV@colv\fi
\ifXKVV@vlabels\noexpand\label{#2-#3-#1}\fi
}%
\expandafter\addto@hook\expandafter
\XKV@toks\expandafter{\XKV@tempa\\}%
\fi
\ifx\XKVV@file\@nnil\else
\immediate\write\XKVV@out{%
#1\ifXKVV@colii\XKVV@wcolsep#2\fi
\ifXKVV@coliii\XKVV@wcolsep#3\fi
\ifXKVV@coliv\XKVV@wcolsep#4\fi
\ifXKVV@colv\XKVV@wcolsep#5\fi
\ifXKVV@wlabels\string\label{#2-#3-#1}\fi
\expandafter\noexpand\XKVV@weol
}%
\fi
\fi
}
\endinput
%%
%% End of file `xkvview.sty'.
|