summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex3/template/tprestrict-test.tex
blob: 042853b97dfa44669d476a4a9cf0e7a06b66e95f (plain)
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

\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