summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex3/template/tprestrict-test.tex
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/doc/latex3/template/tprestrict-test.tex')
-rw-r--r--Master/texmf-dist/doc/latex3/template/tprestrict-test.tex43
1 files changed, 43 insertions, 0 deletions
diff --git a/Master/texmf-dist/doc/latex3/template/tprestrict-test.tex b/Master/texmf-dist/doc/latex3/template/tprestrict-test.tex
new file mode 100644
index 00000000000..042853b97df
--- /dev/null
+++ b/Master/texmf-dist/doc/latex3/template/tprestrict-test.tex
@@ -0,0 +1,43 @@
+
+\makeatletter
+\RequirePackage{template}
+\IgnoreWhiteSpace
+
+\newcount\ca
+\newdimen\da
+
+
+\DeclareTemplateType{type}{0}
+
+%\tracingall\tracingassigns=1
+\DeclareTemplate{type}{Ta}{0}{
+ one =l [2in] \da,
+ two =c [5] \ca}
+ {\DoParameterAssignments\typeout{\da=\the\da,\@spaces \ca=\the\ca}}
+
+\ShowTemplate{type}{Ta}
+
+\typeout{1^^J==}
+\UseTemplate{type}{Ta}{}
+
+\typeout{2^^J==}
+\UseTemplate{type}{Ta}{one=44pt, two=7}
+
+
+\DeclareRestrictedTemplate{type}{Tb}{Ta}{one=33pt}
+
+\ShowTemplate{type}{Tb}
+
+\typeout{RESTRICT^^J3^^J==}
+
+\DeclareInstance{type}{foo}{Tb}{two=9}
+
+\ShowInstance{type}{foo}
+
+\UseInstance{type}{foo}
+
+\typeout{4^^J==}
+\UseTemplate{type}{Tb}{two=7}
+
+\stop
+