[latex3-commits] [latex3/latex2e] template-doc: Add template documenation (44148016)
github at latex-project.org
github at latex-project.org
Tue Sep 10 18:32:10 CEST 2024
Repository : https://github.com/latex3/latex2e
On branch : template-doc
Link : https://github.com/latex3/latex2e/commit/441480169202cbde732e2d605c0cf5e95f0a66fc
>---------------------------------------------------------------
commit 441480169202cbde732e2d605c0cf5e95f0a66fc
Author: Joseph Wright <joseph at texdev.net>
Date: Tue Sep 10 17:32:10 2024 +0100
Add template documenation
>---------------------------------------------------------------
441480169202cbde732e2d605c0cf5e95f0a66fc
base/changes.txt | 7 +++++++
base/doc/clsguide.tex | 21 ++++++++++++++++++++-
base/doc/lttemplates-code.tex | 5 +++++
base/doc/lttemplates-doc.tex | 8 ++++++++
4 files changed, 40 insertions(+), 1 deletion(-)
diff --git a/base/changes.txt b/base/changes.txt
index 69504ec7..eaccb271 100644
--- a/base/changes.txt
+++ b/base/changes.txt
@@ -6,6 +6,13 @@ to completeness or accuracy and it contains some references to files that are
not part of the distribution.
================================================================================
+2024-09-02 Joseph Wright <Joseph.Wright at latex-project.org>
+
+ * lttemplates-doc.tex, lttemplates-code.tex:
+ New files
+ * clsguide.tex
+ Link to template documentation
+
2024-09-03 Ulrike Fischer <Ulrike.Fischer at latex-project.org>
* fontdef.dtx: preload t1cmss.fd and t1cmtt.fd
diff --git a/base/doc/clsguide.tex b/base/doc/clsguide.tex
index 84c3b3e4..33a362ed 100644
--- a/base/doc/clsguide.tex
+++ b/base/doc/clsguide.tex
@@ -42,7 +42,7 @@
\texttt{clsguide.tex} for full details.}%
}
-\date{2024-09-02}
+\date{2024-09-10}
\NewDocumentCommand\cs{m}{\texttt{\textbackslash\detokenize{#1}}}
\NewDocumentCommand\marg{m}{\arg{#1}}
@@ -1397,6 +1397,25 @@ modern packages, that use the L3 programming layer of \LaTeX{}. The
\texttt{expl3} commands and more details can be found in
\texttt{ltproperties-doc.pdf}.
+\subsubsection{Templates (protoype document commands)}
+
+\emph{Templates} as defined by \LaTeX{} are a mechanism to cleanly separate the
+three layers needed for writing a document
+\begin{enumerate}
+ \item authoring of the text with mark-up;
+ \item document layout design;
+ \item implementation (with \TeX{} programming) of the design.
+\end{enumerate}
+They allow document authors to modify design without altering code, and allow
+programmers to make portable changes to classes.
+
+Implementing this mechanism requires a number of steps and a family of commands
+which allow variation in outcomes. A typical use of templates will make use of
+most or all of |\NewTemplateType|, |\DeclareTemplateInterface|,
+|\DeclareTemplateCode|, |\DeclareInstance| and |\UseInstance|, plus potentially
+some more specialised commands. These are descrined in \texttt{lttemplates-doc}
+in full detail.
+
\subsection{Preparing link targets}
Active links in a document need targets to which they can jump to. Such
diff --git a/base/doc/lttemplates-code.tex b/base/doc/lttemplates-code.tex
new file mode 100644
index 00000000..b85e2230
--- /dev/null
+++ b/base/doc/lttemplates-code.tex
@@ -0,0 +1,5 @@
+% This will typeset documentation + code
+%
+
+\AtBeginDocument{\AlsoImplementation}
+\input{lttemplates.dtx}
diff --git a/base/doc/lttemplates-doc.tex b/base/doc/lttemplates-doc.tex
new file mode 100644
index 00000000..18b2ac11
--- /dev/null
+++ b/base/doc/lttemplates-doc.tex
@@ -0,0 +1,8 @@
+% This will typeset only documentation but not the code
+%
+
+\AtBeginDocument{\OnlyDescription
+% \let\tableofcontents\relax
+ \RenewCommandCopy\MaybeStop\StopEventually
+ }
+\input{lttemplates.dtx}
More information about the latex3-commits
mailing list.