summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/exp-testopt/exp-testopt.sty
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
committerNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
commite0c6872cf40896c7be36b11dcc744620f10adf1d (patch)
tree60335e10d2f4354b0674ec22d7b53f0f8abee672 /macros/latex/contrib/exp-testopt/exp-testopt.sty
Initial commit
Diffstat (limited to 'macros/latex/contrib/exp-testopt/exp-testopt.sty')
-rw-r--r--macros/latex/contrib/exp-testopt/exp-testopt.sty101
1 files changed, 101 insertions, 0 deletions
diff --git a/macros/latex/contrib/exp-testopt/exp-testopt.sty b/macros/latex/contrib/exp-testopt/exp-testopt.sty
new file mode 100644
index 0000000000..9ab9750c8b
--- /dev/null
+++ b/macros/latex/contrib/exp-testopt/exp-testopt.sty
@@ -0,0 +1,101 @@
+%%
+%% This is file `exp-testopt.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% exp-testopt.dtx (with options: `package')
+%%
+%% ,--------------------------------------------------.
+%% | Das ist eine generierte Datei. |
+%% | |
+%% | (c) 2009 Paul Ebermann. |
+%% '--------------------------------------------------'
+%% (C) 2008 Paul Ebermann
+%%
+%% Package exp-testopt - expandible testopt-Variante.
+%%
+%% Die Datei exp-testopt.dtx sowie die dazugeh^^c3^^b6rige
+%% exp-testopt.ins sowie die damit generierte
+%% exp-testopt.sty stehen unter der
+%% "LaTeX Project Public License" (LPPL, zu finden
+%% unter http://www.latex-project.org/lppl/, sowie
+%% auch in den meisten TeX-Distributionen in
+%% texmf/docs/latex/base/lppl*.txt), Version 1.3b oder
+%% sp^^c3^^a4ter (nach Wahl des Verwenders).
+%%
+%% Der 'maintenance-status' ist (zur Zeit) 'author-maintained'.
+%%
+%% Das hei^^c3^^9ft u.a., die Dateien d^^c3^^bcrfen frei vertrieben werden,
+%% bei ^^c3^^84nderungen (durch andere Personen als Paul Ebermann)
+%% ist aber der Name der Datei zu ^^c3^^a4ndern.
+\NeedsTeXFormat{LaTeX2e}[2005/12/01]%
+\ProvidesPackage{exp-testopt}[2009/03/06 v0.3 (PE)]
+
+\newcommand*{\@expandable@testopt}[2]{%
+ \@expandable@ifopt{#1}{#1[#2]}%
+}
+
+\newcommand{\@expandable@ifopt}[3]{%
+ \expandafter\ifx% '\ifx' komparas la difinojn de du makrooj, nome \dots
+ \csname exp-testopt@@\string#3@\endcsname% \dots makronomo kreita el la
+ \exp@testopt@opt@% \dots kaj tiu anta^^c5^^addifinita makroo.
+ \afterfi{#1#3}% En la jes-kazo, vokas la unuan argumenton
+ \else% \dots en la ne-kazo la duan.
+ \@expandable@ifOneToken#3\@expandable@ifOneToken% Tiu
+ {\afterfi{#2#3}}%
+ {\afterfi{#2{#3}}}%
+ \fi%
+}%
+
+\def\exp@testopt@opt@{<<<[>>>}% tio estas la nomo, kies valoron ni
+\@namedef{exp-testopt@@\string[@}{<<<[>>>}% Tio -- '\exp-testopt@@[@' -- estas
+
+\long\def\@expandable@ifOneToken#1#2\@expandable@ifOneToken#3#4{%
+ \expandafter\ifx%
+ \csname exp-testopt@@\string#2@\endcsname%
+ \exp@testopt@empty@%
+ \afterfi{#3}%
+ \else
+ \afterfi{#4}%
+ \fi
+}
+
+\def\exp@testopt@empty@{<<<>>>}% tio
+\@namedef{exp-testopt@@@}{<<<>>>}% Tio --
+
+\long\def\@exp@xargdef#1[#2][#3]#4{%
+ \@ifdefinable#1{% { \color{Green}
+ \expandafter\def\expandafter#1\expandafter{%
+ \expandafter%
+ \@expandable@testopt%
+ \csname\string#1\endcsname%
+ {#3}}% }
+ \expandafter\@yargdef%
+ \csname\string#1\endcsname%
+ \tw@%
+ {#2}%
+ {#4}%
+ }%
+}
+
+\def\expnewcommand{%
+ \@star@or@long\expnew@command%
+}
+\def\expnew@command#1{%
+ \@testopt{\exp@newcommand#1}0%
+}
+\def\exp@newcommand#1[#2]{%
+ \@ifnextchar [{\@exp@xargdef#1[#2]}% ^^c4^^88i
+ {\@argdef#1[#2]}% Tiu estas la originalo.
+}
+
+\@ifundefined{afterfi}{%
+ \def\afterfi#1#2\fi{%
+ \fi#1%
+ }%
+}{}%
+
+\endinput
+%%
+%% End of file `exp-testopt.sty'.