summaryrefslogtreecommitdiff
path: root/Master/texmf-dist
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2020-09-11 20:57:29 +0000
committerKarl Berry <karl@freefriends.org>2020-09-11 20:57:29 +0000
commit344f571397847584bf25231169ad48625098a3c5 (patch)
tree5db8517c24c0922b83a2b89adfef1d04ecd7c695 /Master/texmf-dist
parent669f118b45756491c4d06049f501796b22192227 (diff)
latex-base-dev (10sep20)
git-svn-id: svn://tug.org/texlive/trunk@56324 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist')
-rw-r--r--Master/texmf-dist/doc/latex-dev/base/README.md2
-rw-r--r--Master/texmf-dist/doc/latex-dev/base/alltt.pdfbin173079 -> 173079 bytes
-rw-r--r--Master/texmf-dist/doc/latex-dev/base/cfgguide.pdfbin220217 -> 220217 bytes
-rw-r--r--Master/texmf-dist/doc/latex-dev/base/changes.txt10
-rw-r--r--Master/texmf-dist/doc/latex-dev/base/classes.pdfbin520851 -> 520851 bytes
-rw-r--r--Master/texmf-dist/doc/latex-dev/base/clsguide.pdfbin372555 -> 372555 bytes
-rw-r--r--Master/texmf-dist/doc/latex-dev/base/cmfonts.pdfbin264505 -> 264505 bytes
-rw-r--r--Master/texmf-dist/doc/latex-dev/base/cyrguide.pdfbin216997 -> 216997 bytes
-rw-r--r--Master/texmf-dist/doc/latex-dev/base/doc.pdfbin631616 -> 631285 bytes
-rw-r--r--Master/texmf-dist/doc/latex-dev/base/docstrip.pdfbin479710 -> 479704 bytes
-rw-r--r--Master/texmf-dist/doc/latex-dev/base/encguide.pdfbin1532144 -> 1532144 bytes
-rw-r--r--Master/texmf-dist/doc/latex-dev/base/exscale.pdfbin195877 -> 195877 bytes
-rw-r--r--Master/texmf-dist/doc/latex-dev/base/fix-cm.pdfbin262059 -> 262059 bytes
-rw-r--r--Master/texmf-dist/doc/latex-dev/base/fntguide.pdfbin417861 -> 417861 bytes
-rw-r--r--Master/texmf-dist/doc/latex-dev/base/graphpap.pdfbin156277 -> 156277 bytes
-rw-r--r--Master/texmf-dist/doc/latex-dev/base/ifthen.pdfbin205213 -> 205213 bytes
-rw-r--r--Master/texmf-dist/doc/latex-dev/base/inputenc.pdfbin294900 -> 294900 bytes
-rw-r--r--Master/texmf-dist/doc/latex-dev/base/latexchanges.pdfbin232390 -> 232390 bytes
-rw-r--r--Master/texmf-dist/doc/latex-dev/base/latexrelease.pdfbin246195 -> 246195 bytes
-rw-r--r--Master/texmf-dist/doc/latex-dev/base/latexsym.pdfbin192297 -> 192297 bytes
-rw-r--r--Master/texmf-dist/doc/latex-dev/base/lb2.pdfbin138219 -> 138219 bytes
-rw-r--r--Master/texmf-dist/doc/latex-dev/base/letter.pdfbin306068 -> 305441 bytes
-rw-r--r--Master/texmf-dist/doc/latex-dev/base/lgc2.pdfbin101343 -> 101343 bytes
-rw-r--r--Master/texmf-dist/doc/latex-dev/base/lppl.pdfbin125830 -> 125830 bytes
-rw-r--r--Master/texmf-dist/doc/latex-dev/base/ltfilehook-code.pdfbin747549 -> 747033 bytes
-rw-r--r--Master/texmf-dist/doc/latex-dev/base/ltfilehook-doc.pdfbin517421 -> 516967 bytes
-rw-r--r--Master/texmf-dist/doc/latex-dev/base/lthooks-code.pdfbin871310 -> 896523 bytes
-rw-r--r--Master/texmf-dist/doc/latex-dev/base/lthooks-doc.pdfbin602334 -> 603179 bytes
-rw-r--r--Master/texmf-dist/doc/latex-dev/base/ltluatex.pdfbin305256 -> 305256 bytes
-rw-r--r--Master/texmf-dist/doc/latex-dev/base/ltnews.pdfbin988811 -> 988811 bytes
-rw-r--r--Master/texmf-dist/doc/latex-dev/base/ltnews01.pdfbin150020 -> 150020 bytes
-rw-r--r--Master/texmf-dist/doc/latex-dev/base/ltnews02.pdfbin134751 -> 134751 bytes
-rw-r--r--Master/texmf-dist/doc/latex-dev/base/ltnews03.pdfbin134742 -> 134742 bytes
-rw-r--r--Master/texmf-dist/doc/latex-dev/base/ltnews04.pdfbin128772 -> 128772 bytes
-rw-r--r--Master/texmf-dist/doc/latex-dev/base/ltnews05.pdfbin157181 -> 157181 bytes
-rw-r--r--Master/texmf-dist/doc/latex-dev/base/ltnews06.pdfbin133138 -> 133138 bytes
-rw-r--r--Master/texmf-dist/doc/latex-dev/base/ltnews07.pdfbin124029 -> 124029 bytes
-rw-r--r--Master/texmf-dist/doc/latex-dev/base/ltnews08.pdfbin144482 -> 144482 bytes
-rw-r--r--Master/texmf-dist/doc/latex-dev/base/ltnews09.pdfbin120222 -> 120222 bytes
-rw-r--r--Master/texmf-dist/doc/latex-dev/base/ltnews10.pdfbin147946 -> 147946 bytes
-rw-r--r--Master/texmf-dist/doc/latex-dev/base/ltnews11.pdfbin104936 -> 104936 bytes
-rw-r--r--Master/texmf-dist/doc/latex-dev/base/ltnews12.pdfbin137919 -> 137919 bytes
-rw-r--r--Master/texmf-dist/doc/latex-dev/base/ltnews13.pdfbin161065 -> 161065 bytes
-rw-r--r--Master/texmf-dist/doc/latex-dev/base/ltnews14.pdfbin150907 -> 150907 bytes
-rw-r--r--Master/texmf-dist/doc/latex-dev/base/ltnews15.pdfbin122092 -> 122092 bytes
-rw-r--r--Master/texmf-dist/doc/latex-dev/base/ltnews16.pdfbin130687 -> 130687 bytes
-rw-r--r--Master/texmf-dist/doc/latex-dev/base/ltnews17.pdfbin149838 -> 149838 bytes
-rw-r--r--Master/texmf-dist/doc/latex-dev/base/ltnews18.pdfbin36005 -> 36005 bytes
-rw-r--r--Master/texmf-dist/doc/latex-dev/base/ltnews19.pdfbin235073 -> 235073 bytes
-rw-r--r--Master/texmf-dist/doc/latex-dev/base/ltnews20.pdfbin283318 -> 283318 bytes
-rw-r--r--Master/texmf-dist/doc/latex-dev/base/ltnews21.pdfbin233492 -> 233492 bytes
-rw-r--r--Master/texmf-dist/doc/latex-dev/base/ltnews22.pdfbin302836 -> 302836 bytes
-rw-r--r--Master/texmf-dist/doc/latex-dev/base/ltnews23.pdfbin274459 -> 274459 bytes
-rw-r--r--Master/texmf-dist/doc/latex-dev/base/ltnews24.pdfbin252645 -> 252645 bytes
-rw-r--r--Master/texmf-dist/doc/latex-dev/base/ltnews25.pdfbin196326 -> 196326 bytes
-rw-r--r--Master/texmf-dist/doc/latex-dev/base/ltnews26.pdfbin362839 -> 362839 bytes
-rw-r--r--Master/texmf-dist/doc/latex-dev/base/ltnews27.pdfbin239758 -> 239758 bytes
-rw-r--r--Master/texmf-dist/doc/latex-dev/base/ltnews28.pdfbin368226 -> 368226 bytes
-rw-r--r--Master/texmf-dist/doc/latex-dev/base/ltnews29.pdfbin433004 -> 433004 bytes
-rw-r--r--Master/texmf-dist/doc/latex-dev/base/ltnews30.pdfbin491246 -> 491246 bytes
-rw-r--r--Master/texmf-dist/doc/latex-dev/base/ltnews31.pdfbin500919 -> 500919 bytes
-rw-r--r--Master/texmf-dist/doc/latex-dev/base/ltnews32.pdfbin529433 -> 529433 bytes
-rw-r--r--Master/texmf-dist/doc/latex-dev/base/ltshipout-code.pdfbin749702 -> 749381 bytes
-rw-r--r--Master/texmf-dist/doc/latex-dev/base/ltshipout-doc.pdfbin504786 -> 504055 bytes
-rw-r--r--Master/texmf-dist/doc/latex-dev/base/ltx3info.pdfbin191527 -> 191527 bytes
-rw-r--r--Master/texmf-dist/doc/latex-dev/base/ltxdoc.pdfbin215134 -> 215134 bytes
-rw-r--r--Master/texmf-dist/doc/latex-dev/base/makeindx.pdfbin160667 -> 160667 bytes
-rw-r--r--Master/texmf-dist/doc/latex-dev/base/manual.pdfbin151347 -> 151347 bytes
-rw-r--r--Master/texmf-dist/doc/latex-dev/base/modguide.pdfbin220388 -> 220388 bytes
-rw-r--r--Master/texmf-dist/doc/latex-dev/base/nfssfont.pdfbin202451 -> 202451 bytes
-rw-r--r--Master/texmf-dist/doc/latex-dev/base/proc.pdfbin216877 -> 216877 bytes
-rw-r--r--Master/texmf-dist/doc/latex-dev/base/slides.pdfbin351586 -> 351586 bytes
-rw-r--r--Master/texmf-dist/doc/latex-dev/base/slifonts.pdfbin214710 -> 214710 bytes
-rw-r--r--Master/texmf-dist/doc/latex-dev/base/source2e.pdfbin4320779 -> 4353699 bytes
-rw-r--r--Master/texmf-dist/doc/latex-dev/base/syntonly.pdfbin181980 -> 181450 bytes
-rw-r--r--Master/texmf-dist/doc/latex-dev/base/tlc2.pdfbin164947 -> 164947 bytes
-rw-r--r--Master/texmf-dist/doc/latex-dev/base/tulm.pdfbin156546 -> 156546 bytes
-rw-r--r--Master/texmf-dist/doc/latex-dev/base/usrguide.pdfbin399035 -> 399035 bytes
-rw-r--r--Master/texmf-dist/doc/latex-dev/base/utf8ienc.pdfbin331397 -> 331094 bytes
-rw-r--r--Master/texmf-dist/doc/latex-dev/base/webcomp.pdfbin136159 -> 136159 bytes
-rw-r--r--Master/texmf-dist/source/latex-dev/base/ltclass.dtx61
-rw-r--r--Master/texmf-dist/source/latex-dev/base/ltdefns.dtx53
-rw-r--r--Master/texmf-dist/source/latex-dev/base/ltexpl.dtx14
-rw-r--r--Master/texmf-dist/source/latex-dev/base/ltfilehook.dtx8
-rw-r--r--Master/texmf-dist/source/latex-dev/base/ltfiles.dtx2
-rw-r--r--Master/texmf-dist/source/latex-dev/base/lthooks.dtx698
-rw-r--r--Master/texmf-dist/source/latex-dev/base/ltshipout.dtx23
-rw-r--r--Master/texmf-dist/source/latex-dev/base/ltvers.dtx2
-rw-r--r--Master/texmf-dist/tex/latex-dev/base/atbegshi-ltx.sty6
-rw-r--r--Master/texmf-dist/tex/latex-dev/base/atveryend-ltx.sty4
-rw-r--r--Master/texmf-dist/tex/latex-dev/base/everyshi-ltx.sty6
-rw-r--r--Master/texmf-dist/tex/latex-dev/base/filehook-ltx.sty2
-rw-r--r--Master/texmf-dist/tex/latex-dev/base/latex.ltx524
-rw-r--r--Master/texmf-dist/tex/latex-dev/base/latexrelease.sty543
-rw-r--r--Master/texmf-dist/tex/latex-dev/base/srclfile-ltx.sty2
-rw-r--r--Master/texmf-dist/tex/latex-dev/base/structuredlog.sty4
96 files changed, 1231 insertions, 733 deletions
diff --git a/Master/texmf-dist/doc/latex-dev/base/README.md b/Master/texmf-dist/doc/latex-dev/base/README.md
index 0f451408e06..fe45ec06c8f 100644
--- a/Master/texmf-dist/doc/latex-dev/base/README.md
+++ b/Master/texmf-dist/doc/latex-dev/base/README.md
@@ -1,7 +1,7 @@
The LaTeX kernel
================
-Release 2020-10-01 pre-release 8
+Release 2020-10-01 pre-release 9
Overview
--------
diff --git a/Master/texmf-dist/doc/latex-dev/base/alltt.pdf b/Master/texmf-dist/doc/latex-dev/base/alltt.pdf
index 6cd049bbf97..ecaf4094e25 100644
--- a/Master/texmf-dist/doc/latex-dev/base/alltt.pdf
+++ b/Master/texmf-dist/doc/latex-dev/base/alltt.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex-dev/base/cfgguide.pdf b/Master/texmf-dist/doc/latex-dev/base/cfgguide.pdf
index 481b0118f05..a5cc634a012 100644
--- a/Master/texmf-dist/doc/latex-dev/base/cfgguide.pdf
+++ b/Master/texmf-dist/doc/latex-dev/base/cfgguide.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex-dev/base/changes.txt b/Master/texmf-dist/doc/latex-dev/base/changes.txt
index e20ac7dfd51..ef9406cd7d3 100644
--- a/Master/texmf-dist/doc/latex-dev/base/changes.txt
+++ b/Master/texmf-dist/doc/latex-dev/base/changes.txt
@@ -6,6 +6,16 @@ completeness or accuracy and it contains some references to files that
are not part of the distribution.
================================================================================
+2020-09-09 Frank Mittelbach <Frank.Mittelbach@latex-project.org>
+
+ * ltshipout.dtx (subsection{Emulating \pkg{atbegshi}}):
+ Avoid unnecessary overfull box warnings (gh/387)
+
+2020-09-06 Phelype Oleinik <phelype.oleinik@latex-project.org>
+
+ * ltclass.dtx:
+ Correct option passing when a file is replaced
+
2020-08-24 Frank Mittelbach <Frank.Mittelbach@latex-project.org>
* ltfssini.dtx:
diff --git a/Master/texmf-dist/doc/latex-dev/base/classes.pdf b/Master/texmf-dist/doc/latex-dev/base/classes.pdf
index a9595955b44..6264b555249 100644
--- a/Master/texmf-dist/doc/latex-dev/base/classes.pdf
+++ b/Master/texmf-dist/doc/latex-dev/base/classes.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex-dev/base/clsguide.pdf b/Master/texmf-dist/doc/latex-dev/base/clsguide.pdf
index 36e252ad1b0..9d1176d4a09 100644
--- a/Master/texmf-dist/doc/latex-dev/base/clsguide.pdf
+++ b/Master/texmf-dist/doc/latex-dev/base/clsguide.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex-dev/base/cmfonts.pdf b/Master/texmf-dist/doc/latex-dev/base/cmfonts.pdf
index b1e605544e7..6bcb317a11a 100644
--- a/Master/texmf-dist/doc/latex-dev/base/cmfonts.pdf
+++ b/Master/texmf-dist/doc/latex-dev/base/cmfonts.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex-dev/base/cyrguide.pdf b/Master/texmf-dist/doc/latex-dev/base/cyrguide.pdf
index a7d11ca8f84..a43d1356eda 100644
--- a/Master/texmf-dist/doc/latex-dev/base/cyrguide.pdf
+++ b/Master/texmf-dist/doc/latex-dev/base/cyrguide.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex-dev/base/doc.pdf b/Master/texmf-dist/doc/latex-dev/base/doc.pdf
index e50c8ce8b2d..8dea440f33a 100644
--- a/Master/texmf-dist/doc/latex-dev/base/doc.pdf
+++ b/Master/texmf-dist/doc/latex-dev/base/doc.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex-dev/base/docstrip.pdf b/Master/texmf-dist/doc/latex-dev/base/docstrip.pdf
index 71bf27ba33e..a85a0091cb2 100644
--- a/Master/texmf-dist/doc/latex-dev/base/docstrip.pdf
+++ b/Master/texmf-dist/doc/latex-dev/base/docstrip.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex-dev/base/encguide.pdf b/Master/texmf-dist/doc/latex-dev/base/encguide.pdf
index 5b48fb4ae2a..5186a6f2485 100644
--- a/Master/texmf-dist/doc/latex-dev/base/encguide.pdf
+++ b/Master/texmf-dist/doc/latex-dev/base/encguide.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex-dev/base/exscale.pdf b/Master/texmf-dist/doc/latex-dev/base/exscale.pdf
index 316da084e6a..8f23dd4da83 100644
--- a/Master/texmf-dist/doc/latex-dev/base/exscale.pdf
+++ b/Master/texmf-dist/doc/latex-dev/base/exscale.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex-dev/base/fix-cm.pdf b/Master/texmf-dist/doc/latex-dev/base/fix-cm.pdf
index 08dde0ae9fb..b66dba30401 100644
--- a/Master/texmf-dist/doc/latex-dev/base/fix-cm.pdf
+++ b/Master/texmf-dist/doc/latex-dev/base/fix-cm.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex-dev/base/fntguide.pdf b/Master/texmf-dist/doc/latex-dev/base/fntguide.pdf
index 349303e6d41..c3d23a6ca4d 100644
--- a/Master/texmf-dist/doc/latex-dev/base/fntguide.pdf
+++ b/Master/texmf-dist/doc/latex-dev/base/fntguide.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex-dev/base/graphpap.pdf b/Master/texmf-dist/doc/latex-dev/base/graphpap.pdf
index 274b50ae083..81caf6f37a2 100644
--- a/Master/texmf-dist/doc/latex-dev/base/graphpap.pdf
+++ b/Master/texmf-dist/doc/latex-dev/base/graphpap.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex-dev/base/ifthen.pdf b/Master/texmf-dist/doc/latex-dev/base/ifthen.pdf
index 9e3fc6c42fd..cc28e46720c 100644
--- a/Master/texmf-dist/doc/latex-dev/base/ifthen.pdf
+++ b/Master/texmf-dist/doc/latex-dev/base/ifthen.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex-dev/base/inputenc.pdf b/Master/texmf-dist/doc/latex-dev/base/inputenc.pdf
index 30351e71e5b..7915900cb75 100644
--- a/Master/texmf-dist/doc/latex-dev/base/inputenc.pdf
+++ b/Master/texmf-dist/doc/latex-dev/base/inputenc.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex-dev/base/latexchanges.pdf b/Master/texmf-dist/doc/latex-dev/base/latexchanges.pdf
index 6179a01f11d..c64b18bcf2e 100644
--- a/Master/texmf-dist/doc/latex-dev/base/latexchanges.pdf
+++ b/Master/texmf-dist/doc/latex-dev/base/latexchanges.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex-dev/base/latexrelease.pdf b/Master/texmf-dist/doc/latex-dev/base/latexrelease.pdf
index becb06fbb46..08cdbd51c2b 100644
--- a/Master/texmf-dist/doc/latex-dev/base/latexrelease.pdf
+++ b/Master/texmf-dist/doc/latex-dev/base/latexrelease.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex-dev/base/latexsym.pdf b/Master/texmf-dist/doc/latex-dev/base/latexsym.pdf
index 46dbdde61ab..80c54694141 100644
--- a/Master/texmf-dist/doc/latex-dev/base/latexsym.pdf
+++ b/Master/texmf-dist/doc/latex-dev/base/latexsym.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex-dev/base/lb2.pdf b/Master/texmf-dist/doc/latex-dev/base/lb2.pdf
index 7c639fccb24..a80c2ee580c 100644
--- a/Master/texmf-dist/doc/latex-dev/base/lb2.pdf
+++ b/Master/texmf-dist/doc/latex-dev/base/lb2.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex-dev/base/letter.pdf b/Master/texmf-dist/doc/latex-dev/base/letter.pdf
index 7670c796feb..54cc1c43b5e 100644
--- a/Master/texmf-dist/doc/latex-dev/base/letter.pdf
+++ b/Master/texmf-dist/doc/latex-dev/base/letter.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex-dev/base/lgc2.pdf b/Master/texmf-dist/doc/latex-dev/base/lgc2.pdf
index 9c29edd755d..d8e1e6a5180 100644
--- a/Master/texmf-dist/doc/latex-dev/base/lgc2.pdf
+++ b/Master/texmf-dist/doc/latex-dev/base/lgc2.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex-dev/base/lppl.pdf b/Master/texmf-dist/doc/latex-dev/base/lppl.pdf
index 1d3697bc5b0..86e4515dd4a 100644
--- a/Master/texmf-dist/doc/latex-dev/base/lppl.pdf
+++ b/Master/texmf-dist/doc/latex-dev/base/lppl.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex-dev/base/ltfilehook-code.pdf b/Master/texmf-dist/doc/latex-dev/base/ltfilehook-code.pdf
index 12d6fbbd3a1..b70786fabf2 100644
--- a/Master/texmf-dist/doc/latex-dev/base/ltfilehook-code.pdf
+++ b/Master/texmf-dist/doc/latex-dev/base/ltfilehook-code.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex-dev/base/ltfilehook-doc.pdf b/Master/texmf-dist/doc/latex-dev/base/ltfilehook-doc.pdf
index f5d37d4e9b4..34ad7a782d1 100644
--- a/Master/texmf-dist/doc/latex-dev/base/ltfilehook-doc.pdf
+++ b/Master/texmf-dist/doc/latex-dev/base/ltfilehook-doc.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex-dev/base/lthooks-code.pdf b/Master/texmf-dist/doc/latex-dev/base/lthooks-code.pdf
index 03052d05450..960872ce86e 100644
--- a/Master/texmf-dist/doc/latex-dev/base/lthooks-code.pdf
+++ b/Master/texmf-dist/doc/latex-dev/base/lthooks-code.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex-dev/base/lthooks-doc.pdf b/Master/texmf-dist/doc/latex-dev/base/lthooks-doc.pdf
index adc99b31691..ec308ee62de 100644
--- a/Master/texmf-dist/doc/latex-dev/base/lthooks-doc.pdf
+++ b/Master/texmf-dist/doc/latex-dev/base/lthooks-doc.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex-dev/base/ltluatex.pdf b/Master/texmf-dist/doc/latex-dev/base/ltluatex.pdf
index f6c98b2b9fc..3b1e49da266 100644
--- a/Master/texmf-dist/doc/latex-dev/base/ltluatex.pdf
+++ b/Master/texmf-dist/doc/latex-dev/base/ltluatex.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex-dev/base/ltnews.pdf b/Master/texmf-dist/doc/latex-dev/base/ltnews.pdf
index 5fa6b9b8559..a890a221d1c 100644
--- a/Master/texmf-dist/doc/latex-dev/base/ltnews.pdf
+++ b/Master/texmf-dist/doc/latex-dev/base/ltnews.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex-dev/base/ltnews01.pdf b/Master/texmf-dist/doc/latex-dev/base/ltnews01.pdf
index 132c99241cf..0c4cda302e4 100644
--- a/Master/texmf-dist/doc/latex-dev/base/ltnews01.pdf
+++ b/Master/texmf-dist/doc/latex-dev/base/ltnews01.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex-dev/base/ltnews02.pdf b/Master/texmf-dist/doc/latex-dev/base/ltnews02.pdf
index 3cb443cacc1..7fb62414db8 100644
--- a/Master/texmf-dist/doc/latex-dev/base/ltnews02.pdf
+++ b/Master/texmf-dist/doc/latex-dev/base/ltnews02.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex-dev/base/ltnews03.pdf b/Master/texmf-dist/doc/latex-dev/base/ltnews03.pdf
index 489ba8fbfb5..d3d6d5104e2 100644
--- a/Master/texmf-dist/doc/latex-dev/base/ltnews03.pdf
+++ b/Master/texmf-dist/doc/latex-dev/base/ltnews03.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex-dev/base/ltnews04.pdf b/Master/texmf-dist/doc/latex-dev/base/ltnews04.pdf
index d19579de3e7..ed2708170ae 100644
--- a/Master/texmf-dist/doc/latex-dev/base/ltnews04.pdf
+++ b/Master/texmf-dist/doc/latex-dev/base/ltnews04.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex-dev/base/ltnews05.pdf b/Master/texmf-dist/doc/latex-dev/base/ltnews05.pdf
index 07cf7ae8a5a..55d21d641bf 100644
--- a/Master/texmf-dist/doc/latex-dev/base/ltnews05.pdf
+++ b/Master/texmf-dist/doc/latex-dev/base/ltnews05.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex-dev/base/ltnews06.pdf b/Master/texmf-dist/doc/latex-dev/base/ltnews06.pdf
index 526c9dc1672..99ab73bba75 100644
--- a/Master/texmf-dist/doc/latex-dev/base/ltnews06.pdf
+++ b/Master/texmf-dist/doc/latex-dev/base/ltnews06.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex-dev/base/ltnews07.pdf b/Master/texmf-dist/doc/latex-dev/base/ltnews07.pdf
index 9bdb3c44faf..dc6913b4d6d 100644
--- a/Master/texmf-dist/doc/latex-dev/base/ltnews07.pdf
+++ b/Master/texmf-dist/doc/latex-dev/base/ltnews07.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex-dev/base/ltnews08.pdf b/Master/texmf-dist/doc/latex-dev/base/ltnews08.pdf
index a5305c04390..90d3b71e74a 100644
--- a/Master/texmf-dist/doc/latex-dev/base/ltnews08.pdf
+++ b/Master/texmf-dist/doc/latex-dev/base/ltnews08.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex-dev/base/ltnews09.pdf b/Master/texmf-dist/doc/latex-dev/base/ltnews09.pdf
index 25bcf3b22dc..8cbf0547439 100644
--- a/Master/texmf-dist/doc/latex-dev/base/ltnews09.pdf
+++ b/Master/texmf-dist/doc/latex-dev/base/ltnews09.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex-dev/base/ltnews10.pdf b/Master/texmf-dist/doc/latex-dev/base/ltnews10.pdf
index d0cd7834912..bb03c0497a7 100644
--- a/Master/texmf-dist/doc/latex-dev/base/ltnews10.pdf
+++ b/Master/texmf-dist/doc/latex-dev/base/ltnews10.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex-dev/base/ltnews11.pdf b/Master/texmf-dist/doc/latex-dev/base/ltnews11.pdf
index c7ba9f8feb5..b34534a9e40 100644
--- a/Master/texmf-dist/doc/latex-dev/base/ltnews11.pdf
+++ b/Master/texmf-dist/doc/latex-dev/base/ltnews11.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex-dev/base/ltnews12.pdf b/Master/texmf-dist/doc/latex-dev/base/ltnews12.pdf
index 3899b9d2942..3ce0db8cf5e 100644
--- a/Master/texmf-dist/doc/latex-dev/base/ltnews12.pdf
+++ b/Master/texmf-dist/doc/latex-dev/base/ltnews12.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex-dev/base/ltnews13.pdf b/Master/texmf-dist/doc/latex-dev/base/ltnews13.pdf
index 9a6656aa309..24e35095090 100644
--- a/Master/texmf-dist/doc/latex-dev/base/ltnews13.pdf
+++ b/Master/texmf-dist/doc/latex-dev/base/ltnews13.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex-dev/base/ltnews14.pdf b/Master/texmf-dist/doc/latex-dev/base/ltnews14.pdf
index 0d3906f63d0..9e714d14460 100644
--- a/Master/texmf-dist/doc/latex-dev/base/ltnews14.pdf
+++ b/Master/texmf-dist/doc/latex-dev/base/ltnews14.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex-dev/base/ltnews15.pdf b/Master/texmf-dist/doc/latex-dev/base/ltnews15.pdf
index c94d07f167a..bb345d0b9a7 100644
--- a/Master/texmf-dist/doc/latex-dev/base/ltnews15.pdf
+++ b/Master/texmf-dist/doc/latex-dev/base/ltnews15.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex-dev/base/ltnews16.pdf b/Master/texmf-dist/doc/latex-dev/base/ltnews16.pdf
index afaa2d49d36..1f05a760758 100644
--- a/Master/texmf-dist/doc/latex-dev/base/ltnews16.pdf
+++ b/Master/texmf-dist/doc/latex-dev/base/ltnews16.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex-dev/base/ltnews17.pdf b/Master/texmf-dist/doc/latex-dev/base/ltnews17.pdf
index 0e5e08732e4..8bfb542a8a3 100644
--- a/Master/texmf-dist/doc/latex-dev/base/ltnews17.pdf
+++ b/Master/texmf-dist/doc/latex-dev/base/ltnews17.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex-dev/base/ltnews18.pdf b/Master/texmf-dist/doc/latex-dev/base/ltnews18.pdf
index d81914117e9..8e17971dc98 100644
--- a/Master/texmf-dist/doc/latex-dev/base/ltnews18.pdf
+++ b/Master/texmf-dist/doc/latex-dev/base/ltnews18.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex-dev/base/ltnews19.pdf b/Master/texmf-dist/doc/latex-dev/base/ltnews19.pdf
index 8a27941114e..6b61682b7e7 100644
--- a/Master/texmf-dist/doc/latex-dev/base/ltnews19.pdf
+++ b/Master/texmf-dist/doc/latex-dev/base/ltnews19.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex-dev/base/ltnews20.pdf b/Master/texmf-dist/doc/latex-dev/base/ltnews20.pdf
index 9c35861a8bd..9655c580456 100644
--- a/Master/texmf-dist/doc/latex-dev/base/ltnews20.pdf
+++ b/Master/texmf-dist/doc/latex-dev/base/ltnews20.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex-dev/base/ltnews21.pdf b/Master/texmf-dist/doc/latex-dev/base/ltnews21.pdf
index a708475e95a..97e68f9023b 100644
--- a/Master/texmf-dist/doc/latex-dev/base/ltnews21.pdf
+++ b/Master/texmf-dist/doc/latex-dev/base/ltnews21.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex-dev/base/ltnews22.pdf b/Master/texmf-dist/doc/latex-dev/base/ltnews22.pdf
index 96dba3bd9e2..280960478d1 100644
--- a/Master/texmf-dist/doc/latex-dev/base/ltnews22.pdf
+++ b/Master/texmf-dist/doc/latex-dev/base/ltnews22.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex-dev/base/ltnews23.pdf b/Master/texmf-dist/doc/latex-dev/base/ltnews23.pdf
index 4b60f97a9c4..6d28bb490e9 100644
--- a/Master/texmf-dist/doc/latex-dev/base/ltnews23.pdf
+++ b/Master/texmf-dist/doc/latex-dev/base/ltnews23.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex-dev/base/ltnews24.pdf b/Master/texmf-dist/doc/latex-dev/base/ltnews24.pdf
index c9f4d83b646..19ab77e7166 100644
--- a/Master/texmf-dist/doc/latex-dev/base/ltnews24.pdf
+++ b/Master/texmf-dist/doc/latex-dev/base/ltnews24.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex-dev/base/ltnews25.pdf b/Master/texmf-dist/doc/latex-dev/base/ltnews25.pdf
index 2cd7928a24b..f4d721b98da 100644
--- a/Master/texmf-dist/doc/latex-dev/base/ltnews25.pdf
+++ b/Master/texmf-dist/doc/latex-dev/base/ltnews25.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex-dev/base/ltnews26.pdf b/Master/texmf-dist/doc/latex-dev/base/ltnews26.pdf
index d41d1e92a2b..0e2c54327b7 100644
--- a/Master/texmf-dist/doc/latex-dev/base/ltnews26.pdf
+++ b/Master/texmf-dist/doc/latex-dev/base/ltnews26.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex-dev/base/ltnews27.pdf b/Master/texmf-dist/doc/latex-dev/base/ltnews27.pdf
index d9fdef0d3cb..6aabf9663e8 100644
--- a/Master/texmf-dist/doc/latex-dev/base/ltnews27.pdf
+++ b/Master/texmf-dist/doc/latex-dev/base/ltnews27.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex-dev/base/ltnews28.pdf b/Master/texmf-dist/doc/latex-dev/base/ltnews28.pdf
index 3b61224d22a..116a4e1a6b0 100644
--- a/Master/texmf-dist/doc/latex-dev/base/ltnews28.pdf
+++ b/Master/texmf-dist/doc/latex-dev/base/ltnews28.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex-dev/base/ltnews29.pdf b/Master/texmf-dist/doc/latex-dev/base/ltnews29.pdf
index 973a052b7e8..72a351406eb 100644
--- a/Master/texmf-dist/doc/latex-dev/base/ltnews29.pdf
+++ b/Master/texmf-dist/doc/latex-dev/base/ltnews29.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex-dev/base/ltnews30.pdf b/Master/texmf-dist/doc/latex-dev/base/ltnews30.pdf
index 5d16b19cb03..6d6495a007d 100644
--- a/Master/texmf-dist/doc/latex-dev/base/ltnews30.pdf
+++ b/Master/texmf-dist/doc/latex-dev/base/ltnews30.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex-dev/base/ltnews31.pdf b/Master/texmf-dist/doc/latex-dev/base/ltnews31.pdf
index f3219cff44a..035d2259c1b 100644
--- a/Master/texmf-dist/doc/latex-dev/base/ltnews31.pdf
+++ b/Master/texmf-dist/doc/latex-dev/base/ltnews31.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex-dev/base/ltnews32.pdf b/Master/texmf-dist/doc/latex-dev/base/ltnews32.pdf
index 5e3d9ff8993..850d3dbf794 100644
--- a/Master/texmf-dist/doc/latex-dev/base/ltnews32.pdf
+++ b/Master/texmf-dist/doc/latex-dev/base/ltnews32.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex-dev/base/ltshipout-code.pdf b/Master/texmf-dist/doc/latex-dev/base/ltshipout-code.pdf
index 0456d62a501..13d7a72414b 100644
--- a/Master/texmf-dist/doc/latex-dev/base/ltshipout-code.pdf
+++ b/Master/texmf-dist/doc/latex-dev/base/ltshipout-code.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex-dev/base/ltshipout-doc.pdf b/Master/texmf-dist/doc/latex-dev/base/ltshipout-doc.pdf
index da5dfd5080e..9970447b2bc 100644
--- a/Master/texmf-dist/doc/latex-dev/base/ltshipout-doc.pdf
+++ b/Master/texmf-dist/doc/latex-dev/base/ltshipout-doc.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex-dev/base/ltx3info.pdf b/Master/texmf-dist/doc/latex-dev/base/ltx3info.pdf
index 66f3630d672..420058561e0 100644
--- a/Master/texmf-dist/doc/latex-dev/base/ltx3info.pdf
+++ b/Master/texmf-dist/doc/latex-dev/base/ltx3info.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex-dev/base/ltxdoc.pdf b/Master/texmf-dist/doc/latex-dev/base/ltxdoc.pdf
index a366dd9d9ec..02b74f93baa 100644
--- a/Master/texmf-dist/doc/latex-dev/base/ltxdoc.pdf
+++ b/Master/texmf-dist/doc/latex-dev/base/ltxdoc.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex-dev/base/makeindx.pdf b/Master/texmf-dist/doc/latex-dev/base/makeindx.pdf
index c95d21b5844..c1774541c12 100644
--- a/Master/texmf-dist/doc/latex-dev/base/makeindx.pdf
+++ b/Master/texmf-dist/doc/latex-dev/base/makeindx.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex-dev/base/manual.pdf b/Master/texmf-dist/doc/latex-dev/base/manual.pdf
index f18a49e8723..cb07d3d20ce 100644
--- a/Master/texmf-dist/doc/latex-dev/base/manual.pdf
+++ b/Master/texmf-dist/doc/latex-dev/base/manual.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex-dev/base/modguide.pdf b/Master/texmf-dist/doc/latex-dev/base/modguide.pdf
index f898b44b83e..1c0a657082e 100644
--- a/Master/texmf-dist/doc/latex-dev/base/modguide.pdf
+++ b/Master/texmf-dist/doc/latex-dev/base/modguide.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex-dev/base/nfssfont.pdf b/Master/texmf-dist/doc/latex-dev/base/nfssfont.pdf
index cb94d382b97..538cf605896 100644
--- a/Master/texmf-dist/doc/latex-dev/base/nfssfont.pdf
+++ b/Master/texmf-dist/doc/latex-dev/base/nfssfont.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex-dev/base/proc.pdf b/Master/texmf-dist/doc/latex-dev/base/proc.pdf
index a2cf1a4b2e2..284b07fea0e 100644
--- a/Master/texmf-dist/doc/latex-dev/base/proc.pdf
+++ b/Master/texmf-dist/doc/latex-dev/base/proc.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex-dev/base/slides.pdf b/Master/texmf-dist/doc/latex-dev/base/slides.pdf
index 43cd65b9024..e7c9c947bf0 100644
--- a/Master/texmf-dist/doc/latex-dev/base/slides.pdf
+++ b/Master/texmf-dist/doc/latex-dev/base/slides.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex-dev/base/slifonts.pdf b/Master/texmf-dist/doc/latex-dev/base/slifonts.pdf
index 5343749f64a..ebd1eed1d31 100644
--- a/Master/texmf-dist/doc/latex-dev/base/slifonts.pdf
+++ b/Master/texmf-dist/doc/latex-dev/base/slifonts.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex-dev/base/source2e.pdf b/Master/texmf-dist/doc/latex-dev/base/source2e.pdf
index 671b4cf2805..f563c90f69a 100644
--- a/Master/texmf-dist/doc/latex-dev/base/source2e.pdf
+++ b/Master/texmf-dist/doc/latex-dev/base/source2e.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex-dev/base/syntonly.pdf b/Master/texmf-dist/doc/latex-dev/base/syntonly.pdf
index 7b13311d3ea..badd3664524 100644
--- a/Master/texmf-dist/doc/latex-dev/base/syntonly.pdf
+++ b/Master/texmf-dist/doc/latex-dev/base/syntonly.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex-dev/base/tlc2.pdf b/Master/texmf-dist/doc/latex-dev/base/tlc2.pdf
index e8d6d2374a5..e879e9e7ed7 100644
--- a/Master/texmf-dist/doc/latex-dev/base/tlc2.pdf
+++ b/Master/texmf-dist/doc/latex-dev/base/tlc2.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex-dev/base/tulm.pdf b/Master/texmf-dist/doc/latex-dev/base/tulm.pdf
index f1d66d765c1..93e4fd65c6b 100644
--- a/Master/texmf-dist/doc/latex-dev/base/tulm.pdf
+++ b/Master/texmf-dist/doc/latex-dev/base/tulm.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex-dev/base/usrguide.pdf b/Master/texmf-dist/doc/latex-dev/base/usrguide.pdf
index 6d5beb8320d..2dd6844667d 100644
--- a/Master/texmf-dist/doc/latex-dev/base/usrguide.pdf
+++ b/Master/texmf-dist/doc/latex-dev/base/usrguide.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex-dev/base/utf8ienc.pdf b/Master/texmf-dist/doc/latex-dev/base/utf8ienc.pdf
index 8e2035df466..cbd563ad225 100644
--- a/Master/texmf-dist/doc/latex-dev/base/utf8ienc.pdf
+++ b/Master/texmf-dist/doc/latex-dev/base/utf8ienc.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex-dev/base/webcomp.pdf b/Master/texmf-dist/doc/latex-dev/base/webcomp.pdf
index 60253501890..0687dc796e1 100644
--- a/Master/texmf-dist/doc/latex-dev/base/webcomp.pdf
+++ b/Master/texmf-dist/doc/latex-dev/base/webcomp.pdf
Binary files differ
diff --git a/Master/texmf-dist/source/latex-dev/base/ltclass.dtx b/Master/texmf-dist/source/latex-dev/base/ltclass.dtx
index 7b1dbc81275..44fe0f88567 100644
--- a/Master/texmf-dist/source/latex-dev/base/ltclass.dtx
+++ b/Master/texmf-dist/source/latex-dev/base/ltclass.dtx
@@ -33,7 +33,7 @@
%<*driver>
% \fi
\ProvidesFile{ltclass.dtx}
- [2020/08/29 v1.3p LaTeX Kernel (Class & Package Interface)]
+ [2020/09/06 v1.3q LaTeX Kernel (Class & Package Interface)]
% \iffalse
\documentclass{ltxdoc}
\GetFileInfo{ltclass.dtx}
@@ -1021,11 +1021,28 @@
% If the package has been loaded, we check that it was first loaded with
% the options. Otherwise we add the option list to that of the package.
% \begin{macrocode}
+%</2ekernel>
+%<latexrelease>\IncludeInRelease{2020/10/01}{\@pass@ptions}
+%<latexrelease> {Add file replacement in \@pass@ptions}%
+%<*2ekernel|latexrelease>
\def\@pass@ptions#1#2#3{%
- \expandafter\xdef\csname opt@#3.#1\endcsname{%
- \@ifundefined{opt@#3.#1}\@empty
- {\csname opt@#3.#1\endcsname,}%
+ \edef\reserved@a{\@expl@@@filehook@resolve@file@subst@@w #3.#1\@nil}%
+ \expandafter\xdef\csname opt@\reserved@a\endcsname{%
+ \@ifundefined{opt@\reserved@a}\@empty
+ {\csname opt@\reserved@a\endcsname,}%
\zap@space#2 \@empty}}
+%</2ekernel|latexrelease>
+%<latexrelease>\EndIncludeInRelease
+%
+%<latexrelease>\IncludeInRelease{0000/00/00}{\@pass@ptions}
+%<latexrelease> {\@pass@ptions}%
+%<latexrelease>\def\@pass@ptions#1#2#3{%
+%<latexrelease> \expandafter\xdef\csname opt@#3.#1\endcsname{%
+%<latexrelease> \@ifundefined{opt@#3.#1}\@empty
+%<latexrelease> {\csname opt@#3.#1\endcsname,}%
+%<latexrelease> \zap@space#2 \@empty}}
+%<latexrelease>\EndIncludeInRelease
+%<*2ekernel>
\@onlypreamble\@pass@ptions
% \end{macrocode}
%
@@ -1633,8 +1650,6 @@
\@onlypreamble\@fileswith@pti@ns
% \end{macrocode}
%
-
-
% \begin{macro}{\load@onefilewithoptions}
% This macro is used when loading packages or classes.
%
@@ -1727,6 +1742,29 @@
{\@expl@@@filehook@file@push@@
\set@curr@file{\@currname.\@currext}%
\@filehook@set@CurrentFile
+% \end{macrocode}
+% \changes{v1.3q}{2020/09/06}
+% {Save \cs{@currpkg@reqd} so that we don't lose track of
+% package substitutions.}
+% The \cs{set@curr@file} line above might have replaced the file, so
+% \cs{@currname} and \cs{@currext} may no longer hold the actual
+% package being loaded, so in that case we need to update these two
+% token lists (\cs{@curr@file} holds the file name after replacement,
+% so we parse that).
+%
+% The requested file is saved in \cs{@currpkg@reqd} to be used in
+% \cs{InputIfFileExists} later: if the updated \cs{@currname} and
+% \cs{@currext} are used we lose track of the substitution, so
+% \cs{CurrentFile} and \cs{CurrentFileUsed} will be (incorrectly)
+% the same.
+% \begin{macrocode}
+ \edef\@currpkg@reqd{\@currname.\@currext}%
+ \ifx\CurrentFile\CurrentFileUsed
+ \else
+ \filename@parse\@curr@file
+ \edef\@currname{\string@makeletter\filename@base}%
+ \edef\@currext{\string@makeletter\filename@ext}%
+ \fi
\load@onefile@withoptions{#2}%
% \end{macrocode}
% Now just clean up and exit.
@@ -1761,11 +1799,10 @@
%
% The kernel no longer uses \cs{@unprocessedoptions}
% \begin{macrocode}
-\let\@unprocessedoptions\@undefined
+\let\@unprocessedoptions\@undefined
% \end{macrocode}
% \end{macro}
-
-
+%
% \begin{macro}{\@missing@onefilewithoptions}
% Now the action taken when a file is not found.
% \begin{macrocode}
@@ -1817,7 +1854,9 @@
% Now actually load the file (at this point we are certain it exists,
% but use \cs{InputIfFileExists} so that file hooks are executed):
% \begin{macrocode}
- \InputIfFileExists{\@currname.\@currext}{}{}%
+ \InputIfFileExists{\@currpkg@reqd}{}%
+ {\@latex@error
+ {The \@cls@pkg\space\@currpkg@reqd\space failed to load.}\@ehd}%
%-----------------------------------------
% \end{macrocode}
% In older versions of the code |\@unprocessedoptions| would
@@ -1878,7 +1917,7 @@
\fi
\fi}%
%-----------------------------------------
- \reserved@a}
+ \@ifl@aded\@currext\@currname{}{\reserved@a}}
% \end{macrocode}
% \end{macro}
%
diff --git a/Master/texmf-dist/source/latex-dev/base/ltdefns.dtx b/Master/texmf-dist/source/latex-dev/base/ltdefns.dtx
index ea6a924f98f..476d102ae4e 100644
--- a/Master/texmf-dist/source/latex-dev/base/ltdefns.dtx
+++ b/Master/texmf-dist/source/latex-dev/base/ltdefns.dtx
@@ -32,7 +32,7 @@
%<*driver>
% \fi
\ProvidesFile{ltdefns.dtx}
- [2020/08/21 v1.5m LaTeX Kernel (definition commands)]
+ [2020/09/06 v1.5n LaTeX Kernel (definition commands)]
% \iffalse
\documentclass{ltxdoc}
\GetFileInfo{ltdefns.dtx}
@@ -2194,6 +2194,56 @@
% \end{macro}
%
%
+% \begin{macro}{\string@makeletter}
+% \begin{macro}{\@string@makeletter}
+% \begin{macro}{\char@if@alph}
+% Iterates through a string, turning each alphabetic character into
+% a catcode-11 token (partly undoes a \cs{detokenize}). Useful for
+% \cs{ifx}-based string comparisons where \cs{detokenize}-ing the
+% other string would break too much code.
+%
+% \changes{v1.5n}{2020/09/06}
+% {Macro added}
+%
+% The macro uses \textsf{expl3}'s \cs{@expl@str@map@function@@NN} to
+% iterate on the string (without losing spaces) and applies
+% \cs{@string@makeletter} on each character. The latter checks if
+% character is between a--z or A--Z, and uses \cs{@alph} or \cs{@Alph}
+% to get the corresponding catcode-11 token. Other tokens are passed
+% through unchanged.
+% \begin{macrocode}
+%</2ekernel>
+%<latexrelease>\IncludeInRelease{2020/10/01}{\string@makeletter}
+%<latexrelease> {Add \string@makeletter}%
+%<*2ekernel|latexrelease>
+\def\string@makeletter#1{%
+ \@expl@str@map@function@@NN#1\@string@makeletter}
+\def\@string@makeletter#1{%
+ \char@if@alph{#1}%
+ {\@expl@char@generate@@nn{`#1}{11}}%
+ {#1}}
+\def\char@if@alph#1{%
+ \ifnum0\ifnum`#1<`A 1\fi\ifnum`#1>`z 1\fi
+ \if\ifnum`#1>`Z @\fi\ifnum`#1<`a @\fi01\fi>0
+ \expandafter\@secondoftwo
+ \else
+ \expandafter\@firstoftwo
+ \fi}
+%</2ekernel|latexrelease>
+%<latexrelease>\EndIncludeInRelease
+%
+%<latexrelease>\IncludeInRelease{0000/00/00}{\string@makeletter}
+%<latexrelease> {Undefine \string@makeletter}%
+%<latexrelease>\let\string@makeletter\@undefined
+%<latexrelease>\let\@string@makeletter\@undefined
+%<latexrelease>\let\char@if@alph\@undefined
+%<latexrelease>\EndIncludeInRelease
+%<*2ekernel>
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
%
% \begin{macro}{\makeatletter}
% \begin{macro}{\makeatother}
@@ -2207,7 +2257,6 @@
% \end{macro}
% \end{macro}
%
-
%
% \section{Discretionary Hyphenation}
% \begin{macro}{\-}
diff --git a/Master/texmf-dist/source/latex-dev/base/ltexpl.dtx b/Master/texmf-dist/source/latex-dev/base/ltexpl.dtx
index 16ca26095c1..4100da79c28 100644
--- a/Master/texmf-dist/source/latex-dev/base/ltexpl.dtx
+++ b/Master/texmf-dist/source/latex-dev/base/ltexpl.dtx
@@ -33,7 +33,7 @@
%<*driver>
% \fi
\ProvidesFile{ltexpl.dtx}
- [2020/08/21 v1.2e LaTeX Kernel (expl3-dependent code)]
+ [2020/09/06 v1.2f LaTeX Kernel (expl3-dependent code)]
% \iffalse
\documentclass{ltxdoc}
\GetFileInfo{ltexpl.dtx}
@@ -272,7 +272,7 @@
% \end{macrocode}
%
% \changes{v1.2e}{2020/08/19}
-% {Add \cs{\@expl@cs@\meta{thing}@spec@@N}
+% {Add \cs{@expl@cs@\meta{thing}@spec@@N}
% for \cs{ShowCommand} (gh/373)}
% \begin{macrocode}
\cs_gset_eq:NN \@expl@cs@prefix@spec@@N \cs_prefix_spec:N
@@ -280,6 +280,15 @@
\cs_gset_eq:NN \@expl@cs@replacement@spec@@N \cs_replacement_spec:N
% \end{macrocode}
%
+% \changes{v1.2f}{2020/09/06}
+% {Add \cs{@expl@str@map@function@@NN
+% and \cs{@expl@char@generate@@nn}}
+% for \cs{string@makeletter} (gh/386)}
+% \begin{macrocode}
+\cs_gset_eq:NN \@expl@str@map@function@@NN \str_map_function:NN
+\cs_gset_eq:NN \@expl@char@generate@@nn \char_generate:nn
+% \end{macrocode}
+%
% \begin{macrocode}
%<latexrelease>\EndIncludeInRelease
%<latexrelease>\IncludeInRelease{0000/00/00}{expl3~2020-10-01}%
@@ -289,6 +298,7 @@
%<latexrelease>\cs_undefine:N \@expl@cs@prefix@spec@@N
%<latexrelease>\cs_undefine:N \@expl@cs@argument@spec@@N
%<latexrelease>\cs_undefine:N \@expl@cs@replacement@spec@@N
+%<latexrelease>\cs_undefine:N \@expl@str@map@function@@NN
%<latexrelease>\EndIncludeInRelease
%</2ekernel|latexrelease>
% \end{macrocode}
diff --git a/Master/texmf-dist/source/latex-dev/base/ltfilehook.dtx b/Master/texmf-dist/source/latex-dev/base/ltfilehook.dtx
index 73018c682d5..26dba35165f 100644
--- a/Master/texmf-dist/source/latex-dev/base/ltfilehook.dtx
+++ b/Master/texmf-dist/source/latex-dev/base/ltfilehook.dtx
@@ -28,7 +28,7 @@
%
% \iffalse
%
-%%% From File: ltshipout.dtx
+%%% From File: ltfilehook.dtx
%
% \begin{macrocode}
\providecommand\ltfilehookversion{v1.0a}
@@ -1357,7 +1357,7 @@
% \end{macrocode}
%
% \begin{macrocode}
-\cs_new_eq:NN \@expl@@@filehook@file@push@@
+\cs_new_eq:NN \@expl@@@filehook@file@push@@
\__filehook_file_push:
% \end{macrocode}
%
@@ -1434,7 +1434,7 @@
% If there was a file replacement, show that as well:
% \begin{macrocode}
\str_if_eq:NNF \CurrentFileUsed \CurrentFile
- { ~ ( \CurrentFile \space requested ) }
+ { ~ ( \CurrentFile \c_space_tl requested ) }
\iow_newline:
}
\str_if_eq:nnT {#1} {STOP} { \int_gdecr:N \g_@@_nesting_level_int }
@@ -1485,7 +1485,7 @@
% Here is the package file we point to:
% \begin{macrocode}
%<*atveryend-ltx>
-\ProvidesPackage{atveryend}
+\ProvidesPackage{atveryend-ltx}
[2020/08/19 v1.0a
Emulation of the original atvery package^^Jwith kernel methods]
% \end{macrocode}
diff --git a/Master/texmf-dist/source/latex-dev/base/ltfiles.dtx b/Master/texmf-dist/source/latex-dev/base/ltfiles.dtx
index a5ad754bfdc..835f600e323 100644
--- a/Master/texmf-dist/source/latex-dev/base/ltfiles.dtx
+++ b/Master/texmf-dist/source/latex-dev/base/ltfiles.dtx
@@ -461,7 +461,7 @@
% \begin{macrocode}
\edef \@kernel@after@begindocument@before {%
\let\expandafter\noexpand\csname
- g__hook_env/document/begin_code_tl\endcsname
+ __hook env/document/begin\endcsname
\noexpand\@empty}
% \end{macrocode}
%
diff --git a/Master/texmf-dist/source/latex-dev/base/lthooks.dtx b/Master/texmf-dist/source/latex-dev/base/lthooks.dtx
index b1e3985704a..17c3262a4c1 100644
--- a/Master/texmf-dist/source/latex-dev/base/lthooks.dtx
+++ b/Master/texmf-dist/source/latex-dev/base/lthooks.dtx
@@ -32,7 +32,7 @@
%
% \begin{macrocode}
\def\lthooksversion{v1.0a}
-\def\lthooksdate{2020/08/31}
+\def\lthooksdate{2020/09/10}
% \end{macrocode}
%
%<*driver>
@@ -351,6 +351,21 @@
% \meta{label} throughout the sub-packages in order to avoid
% that the labels change if you internally reorganize your code.
%
+% Except for \cs{UseHook}, \cs{UseOneTimeHook}, \cs{IfHookEmptyTF}, and
+% \cs{IfHookExistsTF} (and their \pkg{expl3} interfaces \cs{hook_use:n},
+% \cs{hook_use_once:n}, \cs{hook_if_empty:nTF}, and
+% \cs{hook_if_exist:nTF}), all \meta{hook}
+% and \meta{label} arguments are processed in the same way: first,
+% spaces are trimmed around the argument, then it is fully expanded
+% until only character tokens remain. If the full expansion of the
+% \meta{hook} or \meta{label} contains a non-expandable non-character
+% token, a low-level \TeX{} error is raised (namely, the \meta{hook} is
+% expanded using \TeX's \cs{csname}\ldots\cs{endcsname}, as such,
+% Unicode characters are allowed in \meta{hook} and \meta{label}
+% arguments). The arguments of \cs{UseHook} and \cs{UseOneTimeHook} are
+% processed much in the same way except that spaces are not trimmed
+% around the argument, for better performance.
+%
% It is not enforced, but highly recommended that the hooks defined by
% a package, and the \meta{labels} used to add code to other hooks
% contain the package name to easily identify the source of the code
@@ -599,6 +614,10 @@
% to adding and removing code from it, so this test should be used
% sparingly.
%
+% Generic hooks are declared at the time code is added to them, so the
+% result of \cs{hook_if_exist:n} will change once code is added to
+% said hook (unless the hook was previously declared).
+%
% The \meta{hook} \emph{cannot} be specified using the dot-syntax.
% A leading |.| is treated literally.
% \end{function}
@@ -611,7 +630,7 @@
% rule it is helpful to get some information about the code
% associated with a hook, its current order and the existing rules.
%
-% \begin{function}{\ShowHook}
+% \begin{function}{\ShowHook,\LogHook}
% \begin{syntax}
% \cs{ShowHook} \Arg{hook}
% \end{syntax}
@@ -627,6 +646,10 @@
% any code executed on the next invocation only.
% \end{itemize}
%
+% \cs{LogHook} prints the information to the |.log| file, and
+% \cs{ShowHook} prints them to the terminal/command window and starts
+% \TeX's prompt (only if \cs{errorstopmode}) to wait for user action.
+%
% The \meta{hook} can be specified using the dot-syntax to denote
% the current package name. See section~\ref{sec:default-label}.
% \end{function}
@@ -796,18 +819,43 @@
% branches to either \meta{true code} or \meta{false code} depending
% on the result.
%
-% \fmi{what are the results for generic hooks that do not need to be declared?}
-%
% The existence of a hook usually doesn't mean much from the viewpoint
% of code that tries to add/remove code from that hook, since package
% loading order may vary, thus the creation of hooks is asynchronous
% to adding and removing code from it, so this test should be used
% sparingly.
%
+% Generic hooks are declared at the time code is added to them, so the
+% result of \cs{hook_if_exist:n} will change once code is added to
+% said hook (unless the hook was previously declared).
+%
% The \meta{hook} \emph{cannot} be specified using the dot-syntax.
% A leading |.| is treated literally.
% \end{function}
%
+% \begin{function}{\hook_show:n,\hook_log:n}
+% \begin{syntax}
+% \cs{hook_show:n} \Arg{hook}
+% \end{syntax}
+% Displays information about the \meta{hook} such as
+% \begin{itemize}
+% \item
+% the code chunks (and their labels) added to it,
+% \item
+% any rules set up to order them,
+% \item
+% the computed order in which the chunks are executed,
+% \item
+% any code executed on the next invocation only.
+% \end{itemize}
+%
+% \cs{hook_log:n} prints the information to the |.log| file, and
+% \cs{hook_show:n} prints them to the terminal/command window and starts
+% \TeX's prompt (only if \cs{errorstopmode}) to wait for user action.
+%
+% The \meta{hook} can be specified using the dot-syntax to denote
+% the current package name. See section~\ref{sec:default-label}.
+% \end{function}
%
% \begin{function}{\hook_debug_on:,\hook_debug_off:}
% \begin{syntax}
@@ -1586,6 +1634,20 @@
% \end{macrocode}
% \end{macro}
%
+% \begin{macro}{\g_@@_execute_immediately_prop}
+% List of hooks that from no on should not longer receive code.
+% \begin{macrocode}
+\prop_new:N \g_@@_execute_immediately_prop
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\g_@@_used_prop}
+% All hooks that receive code (for use in debugging display).
+% \begin{macrocode}
+\prop_new:N \g_@@_used_prop
+% \end{macrocode}
+% \end{macro}
+%
% \begin{macro}{\g_@@_hook_curr_name_tl,\g_@@_name_stack_seq}
% Default label used for hook commands, and a stack to keep track of
% packages within packages.
@@ -1602,10 +1664,12 @@
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\tl_gremove_once:Nx}
+% \begin{macro}{\tl_gremove_once:Nx,\tl_show:x,\tl_log:x}
% Some variants of \pkg{expl3} functions. \fmi{should be moved to expl3}
% \begin{macrocode}
\cs_generate_variant:Nn \tl_gremove_once:Nn { Nx }
+\cs_generate_variant:Nn \tl_show:n { x }
+\cs_generate_variant:Nn \tl_log:n { x }
% \end{macrocode}
% \end{macro}
%
@@ -1619,7 +1683,7 @@
%
% \subsection{Providing new hooks}
%
-% \begin{macro}{\g_@@_..._code_prop,\g_@@_..._code_tl,\g_@@_..._code_next_tl}
+% \begin{macro}{\g_@@_..._code_prop,\@@~...,\@@_next~...}
%
% Hooks have a \meta{name} and for each hook we have to provide a number of
% data structures. These are
@@ -1635,10 +1699,14 @@
% (reverse) sorted to ensure that two labels always point to the same
% token list. For global rules, the \meta{name} is |??|.
%
-% \item[\cs{g_@@_\meta{name}_code_tl}] The code that is actually executed
+% \item[\cs{@@~\meta{name}}] The code that is actually executed
% when the hook is called in the document is stored in this token
% list. It is constructed from the code chunks applying the
% information.
+% This token list is named like that so that in case of an error
+% inside the hook, the reported token list in the error is shorter,
+% and to make it simpler to normalize hook names in
+% \cs{@@_make_name:n}.
%
% \item[\cs{g_@@_\meta{name}_reversed_tl}] Some hooks are
% \enquote{reversed}. This token list stores a |-| for such hook
@@ -1646,14 +1714,15 @@
% $\meta{reversed}1$ is $+1$ for normal hooks and $-1$ for reversed
% ones.
%
-% \item[\cs{g_@@_\meta{name}_code_next_tl}] Finally there is extra code
+% \item[\cs{@@_next~\meta{name}}] Finally there is extra code
% (normally empty) that is used on the next invocation of the hook
% (and then deleted). This can be used to define some special
% behavior for a single occasion from within the document. This token
-% list is called |code_next| rather than |next_code| because otherwise
-% a hook called \meta{name}|_next| would have its code-token list
-% named \cs[no-index]{g_@@_\meta{name}_code_next_tl}, which would
-% clash with the next code-token list of a hook called \meta{name}.
+% list follows the same naming scheme than the main \cs{@@~\meta{name}}
+% token list. It is called \cs{@@_next~\meta{name}} rather than
+% \cs{@@~next_\meta{name}} because otherwise a hook whose name is
+% |next_|\meta{name} would clash with the next code-token list of the
+% hook called \meta{name}.
%
% \end{description}
% \end{macro}
@@ -1667,42 +1736,41 @@
% \hook{begindocument}.
% \begin{macrocode}
\cs_new_protected:Npn \hook_new:n #1
+ { \@@_normalize_hook_args:Nn \@@_new:n {#1} }
+\cs_new_protected:Npn \@@_new:n #1
{
- \exp_args:Nx \@@_new:n
- { \@@_parse_label_default:nn {#1} { top-level } }
- }
-\cs_new_protected:Npn \@@_new:n #1 {
% \end{macrocode}
% We check for one of the internal data structures and if it
% already exists we complain.
% \begin{macrocode}
- \hook_if_exist:nTF {#1}
- { \msg_error:nnn { hooks } { exists } {#1} }
+ \hook_if_exist:nTF {#1}
+ { \msg_error:nnn { hooks } { exists } {#1} }
% \end{macrocode}
% Otherwise we add the hook name to the list of all hooks and
% allocate the necessary data structures for the new hook.
% \begin{macrocode}
- { \seq_gput_right:Nn \g_@@_all_seq {#1}
+ {
+ \seq_gput_right:Nn \g_@@_all_seq {#1}
% \end{macrocode}
% This is only used by the actual code of the current hook, so
% declare it normally:
% \begin{macrocode}
- \tl_new:c { g_@@_#1_code_tl }
+ \tl_new:c { @@~#1 }
% \end{macrocode}
% Now ensure that the base data structure for the hook exists:
% \begin{macrocode}
- \@@_declare:n {#1}
+ \@@_declare:n {#1}
% \end{macrocode}
% The \cs{g_@@_\meta{hook}_labels_clist} holds the sorted list of
% labels (once it got sorted). This is used only for debugging.
% \begin{macrocode}
- \clist_new:c {g_@@_#1_labels_clist}
+ \clist_new:c {g_@@_#1_labels_clist}
% \end{macrocode}
% Some hooks should reverse the default order of code chunks. To
% signal this we have a token list which is empty for normal hooks
% and contains a \verb=-= for reversed hooks.
% \begin{macrocode}
- \tl_new:c { g_@@_#1_reversed_tl }
+ \tl_new:c { g_@@_#1_reversed_tl }
% \end{macrocode}
% The above is all in L3 convention, but we also provide an
% interface to legacy \LaTeXe{} hooks of the form \cs{@...hook},
@@ -1717,9 +1785,9 @@
% \end{quote}
%
% \begin{macrocode}
- \@@_include_legacy_code_chunk:n {#1}
+ \@@_include_legacy_code_chunk:n {#1}
}
-}
+ }
% \end{macrocode}
% \end{macro}
%
@@ -1737,7 +1805,7 @@
\@@_if_exist:nF {#1}
{
\prop_new:c { g_@@_#1_code_prop }
- \tl_new:c { g_@@_#1_code_next_tl }
+ \tl_new:c { @@_next~#1 }
}
}
% \end{macrocode}
@@ -1745,29 +1813,31 @@
%
%
%
-% \begin{macro}{\hook_new_reversed:n}
+% \begin{macro}{\hook_new_reversed:n,\@@_new_reversed:n}
%
% Declare a new hook. The default ordering of code chunks is
% reversed, signaled by setting the token list to a minus sign.
% \begin{macrocode}
-\cs_new_protected:Npn \hook_new_reversed:n #1 {
- \hook_new:n {#1}
+\cs_new_protected:Npn \hook_new_reversed:n #1
+ { \@@_normalize_hook_args:Nn \@@_new_reversed:n {#1} }
+\cs_new_protected:Npn \@@_new_reversed:n #1
+ {
+ \@@_new:n {#1}
% \end{macrocode}
% If the hook already exists the above will generate an error
% message, so the next line should be executed (but it is --- too
% bad).
% \begin{macrocode}
- \tl_gset:cn { g_@@_#1_reversed_tl } { - }
-}
+ \tl_gset:cn { g_@@_#1_reversed_tl } { - }
+ }
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\hook_new_pair:nn}
% A shorthand for declaring a normal and a (matching) reversed hook in one go.
% \begin{macrocode}
-\cs_new_protected:Npn \hook_new_pair:nn #1#2 {
- \hook_new:n {#1} \hook_new_reversed:n {#2}
-}
+\cs_new_protected:Npn \hook_new_pair:nn #1#2
+ { \hook_new:n {#1} \hook_new_reversed:n {#2} }
% \end{macrocode}
% \end{macro}
%
@@ -1823,19 +1893,24 @@
%
% \subsection{Parsing a label}
%
-% \begin{macro}[EXP]{\@@_parse_label_default:nn,\@@_parse_label_default:Vn}
+% \begin{macro}[EXP]{\@@_parse_label_default:n}
% This macro checks if a label was given (not \cs{c_novalue_tl}), and
% if so, tries to parse the label looking for a leading \verb|.| to
% replace for \cs{@currname}. Otherwise \cs{@@_currname_or_default:n}
% is used to pick \cs{@currname} or the fallback value.
+%
+% The default |top-level| is hard-coded here. It once was an
+% argument, but it's no longer needed. \pho{can't remember why}
% \begin{macrocode}
-\cs_new:Npn \@@_parse_label_default:nn #1 #2
+\cs_new:Npn \@@_parse_label_default:n #1
{
\tl_if_novalue:nTF {#1}
- { \@@_currname_or_default:n {#2} }
- { \tl_trim_spaces_apply:nN {#1} \@@_parse_dot_label:nn {#2} }
+ { \@@_currname_or_default:n { top-level } }
+ {
+ \tl_trim_spaces_apply:nN {#1}
+ \@@_parse_dot_label:nn { top-level }
+ }
}
-\cs_generate_variant:Nn \@@_parse_label_default:nn { V }
% \end{macrocode}
% \end{macro}
%
@@ -1862,7 +1937,7 @@
}
{
\str_if_eq:nnTF {#1} { . }
- { \@@_currname_or_default:n {#1} }
+ { \@@_currname_or_default:n {#2} }
{ \@@_parse_dot_label:nw {#2} #1 ./ \s_@@_mark }
}
}
@@ -1872,13 +1947,13 @@
{ \@@_parse_dot_label_aux:nw {#1} #3 \s_@@_mark }
{
\tl_if_empty:nTF {#3}
- {#2}
+ { \@@_make_name:n {#2} }
{ \@@_parse_dot_label_cleanup:w #2 ./ #3 \s_@@_mark }
}
}
\cs_new:Npn \@@_parse_dot_label_cleanup:w #1 ./ \s_@@_mark {#1}
\cs_new:Npn \@@_parse_dot_label_aux:nw #1 #2 ./ \s_@@_mark
- { \@@_currname_or_default:n {#1} / #2 }
+ { \@@_currname_or_default:n {#1} / \@@_make_name:n {#2} }
% \end{macrocode}
% \end{macro}
% \end{macro}
@@ -1893,7 +1968,7 @@
\tl_if_empty:NTF \g_@@_hook_curr_name_tl
{
\tl_if_empty:NTF \@currname
- {#1}
+ { \@@_make_name:n {#1} }
{ \@currname }
}
{ \g_@@_hook_curr_name_tl }
@@ -1901,7 +1976,73 @@
% \end{macrocode}
% \end{macro}
%
+% \begin{macro}[EXP]{\@@_make_name:n,\@@_make_name:w}
+% Provides a standard sanitisation of a hook's name.
+% It uses \cs{cs:w} to build a control sequence out of the hook name,
+% then uses \cs{cs_to_str:N} to get the string representation of that,
+% without the escape character. \cs{cs:w}-based expansion is used
+% instead of |e|-based because Unicode characters don't behave well
+% inside \cs{expanded}. The macro adds the \cs{@@~} prefix to the
+% hook name to reuse the hook's code token list to build the csname
+% and avoid leaving \enquote{public} control sequences defined
+% (as~\cs{relax}) in TeX's memory.
+% \begin{macrocode}
+\cs_new:Npn \@@_make_name:n #1
+ {
+ \exp_after:wN \exp_after:wN \exp_after:wN \@@_make_name:w
+ \exp_after:wN \token_to_str:N \cs:w @@~ #1 \cs_end:
+ }
+\exp_last_unbraced:NNNNo
+\cs_new:Npn \@@_make_name:w #1 \tl_to_str:n { @@~ } { }
+% \end{macrocode}
+% \end{macro}
%
+% \begin{macro}{\@@_normalize_hook_args:Nn}
+% \begin{macro}{\@@_normalize_hook_args:Nnn}
+% \begin{macro}{\@@_normalize_hook_rule_args:Nnnnn}
+% \begin{macro}{\@@_normalize_hook_args_aux:Nn}
+% Standard route for normalising hook and label arguments. The main
+% macro does the entire operation within a group so that csnames made
+% by \cs{@@_make_name:n} are wiped off before continuing. This means
+% that this function cannot be used for \cs{hook_use:n}!
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_normalize_hook_args_aux:Nn #1 #2
+ {
+ \group_begin:
+ \use:e
+ {
+ \group_end:
+ \exp_not:N #1 #2
+ }
+ }
+\cs_new_protected:Npn \@@_normalize_hook_args:Nn #1 #2
+ {
+ \@@_normalize_hook_args_aux:Nn #1
+ { { \@@_parse_label_default:n {#2} } }
+ }
+\cs_new_protected:Npn \@@_normalize_hook_args:Nnn #1 #2 #3
+ {
+ \@@_normalize_hook_args_aux:Nn #1
+ {
+ { \@@_parse_label_default:n {#2} }
+ { \@@_parse_label_default:n {#3} }
+ }
+ }
+\cs_new_protected:Npn \@@_normalize_hook_rule_args:Nnnnn #1 #2 #3 #4 #5
+ {
+ \@@_normalize_hook_args_aux:Nn #1
+ {
+ { \@@_parse_label_default:n {#2} }
+ { \@@_parse_label_default:n {#3} }
+ { \tl_trim_spaces:n {#4} }
+ { \@@_parse_label_default:n {#5} }
+ }
+ }
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
%
%
% \begin{macro}{\hook_gput_code:nnn}
@@ -1912,50 +2053,53 @@
% with \meta{label}.
% \begin{macrocode}
\cs_new_protected:Npn \hook_gput_code:nnn #1 #2
- {
- \exp_args:Nxx \@@_gput_code:nnn
- { \@@_parse_label_default:nn {#1} { top-level } }
- { \@@_parse_label_default:nn {#2} { top-level } }
- }
+ { \@@_normalize_hook_args:Nnn \@@_gput_code:nnn {#1} {#2} }
\cs_new_protected:Npn \@@_gput_code:nnn #1 #2 #3
{
% \end{macrocode}
-% First check if the current \meta{hook}/\meta{label} pair was marked
+% First check if the hook was used as a one-time hook:
+% \begin{macrocode}
+ \prop_if_in:NnTF \g_@@_execute_immediately_prop {#1}
+ {#3}
+ {
+% \end{macrocode}
+% Then check if the current \meta{hook}/\meta{label} pair was marked
% for removal, in which case \cs{@@_unmark_removal:nn} is used to
% remove that mark (once). This may happen when a package removes
% code from another package which was not yet loaded: the removal
% order is stored, and at this stage it is executed by not adding to
% the hook.
% \begin{macrocode}
- \@@_if_marked_removal:nnTF {#1} {#2}
- { \@@_unmark_removal:nn {#1} {#2} }
- {
+ \@@_if_marked_removal:nnTF {#1} {#2}
+ { \@@_unmark_removal:nn {#1} {#2} }
+ {
% \end{macrocode}
% If no removal is queued, we are free to add. Start by checking if
% the hook exists.
% \begin{macrocode}
- \hook_if_exist:nTF {#1}
+ \hook_if_exist:nTF {#1}
% \end{macrocode}
% If so we simply add (or append) the new code to the property list
% holding different chunks for the hook. At \verb=\begin{document}=
% this is then sorted into a token list for fast execution.
% \begin{macrocode}
- {
- \@@_hook_gput_code_do:nnn {#1} {#2} {#3}
+ {
+ \@@_hook_gput_code_do:nnn {#1} {#2} {#3}
% \end{macrocode}
% However, if there is an update within the document we need to alter
% this execution code which is done by
% \cs{@@_update_hook_code:n}. In the preamble this does nothing.
% \begin{macrocode}
- \@@_update_hook_code:n {#1}
- }
+ \@@_update_hook_code:n {#1}
+ }
% \end{macrocode}
%
% If the hook does not exist, however, before giving up try to
% declare it as a generic hook, if its name matches one of the valid
% patterns.
% \begin{macrocode}
- { \@@_try_declaring_generic_hook:nnn {#1} {#2} {#3} }
+ { \@@_try_declaring_generic_hook:nnn {#1} {#2} {#3} }
+ }
}
}
\cs_generate_variant:Nn \@@_gput_code:nnn { nxv }
@@ -2187,11 +2331,7 @@
% for \meta{hook} stored under \meta{label} is removed.
% \begin{macrocode}
\cs_new_protected:Npn \hook_gremove_code:nn #1 #2
- {
- \exp_args:Nxx \@@_gremove_code:nn
- { \@@_parse_label_default:nn {#1} { top-level } }
- { \@@_parse_label_default:nn {#2} { top-level } }
- }
+ { \@@_normalize_hook_args:Nnn \@@_gremove_code:nn {#1} {#2} }
\cs_new_protected:Npn \@@_gremove_code:nn #1 #2
{
% \end{macrocode}
@@ -2250,6 +2390,10 @@
% \cs{tl_gremove_once:Nx} is fairly efficient even for longer token
% lists, so we use a single global token list, rather than one for
% each hook.
+%
+% A hand-crafted token list is used here because property lists don't
+% hold repeated items, so multiple usages of \cs{@@_mark_removal:nn}
+% would be cancelled by a single \cs{@@_unmark_removal:nn}.
% \begin{macrocode}
\cs_new_protected:Npn \@@_mark_removal:nn #1 #2
{
@@ -2300,7 +2444,7 @@
%
% \begin{macro}{
% \g_@@_??_code_prop,
-% \g_@@_??_code_tl,
+% \@@~??,
% \g_@@_??_reversed_tl,
% }
%
@@ -2315,11 +2459,11 @@
% lot things should be fast, so this is not done with \texttt{c}
% expansion in the code later on.
%
-% \cs{g_@@_??_code_tl} isn't used, but it has to be defined to trick
+% \cs{@@~??} isn't used, but it has to be defined to trick
% the code into thinking that \verb=??= is actually a hook.
% \begin{macrocode}
\prop_new:c {g_@@_??_code_prop}
-\prop_new:c {g_@@_??_code_tl}
+\prop_new:c {@@~??}
% \end{macrocode}
%
% Default rules are always given in normal ordering (never in
@@ -2347,14 +2491,8 @@
% \begin{macrocode}
\cs_new_protected:Npn \hook_gset_rule:nnnn #1#2#3#4
{
- \use:x
- {
- \@@_gset_rule:nnnn
- { \@@_parse_label_default:nn {#1} { top-level } }
- { \@@_parse_label_default:nn {#2} { top-level } }
- {#3}
- { \@@_parse_label_default:nn {#4} { top-level } }
- }
+ \@@_normalize_hook_rule_args:Nnnnn \@@_gset_rule:nnnn
+ {#1} {#2} {#3} {#4}
}
% \end{macrocode}
%
@@ -2544,7 +2682,7 @@
{ \iow_term:x{^^JAll~ initialized~ (non-empty)~ hooks:}
\prop_map_inline:Nn \g_@@_used_prop
{ \iow_term:x{^^J~ ##1~ ->~
- \exp_not:v {g_@@_##1_code_tl}~ }
+ \exp_not:v {@@~##1}~ }
}
}
% \end{macrocode}
@@ -2566,9 +2704,11 @@
% and at \verb=\begin{document}= this is done for all hooks and
% afterwards only if the hook code changes.
% \begin{macrocode}
-\cs_new_protected:Npn \@@_initialize_hook_code:n #1 {
- \@@_debug:n{ \iow_term:x{^^JUpdate~ code~ for~ hook~
- '#1' \on@line :^^J} }
+\cs_new_protected:Npn \@@_initialize_hook_code:n #1
+ {
+ \debug_suspend:
+ \@@_debug:n{ \iow_term:x{^^JUpdate~ code~ for~ hook~
+ '#1' \on@line :^^J} }
% \end{macrocode}
% This does the sorting and the updates.
% First thing we do is to check if a legacy hook macro exists and
@@ -2576,23 +2716,23 @@
% might make the hook non-empty so we have to do this before
% the then following test.
% \begin{macrocode}
- \@@_include_legacy_code_chunk:n {#1}
+ \@@_include_legacy_code_chunk:n {#1}
% \end{macrocode}
% If there aren't any code
% chunks for the current hook, there is no point in even starting
% the sorting routine so we make a quick test for that and in that
-% case just update \cs{g_@@_\meta{hook}_code_tl} to hold the next
+% case just update \cs{@@~\meta{hook}} to hold the next
% code. If there are code chunks we call
% \cs{@@_initialize_single:NNNn} and pass to it ready made csnames
% as they are needed several times inside. This way we save a bit
% on processing time if we do that up front.
% \begin{macrocode}
- \hook_if_exist:nT {#1}
- {
- \prop_if_empty:cTF {g_@@_#1_code_prop}
- { \tl_gset:co {g_@@_#1_code_tl}
- {\cs:w g_@@_#1_code_next_tl \cs_end: } }
- {
+ \hook_if_exist:nT {#1}
+ {
+ \prop_if_empty:cTF {g_@@_#1_code_prop}
+ { \tl_gset:co { @@~#1 }
+ { \cs:w @@_next~#1 \cs_end: } }
+ {
% \end{macrocode}
% By default the algorithm sorts the code chunks and then saves the
% result in a token list for fast execution by adding the code one
@@ -2601,11 +2741,11 @@
% the opposite order into the token list. So all we have to do
% in preparation is to change two definitions used later on.
% \begin{macrocode}
- \@@_if_reversed:nTF {#1}
- { \cs_set_eq:NN \@@_tl_gput:NV \tl_gput_left:NV
- \cs_set_eq:NN \@@_clist_gput:NV \clist_gput_left:NV }
- { \cs_set_eq:NN \@@_tl_gput:NV \tl_gput_right:NV
- \cs_set_eq:NN \@@_clist_gput:NV \clist_gput_right:NV }
+ \@@_if_reversed:nTF {#1}
+ { \cs_set_eq:NN \@@_tl_gput:NV \tl_gput_left:NV
+ \cs_set_eq:NN \@@_clist_gput:NV \clist_gput_left:NV }
+ { \cs_set_eq:NN \@@_tl_gput:NV \tl_gput_right:NV
+ \cs_set_eq:NN \@@_clist_gput:NV \clist_gput_right:NV }
% \end{macrocode}
%
% When sorting, some relations (namely \verb|voids|) need to
@@ -2613,10 +2753,10 @@
% shouldn't appear in the sorted hook token list, so we temporarily
% save the old code property list so that it can be restored later.
% \begin{macrocode}
- \prop_set_eq:Nc \l_@@_work_prop { g_@@_#1_code_prop }
- \@@_initialize_single:cccn
- { g_@@_#1_code_tl } { g_@@_#1_code_next_tl }
- { g_@@_#1_labels_clist } {#1}
+ \prop_set_eq:Nc \l_@@_work_prop { g_@@_#1_code_prop }
+ \@@_initialize_single:cccn
+ { @@~#1 } { @@_next~#1 }
+ { g_@@_#1_labels_clist } {#1}
% \end{macrocode}
% For debug display we want to keep track of those hooks that
% actually got code added to them, so we record that in plist. We
@@ -2624,24 +2764,16 @@
% i.e., we are only interested in storing the keys and the value is
% arbitrary.
% \begin{macrocode}
- \@@_debug:n{ \exp_args:NNx \prop_gput:Nnn
- \g_@@_used_prop {#1}{} }
- }
- }
-}
-% \end{macrocode}
-% \end{macro}
-%
-%
-% \begin{macro}{\g_@@_used_prop}
-% All hooks that receive code (for use in debugging display).
-% \begin{macrocode}
-\prop_new:N\g_@@_used_prop
+ \@@_debug:n{ \exp_args:NNx \prop_gput:Nnn
+ \g_@@_used_prop {#1}{} }
+ }
+ }
+ \debug_resume:
+ }
% \end{macrocode}
% \end{macro}
%
%
-%
% \begin{macro}[EXP]{\@@_tl_csname:n,\@@_seq_csname:n}
% It is faster to pass a single token and expand it when necessary
% than to pass a bunch of character tokens around.
@@ -2653,8 +2785,6 @@
% \end{macro}
%
%
-%
-%
% \begin{macro}{\l_@@_labels_seq,\l_@@_labels_int,\l_@@_front_tl,
% \l_@@_rear_tl,\l_@@_label_0_tl}
%
@@ -2712,21 +2842,18 @@
% the moment: a label can't be equal to the number 0! \fmi{Needs
% checking for, just in case}
% \begin{macrocode}
-\cs_new_protected:Npn \@@_initialize_single:NNNn #1#2#3#4 {
-% \end{macrocode}
-%
-% \begin{macrocode}
- \debug_suspend:
+\cs_new_protected:Npn \@@_initialize_single:NNNn #1#2#3#4
+ {
% \end{macrocode}
% Step T1: Initialize the data structure \ldots
% \begin{macrocode}
- \seq_clear:N \l_@@_labels_seq
- \int_zero:N \l_@@_labels_int
+ \seq_clear:N \l_@@_labels_seq
+ \int_zero:N \l_@@_labels_int
% \end{macrocode}
%
% Store the name of the hook:
% \begin{macrocode}
- \tl_set:Nn \l_@@_cur_hook_tl {#4}
+ \tl_set:Nn \l_@@_cur_hook_tl {#4}
% \end{macrocode}
%
% We loop over the property list holding the code and record all
@@ -2736,13 +2863,13 @@
% to ensure that labels named |front|, |rear|, |labels|, or |return|
% don't interact with our code.
% \begin{macrocode}
- \prop_map_inline:Nn \l_@@_work_prop
- {
- \int_incr:N \l_@@_labels_int
- \seq_put_right:Nn \l_@@_labels_seq {##1}
- \tl_set:cn { \@@_tl_csname:n {##1} }{0}
- \seq_clear_new:c { \@@_seq_csname:n {##1} }
- }
+ \prop_map_inline:Nn \l_@@_work_prop
+ {
+ \int_incr:N \l_@@_labels_int
+ \seq_put_right:Nn \l_@@_labels_seq {##1}
+ \tl_set:cn { \@@_tl_csname:n {##1} }{0}
+ \seq_clear_new:c { \@@_seq_csname:n {##1} }
+ }
% \end{macrocode}
% Steps T2 and T3: Sort the relevant rules into the data structure\ldots
%
@@ -2758,30 +2885,30 @@
% \cs{@@_apply_label_pair:nnn}, which takes the properly-ordered pair
% of labels as argument.
% \begin{macrocode}
- \prop_map_inline:Nn \l_@@_work_prop
- {
- \prop_map_inline:Nn \l_@@_work_prop
- {
- \@@_if_label_case:nnnnn {##1} {####1}
- { \prop_map_break: }
- { \@@_apply_label_pair:nnn {##1} {####1} }
- { \@@_apply_label_pair:nnn {####1} {##1} }
- {#4}
- }
- }
+ \prop_map_inline:Nn \l_@@_work_prop
+ {
+ \prop_map_inline:Nn \l_@@_work_prop
+ {
+ \@@_if_label_case:nnnnn {##1} {####1}
+ { \prop_map_break: }
+ { \@@_apply_label_pair:nnn {##1} {####1} }
+ { \@@_apply_label_pair:nnn {####1} {##1} }
+ {#4}
+ }
+ }
% \end{macrocode}
% Take a breath and take a look at the data structures that have
% been set up:
% \begin{macrocode}
- \@@_debug:n { \@@_debug_label_data:N \l_@@_work_prop }
+ \@@_debug:n { \@@_debug_label_data:N \l_@@_work_prop }
% \end{macrocode}
%
%
% Step T4:
% \begin{macrocode}
- \tl_set:Nn \l_@@_rear_tl { 0 }
- \tl_set:cn { \@@_tl_csname:n { 0 } } { 0 }
- \seq_map_inline:Nn \l_@@_labels_seq
+ \tl_set:Nn \l_@@_rear_tl { 0 }
+ \tl_set:cn { \@@_tl_csname:n { 0 } } { 0 }
+ \seq_map_inline:Nn \l_@@_labels_seq
{
\int_compare:nNnT { \cs:w \@@_tl_csname:n {##1} \cs_end: } = 0
{
@@ -2789,61 +2916,61 @@
\tl_set:Nn \l_@@_rear_tl {##1}
}
}
- \tl_set_eq:Nc \l_@@_front_tl { \@@_tl_csname:n { 0 } }
+ \tl_set_eq:Nc \l_@@_front_tl { \@@_tl_csname:n { 0 } }
% \end{macrocode}
%
% \begin{macrocode}
- \tl_gclear:N #1
- \clist_gclear:N #3
+ \tl_gclear:N #1
+ \clist_gclear:N #3
% \end{macrocode}
%
% The whole loop combines steps T5--T7:
% \begin{macrocode}
- \bool_while_do:nn { ! \str_if_eq_p:Vn \l_@@_front_tl { 0 } }
- {
+ \bool_while_do:nn { ! \str_if_eq_p:Vn \l_@@_front_tl { 0 } }
+ {
% \end{macrocode}
% This part is step T5:
% \begin{macrocode}
- \int_decr:N \l_@@_labels_int
- \prop_get:NVN \l_@@_work_prop \l_@@_front_tl \l_@@_return_tl
- \@@_tl_gput:NV #1 \l_@@_return_tl
+ \int_decr:N \l_@@_labels_int
+ \prop_get:NVN \l_@@_work_prop \l_@@_front_tl \l_@@_return_tl
+ \@@_tl_gput:NV #1 \l_@@_return_tl
% \end{macrocode}
%
% \begin{macrocode}
- \@@_clist_gput:NV #3 \l_@@_front_tl
- \@@_debug:n{ \iow_term:x{Handled~ code~ for~ \l_@@_front_tl} }
+ \@@_clist_gput:NV #3 \l_@@_front_tl
+ \@@_debug:n{ \iow_term:x{Handled~ code~ for~ \l_@@_front_tl} }
% \end{macrocode}
%
% This is step T6 except that we don't use a pointer $P$ to move
% through the successors, but instead use \verb=##1= of the mapping
% function.
% \begin{macrocode}
- \seq_map_inline:cn { \@@_seq_csname:n { \l_@@_front_tl } }
- {
- \tl_set:cx { \@@_tl_csname:n {##1} }
- { \int_eval:n
- { \cs:w \@@_tl_csname:n {##1} \cs_end: - 1 }
- }
- \int_compare:nNnT
- { \cs:w \@@_tl_csname:n {##1} \cs_end: } = 0
- {
- \tl_set:cn { \@@_tl_csname:n { \l_@@_rear_tl } } {##1}
- \tl_set:Nn \l_@@_rear_tl {##1}
- }
- }
+ \seq_map_inline:cn { \@@_seq_csname:n { \l_@@_front_tl } }
+ {
+ \tl_set:cx { \@@_tl_csname:n {##1} }
+ { \int_eval:n
+ { \cs:w \@@_tl_csname:n {##1} \cs_end: - 1 }
+ }
+ \int_compare:nNnT
+ { \cs:w \@@_tl_csname:n {##1} \cs_end: } = 0
+ {
+ \tl_set:cn { \@@_tl_csname:n { \l_@@_rear_tl } } {##1}
+ \tl_set:Nn \l_@@_rear_tl {##1}
+ }
+ }
% \end{macrocode}
% and step T7:
% \begin{macrocode}
- \tl_set_eq:Nc \l_@@_front_tl
- { \@@_tl_csname:n { \l_@@_front_tl } }
+ \tl_set_eq:Nc \l_@@_front_tl
+ { \@@_tl_csname:n { \l_@@_front_tl } }
% \end{macrocode}
%
% This is step T8: If we haven't moved the code for all labels
% (i.e., if \cs{l_@@_labels_int} is still greater than zero) we
% have a loop and our partial order can't be flattened out.
% \begin{macrocode}
- }
- \int_compare:nNnF \l_@@_labels_int = 0
+ }
+ \int_compare:nNnF \l_@@_labels_int = 0
{
\iow_term:x{====================}
\iow_term:x{Error:~ label~ rules~ are~ incompatible:}
@@ -2860,12 +2987,8 @@
% with adding extra code for a one time execution. That is stored
% in \verb=#2= but is normally empty.
% \begin{macrocode}
- \tl_gput_right:Nn #1 {#2}
-% \end{macrocode}
-%
-% \begin{macrocode}
- \debug_resume:
-}
+ \tl_gput_right:Nn #1 {#2}
+ }
% \end{macrocode}
%
% \begin{macrocode}
@@ -3099,101 +3222,134 @@
%
%
%
-% \begin{macro}{\hook_log:n}
-% This writes out information about the hook given in its argument
-% onto the terminal and the \texttt{.log} file.
+% \begin{macro}{\hook_show:n,\hook_log:n}
+% \begin{macro}{\@@_log_line:x,\@@_log_line_indent:x}
+% \begin{macro}{\@@_log:nN}
+% This writes out information about the hook given in its argument
+% onto the \texttt{.log} file and the terminal, if \cs{show_hook:n} is
+% used. Internally both share the same structure, except that at the
+% end, \cs{hook_show:n} triggers \TeX's prompt.
% \begin{macrocode}
\cs_new_protected:Npn \hook_log:n #1
{
- \exp_args:Nx \@@_log:n
- { \@@_parse_label_default:nn {#1} { top-level } }
+ \cs_set_eq:NN \@@_log_cmd:x \iow_log:x
+ \@@_normalize_hook_args:Nn \@@_log:nN {#1} \tl_log:x
+ }
+\cs_new_protected:Npn \hook_show:n #1
+ {
+ \cs_set_eq:NN \@@_log_cmd:x \iow_term:x
+ \@@_normalize_hook_args:Nn \@@_log:nN {#1} \tl_show:x
}
-\cs_new_protected:Npn \@@_log:n #1
+\cs_new_protected:Npn \@@_log_line:x #1
+ { \@@_log_cmd:x { >~#1 } }
+\cs_new_protected:Npn \@@_log_line_indent:x #1
+ { \@@_log_cmd:x { >~\@spaces #1 } }
+\cs_new_protected:Npn \@@_log:nN #1 #2
{
\@@_preamble_hook:n {#1}
- \iow_term:x{^^JThe~ hook~ '#1':}
+ \iow_term:x { ^^J ->~The~hook~'#1': }
% \end{macrocode}
%
% \begin{macrocode}
\hook_if_exist:nF {#1}
- { \iow_term:x {~Hook~ is~ not~ declared!} }
+ { \@@_log_line:x { is~not~declared! } }
\@@_if_exist:nTF {#1}
{
- \iow_term:x{~Code~ chunks:}
- \prop_if_empty:cTF {g_@@_#1_code_prop}
- { \iow_term:x{\@spaces ---} }
+ \@@_log_line:x { Code~chunks: }
+ \prop_if_empty:cTF { g_@@_#1_code_prop }
+ { \@@_log_line_indent:x { --- } }
{
- \prop_map_inline:cn {g_@@_#1_code_prop}
- { \iow_term:x{\@spaces ##1~ ->~ \tl_to_str:n{##2} } }
+ \prop_map_inline:cn { g_@@_#1_code_prop }
+ { \@@_log_line_indent:x { ##1~->~\tl_to_str:n {##2} } }
}
% \end{macrocode}
%
% \begin{macrocode}
- \iow_term:x{~Extra~ code~ next~ invocation:}
- \iow_term:x{\@spaces
- \tl_if_empty:cTF { g_@@_#1_code_next_tl }
- {---}
+ \@@_log_line:x { Extra~code~for~next~invocation:}
+ \@@_log_line_indent:x
+ {
+ \tl_if_empty:cTF { @@_next~#1 }
+ { --- }
% \end{macrocode}
+%
% If the token list is not empty we want to display it but without
% the first tokens (the code to clear itself) so we call a helper
% command to get rid of them.
% \begin{macrocode}
- {->~ \exp_args:Nv
- \@@_log_next_code:n {g_@@_#1_code_next_tl} } }
+ { ->~ \exp_args:Nv \@@_log_next_code:n { @@_next~#1 } }
+ }
% \end{macrocode}
%
% Loop through the rules in a hook and for every rule found, print it.
% If no rule is there, print |---|. The boolean \cs{l_@@_tmpa_bool}
% here indicates if the hook has no rules.
% \begin{macrocode}
- \iow_term:x { ~Rules: }
+ \@@_log_line:x { Rules: }
\bool_set_true:N \l_@@_tmpa_bool
\@@_list_rules:nn {#1}
{
\bool_set_false:N \l_@@_tmpa_bool
- \iow_term:x
+ \@@_log_line_indent:x
{
- \@spaces ##2~ with~
+ ##2~ with~
\str_if_eq:nnT {##3} {??} { default~ }
- relation~ ##1 }
+ relation~ ##1
+ }
}
\bool_if:NT \l_@@_tmpa_bool
- { \iow_term:x { \@spaces --- } }
+ { \@@_log_line_indent:x { --- } }
% \end{macrocode}
-%
+%
+% When the hook is declared (that is, the sorting algorithm is applied
+% to that hook) and not empty
% \begin{macrocode}
- \bool_lazy_and:nnT
+ \bool_lazy_and:nnTF
{ \hook_if_exist_p:n {#1} }
{ ! \hook_if_empty_p:n {#1} }
- { \iow_term:x { ~Execution~ order
- \bool_if:NTF \l_@@_tmpa_bool
- { \@@_if_reversed:nT {#1}
- { ~ (after~ reversal) }
- }
- { ~ (after~
- \@@_if_reversed:nT {#1} {reversal~ and~}
- applying~ rules)
- }
- :
+ {
+ \@@_log_line:x
+ {
+ Execution~order
+ \bool_if:NTF \l_@@_tmpa_bool
+ { \@@_if_reversed:nT {#1} { ~(after~reversal) } }
+ { ~(after~
+ \@@_if_reversed:nT {#1} { reversal~and~ }
+ applying~rules)
+ } :
+ }
+ #2 % \tl_show:n
+ {
+ \@spaces
+ \clist_if_empty:cTF { g_@@_#1_labels_clist }
+ { --- }
+ { \clist_use:cn {g_@@_#1_labels_clist} { ,~ } }
+ }
+ }
+ {
+ #2
+ {
+ Hook~ \hook_if_exist:nTF {#1}
+ {code~pool~empty} {not~declared}
}
- \iow_term:x
- { \@spaces \clist_use:cn {g_@@_#1_labels_clist} { ,~ } }
}
}
- { \iow_term:n { ~The~hook~is~empty. } }
- \iow_term:n { }
+ { #2 { The~hook~is~empty. } }
}
% \end{macrocode}
%
+% \begin{macro}{\@@_log_next_code:n}
% To display the code for next invocation only (i.e., from
% \cs{AddToHookNext} we have to remove the first two tokens at the
% front which are \cs{tl_gclear:N} and the token list to clear.
% \begin{macrocode}
-\cs_new:Npn \@@_log_next_code:n #1 {
- \exp_args:No \tl_to_str:n {\use_none:nn #1}
-}
+\cs_new:Npn \@@_log_next_code:n #1
+ { \exp_args:No \tl_to_str:n { \use_none:nn #1 } }
% \end{macrocode}
-% \end{macro}
+% \end{macro}
+%
+% \end{macro}
+% \end{macro}
+% \end{macro}
%
% \begin{macro}{\@@_list_rules:nn}
% \begin{macro}{\@@_list_one_rule:nnn,\@@_list_if_rule_exists:nnnF}
@@ -3266,25 +3422,29 @@
%
% \subsection{Specifying code for next invocation}
%
-% \begin{macro}{\hook_gput_next_code:nn}
-%
+% \begin{macro}{\hook_gput_next_code:nn}
+% \begin{macro}{%
+% \@@_gput_next_code:nn,
+% \@@_gput_next_do:nn,
+% \@@_gput_next_do:Nnn,
+% \@@_clear_next:n
+% }
% \begin{macrocode}
\cs_new_protected:Npn \hook_gput_next_code:nn #1
- {
- \exp_args:Nx \@@_gput_next_code:nn
- { \@@_parse_label_default:nn {#1} { top-level } }
- }
+ { \@@_normalize_hook_args:Nn \@@_gput_next_code:nn {#1} }
\cs_new_protected:Npn \@@_gput_next_code:nn #1 #2
{
+ \debug_suspend:
\@@_declare:n {#1}
\hook_if_exist:nTF {#1}
{ \@@_gput_next_do:nn {#1} {#2} }
{ \@@_try_declaring_generic_next_hook:nn {#1} {#2} }
+ \debug_resume:
}
\cs_new_protected:Npn \@@_gput_next_do:nn #1
{
\exp_args:Nc \@@_gput_next_do:Nnn
- { g_@@_#1_code_next_tl } {#1}
+ { @@_next~#1 } {#1}
}
% \end{macrocode}
% First check if the ``next code'' token list is empty: if so we need
@@ -3299,20 +3459,24 @@
% \begin{macrocode}
\cs_new_protected:Npn \@@_gput_next_do:Nnn #1 #2
{
- \tl_if_empty:cT { g_@@_#2_code_tl }
+ \tl_if_empty:cT { @@~#2 }
{ \@@_update_hook_code:n {#2} }
\tl_if_empty:NT #1
- { \tl_gset:Nn #1 { \tl_gclear:c { g_@@_#2_code_next_tl } } }
+ { \tl_gset:Nn #1 { \@@_clear_next:n {#2} } }
\tl_gput_right:Nn #1
}
+\cs_new_protected:Npn \@@_clear_next:n #1
+ { \cs_gset_eq:cN { @@_next~#1 } \c_empty_tl }
% \end{macrocode}
% \end{macro}
+% \end{macro}
%
%
% \subsection{Using the hook}
%
% \begin{macro}{\hook_use:n}
% \begin{macro}[EXP]{\@@_use_initialized:n}
+% \begin{macro}{\@@_use_undefined:w,\@@_use_end:}
% \begin{macro}{\@@_preamble_hook:n}
% \cs{hook_use:n} as defined here is used in the preamble, where
% hooks aren't initialized by default. \cs{@@_use_initialized:n} is
@@ -3340,25 +3504,34 @@
% \begin{macrocode}
\cs_new_protected:Npn \hook_use:n #1
{
- \tl_if_exist:cTF { g_@@_#1_code_tl }
+ \tl_if_exist:cTF { @@~#1 }
{
\@@_preamble_hook:n {#1}
- \cs:w g_@@_#1_code_tl \cs_end:
+ \cs:w @@~#1 \cs_end:
}
{ \@@_use:wn #1 / \s_@@_mark {#1} }
}
\cs_new:Npn \@@_use_initialized:n #1
{
- \tl_if_exist:cTF { g_@@_#1_code_tl }
- { \cs:w g_@@_#1_code_tl \cs_end: }
- { \@@_use:wn #1 / \s_@@_mark {#1} }
+ \if_cs_exist:w @@~#1 \cs_end:
+ \else:
+ \@@_use_undefined:w
+ \fi:
+ \cs:w @@~#1 \@@_use_end:
+ }
+\cs_new:Npn \@@_use_undefined:w #1 #2 @@~#3 \@@_use_end:
+ {
+ #1 % fi
+ \@@_use:wn #3 / \s_@@_mark {#3}
}
\cs_new_protected:Npn \@@_preamble_hook:n #1
{ \@@_initialize_hook_code:n {#1} }
+\cs_new_eq:NN \@@_use_end: \cs_end:
% \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
+% \end{macro}
%
% \begin{macro}[EXP]{\@@_use:wn}
% \begin{macro}{\@@_try_file_hook:n,\@@_if_exist_use:n}
@@ -3391,10 +3564,10 @@
}
\cs_new_protected:Npn \@@_if_exist_use:n #1
{
- \tl_if_exist:cT { g_@@_#1_code_tl }
+ \tl_if_exist:cT { @@~#1 }
{
\@@_preamble_hook:n {#1}
- \cs:w g_@@_#1_code_tl \cs_end:
+ \cs:w @@~#1 \cs_end:
}
}
% \end{macrocode}
@@ -3404,18 +3577,28 @@
% \begin{macro}{\hook_use_once:n}
% For hooks that can and should be used only once we have a special
% use command that remembers the hook name in
-% \cs{g_@@_execute_immediately_clist}. This has the effect that any
+% \cs{g_@@_execute_immediately_prop}. This has the effect that any
% further code added to the hook is executed immediately rather
% than stored in the hook.
+%
+% The code needs some gymnastics to prevent space trimming from the
+% hook name, since \cs{hook_use:n} and \cs{hook_use_once:n} are
+% documented to not trim spaces.
+%
+% \pho{Should this raise an error if the hook doesn't exist?}
% \begin{macrocode}
\cs_new_protected:Npn \hook_use_once:n #1
{
- \tl_if_exist:cT { g_@@_#1_code_tl }
+ \tl_if_exist:cT { @@~#1 }
{
- \clist_gput_left:Nn \g_@@_execute_immediately_clist {#1}
+ \tl_set:Nn \l_@@_return_tl {#1}
+ \@@_normalize_hook_args:Nn \@@_use_once_store:n
+ { \l_@@_return_tl }
\hook_use:n {#1}
}
}
+\cs_new_protected:Npn \@@_use_once_store:n #1
+ { \prop_gput:Nnn \g_@@_execute_immediately_prop {#1} { } }
% \end{macrocode}
% \end{macro}
%
@@ -3445,7 +3628,7 @@
% Test if a hook is empty (that is, no code was added to that hook).
% A hook being empty means that \emph{both} its
% \cs[no-index]{g_@@_\meta{hook}_code_prop} and its
-% \cs[no-index]{g_@@_\meta{hook}_code_next_tl} are empty.
+% \cs[no-index]{@@_next~\meta{hook}} are empty.
% \begin{macrocode}
\prg_new_conditional:Npnn \hook_if_empty:n #1 { p , T , F , TF }
{
@@ -3453,7 +3636,7 @@
{
\bool_lazy_and:nnTF
{ \prop_if_empty_p:c { g_@@_#1_code_prop } }
- { \tl_if_empty_p:c { g_@@_#1_code_next_tl } }
+ { \tl_if_empty_p:c { @@_next~#1 } }
{ \prg_return_true: }
{ \prg_return_false: }
}
@@ -3465,7 +3648,7 @@
% \begin{macro}[pTF]{\hook_if_exist:n}
% A canonical way to test if a hook exists. A hook exists if the
% token list that stores the sorted code for that hook,
-% \cs[no-index]{g_@@_\meta{hook}_code_tl}, exists. The property list
+% \cs[no-index]{@@~\meta{hook}}, exists. The property list
% \cs[no-index]{g_@@_\meta{hook}_code_prop} cannot be used here
% because often it is necessary to add code to a hook without knowing
% if such hook was already declared, or even if it will ever be
@@ -3473,7 +3656,7 @@
% \begin{macrocode}
\prg_new_conditional:Npnn \hook_if_exist:n #1 { p , T , F , TF }
{
- \tl_if_exist:cTF { g_@@_#1_code_tl }
+ \tl_if_exist:cTF { @@~#1 }
{ \prg_return_true: }
{ \prg_return_false: }
}
@@ -3510,13 +3693,6 @@
% \end{macro}
%
%
-% \begin{macro}{\g_@@_execute_immediately_clist}
-% List of hooks that from no on should not longer receive code.
-% \begin{macrocode}
-\clist_new:N \g_@@_execute_immediately_clist
-% \end{macrocode}
-% \end{macro}
-%
% \subsection{Messages}
%
% \begin{macrocode}
@@ -3588,11 +3764,7 @@
%
% \begin{macrocode}
\NewDocumentCommand \AddToHook { m o +m }
- {
- \clist_if_in:NnTF \g_@@_execute_immediately_clist {#1}
- {#3}
- { \hook_gput_code:nnn {#1} {#2} {#3} }
- }
+ { \hook_gput_code:nnn {#1} {#2} {#3} }
% \end{macrocode}
% \end{macro}
%
@@ -3685,19 +3857,19 @@
% Avoid the overhead of \pkg{xparse} and its protection that we
% don't want here (since the hook should vanish without trace if empty)!
% \begin{macrocode}
-\newcommand \UseHook { \hook_use:n }
-\newcommand \UseOneTimeHook { \hook_use_once:n }
+\cs_new:Npn \UseHook { \hook_use:n }
+\cs_new:Npn \UseOneTimeHook { \hook_use_once:n }
% \end{macrocode}
% \end{macro}
%
%
%
-% \begin{macro}{\ShowHook}
-%
+% \begin{macro}{\ShowHook,\LogHook}
% \begin{macrocode}
-\cs_new_protected:Npn \ShowHook { \hook_log:n }
+\cs_new_protected:Npn \ShowHook { \hook_show:n }
+\cs_new_protected:Npn \LogHook { \hook_log:n }
% \end{macrocode}
-% \end{macro}
+% \end{macro}
%
% \begin{macro}{\DebugHooksOn,\DebugHooksOff}
%
@@ -3722,7 +3894,7 @@
% \begin{macrocode}
\NewDocumentCommand \DeclareDefaultHookRule { m m m }
{ \hook_gset_rule:nnnn {??}{#1}{#2}{#3} }
-\@onlypreamble\DeclareDefaultHookRule
+\@onlypreamble\DeclareDefaultHookRule
% \end{macrocode}
% \end{macro}
%
@@ -3766,12 +3938,12 @@
%
% \begin{macrocode}
\cs_new_eq:NN \@expl@@@initialize@all@@
- \__hook_initialize_all:
+ \__hook_initialize_all:
% \end{macrocode}
%
% \begin{macrocode}
-\cs_new_eq:NN \@expl@@@hook@curr@name@push@@n
- \__hook_curr_name_push:n
+\cs_new_eq:NN \@expl@@@hook@curr@name@push@@n
+ \__hook_curr_name_push:n
% \end{macrocode}
%
% \begin{macrocode}
diff --git a/Master/texmf-dist/source/latex-dev/base/ltshipout.dtx b/Master/texmf-dist/source/latex-dev/base/ltshipout.dtx
index 650c46866e4..95d740279d2 100644
--- a/Master/texmf-dist/source/latex-dev/base/ltshipout.dtx
+++ b/Master/texmf-dist/source/latex-dev/base/ltshipout.dtx
@@ -31,8 +31,8 @@
%%% From File: ltshipout.dtx
%
% \begin{macrocode}
-\providecommand\ltshipoutversion{v1.0a}
-\providecommand\ltshipoutdate{2020/08/31}
+\providecommand\ltshipoutversion{v1.0b}
+\providecommand\ltshipoutdate{2020/09/09}
% \end{macrocode}
%
%<*driver>
@@ -412,7 +412,7 @@
%
% \begin{function}{\AtBeginShipoutInit}
% By default \pkg{atbegshi} delayed its action until
-% \verb=\beg{document}=. This command was forcing it in an earlier
+% \verb=\begin{document}=. This command was forcing it in an earlier
% place. With the new concept it does nothing.
% \end{function}
%
@@ -1085,7 +1085,7 @@
% Put the argument into a \texttt{picture} environment that doesn't take up
% any size and uses \texttt{1pt} for \cs{unitlength}.
% \fmi{Could perhaps be generalized as it might be useful elsewhere. For
-% not it is not.}
+% now it is not.}
% \begin{macrocode}
\cs_new:Npn \@@_picture_overlay:n #1 {
% \end{macrocode}
@@ -1100,8 +1100,15 @@
\vbox_to_zero:n {
\kern -\c_@@_vorigin_tl \scan_stop:
\unitlength 1pt \scan_stop:
- \hbox_set_to_wd:Nnn \l_@@_tmp_box \c_zero_dim { \ignorespaces #1 }
-% \box_set_wd:Nn \l_@@_tmp_box \c_zero_dim
+% \end{macrocode}
+% This mimics a simple zero-sized picture environment. The \cs{hss}
+% is need in case there is horizontal material (without using
+% \cs{put} with a positive width.
+% \changes{v1.0b}{2020/09/09}
+% {Prevent overfull box warnings (gh/387)}
+% \begin{macrocode}
+ \hbox_set_to_wd:Nnn \l_@@_tmp_box \c_zero_dim
+ { \ignorespaces #1 \hss }
\box_set_ht:Nn \l_@@_tmp_box \c_zero_dim
\box_set_dp:Nn \l_@@_tmp_box \c_zero_dim
\box_use:N \l_@@_tmp_box
@@ -1567,7 +1574,7 @@
%
% \begin{macrocode}
%<*atbegshi-ltx>
-\ProvidesPackage{atbegshi}
+\ProvidesPackage{atbegshi-ltx}
[2020/08/17 v1.0a
Emulation of the original atbegshi package^^Jwith kernel methods]
% \end{macrocode}
@@ -1673,7 +1680,7 @@
% \end{macrocode}
%
% \begin{macrocode}
-\ProvidesPackage{everyshi}
+\ProvidesPackage{everyshi-ltx}
[2020/08/17 v1.0a
Emulation of the original everyshi package^^Jwith kernel methods]
% \end{macrocode}
diff --git a/Master/texmf-dist/source/latex-dev/base/ltvers.dtx b/Master/texmf-dist/source/latex-dev/base/ltvers.dtx
index f02a9cdc471..83cdf1850d6 100644
--- a/Master/texmf-dist/source/latex-dev/base/ltvers.dtx
+++ b/Master/texmf-dist/source/latex-dev/base/ltvers.dtx
@@ -115,7 +115,7 @@
{2020-10-01}
%</2ekernel|latexrelease>
%<*2ekernel>
-\def\patch@level{-8}
+\def\patch@level{-9}
% \end{macrocode}
%
% \begin{macro}{\development@branch@name}
diff --git a/Master/texmf-dist/tex/latex-dev/base/atbegshi-ltx.sty b/Master/texmf-dist/tex/latex-dev/base/atbegshi-ltx.sty
index 2ffbc66bfc1..b390284aef3 100644
--- a/Master/texmf-dist/tex/latex-dev/base/atbegshi-ltx.sty
+++ b/Master/texmf-dist/tex/latex-dev/base/atbegshi-ltx.sty
@@ -45,9 +45,9 @@
%% File: ltshipout.dtx (C) Copyright 2020 Frank Mittelbach, LaTeX Team
%%
%%% From File: ltshipout.dtx
-\providecommand\ltshipoutversion{v1.0a}
-\providecommand\ltshipoutdate{2020/08/31}
-\ProvidesPackage{atbegshi}
+\providecommand\ltshipoutversion{v1.0b}
+\providecommand\ltshipoutdate{2020/09/09}
+\ProvidesPackage{atbegshi-ltx}
[2020/08/17 v1.0a
Emulation of the original atbegshi package^^Jwith kernel methods]
\let \AtBeginShipoutBox \ShipoutBox
diff --git a/Master/texmf-dist/tex/latex-dev/base/atveryend-ltx.sty b/Master/texmf-dist/tex/latex-dev/base/atveryend-ltx.sty
index 05678138e89..f41f42d1401 100644
--- a/Master/texmf-dist/tex/latex-dev/base/atveryend-ltx.sty
+++ b/Master/texmf-dist/tex/latex-dev/base/atveryend-ltx.sty
@@ -44,10 +44,10 @@
%%
%% File: ltfilehook.dtx (C) Copyright 2020 Frank Mittelbach,
%% Phelype Oleinik & LaTeX Team
-%%% From File: ltshipout.dtx
+%%% From File: ltfilehook.dtx
\providecommand\ltfilehookversion{v1.0a}
\providecommand\ltfilehookdate{2020/08/30}
-\ProvidesPackage{atveryend}
+\ProvidesPackage{atveryend-ltx}
[2020/08/19 v1.0a
Emulation of the original atvery package^^Jwith kernel methods]
\newcommand\AfterLastShipout {\AddToHook{enddocument/afterlastpage}}
diff --git a/Master/texmf-dist/tex/latex-dev/base/everyshi-ltx.sty b/Master/texmf-dist/tex/latex-dev/base/everyshi-ltx.sty
index 5eadf0fc814..2b6f09f0767 100644
--- a/Master/texmf-dist/tex/latex-dev/base/everyshi-ltx.sty
+++ b/Master/texmf-dist/tex/latex-dev/base/everyshi-ltx.sty
@@ -45,9 +45,9 @@
%% File: ltshipout.dtx (C) Copyright 2020 Frank Mittelbach, LaTeX Team
%%
%%% From File: ltshipout.dtx
-\providecommand\ltshipoutversion{v1.0a}
-\providecommand\ltshipoutdate{2020/08/31}
-\ProvidesPackage{everyshi}
+\providecommand\ltshipoutversion{v1.0b}
+\providecommand\ltshipoutdate{2020/09/09}
+\ProvidesPackage{everyshi-ltx}
[2020/08/17 v1.0a
Emulation of the original everyshi package^^Jwith kernel methods]
\def \EveryShipout {\AddToHook{shipout/before}}
diff --git a/Master/texmf-dist/tex/latex-dev/base/filehook-ltx.sty b/Master/texmf-dist/tex/latex-dev/base/filehook-ltx.sty
index b652ce8de84..8ade09ed909 100644
--- a/Master/texmf-dist/tex/latex-dev/base/filehook-ltx.sty
+++ b/Master/texmf-dist/tex/latex-dev/base/filehook-ltx.sty
@@ -44,7 +44,7 @@
%%
%% File: ltfilehook.dtx (C) Copyright 2020 Frank Mittelbach,
%% Phelype Oleinik & LaTeX Team
-%%% From File: ltshipout.dtx
+%%% From File: ltfilehook.dtx
\providecommand\ltfilehookversion{v1.0a}
\providecommand\ltfilehookdate{2020/08/30}
\newcommand\AtBeginOfEveryFile [1]
diff --git a/Master/texmf-dist/tex/latex-dev/base/latex.ltx b/Master/texmf-dist/tex/latex-dev/base/latex.ltx
index 50794044fc7..af87cdddb8b 100644
--- a/Master/texmf-dist/tex/latex-dev/base/latex.ltx
+++ b/Master/texmf-dist/tex/latex-dev/base/latex.ltx
@@ -710,7 +710,7 @@
\def\fmtname{LaTeX2e}
\edef\fmtversion
{2020-10-01}
-\def\patch@level{-8}
+\def\patch@level{-9}
\edef\development@branch@name{develop \the\year-\the\month-\the\day}
\iffalse
\def\reserved@a#1/#2/#3\@nil{%
@@ -1065,6 +1065,8 @@
\cs_gset_eq:NN \@expl@cs@prefix@spec@@N \cs_prefix_spec:N
\cs_gset_eq:NN \@expl@cs@argument@spec@@N \cs_argument_spec:N
\cs_gset_eq:NN \@expl@cs@replacement@spec@@N \cs_replacement_spec:N
+\cs_gset_eq:NN \@expl@str@map@function@@NN \str_map_function:NN
+\cs_gset_eq:NN \@expl@char@generate@@nn \char_generate:nn
\ExplSyntaxOff
%%% From File: ltdefns.dtx
\def\two@digits#1{\ifnum#1<10 0\fi\number#1}
@@ -1569,9 +1571,21 @@
\edef #1{\expandafter\strip@prefix
\meaning #1}%
}
+\def\string@makeletter#1{%
+ \@expl@str@map@function@@NN#1\@string@makeletter}
+\def\@string@makeletter#1{%
+ \char@if@alph{#1}%
+ {\@expl@char@generate@@nn{`#1}{11}}%
+ {#1}}
+\def\char@if@alph#1{%
+ \ifnum0\ifnum`#1<`A 1\fi\ifnum`#1>`z 1\fi
+ \if\ifnum`#1>`Z @\fi\ifnum`#1<`a @\fi01\fi>0
+ \expandafter\@secondoftwo
+ \else
+ \expandafter\@firstoftwo
+ \fi}
\DeclareRobustCommand\makeatletter{\catcode`\@11\relax}
\DeclareRobustCommand\makeatother{\catcode`\@12\relax}
-
\def\@latex@info#1{}
\ifx\directlua\@undefined
\DeclareRobustCommand{\-}{%
@@ -1615,7 +1629,7 @@
%% Phelype Oleinik & LaTeX Team
%%% From File: lthooks.dtx
\def\lthooksversion{v1.0a}
-\def\lthooksdate{2020/08/31}
+\def\lthooksdate{2020/09/10}
\ExplSyntaxOn
\bool_new:N \g__hook_debug_bool
\cs_new_eq:NN \__hook_debug:n \use_none:n
@@ -1643,42 +1657,47 @@
\tl_new:N \g__hook_removal_list_tl
\tl_new:N \l__hook_cur_hook_tl
\prop_new:N \l__hook_work_prop
+\prop_new:N \g__hook_execute_immediately_prop
+\prop_new:N \g__hook_used_prop
\tl_new:N \g__hook_hook_curr_name_tl
\seq_new:N \g__hook_name_stack_seq
\cs_new_eq:NN \__hook_tmp:w ?
\cs_generate_variant:Nn \tl_gremove_once:Nn { Nx }
+\cs_generate_variant:Nn \tl_show:n { x }
+\cs_generate_variant:Nn \tl_log:n { x }
\scan_new:N \s__hook_mark
\cs_new_protected:Npn \hook_new:n #1
+ { \__hook_normalize_hook_args:Nn \__hook_new:n {#1} }
+\cs_new_protected:Npn \__hook_new:n #1
{
- \exp_args:Nx \__hook_new:n
- { \__hook_parse_label_default:nn {#1} { top-level } }
- }
-\cs_new_protected:Npn \__hook_new:n #1 {
- \hook_if_exist:nTF {#1}
- { \msg_error:nnn { hooks } { exists } {#1} }
- { \seq_gput_right:Nn \g__hook_all_seq {#1}
- \tl_new:c { g__hook_#1_code_tl }
- \__hook_declare:n {#1}
- \clist_new:c {g__hook_#1_labels_clist}
- \tl_new:c { g__hook_#1_reversed_tl }
- \__hook_include_legacy_code_chunk:n {#1}
+ \hook_if_exist:nTF {#1}
+ { \msg_error:nnn { hooks } { exists } {#1} }
+ {
+ \seq_gput_right:Nn \g__hook_all_seq {#1}
+ \tl_new:c { __hook~#1 }
+ \__hook_declare:n {#1}
+ \clist_new:c {g__hook_#1_labels_clist}
+ \tl_new:c { g__hook_#1_reversed_tl }
+ \__hook_include_legacy_code_chunk:n {#1}
}
-}
+ }
\cs_new_protected:Npn \__hook_declare:n #1
{
\__hook_if_exist:nF {#1}
{
\prop_new:c { g__hook_#1_code_prop }
- \tl_new:c { g__hook_#1_code_next_tl }
+ \tl_new:c { __hook_next~#1 }
}
}
-\cs_new_protected:Npn \hook_new_reversed:n #1 {
- \hook_new:n {#1}
- \tl_gset:cn { g__hook_#1_reversed_tl } { - }
-}
-\cs_new_protected:Npn \hook_new_pair:nn #1#2 {
- \hook_new:n {#1} \hook_new_reversed:n {#2}
-}
+\cs_new_protected:Npn \hook_new_reversed:n #1
+ { \__hook_normalize_hook_args:Nn \__hook_new_reversed:n {#1} }
+\cs_new_protected:Npn \__hook_new_reversed:n #1
+ {
+ \__hook_new:n {#1}
+ \tl_gset:cn { g__hook_#1_reversed_tl } { - }
+ }
+\cs_new_protected:Npn \hook_new_pair:nn #1#2
+ { \hook_new:n {#1} \hook_new_reversed:n {#2} }
\cs_new_protected:Npn \__hook_include_legacy_code_chunk:n #1
{
\debug_suspend:
@@ -1693,13 +1712,15 @@
}
\debug_resume:
}
-\cs_new:Npn \__hook_parse_label_default:nn #1 #2
+\cs_new:Npn \__hook_parse_label_default:n #1
{
\tl_if_novalue:nTF {#1}
- { \__hook_currname_or_default:n {#2} }
- { \tl_trim_spaces_apply:nN {#1} \__hook_parse_dot_label:nn {#2} }
+ { \__hook_currname_or_default:n { top-level } }
+ {
+ \tl_trim_spaces_apply:nN {#1}
+ \__hook_parse_dot_label:nn { top-level }
+ }
}
-\cs_generate_variant:Nn \__hook_parse_label_default:nn { V }
\cs_new:Npn \__hook_parse_dot_label:nn #1 #2
{
\tl_if_empty:nTF {#1}
@@ -1709,7 +1730,7 @@
}
{
\str_if_eq:nnTF {#1} { . }
- { \__hook_currname_or_default:n {#1} }
+ { \__hook_currname_or_default:n {#2} }
{ \__hook_parse_dot_label:nw {#2} #1 ./ \s__hook_mark }
}
}
@@ -1719,40 +1740,79 @@
{ \__hook_parse_dot_label_aux:nw {#1} #3 \s__hook_mark }
{
\tl_if_empty:nTF {#3}
- {#2}
+ { \__hook_make_name:n {#2} }
{ \__hook_parse_dot_label_cleanup:w #2 ./ #3 \s__hook_mark }
}
}
\cs_new:Npn \__hook_parse_dot_label_cleanup:w #1 ./ \s__hook_mark {#1}
\cs_new:Npn \__hook_parse_dot_label_aux:nw #1 #2 ./ \s__hook_mark
- { \__hook_currname_or_default:n {#1} / #2 }
+ { \__hook_currname_or_default:n {#1} / \__hook_make_name:n {#2} }
\cs_new:Npn \__hook_currname_or_default:n #1
{
\tl_if_empty:NTF \g__hook_hook_curr_name_tl
{
\tl_if_empty:NTF \@currname
- {#1}
+ { \__hook_make_name:n {#1} }
{ \@currname }
}
{ \g__hook_hook_curr_name_tl }
}
-\cs_new_protected:Npn \hook_gput_code:nnn #1 #2
+\cs_new:Npn \__hook_make_name:n #1
+ {
+ \exp_after:wN \exp_after:wN \exp_after:wN \__hook_make_name:w
+ \exp_after:wN \token_to_str:N \cs:w __hook~ #1 \cs_end:
+ }
+\exp_last_unbraced:NNNNo
+\cs_new:Npn \__hook_make_name:w #1 \tl_to_str:n { __hook~ } { }
+\cs_new_protected:Npn \__hook_normalize_hook_args_aux:Nn #1 #2
+ {
+ \group_begin:
+ \use:e
+ {
+ \group_end:
+ \exp_not:N #1 #2
+ }
+ }
+\cs_new_protected:Npn \__hook_normalize_hook_args:Nn #1 #2
+ {
+ \__hook_normalize_hook_args_aux:Nn #1
+ { { \__hook_parse_label_default:n {#2} } }
+ }
+\cs_new_protected:Npn \__hook_normalize_hook_args:Nnn #1 #2 #3
+ {
+ \__hook_normalize_hook_args_aux:Nn #1
+ {
+ { \__hook_parse_label_default:n {#2} }
+ { \__hook_parse_label_default:n {#3} }
+ }
+ }
+\cs_new_protected:Npn \__hook_normalize_hook_rule_args:Nnnnn #1 #2 #3 #4 #5
{
- \exp_args:Nxx \__hook_gput_code:nnn
- { \__hook_parse_label_default:nn {#1} { top-level } }
- { \__hook_parse_label_default:nn {#2} { top-level } }
+ \__hook_normalize_hook_args_aux:Nn #1
+ {
+ { \__hook_parse_label_default:n {#2} }
+ { \__hook_parse_label_default:n {#3} }
+ { \tl_trim_spaces:n {#4} }
+ { \__hook_parse_label_default:n {#5} }
+ }
}
+\cs_new_protected:Npn \hook_gput_code:nnn #1 #2
+ { \__hook_normalize_hook_args:Nnn \__hook_gput_code:nnn {#1} {#2} }
\cs_new_protected:Npn \__hook_gput_code:nnn #1 #2 #3
{
- \__hook_if_marked_removal:nnTF {#1} {#2}
- { \__hook_unmark_removal:nn {#1} {#2} }
+ \prop_if_in:NnTF \g__hook_execute_immediately_prop {#1}
+ {#3}
{
- \hook_if_exist:nTF {#1}
+ \__hook_if_marked_removal:nnTF {#1} {#2}
+ { \__hook_unmark_removal:nn {#1} {#2} }
{
- \__hook_hook_gput_code_do:nnn {#1} {#2} {#3}
- \__hook_update_hook_code:n {#1}
+ \hook_if_exist:nTF {#1}
+ {
+ \__hook_hook_gput_code_do:nnn {#1} {#2} {#3}
+ \__hook_update_hook_code:n {#1}
+ }
+ { \__hook_try_declaring_generic_hook:nnn {#1} {#2} {#3} }
}
- { \__hook_try_declaring_generic_hook:nnn {#1} {#2} {#3} }
}
}
\cs_generate_variant:Nn \__hook_gput_code:nnn { nxv }
@@ -1852,11 +1912,7 @@
\prop_const_from_keyval:Nn \c__hook_generics_reversed_iii_prop {after=}
\prop_const_from_keyval:Nn \c__hook_generics_file_prop {before=,after=}
\cs_new_protected:Npn \hook_gremove_code:nn #1 #2
- {
- \exp_args:Nxx \__hook_gremove_code:nn
- { \__hook_parse_label_default:nn {#1} { top-level } }
- { \__hook_parse_label_default:nn {#2} { top-level } }
- }
+ { \__hook_normalize_hook_args:Nnn \__hook_gremove_code:nn {#1} {#2} }
\cs_new_protected:Npn \__hook_gremove_code:nn #1 #2
{
\__hook_if_exist:nTF {#1}
@@ -1895,18 +1951,12 @@
\cs_new:Npn \__hook_removal_tl:nn #1 #2
{ & \tl_to_str:n {#2} $ \tl_to_str:n {#1} $ }
\prop_new:c {g__hook_??_code_prop}
-\prop_new:c {g__hook_??_code_tl}
+\prop_new:c {__hook~??}
\tl_new:c {g__hook_??_reversed_tl}
\cs_new_protected:Npn \hook_gset_rule:nnnn #1#2#3#4
{
- \use:x
- {
- \__hook_gset_rule:nnnn
- { \__hook_parse_label_default:nn {#1} { top-level } }
- { \__hook_parse_label_default:nn {#2} { top-level } }
- {#3}
- { \__hook_parse_label_default:nn {#4} { top-level } }
- }
+ \__hook_normalize_hook_rule_args:Nnnnn \__hook_gset_rule:nnnn
+ {#1} {#2} {#3} {#4}
}
\cs_new_protected:Npn \__hook_gset_rule:nnnn #1#2#3#4
{
@@ -1981,37 +2031,39 @@
{ \iow_term:x{^^JAll~ initialized~ (non-empty)~ hooks:}
\prop_map_inline:Nn \g__hook_used_prop
{ \iow_term:x{^^J~ ##1~ ->~
- \exp_not:v {g__hook_##1_code_tl}~ }
+ \exp_not:v {__hook~##1}~ }
}
}
\cs_gset_eq:NN \hook_use:n \__hook_use_initialized:n
\cs_gset_eq:NN \__hook_preamble_hook:n \use_none:n
}
-\cs_new_protected:Npn \__hook_initialize_hook_code:n #1 {
- \__hook_debug:n{ \iow_term:x{^^JUpdate~ code~ for~ hook~
- '#1' \on@line :^^J} }
- \__hook_include_legacy_code_chunk:n {#1}
- \hook_if_exist:nT {#1}
- {
- \prop_if_empty:cTF {g__hook_#1_code_prop}
- { \tl_gset:co {g__hook_#1_code_tl}
- {\cs:w g__hook_#1_code_next_tl \cs_end: } }
- {
- \__hook_if_reversed:nTF {#1}
- { \cs_set_eq:NN \__hook_tl_gput:NV \tl_gput_left:NV
- \cs_set_eq:NN \__hook_clist_gput:NV \clist_gput_left:NV }
- { \cs_set_eq:NN \__hook_tl_gput:NV \tl_gput_right:NV
- \cs_set_eq:NN \__hook_clist_gput:NV \clist_gput_right:NV }
- \prop_set_eq:Nc \l__hook_work_prop { g__hook_#1_code_prop }
- \__hook_initialize_single:cccn
- { g__hook_#1_code_tl } { g__hook_#1_code_next_tl }
- { g__hook_#1_labels_clist } {#1}
- \__hook_debug:n{ \exp_args:NNx \prop_gput:Nnn
- \g__hook_used_prop {#1}{} }
- }
- }
-}
-\prop_new:N\g__hook_used_prop
+\cs_new_protected:Npn \__hook_initialize_hook_code:n #1
+ {
+ \debug_suspend:
+ \__hook_debug:n{ \iow_term:x{^^JUpdate~ code~ for~ hook~
+ '#1' \on@line :^^J} }
+ \__hook_include_legacy_code_chunk:n {#1}
+ \hook_if_exist:nT {#1}
+ {
+ \prop_if_empty:cTF {g__hook_#1_code_prop}
+ { \tl_gset:co { __hook~#1 }
+ { \cs:w __hook_next~#1 \cs_end: } }
+ {
+ \__hook_if_reversed:nTF {#1}
+ { \cs_set_eq:NN \__hook_tl_gput:NV \tl_gput_left:NV
+ \cs_set_eq:NN \__hook_clist_gput:NV \clist_gput_left:NV }
+ { \cs_set_eq:NN \__hook_tl_gput:NV \tl_gput_right:NV
+ \cs_set_eq:NN \__hook_clist_gput:NV \clist_gput_right:NV }
+ \prop_set_eq:Nc \l__hook_work_prop { g__hook_#1_code_prop }
+ \__hook_initialize_single:cccn
+ { __hook~#1 } { __hook_next~#1 }
+ { g__hook_#1_labels_clist } {#1}
+ \__hook_debug:n{ \exp_args:NNx \prop_gput:Nnn
+ \g__hook_used_prop {#1}{} }
+ }
+ }
+ \debug_resume:
+ }
\cs_new:Npn \__hook_tl_csname:n #1 { l__hook_label_#1_tl }
\cs_new:Npn \__hook_seq_csname:n #1 { l__hook_label_#1_seq }
\seq_new:N \l__hook_labels_seq
@@ -2019,33 +2071,33 @@
\tl_new:N \l__hook_front_tl
\tl_new:N \l__hook_rear_tl
\tl_new:c { \__hook_tl_csname:n { 0 } }
-\cs_new_protected:Npn \__hook_initialize_single:NNNn #1#2#3#4 {
- \debug_suspend:
- \seq_clear:N \l__hook_labels_seq
- \int_zero:N \l__hook_labels_int
- \tl_set:Nn \l__hook_cur_hook_tl {#4}
- \prop_map_inline:Nn \l__hook_work_prop
- {
- \int_incr:N \l__hook_labels_int
- \seq_put_right:Nn \l__hook_labels_seq {##1}
- \tl_set:cn { \__hook_tl_csname:n {##1} }{0}
- \seq_clear_new:c { \__hook_seq_csname:n {##1} }
- }
- \prop_map_inline:Nn \l__hook_work_prop
- {
- \prop_map_inline:Nn \l__hook_work_prop
- {
- \__hook_if_label_case:nnnnn {##1} {####1}
- { \prop_map_break: }
- { \__hook_apply_label_pair:nnn {##1} {####1} }
- { \__hook_apply_label_pair:nnn {####1} {##1} }
- {#4}
- }
- }
- \__hook_debug:n { \__hook_debug_label_data:N \l__hook_work_prop }
- \tl_set:Nn \l__hook_rear_tl { 0 }
- \tl_set:cn { \__hook_tl_csname:n { 0 } } { 0 }
- \seq_map_inline:Nn \l__hook_labels_seq
+\cs_new_protected:Npn \__hook_initialize_single:NNNn #1#2#3#4
+ {
+ \seq_clear:N \l__hook_labels_seq
+ \int_zero:N \l__hook_labels_int
+ \tl_set:Nn \l__hook_cur_hook_tl {#4}
+ \prop_map_inline:Nn \l__hook_work_prop
+ {
+ \int_incr:N \l__hook_labels_int
+ \seq_put_right:Nn \l__hook_labels_seq {##1}
+ \tl_set:cn { \__hook_tl_csname:n {##1} }{0}
+ \seq_clear_new:c { \__hook_seq_csname:n {##1} }
+ }
+ \prop_map_inline:Nn \l__hook_work_prop
+ {
+ \prop_map_inline:Nn \l__hook_work_prop
+ {
+ \__hook_if_label_case:nnnnn {##1} {####1}
+ { \prop_map_break: }
+ { \__hook_apply_label_pair:nnn {##1} {####1} }
+ { \__hook_apply_label_pair:nnn {####1} {##1} }
+ {#4}
+ }
+ }
+ \__hook_debug:n { \__hook_debug_label_data:N \l__hook_work_prop }
+ \tl_set:Nn \l__hook_rear_tl { 0 }
+ \tl_set:cn { \__hook_tl_csname:n { 0 } } { 0 }
+ \seq_map_inline:Nn \l__hook_labels_seq
{
\int_compare:nNnT { \cs:w \__hook_tl_csname:n {##1} \cs_end: } = 0
{
@@ -2053,42 +2105,41 @@
\tl_set:Nn \l__hook_rear_tl {##1}
}
}
- \tl_set_eq:Nc \l__hook_front_tl { \__hook_tl_csname:n { 0 } }
- \tl_gclear:N #1
- \clist_gclear:N #3
- \bool_while_do:nn { ! \str_if_eq_p:Vn \l__hook_front_tl { 0 } }
- {
- \int_decr:N \l__hook_labels_int
- \prop_get:NVN \l__hook_work_prop \l__hook_front_tl \l__hook_return_tl
- \__hook_tl_gput:NV #1 \l__hook_return_tl
- \__hook_clist_gput:NV #3 \l__hook_front_tl
- \__hook_debug:n{ \iow_term:x{Handled~ code~ for~ \l__hook_front_tl} }
- \seq_map_inline:cn { \__hook_seq_csname:n { \l__hook_front_tl } }
- {
- \tl_set:cx { \__hook_tl_csname:n {##1} }
- { \int_eval:n
- { \cs:w \__hook_tl_csname:n {##1} \cs_end: - 1 }
- }
- \int_compare:nNnT
- { \cs:w \__hook_tl_csname:n {##1} \cs_end: } = 0
- {
- \tl_set:cn { \__hook_tl_csname:n { \l__hook_rear_tl } } {##1}
- \tl_set:Nn \l__hook_rear_tl {##1}
- }
- }
- \tl_set_eq:Nc \l__hook_front_tl
- { \__hook_tl_csname:n { \l__hook_front_tl } }
- }
- \int_compare:nNnF \l__hook_labels_int = 0
+ \tl_set_eq:Nc \l__hook_front_tl { \__hook_tl_csname:n { 0 } }
+ \tl_gclear:N #1
+ \clist_gclear:N #3
+ \bool_while_do:nn { ! \str_if_eq_p:Vn \l__hook_front_tl { 0 } }
+ {
+ \int_decr:N \l__hook_labels_int
+ \prop_get:NVN \l__hook_work_prop \l__hook_front_tl \l__hook_return_tl
+ \__hook_tl_gput:NV #1 \l__hook_return_tl
+ \__hook_clist_gput:NV #3 \l__hook_front_tl
+ \__hook_debug:n{ \iow_term:x{Handled~ code~ for~ \l__hook_front_tl} }
+ \seq_map_inline:cn { \__hook_seq_csname:n { \l__hook_front_tl } }
+ {
+ \tl_set:cx { \__hook_tl_csname:n {##1} }
+ { \int_eval:n
+ { \cs:w \__hook_tl_csname:n {##1} \cs_end: - 1 }
+ }
+ \int_compare:nNnT
+ { \cs:w \__hook_tl_csname:n {##1} \cs_end: } = 0
+ {
+ \tl_set:cn { \__hook_tl_csname:n { \l__hook_rear_tl } } {##1}
+ \tl_set:Nn \l__hook_rear_tl {##1}
+ }
+ }
+ \tl_set_eq:Nc \l__hook_front_tl
+ { \__hook_tl_csname:n { \l__hook_front_tl } }
+ }
+ \int_compare:nNnF \l__hook_labels_int = 0
{
\iow_term:x{====================}
\iow_term:x{Error:~ label~ rules~ are~ incompatible:}
\__hook_debug_label_data:N \l__hook_work_prop
\iow_term:x{====================}
}
- \tl_gput_right:Nn #1 {#2}
- \debug_resume:
-}
+ \tl_gput_right:Nn #1 {#2}
+ }
\cs_generate_variant:Nn \__hook_initialize_single:NNNn {ccc}
\cs_new:Npn \__hook_tl_gput:NV {\ERROR}
\cs_new:Npn \__hook_clist_gput:NV {\ERROR}
@@ -2192,67 +2243,88 @@
}
\cs_new_protected:Npn \hook_log:n #1
{
- \exp_args:Nx \__hook_log:n
- { \__hook_parse_label_default:nn {#1} { top-level } }
+ \cs_set_eq:NN \__hook_log_cmd:x \iow_log:x
+ \__hook_normalize_hook_args:Nn \__hook_log:nN {#1} \tl_log:x
}
-\cs_new_protected:Npn \__hook_log:n #1
+\cs_new_protected:Npn \hook_show:n #1
+ {
+ \cs_set_eq:NN \__hook_log_cmd:x \iow_term:x
+ \__hook_normalize_hook_args:Nn \__hook_log:nN {#1} \tl_show:x
+ }
+\cs_new_protected:Npn \__hook_log_line:x #1
+ { \__hook_log_cmd:x { >~#1 } }
+\cs_new_protected:Npn \__hook_log_line_indent:x #1
+ { \__hook_log_cmd:x { >~\@spaces #1 } }
+\cs_new_protected:Npn \__hook_log:nN #1 #2
{
\__hook_preamble_hook:n {#1}
- \iow_term:x{^^JThe~ hook~ '#1':}
+ \iow_term:x { ^^J ->~The~hook~'#1': }
\hook_if_exist:nF {#1}
- { \iow_term:x {~Hook~ is~ not~ declared!} }
+ { \__hook_log_line:x { is~not~declared! } }
\__hook_if_exist:nTF {#1}
{
- \iow_term:x{~Code~ chunks:}
- \prop_if_empty:cTF {g__hook_#1_code_prop}
- { \iow_term:x{\@spaces ---} }
+ \__hook_log_line:x { Code~chunks: }
+ \prop_if_empty:cTF { g__hook_#1_code_prop }
+ { \__hook_log_line_indent:x { --- } }
{
- \prop_map_inline:cn {g__hook_#1_code_prop}
- { \iow_term:x{\@spaces ##1~ ->~ \tl_to_str:n{##2} } }
+ \prop_map_inline:cn { g__hook_#1_code_prop }
+ { \__hook_log_line_indent:x { ##1~->~\tl_to_str:n {##2} } }
}
- \iow_term:x{~Extra~ code~ next~ invocation:}
- \iow_term:x{\@spaces
- \tl_if_empty:cTF { g__hook_#1_code_next_tl }
- {---}
- {->~ \exp_args:Nv
- \__hook_log_next_code:n {g__hook_#1_code_next_tl} } }
- \iow_term:x { ~Rules: }
+ \__hook_log_line:x { Extra~code~for~next~invocation:}
+ \__hook_log_line_indent:x
+ {
+ \tl_if_empty:cTF { __hook_next~#1 }
+ { --- }
+ { ->~ \exp_args:Nv \__hook_log_next_code:n { __hook_next~#1 } }
+ }
+ \__hook_log_line:x { Rules: }
\bool_set_true:N \l__hook_tmpa_bool
\__hook_list_rules:nn {#1}
{
\bool_set_false:N \l__hook_tmpa_bool
- \iow_term:x
+ \__hook_log_line_indent:x
{
- \@spaces ##2~ with~
+ ##2~ with~
\str_if_eq:nnT {##3} {??} { default~ }
- relation~ ##1 }
+ relation~ ##1
+ }
}
\bool_if:NT \l__hook_tmpa_bool
- { \iow_term:x { \@spaces --- } }
- \bool_lazy_and:nnT
+ { \__hook_log_line_indent:x { --- } }
+ \bool_lazy_and:nnTF
{ \hook_if_exist_p:n {#1} }
{ ! \hook_if_empty_p:n {#1} }
- { \iow_term:x { ~Execution~ order
- \bool_if:NTF \l__hook_tmpa_bool
- { \__hook_if_reversed:nT {#1}
- { ~ (after~ reversal) }
- }
- { ~ (after~
- \__hook_if_reversed:nT {#1} {reversal~ and~}
- applying~ rules)
- }
- :
+ {
+ \__hook_log_line:x
+ {
+ Execution~order
+ \bool_if:NTF \l__hook_tmpa_bool
+ { \__hook_if_reversed:nT {#1} { ~(after~reversal) } }
+ { ~(after~
+ \__hook_if_reversed:nT {#1} { reversal~and~ }
+ applying~rules)
+ } :
+ }
+ #2 % \tl_show:n
+ {
+ \@spaces
+ \clist_if_empty:cTF { g__hook_#1_labels_clist }
+ { --- }
+ { \clist_use:cn {g__hook_#1_labels_clist} { ,~ } }
+ }
+ }
+ {
+ #2
+ {
+ Hook~ \hook_if_exist:nTF {#1}
+ {code~pool~empty} {not~declared}
}
- \iow_term:x
- { \@spaces \clist_use:cn {g__hook_#1_labels_clist} { ,~ } }
}
}
- { \iow_term:n { ~The~hook~is~empty. } }
- \iow_term:n { }
+ { #2 { The~hook~is~empty. } }
}
-\cs_new:Npn \__hook_log_next_code:n #1 {
- \exp_args:No \tl_to_str:n {\use_none:nn #1}
-}
+\cs_new:Npn \__hook_log_next_code:n #1
+ { \exp_args:No \tl_to_str:n { \use_none:nn #1 } }
\cs_new_protected:Npn \__hook_list_rules:nn #1 #2
{
\cs_set_protected:Npn \__hook_tmp:w ##1 ##2 ##3 {#2}
@@ -2297,47 +2369,56 @@
\exp_args:No \__hook_tmp:w { \use:nn { ~ } { ~ } }
}
\cs_new_protected:Npn \hook_gput_next_code:nn #1
- {
- \exp_args:Nx \__hook_gput_next_code:nn
- { \__hook_parse_label_default:nn {#1} { top-level } }
- }
+ { \__hook_normalize_hook_args:Nn \__hook_gput_next_code:nn {#1} }
\cs_new_protected:Npn \__hook_gput_next_code:nn #1 #2
{
+ \debug_suspend:
\__hook_declare:n {#1}
\hook_if_exist:nTF {#1}
{ \__hook_gput_next_do:nn {#1} {#2} }
{ \__hook_try_declaring_generic_next_hook:nn {#1} {#2} }
+ \debug_resume:
}
\cs_new_protected:Npn \__hook_gput_next_do:nn #1
{
\exp_args:Nc \__hook_gput_next_do:Nnn
- { g__hook_#1_code_next_tl } {#1}
+ { __hook_next~#1 } {#1}
}
\cs_new_protected:Npn \__hook_gput_next_do:Nnn #1 #2
{
- \tl_if_empty:cT { g__hook_#2_code_tl }
+ \tl_if_empty:cT { __hook~#2 }
{ \__hook_update_hook_code:n {#2} }
\tl_if_empty:NT #1
- { \tl_gset:Nn #1 { \tl_gclear:c { g__hook_#2_code_next_tl } } }
+ { \tl_gset:Nn #1 { \__hook_clear_next:n {#2} } }
\tl_gput_right:Nn #1
}
+\cs_new_protected:Npn \__hook_clear_next:n #1
+ { \cs_gset_eq:cN { __hook_next~#1 } \c_empty_tl }
\cs_new_protected:Npn \hook_use:n #1
{
- \tl_if_exist:cTF { g__hook_#1_code_tl }
+ \tl_if_exist:cTF { __hook~#1 }
{
\__hook_preamble_hook:n {#1}
- \cs:w g__hook_#1_code_tl \cs_end:
+ \cs:w __hook~#1 \cs_end:
}
{ \__hook_use:wn #1 / \s__hook_mark {#1} }
}
\cs_new:Npn \__hook_use_initialized:n #1
{
- \tl_if_exist:cTF { g__hook_#1_code_tl }
- { \cs:w g__hook_#1_code_tl \cs_end: }
- { \__hook_use:wn #1 / \s__hook_mark {#1} }
+ \if_cs_exist:w __hook~#1 \cs_end:
+ \else:
+ \__hook_use_undefined:w
+ \fi:
+ \cs:w __hook~#1 \__hook_use_end:
+ }
+\cs_new:Npn \__hook_use_undefined:w #1 #2 __hook~#3 \__hook_use_end:
+ {
+ #1 % fi
+ \__hook_use:wn #3 / \s__hook_mark {#3}
}
\cs_new_protected:Npn \__hook_preamble_hook:n #1
{ \__hook_initialize_hook_code:n {#1} }
+\cs_new_eq:NN \__hook_use_end: \cs_end:
\cs_new:Npn \__hook_use:wn #1 / #2 \s__hook_mark #3
{
\str_if_eq:nnTF {#1} { file }
@@ -2355,27 +2436,31 @@
}
\cs_new_protected:Npn \__hook_if_exist_use:n #1
{
- \tl_if_exist:cT { g__hook_#1_code_tl }
+ \tl_if_exist:cT { __hook~#1 }
{
\__hook_preamble_hook:n {#1}
- \cs:w g__hook_#1_code_tl \cs_end:
+ \cs:w __hook~#1 \cs_end:
}
}
\cs_new_protected:Npn \hook_use_once:n #1
{
- \tl_if_exist:cT { g__hook_#1_code_tl }
+ \tl_if_exist:cT { __hook~#1 }
{
- \clist_gput_left:Nn \g__hook_execute_immediately_clist {#1}
+ \tl_set:Nn \l__hook_return_tl {#1}
+ \__hook_normalize_hook_args:Nn \__hook_use_once_store:n
+ { \l__hook_return_tl }
\hook_use:n {#1}
}
}
+\cs_new_protected:Npn \__hook_use_once_store:n #1
+ { \prop_gput:Nnn \g__hook_execute_immediately_prop {#1} { } }
\prg_new_conditional:Npnn \hook_if_empty:n #1 { p , T , F , TF }
{
\__hook_if_exist:nTF {#1}
{
\bool_lazy_and:nnTF
{ \prop_if_empty_p:c { g__hook_#1_code_prop } }
- { \tl_if_empty_p:c { g__hook_#1_code_next_tl } }
+ { \tl_if_empty_p:c { __hook_next~#1 } }
{ \prg_return_true: }
{ \prg_return_false: }
}
@@ -2383,7 +2468,7 @@
}
\prg_new_conditional:Npnn \hook_if_exist:n #1 { p , T , F , TF }
{
- \tl_if_exist:cTF { g__hook_#1_code_tl }
+ \tl_if_exist:cTF { __hook~#1 }
{ \prg_return_true: }
{ \prg_return_false: }
}
@@ -2401,7 +2486,6 @@
\prg_return_false:
\fi:
}
-\clist_new:N \g__hook_execute_immediately_clist
\msg_new:nnnn { hooks } { labels-incompatible }
{
Labels~`#1'~and~`#2'~are~incompatible
@@ -2443,11 +2527,7 @@
\NewDocumentCommand \NewReversedHook { m }{ \hook_new_reversed:n {#1} }
\NewDocumentCommand \NewMirroredHookPair { mm }{ \hook_new_pair:nn {#1}{#2} }
\NewDocumentCommand \AddToHook { m o +m }
- {
- \clist_if_in:NnTF \g__hook_execute_immediately_clist {#1}
- {#3}
- { \hook_gput_code:nnn {#1} {#2} {#3} }
- }
+ { \hook_gput_code:nnn {#1} {#2} {#3} }
\NewDocumentCommand \AddToHookNext { m +m }
{ \hook_gput_next_code:nn {#1} {#2} }
\NewDocumentCommand \RemoveFromHook { m o }
@@ -2473,9 +2553,10 @@
\seq_gpop:NN \g__hook_name_stack_seq \l__hook_return_tl
\__hook_curr_name_push:n {#1}
}
-\newcommand \UseHook { \hook_use:n }
-\newcommand \UseOneTimeHook { \hook_use_once:n }
-\cs_new_protected:Npn \ShowHook { \hook_log:n }
+\cs_new:Npn \UseHook { \hook_use:n }
+\cs_new:Npn \UseOneTimeHook { \hook_use_once:n }
+\cs_new_protected:Npn \ShowHook { \hook_show:n }
+\cs_new_protected:Npn \LogHook { \hook_log:n }
\cs_new_protected:Npn \DebugHooksOn { \hook_debug_on: }
\cs_new_protected:Npn \DebugHooksOff { \hook_debug_off: }
\NewDocumentCommand \DeclareHookRule { m m m m }
@@ -3107,7 +3188,7 @@ Type H <return> for immediate help.}%
\edef \@kernel@after@begindocument@before {%
\let\expandafter\noexpand\csname
- g__hook_env/document/begin_code_tl\endcsname
+ __hook env/document/begin\endcsname
\noexpand\@empty}
\let \@kernel@before@begindocument \@empty
\let \@kernel@after@begindocument \@empty
@@ -9684,9 +9765,10 @@ Type H <return> for immediate help.}%
\@makeother\&%
\kernel@ifnextchar[{\@providesfile{#1}}{\@providesfile{#1}[]}}
\def\@pass@ptions#1#2#3{%
- \expandafter\xdef\csname opt@#3.#1\endcsname{%
- \@ifundefined{opt@#3.#1}\@empty
- {\csname opt@#3.#1\endcsname,}%
+ \edef\reserved@a{\@expl@@@filehook@resolve@file@subst@@w #3.#1\@nil}%
+ \expandafter\xdef\csname opt@\reserved@a\endcsname{%
+ \@ifundefined{opt@\reserved@a}\@empty
+ {\csname opt@\reserved@a\endcsname,}%
\zap@space#2 \@empty}}
\@onlypreamble\@pass@ptions
\def\PassOptionsToPackage{\@pass@ptions\@pkgextension}
@@ -9880,7 +9962,6 @@ Type H <return> for immediate help.}%
\fi
\reserved@a}
\@onlypreamble\@fileswith@pti@ns
-
\def\@onefilewithoptions#1[#2][#3]#4{%
\@pushfilename
\xdef\@currname{#1}%
@@ -9913,6 +9994,13 @@ Type H <return> for immediate help.}%
{\@expl@@@filehook@file@push@@
\set@curr@file{\@currname.\@currext}%
\@filehook@set@CurrentFile
+ \edef\@currpkg@reqd{\@currname.\@currext}%
+ \ifx\CurrentFile\CurrentFileUsed
+ \else
+ \filename@parse\@curr@file
+ \edef\@currname{\string@makeletter\filename@base}%
+ \edef\@currext{\string@makeletter\filename@ext}%
+ \fi
\load@onefile@withoptions{#2}%
\@expl@@@filehook@file@pop@@}%
\expandafter\@firstofone
@@ -9930,7 +10018,6 @@ Type H <return> for immediate help.}%
\@reset@ptions}
\@onlypreamble\@onefilewithoptions
\let\@unprocessedoptions\@undefined
-
\def\@missing@onefilewithoptions#1{%
\@missingfileerror\@currname\@currext
\xdef\@currname{\@missingfile@area\@missingfile@base}%
@@ -9952,7 +10039,9 @@ Type H <return> for immediate help.}%
\UseHook{class/before/\@currname}%
\fi
\fi
- \InputIfFileExists{\@currname.\@currext}{}{}%
+ \InputIfFileExists{\@currpkg@reqd}{}%
+ {\@latex@error
+ {The \@cls@pkg\space\@currpkg@reqd\space failed to load.}\@ehd}%
\expandafter\let\csname unprocessedoptions-\@currname.\@currext\endcsname
\@@unprocessedoptions
\csname\@currname.\@currext-h@@k\endcsname
@@ -9975,7 +10064,7 @@ Type H <return> for immediate help.}%
\UseHook{class/after}%
\fi
\fi}%
- \reserved@a}
+ \@ifl@aded\@currext\@currname{}{\reserved@a}}
\let\@@fileswith@pti@ns\@fileswith@pti@ns
\@onlypreamble\@@fileswith@pti@ns
\def\@reset@ptions{%
@@ -10376,7 +10465,7 @@ Type H <return> for immediate help.}%
%%
%% File: ltfilehook.dtx (C) Copyright 2020 Frank Mittelbach,
%% Phelype Oleinik & LaTeX Team
-%%% From File: ltshipout.dtx
+%%% From File: ltfilehook.dtx
\providecommand\ltfilehookversion{v1.0a}
\providecommand\ltfilehookdate{2020/08/30}
\ExplSyntaxOn
@@ -10636,8 +10725,8 @@ Type H <return> for immediate help.}%
%% File: ltshipout.dtx (C) Copyright 2020 Frank Mittelbach, LaTeX Team
%%
%%% From File: ltshipout.dtx
-\providecommand\ltshipoutversion{v1.0a}
-\providecommand\ltshipoutdate{2020/08/31}
+\providecommand\ltshipoutversion{v1.0b}
+\providecommand\ltshipoutdate{2020/09/09}
\ExplSyntaxOn
\bool_new:N \g__shipout_debug_bool
\cs_new_eq:NN \__shipout_debug:n \use_none:n
@@ -10883,7 +10972,8 @@ Type H <return> for immediate help.}%
\vbox_to_zero:n {
\kern -\c__shipout_vorigin_tl \scan_stop:
\unitlength 1pt \scan_stop:
- \hbox_set_to_wd:Nnn \l__shipout_tmp_box \c_zero_dim { \ignorespaces #1 }
+ \hbox_set_to_wd:Nnn \l__shipout_tmp_box \c_zero_dim
+ { \ignorespaces #1 \hss }
\box_set_ht:Nn \l__shipout_tmp_box \c_zero_dim
\box_set_dp:Nn \l__shipout_tmp_box \c_zero_dim
\box_use:N \l__shipout_tmp_box
diff --git a/Master/texmf-dist/tex/latex-dev/base/latexrelease.sty b/Master/texmf-dist/tex/latex-dev/base/latexrelease.sty
index bb34f36cd02..a96f356e263 100644
--- a/Master/texmf-dist/tex/latex-dev/base/latexrelease.sty
+++ b/Master/texmf-dist/tex/latex-dev/base/latexrelease.sty
@@ -521,6 +521,8 @@ of this package available from CTAN}
\cs_gset_eq:NN \@expl@cs@prefix@spec@@N \cs_prefix_spec:N
\cs_gset_eq:NN \@expl@cs@argument@spec@@N \cs_argument_spec:N
\cs_gset_eq:NN \@expl@cs@replacement@spec@@N \cs_replacement_spec:N
+\cs_gset_eq:NN \@expl@str@map@function@@NN \str_map_function:NN
+\cs_gset_eq:NN \@expl@char@generate@@nn \char_generate:nn
\EndIncludeInRelease
\IncludeInRelease{0000/00/00}{expl3~2020-10-01}%
{expl3~macros~added~for~the~2020-10-01~release}%
@@ -529,6 +531,7 @@ of this package available from CTAN}
\cs_undefine:N \@expl@cs@prefix@spec@@N
\cs_undefine:N \@expl@cs@argument@spec@@N
\cs_undefine:N \@expl@cs@replacement@spec@@N
+\cs_undefine:N \@expl@str@map@function@@NN
\EndIncludeInRelease
\ExplSyntaxOff
%%% From File: ltdefns.dtx
@@ -912,6 +915,28 @@ of this package available from CTAN}
\expandafter\@secondoftwo
\fi}
\EndIncludeInRelease
+\IncludeInRelease{2020/10/01}{\string@makeletter}
+ {Add \string@makeletter}%
+\def\string@makeletter#1{%
+ \@expl@str@map@function@@NN#1\@string@makeletter}
+\def\@string@makeletter#1{%
+ \char@if@alph{#1}%
+ {\@expl@char@generate@@nn{`#1}{11}}%
+ {#1}}
+\def\char@if@alph#1{%
+ \ifnum0\ifnum`#1<`A 1\fi\ifnum`#1>`z 1\fi
+ \if\ifnum`#1>`Z @\fi\ifnum`#1<`a @\fi01\fi>0
+ \expandafter\@secondoftwo
+ \else
+ \expandafter\@firstoftwo
+ \fi}
+\EndIncludeInRelease
+\IncludeInRelease{0000/00/00}{\string@makeletter}
+ {Undefine \string@makeletter}%
+\let\string@makeletter\@undefined
+\let\@string@makeletter\@undefined
+\let\char@if@alph\@undefined
+\EndIncludeInRelease
\IncludeInRelease{2020/10/01}{\-}{Use primitive \- in Lua\LaTeX}%
\ifx\directlua\@undefined
\DeclareRobustCommand{\-}{%
@@ -987,7 +1012,7 @@ of this package available from CTAN}
%% Phelype Oleinik & LaTeX Team
%%% From File: lthooks.dtx
\def\lthooksversion{v1.0a}
-\def\lthooksdate{2020/08/31}
+\def\lthooksdate{2020/09/10}
\IncludeInRelease{2020/10/01}%
{\NewHook}{The hook management}%
\ExplSyntaxOn
@@ -1017,42 +1042,47 @@ of this package available from CTAN}
\tl_new:N \g__hook_removal_list_tl
\tl_new:N \l__hook_cur_hook_tl
\prop_new:N \l__hook_work_prop
+\prop_new:N \g__hook_execute_immediately_prop
+\prop_new:N \g__hook_used_prop
\tl_new:N \g__hook_hook_curr_name_tl
\seq_new:N \g__hook_name_stack_seq
\cs_new_eq:NN \__hook_tmp:w ?
\cs_generate_variant:Nn \tl_gremove_once:Nn { Nx }
+\cs_generate_variant:Nn \tl_show:n { x }
+\cs_generate_variant:Nn \tl_log:n { x }
\scan_new:N \s__hook_mark
\cs_new_protected:Npn \hook_new:n #1
+ { \__hook_normalize_hook_args:Nn \__hook_new:n {#1} }
+\cs_new_protected:Npn \__hook_new:n #1
{
- \exp_args:Nx \__hook_new:n
- { \__hook_parse_label_default:nn {#1} { top-level } }
- }
-\cs_new_protected:Npn \__hook_new:n #1 {
- \hook_if_exist:nTF {#1}
- { \msg_error:nnn { hooks } { exists } {#1} }
- { \seq_gput_right:Nn \g__hook_all_seq {#1}
- \tl_new:c { g__hook_#1_code_tl }
- \__hook_declare:n {#1}
- \clist_new:c {g__hook_#1_labels_clist}
- \tl_new:c { g__hook_#1_reversed_tl }
- \__hook_include_legacy_code_chunk:n {#1}
+ \hook_if_exist:nTF {#1}
+ { \msg_error:nnn { hooks } { exists } {#1} }
+ {
+ \seq_gput_right:Nn \g__hook_all_seq {#1}
+ \tl_new:c { __hook~#1 }
+ \__hook_declare:n {#1}
+ \clist_new:c {g__hook_#1_labels_clist}
+ \tl_new:c { g__hook_#1_reversed_tl }
+ \__hook_include_legacy_code_chunk:n {#1}
}
-}
+ }
\cs_new_protected:Npn \__hook_declare:n #1
{
\__hook_if_exist:nF {#1}
{
\prop_new:c { g__hook_#1_code_prop }
- \tl_new:c { g__hook_#1_code_next_tl }
+ \tl_new:c { __hook_next~#1 }
}
}
-\cs_new_protected:Npn \hook_new_reversed:n #1 {
- \hook_new:n {#1}
- \tl_gset:cn { g__hook_#1_reversed_tl } { - }
-}
-\cs_new_protected:Npn \hook_new_pair:nn #1#2 {
- \hook_new:n {#1} \hook_new_reversed:n {#2}
-}
+\cs_new_protected:Npn \hook_new_reversed:n #1
+ { \__hook_normalize_hook_args:Nn \__hook_new_reversed:n {#1} }
+\cs_new_protected:Npn \__hook_new_reversed:n #1
+ {
+ \__hook_new:n {#1}
+ \tl_gset:cn { g__hook_#1_reversed_tl } { - }
+ }
+\cs_new_protected:Npn \hook_new_pair:nn #1#2
+ { \hook_new:n {#1} \hook_new_reversed:n {#2} }
\cs_new_protected:Npn \__hook_include_legacy_code_chunk:n #1
{
\debug_suspend:
@@ -1067,13 +1097,15 @@ of this package available from CTAN}
}
\debug_resume:
}
-\cs_new:Npn \__hook_parse_label_default:nn #1 #2
+\cs_new:Npn \__hook_parse_label_default:n #1
{
\tl_if_novalue:nTF {#1}
- { \__hook_currname_or_default:n {#2} }
- { \tl_trim_spaces_apply:nN {#1} \__hook_parse_dot_label:nn {#2} }
+ { \__hook_currname_or_default:n { top-level } }
+ {
+ \tl_trim_spaces_apply:nN {#1}
+ \__hook_parse_dot_label:nn { top-level }
+ }
}
-\cs_generate_variant:Nn \__hook_parse_label_default:nn { V }
\cs_new:Npn \__hook_parse_dot_label:nn #1 #2
{
\tl_if_empty:nTF {#1}
@@ -1083,7 +1115,7 @@ of this package available from CTAN}
}
{
\str_if_eq:nnTF {#1} { . }
- { \__hook_currname_or_default:n {#1} }
+ { \__hook_currname_or_default:n {#2} }
{ \__hook_parse_dot_label:nw {#2} #1 ./ \s__hook_mark }
}
}
@@ -1093,40 +1125,79 @@ of this package available from CTAN}
{ \__hook_parse_dot_label_aux:nw {#1} #3 \s__hook_mark }
{
\tl_if_empty:nTF {#3}
- {#2}
+ { \__hook_make_name:n {#2} }
{ \__hook_parse_dot_label_cleanup:w #2 ./ #3 \s__hook_mark }
}
}
\cs_new:Npn \__hook_parse_dot_label_cleanup:w #1 ./ \s__hook_mark {#1}
\cs_new:Npn \__hook_parse_dot_label_aux:nw #1 #2 ./ \s__hook_mark
- { \__hook_currname_or_default:n {#1} / #2 }
+ { \__hook_currname_or_default:n {#1} / \__hook_make_name:n {#2} }
\cs_new:Npn \__hook_currname_or_default:n #1
{
\tl_if_empty:NTF \g__hook_hook_curr_name_tl
{
\tl_if_empty:NTF \@currname
- {#1}
+ { \__hook_make_name:n {#1} }
{ \@currname }
}
{ \g__hook_hook_curr_name_tl }
}
-\cs_new_protected:Npn \hook_gput_code:nnn #1 #2
+\cs_new:Npn \__hook_make_name:n #1
+ {
+ \exp_after:wN \exp_after:wN \exp_after:wN \__hook_make_name:w
+ \exp_after:wN \token_to_str:N \cs:w __hook~ #1 \cs_end:
+ }
+\exp_last_unbraced:NNNNo
+\cs_new:Npn \__hook_make_name:w #1 \tl_to_str:n { __hook~ } { }
+\cs_new_protected:Npn \__hook_normalize_hook_args_aux:Nn #1 #2
{
- \exp_args:Nxx \__hook_gput_code:nnn
- { \__hook_parse_label_default:nn {#1} { top-level } }
- { \__hook_parse_label_default:nn {#2} { top-level } }
+ \group_begin:
+ \use:e
+ {
+ \group_end:
+ \exp_not:N #1 #2
+ }
}
+\cs_new_protected:Npn \__hook_normalize_hook_args:Nn #1 #2
+ {
+ \__hook_normalize_hook_args_aux:Nn #1
+ { { \__hook_parse_label_default:n {#2} } }
+ }
+\cs_new_protected:Npn \__hook_normalize_hook_args:Nnn #1 #2 #3
+ {
+ \__hook_normalize_hook_args_aux:Nn #1
+ {
+ { \__hook_parse_label_default:n {#2} }
+ { \__hook_parse_label_default:n {#3} }
+ }
+ }
+\cs_new_protected:Npn \__hook_normalize_hook_rule_args:Nnnnn #1 #2 #3 #4 #5
+ {
+ \__hook_normalize_hook_args_aux:Nn #1
+ {
+ { \__hook_parse_label_default:n {#2} }
+ { \__hook_parse_label_default:n {#3} }
+ { \tl_trim_spaces:n {#4} }
+ { \__hook_parse_label_default:n {#5} }
+ }
+ }
+\cs_new_protected:Npn \hook_gput_code:nnn #1 #2
+ { \__hook_normalize_hook_args:Nnn \__hook_gput_code:nnn {#1} {#2} }
\cs_new_protected:Npn \__hook_gput_code:nnn #1 #2 #3
{
- \__hook_if_marked_removal:nnTF {#1} {#2}
- { \__hook_unmark_removal:nn {#1} {#2} }
+ \prop_if_in:NnTF \g__hook_execute_immediately_prop {#1}
+ {#3}
{
- \hook_if_exist:nTF {#1}
+ \__hook_if_marked_removal:nnTF {#1} {#2}
+ { \__hook_unmark_removal:nn {#1} {#2} }
{
- \__hook_hook_gput_code_do:nnn {#1} {#2} {#3}
- \__hook_update_hook_code:n {#1}
+ \hook_if_exist:nTF {#1}
+ {
+ \__hook_hook_gput_code_do:nnn {#1} {#2} {#3}
+ \__hook_update_hook_code:n {#1}
+ }
+ { \__hook_try_declaring_generic_hook:nnn {#1} {#2} {#3} }
}
- { \__hook_try_declaring_generic_hook:nnn {#1} {#2} {#3} }
}
}
\cs_generate_variant:Nn \__hook_gput_code:nnn { nxv }
@@ -1226,11 +1297,7 @@ of this package available from CTAN}
\prop_const_from_keyval:Nn \c__hook_generics_reversed_iii_prop {after=}
\prop_const_from_keyval:Nn \c__hook_generics_file_prop {before=,after=}
\cs_new_protected:Npn \hook_gremove_code:nn #1 #2
- {
- \exp_args:Nxx \__hook_gremove_code:nn
- { \__hook_parse_label_default:nn {#1} { top-level } }
- { \__hook_parse_label_default:nn {#2} { top-level } }
- }
+ { \__hook_normalize_hook_args:Nnn \__hook_gremove_code:nn {#1} {#2} }
\cs_new_protected:Npn \__hook_gremove_code:nn #1 #2
{
\__hook_if_exist:nTF {#1}
@@ -1269,18 +1336,12 @@ of this package available from CTAN}
\cs_new:Npn \__hook_removal_tl:nn #1 #2
{ & \tl_to_str:n {#2} $ \tl_to_str:n {#1} $ }
\prop_new:c {g__hook_??_code_prop}
-\prop_new:c {g__hook_??_code_tl}
+\prop_new:c {__hook~??}
\tl_new:c {g__hook_??_reversed_tl}
\cs_new_protected:Npn \hook_gset_rule:nnnn #1#2#3#4
{
- \use:x
- {
- \__hook_gset_rule:nnnn
- { \__hook_parse_label_default:nn {#1} { top-level } }
- { \__hook_parse_label_default:nn {#2} { top-level } }
- {#3}
- { \__hook_parse_label_default:nn {#4} { top-level } }
- }
+ \__hook_normalize_hook_rule_args:Nnnnn \__hook_gset_rule:nnnn
+ {#1} {#2} {#3} {#4}
}
\cs_new_protected:Npn \__hook_gset_rule:nnnn #1#2#3#4
{
@@ -1355,37 +1416,39 @@ of this package available from CTAN}
{ \iow_term:x{^^JAll~ initialized~ (non-empty)~ hooks:}
\prop_map_inline:Nn \g__hook_used_prop
{ \iow_term:x{^^J~ ##1~ ->~
- \exp_not:v {g__hook_##1_code_tl}~ }
+ \exp_not:v {__hook~##1}~ }
}
}
\cs_gset_eq:NN \hook_use:n \__hook_use_initialized:n
\cs_gset_eq:NN \__hook_preamble_hook:n \use_none:n
}
-\cs_new_protected:Npn \__hook_initialize_hook_code:n #1 {
- \__hook_debug:n{ \iow_term:x{^^JUpdate~ code~ for~ hook~
- '#1' \on@line :^^J} }
- \__hook_include_legacy_code_chunk:n {#1}
- \hook_if_exist:nT {#1}
- {
- \prop_if_empty:cTF {g__hook_#1_code_prop}
- { \tl_gset:co {g__hook_#1_code_tl}
- {\cs:w g__hook_#1_code_next_tl \cs_end: } }
- {
- \__hook_if_reversed:nTF {#1}
- { \cs_set_eq:NN \__hook_tl_gput:NV \tl_gput_left:NV
- \cs_set_eq:NN \__hook_clist_gput:NV \clist_gput_left:NV }
- { \cs_set_eq:NN \__hook_tl_gput:NV \tl_gput_right:NV
- \cs_set_eq:NN \__hook_clist_gput:NV \clist_gput_right:NV }
- \prop_set_eq:Nc \l__hook_work_prop { g__hook_#1_code_prop }
- \__hook_initialize_single:cccn
- { g__hook_#1_code_tl } { g__hook_#1_code_next_tl }
- { g__hook_#1_labels_clist } {#1}
- \__hook_debug:n{ \exp_args:NNx \prop_gput:Nnn
- \g__hook_used_prop {#1}{} }
- }
- }
-}
-\prop_new:N\g__hook_used_prop
+\cs_new_protected:Npn \__hook_initialize_hook_code:n #1
+ {
+ \debug_suspend:
+ \__hook_debug:n{ \iow_term:x{^^JUpdate~ code~ for~ hook~
+ '#1' \on@line :^^J} }
+ \__hook_include_legacy_code_chunk:n {#1}
+ \hook_if_exist:nT {#1}
+ {
+ \prop_if_empty:cTF {g__hook_#1_code_prop}
+ { \tl_gset:co { __hook~#1 }
+ { \cs:w __hook_next~#1 \cs_end: } }
+ {
+ \__hook_if_reversed:nTF {#1}
+ { \cs_set_eq:NN \__hook_tl_gput:NV \tl_gput_left:NV
+ \cs_set_eq:NN \__hook_clist_gput:NV \clist_gput_left:NV }
+ { \cs_set_eq:NN \__hook_tl_gput:NV \tl_gput_right:NV
+ \cs_set_eq:NN \__hook_clist_gput:NV \clist_gput_right:NV }
+ \prop_set_eq:Nc \l__hook_work_prop { g__hook_#1_code_prop }
+ \__hook_initialize_single:cccn
+ { __hook~#1 } { __hook_next~#1 }
+ { g__hook_#1_labels_clist } {#1}
+ \__hook_debug:n{ \exp_args:NNx \prop_gput:Nnn
+ \g__hook_used_prop {#1}{} }
+ }
+ }
+ \debug_resume:
+ }
\cs_new:Npn \__hook_tl_csname:n #1 { l__hook_label_#1_tl }
\cs_new:Npn \__hook_seq_csname:n #1 { l__hook_label_#1_seq }
\seq_new:N \l__hook_labels_seq
@@ -1393,33 +1456,33 @@ of this package available from CTAN}
\tl_new:N \l__hook_front_tl
\tl_new:N \l__hook_rear_tl
\tl_new:c { \__hook_tl_csname:n { 0 } }
-\cs_new_protected:Npn \__hook_initialize_single:NNNn #1#2#3#4 {
- \debug_suspend:
- \seq_clear:N \l__hook_labels_seq
- \int_zero:N \l__hook_labels_int
- \tl_set:Nn \l__hook_cur_hook_tl {#4}
- \prop_map_inline:Nn \l__hook_work_prop
- {
- \int_incr:N \l__hook_labels_int
- \seq_put_right:Nn \l__hook_labels_seq {##1}
- \tl_set:cn { \__hook_tl_csname:n {##1} }{0}
- \seq_clear_new:c { \__hook_seq_csname:n {##1} }
- }
- \prop_map_inline:Nn \l__hook_work_prop
- {
- \prop_map_inline:Nn \l__hook_work_prop
- {
- \__hook_if_label_case:nnnnn {##1} {####1}
- { \prop_map_break: }
- { \__hook_apply_label_pair:nnn {##1} {####1} }
- { \__hook_apply_label_pair:nnn {####1} {##1} }
- {#4}
- }
- }
- \__hook_debug:n { \__hook_debug_label_data:N \l__hook_work_prop }
- \tl_set:Nn \l__hook_rear_tl { 0 }
- \tl_set:cn { \__hook_tl_csname:n { 0 } } { 0 }
- \seq_map_inline:Nn \l__hook_labels_seq
+\cs_new_protected:Npn \__hook_initialize_single:NNNn #1#2#3#4
+ {
+ \seq_clear:N \l__hook_labels_seq
+ \int_zero:N \l__hook_labels_int
+ \tl_set:Nn \l__hook_cur_hook_tl {#4}
+ \prop_map_inline:Nn \l__hook_work_prop
+ {
+ \int_incr:N \l__hook_labels_int
+ \seq_put_right:Nn \l__hook_labels_seq {##1}
+ \tl_set:cn { \__hook_tl_csname:n {##1} }{0}
+ \seq_clear_new:c { \__hook_seq_csname:n {##1} }
+ }
+ \prop_map_inline:Nn \l__hook_work_prop
+ {
+ \prop_map_inline:Nn \l__hook_work_prop
+ {
+ \__hook_if_label_case:nnnnn {##1} {####1}
+ { \prop_map_break: }
+ { \__hook_apply_label_pair:nnn {##1} {####1} }
+ { \__hook_apply_label_pair:nnn {####1} {##1} }
+ {#4}
+ }
+ }
+ \__hook_debug:n { \__hook_debug_label_data:N \l__hook_work_prop }
+ \tl_set:Nn \l__hook_rear_tl { 0 }
+ \tl_set:cn { \__hook_tl_csname:n { 0 } } { 0 }
+ \seq_map_inline:Nn \l__hook_labels_seq
{
\int_compare:nNnT { \cs:w \__hook_tl_csname:n {##1} \cs_end: } = 0
{
@@ -1427,42 +1490,41 @@ of this package available from CTAN}
\tl_set:Nn \l__hook_rear_tl {##1}
}
}
- \tl_set_eq:Nc \l__hook_front_tl { \__hook_tl_csname:n { 0 } }
- \tl_gclear:N #1
- \clist_gclear:N #3
- \bool_while_do:nn { ! \str_if_eq_p:Vn \l__hook_front_tl { 0 } }
- {
- \int_decr:N \l__hook_labels_int
- \prop_get:NVN \l__hook_work_prop \l__hook_front_tl \l__hook_return_tl
- \__hook_tl_gput:NV #1 \l__hook_return_tl
- \__hook_clist_gput:NV #3 \l__hook_front_tl
- \__hook_debug:n{ \iow_term:x{Handled~ code~ for~ \l__hook_front_tl} }
- \seq_map_inline:cn { \__hook_seq_csname:n { \l__hook_front_tl } }
- {
- \tl_set:cx { \__hook_tl_csname:n {##1} }
- { \int_eval:n
- { \cs:w \__hook_tl_csname:n {##1} \cs_end: - 1 }
- }
- \int_compare:nNnT
- { \cs:w \__hook_tl_csname:n {##1} \cs_end: } = 0
- {
- \tl_set:cn { \__hook_tl_csname:n { \l__hook_rear_tl } } {##1}
- \tl_set:Nn \l__hook_rear_tl {##1}
- }
- }
- \tl_set_eq:Nc \l__hook_front_tl
- { \__hook_tl_csname:n { \l__hook_front_tl } }
- }
- \int_compare:nNnF \l__hook_labels_int = 0
+ \tl_set_eq:Nc \l__hook_front_tl { \__hook_tl_csname:n { 0 } }
+ \tl_gclear:N #1
+ \clist_gclear:N #3
+ \bool_while_do:nn { ! \str_if_eq_p:Vn \l__hook_front_tl { 0 } }
+ {
+ \int_decr:N \l__hook_labels_int
+ \prop_get:NVN \l__hook_work_prop \l__hook_front_tl \l__hook_return_tl
+ \__hook_tl_gput:NV #1 \l__hook_return_tl
+ \__hook_clist_gput:NV #3 \l__hook_front_tl
+ \__hook_debug:n{ \iow_term:x{Handled~ code~ for~ \l__hook_front_tl} }
+ \seq_map_inline:cn { \__hook_seq_csname:n { \l__hook_front_tl } }
+ {
+ \tl_set:cx { \__hook_tl_csname:n {##1} }
+ { \int_eval:n
+ { \cs:w \__hook_tl_csname:n {##1} \cs_end: - 1 }
+ }
+ \int_compare:nNnT
+ { \cs:w \__hook_tl_csname:n {##1} \cs_end: } = 0
+ {
+ \tl_set:cn { \__hook_tl_csname:n { \l__hook_rear_tl } } {##1}
+ \tl_set:Nn \l__hook_rear_tl {##1}
+ }
+ }
+ \tl_set_eq:Nc \l__hook_front_tl
+ { \__hook_tl_csname:n { \l__hook_front_tl } }
+ }
+ \int_compare:nNnF \l__hook_labels_int = 0
{
\iow_term:x{====================}
\iow_term:x{Error:~ label~ rules~ are~ incompatible:}
\__hook_debug_label_data:N \l__hook_work_prop
\iow_term:x{====================}
}
- \tl_gput_right:Nn #1 {#2}
- \debug_resume:
-}
+ \tl_gput_right:Nn #1 {#2}
+ }
\cs_generate_variant:Nn \__hook_initialize_single:NNNn {ccc}
\cs_new:Npn \__hook_tl_gput:NV {\ERROR}
\cs_new:Npn \__hook_clist_gput:NV {\ERROR}
@@ -1566,67 +1628,88 @@ of this package available from CTAN}
}
\cs_new_protected:Npn \hook_log:n #1
{
- \exp_args:Nx \__hook_log:n
- { \__hook_parse_label_default:nn {#1} { top-level } }
+ \cs_set_eq:NN \__hook_log_cmd:x \iow_log:x
+ \__hook_normalize_hook_args:Nn \__hook_log:nN {#1} \tl_log:x
}
-\cs_new_protected:Npn \__hook_log:n #1
+\cs_new_protected:Npn \hook_show:n #1
+ {
+ \cs_set_eq:NN \__hook_log_cmd:x \iow_term:x
+ \__hook_normalize_hook_args:Nn \__hook_log:nN {#1} \tl_show:x
+ }
+\cs_new_protected:Npn \__hook_log_line:x #1
+ { \__hook_log_cmd:x { >~#1 } }
+\cs_new_protected:Npn \__hook_log_line_indent:x #1
+ { \__hook_log_cmd:x { >~\@spaces #1 } }
+\cs_new_protected:Npn \__hook_log:nN #1 #2
{
\__hook_preamble_hook:n {#1}
- \iow_term:x{^^JThe~ hook~ '#1':}
+ \iow_term:x { ^^J ->~The~hook~'#1': }
\hook_if_exist:nF {#1}
- { \iow_term:x {~Hook~ is~ not~ declared!} }
+ { \__hook_log_line:x { is~not~declared! } }
\__hook_if_exist:nTF {#1}
{
- \iow_term:x{~Code~ chunks:}
- \prop_if_empty:cTF {g__hook_#1_code_prop}
- { \iow_term:x{\@spaces ---} }
+ \__hook_log_line:x { Code~chunks: }
+ \prop_if_empty:cTF { g__hook_#1_code_prop }
+ { \__hook_log_line_indent:x { --- } }
+ {
+ \prop_map_inline:cn { g__hook_#1_code_prop }
+ { \__hook_log_line_indent:x { ##1~->~\tl_to_str:n {##2} } }
+ }
+ \__hook_log_line:x { Extra~code~for~next~invocation:}
+ \__hook_log_line_indent:x
{
- \prop_map_inline:cn {g__hook_#1_code_prop}
- { \iow_term:x{\@spaces ##1~ ->~ \tl_to_str:n{##2} } }
+ \tl_if_empty:cTF { __hook_next~#1 }
+ { --- }
+ { ->~ \exp_args:Nv \__hook_log_next_code:n { __hook_next~#1 } }
}
- \iow_term:x{~Extra~ code~ next~ invocation:}
- \iow_term:x{\@spaces
- \tl_if_empty:cTF { g__hook_#1_code_next_tl }
- {---}
- {->~ \exp_args:Nv
- \__hook_log_next_code:n {g__hook_#1_code_next_tl} } }
- \iow_term:x { ~Rules: }
+ \__hook_log_line:x { Rules: }
\bool_set_true:N \l__hook_tmpa_bool
\__hook_list_rules:nn {#1}
{
\bool_set_false:N \l__hook_tmpa_bool
- \iow_term:x
+ \__hook_log_line_indent:x
{
- \@spaces ##2~ with~
+ ##2~ with~
\str_if_eq:nnT {##3} {??} { default~ }
- relation~ ##1 }
+ relation~ ##1
+ }
}
\bool_if:NT \l__hook_tmpa_bool
- { \iow_term:x { \@spaces --- } }
- \bool_lazy_and:nnT
+ { \__hook_log_line_indent:x { --- } }
+ \bool_lazy_and:nnTF
{ \hook_if_exist_p:n {#1} }
{ ! \hook_if_empty_p:n {#1} }
- { \iow_term:x { ~Execution~ order
- \bool_if:NTF \l__hook_tmpa_bool
- { \__hook_if_reversed:nT {#1}
- { ~ (after~ reversal) }
- }
- { ~ (after~
- \__hook_if_reversed:nT {#1} {reversal~ and~}
- applying~ rules)
- }
- :
+ {
+ \__hook_log_line:x
+ {
+ Execution~order
+ \bool_if:NTF \l__hook_tmpa_bool
+ { \__hook_if_reversed:nT {#1} { ~(after~reversal) } }
+ { ~(after~
+ \__hook_if_reversed:nT {#1} { reversal~and~ }
+ applying~rules)
+ } :
+ }
+ #2 % \tl_show:n
+ {
+ \@spaces
+ \clist_if_empty:cTF { g__hook_#1_labels_clist }
+ { --- }
+ { \clist_use:cn {g__hook_#1_labels_clist} { ,~ } }
+ }
+ }
+ {
+ #2
+ {
+ Hook~ \hook_if_exist:nTF {#1}
+ {code~pool~empty} {not~declared}
}
- \iow_term:x
- { \@spaces \clist_use:cn {g__hook_#1_labels_clist} { ,~ } }
}
}
- { \iow_term:n { ~The~hook~is~empty. } }
- \iow_term:n { }
+ { #2 { The~hook~is~empty. } }
}
-\cs_new:Npn \__hook_log_next_code:n #1 {
- \exp_args:No \tl_to_str:n {\use_none:nn #1}
-}
+\cs_new:Npn \__hook_log_next_code:n #1
+ { \exp_args:No \tl_to_str:n { \use_none:nn #1 } }
\cs_new_protected:Npn \__hook_list_rules:nn #1 #2
{
\cs_set_protected:Npn \__hook_tmp:w ##1 ##2 ##3 {#2}
@@ -1671,47 +1754,56 @@ of this package available from CTAN}
\exp_args:No \__hook_tmp:w { \use:nn { ~ } { ~ } }
}
\cs_new_protected:Npn \hook_gput_next_code:nn #1
- {
- \exp_args:Nx \__hook_gput_next_code:nn
- { \__hook_parse_label_default:nn {#1} { top-level } }
- }
+ { \__hook_normalize_hook_args:Nn \__hook_gput_next_code:nn {#1} }
\cs_new_protected:Npn \__hook_gput_next_code:nn #1 #2
{
+ \debug_suspend:
\__hook_declare:n {#1}
\hook_if_exist:nTF {#1}
{ \__hook_gput_next_do:nn {#1} {#2} }
{ \__hook_try_declaring_generic_next_hook:nn {#1} {#2} }
+ \debug_resume:
}
\cs_new_protected:Npn \__hook_gput_next_do:nn #1
{
\exp_args:Nc \__hook_gput_next_do:Nnn
- { g__hook_#1_code_next_tl } {#1}
+ { __hook_next~#1 } {#1}
}
\cs_new_protected:Npn \__hook_gput_next_do:Nnn #1 #2
{
- \tl_if_empty:cT { g__hook_#2_code_tl }
+ \tl_if_empty:cT { __hook~#2 }
{ \__hook_update_hook_code:n {#2} }
\tl_if_empty:NT #1
- { \tl_gset:Nn #1 { \tl_gclear:c { g__hook_#2_code_next_tl } } }
+ { \tl_gset:Nn #1 { \__hook_clear_next:n {#2} } }
\tl_gput_right:Nn #1
}
+\cs_new_protected:Npn \__hook_clear_next:n #1
+ { \cs_gset_eq:cN { __hook_next~#1 } \c_empty_tl }
\cs_new_protected:Npn \hook_use:n #1
{
- \tl_if_exist:cTF { g__hook_#1_code_tl }
+ \tl_if_exist:cTF { __hook~#1 }
{
\__hook_preamble_hook:n {#1}
- \cs:w g__hook_#1_code_tl \cs_end:
+ \cs:w __hook~#1 \cs_end:
}
{ \__hook_use:wn #1 / \s__hook_mark {#1} }
}
\cs_new:Npn \__hook_use_initialized:n #1
{
- \tl_if_exist:cTF { g__hook_#1_code_tl }
- { \cs:w g__hook_#1_code_tl \cs_end: }
- { \__hook_use:wn #1 / \s__hook_mark {#1} }
+ \if_cs_exist:w __hook~#1 \cs_end:
+ \else:
+ \__hook_use_undefined:w
+ \fi:
+ \cs:w __hook~#1 \__hook_use_end:
+ }
+\cs_new:Npn \__hook_use_undefined:w #1 #2 __hook~#3 \__hook_use_end:
+ {
+ #1 % fi
+ \__hook_use:wn #3 / \s__hook_mark {#3}
}
\cs_new_protected:Npn \__hook_preamble_hook:n #1
{ \__hook_initialize_hook_code:n {#1} }
+\cs_new_eq:NN \__hook_use_end: \cs_end:
\cs_new:Npn \__hook_use:wn #1 / #2 \s__hook_mark #3
{
\str_if_eq:nnTF {#1} { file }
@@ -1729,27 +1821,31 @@ of this package available from CTAN}
}
\cs_new_protected:Npn \__hook_if_exist_use:n #1
{
- \tl_if_exist:cT { g__hook_#1_code_tl }
+ \tl_if_exist:cT { __hook~#1 }
{
\__hook_preamble_hook:n {#1}
- \cs:w g__hook_#1_code_tl \cs_end:
+ \cs:w __hook~#1 \cs_end:
}
}
\cs_new_protected:Npn \hook_use_once:n #1
{
- \tl_if_exist:cT { g__hook_#1_code_tl }
+ \tl_if_exist:cT { __hook~#1 }
{
- \clist_gput_left:Nn \g__hook_execute_immediately_clist {#1}
+ \tl_set:Nn \l__hook_return_tl {#1}
+ \__hook_normalize_hook_args:Nn \__hook_use_once_store:n
+ { \l__hook_return_tl }
\hook_use:n {#1}
}
}
+\cs_new_protected:Npn \__hook_use_once_store:n #1
+ { \prop_gput:Nnn \g__hook_execute_immediately_prop {#1} { } }
\prg_new_conditional:Npnn \hook_if_empty:n #1 { p , T , F , TF }
{
\__hook_if_exist:nTF {#1}
{
\bool_lazy_and:nnTF
{ \prop_if_empty_p:c { g__hook_#1_code_prop } }
- { \tl_if_empty_p:c { g__hook_#1_code_next_tl } }
+ { \tl_if_empty_p:c { __hook_next~#1 } }
{ \prg_return_true: }
{ \prg_return_false: }
}
@@ -1757,7 +1853,7 @@ of this package available from CTAN}
}
\prg_new_conditional:Npnn \hook_if_exist:n #1 { p , T , F , TF }
{
- \tl_if_exist:cTF { g__hook_#1_code_tl }
+ \tl_if_exist:cTF { __hook~#1 }
{ \prg_return_true: }
{ \prg_return_false: }
}
@@ -1775,7 +1871,6 @@ of this package available from CTAN}
\prg_return_false:
\fi:
}
-\clist_new:N \g__hook_execute_immediately_clist
\msg_new:nnnn { hooks } { labels-incompatible }
{
Labels~`#1'~and~`#2'~are~incompatible
@@ -1817,11 +1912,7 @@ of this package available from CTAN}
\NewDocumentCommand \NewReversedHook { m }{ \hook_new_reversed:n {#1} }
\NewDocumentCommand \NewMirroredHookPair { mm }{ \hook_new_pair:nn {#1}{#2} }
\NewDocumentCommand \AddToHook { m o +m }
- {
- \clist_if_in:NnTF \g__hook_execute_immediately_clist {#1}
- {#3}
- { \hook_gput_code:nnn {#1} {#2} {#3} }
- }
+ { \hook_gput_code:nnn {#1} {#2} {#3} }
\NewDocumentCommand \AddToHookNext { m +m }
{ \hook_gput_next_code:nn {#1} {#2} }
\NewDocumentCommand \RemoveFromHook { m o }
@@ -1847,9 +1938,10 @@ of this package available from CTAN}
\seq_gpop:NN \g__hook_name_stack_seq \l__hook_return_tl
\__hook_curr_name_push:n {#1}
}
-\newcommand \UseHook { \hook_use:n }
-\newcommand \UseOneTimeHook { \hook_use_once:n }
-\cs_new_protected:Npn \ShowHook { \hook_log:n }
+\cs_new:Npn \UseHook { \hook_use:n }
+\cs_new:Npn \UseOneTimeHook { \hook_use_once:n }
+\cs_new_protected:Npn \ShowHook { \hook_show:n }
+\cs_new_protected:Npn \LogHook { \hook_log:n }
\cs_new_protected:Npn \DebugHooksOn { \hook_debug_on: }
\cs_new_protected:Npn \DebugHooksOff { \hook_debug_off: }
\NewDocumentCommand \DeclareHookRule { m m m m }
@@ -3018,7 +3110,7 @@ of this package available from CTAN}
\edef \@kernel@after@begindocument@before {%
\let\expandafter\noexpand\csname
- g__hook_env/document/begin_code_tl\endcsname
+ __hook env/document/begin\endcsname
\noexpand\@empty}
\let \@kernel@before@begindocument \@empty
\let \@kernel@after@begindocument \@empty
@@ -3956,7 +4048,7 @@ of this package available from CTAN}
%%
%% File: ltfilehook.dtx (C) Copyright 2020 Frank Mittelbach,
%% Phelype Oleinik & LaTeX Team
-%%% From File: ltshipout.dtx
+%%% From File: ltfilehook.dtx
\providecommand\ltfilehookversion{v1.0a}
\providecommand\ltfilehookdate{2020/08/30}
\IncludeInRelease{2020/10/01}%
@@ -4305,8 +4397,8 @@ of this package available from CTAN}
%% File: ltshipout.dtx (C) Copyright 2020 Frank Mittelbach, LaTeX Team
%%
%%% From File: ltshipout.dtx
-\providecommand\ltshipoutversion{v1.0a}
-\providecommand\ltshipoutdate{2020/08/31}
+\providecommand\ltshipoutversion{v1.0b}
+\providecommand\ltshipoutdate{2020/09/09}
\IncludeInRelease{2020/10/01}%
{\shipout}{Hook mangement (shipout)}%
\ExplSyntaxOn
@@ -4554,7 +4646,8 @@ of this package available from CTAN}
\vbox_to_zero:n {
\kern -\c__shipout_vorigin_tl \scan_stop:
\unitlength 1pt \scan_stop:
- \hbox_set_to_wd:Nnn \l__shipout_tmp_box \c_zero_dim { \ignorespaces #1 }
+ \hbox_set_to_wd:Nnn \l__shipout_tmp_box \c_zero_dim
+ { \ignorespaces #1 \hss }
\box_set_ht:Nn \l__shipout_tmp_box \c_zero_dim
\box_set_dp:Nn \l__shipout_tmp_box \c_zero_dim
\box_use:N \l__shipout_tmp_box
@@ -5625,6 +5718,23 @@ of this package available from CTAN}
\let\protected@wlog\@undefined
\EndIncludeInRelease
+\IncludeInRelease{2020/10/01}{\@pass@ptions}
+ {Add file replacement in \@pass@ptions}%
+\def\@pass@ptions#1#2#3{%
+ \edef\reserved@a{\@expl@@@filehook@resolve@file@subst@@w #3.#1\@nil}%
+ \expandafter\xdef\csname opt@\reserved@a\endcsname{%
+ \@ifundefined{opt@\reserved@a}\@empty
+ {\csname opt@\reserved@a\endcsname,}%
+ \zap@space#2 \@empty}}
+\EndIncludeInRelease
+\IncludeInRelease{0000/00/00}{\@pass@ptions}
+ {\@pass@ptions}%
+\def\@pass@ptions#1#2#3{%
+ \expandafter\xdef\csname opt@#3.#1\endcsname{%
+ \@ifundefined{opt@#3.#1}\@empty
+ {\csname opt@#3.#1\endcsname,}%
+ \zap@space#2 \@empty}}
+\EndIncludeInRelease
\IncludeInRelease{2020/10/01}%
{\@process@pti@ns}{Unused options issue}%
\def\@process@pti@ns{%
@@ -5781,6 +5891,13 @@ of this package available from CTAN}
{\@expl@@@filehook@file@push@@
\set@curr@file{\@currname.\@currext}%
\@filehook@set@CurrentFile
+ \edef\@currpkg@reqd{\@currname.\@currext}%
+ \ifx\CurrentFile\CurrentFileUsed
+ \else
+ \filename@parse\@curr@file
+ \edef\@currname{\string@makeletter\filename@base}%
+ \edef\@currext{\string@makeletter\filename@ext}%
+ \fi
\load@onefile@withoptions{#2}%
\@expl@@@filehook@file@pop@@}%
\expandafter\@firstofone
@@ -5798,7 +5915,6 @@ of this package available from CTAN}
\@reset@ptions}
\@onlypreamble\@onefilewithoptions
\let\@unprocessedoptions\@undefined
-
\def\@missing@onefilewithoptions#1{%
\@missingfileerror\@currname\@currext
\xdef\@currname{\@missingfile@area\@missingfile@base}%
@@ -5820,7 +5936,9 @@ of this package available from CTAN}
\UseHook{class/before/\@currname}%
\fi
\fi
- \InputIfFileExists{\@currname.\@currext}{}{}%
+ \InputIfFileExists{\@currpkg@reqd}{}%
+ {\@latex@error
+ {The \@cls@pkg\space\@currpkg@reqd\space failed to load.}\@ehd}%
\expandafter\let\csname unprocessedoptions-\@currname.\@currext\endcsname
\@@unprocessedoptions
\csname\@currname.\@currext-h@@k\endcsname
@@ -5843,7 +5961,7 @@ of this package available from CTAN}
\UseHook{class/after}%
\fi
\fi}%
- \reserved@a}
+ \@ifl@aded\@currext\@currname{}{\reserved@a}}
\EndIncludeInRelease
\IncludeInRelease{0000/00/00}%
{\@onefilewithoptions}{Hooks and unused options issue}%
@@ -10264,6 +10382,8 @@ of this package available from CTAN}
\cs_gset_eq:NN \@expl@cs@prefix@spec@@N \cs_prefix_spec:N
\cs_gset_eq:NN \@expl@cs@argument@spec@@N \cs_argument_spec:N
\cs_gset_eq:NN \@expl@cs@replacement@spec@@N \cs_replacement_spec:N
+\cs_gset_eq:NN \@expl@str@map@function@@NN \str_map_function:NN
+\cs_gset_eq:NN \@expl@char@generate@@nn \char_generate:nn
\EndIncludeInRelease
\IncludeInRelease{0000/00/00}{expl3~2020-10-01}%
{expl3~macros~added~for~the~2020-10-01~release}%
@@ -10272,6 +10392,7 @@ of this package available from CTAN}
\cs_undefine:N \@expl@cs@prefix@spec@@N
\cs_undefine:N \@expl@cs@argument@spec@@N
\cs_undefine:N \@expl@cs@replacement@spec@@N
+\cs_undefine:N \@expl@str@map@function@@NN
\EndIncludeInRelease
\ExplSyntaxOff
%%% From File: ltfinal.dtx
diff --git a/Master/texmf-dist/tex/latex-dev/base/srclfile-ltx.sty b/Master/texmf-dist/tex/latex-dev/base/srclfile-ltx.sty
index 4c07a63305a..3643c55af23 100644
--- a/Master/texmf-dist/tex/latex-dev/base/srclfile-ltx.sty
+++ b/Master/texmf-dist/tex/latex-dev/base/srclfile-ltx.sty
@@ -44,7 +44,7 @@
%%
%% File: ltfilehook.dtx (C) Copyright 2020 Frank Mittelbach,
%% Phelype Oleinik & LaTeX Team
-%%% From File: ltshipout.dtx
+%%% From File: ltfilehook.dtx
\providecommand\ltfilehookversion{v1.0a}
\providecommand\ltfilehookdate{2020/08/30}
\newcommand\BeforeClass[2]
diff --git a/Master/texmf-dist/tex/latex-dev/base/structuredlog.sty b/Master/texmf-dist/tex/latex-dev/base/structuredlog.sty
index 2f625adbbc3..58fc086af8d 100644
--- a/Master/texmf-dist/tex/latex-dev/base/structuredlog.sty
+++ b/Master/texmf-dist/tex/latex-dev/base/structuredlog.sty
@@ -44,7 +44,7 @@
%%
%% File: ltfilehook.dtx (C) Copyright 2020 Frank Mittelbach,
%% Phelype Oleinik & LaTeX Team
-%%% From File: ltshipout.dtx
+%%% From File: ltfilehook.dtx
\providecommand\ltfilehookversion{v1.0a}
\providecommand\ltfilehookdate{2020/08/30}
\ProvidesExplPackage
@@ -62,7 +62,7 @@
( LEVEL ~ \int_use:N \g__filehook_nesting_level_int \c_space_tl #1 ) ~
\CurrentFileUsed
\str_if_eq:NNF \CurrentFileUsed \CurrentFile
- { ~ ( \CurrentFile \space requested ) }
+ { ~ ( \CurrentFile \c_space_tl requested ) }
\iow_newline:
}
\str_if_eq:nnT {#1} {STOP} { \int_gdecr:N \g__filehook_nesting_level_int }