[latex3-commits] [git/LaTeX3-latex3-latex2e] template: Additional documentation (ae8920d7)

Joseph Wright joseph.wright at morningstar2.co.uk
Sun Jun 5 10:03:22 CEST 2022


Repository : https://github.com/latex3/latex2e
On branch  : template
Link       : https://github.com/latex3/latex2e/commit/ae8920d707900a6c8e5cc020561b77a1ca643822

>---------------------------------------------------------------

commit ae8920d707900a6c8e5cc020561b77a1ca643822
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date:   Sun Jun 5 09:03:22 2022 +0100

    Additional documentation


>---------------------------------------------------------------

ae8920d707900a6c8e5cc020561b77a1ca643822
 base/doc/usrguide3.tex | 45 +++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 45 insertions(+)

diff --git a/base/doc/usrguide3.tex b/base/doc/usrguide3.tex
index c718eaec..399539c1 100644
--- a/base/doc/usrguide3.tex
+++ b/base/doc/usrguide3.tex
@@ -1483,4 +1483,49 @@ key types:
     }
 \end{verbatim}
 
+\subsection{\emph{Ad hoc} adjustment of templates}
+
+\begin{decl}
+  |\SetTemplateKeys| \arg{obj.~type} \arg{template} \arg{parameters}
+\end{decl}
+
+At point of use it may be useful to apply changed to individual instances.
+This is supported as each template key is made available for adjustment
+using \cs{SetTemplateKeys}.
+
+For example, after
+\begin{verbatim}
+  \DeclareObjectType{MyObj}{0}
+  \DeclareTemplateInterface{MyObj}{TemplateA}{0}
+    {
+      akey: tokenlist  ,
+      bkey: function{2}
+    }
+  \DeclareTemplateCode{MyObj}{TemplateA}{0}
+    {
+      akey = SomeTokens ,
+      bkey = \func:nn ,
+    }
+\end{verbatim}
+the template keys could be adjusted in an \emph{ad hoc} fashion using
+\begin{verbatim}
+  \SetTemplateKeys{MyObj}{TemplateA}
+    {
+      akey = OtherTokens ,
+      bkey = \AltFunc:nn
+    }
+\end{verbatim}
+
+\subsection{Getting information about templates and instances}
+
+\begin{decl}
+  |\ShowTemplateInterface| \arg{obj.~type} \arg{template} \\
+  |\ShowTemplateDefaults| \arg{obj.~type} \arg{template} \\
+  |\ShowTemplateCode| \arg{obj.~type} \arg{template} \\
+  |\ShowTemplateVariables| \arg{obj.~type} \arg{template} \\
+  |\ShowInstanceValues| \arg{obj.~type} \arg{instance} \\
+\end{decl}
+These functions show data on the appropriate part of the template or instance
+structure.
+
 \end{document}





More information about the latex3-commits mailing list.