[latex3-commits] [git/LaTeX3-latex3-latex3] master: added Will's thoughts on hooks (ce0c13f85)

Frank Mittelbach frank.mittelbach at latex-project.org
Tue Oct 15 13:24:48 CEST 2019


Repository : https://github.com/latex3/latex3
On branch  : master
Link       : https://github.com/latex3/latex3/commit/ce0c13f85e31b6ef1b427759f3643174c3b84600

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

commit ce0c13f85e31b6ef1b427759f3643174c3b84600
Author: Frank Mittelbach <frank.mittelbach at latex-project.org>
Date:   Tue Oct 15 13:24:48 2019 +0200

    added Will's thoughts on hooks


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

ce0c13f85e31b6ef1b427759f3643174c3b84600
 discussionpapers/2019-07-thoughts-on-hooks.pdf     | Bin 273265 -> 0 bytes
 discussionpapers/2019-thoughts-on-hooks.pdf        | Bin 0 -> 278937 bytes
 ...hts-on-hooks.tex => 2019-thoughts-on-hooks.tex} |  42 ++++++++++++++++++++-
 3 files changed, 41 insertions(+), 1 deletion(-)

diff --git a/discussionpapers/2019-07-thoughts-on-hooks.pdf b/discussionpapers/2019-07-thoughts-on-hooks.pdf
deleted file mode 100644
index 1fba3c4ea..000000000
Binary files a/discussionpapers/2019-07-thoughts-on-hooks.pdf and /dev/null differ
diff --git a/discussionpapers/2019-thoughts-on-hooks.pdf b/discussionpapers/2019-thoughts-on-hooks.pdf
new file mode 100644
index 000000000..33fe941fa
Binary files /dev/null and b/discussionpapers/2019-thoughts-on-hooks.pdf differ
diff --git a/discussionpapers/2019-07-thoughts-on-hooks.tex b/discussionpapers/2019-thoughts-on-hooks.tex
similarity index 91%
rename from discussionpapers/2019-07-thoughts-on-hooks.tex
rename to discussionpapers/2019-thoughts-on-hooks.tex
index 6c2678e51..35b787fff 100644
--- a/discussionpapers/2019-07-thoughts-on-hooks.tex
+++ b/discussionpapers/2019-thoughts-on-hooks.tex
@@ -7,7 +7,7 @@
 %                        \and  
   \LaTeX{} Project Team}
 
-\date{2019-07-01}
+\date{2019-10-15}
 
 \newcounter{hook}
 \newcounter{config}
@@ -239,6 +239,46 @@ is going to be quite surprising.
 
 
 
+\subsection{Thoughts on the \cs{end} (environment) interface}
+
+From a mail by Will:
+\begin{verbatim}
+1.  It’s interesting that breqn redefines \end or now “\end “ to be:
+
+      \@namedef{end }#1{\csname end#1\endcsname \latex at end{#1}}%
+
+This allows an environment end definition like this:
+
+      \def\enddmath#1{\check at punct@or at qed}
+
+which “absorbs” the \latex at end (the #1), switches over to the aux
+ function, which is
+
+      \def\check at punct@or at qed#1{…
+         \def\finish at end{\csname end@#1\endcsname\latex at end{#1}}%
+         \check at punct
+      }
+
+which allows \futurelet lookahead and all that, using \finish at end
+ finally to tidy up the environment properly.
+
+This is all rather convoluted and very neat and tidy.
+
+As far as I know there are no incompatibilities with breqn and any
+ other major package, so the question arises whether it would be worth
+ setting up "\end “ a little more directly to allow this behaviour. Of
+ course it will slow down every environment in a document by one
+ expansion, but is that a big deal? It may well be, I don’t know.
+
+
+2.  If we build a hook into 2e to provide this, do we add an interface
+ to xparse to allow environments to lookahead? As well as being useful
+ for breqn — and it’s such a good part of breqn I’d argue it’s worth
+ breaking it out from there for xmath — wouldn’t this style of
+ lookahead be needed for LDB concepts?
+\end{verbatim}
+
+
 \section{Hooks and config points in various places}
 
 In this section we collect existing \LaTeXe{} hooks (both by the





More information about the latex3-commits mailing list