| 1 |
%% |
| 2 |
%% This is file `xkvview.sty', |
| 3 |
%% generated with the docstrip utility. |
| 4 |
%% |
| 5 |
%% The original source files were: |
| 6 |
%% |
| 7 |
%% xkeyval.dtx (with options: `xkvview') |
| 8 |
%% |
| 9 |
%% --------------------------------------- |
| 10 |
%% Copyright (C) 2004-2022 Hendri Adriaens |
| 11 |
%% 2025 David Carlisle for latex-package-repositories |
| 12 |
%% --------------------------------------- |
| 13 |
%% |
| 14 |
%% This work may be distributed and/or modified under the |
| 15 |
%% conditions of the LaTeX Project Public License, either version 1.3 |
| 16 |
%% of this license or (at your option) any later version. |
| 17 |
%% The latest version of this license is in |
| 18 |
%% http://www.latex-project.org/lppl.txt |
| 19 |
%% and version 1.3 or later is part of all distributions of LaTeX |
| 20 |
%% version 2003/12/01 or later. |
| 21 |
%% |
| 22 |
%% This work has the LPPL maintenance status "maintained". |
| 23 |
%% |
| 24 |
%% This Current Maintainer of this work is Hendri Adriaens. |
| 25 |
%% |
| 26 |
%% This work consists of the file xkeyval.dtx and derived files |
| 27 |
%% keyval.tex, xkvtxhdr.tex, xkeyval.sty, xkeyval.tex, xkvview.sty, |
| 28 |
%% xkvltxp.sty, xkvutils.tex, pst-xkey.tex, pst-xkey.sty, xkveca.cls, |
| 29 |
%% xkvecb.cls, xkvesa.sty, xkvesb.sty, xkvesc.sty, xkvex1.tex, |
| 30 |
%% xkvex2.tex, xkvex3.tex and xkvex4.tex. |
| 31 |
%% |
| 32 |
%% The following files constitute the xkeyval bundle and must be |
| 33 |
%% distributed as a whole: readme, xkeyval.pdf, keyval.tex, |
| 34 |
%% pst-xkey.sty, pst-xkey.tex, xkeyval.sty, xkeyval.tex, xkvview.sty, |
| 35 |
%% xkvltxp.sty, xkvtxhdr.tex, xkvutils.tex, pst-xkey.dtx and xkeyval.dtx. |
| 36 |
%% |
| 37 |
\NeedsTeXFormat{LaTeX2e}[1995/12/01] |
| 38 |
\ProvidesPackage{xkvview}% |
| 39 |
[2008/08/10 v1.5 viewer utility for xkeyval (HA)] |
| 40 |
\RequirePackage{xkeyval} |
| 41 |
\RequirePackage{longtable} |
| 42 |
\DeclareOptionX*{% |
| 43 |
\PackageWarning{xkvview}{Unknown option `\CurrentOption'}% |
| 44 |
} |
| 45 |
\ProcessOptionsX |
| 46 |
\newif\ifXKVV@vwkey |
| 47 |
\newif\ifXKVV@colii |
| 48 |
\newif\ifXKVV@coliii |
| 49 |
\newif\ifXKVV@coliv |
| 50 |
\newif\ifXKVV@colv |
| 51 |
\newwrite\XKVV@out |
| 52 |
\let\XKVV@db\@empty |
| 53 |
\define@cmdkeys[XKVV]{xkvview}[XKVV@]{% |
| 54 |
prefix,family,type,default,file,columns,wcolsep,weol}[\@nil] |
| 55 |
\define@boolkeys[XKVV]{xkvview}[XKVV@]{view,vlabels,wlabels}[true] |
| 56 |
\presetkeys[XKVV]{xkvview}{prefix,family,type,default,file,% |
| 57 |
columns,wcolsep=&,weol=\\,view,vlabels=false,wlabels=false}{} |
| 58 |
\def\XKVV@tabulate#1#2#3{% |
| 59 |
\def\XKV@tempa{#3}% |
| 60 |
\@onelevel@sanitize\XKV@tempa |
| 61 |
\XKV@addtolist@x\XKVV@db{#1=\ifx\XKV@prefix\@empty\else\expandafter |
| 62 |
\XKVV@t@bulate\XKV@prefix\fi=\XKV@tfam=#2=\XKV@tempa}% |
| 63 |
} |
| 64 |
\def\XKVV@t@bulate#1@{#1} |
| 65 |
\def\XKV@define@key#1{% |
| 66 |
\@ifnextchar[{\XKV@d@fine@k@y{#1}}{% |
| 67 |
\XKVV@tabulate{#1}{ordinary}{[none]}% |
| 68 |
\expandafter\def\csname\XKV@header#1\endcsname####1% |
| 69 |
}% |
| 70 |
} |
| 71 |
\def\XKV@d@fine@k@y#1[#2]{% |
| 72 |
\XKVV@tabulate{#1}{ordinary}{#2}% |
| 73 |
\XKV@define@default{#1}{#2}% |
| 74 |
\expandafter\def\csname\XKV@header#1\endcsname##1% |
| 75 |
} |
| 76 |
\def\XKV@define@cmdkey#1#2[#3]#4{% |
| 77 |
\ifXKV@st |
| 78 |
\XKVV@tabulate{#2}{command}{#3}% |
| 79 |
\XKV@define@default{#2}{#3}% |
| 80 |
\else |
| 81 |
\XKVV@tabulate{#2}{command}{[none]}% |
| 82 |
\fi |
| 83 |
\def\XKV@tempa{\expandafter\def\csname\XKV@header#2\endcsname####1}% |
| 84 |
\begingroup\expandafter\endgroup\expandafter\XKV@tempa\expandafter |
| 85 |
{\expandafter\def\csname#1#2\endcsname{##1}#4}% |
| 86 |
} |
| 87 |
\def\XKV@d@fine@ch@icekey#1[#2]{% |
| 88 |
\XKVV@tabulate{#1}{choice}{#2}% |
| 89 |
\XKV@define@default{#1}{#2}% |
| 90 |
\XKV@d@fine@ch@ic@key{#1}% |
| 91 |
} |
| 92 |
\def\XKV@d@fine@ch@ic@key#1{% |
| 93 |
\XKVV@tabulate{#1}{choice}{[none]}% |
| 94 |
\ifXKV@pl\XKV@afterelsefi |
| 95 |
\expandafter\XKV@d@f@ne@ch@ic@k@y |
| 96 |
\else\XKV@afterfi |
| 97 |
\expandafter\XKV@d@f@ne@ch@ic@key |
| 98 |
\fi |
| 99 |
\csname\XKV@header#1\endcsname |
| 100 |
} |
| 101 |
\def\XKV@d@f@ne@b@olkey#1#2#3#4#5{% |
| 102 |
\expandafter\newif\csname if#3\endcsname |
| 103 |
\ifXKV@st |
| 104 |
\XKVV@tabulate{#2}{boolean}{#4}% |
| 105 |
\XKV@define@default{#2}{#4}% |
| 106 |
\else |
| 107 |
\XKVV@tabulate{#2}{boolean}{[none]}% |
| 108 |
\fi |
| 109 |
\ifXKV@pl |
| 110 |
\def#1##1{\XKV@pltrue\XKV@sttrue |
| 111 |
\XKV@checkchoice[\XKV@resa]{##1}{true,false}#5% |
| 112 |
}% |
| 113 |
\else |
| 114 |
\def#1##1{\XKV@plfalse\XKV@sttrue |
| 115 |
\XKV@checkchoice[\XKV@resa]{##1}{true,false}#5% |
| 116 |
}% |
| 117 |
\fi |
| 118 |
} |
| 119 |
\def\xkvview#1{% |
| 120 |
\setkeys[XKVV]{xkvview}{#1}% |
| 121 |
\ifx\XKVV@default\@nnil\else\@onelevel@sanitize\XKVV@default\fi |
| 122 |
\ifx\XKVV@columns\@nnil |
| 123 |
\count@5 |
| 124 |
\XKVV@coliitrue\XKVV@coliiitrue\XKVV@colivtrue\XKVV@colvtrue |
| 125 |
\else |
| 126 |
\count@\@ne |
| 127 |
\@expandtwoargs\in@{,prefix,}{,\XKVV@columns,}% |
| 128 |
\ifin@\advance\count@\@ne\XKVV@coliitrue\else\XKVV@coliifalse\fi |
| 129 |
\@expandtwoargs\in@{,family,}{,\XKVV@columns,}% |
| 130 |
\ifin@\advance\count@\@ne\XKVV@coliiitrue\else\XKVV@coliiifalse\fi |
| 131 |
\@expandtwoargs\in@{,type,}{,\XKVV@columns,}% |
| 132 |
\ifin@\advance\count@\@ne\XKVV@colivtrue\else\XKVV@colivfalse\fi |
| 133 |
\@expandtwoargs\in@{,default,}{,\XKVV@columns,}% |
| 134 |
\ifin@\advance\count@\@ne\XKVV@colvtrue\else\XKVV@colvfalse\fi |
| 135 |
\fi |
| 136 |
\ifXKVV@view |
| 137 |
\protected@edef\XKV@tempa{\noexpand\begin{longtable}[l]{% |
| 138 |
*\the\count@ l}\normalfont Key\ifXKVV@colii&\normalfont Prefix% |
| 139 |
\fi\ifXKVV@coliii&\normalfont Family\fi\ifXKVV@coliv&\normalfont |
| 140 |
Type\fi\ifXKVV@colv&\normalfont Default\fi\\\noexpand\hline |
| 141 |
\noexpand\endfirsthead\noexpand\multicolumn{\the\count@}{l}{% |
| 142 |
\normalfont\emph{Continued from previous page}}\\\noexpand\hline |
| 143 |
\normalfont Key\ifXKVV@colii&\normalfont Prefix\fi\ifXKVV@coliii |
| 144 |
&\normalfont Family\fi\ifXKVV@coliv&\normalfont Type\fi |
| 145 |
\ifXKVV@colv&\normalfont Default\fi\\\noexpand\hline\noexpand |
| 146 |
\endhead\noexpand\hline\noexpand\multicolumn{\the\count@}{r}{% |
| 147 |
\normalfont\emph{Continued on next page}}\\\noexpand\endfoot |
| 148 |
\noexpand\hline\noexpand\endlastfoot |
| 149 |
}% |
| 150 |
\XKV@toks\expandafter{\XKV@tempa}% |
| 151 |
\fi |
| 152 |
\ifx\XKVV@file\@nnil\else\immediate\openout\XKVV@out\XKVV@file\fi |
| 153 |
\XKV@for@o\XKVV@db\XKV@tempa{% |
| 154 |
\XKVV@vwkeytrue\expandafter\XKVV@xkvview\XKV@tempa\@nil |
| 155 |
}% |
| 156 |
\ifXKVV@view |
| 157 |
\addto@hook\XKV@toks{\end{longtable}}% |
| 158 |
\begingroup\ttfamily\the\XKV@toks\endgroup |
| 159 |
\fi |
| 160 |
\ifx\XKVV@file\@nnil\else\immediate\closeout\XKVV@out\fi |
| 161 |
} |
| 162 |
\def\XKVV@xkvview#1=#2=#3=#4=#5\@nil{% |
| 163 |
\ifx\XKVV@prefix\@nnil\else |
| 164 |
\def\XKV@tempa{#2}% |
| 165 |
\ifx\XKV@tempa\XKVV@prefix\else\XKVV@vwkeyfalse\fi |
| 166 |
\fi |
| 167 |
\ifx\XKVV@family\@nnil\else |
| 168 |
\def\XKV@tempa{#3}% |
| 169 |
\ifx\XKV@tempa\XKVV@family\else\XKVV@vwkeyfalse\fi |
| 170 |
\fi |
| 171 |
\ifx\XKVV@type\@nnil\else |
| 172 |
\def\XKV@tempa{#4}% |
| 173 |
\ifx\XKV@tempa\XKVV@type\else\XKVV@vwkeyfalse\fi |
| 174 |
\fi |
| 175 |
\ifx\XKVV@default\@nnil\else |
| 176 |
\def\XKV@tempa{#5}% |
| 177 |
\ifx\XKV@tempa\XKVV@default\else\XKVV@vwkeyfalse\fi |
| 178 |
\fi |
| 179 |
\ifXKVV@vwkey |
| 180 |
\ifXKVV@view |
| 181 |
\edef\XKV@tempa{% |
| 182 |
#1\ifXKVV@colii\fi\ifXKVV@coliii\fi |
| 183 |
\ifXKVV@coliv\fi\ifXKVV@colv\fi |
| 184 |
\ifXKVV@vlabels\noexpand\label{#2-#3-#1}\fi |
| 185 |
}% |
| 186 |
\expandafter\addto@hook\expandafter |
| 187 |
\XKV@toks\expandafter{\XKV@tempa\\}% |
| 188 |
\fi |
| 189 |
\ifx\XKVV@file\@nnil\else |
| 190 |
\immediate\write\XKVV@out{% |
| 191 |
#1\ifXKVV@colii\XKVV@wcolsep#2\fi |
| 192 |
\ifXKVV@coliii\XKVV@wcolsep#3\fi |
| 193 |
\ifXKVV@coliv\XKVV@wcolsep#4\fi |
| 194 |
\ifXKVV@colv\XKVV@wcolsep#5\fi |
| 195 |
\ifXKVV@wlabels\string\label{#2-#3-#1}\fi |
| 196 |
\expandafter\noexpand\XKVV@weol |
| 197 |
}% |
| 198 |
\fi |
| 199 |
\fi |
| 200 |
} |
| 201 |
\endinput |
| 202 |
%% |
| 203 |
%% End of file `xkvview.sty'. |