Debian Codegraph @

texmf-dist/doc/latex/kvsetkeys/kvsetkeys-example.tex

raw
1 %%
2 %% This is file `kvsetkeys-example.tex',
3 %% generated with the docstrip utility.
4 %%
5 %% The original source files were:
6 %%
7 %% kvsetkeys.dtx (with options: `example')
8 %%
9 %% This is a generated file.
10 %%
11 %% Project: kvsetkeys
12 %% Version: 2022-10-05 v1.19
13 %%
14 %% Copyright (C)
15 %% 2006, 2007, 2009-2012 Heiko Oberdiek
16 %% 2016-2022 Oberdiek Package Support Group
17 %%
18 %% This work may be distributed and/or modified under the
19 %% conditions of the LaTeX Project Public License, either
20 %% version 1.3c of this license or (at your option) any later
21 %% version. This version of this license is in
22 %% https://www.latex-project.org/lppl/lppl-1-3c.txt
23 %% and the latest version of this license is in
24 %% https://www.latex-project.org/lppl.txt
25 %% and version 1.3 or later is part of all distributions of
26 %% LaTeX version 2005/12/01 or later.
27 %%
28 %% This work has the LPPL maintenance status "maintained".
29 %%
30 %% The Current Maintainers of this work are
31 %% Heiko Oberdiek and the Oberdiek Package Support Group
32 %% https://github.com/ho-tex/kvsetkeys/issues
33 %%
34 %% The Base Interpreter refers to any `TeX-Format',
35 %% because some files are installed in TDS:tex/generic//.
36 %%
37 %% This work consists of the main source file kvsetkeys.dtx
38 %% and the derived files
39 %% kvsetkeys.sty, kvsetkeys.pdf, kvsetkeys.ins, kvsetkeys.drv,
40 %% kvsetkeys-example.tex, kvsetkeys-test1.tex,
41 %% kvsetkeys-test2.tex, kvsetkeys-test3.tex,
42 %% kvsetkeys-test4.tex.
43 %%
44 \documentclass{article}
45 \usepackage[T1]{fontenc}
46 \usepackage{kvsetkeys}
47 \usepackage{keyval}
48
49 \makeatletter
50 \newcommand*{\tag}[2][]{%
51 % #1: attributes
52 % #2: tag name
53 \begingroup
54 \toks@={}%
55 \let\@endslash\@empty
56 \kvsetkeys{tag}{#1}%
57 \texttt{%
58 \textless #2\the\toks@\@endslash\textgreater
59 }%
60 \endgroup
61 }
62 \kv@set@family@handler{tag}{%
63 % #1: key
64 % #2: value
65 \toks@\expandafter{%
66 \the\toks@
67 \space
68 #1=\string"#2\string"%
69 }%
70 }
71 \define@key{tag}{/}[]{%
72 \def\@endslash{/}%
73 }
74 \makeatother
75
76 \begin{document}
77 \begin{tabbing}
78 \mbox{}\qquad\=\qquad\=\kill
79 \tag{html}\\
80 \>\dots\\
81 \>\tag[border=1]{table}\\
82 \>\>\tag[width=200, span=3, /]{colgroup}\\
83 \>\>\dots\\
84 \>\tag{/table}\\
85 \>\dots\\
86 \tag{/html}\\
87 \end{tabbing}
88 \end{document}
89 %% \section{Installation}
90 \endinput
91 %%
92 %% End of file `kvsetkeys-example.tex'.