summaryrefslogtreecommitdiff
path: root/macros/latex-dev
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2021-02-27 03:01:43 +0000
committerNorbert Preining <norbert@preining.info>2021-02-27 03:01:43 +0000
commit4e6fb7c03bc033485887a99d2ffeca70ef8c0644 (patch)
tree5a337396041659a71d6da3f68367402d5c4e7dfe /macros/latex-dev
parent8b1159ba65d4003e969141fb034abbdc19e27c4b (diff)
CTAN sync 202102270301
Diffstat (limited to 'macros/latex-dev')
-rw-r--r--macros/latex-dev/base/README.md2
-rw-r--r--macros/latex-dev/base/alltt.dtx23
-rw-r--r--macros/latex-dev/base/alltt.ins4
-rw-r--r--macros/latex-dev/base/alltt.pdfbin172584 -> 214708 bytes
-rw-r--r--macros/latex-dev/base/bugs.txt8
-rw-r--r--macros/latex-dev/base/cfgguide.pdfbin220226 -> 242885 bytes
-rw-r--r--macros/latex-dev/base/cfgguide.tex10
-rw-r--r--macros/latex-dev/base/changes.txt152
-rw-r--r--macros/latex-dev/base/classes.dtx26
-rw-r--r--macros/latex-dev/base/classes.ins4
-rw-r--r--macros/latex-dev/base/classes.pdfbin520832 -> 550002 bytes
-rw-r--r--macros/latex-dev/base/clsguide.pdfbin372576 -> 402778 bytes
-rw-r--r--macros/latex-dev/base/clsguide.tex4
-rw-r--r--macros/latex-dev/base/cmextra.ins4
-rw-r--r--macros/latex-dev/base/cmfonts.fdd2
-rw-r--r--macros/latex-dev/base/cmfonts.ins4
-rw-r--r--macros/latex-dev/base/cmfonts.pdfbin264510 -> 292316 bytes
-rw-r--r--macros/latex-dev/base/cyrguide.pdfbin216995 -> 239679 bytes
-rw-r--r--macros/latex-dev/base/cyrguide.tex6
-rw-r--r--macros/latex-dev/base/doc-v3beta.sty1241
-rw-r--r--macros/latex-dev/base/doc.dtx2
-rw-r--r--macros/latex-dev/base/doc.pdfbin631310 -> 676705 bytes
-rw-r--r--macros/latex-dev/base/docstrip.dtx6
-rw-r--r--macros/latex-dev/base/docstrip.ins4
-rw-r--r--macros/latex-dev/base/docstrip.pdfbin479297 -> 503365 bytes
-rw-r--r--macros/latex-dev/base/ec.ins4
-rw-r--r--macros/latex-dev/base/encguide.pdfbin1532142 -> 1316471 bytes
-rw-r--r--macros/latex-dev/base/encguide.tex8
-rw-r--r--macros/latex-dev/base/exscale.dtx2
-rw-r--r--macros/latex-dev/base/exscale.ins4
-rw-r--r--macros/latex-dev/base/exscale.pdfbin195882 -> 212291 bytes
-rw-r--r--macros/latex-dev/base/fix-cm.dtx2
-rw-r--r--macros/latex-dev/base/fix-cm.ins4
-rw-r--r--macros/latex-dev/base/fix-cm.pdfbin261622 -> 287671 bytes
-rw-r--r--macros/latex-dev/base/fntguide.pdfbin418347 -> 493933 bytes
-rw-r--r--macros/latex-dev/base/fntguide.tex6
-rw-r--r--macros/latex-dev/base/fontdef.dtx6
-rw-r--r--macros/latex-dev/base/format.ins15
-rw-r--r--macros/latex-dev/base/graphpap.dtx2
-rw-r--r--macros/latex-dev/base/graphpap.ins4
-rw-r--r--macros/latex-dev/base/graphpap.pdfbin156276 -> 169321 bytes
-rw-r--r--macros/latex-dev/base/idx.tex2
-rw-r--r--macros/latex-dev/base/ifthen.dtx4
-rw-r--r--macros/latex-dev/base/ifthen.ins4
-rw-r--r--macros/latex-dev/base/ifthen.pdfbin204833 -> 220414 bytes
-rw-r--r--macros/latex-dev/base/inputenc.dtx6
-rw-r--r--macros/latex-dev/base/inputenc.ins4
-rw-r--r--macros/latex-dev/base/inputenc.pdfbin294928 -> 318168 bytes
-rw-r--r--macros/latex-dev/base/lablst.tex2
-rw-r--r--macros/latex-dev/base/latex209.dtx2
-rw-r--r--macros/latex-dev/base/latex209.ins4
-rw-r--r--macros/latex-dev/base/latexchanges.pdfbin247704 -> 468044 bytes
-rw-r--r--macros/latex-dev/base/latexchanges.tex6
-rw-r--r--macros/latex-dev/base/latexrelease.dtx27
-rw-r--r--macros/latex-dev/base/latexrelease.ins5
-rw-r--r--macros/latex-dev/base/latexrelease.pdfbin245786 -> 271510 bytes
-rw-r--r--macros/latex-dev/base/latexsym.dtx2
-rw-r--r--macros/latex-dev/base/latexsym.ins6
-rw-r--r--macros/latex-dev/base/latexsym.pdfbin192295 -> 208358 bytes
-rw-r--r--macros/latex-dev/base/lb2.pdfbin138221 -> 252153 bytes
-rw-r--r--macros/latex-dev/base/legal.txt5
-rw-r--r--macros/latex-dev/base/letter.dtx4
-rw-r--r--macros/latex-dev/base/letter.ins4
-rw-r--r--macros/latex-dev/base/letter.pdfbin307271 -> 328965 bytes
-rw-r--r--macros/latex-dev/base/lgc2.pdfbin101335 -> 215090 bytes
-rw-r--r--macros/latex-dev/base/lppl.pdfbin125830 -> 132372 bytes
-rw-r--r--macros/latex-dev/base/ltalloc.dtx2
-rw-r--r--macros/latex-dev/base/ltbibl.dtx2
-rw-r--r--macros/latex-dev/base/ltboxes.dtx112
-rw-r--r--macros/latex-dev/base/ltclass.dtx148
-rw-r--r--macros/latex-dev/base/ltcmd.dtx4041
-rw-r--r--macros/latex-dev/base/ltcntrl.dtx2
-rw-r--r--macros/latex-dev/base/ltcounts.dtx2
-rw-r--r--macros/latex-dev/base/ltdefns.dtx6
-rw-r--r--macros/latex-dev/base/ltdirchk.dtx12
-rw-r--r--macros/latex-dev/base/lterror.dtx2
-rw-r--r--macros/latex-dev/base/ltexpl.dtx68
-rw-r--r--macros/latex-dev/base/ltfilehook-code.pdfbin747843 -> 785603 bytes
-rw-r--r--macros/latex-dev/base/ltfilehook-doc.pdfbin518920 -> 544026 bytes
-rw-r--r--macros/latex-dev/base/ltfilehook.dtx73
-rw-r--r--macros/latex-dev/base/ltfiles.dtx18
-rw-r--r--macros/latex-dev/base/ltfinal.dtx56
-rw-r--r--macros/latex-dev/base/ltfloat.dtx106
-rw-r--r--macros/latex-dev/base/ltfntcmd.dtx2
-rw-r--r--macros/latex-dev/base/ltfssaxes.dtx10
-rw-r--r--macros/latex-dev/base/ltfssbas.dtx2
-rw-r--r--macros/latex-dev/base/ltfsscmp.dtx2
-rw-r--r--macros/latex-dev/base/ltfssdcl.dtx14
-rw-r--r--macros/latex-dev/base/ltfssini.dtx36
-rw-r--r--macros/latex-dev/base/ltfsstrc.dtx4
-rw-r--r--macros/latex-dev/base/lthooks-code.pdfbin929157 -> 968601 bytes
-rw-r--r--macros/latex-dev/base/lthooks-doc.pdfbin626773 -> 656622 bytes
-rw-r--r--macros/latex-dev/base/lthooks.dtx31
-rw-r--r--macros/latex-dev/base/lthyphen.dtx4
-rw-r--r--macros/latex-dev/base/ltidxglo.dtx2
-rw-r--r--macros/latex-dev/base/ltlength.dtx2
-rw-r--r--macros/latex-dev/base/ltlists.dtx2
-rw-r--r--macros/latex-dev/base/ltlogos.dtx2
-rw-r--r--macros/latex-dev/base/ltluatex.dtx12
-rw-r--r--macros/latex-dev/base/ltluatex.pdfbin305260 -> 325172 bytes
-rw-r--r--macros/latex-dev/base/ltmath.dtx2
-rw-r--r--macros/latex-dev/base/ltmiscen.dtx13
-rw-r--r--macros/latex-dev/base/ltnews.cls6
-rw-r--r--macros/latex-dev/base/ltnews.pdfbin996577 -> 1055081 bytes
-rw-r--r--macros/latex-dev/base/ltnews.tex6
-rw-r--r--macros/latex-dev/base/ltnews01.pdfbin150020 -> 161517 bytes
-rw-r--r--macros/latex-dev/base/ltnews01.tex8
-rw-r--r--macros/latex-dev/base/ltnews02.pdfbin134751 -> 150465 bytes
-rw-r--r--macros/latex-dev/base/ltnews02.tex2
-rw-r--r--macros/latex-dev/base/ltnews03.pdfbin134739 -> 150492 bytes
-rw-r--r--macros/latex-dev/base/ltnews03.tex2
-rw-r--r--macros/latex-dev/base/ltnews04.pdfbin128773 -> 143685 bytes
-rw-r--r--macros/latex-dev/base/ltnews04.tex2
-rw-r--r--macros/latex-dev/base/ltnews05.pdfbin157182 -> 174489 bytes
-rw-r--r--macros/latex-dev/base/ltnews05.tex2
-rw-r--r--macros/latex-dev/base/ltnews06.pdfbin133141 -> 142908 bytes
-rw-r--r--macros/latex-dev/base/ltnews06.tex2
-rw-r--r--macros/latex-dev/base/ltnews07.pdfbin124030 -> 138043 bytes
-rw-r--r--macros/latex-dev/base/ltnews07.tex2
-rw-r--r--macros/latex-dev/base/ltnews08.pdfbin144483 -> 155052 bytes
-rw-r--r--macros/latex-dev/base/ltnews08.tex2
-rw-r--r--macros/latex-dev/base/ltnews09.pdfbin120221 -> 129031 bytes
-rw-r--r--macros/latex-dev/base/ltnews09.tex4
-rw-r--r--macros/latex-dev/base/ltnews10.pdfbin147944 -> 159312 bytes
-rw-r--r--macros/latex-dev/base/ltnews10.tex2
-rw-r--r--macros/latex-dev/base/ltnews11.pdfbin104939 -> 111954 bytes
-rw-r--r--macros/latex-dev/base/ltnews11.tex4
-rw-r--r--macros/latex-dev/base/ltnews12.pdfbin137922 -> 147585 bytes
-rw-r--r--macros/latex-dev/base/ltnews12.tex2
-rw-r--r--macros/latex-dev/base/ltnews13.pdfbin161063 -> 173322 bytes
-rw-r--r--macros/latex-dev/base/ltnews13.tex2
-rw-r--r--macros/latex-dev/base/ltnews14.pdfbin150913 -> 161405 bytes
-rw-r--r--macros/latex-dev/base/ltnews14.tex2
-rw-r--r--macros/latex-dev/base/ltnews15.pdfbin122092 -> 130445 bytes
-rw-r--r--macros/latex-dev/base/ltnews15.tex2
-rw-r--r--macros/latex-dev/base/ltnews16.pdfbin130689 -> 146533 bytes
-rw-r--r--macros/latex-dev/base/ltnews16.tex4
-rw-r--r--macros/latex-dev/base/ltnews17.pdfbin149848 -> 166366 bytes
-rw-r--r--macros/latex-dev/base/ltnews17.tex2
-rw-r--r--macros/latex-dev/base/ltnews18.pdfbin36004 -> 38030 bytes
-rw-r--r--macros/latex-dev/base/ltnews18.tex2
-rw-r--r--macros/latex-dev/base/ltnews19.pdfbin235075 -> 245818 bytes
-rw-r--r--macros/latex-dev/base/ltnews19.tex2
-rw-r--r--macros/latex-dev/base/ltnews20.pdfbin283324 -> 297069 bytes
-rw-r--r--macros/latex-dev/base/ltnews20.tex2
-rw-r--r--macros/latex-dev/base/ltnews21.pdfbin233489 -> 244859 bytes
-rw-r--r--macros/latex-dev/base/ltnews21.tex2
-rw-r--r--macros/latex-dev/base/ltnews22.pdfbin302831 -> 318402 bytes
-rw-r--r--macros/latex-dev/base/ltnews22.tex2
-rw-r--r--macros/latex-dev/base/ltnews23.pdfbin274456 -> 287124 bytes
-rw-r--r--macros/latex-dev/base/ltnews23.tex2
-rw-r--r--macros/latex-dev/base/ltnews24.pdfbin252643 -> 265212 bytes
-rw-r--r--macros/latex-dev/base/ltnews24.tex2
-rw-r--r--macros/latex-dev/base/ltnews25.pdfbin196325 -> 205161 bytes
-rw-r--r--macros/latex-dev/base/ltnews25.tex2
-rw-r--r--macros/latex-dev/base/ltnews26.pdfbin362839 -> 379734 bytes
-rw-r--r--macros/latex-dev/base/ltnews26.tex2
-rw-r--r--macros/latex-dev/base/ltnews27.pdfbin239759 -> 252432 bytes
-rw-r--r--macros/latex-dev/base/ltnews27.tex2
-rw-r--r--macros/latex-dev/base/ltnews28.pdfbin368231 -> 387986 bytes
-rw-r--r--macros/latex-dev/base/ltnews28.tex4
-rw-r--r--macros/latex-dev/base/ltnews29.pdfbin433003 -> 454807 bytes
-rw-r--r--macros/latex-dev/base/ltnews29.tex4
-rw-r--r--macros/latex-dev/base/ltnews30.pdfbin491245 -> 511854 bytes
-rw-r--r--macros/latex-dev/base/ltnews30.tex2
-rw-r--r--macros/latex-dev/base/ltnews31.pdfbin500928 -> 526312 bytes
-rw-r--r--macros/latex-dev/base/ltnews31.tex2
-rw-r--r--macros/latex-dev/base/ltnews32.pdfbin520917 -> 546168 bytes
-rw-r--r--macros/latex-dev/base/ltnews32.tex2
-rw-r--r--macros/latex-dev/base/ltnews33.pdfbin325333 -> 518997 bytes
-rw-r--r--macros/latex-dev/base/ltnews33.tex317
-rw-r--r--macros/latex-dev/base/ltoutenc.dtx89
-rw-r--r--macros/latex-dev/base/ltoutenc.ins4
-rw-r--r--macros/latex-dev/base/ltoutput.dtx4
-rw-r--r--macros/latex-dev/base/ltpage.dtx2
-rw-r--r--macros/latex-dev/base/ltpageno.dtx2
-rw-r--r--macros/latex-dev/base/ltpar.dtx2
-rw-r--r--macros/latex-dev/base/ltpara-code.pdfbin0 -> 614825 bytes
-rw-r--r--macros/latex-dev/base/ltpara-code.tex4
-rw-r--r--macros/latex-dev/base/ltpara-doc.pdfbin0 -> 490887 bytes
-rw-r--r--macros/latex-dev/base/ltpara-doc.tex6
-rw-r--r--macros/latex-dev/base/ltpara.dtx1159
-rw-r--r--macros/latex-dev/base/ltpictur.dtx2
-rw-r--r--macros/latex-dev/base/ltplain.dtx2
-rw-r--r--macros/latex-dev/base/ltsect.dtx2
-rw-r--r--macros/latex-dev/base/ltshipout-code.pdfbin756536 -> 810735 bytes
-rw-r--r--macros/latex-dev/base/ltshipout-doc.pdfbin528458 -> 562262 bytes
-rw-r--r--macros/latex-dev/base/ltshipout.dtx608
-rw-r--r--macros/latex-dev/base/ltspace.dtx2
-rw-r--r--macros/latex-dev/base/lttab.dtx2
-rw-r--r--macros/latex-dev/base/lttextcomp.dtx458
-rw-r--r--macros/latex-dev/base/ltthm.dtx2
-rw-r--r--macros/latex-dev/base/ltvers.dtx30
-rw-r--r--macros/latex-dev/base/ltx3info.pdfbin191531 -> 219353 bytes
-rw-r--r--macros/latex-dev/base/ltx3info.tex2
-rw-r--r--macros/latex-dev/base/ltxcheck.tex4
-rw-r--r--macros/latex-dev/base/ltxdoc.dtx2
-rw-r--r--macros/latex-dev/base/ltxdoc.pdfbin215243 -> 238576 bytes
-rw-r--r--macros/latex-dev/base/ltxguide.cls4
-rw-r--r--macros/latex-dev/base/ltxref.dtx2
-rw-r--r--macros/latex-dev/base/makeindx.dtx4
-rw-r--r--macros/latex-dev/base/makeindx.ins4
-rw-r--r--macros/latex-dev/base/makeindx.pdfbin160668 -> 173683 bytes
-rw-r--r--macros/latex-dev/base/manifest.txt2
-rw-r--r--macros/latex-dev/base/manual.pdfbin151352 -> 160519 bytes
-rw-r--r--macros/latex-dev/base/minimal.cls2
-rw-r--r--macros/latex-dev/base/modguide.pdfbin220389 -> 243601 bytes
-rw-r--r--macros/latex-dev/base/modguide.tex4
-rw-r--r--macros/latex-dev/base/newdc.ins4
-rw-r--r--macros/latex-dev/base/newlfont.dtx2
-rw-r--r--macros/latex-dev/base/nfssfont.dtx2
-rw-r--r--macros/latex-dev/base/nfssfont.ins4
-rw-r--r--macros/latex-dev/base/nfssfont.pdfbin202445 -> 218781 bytes
-rw-r--r--macros/latex-dev/base/olddc.ins4
-rw-r--r--macros/latex-dev/base/oldlfont.dtx2
-rw-r--r--macros/latex-dev/base/preload.dtx2
-rw-r--r--macros/latex-dev/base/proc.dtx6
-rw-r--r--macros/latex-dev/base/proc.ins4
-rw-r--r--macros/latex-dev/base/proc.pdfbin216401 -> 233994 bytes
-rw-r--r--macros/latex-dev/base/slides.dtx4
-rw-r--r--macros/latex-dev/base/slides.ins8
-rw-r--r--macros/latex-dev/base/slides.pdfbin351910 -> 374049 bytes
-rw-r--r--macros/latex-dev/base/slifonts.fdd4
-rw-r--r--macros/latex-dev/base/slifonts.pdfbin214706 -> 234006 bytes
-rw-r--r--macros/latex-dev/base/source2e.pdfbin4392016 -> 4757868 bytes
-rw-r--r--macros/latex-dev/base/source2e.tex4
-rw-r--r--macros/latex-dev/base/source2edoc.cls31
-rw-r--r--macros/latex-dev/base/syntonly.dtx2
-rw-r--r--macros/latex-dev/base/syntonly.ins4
-rw-r--r--macros/latex-dev/base/syntonly.pdfbin181871 -> 197456 bytes
-rw-r--r--macros/latex-dev/base/testpage.tex2
-rw-r--r--macros/latex-dev/base/texpert.txt2
-rw-r--r--macros/latex-dev/base/tlc2.pdfbin164952 -> 289514 bytes
-rw-r--r--macros/latex-dev/base/tulm.fdd6
-rw-r--r--macros/latex-dev/base/tulm.ins4
-rw-r--r--macros/latex-dev/base/tulm.pdfbin156546 -> 170529 bytes
-rw-r--r--macros/latex-dev/base/unpack.ins2
-rw-r--r--macros/latex-dev/base/usrguide.pdfbin399074 -> 430996 bytes
-rw-r--r--macros/latex-dev/base/usrguide.tex8
-rw-r--r--macros/latex-dev/base/usrguide3.pdfbin181816 -> 325379 bytes
-rw-r--r--macros/latex-dev/base/usrguide3.tex6
-rw-r--r--macros/latex-dev/base/utf8ienc.dtx18
-rw-r--r--macros/latex-dev/base/utf8ienc.pdfbin330863 -> 361507 bytes
-rw-r--r--macros/latex-dev/base/webcomp.pdfbin136162 -> 146199 bytes
-rw-r--r--macros/latex-dev/required/tools/README.md2
-rw-r--r--macros/latex-dev/required/tools/afterpage.dtx4
-rw-r--r--macros/latex-dev/required/tools/afterpage.ins8
-rw-r--r--macros/latex-dev/required/tools/afterpage.pdfbin189846 -> 205343 bytes
-rw-r--r--macros/latex-dev/required/tools/array-2016-10-06.sty2
-rw-r--r--macros/latex-dev/required/tools/array-2020-02-10.sty2
-rw-r--r--macros/latex-dev/required/tools/array.dtx61
-rw-r--r--macros/latex-dev/required/tools/array.pdfbin483037 -> 516397 bytes
-rw-r--r--macros/latex-dev/required/tools/bm.dtx4
-rw-r--r--macros/latex-dev/required/tools/bm.ins8
-rw-r--r--macros/latex-dev/required/tools/bm.pdfbin306728 -> 328028 bytes
-rw-r--r--macros/latex-dev/required/tools/calc.dtx6
-rw-r--r--macros/latex-dev/required/tools/calc.pdfbin340889 -> 370412 bytes
-rw-r--r--macros/latex-dev/required/tools/changes.txt28
-rw-r--r--macros/latex-dev/required/tools/dcolumn.dtx4
-rw-r--r--macros/latex-dev/required/tools/dcolumn.pdfbin199218 -> 220688 bytes
-rw-r--r--macros/latex-dev/required/tools/delarray.dtx4
-rw-r--r--macros/latex-dev/required/tools/delarray.pdfbin183426 -> 198646 bytes
-rw-r--r--macros/latex-dev/required/tools/enumerate.dtx4
-rw-r--r--macros/latex-dev/required/tools/enumerate.pdfbin199047 -> 215355 bytes
-rw-r--r--macros/latex-dev/required/tools/fileerr.dtx4
-rw-r--r--macros/latex-dev/required/tools/fileerr.pdfbin179676 -> 195249 bytes
-rw-r--r--macros/latex-dev/required/tools/fontsmpl.dtx4
-rw-r--r--macros/latex-dev/required/tools/fontsmpl.pdfbin138027 -> 154032 bytes
-rw-r--r--macros/latex-dev/required/tools/ftnright.dtx6
-rw-r--r--macros/latex-dev/required/tools/ftnright.pdfbin346513 -> 369962 bytes
-rw-r--r--macros/latex-dev/required/tools/hhline.dtx4
-rw-r--r--macros/latex-dev/required/tools/hhline.pdfbin175673 -> 189538 bytes
-rw-r--r--macros/latex-dev/required/tools/indentfirst.dtx4
-rw-r--r--macros/latex-dev/required/tools/indentfirst.pdfbin144779 -> 157801 bytes
-rw-r--r--macros/latex-dev/required/tools/layout.dtx31
-rw-r--r--macros/latex-dev/required/tools/layout.pdfbin246917 -> 267872 bytes
-rw-r--r--macros/latex-dev/required/tools/longtable-2020-01-07.sty448
-rw-r--r--macros/latex-dev/required/tools/longtable.dtx114
-rw-r--r--macros/latex-dev/required/tools/longtable.ins8
-rw-r--r--macros/latex-dev/required/tools/longtable.pdfbin349888 -> 381665 bytes
-rw-r--r--macros/latex-dev/required/tools/manifest.txt4
-rw-r--r--macros/latex-dev/required/tools/multicol-2017-04-11.sty4
-rw-r--r--macros/latex-dev/required/tools/multicol.dtx2
-rw-r--r--macros/latex-dev/required/tools/multicol.ins8
-rw-r--r--macros/latex-dev/required/tools/multicol.pdfbin490903 -> 516297 bytes
-rw-r--r--macros/latex-dev/required/tools/rawfonts.dtx4
-rw-r--r--macros/latex-dev/required/tools/rawfonts.pdfbin135688 -> 146533 bytes
-rw-r--r--macros/latex-dev/required/tools/shellesc.dtx6
-rw-r--r--macros/latex-dev/required/tools/shellesc.pdfbin169765 -> 183519 bytes
-rw-r--r--macros/latex-dev/required/tools/showkeys.dtx6
-rw-r--r--macros/latex-dev/required/tools/showkeys.pdfbin242771 -> 260623 bytes
-rw-r--r--macros/latex-dev/required/tools/somedefs.dtx4
-rw-r--r--macros/latex-dev/required/tools/somedefs.pdfbin156506 -> 175168 bytes
-rw-r--r--macros/latex-dev/required/tools/tabularx.dtx4
-rw-r--r--macros/latex-dev/required/tools/tabularx.ins8
-rw-r--r--macros/latex-dev/required/tools/tabularx.pdfbin254169 -> 278038 bytes
-rw-r--r--macros/latex-dev/required/tools/theorem.dtx4
-rw-r--r--macros/latex-dev/required/tools/theorem.pdfbin323050 -> 351478 bytes
-rw-r--r--macros/latex-dev/required/tools/tools-overview.pdfbin68285 -> 73673 bytes
-rw-r--r--macros/latex-dev/required/tools/tools-overview.tex6
-rw-r--r--macros/latex-dev/required/tools/tools.ins8
-rw-r--r--macros/latex-dev/required/tools/trace.dtx4
-rw-r--r--macros/latex-dev/required/tools/trace.pdfbin212721 -> 229686 bytes
-rw-r--r--macros/latex-dev/required/tools/varioref-2016-02-16.sty2
-rw-r--r--macros/latex-dev/required/tools/varioref.dtx4
-rw-r--r--macros/latex-dev/required/tools/varioref.ins8
-rw-r--r--macros/latex-dev/required/tools/varioref.pdfbin363007 -> 383481 bytes
-rw-r--r--macros/latex-dev/required/tools/verbatim.dtx4
-rw-r--r--macros/latex-dev/required/tools/verbatim.pdfbin302925 -> 330814 bytes
-rw-r--r--macros/latex-dev/required/tools/xr.dtx4
-rw-r--r--macros/latex-dev/required/tools/xr.pdfbin163607 -> 177595 bytes
-rw-r--r--macros/latex-dev/required/tools/xspace.dtx4
-rw-r--r--macros/latex-dev/required/tools/xspace.pdfbin237978 -> 256896 bytes
313 files changed, 9377 insertions, 871 deletions
diff --git a/macros/latex-dev/base/README.md b/macros/latex-dev/base/README.md
index 670f7eaa07..8087411acb 100644
--- a/macros/latex-dev/base/README.md
+++ b/macros/latex-dev/base/README.md
@@ -1,7 +1,7 @@
The LaTeX kernel
================
-Release 2021-05-01 pre-release 1
+Release 2021-05-01 pre-release 2
Overview
--------
diff --git a/macros/latex-dev/base/alltt.dtx b/macros/latex-dev/base/alltt.dtx
index 0810cd7302..350229ab40 100644
--- a/macros/latex-dev/base/alltt.dtx
+++ b/macros/latex-dev/base/alltt.dtx
@@ -1,7 +1,7 @@
% \iffalse meta-comment
%
% Copyright (C) 1993-2021
-% The LaTeX3 Project and any individual authors listed elsewhere
+% The LaTeX Project and any individual authors listed elsewhere
% in this file.
%
% This file is part of the LaTeX base system.
@@ -30,7 +30,7 @@
%%
%% File `alltt.dtx'.
%% Copyright (C) 1987 by Leslie Lamport
-%% Copyright (C) 1994--2020 LaTeX3 project, Johannes Braams
+%% Copyright (C) 1994-2021 LaTeX Project, Johannes Braams
%% all rights reserved.
%%
%<*dtx>
@@ -40,10 +40,11 @@
%<package>\ProvidesPackage{alltt}
%<driver>\ProvidesFile{alltt.drv}
%\ProvidesFile{alltt.dtx}
- [2020/11/23 v2.0g defines alltt environment]
+ [2021/01/29 v2.0g defines alltt environment]
%
%<*driver>
\documentclass{ltxdoc}
+\usepackage{alltt}
\begin{document}
\providecommand{\Lenv}[1]{\textsf{#1}}
\providecommand{\pkg}[1]{\texttt{#1}}
@@ -55,6 +56,8 @@
%
% \changes{v2.0g}{1997/06/16}{A few documentation fixes (PR 2520)}
% \changes{v2.0d}{1995/04/02}{A few documentation fixes (PR 1517)}
+% \changes{v2.0g}{2021-01-29}{Added a warning about OT1 versus T1 font
+% encoding}
%
% \GetFileInfo{alltt.dtx}
% \title{The \texttt{alltt} environment\thanks{This file
@@ -88,11 +91,19 @@
% extra blank line if you're not careful.
%
% \item Insert a math formula. Note that |$| just produces a dollar
-% sign, so you'll have to type |\(...\)| or |\[...\]|. Also, |^|
-% and |_| just produce their characters; use |\sp| or |\sb| for
-% super- and subscripts, as in |\(x\sp{2}\)|.
+% sign, so you'll have to type |\(...\)| or |\[...\]|. Also, |^|
+% and |_| just produce their characters; use |\sp| or |\sb| for
+% super- and subscripts, as in |\(x\sp{2}\)|.
% \end{itemize}
%
+% \textbf{NB} When you are using \textsf{OT1} encoded fonts you might
+% be surprsied when you switch to italics, becuase those fonts have
+% a different set of glyphs:
+% \begin{alltt}
+% The glyph at the position of the $ in a slanted font: \textsl{$}.
+% The glyph at the position of the $ in an italic font: \textit{$}.
+% \end{alltt}
+%
% \StopEventually{}
%
% \section{The Implementation}
diff --git a/macros/latex-dev/base/alltt.ins b/macros/latex-dev/base/alltt.ins
index 817a00f3a6..7ce2103207 100644
--- a/macros/latex-dev/base/alltt.ins
+++ b/macros/latex-dev/base/alltt.ins
@@ -4,7 +4,7 @@
%% LaTeX or TeX.
%%
%% Copyright (C) 1993-2021
-%% The LaTeX3 Project and any individual authors listed elsewhere
+%% The LaTeX Project and any individual authors listed elsewhere
%% in this file.
%%
%% This file is part of the LaTeX base system.
@@ -49,7 +49,7 @@ reports for it can be opened at https://latex-project.org/bugs.html
Copyright (C) 1993-2021
-The LaTeX3 Project and any individual authors listed elsewhere
+The LaTeX Project and any individual authors listed elsewhere
in this file.
This file was generated from file(s) of the LaTeX base system.
diff --git a/macros/latex-dev/base/alltt.pdf b/macros/latex-dev/base/alltt.pdf
index 3c889b299a..de9abedb7c 100644
--- a/macros/latex-dev/base/alltt.pdf
+++ b/macros/latex-dev/base/alltt.pdf
Binary files differ
diff --git a/macros/latex-dev/base/bugs.txt b/macros/latex-dev/base/bugs.txt
index 8fd071c8a7..bbb78d8c22 100644
--- a/macros/latex-dev/base/bugs.txt
+++ b/macros/latex-dev/base/bugs.txt
@@ -21,7 +21,7 @@ Before you report an error, please check that:
https://www.latex-project.org/bugs.html
* The error is not caused by software other than the core LaTeX
- software that is produced and maintained by the LaTeX3 project
+ software that is produced and maintained by the LaTeX Project
team. Please report problems with other software to the authors
or suppliers of that software, and not to us!
@@ -30,9 +30,9 @@ Before you report an error, please check that:
Also, the test file demonstrating the error should not use any
classes or packages other than those authored and supported by the
- LaTeX3 team. The files for the package or class will tell you how
+ LaTeX Project team. The files for the package or class will tell you how
it is supported. The test file should use the package latexbug to
- check that all packages in the file are supported by the LaTeX3
+ check that all packages in the file are supported by the LaTeX
Project (see the discussion on the website why this is important).
* The error is not caused by using an obsolete version of any file or
@@ -85,4 +85,4 @@ given in that corresponding errata file.
Please *do not* send such reports to the latex-bugs address.
---- Copyright 1997,1998,2006,2008,2017,2020 the LaTeX3 project. All rights reserved ---
+--- Copyright (C) 1997-2021 the LaTeX Project. All rights reserved ---
diff --git a/macros/latex-dev/base/cfgguide.pdf b/macros/latex-dev/base/cfgguide.pdf
index 8171183a8e..d5c5c2ee72 100644
--- a/macros/latex-dev/base/cfgguide.pdf
+++ b/macros/latex-dev/base/cfgguide.pdf
Binary files differ
diff --git a/macros/latex-dev/base/cfgguide.tex b/macros/latex-dev/base/cfgguide.tex
index 048f4f4ef5..66c02e4c33 100644
--- a/macros/latex-dev/base/cfgguide.tex
+++ b/macros/latex-dev/base/cfgguide.tex
@@ -1,7 +1,7 @@
% \iffalse meta-comment
%
% Copyright (C) 1993-2021
-% The LaTeX3 Project and any individual authors listed elsewhere
+% The LaTeX Project and any individual authors listed elsewhere
% in this file.
%
% This file is part of the LaTeX base system.
@@ -39,7 +39,7 @@
\title{Configuration options for \LaTeXe}
-\author{\copyright~Copyright 1998, 2001, 2003 \LaTeX3 Project Team.\\
+\author{\copyright~Copyright 1998, 2001, 2003 \LaTeX\ Project Team.\\
All rights reserved.}
\date{14 February 2003}
@@ -146,7 +146,7 @@ configuration files has the following consequences.
portable only in the sense of being processable at a different
site---the actual formatting will not be the same if different
fonts are used.
- \item The \LaTeX3 project team will not be able to support you in
+ \item The \LaTeX\ Project team will not be able to support you in
diagnosing problems if these cannot be reproduced with a format
that does not use any configuration files.
\end{itemize}
@@ -288,7 +288,7 @@ following consequences.
portable only in the sense of being processable at a different
site---the actual formatting will not be the same if different
fonts are used.
- \item The \LaTeX3 project team will not be able to support you in
+ \item The \LaTeX\ Project team will not be able to support you in
diagnosing problems if these cannot be reproduced with a format
that does not use any customised font definition files.
\end{itemize}
@@ -370,7 +370,7 @@ consequences.
\item Documents are portable only in the sense of being processable
at a different site---the actual formatting will not be the same
if different fonts are used.
- \item The \LaTeX3 project team will not be able to support you in
+ \item The \LaTeX\ Project team will not be able to support you in
diagnosing problems if these cannot be reproduced with a format
that does not use this configuration file.
\end{itemize}
diff --git a/macros/latex-dev/base/changes.txt b/macros/latex-dev/base/changes.txt
index bdb299ae3c..e9d856a364 100644
--- a/macros/latex-dev/base/changes.txt
+++ b/macros/latex-dev/base/changes.txt
@@ -6,6 +6,154 @@ completeness or accuracy and it contains some references to files that
are not part of the distribution.
================================================================================
+2021-02-25 Marcel Krüger <Marcel.Krueger@latex-project.org>
+
+ * ltfinal.dtx:
+ Improve speed of compatibility code for preloading \pdfglyphtounicode
+ into \everyjob
+
+2021-02-19 Frank Mittelbach <Frank.Mittelbach@latex-project.org>
+
+ * ltoutenc.dtx (subsection{Definitions for the TU encoding}):
+ Add \textnonbreakinghyphen, \textfiguredash and \texthorizontalbar
+ to OT1, T1 and TU encoding (gh/404)
+
+ * doc-v3beta.sty: File added, currently for internal documentation
+ to be replaced in a later release.
+
+2021-02-18 Frank Mittelbach <Frank.Mittelbach@latex-project.org>
+
+ * ltclass.dtx: save raw package/class option lists to improve
+ key/val usage in optional argument of \usepackage and
+ \documentclass.
+
+2021-02-17 Frank Mittelbach <Frank.Mittelbach@latex-project.org>
+
+ * ltoutenc.dtx (subsection{Definitions for the TS1 encoding}):
+ Special definition for \textasteriskcentered when missing in TS1 (gh/502)
+
+ * ltoutenc.dtx (subsection{Definitions for the TU encoding}):
+ Adjust values for \textasteriskcentered To match TS1 definition (gh/502)
+
+2021-02-16 Frank Mittelbach <Frank.Mittelbach@latex-project.org>
+
+ * ltpara.dtx: providing paragraph hooks,; full integration into
+ latex.ltx will happen at a later point in time. For documentation
+ see ltpara-doc.pdf.
+
+2021-02-16 Frank Mittelbach <Frank.Mittelbach@latex-project.org>
+
+ * ltfloat.dtx (subsection{Footnotes}):
+ \footref added
+
+2021-02-15 David Carlisle <David.Carlisle@latex-project.org>
+
+ * ltfssdcl.dtx: two additional \expandafter to avoid infinite
+ loop on not in math error. (gh/501)
+
+2021-02-11 Frank Mittelbach <Frank.Mittelbach@latex-project.org>
+
+ * classes.dtx (subsubsection{Itemize}):
+ Drop incorrect space in \labelitemiv (gh/496)
+ Document use of \labelitemfont in ltnews33 (gh/497)
+
+2021-02-10 Frank Mittelbach <Frank.Mittelbach@latex-project.org>
+
+ * ltoutenc.dtx (subsection{Definitions for the TU encoding}):
+ Add \textnonbreakinghyphen}, \textfiguredash and
+ \texthorizontalbar (gh/404)
+
+2021-02-10 Frank Mittelbach <Frank.Mittelbach@latex-project.org>
+
+ * ltboxes.dtx (section{\LaTeX\ Box commands}):
+ Explicitly run \par at the end of footnote text in preparation
+ for paragraph hooks
+
+ * ltfloat.dtx (subsection{Footnotes}):
+ Explicitly run \par at the end of footnote text in preparation
+ for paragraph hooks
+
+2021-02-08 Frank Mittelbach <Frank.Mittelbach@latex-project.org>
+
+ * ltfilehook.dtx (subsection{Patching \LaTeX{}'s \InputIfFileExists command}):
+ Undo the internal for robust \InputIfFileExists in rollback (gh/494)
+
+2021-02-08 Frank Mittelbach <Frank.Mittelbach@latex-project.org>
+
+ * ltmiscen.dtx (subsection{Environments}):
+ Undo the internals for \begin and \end as well when
+ rolling back (gh/494)
+
+2021-02-04 Frank Mittelbach <Frank.Mittelbach@latex-project.org>
+
+ * ltboxes.dtx (section{\LaTeX\ Box commands}):
+ Always add the color groups (gh/488)
+
+2021-02-03 Frank Mittelbach <Frank.Mittelbach@latex-project.org>
+
+ * ltfloat.dtx (subsection{Floating Environments}):
+ Explicitly end the \marginpar argument with \par to support
+ tagging (gh/489)
+
+2021-01-31 David Carlisle <David.Carlisle@latex-project.org>
+
+ * ltfilehook.dtx: set \protect to \string to avoid bad
+ expansion and possible non termination. github/481
+
+2021-01-27 Frank Mittelbach <Frank.Mittelbach@latex-project.org>
+
+ * utf8ienc.dtx (subsection{The mapping table}):
+ Support various Unicode characters with dot accents for
+ Indic transliterations (gh/484)
+
+2021-01-22 Marcel Krüger <Marcel.Krueger@latex-project.org>
+
+ * ltshipout.dtx:
+ Define and call Lua callback pre_shipout_filter.
+
+2021-01-21 Marcel Krüger <Marcel.Krueger@latex-project.org>
+
+ * ltfinal.dtx:
+ For pdfTeX enable automatic generation of ToUnicode maps.
+ For pdfTeX versions which do not support dumping these into the format,
+ all \pdfglyphtounicode instructions will be dumped into \everyjob
+
+2021-01-19 Frank Mittelbach <Frank.Mittelbach@latex-project.org>
+
+ * ltshipout.dtx: Reordered execution of shipout hooks so that code
+ in one can influence code in later ones in a more natural manner.
+
+2020-01-16 Joseph Wright <Joseph.Wright@latex-project.org>
+
+ * ltexpl.dtx
+ Adjust for full xparse integration
+
+ * ltcmd.dtx
+ New file to replace loading xparse
+
+2021-01-12 Frank Mittelbach <Frank.Mittelbach@latex-project.org>
+
+ * ltshipout.dtx: Make sure that the shipout/firstpage hook material
+ is not stored inside \ShipoutBox, in case that gets reused, e.g. via
+ \RawShipout but is only ever added to the very first page shipped out.
+
+2021-01-10 Frank Mittelbach <Frank.Mittelbach@latex-project.org>
+
+ * ltshipout.dtx:
+ Added internal \@kernel@after@shipout@background hook.
+ Added public shipout/after hook
+
+ (subsection{Overloading the \shipout primitive}):
+ Add \RawShipout for shipping out while bypassing most hooks.
+
+ (subsection{Emulating atbegshi}): Added
+ \AtBeginShipoutOriginalShipout to the emulation of atbegshi.
+
+2021-01-08 Frank Mittelbach <Frank.Mittelbach@latex-project.org>
+
+ * ltshipout.dtx (subsection{Package \pkg{everyshi} emulation}):
+ The emulation is no longer needed so taken out (gh440)
+
2020-12-22 Frank Mittelbach <Frank.Mittelbach@latex-project.org>
* ltfssaxes.dtx (subsection{Changing to a new series}):
@@ -110,8 +258,8 @@ All changes above are only part of the development branch for the next release.
2020-12-03 Joseph Wright <Joseph.Wright@latex-project.org>
- * usrguide3.tex
- New file to cover creation of document commands
+ * usrguide3.tex
+ New file to cover creation of document commands
#########################
diff --git a/macros/latex-dev/base/classes.dtx b/macros/latex-dev/base/classes.dtx
index c91b338143..ffe04c620f 100644
--- a/macros/latex-dev/base/classes.dtx
+++ b/macros/latex-dev/base/classes.dtx
@@ -1,7 +1,7 @@
% \iffalse meta-comment
%
% Copyright (C) 1993-2021
-% The LaTeX3 Project and any individual authors listed elsewhere
+% The LaTeX Project and any individual authors listed elsewhere
% in this file.
%
% This file is part of the LaTeX base system.
@@ -53,7 +53,7 @@
%<*driver>
\ProvidesFile{classes.drv}
%</driver>
- [2020/11/23 v1.4m
+ [2021/02/12 v1.4n
%<article|report|book> Standard LaTeX document class]
%<10pt|11pt|12pt> Standard LaTeX file (size option)]
% \end{macrocode}
@@ -221,9 +221,9 @@
% file has version number \fileversion, last revised \filedate.}}
%
% \author{%
-% Copyright (C) 1992 by Leslie Lamport \and
-% Copyright (C) 1994-2020 by Frank Mittelbach \and Johannes Braams \and
-% \LaTeX3 Project Team
+% Copyright (C) 1992 by Leslie Lamport and
+% Copyright (C) 1994-2020 by Frank Mittelbach and Johannes Braams and
+% LaTeX Project Team
% }
% \date{\filedate}
% \MaintainedByLaTeXTeam{latex}
@@ -2953,11 +2953,12 @@
% the labels of the various itemization levels: the symbols used are
% bullet, bold en-dash, centered asterisk and centred dot.
%
+% \changes{v1.4n}{2021/06/11}{Drop incorrect space in \cs{labelitemiv} (gh/496)}
% \begin{macrocode}
\newcommand\labelitemi {\labelitemfont \textbullet}
\newcommand\labelitemii {\labelitemfont \bfseries \textendash}
\newcommand\labelitemiii{\labelitemfont \textasteriskcentered}
-\newcommand\labelitemiv{ \labelitemfont \textperiodcentered}
+\newcommand\labelitemiv {\labelitemfont \textperiodcentered}
% \end{macrocode}
%
% \begin{macro}{\labelitemfont}
@@ -2966,13 +2967,16 @@
% produced regardless of surrounding conditions.
%
% \changes{v1.4l}{2019/12/20}{Normalize label fonts}
-% A possible alternative would be
+% Possible alternatives would be, for example,
%\begin{verbatim}
-%\renewcommand\labelitemfont{%
-% \fontseries\seriesdefault
-% \fontshape\shapedefault\selectfont}
+% \renewcommand\labelitemfont
+% {\normalfont\fontfamily{lmss}\selectfont}
+% \renewcommand\labelitemfont
+% {\rmfamily\normalshape}
%\end{verbatim}
-% which resets series and shape doesn't touch the family.
+% the first would use symbols from Latin Modern Sans, the second
+% would only allow changes in the font series so that an
+% \texttt{itemize} in a bold context would produce bolder symbols.
% \begin{macrocode}
\newcommand\labelitemfont{\normalfont}
% \end{macrocode}
diff --git a/macros/latex-dev/base/classes.ins b/macros/latex-dev/base/classes.ins
index b3f3e19fc4..be0dcaf8ff 100644
--- a/macros/latex-dev/base/classes.ins
+++ b/macros/latex-dev/base/classes.ins
@@ -4,7 +4,7 @@
%% LaTeX or TeX.
%%
%% Copyright (C) 1993-2021
-%% The LaTeX3 Project and any individual authors listed elsewhere
+%% The LaTeX Project and any individual authors listed elsewhere
%% in this file.
%%
%% This file is part of the LaTeX base system.
@@ -49,7 +49,7 @@ reports for it can be opened at https://latex-project.org/bugs.html
Copyright (C) 1993-2021
-The LaTeX3 Project and any individual authors listed elsewhere
+The LaTeX Project and any individual authors listed elsewhere
in this file.
This file was generated from file(s) of the LaTeX base system.
diff --git a/macros/latex-dev/base/classes.pdf b/macros/latex-dev/base/classes.pdf
index 7c2a8a111c..01527318fe 100644
--- a/macros/latex-dev/base/classes.pdf
+++ b/macros/latex-dev/base/classes.pdf
Binary files differ
diff --git a/macros/latex-dev/base/clsguide.pdf b/macros/latex-dev/base/clsguide.pdf
index bf272bfaae..c4c4cad12d 100644
--- a/macros/latex-dev/base/clsguide.pdf
+++ b/macros/latex-dev/base/clsguide.pdf
Binary files differ
diff --git a/macros/latex-dev/base/clsguide.tex b/macros/latex-dev/base/clsguide.tex
index 57f4b2fd79..3667210e5f 100644
--- a/macros/latex-dev/base/clsguide.tex
+++ b/macros/latex-dev/base/clsguide.tex
@@ -1,7 +1,7 @@
% \iffalse meta-comment
%
% Copyright (C) 1993-2021
-% The LaTeX3 Project and any individual authors listed elsewhere
+% The LaTeX Project and any individual authors listed elsewhere
% in this file.
%
% This file is part of the LaTeX base system.
@@ -34,7 +34,7 @@
\title{\LaTeXe~for class and package writers}
-\author{Copyright \copyright~1995--2006 The \LaTeX3 Project\\
+\author{Copyright \copyright~1995--2006 The \LaTeX\ Project\\
All rights reserved}
\date{15 February 2006}
diff --git a/macros/latex-dev/base/cmextra.ins b/macros/latex-dev/base/cmextra.ins
index f96b04221a..c530e04d0b 100644
--- a/macros/latex-dev/base/cmextra.ins
+++ b/macros/latex-dev/base/cmextra.ins
@@ -4,7 +4,7 @@
%% LaTeX or TeX.
%%
%% Copyright (C) 1993-2021
-%% The LaTeX3 Project and any individual authors listed elsewhere
+%% The LaTeX Project and any individual authors listed elsewhere
%% in this file.
%%
%% This file is part of the LaTeX base system.
@@ -49,7 +49,7 @@ reports for it can be opened at https://latex-project.org/bugs.html
Copyright (C) 1993-2021
-The LaTeX3 Project and any individual authors listed elsewhere
+The LaTeX Project and any individual authors listed elsewhere
in this file.
This file was generated from file(s) of the LaTeX base system.
diff --git a/macros/latex-dev/base/cmfonts.fdd b/macros/latex-dev/base/cmfonts.fdd
index 1eb318b049..f991ee564e 100644
--- a/macros/latex-dev/base/cmfonts.fdd
+++ b/macros/latex-dev/base/cmfonts.fdd
@@ -1,7 +1,7 @@
% \iffalse meta-comment
%
% Copyright 1993-2019
-% The LaTeX3 Project and any individual authors listed elsewhere
+% The LaTeX Project and any individual authors listed elsewhere
% in this file.
%
% This file is part of the LaTeX base system.
diff --git a/macros/latex-dev/base/cmfonts.ins b/macros/latex-dev/base/cmfonts.ins
index 430abdd5f9..d54a325f42 100644
--- a/macros/latex-dev/base/cmfonts.ins
+++ b/macros/latex-dev/base/cmfonts.ins
@@ -4,7 +4,7 @@
%% LaTeX or TeX.
%%
%% Copyright (C) 1993-2021
-%% The LaTeX3 Project and any individual authors listed elsewhere
+%% The LaTeX Project and any individual authors listed elsewhere
%% in this file.
%%
%% This file is part of the LaTeX base system.
@@ -49,7 +49,7 @@ reports for it can be opened at https://latex-project.org/bugs.html
Copyright (C) 1993-2021
-The LaTeX3 Project and any individual authors listed elsewhere
+The LaTeX Project and any individual authors listed elsewhere
in this file.
This file was generated from file(s) of the LaTeX base system.
diff --git a/macros/latex-dev/base/cmfonts.pdf b/macros/latex-dev/base/cmfonts.pdf
index 7ca9515508..9a9131d46c 100644
--- a/macros/latex-dev/base/cmfonts.pdf
+++ b/macros/latex-dev/base/cmfonts.pdf
Binary files differ
diff --git a/macros/latex-dev/base/cyrguide.pdf b/macros/latex-dev/base/cyrguide.pdf
index 6ff9220063..38b01ca8d0 100644
--- a/macros/latex-dev/base/cyrguide.pdf
+++ b/macros/latex-dev/base/cyrguide.pdf
Binary files differ
diff --git a/macros/latex-dev/base/cyrguide.tex b/macros/latex-dev/base/cyrguide.tex
index 89c5a56b7f..07d4bc0b3f 100644
--- a/macros/latex-dev/base/cyrguide.tex
+++ b/macros/latex-dev/base/cyrguide.tex
@@ -1,7 +1,7 @@
% \iffalse meta-comment
%
% Copyright (C) 1993-2021
-% The LaTeX3 Project and any individual authors listed elsewhere
+% The LaTeX Project and any individual authors listed elsewhere
% in this file.
%
% This file is part of the LaTeX base system.
@@ -33,7 +33,7 @@
\title{Cyrillic languages support in \LaTeX}
\author{\copyright~Copyright 1998--1999,\\ Vladimir Volovich,
- Werner Lemberg and \LaTeX3 Project Team.\\ All rights reserved.}
+ Werner Lemberg and \LaTeX\ Project Team.\\ All rights reserved.}
\date{12 March 1999}
@@ -381,7 +381,7 @@ font encoding definition files, then you could try using the
experimental \textsf{mathtext} package, which is also in the
\textsf{T2}~bundle. Note that this package uses up at least one
additional math alphabet per font encoding. For this and other
-reasons, The \LaTeX3 Project Team considers that this experimental
+reasons, The \LaTeX\ Project Team considers that this experimental
extension to \LaTeX{}'s glyph-handling mechanisms should be used with
caution; but please try it out and send us your opinions and ideas.
Note that it is not included in the core of \LaTeX{} because both the
diff --git a/macros/latex-dev/base/doc-v3beta.sty b/macros/latex-dev/base/doc-v3beta.sty
new file mode 100644
index 0000000000..eeac71568c
--- /dev/null
+++ b/macros/latex-dev/base/doc-v3beta.sty
@@ -0,0 +1,1241 @@
+%%
+%% This is file `doc-v3beta.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% doc.dtx (with options: `package,beta')
+%%
+%% This is a generated file.
+%%
+%% The source is maintained by the LaTeX Project team and bug
+%% reports for it can be opened at https://latex-project.org/bugs.html
+%% (but please observe conditions on bug reports sent to that address!)
+%%
+%%
+%% Copyright 1993-2018
+%% The LaTeX3 Project and any individual authors listed elsewhere
+%% in this file.
+%%
+%% This file was generated from file(s) of the LaTeX base system.
+%% --------------------------------------------------------------
+%%
+%% It may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3c
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%% https://www.latex-project.org/lppl.txt
+%% and version 1.3c or later is part of all distributions of LaTeX
+%% version 2005/12/01 or later.
+%%
+%% This file has the LPPL maintenance status "maintained".
+%%
+%% This file may only be distributed together with a copy of the LaTeX
+%% base system. You may however distribute the LaTeX base system without
+%% such generated files.
+%%
+%% The list of all files belonging to the LaTeX base distribution is
+%% given in the file `manifest.txt'. See also `legal.txt' for additional
+%% information.
+%%
+%% The list of derived (unpacked) files belonging to the distribution
+%% and covered by LPPL is defined by the unpacking scripts (with
+%% extension .ins) which are part of the distribution.
+\NeedsTeXFormat{LaTeX2e}[1994/12/01]
+
+\providecommand\DeclareRelease[3]{}
+\providecommand\DeclareCurrentRelease[2]{}
+
+\DeclareRelease{v2}{2016-02-15.sty}
+ {doc-2016-02-15.sty}
+\DeclareCurrentRelease{v3}{2018-04-16}
+
+\ProvidesPackage{doc-v3beta}
+ [2021/02/07 v3.0e
+ Standard LaTeX documentation package V3 (FMi)]
+%%
+%% Package `doc' to use with LaTeX 2e
+%% Copyright (C) 1989-2018 Frank Mittelbach, all rights reserved.
+
+
+
+
+
+\@ifundefined{macro@cnt}{}{\endinput}
+\catcode`\^^A=14
+\AtBeginDocument{\catcode`\^^A=14\relax}
+\RequirePackage{kvoptions}
+\SetupKeyvalOptions{family=doc,prefix=doc@}
+\DeclareBoolOption{noprint}
+\DeclareBoolOption{noindex}
+\DeclareBoolOption[true]{hyperref}
+\DeclareBoolOption[true]{multicol}
+\DeclareBoolOption[false]{debugshow}
+\DeclareBoolOption[true]{toplevel}
+\DeclareComplementaryOption{notoplevel}{toplevel}
+\DeclareBoolOption{macrolike}
+\DeclareComplementaryOption{envlike}{macrolike}
+\DeclareStringOption{idxtype}
+\DeclareStringOption{idxgroup}
+\DeclareStringOption{printtype}
+\DeclareBoolOption[false]{outer}
+\ProcessKeyvalOptions*
+\newif\ifscan@allowed \scan@allowedtrue
+\def\SetupDoc#1{%
+ \setkeys{doc}{#1}%
+ \edef\doc@noprintdefault{\ifdoc@noprint true\else false\fi}%
+ \ifdoc@noindex
+ \def\doc@noindexdefault{true}%
+ \scan@allowedfalse
+ \else
+ \def\doc@noindexdefault{false}%
+ \fi
+}
+\SetupDoc{} % just save the default values
+\def\macrocode{\macro@code
+ \frenchspacing \@vobeyspaces
+ \xmacro@code}
+\def\macro@code{%
+ \topsep \MacrocodeTopsep
+ \@beginparpenalty \predisplaypenalty
+ \if@inlabel\leavevmode\fi
+ \trivlist \parskip \z@ \item[]%
+ \macro@font
+ \leftskip\@totalleftmargin \advance\leftskip\MacroIndent
+ \rightskip\z@ \parindent\z@ \parfillskip\@flushglue
+ \blank@linefalse \def\par{\ifblank@line
+ \leavevmode\fi
+ \blank@linetrue\@@par
+ \penalty\interlinepenalty}
+ \obeylines
+ \let\do\do@noligs \verbatim@nolig@list
+ \let\do\@makeother \dospecials
+ \global\@newlistfalse
+ \global\@minipagefalse
+ \ifcodeline@index
+ \everypar{\global\advance\c@CodelineNo\@ne
+ \llap{\theCodelineNo\ \hskip\@totalleftmargin}%
+ \check@module}%
+ \else \everypar{\check@module}%
+ \fi
+ \init@crossref}
+\newif\ifblank@line
+\def\endmacrocode{%
+ \ifpm@module \endgroup \pm@modulefalse \fi
+ \everypar{}%
+ \global\@inlabelfalse
+ \endtrivlist
+ \close@crossref}
+\@ifundefined{MacroFont}{%
+ \if@compatibility
+ \def\MacroFont{\small
+ \usefont\encodingdefault
+ \ttdefault
+ \mddefault
+ \updefault
+ }%
+ \else
+ \def\MacroFont{\fontencoding\encodingdefault
+ \fontfamily\ttdefault
+ \fontseries\mddefault
+ \fontshape\updefault
+ \small}%
+ \fi
+ }{}
+\@ifundefined{AltMacroFont}{%
+ \if@compatibility
+ \def\AltMacroFont{\small
+ \usefont\encodingdefault
+ \ttdefault
+ \mddefault
+ \sldefault
+ }%
+ \else
+ \def\AltMacroFont{\fontencoding\encodingdefault
+ \fontfamily\ttdefault
+ \fontseries\mddefault
+ \fontshape\sldefault
+ \small
+ }%
+ \fi
+ }{}
+\AtBeginDocument{\let\macro@font\MacroFont}
+\def\check@module{%
+ \ifcheck@modules
+ \ifpm@module \endgroup \pm@modulefalse \fi
+ \expandafter\futurelet\expandafter\next\expandafter\ch@percent
+ \fi}
+\newif\ifpm@module
+\def\DontCheckModules{\check@modulesfalse}
+\def\CheckModules{\check@modulestrue}
+\newif\ifcheck@modules \check@modulestrue
+\def\ch@percent{%
+ \if \percentchar\next
+ \expandafter\check@angle
+ \fi}
+\def\check@angle#1{\futurelet\next\ch@angle}
+\begingroup
+\catcode`\<\active
+\gdef\ch@angle{\ifx<\next
+ \expandafter\ch@plus@etc
+ \else \percentchar \fi}
+\gdef\ch@plus@etc<{\futurelet\next\check@plus@etc}
+\gdef\check@plus@etc{%
+ \if +\next
+ \let\next\pm@module
+ \else\if -\next
+ \let\next\pm@module
+ \else\if *\next
+ \let\next\star@module
+ \else\if /\next
+ \let\next\slash@module
+ \else\ifx <\next
+ \percentchar
+ \else
+ \let\next\pm@module
+ \fi\fi\fi\fi\fi
+ \next}
+\endgroup
+\begingroup
+\catcode`\~=\active
+\lccode`\~=`\>
+\lowercase{\gdef\pm@module#1~}{\pm@moduletrue
+ \Module{#1}\begingroup
+ \advance\guard@level\@ne
+ \ifnum\guard@level>\c@StandardModuleDepth\AltMacroFont\fi
+}
+\lowercase{\gdef\star@module#1~}{%
+ \Module{#1}%
+ \global \advance \guard@level\@ne
+ \ifnum \guard@level>\c@StandardModuleDepth
+ \global\let\macro@font=\AltMacroFont \macro@font
+ \fi}
+\catcode`\>=\active
+\gdef\slash@module#1>{%
+ \Module{#1}%
+ \global \advance \guard@level\m@ne
+ \ifnum \guard@level=\c@StandardModuleDepth
+ \global\let\macro@font\MacroFont \macro@font
+ \fi
+}
+\endgroup
+\newcounter{StandardModuleDepth}
+\newcount \guard@level
+
+\@ifundefined{Module}{%
+ \def\Module#1{\mod@math@codes$\langle\mathsf{#1}\rangle$}
+ }{}
+\def\mod@math@codes{\mathcode`\|="226A \mathcode`\&="2026
+ \mathcode`\-="702D \mathcode`\+="702B
+ \mathcode`\:="703A \mathcode`\=="703D }
+\newskip\MacrocodeTopsep \MacrocodeTopsep = 3pt plus 1.2pt minus 1pt
+\newdimen\MacroIndent
+\settowidth\MacroIndent{\rmfamily\scriptsize 00\ }
+\@namedef{macrocode*}{\macro@code\sxmacro@code}
+\expandafter\let\csname endmacrocode*\endcsname = \endmacrocode
+\catcode`\!=\catcode`\% ^^A In this section there must not be
+ ^^A any exclamation marks.
+ ^^A
+\begingroup
+\catcode`\|=\z@ \catcode`\[=\@ne \catcode`\]=\tw@
+\catcode`\{=12 \catcode`\}=12
+\catcode`\%=12 \catcode`\ =\active \catcode`\\=\active
+!% \end{macrocode*}
+! Next follows the actual definition of |\macro@code|;
+! notice the
+! use of the new escape character. We manage to get the argument
+! surrounded by the string |\end{macrocode}|, but at the end
+! however, in spite of the actual characters used during the
+! definition of
+! this macro, |\end| with the argument |{macrocode}|
+! will be executed, to ensure a balanced environment.
+! \begin{macrocode*}
+|gdef|xmacro@code#1% \end{macrocode}[#1|end[macrocode]]
+!% \end{macrocode*}
+! \begin{macro}{\sxmacro@code}
+! The definition of |\sxmacro@code| is completely analogous,
+! only
+! here a slightly different terminating string will be used.
+! Note that the space is not active in this environment.
+! \begin{macrocode}
+|catcode`| =12
+|gdef|sxmacro@code#1% \end{macrocode*}[#1|end[macrocode*]]
+!% \end{macrocode}
+! because the |\catcode| changes have been made local by
+! commencing a
+! new group, there now follows the matching |\endgroup|
+! in a rather
+! unusual style of writing.
+! \begin{macrocode}
+|endgroup
+!% \end{macrocode}
+\catcode`\!=12
+
+\reversemarginpar
+\setlength\marginparpush{0pt} \setlength\marginparwidth{8pc}
+\setlength\marginparsep{\labelsep}
+{\catcode`\|=\z@ \catcode`\\=12
+|gdef|bslash{\}}
+\def\verbatim{\@beginparpenalty \predisplaypenalty \@verbatim
+ \MacroFont \frenchspacing \@vobeyspaces \@xverbatim}
+\@namedef{verbatim*}{\@beginparpenalty \predisplaypenalty \@verbatim
+ \MacroFont \@sxverbatim}
+\def\@verbatim{\trivlist \item[]\if@minipage\else\vskip\parskip\fi
+ \leftskip\@totalleftmargin\rightskip\z@
+ \parindent\z@\parfillskip\@flushglue\parskip\z@
+ \@@par
+ \@tempswafalse
+ \def\par{\if@tempswa\hbox{}\fi\@tempswatrue\@@par
+ \penalty\interlinepenalty
+ \check@percent}%
+ \obeylines
+ \let\do\do@noligs \verbatim@nolig@list
+ \let\do\@makeother \dospecials}
+{\catcode`\%=12
+ \long\gdef\check@percent#1{\ifx #1%\let\next\@empty \else
+ \let\next=#1\fi \next}}
+\def\verb{\relax\ifmmode\hbox\else\leavevmode\null\fi
+ \bgroup \let\do\do@noligs \verbatim@nolig@list
+ \ttfamily \verb@eol@error \let\do\@makeother \dospecials
+ \@ifstar{\@sverb}{\@vobeyspaces \frenchspacing \@sverb}}
+\let\verb@balance@group\@empty
+
+\def\verb@egroup{\global\let\verb@balance@group\@empty\egroup}
+
+\begingroup
+ \obeylines%
+ \gdef\verb@eol@error{\obeylines%
+ \def^^M{\verb@egroup\@latex@error{%
+ Text for \noexpand\verb command ended by end of line}\@ehc}}%
+\endgroup
+\def\@sverb#1{%
+ \catcode`#1\active \lccode`\~`#1%
+ \gdef\verb@balance@group{\verb@egroup
+ \@latex@error{Illegal use of \noexpand\verb command}\@ehc}%
+ \aftergroup\verb@balance@group
+ \lowercase{\let~\verb@egroup}}
+\def\verbatim@nolig@list{\do\`\do\<\do\>\do\,\do\'\do\-}
+\def\do@noligs#1{%
+ \catcode`#1\active
+ \begingroup
+ \lccode`\~=`#1\relax
+ \lowercase{\endgroup\def~{\leavevmode\kern\z@\char`#1}}}
+\newcount\macro@cnt \macro@cnt=0
+\newskip\MacroTopsep \MacroTopsep = 7pt plus 2pt minus 2pt
+\begingroup
+\catcode`\~\active
+\gdef\SpecialEscapechar#1{%
+ \begingroup
+ \uccode`\~`#1%
+ \uppercase{\gdef\active@escape@char{~}}%
+ \escapechar\m@ne \xdef\special@escape@char{\string#1}%
+ \endgroup}
+\endgroup
+\begingroup \catcode`\|=\z@ \catcode`\\=\active
+|gdef|init@crossref{|catcode`|\|active |let\|bslash
+ |MakePrivateLetters
+ |catcode|expandafter`|special@escape@char|active
+ |expandafter|let|active@escape@char|scan@macro}
+|endgroup
+\SpecialEscapechar{\\}
+\@ifundefined{MakePrivateLetters}
+ {\let\MakePrivateLetters\makeatletter}{}
+\def\close@crossref{\SpecialEscapechar\\}
+\def\scan@macro{%
+ \special@escape@char
+ \step@checksum
+ \ifscan@allowed
+ \let\macro@namepart\@empty
+ \def\next{\futurelet\next\macro@switch}%
+ \else \let\next\@empty \fi
+ \next}
+\def\DisableCrossrefs{\@bsphack\scan@allowedfalse\@esphack}
+\def\EnableCrossrefs{\@bsphack\scan@allowedtrue
+ \def\DisableCrossrefs{\@bsphack\@esphack}\@esphack}
+\def\macro@switch{\ifcat\noexpand\next a%
+ \let\next\macro@name
+ \else \let\next\short@macro \fi
+ \next}
+\begingroup
+\catcode`\&=12
+\gdef\short@macro#1{\begingroup
+ \uccode`\&=\expandafter`\string#1%
+ \uppercase{\def\x{\def\macro@namepart{&}}}%
+ \expandafter\endgroup\x
+ \maybe@index@short@macro\macro@namepart
+ \scan@allowedfalse#1%
+ \scan@allowedtrue }
+\endgroup
+\def\macro@name#1{\edef\macro@namepart{\macro@namepart#1}%
+ \futurelet\next\more@macroname}
+\def\more@macroname{\ifcat\noexpand\next a%
+ \let\next\macro@name
+ \else \let\next\macro@finish \fi
+ \next}
+\def\macro@finish{%
+ \macro@namepart
+ \maybe@index@macro \macro@namepart
+}
+
+\RequirePackage{expl3}
+\ExplSyntaxOn
+\seq_new:N \l__doc_donotindex_seq
+\prop_new:N \g__doc_idxtype_prop
+\cs_new:Npn\__doc_trace:x {
+ \ifdoc@debugshow
+ \expandafter \iow_term:x
+ \else
+ \expandafter \use_none:n
+ \fi
+}
+\cs_new:Npn \doc_dont_index:n {
+ \group_begin:
+ \MakePrivateLetters
+ \__doc_dont_index:n
+}
+\cs_new:Npn \__doc_dont_index:n #1 {
+ \group_end:
+ \__doc_trace:x{Disable~ indexing~ for~ '\tl_to_str:n{#1}' }
+ \clist_map_function:nN {#1} \__doc_dont_index_aux:n
+}
+\cs_new:Npn \__doc_dont_index_aux:n #1 {
+ \seq_put_right:Nx \l__doc_donotindex_seq {\expandafter\@gobble \string#1}
+}
+\cs_set_eq:NN \DoNotIndex \doc_dont_index:n
+\def \ShowIndexingState {
+ \__doc_trace:x{Show~ doc~ indexing~ state:}
+ \seq_show:N \l__doc_donotindex_seq
+ \prop_show:N \g__doc_idxtype_prop
+}
+
+\cs_new:Npn \__doc_idxtype_put:Nn #1#2 {
+ \exp_args:Nx \__doc_idxtype_put:nn { \cs_to_str:N #1 }{#2}
+ \protected@write\@auxout{}
+ {\string\RecordIndexTypeAux {\string#1 }{#2} }
+}
+\cs_new:Npn \RecordIndexTypeAux #1#2 {
+ \exp_args:Nx \__doc_idxtype_put:nn { \cs_to_str:N #1 }{#2}
+}
+\AtEndDocument{
+ \cs_set_eq:NN \RecordIndexTypeAux \use_none:nn
+}
+\cs_set_eq:NN \RecordIndexType \__doc_idxtype_put:Nn
+\cs_new:Npn \__doc_idxtype_put_scan:nn #1#2 {
+ \exp_args:Nf \__doc_idxtype_put:nn { \tl_to_str:n {#1} }{#2}
+ \protected@write\@auxout{}
+ {\string\RecordIndexTypeAux {\bslash #1 }{#2} }
+}
+\cs_generate_variant:Nn \__doc_idxtype_put_scan:nn {o}
+\cs_set_eq:NN \record@index@type@save \__doc_idxtype_put_scan:on
+\cs_new:Npn \__doc_idxtype_put:nn #1#2 {
+ \exp_args:NNf
+ \seq_if_in:NnTF \l__doc_donotindex_seq {\tl_to_str:n{#1}}
+ {
+ \__doc_trace:x{Not~ recording~ index~ type~ for~ '\bslash #1' }
+ }
+ {
+ \__doc_trace:x{Recording~ index~ type~ for~ '\bslash #1' ~ as~ #2 }
+ \prop_gput:Nnn \g__doc_idxtype_prop {#1}{#2}
+ }
+}
+\cs_new:Npn \exp_args:co #1#2
+ { \cs:w #1 \exp_after:wN \cs_end:\exp_after:wN {#2} }
+\cs_generate_variant:Nn \tl_to_str:n {o}
+
+\cs_new:Npn \__doc_maybe_index:o #1 {
+ \exp_args:Nf \__doc_maybe_index_aux:nN { \tl_to_str:o {#1} }
+ \SpecialIndex
+}
+\cs_set_eq:NN \maybe@index@macro \__doc_maybe_index:o
+\cs_new:Npn \__doc_maybe_index_short:o #1 {
+ \exp_args:Nf \__doc_maybe_index_aux:nN { \tl_to_str:o {#1} }
+ \SpecialShortIndex
+}
+\cs_set_eq:NN \maybe@index@short@macro \__doc_maybe_index_short:o
+\cs_new:Npn \__doc_maybe_index_aux:nN #1#2 {
+ \__doc_trace:x{Searching~ for~ '\bslash #1'}
+ \seq_if_in:NnTF \l__doc_donotindex_seq {#1}
+ {
+ \__doc_trace:x{Not~ indexing~ '\bslash #1' }
+ }
+ {
+ \prop_get:NnNTF \g__doc_idxtype_prop {#1} \l__doc_idxtype_tl
+ {
+ \exp_args:Ncno \__doc_maybe_index_aux:Nnn
+ { Code \tl_use:N \l__doc_idxtype_tl Index }
+ {code} {\bslash #1}
+ }
+ {
+ \__doc_trace:x{Indexing~ '\bslash #1'\space (\string #2)}
+ \exp_args:No #2 {\bslash #1}
+ }
+ }
+}
+\cs_new:Npn \SpecialShortIndex #1 {
+ \@SpecialIndexHelper@ #1\@nil
+ \@bsphack
+ \ifdoc@noindex \else
+ \str_case_e:nnF {\@gtempa }
+ {
+ {\cs_to_str:N \^^M } {\def\reserved@a{ \string \space \actualchar }
+ \def\reserved@b { \space }
+ \let\reserved@c \@empty }
+ { } {\def\reserved@a{ \string \space \actualchar }
+ \def\reserved@b { \space }
+ \let\reserved@c \@empty }
+ {\c_left_brace_str} { \def\reserved@a{ \bgroup \actualchar }
+ \def\reserved@b { \c_left_brace_str }
+ \def\reserved@c { \noexpand\iffalse
+ \c_right_brace_str
+ \noexpand\fi } }
+ {\c_right_brace_str} { \def\reserved@a{ \egroup \actualchar
+ \noexpand\iffalse
+ \c_left_brace_str
+ \noexpand\fi }
+ \def\reserved@b { \c_right_brace_str }
+ \let\reserved@c \@empty }
+ {\verbatimchar} { \def\reserved@a{ \quotechar\verbatimchar
+ \actualchar }
+ \let\reserved@b \@empty
+ \def\reserved@c
+ { \string\texttt{\string\string\verbatimchar} } }
+ }
+ { \def\reserved@a {\quotechar \@gtempa \actualchar }
+ \def\reserved@b {\quotechar \@gtempa }
+ \let\reserved@c \@empty }
+ \special@index {
+ \reserved@a
+ \string\verb
+ \quotechar *\verbatimchar \quotechar \bslash
+ \reserved@b
+ \verbatimchar
+ \reserved@c
+ \encapchar code}
+ \fi
+ \@esphack
+}
+
+\cs_new:Npn \__doc_maybe_index_aux:Nnn #1#2#3 {
+ \cs_if_exist:NTF #1
+ {
+ \__doc_trace:x{Indexing~ '#3'\space as~
+ \tl_use:N \l__doc_idxtype_tl }
+ #1{#2}{#3}
+ }
+ {
+ \PackageError{doc}{Doc~ element~
+ '\tl_use:N \l__doc_idxtype_tl'~ unknown}%
+
+ {When~ using~ '\string\RecordIndexType'~ the~ type~ must~
+ be~ known~\MessageBreak
+ to~ the~ system,~ i.e.,~ declared~ via~
+ '\string\NewDocElement'\MessageBreak
+ before~ it~ can~ be~ used~ in~ indexing.}
+ }
+}
+\ExplSyntaxOff
+\@ifundefined{actualchar}{\def\actualchar{=}}{}
+\@ifundefined{quotechar}{\def\quotechar{!}}{}
+\@ifundefined{levelchar}{\def\levelchar{>}}{}
+\@ifundefined{encapchar}{\def\encapchar{|}}{}
+\@ifundefined{verbatimchar}{\def\verbatimchar{+}}{}
+\begingroup
+ \catcode`\|=0
+ \catcode`\\=12
+ |gdef|@SpecialIndexHelper@#1#2|@nil{%
+ |if |noexpand#1\%
+ |gdef|@gtempa{#2}%
+ |else
+ |begingroup
+ |escapechar|m@ne
+ |expandafter|gdef|expandafter|@gtempa|expandafter{|string#1#2}%
+ |endgroup
+ |fi}
+|endgroup
+\def\SortIndex#1#2{%
+ \ifdoc@noindex\else
+ \index{#1\actualchar#2}%
+ \fi
+}
+\@ifundefined{LeftBraceIndex}{\def\LeftBraceIndex{%
+ \special@index{\bgroup\actualchar
+ \string\verb% % to fool emacs highlighting
+ \quotechar*\verbatimchar
+ \quotechar\bslash{\verbatimchar\string\iffalse}\string\fi}}}{}
+
+\@ifundefined{RightBraceIndex}{\def\RightBraceIndex{%
+ \special@index{\egroup\actualchar\string\iffalse{\string\fi
+ \string\verb% % to fool emacs highlighting
+ \quotechar*\verbatimchar\quotechar\bslash}\verbatimchar}}}{}
+\@ifundefined{PercentIndex}
+ {\def\PercentIndex{\it@is@a\percentchar}}{}
+\def\OldMakeindex{\def\PercentIndex{%
+ \special@index{\quotechar\percentchar\actualchar
+ \string\verb% % to fool emacs highlighting
+ \quotechar*\verbatimchar\quotechar\bslash
+ \percentchar\percentchar\verbatimchar}}}
+{\catcode`\%=12 \gdef\percentchar{%}}
+\def\it@is@a#1{\special@index{\quotechar #1\actualchar
+ \string\verb% % to fool emacs highlighting
+ \quotechar*\verbatimchar
+ \quotechar\bslash\quotechar#1\verbatimchar}}
+
+\newdimen\IndexMin \IndexMin = 80pt
+\newcount\c@IndexColumns \c@IndexColumns = 3
+\ifdoc@multicol
+ \RequirePackage{multicol}
+ \renewenvironment{theindex}
+ {\begin{multicols}\c@IndexColumns[\index@prologue][\IndexMin]%
+ \IndexParms \let\item\@idxitem \ignorespaces}%
+ {\end{multicols}}
+\else
+ \def\theindex{\@restonecoltrue\if@twocolumn\@restonecolfalse\fi
+ \columnseprule \z@ \columnsep 35\p@
+ \twocolumn[\index@prologue]%
+ \IndexParms \let\item\@idxitem \ignorespaces}
+ \def\endtheindex{\if@restonecol\onecolumn\else\clearpage\fi}
+\fi
+\long\def\IndexPrologue#1{\@bsphack\def\index@prologue{#1}\@esphack}
+\@ifundefined{index@prologue}
+ {\def\index@prologue{\section*{Index}%
+ \markboth{Index}{Index}%
+ Numbers written in italic refer to the page
+ where the corresponding entry is described;
+ numbers underlined refer to the
+ \ifcodeline@index
+ code line of the
+ \fi
+ definition; numbers in roman refer to the
+ \ifcodeline@index
+ code lines
+ \else
+ pages
+ \fi
+ where the entry is used.
+ }}{}
+\@ifundefined{IndexParms}
+ {\def\IndexParms{%
+ \parindent \z@
+ \columnsep 15pt
+ \parskip 0pt plus 1pt
+ \rightskip 15pt
+ \mathsurround \z@
+ \parfillskip=-15pt
+ \small
+ \def\@idxitem{\par\hangindent 30pt}%
+ \def\subitem{\@idxitem\hspace*{15pt}}%
+ \def\subsubitem{\@idxitem\hspace*{25pt}}%
+ \def\indexspace{\par\vspace{10pt plus 2pt minus 3pt}}%
+ }}{}
+\def\efill{\hfill\nopagebreak}%
+\def\pfill{\unskip~%
+ \leaders\hbox to.6em{\hss .\hss}\hfill
+ \penalty500\strut\nobreak
+ \leaders\hbox to.6em{\hss .\hss}\hfil
+ ~\ignorespaces}%
+\def\*{\leavevmode\lower.8ex\hbox{$\,\widetilde{\ }\,$}}
+\@ifundefined{main}{\def\main#1{\underline{#1}}}{}
+\@ifundefined{usage}{\def\usage#1{\textit{#1}}}{}
+\@ifundefined{code}{\def\code#1{#1}}{}
+\def\PrintIndex{\@input@{\jobname.ind}%
+ \global\let\PrintIndex\@empty}
+\def\changes{\@bsphack\begingroup\@sanitize
+ \catcode`\\\z@ \catcode`\ 10 \MakePercentIgnore
+ \changes@}
+\def\changes@#1#2#3{%
+ \protected@edef\@tempa{\noexpand\glossary{#1\levelchar
+ \ifx\saved@macroname\@empty
+ \quotechar!%
+ \actualchar
+ \generalname
+ \else
+ \saved@indexname
+ \actualchar
+ \string\verb% % to fool emacs highlighting
+ \quotechar*%
+ \verbatimchar\saved@macroname
+ \verbatimchar
+ \fi
+ :\levelchar #3}}%
+ \@tempa\endgroup\@esphack}
+\def\saved@macroname{}
+\def\saved@indexname{}
+\def\generalname{General}
+\let\RecordChanges\makeglossary
+\newdimen\GlossaryMin \GlossaryMin = 80pt
+\newcount\c@GlossaryColumns \c@GlossaryColumns = 2
+\ifdoc@multicol
+ \newenvironment{theglossary}{%
+ \begin{multicols}\c@GlossaryColumns
+ [\glossary@prologue][\GlossaryMin]%
+ \GlossaryParms \let\item\@idxitem \ignorespaces}%
+ {\end{multicols}}
+\else
+ \newenvironment{theglossary}{%
+ \@restonecoltrue\if@twocolumn\@restonecolfalse\fi
+ \columnseprule \z@ \columnsep 35\p@
+ \twocolumn[\glossary@prologue]%
+ \GlossaryParms \let\item\@idxitem \ignorespaces}
+ {\if@restonecol\onecolumn\else\clearpage\fi}
+\fi
+\long\def\GlossaryPrologue#1{\@bsphack
+ \def\glossary@prologue{#1}%
+ \@esphack}
+\@ifundefined{glossary@prologue}
+ {\def\glossary@prologue{\section*{{Change History}}%
+ \markboth{{Change History}}{{Change History}}%
+ }}{}
+\@ifundefined{GlossaryParms}{\let\GlossaryParms\IndexParms
+ \expandafter\def\expandafter\GlossaryParms\expandafter{\GlossaryParms
+ \rightskip 15pt plus 1fil
+ \parfillskip -15pt plus -1fil\relax}
+}{}
+\def\PrintChanges{\@input@{\jobname.gls}%
+ \global\let\PrintChanges\@empty}
+\newcommand\AlsoImplementation{%
+ \long\def\MaybeStopHere##1{\@bsphack\gdef\Finale{##1%
+ \check@checksum}%
+ \init@checksum
+ \@esphack}%
+ }
+\AlsoImplementation
+\def\OnlyDescription{\@bsphack\long\def\MaybeStopHere##1{%
+ ##1\endinput}\@esphack}
+\let\Finale\relax
+\def\StopEventually{\MaybeStopHere}
+\ifx\l@nohyphenation\undefined
+ \newlanguage\l@nohyphenation
+\fi
+\DeclareRobustCommand\meta[1]{%
+ \ensuremath\langle
+ \ifmmode \expandafter \nfss@text \fi
+ {%
+ \meta@font@select
+ \edef\meta@hyphen@restore
+ {\hyphenchar\the\font\the\hyphenchar\font}%
+ \hyphenchar\font\m@ne
+ \language\l@nohyphenation
+ #1\/%
+ \meta@hyphen@restore
+ }\ensuremath\rangle
+}
+\def\meta@font@select{\itshape}
+\def\IndexInput#1{%
+ \begingroup \macro@code
+ \frenchspacing \@vobeyspaces
+ \input{#1}\endmacrocode
+ \endgroup}
+\def\maketitle{\par
+ \begingroup \def \thefootnote {\fnsymbol {footnote}}%
+ \setcounter {footnote}\z@
+ \def\@makefnmark{\hbox to\z@{$\m@th^{\@thefnmark}$\hss}}%
+ \long\def\@makefntext##1{\parindent 1em\noindent
+ \hbox to1.8em{\hss$\m@th^{\@thefnmark}$}##1}%
+ \if@twocolumn \twocolumn [\@maketitle ]%
+ \else \newpage \global \@topnum \z@ \@maketitle \fi
+ \thispagestyle{titlepage}\@thanks \endgroup
+ \setcounter {footnote}\z@
+ \gdef\@date{\today}\gdef\@thanks{}%
+ \gdef\@author{}\gdef\@title{}}
+\@ifundefined{ps@titlepage}
+ {\let\ps@titlepage=\ps@plain}{}
+\def\MakeShortVerb{%
+ \@ifstar
+ {\def\@shortvrbdef{\verb*}\@MakeShortVerb}%
+ {\def\@shortvrbdef{\verb}\@MakeShortVerb}}
+\def\@MakeShortVerb#1{%
+ \expandafter\ifx\csname cc\string#1\endcsname\relax
+ \@shortvrbinfo{Made }{#1}\@shortvrbdef
+ \add@special{#1}%
+ \expandafter
+ \xdef\csname cc\string#1\endcsname{\the\catcode`#1}%
+ \begingroup
+ \catcode`\~\active \lccode`\~`#1%
+ \lowercase{%
+ \global\expandafter\let
+ \csname ac\string#1\endcsname~%
+ \expandafter\gdef\expandafter~\expandafter{\@shortvrbdef~}}%
+ \endgroup
+ \global\catcode`#1\active
+ \else
+ \@shortvrbinfo\@empty{#1 already}%
+ {\@empty\verb% % to fool emacs highlighting
+ (*)}%
+ \fi}
+\def\DeleteShortVerb#1{%
+ \expandafter\ifx\csname cc\string#1\endcsname\relax
+ \@shortvrbinfo\@empty{#1 not}%
+ {\@empty\verb% % to fool emacs highlighting
+ (*)}%
+ \else
+ \@shortvrbinfo{Deleted }{#1 as}%
+ {\@empty\verb% % to fool emacs
+ % highlighting
+ (*)}%
+ \rem@special{#1}%
+ \global\catcode`#1\csname cc\string#1\endcsname
+ \global \expandafter\let \csname cc\string#1\endcsname \relax
+ \ifnum\catcode`#1=\active
+ \begingroup
+ \catcode`\~\active \lccode`\~`#1%
+ \lowercase{%
+ \global\expandafter\let\expandafter~%
+ \csname ac\string#1\endcsname}%
+ \endgroup \fi \fi}
+\def\@shortvrbinfo#1#2#3{%
+ \PackageInfo{doc}{%
+ #1\expandafter\@gobble\string#2 a short reference
+ for \expandafter\string#3}}
+\def\add@special#1{%
+ \rem@special{#1}%
+ \expandafter\gdef\expandafter\dospecials\expandafter
+ {\dospecials \do #1}%
+ \expandafter\gdef\expandafter\@sanitize\expandafter
+ {\@sanitize \@makeother #1}}
+\def\rem@special#1{%
+ \def\do##1{%
+ \ifnum`#1=`##1 \else \noexpand\do\noexpand##1\fi}%
+ \xdef\dospecials{\dospecials}%
+ \begingroup
+ \def\@makeother##1{%
+ \ifnum`#1=`##1 \else \noexpand\@makeother\noexpand##1\fi}%
+ \xdef\@sanitize{\@sanitize}%
+ \endgroup}
+\def\init@checksum{\relax
+ \global\bslash@cnt\z@}
+\def\check@checksum{\relax
+ \ifnum\check@sum>\m@ne
+ \ifnum\check@sum=\z@
+ \typeout{**********************************}%
+ \typeout{* This macro file has no checksum!}%
+ \typeout{* The checksum should be \the\bslash@cnt!}%
+ \typeout{**********************************}%
+ \else
+ \ifnum\check@sum=\bslash@cnt
+ \typeout{*******************}%
+ \typeout{* Checksum passed *}%
+ \typeout{*******************}%
+ \else
+ \PackageError{doc}{Checksum not passed
+ (\the\check@sum<>\the\bslash@cnt)}%
+ {The file currently documented seems to be wrong.^^J%
+ Try to get a correct version.}%
+ \fi
+ \fi
+ \fi
+ \global\check@sum\m@ne}
+\newcount\check@sum \check@sum = \m@ne
+\newcount\bslash@cnt \bslash@cnt = \z@
+\def\CheckSum#1{\@bsphack\global\check@sum#1\relax\@esphack}
+\def\step@checksum{\global\advance\bslash@cnt\@ne}
+\def\CharacterTable{\begingroup \CharTableChanges \character@table}
+\begingroup
+ \catcode`\~=11
+ \gdef\character@table#1{\def\used~table{#1}%
+ \ifx\used~table\default~table
+ \typeout{***************************}%
+ \typeout{* Character table correct *}%
+ \typeout{***************************}%
+ \else
+ \PackageError{doc}{Character table corrupted}
+ {\the\wrong@table}
+ \show\default~table
+ \show\used~table
+ \fi
+ \endgroup}
+ \global\let\CharTableChanges\@empty
+ \makeatother
+ \gdef\default~table
+ {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+ Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+ Digits \0\1\2\3\4\5\6\7\8\9
+ Exclamation \! Double quote \" Hash (number) \#
+ Dollar \$ Percent \% Ampersand \&
+ Acute accent \' Left paren \( Right paren \)
+ Asterisk \* Plus \+ Comma \,
+ Minus \- Point \. Solidus \/
+ Colon \: Semicolon \; Less than \<
+ Equals \= Greater than \> Question mark \?
+ Commercial at \@ Left bracket \[ Backslash \\
+ Right bracket \] Circumflex \^ Underscore \_
+ Grave accent \` Left brace \{ Vertical bar \|
+ Right brace \} Tilde \~}
+\endgroup
+ \newhelp\wrong@table{Some of the ASCII characters are corrupted.^^J
+ I now \string\show\space you both tables for comparison.}
+\newif\ifcodeline@index \codeline@indexfalse
+\let\CodelineNumbered\codeline@indextrue
+\def\codeline@wrindex#1{\if@filesw
+ \begingroup
+ \set@display@protect
+ \immediate\write\@indexfile
+ {\string\indexentry{#1}%
+ {\number\c@CodelineNo}}%
+ \endgroup
+ \fi}
+\let\special@index = \@gobble
+\def\CodelineIndex{\makeindex
+ \codeline@indextrue
+ \let\special@index\codeline@wrindex}
+\def\PageIndex{\makeindex
+ \codeline@indexfalse
+ \let\special@index\index}
+\newcount\c@CodelineNo \c@CodelineNo\z@
+\@ifundefined{theCodelineNo}
+ {\ifx\selectfont\undefined
+ \def\theCodelineNo{\rmfamily\scriptsize\arabic{CodelineNo}}%
+ \else
+ \def\theCodelineNo{\reset@font\scriptsize\arabic{CodelineNo}}%
+ \fi}
+ {}
+ \tolerance=1000\relax
+{ \catcode`\"=12
+ \global\mathcode`\\="705C \global\mathcode`\@="7040 }
+\@ifundefined{DocstyleParms}{}{\DocstyleParms}
+ \let\DocstyleParms\relax
+\@ifundefined{AmSTeX}
+ {\def\AmSTeX{\leavevmode\hbox{$\mathcal A\kern-.2em\lower.376ex%
+ \hbox{$\mathcal M$}\kern-.2em\mathcal S$-\TeX}}}{}
+\@ifundefined{BibTeX}
+ {\def\BibTeX{{\rmfamily B\kern-.05em%
+ \textsc{i\kern-.025em b}\kern-.08em%
+ T\kern-.1667em\lower.7ex\hbox{E}\kern-.125emX}}}{}
+\@ifundefined{SliTeX}
+ {\def\SliTeX{{\rmfamily S\kern-.06emL\kern-.18em\raise.32ex\hbox
+ {\scshape i}\kern -.03em\TeX}}}{}
+\@ifundefined{PlainTeX}{\def\PlainTeX{\textsc{Plain}\kern2pt\TeX}}{}
+\@ifundefined{Web}{\def\Web{\textsc{Web}}}{}
+\def\MakePercentIgnore{\catcode`\%9\relax}
+\def\MakePercentComment{\catcode`\%14\relax}
+\def\DocInput#1{\MakePercentIgnore\input{#1}\MakePercentComment}
+\def\GetFileInfo#1{%
+ \def\filename{#1}%
+ \def\@tempb##1 ##2 ##3\relax##4\relax{%
+ \def\filedate{##1}%
+ \def\fileversion{##2}%
+ \def\fileinfo{##3}}%
+ \edef\@tempa{\csname ver@#1\endcsname}%
+ \expandafter\@tempb\@tempa\relax? ? \relax\relax}
+
+\ifdoc@hyperref
+ \let\PrintDescribeMacro \@empty
+ \let\PrintDescribeEnv \@empty
+ \let\PrintMacroName \@empty
+ \let\PrintEnvName \@empty
+ \let\SpecialUsageIndex \@empty
+ \let\SpecialEnvIndex \@empty
+ \expandafter\let\expandafter\doc@eoph@@k\csname doc.sty-h@@k\endcsname
+ \RequirePackage{hypdoc}
+ \expandafter\let\csname doc.sty-h@@k\endcsname\doc@eoph@@k
+ \let\PrintDescribeMacro \relax
+ \let\PrintDescribeEnv \relax
+ \let\PrintMacroName \relax
+ \let\PrintEnvName \relax
+ \def\doc@providetarget{\HD@target}
+ \def\doc@handleencap#1{\encapchar hdclindex{\the\c@HD@hypercount}{#1}}
+\else
+ \let\doc@providetarget\@empty
+ \def\doc@handleencap#1{\encapchar #1}
+ \def\hdclindex#1#2{\ifx\@nil#2\@nil\else\csname #2\expandafter\endcsname\fi}
+ \def\hdpindex #1{\ifx\@nil#1\@nil\else\csname #1\expandafter\endcsname\fi}
+\fi
+
+
+\ExplSyntaxOn
+
+\long\def\@doc@env#1#2#3{
+ \endgroup
+ \clist_map_inline:nn {#3} { \@doc@env@{#1}{#2}{##1} }
+}
+
+\ExplSyntaxOff
+\long\def\@doc@env@#1#2#3{%
+ \topsep\MacroTopsep
+ \trivlist
+ \edef\saved@macroname{\string#3}%
+ \if #1%
+ \edef\saved@indexname{\expandafter\@gobble\saved@macroname}%
+ \expandafter\ifx
+ \csname Code#2Index\endcsname
+ \CodeMacroIndex
+ \else
+ \record@index@type@save
+ {\saved@indexname}{#2}%
+ \fi
+ \else
+ \let\saved@indexname\saved@macroname
+ \fi
+ \def\makelabel##1{\llap{##1}}%
+ \if@inlabel
+ \let\@tempa\@empty
+ \count@\macro@cnt
+ \loop\ifnum\count@>\z@
+ \edef\@tempa{\@tempa\hbox{\strut}}\advance\count@\m@ne
+ \repeat
+ \edef\makelabel##1{\llap{\vtop to\baselineskip{\@tempa\hbox{##1}\vss}}}%
+ \advance\macro@cnt\@ne
+ \else
+ \macro@cnt\@ne
+ \fi
+ \ifdoc@noprint
+ \item
+ \else
+ \edef\@tempa{%
+ \noexpand\item[%
+ \noexpand\doc@providetarget
+ \noexpand\strut
+ \noexpand\@nameuse{Print#2Name}{\saved@macroname}]}%
+ \@tempa
+ \fi
+ \ifdoc@noindex\else
+ \global\advance\c@CodelineNo\@ne
+ \csname SpecialMain#2Index\expandafter\endcsname
+ \expandafter{\saved@macroname}\nobreak
+ \global\advance\c@CodelineNo\m@ne
+ \fi
+ \if#1\expandafter\DoNotIndex \expandafter {\saved@macroname}\fi
+ \ignorespaces}
+
+\def\doc@env#1#2[#3]{%
+ \@nameuse{doc@noprint\doc@noprintdefault}%
+ \@nameuse{doc@noindex\doc@noindexdefault}%
+ \setkeys{doc}{#3}%
+ \begingroup
+ \ifdoc@outer
+ \catcode`\\12
+ \fi
+ \MakePrivateLetters
+ \@doc@env{#1}{#2}%
+}
+
+\def\@doc@describe#1#2{%
+ \ifdoc@noprint\else
+ \marginpar{\raggedleft
+ \strut
+ \doc@providetarget
+ \@nameuse{PrintDescribe#1}{#2}}%
+ \fi
+ \ifdoc@noindex\else
+ \@nameuse{Special#1Index}{#2}%
+ \fi
+ \@esphack
+ \endgroup
+ \ignorespaces}
+\def\doc@describe#1[#2]{%
+ \leavevmode\@bsphack
+ \setkeys{doc}{#2}%
+ \@doc@describe{#1}}
+\@ifundefined{temptokenb}{\newtoks\@temptokenb}{}
+\def\doc@createspecialindexes#1#2#3{%
+ \@temptokena{\space (#2)}%
+ \@temptokenb{#3:}%
+ \@nameedef{SpecialMain#1Index}##1{%
+ \noexpand\@bsphack
+ \ifdoc@toplevel
+ \noexpand\special@index{##1\noexpand\actualchar
+ {\string\ttfamily\space##1}%
+ \ifx\@nil#2\@nil\else \the\@temptokena \fi
+ \noexpand\encapchar main}%
+ \fi
+ \ifx\@nil#3\@nil\else
+ \noexpand\special@index{\the\@temptokenb\noexpand\levelchar
+ ##1\noexpand\actualchar{\string\ttfamily\space##1}%
+ \noexpand\encapchar main}%
+ \fi
+ \noexpand\@esphack}%
+ \@nameedef{Special#1Index}##1{%
+ \noexpand\@bsphack
+ \ifdoc@toplevel
+ \noexpand\doc@providetarget
+ \noexpand\index{##1\noexpand\actualchar{\string\ttfamily\space##1}%
+ \ifx\@nil#2\@nil\else \the\@temptokena \fi
+ \noexpand\doc@handleencap{usage}}%
+ \fi
+ \ifx\@nil#3\@nil\else
+ \noexpand\index{\the\@temptokenb\noexpand\levelchar
+ ##1\noexpand\actualchar{\string\ttfamily\space##1}%
+ \noexpand\doc@handleencap{usage}}%
+ \fi
+ \noexpand\@esphack}}
+\def\doc@createspecialmacrolikeindexes#1#2#3{%
+ \@temptokena{\space (#2)}%
+ \@temptokenb{#3:}%
+ \@nameedef{Code#1Index}##1##2{%
+ \noexpand\@SpecialIndexHelper@##2\noexpand\@nil
+ \noexpand\@bsphack
+ \noexpand\ifdoc@noindex\noexpand\else
+ \ifdoc@toplevel
+ \noexpand\special@index{\noexpand\@gtempa\noexpand\actualchar
+\string\verb% % to fool emacs highlighting
+\noexpand\quotechar*\noexpand\verbatimchar
+\noexpand\bslash\noexpand\@gtempa\noexpand\verbatimchar
+\ifx\@nil#2\@nil\else \the\@temptokena \fi
+\noexpand\encapchar ##1}%
+ \fi
+ \ifx\@nil#3\@nil\else
+ \noexpand\special@index{\the\@temptokenb\noexpand\levelchar
+\noexpand\@gtempa\noexpand\actualchar
+\string\verb% % to fool emacs highlighting
+\noexpand\quotechar*\noexpand\verbatimchar
+\noexpand\bslash\noexpand\@gtempa\noexpand\verbatimchar
+\noexpand\encapchar ##1}%
+ \fi
+ \noexpand\fi
+ \noexpand\@esphack}%
+ \@nameedef{SpecialMain#1Index}##1{%
+ \expandafter\noexpand\csname Code#1Index\endcsname
+ {main}{##1}}%
+ \@nameedef{Special#1Index}##1{%
+ \noexpand\@SpecialIndexHelper@##1\noexpand\@nil
+ \noexpand\@bsphack
+ \noexpand\ifdoc@noindex\noexpand\else
+ \ifdoc@toplevel
+ \noexpand\doc@providetarget
+ \noexpand\index{\noexpand\@gtempa\noexpand\actualchar
+\string\verb% % to fool emacs highlighting
+\noexpand\quotechar*\noexpand\verbatimchar
+\noexpand\bslash\noexpand\@gtempa\noexpand\verbatimchar
+\ifx\@nil#2\@nil\else \the\@temptokena \fi
+\noexpand\doc@handleencap{usage}}%
+ \fi
+ \ifx\@nil#3\@nil\else
+ \noexpand\index{\the\@temptokenb\noexpand\levelchar
+\noexpand\@gtempa\noexpand\actualchar
+\string\verb% % to fool emacs highlighting
+\noexpand\quotechar*\noexpand\verbatimchar
+\noexpand\bslash\noexpand\@gtempa\noexpand\verbatimchar
+\noexpand\doc@handleencap{usage}}%
+ \fi
+ \noexpand\fi
+ \noexpand\@esphack}}
+
+\def\doc@createdescribe#1{%
+ \@namedef{Describe#1}{%
+ \begingroup
+ \MakePrivateLetters
+ \@ifnextchar[%]
+ {\doc@describe{#1}}{\doc@describe{#1}[]}}}
+\def\doc@createenv#1#2#3{%
+ \@namedef{#3}{%
+ \@ifnextchar[%]
+ {\doc@env{#1}{#2}}{\doc@env{#1}{#2}[]}}%
+ \@namedef{end#3}{\endtrivlist}%
+}
+
+\def\@nameedef#1{\expandafter\edef\csname #1\endcsname}
+
+
+\def\doc@declareerror#1#2{%
+ \PackageError{doc}{Doc element '#1/#2' already defined?\@gobble}%
+ {There is already a definition for
+ '\string\Print#1Name',\MessageBreak
+ '\string\PrintDescribe#1'
+ or the environment '#2'.\MessageBreak
+ Maybe you are overwriting something by mistake!\MessageBreak
+ Otherwise use '\string\RenewDocElement' instead.}%
+}
+
+\def\doc@notdeclarederror#1#2{%
+ \PackageError{doc}{Doc element '#1/#2' unknown}%
+ {I expected an existing definition for
+ '\string\Print#1Name',\MessageBreak
+ '\string\PrintDescribe#1' and
+ the environment '#2' but\MessageBreak
+ not all of them are defined.\MessageBreak
+ Maybe you wanted to use
+ '\string\NewDocElement'?}%
+}
+\newcommand\NewDocElement[3][]{%
+ \@ifundefined{Print#2Name}%
+ {\@ifundefined{PrintDescribe#2}%
+ {\@ifundefined{#3}%
+ {\@ifundefined{end#3}%
+ {\@NewDocElement{#1}}%
+ \doc@declareerror
+ }\doc@declareerror
+ }\doc@declareerror
+ }\doc@declareerror
+ {#2}{#3}%
+}
+\newcommand\RenewDocElement[3][]{%
+ \@ifundefined{Print#2Name}\doc@notdeclarederror
+ {\@ifundefined{PrintDescribe#2}\doc@notdeclarederror
+ {\@ifundefined{#3}\doc@notdeclarederror
+ {\@ifundefined{end#3}\doc@notdeclarederror
+ {\@NewDocElement{#1}}%
+ }%
+ }%
+ }%
+ {#2}{#3}%
+}
+\def\@NewDocElement#1#2#3{%
+ \doc@macrolikefalse
+ \doc@topleveltrue
+ \def\doc@idxtype{#3}%
+ \def\doc@idxgroup{#3s}%
+ \let\doc@printtype\@empty
+ \setkeys{doc}{#1}%
+ \ifx\doc@printtype\@empty
+ \@temptokena{}%
+ \else
+ \@temptokena\expandafter{\expandafter
+ \textnormal\expandafter{\expandafter
+ \space\expandafter
+ (\doc@printtype)}}%
+ \fi
+ \@nameedef{Print#2Name}##1{%
+ {\noexpand\MacroFont
+ \ifdoc@macrolike
+ \noexpand\string
+ \fi
+ ##1%
+ \the\@temptokena
+ }}%
+ \expandafter\let\csname PrintDescribe#2\expandafter\endcsname
+ \csname Print#2Name\endcsname
+ \edef\doc@expr{%
+ \ifdoc@macrolike
+ \noexpand\doc@createspecialmacrolikeindexes
+ \else
+ \noexpand\doc@createspecialindexes
+ \fi
+ {#2}%
+ }%
+ \expandafter\expandafter\expandafter
+ \doc@expr
+ \expandafter\expandafter\expandafter
+ {\expandafter\doc@idxtype\expandafter}\expandafter
+ {\doc@idxgroup}%
+ \doc@createdescribe{#2}%
+ \ifdoc@macrolike
+ \doc@createenv{TT}{#2}{#3}%
+ \else
+ \doc@createenv{TF}{#2}{#3}%
+ \fi
+}
+
+
+\NewDocElement[macrolike = true ,
+ idxtype = ,
+ idxgroup = ,
+ printtype =
+ ]{Macro}{macro}
+
+\def\SpecialMainIndex{\SpecialMainMacroIndex}
+
+\def\SpecialUsageIndex{\SpecialMacroIndex}
+
+\def\SpecialIndex {\CodeMacroIndex{code}}
+
+\NewDocElement[macrolike = false ,
+ idxtype = env. ,
+ idxgroup = environments ,
+ printtype = \textit{env.}
+ ]{Env}{environment}
+
+
+\DeclareRobustCommand\cs[1]{\texttt{\bslash #1}}
+
+\endinput
+%%
+%% End of file `doc-v3beta.sty'.
diff --git a/macros/latex-dev/base/doc.dtx b/macros/latex-dev/base/doc.dtx
index c860a67438..c1a96948a8 100644
--- a/macros/latex-dev/base/doc.dtx
+++ b/macros/latex-dev/base/doc.dtx
@@ -1,7 +1,7 @@
% \iffalse meta-comment
%
% Copyright (C) 1993-2021
-% The LaTeX3 Project and any individual authors listed elsewhere
+% The LaTeX Project and any individual authors listed elsewhere
% in this file.
%
% This file is part of the LaTeX base system.
diff --git a/macros/latex-dev/base/doc.pdf b/macros/latex-dev/base/doc.pdf
index 960e997adb..2914d862ff 100644
--- a/macros/latex-dev/base/doc.pdf
+++ b/macros/latex-dev/base/doc.pdf
Binary files differ
diff --git a/macros/latex-dev/base/docstrip.dtx b/macros/latex-dev/base/docstrip.dtx
index ea3a443c39..c7480988b4 100644
--- a/macros/latex-dev/base/docstrip.dtx
+++ b/macros/latex-dev/base/docstrip.dtx
@@ -1,7 +1,7 @@
% \iffalse meta-comment
%
% Copyright (C) 1993-2021
-% The LaTeX3 Project and any individual authors listed elsewhere
+% The LaTeX Project and any individual authors listed elsewhere
% in this file.
%
% This file is part of the LaTeX base system.
@@ -42,7 +42,7 @@
%% Frank Mittelbach
%% Copyright (C) 1995 Marcin Woli\'nski
%% Copyright (C) 1996-1997 Mark Wooding, Marcin Woli\'nski
-%% Copyright (C) 1998-2020 LaTeX3 project and the above authors
+%% Copyright (C) 1998-2021 LaTeX Project and the above authors.
%% All rights are reserved.
%%
%
@@ -789,7 +789,7 @@
%
% \section{Internal functions and variables}
%
-% An important consideration for \LaTeX3 development is separating
+% An important consideration for \LaTeX\ development is separating
% out public and internal functions. Functions and variables which
% are private to one module should not be used or modified by any
% other module. As \TeX{} does not have any formal namespacing
diff --git a/macros/latex-dev/base/docstrip.ins b/macros/latex-dev/base/docstrip.ins
index edc75d8258..e34281fc36 100644
--- a/macros/latex-dev/base/docstrip.ins
+++ b/macros/latex-dev/base/docstrip.ins
@@ -4,7 +4,7 @@
%% LaTeX or TeX.
%%
%% Copyright (C) 1993-2021
-%% The LaTeX3 Project and any individual authors listed elsewhere
+%% The LaTeX Project and any individual authors listed elsewhere
%% in this file.
%%
%% This file is part of the LaTeX base system.
@@ -53,7 +53,7 @@ reports for it can be opened at https://latex-project.org/bugs.html
Copyright (C) 1993-2021
-The LaTeX3 Project and any individual authors listed elsewhere
+The LaTeX Project and any individual authors listed elsewhere
in this file.
This file was generated from file(s) of the LaTeX base system.
diff --git a/macros/latex-dev/base/docstrip.pdf b/macros/latex-dev/base/docstrip.pdf
index 1b07721077..bcbaf41e21 100644
--- a/macros/latex-dev/base/docstrip.pdf
+++ b/macros/latex-dev/base/docstrip.pdf
Binary files differ
diff --git a/macros/latex-dev/base/ec.ins b/macros/latex-dev/base/ec.ins
index ce702d8a27..90b7b2e61f 100644
--- a/macros/latex-dev/base/ec.ins
+++ b/macros/latex-dev/base/ec.ins
@@ -4,7 +4,7 @@
%% LaTeX or TeX.
%%
%% Copyright (C) 1993-2021
-%% The LaTeX3 Project and any individual authors listed elsewhere
+%% The LaTeX Project and any individual authors listed elsewhere
%% in this file.
%%
%% This file is part of the LaTeX base system.
@@ -49,7 +49,7 @@ reports for it can be opened at https://latex-project.org/bugs.html
Copyright (C) 1993-2021
-The LaTeX3 Project and any individual authors listed elsewhere
+The LaTeX Project and any individual authors listed elsewhere
in this file.
This file was generated from file(s) of the LaTeX base system.
diff --git a/macros/latex-dev/base/encguide.pdf b/macros/latex-dev/base/encguide.pdf
index fe668c7f93..367f5f7c41 100644
--- a/macros/latex-dev/base/encguide.pdf
+++ b/macros/latex-dev/base/encguide.pdf
Binary files differ
diff --git a/macros/latex-dev/base/encguide.tex b/macros/latex-dev/base/encguide.tex
index aeb2f35037..d70233eab4 100644
--- a/macros/latex-dev/base/encguide.tex
+++ b/macros/latex-dev/base/encguide.tex
@@ -1,7 +1,7 @@
% \iffalse meta-comment
%
% Copyright (C) 1993-2021
-% The LaTeX3 Project and any individual authors listed elsewhere
+% The LaTeX Project and any individual authors listed elsewhere
% in this file.
%
% This file is part of the LaTeX base system.
@@ -188,7 +188,7 @@
\title{\LaTeX{} font encodings}
\author{Frank Mittelbach \and Robin
- Fairbairns \and Werner Lemberg \and \LaTeX3 Project Team.}
+ Fairbairns \and Werner Lemberg \and \LaTeX\ Project Team.}
\date{\copyright~Copyright 1995--2016 \\[5pt] 18 February 2016}
@@ -286,7 +286,7 @@ known needs of researchers in mathematics and the mathematical sciences.
Independently, a first proposal (the so-called \emph{Aston proposal}) was worked
out by Justin Ziegler together with Frank Mittelbach and other members of the
-\LaTeX3 project team~\cite{ziegler}. A first implementation of
+\LaTeX\ Project team~\cite{ziegler}. A first implementation of
this propsal was realized by Matthias Clasen und Ulrik
Vieth~\cite{clasen,clasen-vieth}.
@@ -345,7 +345,7 @@ fonts.
Names for encoding schemes are strings of up to three letters (all
upper case) plus digits.
-The \LaTeX3 project reserves the use of encoding names starting with the
+The \LaTeX\ Project reserves the use of encoding names starting with the
following letters: |T| (standard 256-long text encodings), |TS|
(symbols that are designed to extend a corresponding |T| encoding),
|X| (text encodings that do not conform to the strict requirements for
diff --git a/macros/latex-dev/base/exscale.dtx b/macros/latex-dev/base/exscale.dtx
index b6f465443f..ea67cb6fb7 100644
--- a/macros/latex-dev/base/exscale.dtx
+++ b/macros/latex-dev/base/exscale.dtx
@@ -1,7 +1,7 @@
% \iffalse meta-comment
%
% Copyright (C) 1993-2021
-% The LaTeX3 Project and any individual authors listed elsewhere
+% The LaTeX Project and any individual authors listed elsewhere
% in this file.
%
% This file is part of the LaTeX base system.
diff --git a/macros/latex-dev/base/exscale.ins b/macros/latex-dev/base/exscale.ins
index 8a22a7f938..cfd2c535a7 100644
--- a/macros/latex-dev/base/exscale.ins
+++ b/macros/latex-dev/base/exscale.ins
@@ -4,7 +4,7 @@
%% LaTeX or TeX.
%%
%% Copyright (C) 1993-2021
-%% The LaTeX3 Project and any individual authors listed elsewhere
+%% The LaTeX Project and any individual authors listed elsewhere
%% in this file.
%%
%% This file is part of the LaTeX base system.
@@ -49,7 +49,7 @@ reports for it can be opened at https://latex-project.org/bugs.html
Copyright (C) 1993-2021
-The LaTeX3 Project and any individual authors listed elsewhere
+The LaTeX Project and any individual authors listed elsewhere
in this file.
This file was generated from file(s) of the LaTeX base system.
diff --git a/macros/latex-dev/base/exscale.pdf b/macros/latex-dev/base/exscale.pdf
index 52395da904..fb19614ee8 100644
--- a/macros/latex-dev/base/exscale.pdf
+++ b/macros/latex-dev/base/exscale.pdf
Binary files differ
diff --git a/macros/latex-dev/base/fix-cm.dtx b/macros/latex-dev/base/fix-cm.dtx
index d844b65aa5..1be2e16cc0 100644
--- a/macros/latex-dev/base/fix-cm.dtx
+++ b/macros/latex-dev/base/fix-cm.dtx
@@ -1,7 +1,7 @@
% \iffalse meta-comment
%
% Copyright (C) 1993-2021
-% The LaTeX3 Project and any individual authors listed elsewhere
+% The LaTeX Project and any individual authors listed elsewhere
% in this file.
%
% This file is part of the LaTeX base system.
diff --git a/macros/latex-dev/base/fix-cm.ins b/macros/latex-dev/base/fix-cm.ins
index 840d5e408c..95931970f4 100644
--- a/macros/latex-dev/base/fix-cm.ins
+++ b/macros/latex-dev/base/fix-cm.ins
@@ -4,7 +4,7 @@
%% LaTeX or TeX.
%%
%% Copyright (C) 1993-2021
-%% The LaTeX3 Project and any individual authors listed elsewhere
+%% The LaTeX Project and any individual authors listed elsewhere
%% in this file.
%%
%% This file is part of the LaTeX base system.
@@ -49,7 +49,7 @@ reports for it can be opened at https://latex-project.org/bugs.html
Copyright (C) 1993-2021
-The LaTeX3 Project and any individual authors listed elsewhere
+The LaTeX Project and any individual authors listed elsewhere
in this file.
This file was generated from file(s) of the LaTeX base system.
diff --git a/macros/latex-dev/base/fix-cm.pdf b/macros/latex-dev/base/fix-cm.pdf
index 1c1c03621a..00ac759011 100644
--- a/macros/latex-dev/base/fix-cm.pdf
+++ b/macros/latex-dev/base/fix-cm.pdf
Binary files differ
diff --git a/macros/latex-dev/base/fntguide.pdf b/macros/latex-dev/base/fntguide.pdf
index 5cadeb9dfb..48e00dbf08 100644
--- a/macros/latex-dev/base/fntguide.pdf
+++ b/macros/latex-dev/base/fntguide.pdf
Binary files differ
diff --git a/macros/latex-dev/base/fntguide.tex b/macros/latex-dev/base/fntguide.tex
index 7a824d0a99..6e20cc253f 100644
--- a/macros/latex-dev/base/fntguide.tex
+++ b/macros/latex-dev/base/fntguide.tex
@@ -2,7 +2,7 @@
%
% Copyright (C) 1993-2021
%
-% The LaTeX3 Project and any individual authors listed elsewhere
+% The LaTeX Project and any individual authors listed elsewhere
% in this file.
%
% This file is part of the LaTeX base system.
@@ -37,7 +37,7 @@
\title{\LaTeXe{} font selection}
-\author{\copyright~Copyright 1995--2020, \LaTeX3 Project
+\author{\copyright~Copyright 1995--2020, \LaTeX\ Project
Team.\thanks{Thanks to Arash Esbati for documenting the
newer NFSS features of 2020}\\
All rights reserved.}
@@ -1800,7 +1800,7 @@ typesetting, as will the default declarations such as |\bfseries|.
Names for encoding schemes are strings of up to three letters (all
upper case) plus digits.
- The \LaTeX3 project reserves the use of encodings starting with the
+ The \LaTeX\ Project reserves the use of encodings starting with the
following letters: |T| (standard 256-long text encodings), |TS|
(symbols that are designed to extend a corresponding |T| encoding),
|X| (text encodings that do not conform to the strict requirements for
diff --git a/macros/latex-dev/base/fontdef.dtx b/macros/latex-dev/base/fontdef.dtx
index 6900a02074..581cfeb789 100644
--- a/macros/latex-dev/base/fontdef.dtx
+++ b/macros/latex-dev/base/fontdef.dtx
@@ -1,7 +1,7 @@
% \iffalse meta-comment
%
% Copyright (C) 1993-2021
-% The LaTeX3 Project and any individual authors listed elsewhere
+% The LaTeX Project and any individual authors listed elsewhere
% in this file.
%
% This file is part of the LaTeX base system.
@@ -39,7 +39,7 @@
%<driver, >\ProvidesFile{fontdef.drv}
% \fi
% \ProvidesFile{fontdef.dtx}
-%<-latexrelease> [2020/11/24 v3.0i LaTeX Kernel
+%<-latexrelease> [2021/01/15 v3.0i LaTeX Kernel
% \iftrue (\else
%<text, >(Text
%<math, >(Math
@@ -227,7 +227,7 @@
% described in \texttt{ltoutenc.dtx}.
%
% By convention, text encoding specific declarations, including the
-% declaration |\DeclareFontEncoding|, are kept in separate file of
+% |\DeclareFontEncoding| declaration, are kept in separate file of
% the form \meta{enc}\texttt{enc.def}, e.g.~\texttt{ot1enc.def}. This
% allows other applications to make use of the declarations as
% well.
diff --git a/macros/latex-dev/base/format.ins b/macros/latex-dev/base/format.ins
index f872c31a3e..9c90555b9f 100644
--- a/macros/latex-dev/base/format.ins
+++ b/macros/latex-dev/base/format.ins
@@ -4,7 +4,7 @@
%% LaTeX or TeX.
%%
%% Copyright (C) 1993-2021
-%% The LaTeX3 Project and any individual authors listed elsewhere
+%% The LaTeX Project and any individual authors listed elsewhere
%% in this file.
%%
%% This file is part of the LaTeX base system.
@@ -49,7 +49,7 @@ reports for it can be opened at https://latex-project.org/bugs.html
Copyright (C) 1993-2021
-The LaTeX3 Project and any individual authors listed elsewhere
+The LaTeX Project and any individual authors listed elsewhere
in this file.
This file was generated from file(s) of the LaTeX base system.
@@ -88,8 +88,8 @@ reports for it can be opened at https://latex-project.org/bugs.html
(but please observe conditions on bug reports sent to that address!)
-Copyright 2015
-The LaTeX3 Project and any individual authors listed elsewhere
+Copyright (C) 2015-2021
+The LaTeX Project and any individual authors listed elsewhere
in this file.
This file was generated from file(s) of the LaTeX base system.
@@ -124,7 +124,7 @@ extension .ins) which are part of the distribution.
This is a generated file.
Copyright (C) 1993-2021
-The LaTeX3 Project and any individual authors listed elsewhere
+The LaTeX Project and any individual authors listed elsewhere
in this file.
This file was generated from file(s) of the LaTeX base system.
@@ -166,6 +166,7 @@ the system are in the document `cfgguide.tex'.
% we have the extensions as soon as possible.
\from{ltexpl.dtx}{2ekernel} % expl3-based extensions
\from{ltdefns.dtx}{2ekernel}
+ \from{ltcmd.dtx}{2ekernel} % Used to be xparse
\from{lthooks.dtx}{2ekernel} % L3 layer module
\from{ltalloc.dtx}{2ekernel}
\from{ltcntrl.dtx}{2ekernel}
@@ -233,13 +234,15 @@ the system are in the document `cfgguide.tex'.
% hook management support
-\generate{\file{everyshi-ltx.sty}{\from{ltshipout.dtx}{everyshi-ltx}}} % emulating everyshi
\generate{\file{atbegshi-ltx.sty}{\from{ltshipout.dtx}{atbegshi-ltx}}} % emulating atbegshi
\generate{\file{atveryend-ltx.sty}{\from{ltfilehook.dtx}{atveryend-ltx}}} % emulating atveryend
\generate{\file{structuredlog.sty}{\from{ltfilehook.dtx}{structuredlog}}}
+% hook managed para
+
+\generate{\file{ltpara.ltx}{\from{ltpara.dtx}{2ekernel}}}
% luatex support (TeX part)
diff --git a/macros/latex-dev/base/graphpap.dtx b/macros/latex-dev/base/graphpap.dtx
index 0a89a25fe1..cc9f4da3cb 100644
--- a/macros/latex-dev/base/graphpap.dtx
+++ b/macros/latex-dev/base/graphpap.dtx
@@ -1,7 +1,7 @@
% \iffalse meta-comment
%
% Copyright (C) 1993-2021
-% The LaTeX3 Project and any individual authors listed elsewhere
+% The LaTeX Project and any individual authors listed elsewhere
% in this file.
%
% This file is part of the LaTeX base system.
diff --git a/macros/latex-dev/base/graphpap.ins b/macros/latex-dev/base/graphpap.ins
index 9528f3dcdc..65156ad917 100644
--- a/macros/latex-dev/base/graphpap.ins
+++ b/macros/latex-dev/base/graphpap.ins
@@ -4,7 +4,7 @@
%% LaTeX or TeX.
%%
%% Copyright (C) 1993-2021
-%% The LaTeX3 Project and any individual authors listed elsewhere
+%% The LaTeX Project and any individual authors listed elsewhere
%% in this file.
%%
%% This file is part of the LaTeX base system.
@@ -49,7 +49,7 @@ reports for it can be opened at https://latex-project.org/bugs.html
Copyright (C) 1993-2021
-The LaTeX3 Project and any individual authors listed elsewhere
+The LaTeX Project and any individual authors listed elsewhere
in this file.
This file was generated from file(s) of the LaTeX base system.
diff --git a/macros/latex-dev/base/graphpap.pdf b/macros/latex-dev/base/graphpap.pdf
index b7cba8a565..21ed3df036 100644
--- a/macros/latex-dev/base/graphpap.pdf
+++ b/macros/latex-dev/base/graphpap.pdf
Binary files differ
diff --git a/macros/latex-dev/base/idx.tex b/macros/latex-dev/base/idx.tex
index 89f8b1f9a0..8257396f81 100644
--- a/macros/latex-dev/base/idx.tex
+++ b/macros/latex-dev/base/idx.tex
@@ -1,7 +1,7 @@
% \iffalse meta-comment
%
% Copyright (C) 1993-2021
-% The LaTeX3 Project and any individual authors listed elsewhere
+% The LaTeX Project and any individual authors listed elsewhere
% in this file.
%
% This file is part of the LaTeX base system.
diff --git a/macros/latex-dev/base/ifthen.dtx b/macros/latex-dev/base/ifthen.dtx
index f07e4aa8f1..acb5cf1967 100644
--- a/macros/latex-dev/base/ifthen.dtx
+++ b/macros/latex-dev/base/ifthen.dtx
@@ -1,7 +1,7 @@
% \iffalse meta-comment
%
% Copyright (C) 1993-2021
-% The LaTeX3 Project and any individual authors listed elsewhere
+% The LaTeX Project and any individual authors listed elsewhere
% in this file.
%
% This file is part of the LaTeX base system.
@@ -30,7 +30,7 @@
%%
%% File `ifthen.dtx'.
%% Copyright (C) 1991 by Leslie Lamport
-%% Copyright (C) 1994-2001 LaTeX3 project, David Carlisle
+%% Copyright (C) 1994-2001 LaTeX project, David Carlisle
%% all rights reserved.
%%
%
diff --git a/macros/latex-dev/base/ifthen.ins b/macros/latex-dev/base/ifthen.ins
index d589deaafc..42e1d3f5d9 100644
--- a/macros/latex-dev/base/ifthen.ins
+++ b/macros/latex-dev/base/ifthen.ins
@@ -4,7 +4,7 @@
%% LaTeX or TeX.
%%
%% Copyright (C) 1993-2021
-%% The LaTeX3 Project and any individual authors listed elsewhere
+%% The LaTeX Project and any individual authors listed elsewhere
%% in this file.
%%
%% This file is part of the LaTeX base system.
@@ -49,7 +49,7 @@ reports for it can be opened at https://latex-project.org/bugs.html
Copyright (C) 1993-2021
-The LaTeX3 Project and any individual authors listed elsewhere
+The LaTeX Project and any individual authors listed elsewhere
in this file.
This file was generated from file(s) of the LaTeX base system.
diff --git a/macros/latex-dev/base/ifthen.pdf b/macros/latex-dev/base/ifthen.pdf
index a5263ace6b..777c2602e9 100644
--- a/macros/latex-dev/base/ifthen.pdf
+++ b/macros/latex-dev/base/ifthen.pdf
Binary files differ
diff --git a/macros/latex-dev/base/inputenc.dtx b/macros/latex-dev/base/inputenc.dtx
index d8649c778d..1b8691d30f 100644
--- a/macros/latex-dev/base/inputenc.dtx
+++ b/macros/latex-dev/base/inputenc.dtx
@@ -1,7 +1,7 @@
% \iffalse meta-comment
%
% Copyright (C) 1993-2021
-% LaTeX3 Project and any individual authors listed elsewhere
+% LaTeX Project and any individual authors listed elsewhere
% in this file.
%
% This file is part of the LaTeX base system.
@@ -283,7 +283,7 @@
% with the |utf8| option.
%
% The |\DeclareUnicodeCharacter| takes UTF-8 code point as its first argument
-% (in form of a a hexadecimal number) and the definition that this maps to as
+% (in form of a hexadecimal number) and the definition that this maps to as
% its second argument. For example, the code point |00E4| which is
% ``LATIN SMALL LETTER A WITH DIAERESIS'' would be set up via:
%\begin{verbatim}
@@ -410,7 +410,7 @@
%<cp1252&!ansinew> \ProvidesFile{cp1252.def}
%<cp1250> \ProvidesFile{cp1250.def}
%<cp1257> \ProvidesFile{cp1257.def}
- [2020/11/26 v1.3d Input encoding file]
+ [2021/02/14 v1.3d Input encoding file]
%<cp850>%%
%<cp850>%% If you need a Euro symbol, try cp858 instead.
%<cp850>%%
diff --git a/macros/latex-dev/base/inputenc.ins b/macros/latex-dev/base/inputenc.ins
index 19a8606e5d..920a585bff 100644
--- a/macros/latex-dev/base/inputenc.ins
+++ b/macros/latex-dev/base/inputenc.ins
@@ -4,7 +4,7 @@
%% LaTeX or TeX.
%%
%% Copyright (C) 1993-2021
-%% The LaTeX3 Project and any individual authors listed elsewhere
+%% The LaTeX Project and any individual authors listed elsewhere
%% in this file.
%%
%% This file is part of the LaTeX base system.
@@ -49,7 +49,7 @@ reports for it can be opened at https://latex-project.org/bugs.html
Copyright (C) 1993-2021
-The LaTeX3 Project and any individual authors listed elsewhere
+The LaTeX Project and any individual authors listed elsewhere
in this file.
This file was generated from file(s) of the LaTeX base system.
diff --git a/macros/latex-dev/base/inputenc.pdf b/macros/latex-dev/base/inputenc.pdf
index e27e93c46e..92bf387168 100644
--- a/macros/latex-dev/base/inputenc.pdf
+++ b/macros/latex-dev/base/inputenc.pdf
Binary files differ
diff --git a/macros/latex-dev/base/lablst.tex b/macros/latex-dev/base/lablst.tex
index 643dd6b1f6..da2d7dbceb 100644
--- a/macros/latex-dev/base/lablst.tex
+++ b/macros/latex-dev/base/lablst.tex
@@ -1,7 +1,7 @@
% \iffalse meta-comment
%
% Copyright (C) 1993-2021
-% The LaTeX3 Project and any individual authors listed elsewhere
+% The LaTeX Project and any individual authors listed elsewhere
% in this file.
%
% This file is part of the LaTeX base system.
diff --git a/macros/latex-dev/base/latex209.dtx b/macros/latex-dev/base/latex209.dtx
index 183028fca7..bf92f8ef1e 100644
--- a/macros/latex-dev/base/latex209.dtx
+++ b/macros/latex-dev/base/latex209.dtx
@@ -1,7 +1,7 @@
% \iffalse meta-comment
%
% Copyright (C) 1993-2021
-% The LaTeX3 Project and any individual authors listed elsewhere
+% The LaTeX Project and any individual authors listed elsewhere
% in this file.
%
% This file is part of the LaTeX base system.
diff --git a/macros/latex-dev/base/latex209.ins b/macros/latex-dev/base/latex209.ins
index 7c5197b9bd..33ebc2488c 100644
--- a/macros/latex-dev/base/latex209.ins
+++ b/macros/latex-dev/base/latex209.ins
@@ -4,7 +4,7 @@
%% LaTeX or TeX.
%%
%% Copyright (C) 1993-2021
-%% The LaTeX3 Project and any individual authors listed elsewhere
+%% The LaTeX Project and any individual authors listed elsewhere
%% in this file.
%%
%% This file is part of the LaTeX base system.
@@ -49,7 +49,7 @@ reports for it can be opened at https://latex-project.org/bugs.html
Copyright (C) 1993-2021
-The LaTeX3 Project and any individual authors listed elsewhere
+The LaTeX Project and any individual authors listed elsewhere
in this file.
This file was generated from file(s) of the LaTeX base system.
diff --git a/macros/latex-dev/base/latexchanges.pdf b/macros/latex-dev/base/latexchanges.pdf
index 0a86ec34c4..5c361e6139 100644
--- a/macros/latex-dev/base/latexchanges.pdf
+++ b/macros/latex-dev/base/latexchanges.pdf
Binary files differ
diff --git a/macros/latex-dev/base/latexchanges.tex b/macros/latex-dev/base/latexchanges.tex
index 500baa66c2..bc8e8dd07b 100644
--- a/macros/latex-dev/base/latexchanges.tex
+++ b/macros/latex-dev/base/latexchanges.tex
@@ -1,7 +1,7 @@
% \iffalse meta-comment
%
% Copyright (C) 2015-2021
-% The LaTeX3 Project and any individual authors listed elsewhere
+% The LaTeX Project and any individual authors listed elsewhere
% in this file.
%
% This file is part of the LaTeX base system.
@@ -38,7 +38,7 @@
\title{Changes to the \LaTeXe{} format}
-\author{\copyright~Copyright 2015--2021, \LaTeX3 Project Team.\\
+\author{\copyright~Copyright 2015--2021, \LaTeX\ Project Team.\\
All rights reserved.}
\date{2021-01-08}
@@ -985,7 +985,7 @@ we face an age old problem and unsolvable problem in \TeX: A
reliable test for math mode that doesn't destroy
kerning. Fortunately this problem can be solved when using e\TeX\ so
if you use this as engine for your \LaTeX\ format, as recommended by
-the \LaTeX3 Project, you will get a fully functioning |\TextOrMath|
+the \LaTeX\ Project, you will get a fully functioning |\TextOrMath|
command with no side effects. If you use regular \TeX\ as engine for
your \LaTeX\ format then we have to choose between the lesser of two
evils: 1)~breaking ligatures and preventing kerning or 2)~face the
diff --git a/macros/latex-dev/base/latexrelease.dtx b/macros/latex-dev/base/latexrelease.dtx
index 19a1d0db80..cfcac4b397 100644
--- a/macros/latex-dev/base/latexrelease.dtx
+++ b/macros/latex-dev/base/latexrelease.dtx
@@ -1,7 +1,7 @@
% \iffalse meta-comment
%
% Copyright (C) 1993-2021
-% The LaTeX3 Project and any individual authors listed elsewhere
+% The LaTeX Project and any individual authors listed elsewhere
% in this file.
%
% This file is part of the LaTeX base system.
@@ -40,7 +40,7 @@
%<*!fixltx2e>
% \fi
% \ProvidesFile{latexrelease.dtx}
- [2020/12/06 v1.0k LaTeX release emulation and tests
+ [2021/01/23 v1.0l LaTeX release emulation and tests
(including releases up to \latexreleaseversion)]
% \iffalse
%</!fixltx2e>
@@ -69,7 +69,7 @@
% \title{The \Lpack{latexrelease} package\thanks{This file
% has version number \fileversion, last
% revised \filedate.}}
-% \author{The \LaTeX3 Project}
+% \author{The \LaTeX Project}
% \date{\filedate}
% \MaintainedByLaTeXTeam{latex}
% \maketitle
@@ -129,7 +129,6 @@
% package has no information will generate a warning. Dates
% earlier than 2015 will work but will roll back to some point in 2015
% when the method was introduced.
-% |\IncludeInRelease| command is defined.
% The |\requestedLaTeXdate| is set to the normalized date argument
% so that package rollback defaults to the specified date.
%
@@ -137,9 +136,6 @@
% |current| This is the default behaviour, it does not change the
% effective date of the format but does ensure that the
% |\IncludeInRelease| command is defined.
-% the |\requestedLaTeXdate| is reset to 0 so that package rollback
-% does not use the implicit date.
-% |\IncludeInRelease| command is defined.
% The |\requestedLaTeXdate| macro is reset to 0 so that package rollback
% does not use the implicit date.
%
@@ -147,11 +143,16 @@
% |latest| sets the effective date of the format to the release date
% of this file, so in an older format applies all patches currently
% available.
-% |\IncludeInRelease| command is defined.
% The |\requestedLaTeXdate| macro is reset to 0 so that package rollback
% does not use the implicit date.
% \end{itemize}
%
+% In all cases, when the package is loaded, the |\sourceLaTeXdate| is
+% defined to be the numerical representation of |\fmtversion| before the
+% rollback/forward actually happens, so it is possible to test from which
+% was the original \LaTeX{} version before \Lpack{latexrelease} was loaded.
+% This is particularly useful when some code in a package has to be
+% redefined differently if rolling backwards in time or forwards.
%
% \section{Release Specific Code}
%
@@ -388,6 +389,16 @@
%
% \section{Setup}
%
+% \begin{macro}{\sourceLaTeXdate}
+% \changes{v1.0l}{2021/01/23}{\cs{sourceLaTeXdate} added}
+% Store the original \LaTeX{} format version
+% as a number in the format |YYYYMMDD|:
+% \begin{macrocode}
+\edef\sourceLaTeXdate{%
+ \expandafter\@parse@version\fmtversion//00\@nil}
+% \end{macrocode}
+% \end{macro}
+%
% \begin{macro}{\IncludeInRelease}
% \begin{macro}{\EndIncludeInRelease}
% \begin{macrocode}
diff --git a/macros/latex-dev/base/latexrelease.ins b/macros/latex-dev/base/latexrelease.ins
index 141a677b48..b4d0aef567 100644
--- a/macros/latex-dev/base/latexrelease.ins
+++ b/macros/latex-dev/base/latexrelease.ins
@@ -4,7 +4,7 @@
%% LaTeX or TeX.
%%
%% Copyright (C) 1993-2021
-%% The LaTeX3 Project and any individual authors listed elsewhere
+%% The LaTeX Project and any individual authors listed elsewhere
%% in this file.
%%
%% This file is part of the LaTeX base system.
@@ -49,7 +49,7 @@ reports for it can be opened at https://latex-project.org/bugs.html
Copyright (C) 1993-2021
-The LaTeX3 Project and any individual authors listed elsewhere
+The LaTeX Project and any individual authors listed elsewhere
in this file.
This file was generated from file(s) of the LaTeX base system.
@@ -93,6 +93,7 @@ extension .ins) which are part of the distribution.
\from{ltluatex.dtx} {latexrelease}% empty
\from{ltexpl.dtx} {latexrelease}% empty
\from{ltdefns.dtx} {latexrelease}%
+ \from{ltcmd.dtx} {latexrelease}%
\from{lthooks.dtx} {latexrelease}% empty % L3 layer module
\from{ltalloc.dtx} {latexrelease}% empty
\from{ltcntrl.dtx} {latexrelease}% empty
diff --git a/macros/latex-dev/base/latexrelease.pdf b/macros/latex-dev/base/latexrelease.pdf
index a0c1c75aad..f91d690fb6 100644
--- a/macros/latex-dev/base/latexrelease.pdf
+++ b/macros/latex-dev/base/latexrelease.pdf
Binary files differ
diff --git a/macros/latex-dev/base/latexsym.dtx b/macros/latex-dev/base/latexsym.dtx
index c53dac62f0..7a97aa4318 100644
--- a/macros/latex-dev/base/latexsym.dtx
+++ b/macros/latex-dev/base/latexsym.dtx
@@ -1,7 +1,7 @@
% \iffalse meta-comment
%
% Copyright (C) 1993-2021
-% The LaTeX3 Project and any individual authors listed elsewhere
+% The LaTeX Project and any individual authors listed elsewhere
% in this file.
%
% This file is part of the LaTeX base system.
diff --git a/macros/latex-dev/base/latexsym.ins b/macros/latex-dev/base/latexsym.ins
index 620046ac9b..902bbfc9e8 100644
--- a/macros/latex-dev/base/latexsym.ins
+++ b/macros/latex-dev/base/latexsym.ins
@@ -4,7 +4,7 @@
%% LaTeX or TeX.
%%
%% Copyright (C) 1993-2021
-%% The LaTeX3 Project and any individual authors listed elsewhere
+%% The LaTeX Project and any individual authors listed elsewhere
%% in this file.
%%
%% This file is part of the LaTeX base system.
@@ -49,7 +49,7 @@ reports for it can be opened at https://latex-project.org/bugs.html
Copyright (C) 1993-2021
-The LaTeX3 Project and any individual authors listed elsewhere
+The LaTeX Project and any individual authors listed elsewhere
in this file.
This file was generated from file(s) of the LaTeX base system.
@@ -88,7 +88,7 @@ reports for it can be opened at https://latex-project.org/bugs.html
Copyright (C) 1993-2021
-The LaTeX3 Project and any individual authors listed elsewhere
+The LaTeX Project and any individual authors listed elsewhere
in this file.
This file was generated from file(s) of the LaTeX base system.
diff --git a/macros/latex-dev/base/latexsym.pdf b/macros/latex-dev/base/latexsym.pdf
index 1b2b921b26..54b92b46ca 100644
--- a/macros/latex-dev/base/latexsym.pdf
+++ b/macros/latex-dev/base/latexsym.pdf
Binary files differ
diff --git a/macros/latex-dev/base/lb2.pdf b/macros/latex-dev/base/lb2.pdf
index 7a7e1ad0cf..f6d24713c4 100644
--- a/macros/latex-dev/base/lb2.pdf
+++ b/macros/latex-dev/base/lb2.pdf
Binary files differ
diff --git a/macros/latex-dev/base/legal.txt b/macros/latex-dev/base/legal.txt
index 5e20be289d..2fec428b91 100644
--- a/macros/latex-dev/base/legal.txt
+++ b/macros/latex-dev/base/legal.txt
@@ -7,9 +7,8 @@ COPYRIGHT
=========
This distribution is
-Copyright 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005
- 2006 2007 2008 2009 2011 2014 2015 2016
-The LaTeX3 Project and the individual authors:
+Copyright (C) 1993-2021
+The LaTeX Project and the individual authors:
Leslie Lamport
Johannes Braams
diff --git a/macros/latex-dev/base/letter.dtx b/macros/latex-dev/base/letter.dtx
index faece887f8..3c7fe56ba1 100644
--- a/macros/latex-dev/base/letter.dtx
+++ b/macros/latex-dev/base/letter.dtx
@@ -1,7 +1,7 @@
% \iffalse meta-comment
%
% Copyright (C) 1993-2021
-% The LaTeX3 Project and any individual authors listed elsewhere
+% The LaTeX Project and any individual authors listed elsewhere
% in this file.
%
% This file is part of the LaTeX base system.
@@ -165,7 +165,7 @@
% \changes{v1.3a}{2020/03/07}{merged changes to classes.dtx into letter.dtx}
%
% \iffalse
-% Copyright (C) 1994 LaTeX3 project, Frank Mittelbach
+% Copyright (C) 1994 LaTeX Project, Frank Mittelbach
% and Rainer Sch\"opf, all rights reserved.
% \fi
%
diff --git a/macros/latex-dev/base/letter.ins b/macros/latex-dev/base/letter.ins
index 1c2b2f9f01..44777393eb 100644
--- a/macros/latex-dev/base/letter.ins
+++ b/macros/latex-dev/base/letter.ins
@@ -4,7 +4,7 @@
%% LaTeX or TeX.
%%
%% Copyright (C) 1993-2021
-%% The LaTeX3 Project and any individual authors listed elsewhere
+%% The LaTeX Project and any individual authors listed elsewhere
%% in this file.
%%
%% This file is part of the LaTeX base system.
@@ -49,7 +49,7 @@ reports for it can be opened at https://latex-project.org/bugs.html
Copyright (C) 1993-2021
-The LaTeX3 Project and any individual authors listed elsewhere
+The LaTeX Project and any individual authors listed elsewhere
in this file.
This file was generated from file(s) of the LaTeX base system.
diff --git a/macros/latex-dev/base/letter.pdf b/macros/latex-dev/base/letter.pdf
index 1843ce9d7b..0280c54380 100644
--- a/macros/latex-dev/base/letter.pdf
+++ b/macros/latex-dev/base/letter.pdf
Binary files differ
diff --git a/macros/latex-dev/base/lgc2.pdf b/macros/latex-dev/base/lgc2.pdf
index eea053fb38..e285c6f20d 100644
--- a/macros/latex-dev/base/lgc2.pdf
+++ b/macros/latex-dev/base/lgc2.pdf
Binary files differ
diff --git a/macros/latex-dev/base/lppl.pdf b/macros/latex-dev/base/lppl.pdf
index 6f50abccce..37035109f3 100644
--- a/macros/latex-dev/base/lppl.pdf
+++ b/macros/latex-dev/base/lppl.pdf
Binary files differ
diff --git a/macros/latex-dev/base/ltalloc.dtx b/macros/latex-dev/base/ltalloc.dtx
index 3328c1f504..59c492836f 100644
--- a/macros/latex-dev/base/ltalloc.dtx
+++ b/macros/latex-dev/base/ltalloc.dtx
@@ -1,7 +1,7 @@
% \iffalse meta-comment
%
% Copyright (C) 1993-2021
-% The LaTeX3 Project and any individual authors listed elsewhere
+% The LaTeX Project and any individual authors listed elsewhere
% in this file.
%
% This file is part of the LaTeX base system.
diff --git a/macros/latex-dev/base/ltbibl.dtx b/macros/latex-dev/base/ltbibl.dtx
index 7f5066542f..0319342dd4 100644
--- a/macros/latex-dev/base/ltbibl.dtx
+++ b/macros/latex-dev/base/ltbibl.dtx
@@ -1,7 +1,7 @@
% \iffalse meta-comment
%
% Copyright (C) 1993-2021
-% The LaTeX3 Project and any individual authors listed elsewhere
+% The LaTeX Project and any individual authors listed elsewhere
% in this file.
%
% This file is part of the LaTeX base system.
diff --git a/macros/latex-dev/base/ltboxes.dtx b/macros/latex-dev/base/ltboxes.dtx
index ec192293f1..8281b4b712 100644
--- a/macros/latex-dev/base/ltboxes.dtx
+++ b/macros/latex-dev/base/ltboxes.dtx
@@ -1,7 +1,7 @@
% \iffalse meta-comment
%
% Copyright (C) 1993-2021
-% The LaTeX3 Project and any individual authors listed elsewhere
+% The LaTeX Project and any individual authors listed elsewhere
% in this file.
%
% This file is part of the LaTeX base system.
@@ -33,7 +33,7 @@
%<*driver>
% \fi
\ProvidesFile{ltboxes.dtx}
- [2020/12/05 v1.4a LaTeX Kernel (Box Commands)]
+ [2021/02/10 v1.4b LaTeX Kernel (Box Commands)]
% \iffalse
\documentclass{ltxdoc}
\GetFileInfo{ltboxes.dtx}
@@ -222,7 +222,7 @@
% \changes{v1.0j}{1994/10/18}
% {stuff from ltpatch done}
% \changes{v1.0p}{1994/11/09}
-% {more colour changes\ldots}
+% {more color changes\ldots}
% \changes{v1.0q}{1994/11/17}
% {\cs{@tempa} to \cs{reserved@a}}
% \changes{v1.0t}{1995/05/07}{Use \cs{hb@xt@}}
@@ -422,7 +422,7 @@
% {macro added}
% \changes{v0.1a}{1993/12/03}
% {color support}
-% This macro is initially a no-op, but the colour package will redefine
+% This macro is initially a no-op, but the color package will redefine
% it to insert a |\special|.
% \begin{macrocode}
\let\set@color\relax
@@ -431,38 +431,66 @@
%
% \begin{macro}{\color@begingroup}
% \changes{v1.0b}{1994/03/14}
-% {macro added for colour support}
+% {macro added for color support}
% \begin{macro}{\color@endgroup}
% \changes{v1.0b}{1994/03/14}
-% {macro added for colour support}
+% {macro added for color support}
% \begin{macro}{\color@setgroup}
% \changes{v1.0f}{1994/05/11}
-% {macro added for colour support}
+% {macro added for color support}
% \begin{macro}{\normalcolor}
% \changes{v1.0g}{1994/05/12}
-% {macro added for colour support}
+% {macro added for color support}
% \begin{macro}{\color@hbox}
% \changes{v1.0n}{1994/11/05}
-% {macro added for colour support}
+% {macro added for color support}
% \begin{macro}{\color@vbox}
% \changes{v1.0r}{1994/11/18}
-% {macro added for colour support}
+% {macro added for color support}
% \begin{macro}{\color@endbox}
% \changes{v1.0n}{1994/11/05}
-% {macro added for colour support}
-% These macros are initially a no-op, but the colour package will
+% {macro added for color support}
+% \changes{v1.4b}{2021/02/04}
+% {Always add the color groups (gh/488)}
+% In the past these macros were initially no-ops, and the \pkg{color}
+% package redefined
% redefine them to be |\begingroup|, |\endgroup|,
% |\begingroup\set@color|,\\ |\hbox\bgroup\color@begingroup|,
% |\color@endgroup\egroup|.
-% and \meta{set to main document colour} respectively.
+% and \meta{set to main document color} respectively.
+%
+% Nowadays we always set the group already in the kernel as this makes the
+% coding simpler.
% \begin{macrocode}
-\let\color@begingroup\relax
-\let\color@endgroup\relax
-\let\color@setgroup\relax
-\let\normalcolor\relax
-\let\color@hbox\relax
-\let\color@vbox\relax
-\let\color@endbox\relax
+%</2ekernel>
+%<*2ekernel|latexrelease>
+%<latexrelease>\IncludeInRelease{2021/05/01}%
+%<latexrelease> {\color@begingroup}{color group settings}%
+\let\color@begingroup\begingroup
+\def\color@endgroup{\endgraf\endgroup}
+\def\color@setgroup{\color@begingroup} % changed further in color package
+\let\normalcolor\relax % remains untouched; only changed in a color package
+\def\color@hbox{\hbox\bgroup\color@begingroup}
+\def\color@vbox{\vbox\bgroup\color@begingroup}
+\def\color@endbox{\color@endgroup\egroup}
+%</2ekernel|latexrelease>
+%<latexrelease>\EndIncludeInRelease
+% \end{macrocode}
+%
+% \begin{macrocode}
+%<latexrelease>\IncludeInRelease{0000/00/00}%
+%<latexrelease> {\color@begingroup}{color group settings}%
+%<latexrelease>
+%<latexrelease>\let\color@begingroup\relax
+%<latexrelease>\let\color@endgroup\relax
+%<latexrelease>\let\color@setgroup\relax
+%<latexrelease>\let\normalcolor\relax
+%<latexrelease>\let\color@hbox\relax
+%<latexrelease>\let\color@vbox\relax
+%<latexrelease>\let\color@endbox\relax
+%<latexrelease>
+%<latexrelease>\EndIncludeInRelease
+%<*2ekernel>
% \end{macrocode}
% \end{macro}
% \end{macro}
@@ -1016,7 +1044,7 @@
%
% \begin{macro}{\@iiiminipage}
% \changes{v1.0e}{1994/04/21}
-% {Extra \cs{bgroup} for colour}
+% {Extra \cs{bgroup} for color}
% \changes{v1.0f}{1994/05/11}
% {Use new \cs{color@setgroup} concept.}
% Internal form of |minipage|.
@@ -1054,11 +1082,11 @@
% {(RmS) replaced \cs{vskip}-\cs{lastskip} by \cs{unskip}
% (proposed by FMi)}
% \changes{v1.0e}{1994/04/21}
-% {Extra \cs{egroup} for colour}
+% {Extra \cs{egroup} for color}
% \changes{v1.0f}{1994/05/11}
% {Use new \cs{color@setgroup} concept.}
% \changes{v1.0n}{1994/11/05}
-% {Colour resetting for footnotes moved to here: as for main
+% {Color resetting for footnotes moved to here: as for main
% page.}
% \begin{macrocode}
\def\endminipage{%
@@ -1093,9 +1121,9 @@
% Final |\strut| added 27 Mar 89, on suggestion by Don Hosek
% \changes{LaTeX2.09}{1991/09/29}{(RmS) added \cs{reset@font}}
% \changes{LaTeX2.09}{1992/11/26}{(RmS) added protection for \cs{edef}}
-% \changes{v0.1a}{1994/03/07}{Extra group for colour}
+% \changes{v0.1a}{1994/03/07}{Extra group for color}
% \changes{v1.0e}{1994/04/21}
-% {Extra \cs{endgraf} for colour}
+% {Extra \cs{endgraf} for color}
% \changes{v1.0f}{1994/05/11}
% {Use new \cs{color@setgroup} concept.}
% \changes{v1.0f}{1994/05/11}
@@ -1103,11 +1131,17 @@
% \changes{v1.0m}{1994/11/04}
% {Added \cs{protected@edef}. ASAJ.}
% \changes{v1.0n}{1994/11/05}
-% {Colour resetting for footnotes moved to endminipage: as for main
+% {Color resetting for footnotes moved to endminipage: as for main
% page.}
% \changes{v1.0o}{1994/11/05}
-% {Colour groups restored here.}
+% {Color groups restored here.}
+% \changes{v1.4b}{2021/02/10}
+% {Explicitly run \cs{par} in support for paragraph tagging}
% \begin{macrocode}
+%</2ekernel>
+%<*2ekernel|latexrelease>
+%<latexrelease>\IncludeInRelease{2021/05/01}%
+%<latexrelease> {\@mpfootnotetext}{footnotetext tagging}%
\long\def\@mpfootnotetext#1{%
\global\setbox\@mpfootins\vbox{%
\unvbox\@mpfootins
@@ -1119,7 +1153,31 @@
\color@begingroup
\@makefntext{%
\rule\z@\footnotesep\ignorespaces#1\@finalstrut\strutbox}%
+ \par
\color@endgroup}}
+%</2ekernel|latexrelease>
+%<latexrelease>\EndIncludeInRelease
+% \end{macrocode}
+%
+% \begin{macrocode}
+%<latexrelease>\IncludeInRelease{0000/00/00}%
+%<latexrelease> {\@mpfootnotetext}{footnotetext tagging}%
+%<latexrelease>
+%<latexrelease>\long\def\@mpfootnotetext#1{%
+%<latexrelease> \global\setbox\@mpfootins\vbox{%
+%<latexrelease> \unvbox\@mpfootins
+%<latexrelease> \reset@font\footnotesize
+%<latexrelease> \hsize\columnwidth
+%<latexrelease> \@parboxrestore
+%<latexrelease> \protected@edef\@currentlabel
+%<latexrelease> {\csname p@mpfootnote\endcsname\@thefnmark}%
+%<latexrelease> \color@begingroup
+%<latexrelease> \@makefntext{%
+%<latexrelease> \rule\z@\footnotesep\ignorespaces#1\@finalstrut\strutbox}%
+%<latexrelease> \color@endgroup}}
+%<latexrelease>
+%<latexrelease>\EndIncludeInRelease
+%<*2ekernel>
% \end{macrocode}
% \end{macro}
%
diff --git a/macros/latex-dev/base/ltclass.dtx b/macros/latex-dev/base/ltclass.dtx
index 1400ec0a62..26667cbeb1 100644
--- a/macros/latex-dev/base/ltclass.dtx
+++ b/macros/latex-dev/base/ltclass.dtx
@@ -1,7 +1,7 @@
% \iffalse meta-comment
%
% Copyright (C) 1993-2021
-% The LaTeX3 Project and any individual authors listed elsewhere
+% The LaTeX Project and any individual authors listed elsewhere
% in this file.
%
% This file is part of the LaTeX base system.
@@ -33,7 +33,7 @@
%<*driver>
% \fi
\ProvidesFile{ltclass.dtx}
- [2020/12/17 v1.3v LaTeX Kernel (Class & Package Interface)]
+ [2021/02/18 v1.3x LaTeX Kernel (Class & Package Interface)]
% \iffalse
\documentclass{ltxdoc}
\GetFileInfo{ltclass.dtx}
@@ -712,6 +712,7 @@
% Path to the current file if explicitly given. The auxiliary is
% needed here to insert a \cs{@empty} to prevent the loss of braces.
% \changes{v1.3u}{2020/11/20}{Macro added}
+% \changes{v1.3w}{2021/01/21}{Add empty entry for latexrelease}
% \begin{macrocode}
%</2ekernel>
%<*2ekernel|latexrelease>
@@ -719,6 +720,7 @@
%<latexrelease>\IncludeInRelease{2020/10/01}{\@kernel@currpathstack}%
%<latexrelease> {Add \@kernel@currpathstack}%
\gdef\@kernel@currpathstack{}
+%<latexrelease>\g@addto@macro\@kernel@currpathstack{{}}
\def\@p@pfilepath#1{%
\gdef\@currpath{#1}\@p@pfilepath@aux\@empty}
\def\@p@pfilepath@aux#1\@nil{%
@@ -1164,13 +1166,14 @@
%
% \begin{macro}{\PassOptionsToPackage}
% \begin{macro}{\PassOptionsToClass}
-% 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.
+% 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.
% \changes{v1.3t}{2020/10/18}{Drop path from \cs{input@path} (gh/414).}
+% \changes{v1.3x}{2021/02/18}{save raw option lists (gh/85)}
% \begin{macrocode}
%</2ekernel>
-%<latexrelease>\IncludeInRelease{2020/10/01}{\@pass@ptions}
-%<latexrelease> {Add file replacement in \@pass@ptions}%
+%<latexrelease>\IncludeInRelease{2021/05/01}%
+%<latexrelease> {\@pass@ptions}{Raw option lists}%
%<*2ekernel|latexrelease>
\def\@pass@ptions#1#2#3{%
\@expl@@@filehook@set@curr@file@@nNN
@@ -1187,12 +1190,41 @@
% \begin{macrocode}
\expandafter\let
\csname opt@#3.#1\expandafter\endcsname
- \csname opt@\reserved@a\endcsname}
+ \csname opt@\reserved@a\endcsname
+% \end{macrocode}
+% Extend raw option list
+% \begin{macrocode}
+ \@ifundefined{@raw@opt@#3.#1}%
+ {\expandafter\gdef\csname @raw@opt@#3.#1\endcsname{#2}}%
+ {\expandafter\g@addto@macro\csname @raw@opt@#3.#1\endcsname{,#2}}%
+}
%</2ekernel|latexrelease>
%<latexrelease>\EndIncludeInRelease
+% \end{macrocode}
+%
+% \begin{macrocode}
+%<latexrelease>\IncludeInRelease{2020/10/01}{\@pass@ptions}
+%<latexrelease> {Add file replacement in \@pass@ptions}%
+%<latexrelease>
+%<latexrelease>\def\@pass@ptions#1#2#3{%
+%<latexrelease> \@expl@@@filehook@set@curr@file@@nNN
+%<latexrelease> {\@expl@@@filehook@resolve@file@subst@@w #3.#1\@nil}%
+%<latexrelease> \reserved@a\reserved@b
+%<latexrelease> \@expl@@@filehook@clear@replacement@flag@@
+%<latexrelease> \expandafter\xdef\csname opt@\reserved@a\endcsname{%
+%<latexrelease> \@ifundefined{opt@\reserved@a}\@empty
+%<latexrelease> {\csname opt@\reserved@a\endcsname,}%
+%<latexrelease> \zap@space#2 \@empty}%
+%<latexrelease> \expandafter\let
+%<latexrelease> \csname opt@#3.#1\expandafter\endcsname
+%<latexrelease> \csname opt@\reserved@a\endcsname}
+%<latexrelease>\EndIncludeInRelease
+% \end{macrocode}
%
+% \begin{macrocode}
%<latexrelease>\IncludeInRelease{0000/00/00}{\@pass@ptions}
%<latexrelease> {\@pass@ptions}%
+%<latexrelease>
%<latexrelease>\def\@pass@ptions#1#2#3{%
%<latexrelease> \expandafter\xdef\csname opt@#3.#1\endcsname{%
%<latexrelease> \@ifundefined{opt@#3.#1}\@empty
@@ -1200,6 +1232,9 @@
%<latexrelease> \zap@space#2 \@empty}}
%<latexrelease>\EndIncludeInRelease
%<*2ekernel>
+% \end{macrocode}
+%
+% \begin{macrocode}
\@onlypreamble\@pass@ptions
% \end{macrocode}
%
@@ -1241,18 +1276,49 @@
% \end{macro}
%
% \begin{macro}{\OptionNotUsed}
+% \changes{v1.3x}{2021/02/18}{filter out =value from unused option list (gh/85)}
+% \begin{macro}{\@remove@eq@value}
+% \changes{v1.3x}{2021/02/18}{macro added (gh/85)}
% If we are in a class file, add |\CurrentOption| to the list of
% unused options. Otherwise, in a package file do nothing.
% \begin{macrocode}
+%</2ekernel>
+%<latexrelease>\IncludeInRelease{2021/05/01}%
+%<latexrelease> {\OptionNotUsed}{filter unused option list}%
+%<*2ekernel|latexrelease>
+\def\@remove@eq@value#1=#2\@nil{#1}
+% \end{macrocode}
+%
+% \begin{macrocode}
\def\OptionNotUsed{%
\ifx\@currext\@clsextension
\xdef\@unusedoptionlist{%
\ifx\@unusedoptionlist\@empty\else\@unusedoptionlist,\fi
- \CurrentOption}%
+ \expandafter\@remove@eq@value\CurrentOption=\@nil}%
\fi}
+%</2ekernel|latexrelease>
+%<latexrelease>\EndIncludeInRelease
+%<latexrelease>\IncludeInRelease{0000/00/00}%
+%<latexrelease> {\OptionNotUsed}{filter unused option list}%
+%<latexrelease>\let\@remove@eq@value\@undefined
+% \end{macrocode}
+%
+% \begin{macrocode}
+%<latexrelease>\def\OptionNotUsed{%
+%<latexrelease> \ifx\@currext\@clsextension
+%<latexrelease> \xdef\@unusedoptionlist{%
+%<latexrelease> \ifx\@unusedoptionlist\@empty\else\@unusedoptionlist,\fi
+%<latexrelease> \CurrentOption}%
+%<latexrelease> \fi}
+%<latexrelease>\EndIncludeInRelease
+%<*2ekernel>
+% \end{macrocode}
+%
+% \begin{macrocode}
\@onlypreamble\OptionNotUsed
% \end{macrocode}
% \end{macro}
+% \end{macro}
%
% \begin{macro}{\default@ds}
% The default option code.
@@ -1403,11 +1469,30 @@
% {Name changed from \cs{@executeoption}}
% \changes{v1.0e}{1994/05/17}
% {Execute option after removing from list, not before}
+% \changes{v1.3x}{2021/02/18}{filter out =value from unused option list (gh/85)}
% \begin{macrocode}
+%</2ekernel>
+%<latexrelease>\IncludeInRelease{2021/05/01}%
+%<latexrelease> {\@use@ption}{filter unused option list}%
+%<*2ekernel|latexrelease>
\def\@use@ption{%
- \@expandtwoargs\@removeelement\CurrentOption
+ \@expandtwoargs\@removeelement
+ {\expandafter\@remove@eq@value\CurrentOption=\@nil}%
\@unusedoptionlist\@unusedoptionlist
\csname ds@\CurrentOption\endcsname}
+%</2ekernel|latexrelease>
+%<latexrelease>\EndIncludeInRelease
+%<latexrelease>\IncludeInRelease{0000/00/00}%
+%<latexrelease> {\@use@ption}{filter unused option list}%
+%<latexrelease>\def\@use@ption{%
+%<latexrelease> \@expandtwoargs\@removeelement\CurrentOption
+%<latexrelease> \@unusedoptionlist\@unusedoptionlist
+%<latexrelease> \csname ds@\CurrentOption\endcsname}
+%<latexrelease>\EndIncludeInRelease
+%<*2ekernel>
+% \end{macrocode}
+%
+% \begin{macrocode}
\@onlypreamble\@use@ption
% \end{macrocode}
% \end{macro}
@@ -1721,15 +1806,23 @@
% {Prevent loss of brackets PR/3965}
% \changes{v2.1b}{2016/11/09}
% {Improve \cs{ifx} tests PR/4497}
+% \changes{v1.3x}{2021/02/18}{save raw class option list (gh/85)}
% \begin{macrocode}
%</2ekernel>
-%<latexrelease>\IncludeInRelease{2017/01/01}%
+%<latexrelease>\IncludeInRelease{2020/10/01}%
%<latexrelease> {\@fileswith@pti@ns}{ifx tests in \@fileswith@pti@ns}%
%<*2ekernel|latexrelease>
\def\@fileswith@pti@ns#1[#2]#3[#4]{%
\ifx#1\@clsextension
\ifx\@classoptionslist\relax
\xdef\@classoptionslist{\zap@space#2 \@empty}%
+% \end{macrocode}
+% Save raw class list.
+% \begin{macrocode}
+ \gdef\@raw@classoptionslist{#2}%
+% \end{macrocode}
+%
+% \begin{macrocode}
\def\reserved@a{%
\@onefilewithoptions#3[{#2}][{#4}]#1%
\@documentclasshook}%
@@ -1768,6 +1861,33 @@
\fi
\reserved@a}
%</2ekernel|latexrelease>
+%<latexrelease>\EndIncludeInRelease
+%<latexrelease>\IncludeInRelease{2017/01/01}%
+%<latexrelease> {\@fileswith@pti@ns}{ifx tests in \@fileswith@pti@ns}%
+%<latexrelease>\def\@fileswith@pti@ns#1[#2]#3[#4]{%
+%<latexrelease> \ifx#1\@clsextension
+%<latexrelease> \ifx\@classoptionslist\relax
+%<latexrelease> \xdef\@classoptionslist{\zap@space#2 \@empty}%
+%<latexrelease> \def\reserved@a{%
+%<latexrelease> \@onefilewithoptions#3[{#2}][{#4}]#1%
+%<latexrelease> \@documentclasshook}%
+%<latexrelease> \else
+%<latexrelease> \def\reserved@a{%
+%<latexrelease> \@onefilewithoptions#3[{#2}][{#4}]#1}%
+%<latexrelease> \fi
+%<latexrelease> \else
+%<latexrelease> \def\reserved@b##1,{%
+%<latexrelease> \ifx\@nnil##1\relax\else
+%<latexrelease> \ifx\@nnil##1\@nnil\else
+%<latexrelease> \noexpand\@onefilewithoptions##1[{#2}][{#4}]%
+%<latexrelease> \noexpand\@pkgextension
+%<latexrelease> \fi
+%<latexrelease> \expandafter\reserved@b
+%<latexrelease> \fi}%
+%<latexrelease> \edef\reserved@a{\zap@space#3 \@empty}%
+%<latexrelease> \edef\reserved@a{\expandafter\reserved@b\reserved@a,\@nnil,}%
+%<latexrelease> \fi
+%<latexrelease> \reserved@a}
% \end{macrocode}
%
% \begin{macrocode}
@@ -2640,7 +2760,8 @@
% Text before the |\end|, write it with a warning.
% \begin{macrocode}
\@latex@warning{Writing text `##1' before %
- \string\end{\@currenvir}\MessageBreak as last line of \@curr@file}%
+ \string\end{\@currenvir}\MessageBreak
+ as last line of \@curr@file}%
\immediate\write\reserved@c{##1}%
\fi%
\ifx\relax##2\relax%
@@ -2675,7 +2796,8 @@
%</2ekernel|latexrelease>
%<latexrelease>\EndIncludeInRelease
%<latexrelease>\IncludeInRelease{2019/10/01}%
-%<latexrelease> {\filec@ntents}{Spaces in file names + optional arg}%
+%<latexrelease> {\filec@ntents}{Spaces in file names + optional arg}%
+%<latexrelease>
%<latexrelease>\def\filecontents{\@tempswatrue\@fileswtrue
%<latexrelease> \@ifnextchar[\filec@ntents@opt\filec@ntents
%<latexrelease>}
@@ -2805,7 +2927,7 @@
%<latexrelease>\endgroup%
%<latexrelease>\EndIncludeInRelease
%<latexrelease>\IncludeInRelease{0000/00/00}%
-%<latexrelease> {\filec@ntents}{Spaces in file names + optional arg}%
+%<latexrelease> {\filec@ntents}{Spaces in file names + optional arg}%
%<latexrelease>
%<latexrelease>\let\filec@ntents@opt \@undefined
%<latexrelease>\let\filec@ntents@force \@undefined
diff --git a/macros/latex-dev/base/ltcmd.dtx b/macros/latex-dev/base/ltcmd.dtx
new file mode 100644
index 0000000000..26ce75224f
--- /dev/null
+++ b/macros/latex-dev/base/ltcmd.dtx
@@ -0,0 +1,4041 @@
+% \iffalse meta-comment
+%
+% Copyright (C) 1999 Frank Mittelbach, Chris Rowley, David Carlisle
+% Copyright (C) 2004-2008 Frank Mittelbach, The LaTeX3 Project
+% Copyright (C) 2009-2021
+% The LaTeX Project and any individual authors listed elsewhere
+% in this file.
+%
+% This file is part of the LaTeX base system.
+% -------------------------------------------
+%
+% It may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3c
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% https://www.latex-project.org/lppl.txt
+% and version 1.3c or later is part of all distributions of LaTeX
+% version 2008 or later.
+%
+% This file has the LPPL maintenance status "maintained".
+%
+% The list of all files belonging to the LaTeX base distribution is
+% given in the file `manifest.txt'. See also `legal.txt' for additional
+% information.
+%
+% The list of derived (unpacked) files belonging to the distribution
+% and covered by LPPL is defined by the unpacking scripts (with
+% extension .ins) which are part of the distribution.
+%
+% \fi
+%
+% \iffalse
+%
+%%% From File: ltcmd.dtx
+%
+% \begin{macrocode}
+\def\ltcmdversion{v1.0a}
+\def\ltcmddate{2021/01/21}
+% \end{macrocode}
+%
+%<*driver>
+% \fi
+\ProvidesFile{ltcmd.dtx}
+ [2020-11-20 v1.0 LaTeX Kernel (Document commands)]
+% \iffalse
+\documentclass{l3doc}
+\GetFileInfo{ltcmd.dtx}
+\title{\filename}
+\date{\filedate}
+\author{Frank Mittelbach, Chris Rowley, David Carlisle, \LaTeX{} Project Team}
+\begin{document}
+ \maketitle
+ \DocInput{ltcmd.dtx}
+\end{document}
+%</driver>
+% \fi
+%
+% \section{Creating document commands}
+%
+% \changes{v1.0}{2020-11-20}{Initial version derived from \texttt{xparse.dtx}}
+%
+% Document commands should be created using the tools provided by this module:
+% \cs{NewDocumentCommand}, etc.\@, in almost all cases. This allows clean
+% separation of document-level syntax from code-level interfaces. Users have
+% a need to create new document commands, and as such a significant amount of
+% documentation for \pkg{ltcmd} is provided as part of \texttt{usrguide3}. Here,
+% additional material aimed at programmers is provided
+%
+% \StopEventually{}
+%
+% \begin{macrocode}
+%<@@=cmd>
+% \end{macrocode}
+%
+% \begin{macrocode}
+%<*2ekernel>
+\message{document commands,}
+%</2ekernel>
+% \end{macrocode}
+%
+% \pkg{ltcmd} code contains an |^^@| character, which usually has
+% catcode~15, so \cs{IncludeInRelease} will break when this code is
+% being skipped, so we'll save the catcode of |^^@| to restore later:
+% \begin{macrocode}
+%<*2ekernel|latexrelease>
+%<latexrelease>\edef\@latexrelease@catcode@null{\the\catcode`\^^@ }
+%<latexrelease>\catcode`\^^@=12
+%<latexrelease>\IncludeInRelease{2021/05/01}%
+%<latexrelease> {\NewDocumentCommand}{Document commands}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+\ExplSyntaxOn
+% \end{macrocode}
+%
+% \subsection{Variables and constants}
+%
+% \begin{variable}{\l_@@_arg_spec_tl}
+% Holds the argument specification after normalization of shorthands.
+% \begin{macrocode}
+\tl_new:N \l_@@_arg_spec_tl
+% \end{macrocode}
+% \end{variable}
+%
+% \begin{variable}{\l_@@_args_tl}
+% Token list variable for grabbed arguments.
+% \begin{macrocode}
+\tl_new:N \l_@@_args_tl
+% \end{macrocode}
+% \end{variable}
+%
+% \begin{variable}{\l_@@_args_i_tl, \l_@@_args_ii_tl}
+% Hold the modified arguments when dealing with default values or
+% processors.
+% \begin{macrocode}
+\tl_new:N \l_@@_args_i_tl
+\tl_new:N \l_@@_args_ii_tl
+% \end{macrocode}
+% \end{variable}
+%
+% \begin{variable}{\l_@@_current_arg_int}
+% The number of the current argument being set up: this is used to
+% make sure there are at most 9 arguments, then for creating the
+% expandable auxiliary functions and knowing how many arguments the
+% code function should take.
+% \begin{macrocode}
+\int_new:N \l_@@_current_arg_int
+% \end{macrocode}
+% \end{variable}
+%
+% \begin{variable}{\l_@@_defaults_bool, \l_@@_defaults_tl}
+% The boolean indicates whether there are any argument with default
+% value other than |-NoValue-|; the token list holds the code to
+% determine these default values in terms of other arguments.
+% \begin{macrocode}
+\bool_new:N \l_@@_defaults_bool
+\tl_new:N \l_@@_defaults_tl
+% \end{macrocode}
+% \end{variable}
+%
+% \begin{variable}{\l_@@_environment_bool}
+% Generating environments uses the same mechanism as generating functions.
+% However, full processing of arguments is always needed for environments,
+% and so the function-generating code needs to know this.
+% This variable is also used at run time to give correct error messages.
+% \begin{macrocode}
+\bool_new:N \l_@@_environment_bool
+% \end{macrocode}
+% \end{variable}
+%
+% \begin{variable}{\l_@@_environment_str}
+% Name of the environment, used at definition time and at run time.
+% \begin{macrocode}
+\str_new:N \l_@@_environment_str
+% \end{macrocode}
+% \end{variable}
+%
+% \begin{variable}{\l_@@_expandable_bool}
+% Used to indicate if an expandable command is begin generated, as this
+% affects both the acceptable argument types and how they are implemented.
+% \begin{macrocode}
+\bool_new:N \l_@@_expandable_bool
+% \end{macrocode}
+% \end{variable}
+%
+% \begin{variable}{\l_@@_expandable_aux_name_tl}
+% Used to create pretty-printing names for the auxiliaries: although the
+% immediate definition does not vary, the full expansion does and so it
+% does not count as a constant.
+% \begin{macrocode}
+\tl_new:N \l_@@_expandable_aux_name_tl
+\tl_set:Nn \l_@@_expandable_aux_name_tl
+ {
+ \l_@@_function_tl \c_space_tl
+ ( arg~ \int_use:N \l_@@_current_arg_int )
+ }
+% \end{macrocode}
+% \end{variable}
+%
+% \begin{variable}{\g_@@_grabber_int}
+% Used (in exceptional cases) to get unique names for grabbers used by
+% expandable commands.
+% \begin{macrocode}
+\int_new:N \g_@@_grabber_int
+% \end{macrocode}
+% \end{variable}
+%
+% \begin{variable}{\l_@@_fn_tl}
+% For passing the pre-formed name of the auxiliary to be used as the
+% parsing function.
+% \begin{macrocode}
+\tl_new:N \l_@@_fn_tl
+% \end{macrocode}
+% \end{variable}
+%
+% \begin{variable}{\l_@@_fn_code_tl}
+% For passing the pre-formed name of the auxiliary that contains the
+% actual code.
+% \begin{macrocode}
+\tl_new:N \l_@@_fn_code_tl
+% \end{macrocode}
+% \end{variable}
+%
+% \begin{variable}{\l_@@_function_tl}
+% Holds the control sequence name of the function currently being
+% defined: used to avoid passing this as an argument and to avoid repeated
+% use of \cs{cs_to_str:N}.
+% \begin{macrocode}
+\tl_new:N \l_@@_function_tl
+% \end{macrocode}
+% \end{variable}
+%
+% \begin{variable}{\l_@@_grab_expandably_bool}
+% When defining a non-expandable command, indicates whether the
+% arguments can all safely be grabbed by expandable grabbers. This is
+% to support abuses of \pkg{xparse} that use protected functions
+% inside csname constructions.
+% \begin{macrocode}
+\bool_new:N \l_@@_grab_expandably_bool
+% \end{macrocode}
+% \end{variable}
+%
+% \begin{variable}{\l_@@_obey_spaces_bool}
+% For trailing optionals.
+% \begin{macrocode}
+\bool_new:N \l_@@_obey_spaces_bool
+% \end{macrocode}
+% \end{variable}
+%
+% \begin{variable}{\l_@@_last_delimiters_tl}
+% Holds the delimiters (first tokens) of all optional arguments since
+% the previous mandatory argument, to warn about cases where it would
+% be impossible to omit optional arguments completely because the
+% following mandatory argument has the same delimiter as one of the
+% optional arguments.
+% \begin{macrocode}
+\tl_new:N \l_@@_last_delimiters_tl
+% \end{macrocode}
+% \end{variable}
+%
+% \begin{variable}{\l_@@_long_bool}
+% Used to indicate that an argument is long, on a per-argument basis.
+% \begin{macrocode}
+\bool_new:N \l_@@_long_bool
+% \end{macrocode}
+% \end{variable}
+%
+% \begin{variable}{\l_@@_m_args_int}
+% The number of \texttt{m} arguments: if this is the same as the total
+% number of arguments, then a short-cut can be taken in the creation of
+% the grabber code.
+% \begin{macrocode}
+\int_new:N \l_@@_m_args_int
+% \end{macrocode}
+% \end{variable}
+%
+% \begin{variable}{\l_@@_prefixed_bool}
+% When preparing the signature of non-expandable commands, indicates
+% that the current argument is affected by a processor or by |+|
+% (namely is long).
+% \begin{macrocode}
+\bool_new:N \l_@@_prefixed_bool
+% \end{macrocode}
+% \end{variable}
+%
+% \begin{variable}{\l_@@_process_all_tl, \l_@@_process_one_tl, \l_@@_process_some_bool}
+% When preparing the signature, the processors that will be applied to
+% a given argument are collected in \cs{l_@@_process_one_tl}, while
+% \cs{l_@@_process_all_tl} contains processors for all arguments. The
+% boolean indicates whether there are any processors (to bypass the
+% whole endeavour otherwise).
+% \begin{macrocode}
+\tl_new:N \l_@@_process_all_tl
+\tl_new:N \l_@@_process_one_tl
+\bool_new:N \l_@@_process_some_bool
+% \end{macrocode}
+% \end{variable}
+%
+% \begin{variable}{\l_@@_saved_args_tl}
+% Stores \cs{l_@@_args_tl} to deal with space-trimming of
+% \texttt{b}-type arguments.
+% \begin{macrocode}
+\tl_new:N \l_@@_saved_args_tl
+% \end{macrocode}
+% \end{variable}
+%
+% \begin{variable}{\l_@@_signature_tl}
+% Used when constructing the signature (code for argument grabbing) to
+% hold what will become the implementation of the main function.
+% When arguments are grabbed (at point of use of the command/environment),
+% it also stores the code for grabbing the remaining arguments.
+% \begin{macrocode}
+\tl_new:N \l_@@_signature_tl
+% \end{macrocode}
+% \end{variable}
+%
+% \begin{variable}
+% {\l_@@_some_obey_spaces_bool, \l_@@_some_long_bool, \l_@@_some_short_bool}
+% These flags are set while normalizing the argument specification.
+% The \texttt{obey_spaces} one is used to detect when |!| is used on
+% an argument that is not a trailing optional argument.
+% The other two are used to check whether all short arguments appear
+% before long arguments: this is needed to grab arguments expandably.
+% As soon as the first long argument is seen (other than
+% \texttt{t}-type, whose long status is ignored) the
+% \texttt{some_long} flag is set. The \texttt{some_short} flag is
+% used for expandable commands, to know whether to define a short
+% auxiliary too.
+% \begin{macrocode}
+\bool_new:N \l_@@_some_obey_spaces_bool
+\bool_new:N \l_@@_some_long_bool
+\bool_new:N \l_@@_some_short_bool
+% \end{macrocode}
+% \end{variable}
+%
+% \begin{variable}{\l_@@_tmp_prop, \l_@@_tmpa_tl, \l_@@_tmpb_tl}
+% \begin{macro}{\@@_tmp:w}
+% Scratch space.
+% \begin{macrocode}
+\prop_new:N \l_@@_tmp_prop
+\tl_new:N \l_@@_tmpa_tl
+\tl_new:N \l_@@_tmpb_tl
+\cs_new_eq:NN \@@_tmp:w ?
+% \end{macrocode}
+% \end{macro}
+% \end{variable}
+%
+% With \pkg{xparse}, information about commands being (re)defined was
+% switched off by default, unless the |log-declarations| package
+% option was used, so here we'll switch that off as well.
+% \begin{macrocode}
+\msg_redirect_module:nnn { LaTeX / ltcmd } { info } { none }
+% \end{macrocode}
+%
+% \subsection{Declaring commands and environments}
+%
+% \begin{macro}{\@@_declare_cmd:Nnn, \@@_declare_expandable_cmd:Nnn}
+% \begin{macro}{\@@_declare_cmd_aux:Nnn}
+% \begin{macro}
+% {\@@_declare_cmd_internal:Nnnn, \@@_declare_cmd_internal:cnxn}
+% The main functions for creating commands set the appropriate flag then
+% use the same internal code to do the definition.
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_declare_cmd:Nnn
+ {
+ \bool_set_false:N \l_@@_expandable_bool
+ \@@_declare_cmd_aux:Nnn
+ }
+\cs_new_protected:Npn \@@_declare_expandable_cmd:Nnn
+ {
+ \bool_set_true:N \l_@@_expandable_bool
+ \@@_declare_cmd_aux:Nnn
+ }
+% \end{macrocode}
+% The first stage is to log information, both for the user in the log and
+% for programmatic use in a property list of all declared commands.
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_declare_cmd_aux:Nnn #1#2#3
+ {
+ \cs_if_exist:NTF #1
+ {
+ \__kernel_msg_info:nnxx { ltcmd } { redefine-command }
+ { \token_to_str:N #1 } { \tl_to_str:n {#2} }
+ }
+ {
+ \bool_lazy_or:nnT
+ { \cs_if_exist_p:c { \cs_to_str:N #1 ~ code } }
+ { \cs_if_exist_p:c { \cs_to_str:N #1 ~ defaults } }
+ {
+ \__kernel_msg_warning:nnx { ltcmd } { unsupported-let }
+ { \token_to_str:N #1 }
+ }
+ \__kernel_msg_info:nnxx { ltcmd } { define-command }
+ { \token_to_str:N #1 } { \tl_to_str:n {#2} }
+ }
+ \bool_set_false:N \l_@@_environment_bool
+ \@@_declare_cmd_internal:Nnnn #1 {#2} {#3} { }
+ }
+% \end{macrocode}
+% At definition time, the variable \cs{l_@@_fn_tl} is only used for error messages.
+% The real business of defining a document command starts with setting up
+% the appropriate name, then normalizing the argument specification to get rid of
+% shorthands.
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_declare_cmd_internal:Nnnn #1#2#3#4
+ {
+ \tl_set:Nx \l_@@_function_tl { \cs_to_str:N #1 }
+ \tl_set:Nx \l_@@_fn_tl
+ { \exp_not:c { \l_@@_function_tl \c_space_tl } }
+ \@@_normalize_arg_spec:n {#2}
+ \exp_args:No \@@_prepare_signature:n \l_@@_arg_spec_tl
+ \@@_declare_cmd_code:Nnn #1 {#2} {#3}
+ #4
+ \@@_break_point:n {#2}
+ }
+\cs_generate_variant:Nn \@@_declare_cmd_internal:Nnnn { cnx }
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\@@_break_point:n}
+% A marker used to escape from creating a definition if necessary.
+% \begin{macrocode}
+\cs_new_eq:NN \@@_break_point:n \use_none:n
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@@_declare_cmd_code:Nnn}
+% \begin{macro}
+% {\@@_declare_cmd_code_aux:Nnn, \@@_declare_cmd_code_expandable:Nnn}
+% The appropriate auxiliary is called.
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_declare_cmd_code:Nnn
+ {
+ \bool_if:NTF \l_@@_grab_expandably_bool
+ { \@@_declare_cmd_code_expandable:Nnn }
+ { \@@_declare_cmd_code_aux:Nnn }
+ }
+% \end{macrocode}
+% Standard functions call \cs{@@_start:nNNnnn}, which receives the
+% argument specification, an auxiliary used for
+% grabbing arguments, an auxiliary containing the code, and then the
+% signature, default arguments, and processors.
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_declare_cmd_code_aux:Nnn #1#2#3
+ {
+ \cs_generate_from_arg_count:cNnn
+ { \l_@@_function_tl \c_space_tl code }
+ \cs_set_protected:Npn \l_@@_current_arg_int {#3}
+ \cs_set_protected_nopar:Npx #1
+ {
+ \bool_if:NTF \l_@@_environment_bool
+ {
+ \@@_start_env:nnnnn { \exp_not:n {#2} }
+ { \l_@@_environment_str }
+ }
+ {
+ \@@_start:nNNnnn { \exp_not:n {#2} }
+ \exp_not:c { \l_@@_function_tl \c_space_tl }
+ \exp_not:c { \l_@@_function_tl \c_space_tl code }
+ }
+ { \exp_not:o \l_@@_signature_tl }
+ {
+ \bool_if:NT \l_@@_defaults_bool
+ { \exp_not:o \l_@@_defaults_tl }
+ }
+ {
+ \bool_if:NT \l_@@_process_some_bool
+ { \exp_not:o \l_@@_process_all_tl }
+ }
+ }
+ }
+% \end{macrocode}
+% Expandable functions and functions whose arguments can be grabbed
+% expandably call \cs{@@_start_expandable:nNNNNn}, which receives the
+% argument specification, four auxiliaries (two for grabbing arguments, one for
+% the code, and one for default arguments), and finally the signature.
+% Non-expandable functions that take this branch should nevertheless
+% be protected, as well as their \texttt{code} function. They will
+% only be expanded in contexts such as constructing a csname.
+% The two grabbers (named after the function with one or two spaces)
+% are needed when there are both short and long arguments; otherwise
+% the same grabber is included twice in the definition. If all
+% arguments are long or all are short the (only) grabber is defined
+% correspondingly to be long/short. Otherwise two grabbers are
+% defined, one long, one short.
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_declare_cmd_code_expandable:Nnn #1#2#3
+ {
+ \exp_args:Ncc \cs_generate_from_arg_count:NNnn
+ { \l_@@_function_tl \c_space_tl code }
+ { cs_set \bool_if:NF \l_@@_expandable_bool { _protected } :Npn }
+ \l_@@_current_arg_int {#3}
+ \bool_if:NT \l_@@_defaults_bool
+ {
+ \use:x
+ {
+ \cs_generate_from_arg_count:cNnn
+ { \l_@@_function_tl \c_space_tl defaults }
+ \cs_set:Npn \l_@@_current_arg_int
+ { \exp_not:o \l_@@_defaults_tl }
+ }
+ }
+ \bool_if:NTF \l_@@_expandable_bool
+ { \cs_set_nopar:Npx } { \cs_set_protected_nopar:Npx } #1
+ {
+ \exp_not:N \@@_start_expandable:nNNNNn
+ { \exp_not:n {#2} }
+ \exp_not:c { \l_@@_function_tl \c_space_tl }
+ \exp_not:c
+ {
+ \l_@@_function_tl \c_space_tl
+ \bool_if:NT \l_@@_some_short_bool
+ { \bool_if:NT \l_@@_some_long_bool { \c_space_tl } }
+ }
+ \exp_not:c { \l_@@_function_tl \c_space_tl code }
+ \bool_if:NTF \l_@@_defaults_bool
+ { \exp_not:c { \l_@@_function_tl \c_space_tl defaults } }
+ { ? }
+ { \exp_not:o \l_@@_signature_tl }
+ }
+ \bool_if:NTF \l_@@_some_long_bool
+ {
+ \bool_if:NT \l_@@_some_short_bool
+ {
+ \cs_set_nopar:cpx { \l_@@_function_tl \c_space_tl \c_space_tl }
+ ##1##2 { ##1 {##2} }
+ }
+ \cs_set:cpx
+ }
+ { \cs_set_nopar:cpx }
+ { \l_@@_function_tl \c_space_tl } ##1##2 { ##1 {##2} }
+ }
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\@@_declare_env:nnnn}
+% \begin{macro}{\@@_declare_env_internal:nnnn}
+% The lead-off to creating an environment is much the same as that for
+% creating a command: issue the appropriate message, store the argument
+% specification then hand off to an internal function.
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_declare_env:nnnn #1#2
+ {
+ \str_set:Nx \l_@@_environment_str {#1}
+ \str_set:Nx \l_@@_environment_str
+ { \tl_trim_spaces:o { \l_@@_environment_str } }
+ \cs_if_exist:cTF { \l_@@_environment_str }
+ {
+ \__kernel_msg_info:nnxx { ltcmd } { redefine-environment }
+ { \l_@@_environment_str } { \tl_to_str:n {#2} }
+ }
+ {
+ \__kernel_msg_info:nnxx { ltcmd } { define-environment }
+ { \l_@@_environment_str } { \tl_to_str:n {#2} }
+ }
+ \bool_set_false:N \l_@@_expandable_bool
+ \bool_set_true:N \l_@@_environment_bool
+ \exp_args:NV \@@_declare_env_internal:nnnn
+ \l_@@_environment_str {#2}
+ }
+% \end{macrocode}
+% Creating a document environment requires a few more steps than creating
+% a single command. In order to pass the arguments of the command to the
+% end of the function, it is necessary to store the grabbed arguments.
+% To do that, the function used at the end of the environment has to be
+% redefined to contain the appropriate information. To minimize the amount
+% of expansion at point of use, the code here is expanded now as well as
+% when used.
+% The last argument of \cs{@@_declare_cmd_internal:Nnnn} is only run
+% if the definition succeeded. In package mode this ensures that the
+% original definition of the environment is not changed if the
+% definition fails for any reason. This also avoids an error when
+% defining the \verb*|end aux | function when the user asks for more
+% than $9$ arguments.
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_declare_env_internal:nnnn #1#2#3#4
+ {
+ \@@_declare_cmd_internal:cnxn { environment~ #1 } {#2}
+ {
+ \cs_set_nopar:Npx \exp_not:c { environment~ #1 ~end~aux }
+ {
+ \exp_not:N \exp_not:N \exp_not:c { environment~ #1~end~aux~ }
+ \exp_not:n { \exp_not:o \l_@@_args_tl }
+ }
+ \exp_not:n {#3}
+ }
+ {
+ \cs_set_nopar:cpx { environment~ #1 ~end }
+ { \exp_not:c { environment~ #1 ~end~aux } }
+ \cs_generate_from_arg_count:cNnn
+ { environment~ #1 ~end~aux~ } \cs_set:Npn
+ \l_@@_current_arg_int {#4}
+ \cs_set_eq:cc {#1} { environment~ #1 }
+ \cs_set_eq:cc { end #1 } { environment~ #1 ~end }
+ }
+ }
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \subsection{Structure of \pkg{xparse} commands}
+%
+% \begin{macro}{\@@_start_env:nnnnn, \@@_start:nNNnnn}
+% For error messages that occur during run-time when getting arguments
+% of environments it is necessary to keep track of the environment
+% name. We begin non-expandable commands with a token equal to
+% \cs{scan_stop:}, whose name gives a reasonable error message if the
+% command is used inside a csname and protects against
+% \texttt{f}-expansion. This is useless for environments since
+% \cs{begin} is already not expandable. Both the command and
+% environment codes start with \cs{group_align_safe_begin:}, then
+% \cs{@@_run_code:} (used by both) does \cs{group_align_safe_end:}, so
+% that delimited arguments may be grabbed in alignments if they
+% contain and alignment tab token (see latex3/latex3/issues/839).
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_start_env:nnnnn #1#2
+ {
+ \conditionally@traceoff
+ \group_align_safe_begin:
+ \str_set:Nn \l_@@_environment_str {#2}
+ \bool_set_true:N \l_@@_environment_bool
+ \@@_start_aux:ccnnnn
+ { environment~ \l_@@_environment_str \c_space_tl }
+ { environment~ \l_@@_environment_str \c_space_tl code }
+ {#1}
+ }
+\cs_new_protected:Npx \@@_start:nNNnnn #1#2#3
+ {
+ \exp_not:c { xparse~function~is~not~expandable }
+ \exp_not:N \conditionally@traceoff
+ \exp_not:N \group_align_safe_begin:
+ \exp_not:n { \bool_set_false:N \l_@@_environment_bool }
+ \exp_not:N \@@_start_aux:NNnnnn
+ #2 #3 {#1}
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@@_start_aux:NNnnnn, \@@_start_aux:ccnnnn}
+% This sets up a few variables to minimize the boilerplate code
+% included in all \pkg{xparse}-defined commands. It then runs the
+% grabbers~|#4|. Again, the argument specification |#1| is only for
+% diagnostics.
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_start_aux:NNnnnn #1#2#3#4#5#6
+ {
+ \tl_clear:N \l_@@_args_tl
+ \tl_set:Nn \l_@@_fn_tl {#1}
+ \tl_set:Nn \l_@@_fn_code_tl {#2}
+ \tl_set:Nn \l_@@_defaults_tl {#5}
+ \tl_set:Nn \l_@@_process_all_tl {#6}
+ #4 \@@_run_code:
+ }
+\cs_generate_variant:Nn \@@_start_aux:NNnnnn { cc }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@@_run_code:}
+% After arguments are grabbed, this function is responsible for
+% inserting default values, running processors, and finally doing
+% \cs{group_align_safe_end:} as promised, and running the code.
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_run_code:
+ {
+ \tl_if_empty:NF \l_@@_defaults_tl { \@@_defaults: }
+ \tl_if_empty:NF \l_@@_process_all_tl { \@@_args_process: }
+ \group_align_safe_end:
+ \conditionally@traceon
+ \exp_after:wN \l_@@_fn_code_tl \l_@@_args_tl
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@@_defaults:}
+% \begin{macro}{\@@_defaults_def:, \@@_defaults_def:nn, \@@_defaults_def:nnn}
+% \begin{macro}{\@@_defaults_aux:, \@@_defaults_error:w}
+% First construct \cs{@@_tmp:w} (see below) that will receive
+% the arguments found so far and determine default values for any
+% missing argument. Then call it repeatedly until the set of
+% arguments stabilizes. Since that could lead to an infinite loop we
+% only call it up to nine times, the maximal number needed for
+% stabilization if there is a chain of arguments that depend on each
+% other. If that fails to stabilize raise an error.
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_defaults:
+ {
+ \@@_defaults_def:
+ \tl_set_eq:NN \l_@@_args_i_tl \l_@@_args_tl
+ \@@_defaults_aux: \@@_defaults_aux: \@@_defaults_aux:
+ \@@_defaults_aux: \@@_defaults_aux: \@@_defaults_aux:
+ \@@_defaults_aux: \@@_defaults_aux: \@@_defaults_aux:
+ \@@_defaults_error:w
+ \q_recursion_stop
+ \tl_set_eq:NN \l_@@_args_tl \l_@@_args_i_tl
+ }
+\cs_new_protected:Npn \@@_defaults_aux:
+ {
+ \tl_set:Nx \l_@@_args_ii_tl
+ { \exp_after:wN \@@_tmp:w \l_@@_args_i_tl }
+ \tl_if_eq:NNT \l_@@_args_ii_tl \l_@@_args_i_tl
+ { \use_none_delimit_by_q_recursion_stop:w }
+ \tl_set_eq:NN \l_@@_args_i_tl \l_@@_args_ii_tl
+ }
+\cs_new_protected:Npn \@@_defaults_error:w \q_recursion_stop
+ {
+ \__kernel_msg_error:nnx { ltcmd } { loop-in-defaults }
+ { \@@_environment_or_command: }
+ }
+% \end{macrocode}
+% To construct \cs{@@_tmp:w}, first go through the arguments
+% found and the corresponding defaults, building a token list with
+% |{#|\meta{arg number}|}| for arguments found in the input (whose
+% default will not be used) and otherwise
+% |{|\cs{exp_not:n}\Arg{default}|}| for arguments whose default will
+% be used.
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_defaults_def:
+ {
+ \tl_clear:N \l_@@_tmpa_tl
+ \int_zero:N \l_@@_current_arg_int
+ \@@_tl_mapthread_function:NNN \l_@@_args_tl \l_@@_defaults_tl
+ \@@_defaults_def:nn
+ \cs_generate_from_arg_count:NNVo \@@_tmp:w \cs_set:Npn
+ \l_@@_current_arg_int \l_@@_tmpa_tl
+ }
+\cs_generate_variant:Nn \cs_generate_from_arg_count:NNnn { NNVo }
+\cs_new_protected:Npn \@@_defaults_def:nn
+ {
+ \int_incr:N \l_@@_current_arg_int
+ \exp_args:NV \@@_defaults_def:nnn \l_@@_current_arg_int
+ }
+\cs_new_protected:Npn \@@_defaults_def:nnn #1#2#3
+ {
+ \tl_put_right:Nx \l_@@_tmpa_tl
+ {
+ {
+ \exp_not:N \exp_not:n
+ {
+ \tl_if_novalue:nTF {#2}
+ { \exp_not:o {#3} }
+ { \exp_not:n { ## #1 } }
+ }
+ }
+ }
+ }
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\@@_args_process:}
+% \begin{macro}{\@@_args_process_loop:nn, \@@_args_process_aux:n}
+% Loop through arguments (stored in \cs{l_@@_args_tl}) and the
+% corresponding processors (in \cs{l_@@_process_all_tl})
+% simultaneously, apply all processors for each argument and store the
+% result back into \cs{l_@@_args_tl}. To allow processors to depend
+% on other arguments, for every processor define a temporary auxiliary
+% that receives all arguments \cs{l_@@_args_tl}.
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_args_process:
+ {
+ \tl_clear:N \l_@@_args_ii_tl
+ \@@_tl_mapthread_function:NNN
+ \l_@@_args_tl
+ \l_@@_process_all_tl
+ \@@_args_process_loop:nn
+ \tl_set_eq:NN \l_@@_args_tl \l_@@_args_ii_tl
+ }
+\cs_new_protected:Npn \@@_args_process_loop:nn #1#2
+ {
+ \tl_set:Nn \ProcessedArgument {#1}
+ \tl_if_novalue:nF {#1}
+ { \tl_map_function:nN {#2} \@@_args_process_aux:n }
+ \tl_put_right:No \l_@@_args_ii_tl
+ { \exp_after:wN { \ProcessedArgument } }
+ }
+\cs_new_protected:Npn \@@_args_process_aux:n #1
+ {
+ \cs_generate_from_arg_count:NNnn \@@_tmp:w \cs_set:Npn
+ { \tl_count:N \l_@@_args_tl } {#1}
+ \exp_args:NNNo \exp_after:wN \@@_tmp:w \l_@@_args_tl
+ { \ProcessedArgument }
+ }
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}[EXP]{\@@_start_expandable:nNNNNn}
+% This is called for all expandable commands. |#6| is the signature,
+% responsible for grabbing arguments. |#5| is used to determine
+% default values (or is |?| if there are none). |#4| is the code to run.
+% |#2|~and~|#3| are functions (named after the command) that grab a single
+% argument in the input stream (|#3|~is~short). The argument specification |#1| is
+% only used by diagnostic functions. Same as for the non-expandable
+% version, this starts with \cs{group_align_safe_begin:}, which
+% expands to nothing, so may be safely used in an expandable context.
+% \begin{macrocode}
+\cs_new:Npn \@@_start_expandable:nNNNNn #1#2#3#4#5#6
+ {
+ \group_align_safe_begin:
+ #6 \@@_end_expandable:NNw #5 #4 \q_@@ #2#3
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[EXP]{\@@_end_expandable:NNw}
+% \begin{macro}[EXP]{\@@_end_expandable_aux:w}
+% \begin{macro}[EXP]{\@@_end_expandable_aux:nNNNN}
+% \begin{macro}[EXP]{\@@_end_expandable_defaults:nnnNNn}
+% \begin{macro}[EXP]{\@@_end_expandable_defaults:nnw}
+% \begin{macro}[EXP]{\@@_end_expandable_defaults:nw}
+% Followed by a function |#1| to determine default values (or |?| if
+% there are no defaults), the code
+% |#2|, arguments that have been grabbed, then \cs{q_@@} and two generic
+% grabbers. The idea to find default values is similar to the
+% non-expandable case but we cannot define an auxiliary function, so
+% at every step in the loop we need to go through all arguments
+% searching for which ones started out as |-NoValue-| and replacing
+% these by the newly computed values. In fact we need to keep track
+% of three versions of all arguments: the original version, the
+% previous version with default values, and the currently built
+% version (first argument of \cs{@@_end_expandable_defaults:nnnNNn}).
+% \begin{macrocode}
+\cs_new:Npn \@@_end_expandable:NNw #1#2
+ { \@@_end_expandable_aux:w #1#2 \prg_do_nothing: }
+\cs_new:Npn \@@_end_expandable_aux:w #1#2#3 \q_@@
+ { \exp_args:No \@@_end_expandable_aux:nNNNN {#3} #1 #2 }
+\cs_new:Npn \@@_end_expandable_aux:nNNNN #1#2#3#4#5
+ {
+ \token_if_eq_charcode:NNT ? #2 { \exp_after:wN \use_iv:nnnn }
+ \@@_end_expandable_defaults:nnnNNn {#1} { } {#1} #2#3
+ { } { } { } { } { } { } { } { } { } { }
+ {
+ \__kernel_msg_expandable_error:nnf
+ { ltcmd } { loop-in-defaults }
+ { \exp_args:Nf \tl_trim_spaces:n { \token_to_str:N #4 } }
+ \use_iv:nnnn
+ }
+ \q_stop
+ }
+\cs_new:Npn \@@_end_expandable_defaults:nnnNNn #1#2#3#4#5#6
+ {
+ #6
+ \str_if_eq:nnTF {#1} {#2}
+ { \use_i_delimit_by_q_stop:nw { \group_align_safe_end: #5 #1 } }
+ {
+ \exp_args:No \@@_tl_mapthread_function:nnN
+ { #4 #1 } {#3}
+ \@@_end_expandable_defaults:nnw
+ \@@_end_expandable_defaults:nnnNNn { } {#1} {#3} #4 #5
+ }
+ }
+\cs_new:Npn \@@_end_expandable_defaults:nnw #1#2
+ {
+ \tl_if_novalue:nTF {#2}
+ { \exp_args:No \@@_end_expandable_defaults:nw {#1} }
+ { \@@_end_expandable_defaults:nw {#2} }
+ }
+\cs_new:Npn \@@_end_expandable_defaults:nw
+ #1#2 \@@_end_expandable_defaults:nnnNNn #3
+ { #2 \@@_end_expandable_defaults:nnnNNn { #3 {#1} } }
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \subsection{Normalizing the argument specifications}
+%
+% The goal here is to expand aliases and check that the argument
+% specification is valid before the main parsing run. If it is not
+% valid the entire set up is abandoned to avoid any strange internal
+% errors. A function is provided for each argument type that will grab
+% any extra data items and call the loop function after performing the
+% following checks and tasks.
+% \begin{itemize}
+% \item Check that each argument has the correct number of data items
+% associated with it, and that where a single character is required,
+% one has actually been supplied.
+% \item Check that processors and the markers~|+| and~|!| are followed
+% by an argument for which they make sense, and are not redundant.
+% \item Check the absence of forbidden types for expandable commands,
+% namely \texttt{G}/\texttt{v} always, and \texttt{l}/\texttt{u}
+% after optional arguments (\pkg{xparse} may have inserted braces
+% due to a failed search for an optional argument).
+% \item Check that no optional argument is followed by a mandatory
+% argument with the same delimiter, as otherwise the optional
+% argument could never be omitted.
+% \item Keep track in \cs{l_@@_some_long_bool} and
+% \cs{l_@@_some_short_bool} of whether the command has some
+% long/short arguments.
+% \item Keep track in \cs{l_@@_grab_expandably_bool} of whether all
+% arguments are \texttt{m}/\texttt{l}/\texttt{u} type and short
+% arguments appear before long ones, in which case they can be
+% grabbed expandably just as safely as they could be grabbed
+% nonexpandably. Regardless of that, arguments of expandable
+% commands will be grabbed expandably and arguments of environments
+% will not (because the list of arguments built by non-expandable
+% grabbing is used to pass them to the end-environment code).
+% \end{itemize}
+% Further checks happen at the end of the loop:
+% \begin{itemize}
+% \item that there are at most $9$ arguments;
+% \item that an expandable command does not end with an optional
+% argument (this case is detected by using the fact that
+% \cs{l_@@_last_delimiters_tl} is cleared by every mandatory argument
+% and filled by every optional argument).
+% \end{itemize}
+%
+% \begin{macro}{\@@_normalize_arg_spec:n}
+% \begin{macro}{\@@_normalize_arg_spec_loop:n}
+% Loop through the argument specification, calling an auxiliary
+% specific to each argument type. If any argument is unknown stop the
+% definition.
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_normalize_arg_spec:n #1
+ {
+ \int_zero:N \l_@@_current_arg_int
+ \tl_clear:N \l_@@_last_delimiters_tl
+ \tl_clear:N \l_@@_arg_spec_tl
+ \bool_set_true:N \l_@@_grab_expandably_bool
+ \bool_set_false:N \l_@@_obey_spaces_bool
+ \bool_set_false:N \l_@@_long_bool
+ \bool_set_false:N \l_@@_some_obey_spaces_bool
+ \bool_set_false:N \l_@@_some_long_bool
+ \bool_set_false:N \l_@@_some_short_bool
+ \@@_normalize_arg_spec_loop:n #1
+ \q_recursion_tail \q_recursion_tail \q_recursion_tail \q_recursion_stop
+ \int_compare:nNnT \l_@@_current_arg_int > 9
+ {
+ \__kernel_msg_error:nnxx { ltcmd } { too-many-arguments }
+ { \@@_environment_or_command: } { \tl_to_str:n {#1} }
+ \@@_bad_def:wn
+ }
+ \bool_if:NT \l_@@_expandable_bool
+ {
+ \tl_if_empty:NF \l_@@_last_delimiters_tl
+ {
+ \__kernel_msg_error:nnxx { ltcmd } { expandable-ending-optional }
+ { \iow_char:N \\ \l_@@_function_tl } { \tl_to_str:n {#1} }
+ \@@_bad_def:wn
+ }
+ }
+ \bool_if:NT \l_@@_expandable_bool
+ { \bool_set_true:N \l_@@_grab_expandably_bool }
+ \bool_if:NT \l_@@_environment_bool
+ { \bool_set_false:N \l_@@_grab_expandably_bool }
+ }
+\cs_new_protected:Npn \@@_normalize_arg_spec_loop:n #1
+ {
+ \quark_if_recursion_tail_stop:n {#1}
+ \int_incr:N \l_@@_current_arg_int
+ \cs_if_exist_use:cF { @@_normalize_type_ \tl_to_str:n {#1} :w }
+ {
+ \bool_lazy_any:nTF
+ {
+ { \str_if_eq_p:nn {#1} { G } }
+ { \str_if_eq_p:nn {#1} { g } }
+ { \str_if_eq_p:nn {#1} { l } }
+ { \str_if_eq_p:nn {#1} { u } }
+ }
+ {
+ \__kernel_msg_error:nnxx { ltcmd } { xparse-argument-type }
+ { \@@_environment_or_command: } { \tl_to_str:n {#1} }
+ }
+ {
+ \__kernel_msg_error:nnxx { ltcmd } { unknown-argument-type }
+ { \@@_environment_or_command: } { \tl_to_str:n {#1} }
+ }
+ \@@_bad_def:wn
+ }
+ }
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}
+% {
+% \@@_normalize_type_d:w,
+% \@@_normalize_type_e:w,
+% \@@_normalize_type_o:w,
+% \@@_normalize_type_O:w,
+% \@@_normalize_type_r:w,
+% \@@_normalize_type_s:w,
+% }
+% These argument types are aliases of more general ones, for example
+% with the default argument |-NoValue-|. To easily insert that marker
+% expanded in the definitions we call \cs{@@_tmp:w} with the argument
+% |-NoValue-|. For argument types that need additional data, check
+% that the data is present (not \cs{q_recursion_tail}) before
+% proceeding.
+% \begin{macrocode}
+\cs_set_protected:Npn \@@_tmp:w #1
+ {
+ \cs_new_protected:Npn \@@_normalize_type_d:w ##1##2
+ {
+ \quark_if_recursion_tail_stop_do:nn {##2} { \@@_bad_arg_spec:wn }
+ \@@_normalize_type_D:w {##1} {##2} {#1}
+ }
+ \cs_new_protected:Npn \@@_normalize_type_e:w ##1
+ {
+ \quark_if_recursion_tail_stop_do:nn {##1} { \@@_bad_arg_spec:wn }
+ \@@_normalize_type_E:w {##1} { }
+ }
+ \cs_new_protected:Npn \@@_normalize_type_o:w
+ { \@@_normalize_type_D:w [ ] {#1} }
+ \cs_new_protected:Npn \@@_normalize_type_O:w
+ { \@@_normalize_type_D:w [ ] }
+ \cs_new_protected:Npn \@@_normalize_type_r:w ##1##2
+ {
+ \quark_if_recursion_tail_stop_do:nn {##2} { \@@_bad_arg_spec:wn }
+ \@@_normalize_type_R:w {##1} {##2} {#1}
+ }
+ \cs_new_protected:Npn \@@_normalize_type_s:w
+ { \@@_normalize_type_t:w * }
+ }
+\exp_args:No \@@_tmp:w { \c_novalue_tl }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}
+% {
+% \@@_normalize_type_>:w,
+% \@@_normalize_type_+:w,
+% \@@_normalize_type_!:w,
+% }
+% Check that these prefixes have arguments, namely that the next token
+% is not \cs{q_recursion_tail}, and remember to leave it after the
+% looping macro. Processors are forbidden in expandable commands.
+% If all is good, store the prefix in the cleaned up
+% \cs{l_@@_arg_spec_tl}, and decrement the argument number as prefixes
+% do not correspond to arguments.
+% \begin{macrocode}
+\cs_new_protected:cpn { @@_normalize_type_>:w } #1#2
+ {
+ \quark_if_recursion_tail_stop_do:nn {#2} { \@@_bad_arg_spec:wn }
+ \bool_if:NT \l_@@_expandable_bool
+ {
+ \__kernel_msg_error:nnxx { ltcmd } { processor-in-expandable }
+ { \iow_char:N \\ \l_@@_function_tl } { \tl_to_str:n {#1} }
+ \@@_bad_def:wn
+ }
+ \tl_put_right:Nx \l_@@_arg_spec_tl { > { \tl_trim_spaces:n {#1} } }
+ \int_decr:N \l_@@_current_arg_int
+ \bool_set_false:N \l_@@_grab_expandably_bool
+ \@@_normalize_arg_spec_loop:n {#2}
+ }
+\cs_new_protected:cpn { @@_normalize_type_+:w } #1
+ {
+ \quark_if_recursion_tail_stop_do:nn {#1} { \@@_bad_arg_spec:wn }
+ \bool_if:NT \l_@@_long_bool
+ {
+ \__kernel_msg_error:nnxx { ltcmd } { two-markers }
+ { \@@_environment_or_command: } { + }
+ \@@_bad_def:wn
+ }
+ \bool_set_true:N \l_@@_long_bool
+ \int_decr:N \l_@@_current_arg_int
+ \@@_normalize_arg_spec_loop:n {#1}
+ }
+\cs_new_protected:cpn { @@_normalize_type_!:w } #1
+ {
+ \quark_if_recursion_tail_stop_do:nn {#1} { \@@_bad_arg_spec:wn }
+ \bool_if:NT \l_@@_obey_spaces_bool
+ {
+ \__kernel_msg_error:nnxx { ltcmd } { two-markers }
+ { \@@_environment_or_command: } { ! }
+ \@@_bad_def:wn
+ }
+ \bool_set_true:N \l_@@_obey_spaces_bool
+ \bool_set_true:N \l_@@_some_obey_spaces_bool
+ \int_decr:N \l_@@_current_arg_int
+ \@@_normalize_arg_spec_loop:n {#1}
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}
+% {
+% \@@_normalize_type_D:w,
+% \@@_normalize_type_E:w,
+% \@@_normalize_type_t:w,
+% }
+% \begin{macro}{\@@_normalize_E_unique_check:w}
+% Optional argument types. Check that all required data is present
+% (and consists of single characters if applicable) and check for
+% forbidden types for expandable commands. For \texttt{E}-type
+% require that there is at least one embellishment, that each one is a
+% single character, and that there aren't more optional arguments than
+% embellishments; also remember that each embellishment counts as one
+% argument for \cs{l_@@_current_arg_int}. Then in each case
+% store the data in \cs{l_@@_arg_spec_tl}, and
+% for later checks store in \cs{l_@@_last_delimiters_tl} the tokens
+% whose presence determines whether there is an optional argument (for
+% braces store |{}|, seen later as an empty delimiter).
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_normalize_type_D:w #1#2#3
+ {
+ \quark_if_recursion_tail_stop_do:nn {#3} { \@@_bad_arg_spec:wn }
+ \@@_single_token_check:n {#1} \@@_allowed_token_check:N #1
+ \@@_single_token_check:n {#2}
+ \@@_add_arg_spec:n { D #1 #2 {#3} }
+ \tl_put_right:Nn \l_@@_last_delimiters_tl {#1}
+ \bool_set_false:N \l_@@_grab_expandably_bool
+ \@@_normalize_arg_spec_loop:n
+ }
+\cs_new_protected:Npn \@@_normalize_type_E:w #1#2
+ {
+ \quark_if_recursion_tail_stop_do:nn {#2} { \@@_bad_arg_spec:wn }
+ \tl_if_blank:nT {#1} { \@@_bad_arg_spec:wn }
+ \tl_map_function:nN {#1} \@@_single_token_check:n
+ \tl_map_function:nN {#1} \@@_allowed_token_check:N
+ \@@_normalize_E_unique_check:w #1 \q_nil \q_stop
+ \int_compare:nNnT { \tl_count:n {#2} } > { \tl_count:n {#1} }
+ { \@@_bad_arg_spec:wn }
+ \@@_add_arg_spec:n { E {#1} {#2} }
+ \tl_put_right:Nn \l_@@_last_delimiters_tl {#1}
+ \bool_set_false:N \l_@@_grab_expandably_bool
+ \int_add:Nn \l_@@_current_arg_int { \tl_count:n {#1} - 1 }
+ \@@_normalize_arg_spec_loop:n
+ }
+\cs_new_protected:Npn \@@_normalize_E_unique_check:w #1#2 \q_stop
+ {
+ \quark_if_nil:NF #1
+ {
+ \tl_if_in:nnT {#2} {#1} { \@@_bad_arg_spec:wn }
+ \@@_normalize_E_unique_check:w #2 \q_stop
+ }
+ }
+\cs_new_protected:Npn \@@_normalize_type_t:w #1
+ {
+ \quark_if_recursion_tail_stop_do:Nn #1 { \@@_bad_arg_spec:wn }
+ \@@_single_token_check:n {#1} \@@_allowed_token_check:N #1
+ \tl_put_right:Nx \l_@@_arg_spec_tl
+ {
+ \bool_if:NT \l_@@_obey_spaces_bool { ! }
+ t \exp_not:n {#1}
+ }
+ \tl_put_right:Nn \l_@@_last_delimiters_tl {#1}
+ \bool_set_false:N \l_@@_grab_expandably_bool
+ \bool_set_false:N \l_@@_obey_spaces_bool
+ \bool_set_false:N \l_@@_long_bool
+ \@@_normalize_arg_spec_loop:n
+ }
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}
+% {
+% \@@_normalize_type_m:w,
+% \@@_normalize_type_R:w,
+% \@@_normalize_type_v:w
+% }
+% Mandatory arguments. First check the required data is present,
+% consists of single characters where applicable, and that the argument
+% type is allowed for expandable commands if applicable. For the
+% \texttt{m} and \texttt{R} argument types check that they do not
+% follow some optional argument with that delimiter as otherwise the
+% optional argument could not be omitted. Then save data in
+% \cs{l_@@_arg_spec_tl}, count the mandatory argument, and empty the
+% list of last delimiters.
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_normalize_type_m:w
+ {
+ \@@_delimiter_check:nnn { } { m } { \iow_char:N \{ }
+ \@@_add_arg_spec_mandatory:n { m }
+ \@@_normalize_arg_spec_loop:n
+ }
+\cs_new_protected:Npn \@@_normalize_type_R:w #1#2#3
+ {
+ \quark_if_recursion_tail_stop_do:nn {#3} { \@@_bad_arg_spec:wn }
+ \@@_single_token_check:n {#1} \@@_allowed_token_check:N #1
+ \@@_single_token_check:n {#2}
+ \@@_delimiter_check:nnn {#1} { R/r } { \tl_to_str:n {#1} }
+ \bool_set_false:N \l_@@_grab_expandably_bool
+ \@@_add_arg_spec_mandatory:n { R #1 #2 {#3} }
+ \@@_normalize_arg_spec_loop:n
+ }
+\cs_new_protected:Npn \@@_normalize_type_v:w
+ {
+ \@@_normalize_check_gv:N v
+ \@@_add_arg_spec_mandatory:n { v }
+ \@@_normalize_arg_spec_loop:n
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@@_normalize_type_b:w}
+% This argument type is not allowed for commands. This is only
+% allowed at the end of the argument specification, hence we check
+% that |#1| is the end.
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_normalize_type_b:w #1
+ {
+ \bool_if:NF \l_@@_environment_bool
+ {
+ \__kernel_msg_error:nnxx
+ { ltcmd } { invalid-command-arg }
+ { \@@_environment_or_command: } { b }
+ \@@_bad_def:wn
+ }
+ \tl_clear:N \l_@@_last_delimiters_tl
+ \@@_add_arg_spec:n { b }
+ \quark_if_recursion_tail_stop:n {#1}
+ \__kernel_msg_error:nnxx { ltcmd } { arg-after-body }
+ { \@@_environment_or_command: }
+ { \tl_to_str:n {#1} }
+ \@@_bad_def:wn
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@@_single_token_check:n}
+% Checks that the argument is a single (non-space) token (possibly
+% surrounded by spaces), and aborts the definition otherwise.
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_single_token_check:n #1
+ {
+ \tl_trim_spaces_apply:nN {#1} \tl_if_single_token:nF
+ {
+ \__kernel_msg_error:nnxx { ltcmd } { not-single-token }
+ { \@@_environment_or_command: } { \tl_to_str:n {#1} }
+ \@@_bad_def:wn
+ }
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@@_allowed_token_check:N}
+% Some tokens are now allowed as delimiters for some argument types,
+% notably implicit begin/end-group tokens (|\bgroup|/|\egroup|).
+% The major problem with these tokens is that for |\peek_...| functions,
+% a literal~|{|$_1$. is virtually indistinguishable from a |\bgroup| or
+% other token which was |\let| to a~|{|$_1$, and the same goes
+% for~|}|$_2$. All other tokens can be easily distingushed from their
+% implicit counterparts by grabbing them and looking at the string
+% length (see \cs{@@_token_if_cs:NTF}), but for begin/end group tokens
+% that is not possible without the risk of mistakenly grabbing the
+% entire brace group (potentially leading to a~\texttt{!~Runaway argument}
+% error) or trying to grab a |}|$_2$, leading to
+% an~\verb|! Argument of \dots has an extra }| error.
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_allowed_token_check:N #1
+ {
+ \token_if_eq_meaning:NNTF #1 \c_group_begin_token
+ { \use:n }
+ {
+ \token_if_eq_meaning:NNTF #1 \c_group_end_token
+ { \use:n }
+ { \use_none:n }
+ }
+ {
+ \__kernel_msg_error:nnxxx
+ { ltcmd } { forbidden-implicit-group-token }
+ { \@@_environment_or_command: } { \tl_to_str:n {#1} }
+ {
+ \token_if_eq_meaning:NNTF #1 \c_group_begin_token
+ { begin } { end }
+ }
+ \@@_bad_def:wn
+ }
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@@_normalize_check_gv:N, \@@_normalize_check_lu:N}
+% Called for arguments that are always forbidden, or forbidden after
+% an optional argument, for expandable commands.
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_normalize_check_gv:N #1
+ {
+ \bool_if:NT \l_@@_expandable_bool
+ {
+ \__kernel_msg_error:nnxx
+ { ltcmd } { invalid-expandable-argument-type }
+ { \iow_char:N \\ \l_@@_function_tl } { \tl_to_str:n {#1} }
+ \@@_bad_def:wn
+ }
+ \bool_set_false:N \l_@@_grab_expandably_bool
+ }
+\cs_new_protected:Npn \@@_normalize_check_lu:N #1
+ {
+ \bool_if:NT \l_@@_expandable_bool
+ {
+ \tl_if_empty:NF \l_@@_last_delimiters_tl
+ {
+ \__kernel_msg_error:nnxx
+ { ltcmd } { invalid-after-optional-expandably }
+ { \iow_char:N \\ \l_@@_function_tl } { \tl_to_str:n {#1} }
+ \@@_bad_def:wn
+ }
+ }
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@@_delimiter_check:nnn}
+% Called for \texttt{m} and \texttt{R} arguments. Checks that the
+% leading token does not coincide with the token denoting the presence
+% of a previous optional argument. Instead of dealing with braces for
+% the \texttt{m}-type we use an empty delimiter to denote that case.
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_delimiter_check:nnn #1#2#3
+ {
+ \tl_map_inline:Nn \l_@@_last_delimiters_tl
+ {
+ \tl_if_eq:nnT {##1} {#1}
+ {
+ \__kernel_msg_warning:nnxx { ltcmd } { optional-mandatory }
+ {#2} {#3}
+ }
+ }
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@@_bad_arg_spec:wn, \@@_bad_def:wn}
+% If the argument specification is wrong, this provides an escape from
+% the entire definition process.
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_bad_arg_spec:wn #1 \@@_break_point:n #2
+ {
+ \__kernel_msg_error:nnxx { ltcmd } { bad-arg-spec }
+ { \@@_environment_or_command: } { \tl_to_str:n {#2} }
+ }
+\cs_new_protected:Npn \@@_bad_def:wn #1 \@@_break_point:n #2 { }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@@_add_arg_spec:n, \@@_add_arg_spec_mandatory:n}
+% When adding an argument to the argument specification, set the
+% \texttt{some_long} or \texttt{some_short} booleans as appropriate
+% and clear the booleans keeping track of |+| and |!| markers.
+% Before that, test for a short argument following some long
+% arguments: this is forbidden for expandable commands and prevents
+% grabbing arguments expandably.
+%
+% For mandatory arguments do some more work, in particular complain if
+% they were preceeded by~|!|.
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_add_arg_spec:n #1
+ {
+ \bool_lazy_and:nnT
+ { ! \l_@@_long_bool }
+ { \l_@@_some_long_bool }
+ {
+ \bool_if:NT \l_@@_expandable_bool
+ {
+ \__kernel_msg_error:nnx { ltcmd } { inconsistent-long }
+ { \iow_char:N \\ \l_@@_function_tl }
+ \@@_bad_def:wn
+ }
+ \bool_set_false:N \l_@@_grab_expandably_bool
+ }
+ \bool_if:NTF \l_@@_long_bool
+ { \bool_set_true:N \l_@@_some_long_bool }
+ { \bool_set_true:N \l_@@_some_short_bool }
+ \tl_put_right:Nx \l_@@_arg_spec_tl
+ {
+ \bool_if:NT \l_@@_long_bool { + }
+ \bool_if:NT \l_@@_obey_spaces_bool { ! }
+ \exp_not:n {#1}
+ }
+ \bool_set_false:N \l_@@_long_bool
+ \bool_set_false:N \l_@@_obey_spaces_bool
+ }
+\cs_new_protected:Npn \@@_add_arg_spec_mandatory:n #1
+ {
+ \bool_if:NT \l_@@_some_obey_spaces_bool
+ {
+ \__kernel_msg_error:nnxx { ltcmd } { non-trailing-obey-spaces }
+ { \@@_environment_or_command: } { \tl_to_str:n {#1} }
+ \@@_bad_def:wn
+ }
+ \tl_clear:N \l_@@_last_delimiters_tl
+ \@@_add_arg_spec:n {#1}
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Preparing the signature: general mechanism}
+%
+% \begin{macro}{\@@_prepare_signature:n}
+% \begin{macro}{\@@_prepare_signature:N}
+% \begin{macro}{\@@_prepare_signature_bypass:N}
+% Actually creating the signature uses the same loop approach as
+% normalizing the signature. There are first a number of variables which need
+% to be set to track what is going on. Many of these variables are unused
+% when defining expandable commands.
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_prepare_signature:n #1
+ {
+ \int_zero:N \l_@@_current_arg_int
+ \bool_set_false:N \l_@@_long_bool
+ \bool_set_false:N \l_@@_obey_spaces_bool
+ \int_zero:N \l_@@_m_args_int
+ \bool_set_false:N \l_@@_defaults_bool
+ \tl_clear:N \l_@@_defaults_tl
+ \tl_clear:N \l_@@_process_all_tl
+ \tl_clear:N \l_@@_process_one_tl
+ \bool_set_false:N \l_@@_process_some_bool
+ \tl_clear:N \l_@@_signature_tl
+ \@@_prepare_signature:N #1 \q_recursion_tail \q_recursion_stop
+ \bool_if:NF \l_@@_expandable_bool { \@@_flush_m_args: }
+ }
+% \end{macrocode}
+% The main looping function does not take an argument, but carries out the
+% reset on the processor boolean. This is split off from the rest of the
+% process so that when actually setting up processors the flag-reset can
+% be bypassed.
+%
+% For each known argument type there is an appropriate function to actually
+% do the addition to the signature. These are separate for expandable and
+% standard functions, as the approaches are different.
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_prepare_signature:N
+ {
+ \bool_set_false:N \l_@@_prefixed_bool
+ \@@_prepare_signature_bypass:N
+ }
+\cs_new_protected:Npn \@@_prepare_signature_bypass:N #1
+ {
+ \quark_if_recursion_tail_stop:N #1
+ \use:c
+ {
+ @@_add
+ \bool_if:NT \l_@@_grab_expandably_bool { _expandable }
+ _type_ \token_to_str:N #1 :w
+ }
+ }
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \subsection{Setting up a standard signature}
+%
+% Each argument-adding function appends to the signature a grabber (and
+% for some types, the delimiters or default value), except the one for
+% \texttt{m} arguments. These are collected and added to the signature
+% all at once by \cs{@@_flush_m_args:}, called for every other argument
+% type. All of the functions then call the loop function
+% \cs{@@_prepare_signature:N}. Default values of arguments are
+% collected by \cs{@@_add_default:n} rather than being stored with the
+% argument; this function and \cs{@@_add_default:} are also responsible
+% for keeping track of \cs{l_@@_current_arg_int}.
+%
+% \begin{macro}{\@@_add_type_+:w}
+% Making the next argument long means setting the flag. The \texttt{m}
+% arguments are recorded here as
+% this has to be done for every case where there is then a long argument.
+% \begin{macrocode}
+\cs_new_protected:cpn { @@_add_type_+:w }
+ {
+ \@@_flush_m_args:
+ \bool_set_true:N \l_@@_long_bool
+ \bool_set_true:N \l_@@_prefixed_bool
+ \@@_prepare_signature_bypass:N
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@@_add_type_!:w}
+% Much the same for controlling trailing optional arguments.
+% \begin{macrocode}
+\cs_new_protected:cpn { @@_add_type_!:w }
+ {
+ \@@_flush_m_args:
+ \bool_set_true:N \l_@@_obey_spaces_bool
+ \bool_set_true:N \l_@@_prefixed_bool
+ \@@_prepare_signature_bypass:N
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@@_add_type_>:w}
+% When a processor is found, the processor code is stored. It will be
+% used by \cs{@@_args_process:} once arguments are all found. Here too
+% the loop calls \cs{@@_prepare_signature_bypass:N} rather than
+% \cs{@@_prepare_signature:N} so that the flag is not reset.
+% \begin{macrocode}
+\cs_new_protected:cpn { @@_add_type_>:w } #1
+ {
+ \@@_flush_m_args:
+ \bool_set_true:N \l_@@_prefixed_bool
+ \bool_set_true:N \l_@@_process_some_bool
+ \tl_put_left:Nn \l_@@_process_one_tl { {#1} }
+ \@@_prepare_signature_bypass:N
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@@_add_type_b:w}
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_add_type_b:w
+ {
+ \@@_flush_m_args:
+ \@@_add_default:
+ \@@_add_grabber:N b
+ \@@_prepare_signature:N
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@@_add_type_D:w}
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_add_type_D:w #1#2#3
+ {
+ \@@_flush_m_args:
+ \@@_add_default:n {#3}
+ \@@_add_grabber:N D
+ \tl_put_right:Nn \l_@@_signature_tl { #1 #2 }
+ \@@_prepare_signature:N
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@@_add_type_E:w}
+% The \texttt{E}-type argument needs a special handling of default
+% values.
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_add_type_E:w #1#2
+ {
+ \@@_flush_m_args:
+ \@@_add_default_E:nn {#1} {#2}
+ \@@_add_grabber:N E
+ \tl_put_right:Nn \l_@@_signature_tl { {#1} }
+ \@@_prepare_signature:N
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@@_add_type_m:w}
+% The \texttt{m} type is special as short arguments which are not
+% post-processed are simply counted at this stage. Thus there is a check
+% to see if either of these cases apply. If so, a one-argument grabber
+% is added to the signature. On the other hand, if a standard short
+% argument is required it is simply counted at this stage, to be
+% added later using \cs{@@_flush_m_args:}.
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_add_type_m:w
+ {
+ \@@_add_default:
+ \bool_if:NTF \l_@@_prefixed_bool
+ { \@@_add_grabber:N m }
+ { \int_incr:N \l_@@_m_args_int }
+ \@@_prepare_signature:N
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@@_add_type_R:w}
+% The \texttt{R}-type argument is very similar to the \texttt{D}-type.
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_add_type_R:w #1#2#3
+ {
+ \@@_flush_m_args:
+ \@@_add_default:n {#3}
+ \@@_add_grabber:N R
+ \tl_put_right:Nn \l_@@_signature_tl { #1 #2 }
+ \@@_prepare_signature:N
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@@_add_type_t:w}
+% Setting up a \texttt{t} argument means collecting one token for the test,
+% and adding it along with the grabber to the signature.
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_add_type_t:w #1
+ {
+ \@@_flush_m_args:
+ \@@_add_default:
+ \@@_add_grabber:N t
+ \tl_put_right:Nn \l_@@_signature_tl {#1}
+ \@@_prepare_signature:N
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@@_add_type_v:w}
+% At this stage, the \texttt{v} argument is identical to \texttt{l}
+% except that since the grabber may fail to read a verbatim argument
+% we need a default value.
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_add_type_v:w
+ {
+ \@@_flush_m_args:
+ \exp_args:No \@@_add_default:n \c_novalue_tl
+ \@@_add_grabber:N v
+ \@@_prepare_signature:N
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@@_flush_m_args:}
+% As \texttt{m} arguments are simply counted, there is a need to add
+% them to the token register in a block. As this function can only
+% be called if something other than \texttt{m} turns up, the flag can
+% be switched here.
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_flush_m_args:
+ {
+ \int_compare:nNnT \l_@@_m_args_int > 0
+ {
+ \tl_put_right:Nx \l_@@_signature_tl
+ { \exp_not:c { @@_grab_m_ \int_use:N \l_@@_m_args_int :w } }
+ \tl_put_right:Nx \l_@@_process_all_tl
+ { \prg_replicate:nn { \l_@@_m_args_int } { { } } }
+ }
+ \int_zero:N \l_@@_m_args_int
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@@_add_grabber:N}
+% To keep the various checks needed in one place, adding the grabber
+% to the signature is done here. The only questions are whether the
+% grabber should be long or not, and whether to obey spaces. The
+% \cs{l_@@_obey_spaces_bool} boolean can only be \texttt{true} for
+% trailing optional arguments. In that case spaces will not be
+% ignored when looking for that optional argument.
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_add_grabber:N #1
+ {
+ \tl_put_right:Nx \l_@@_signature_tl
+ {
+ \exp_not:c
+ {
+ @@_grab_ #1
+ \bool_if:NT \l_@@_long_bool { _long }
+ \bool_if:NT \l_@@_obey_spaces_bool { _obey_spaces }
+ :w
+ }
+ }
+ \bool_set_false:N \l_@@_long_bool
+ \bool_set_false:N \l_@@_obey_spaces_bool
+ \tl_put_right:Nx \l_@@_process_all_tl
+ { { \exp_not:o \l_@@_process_one_tl } }
+ \tl_clear:N \l_@@_process_one_tl
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@@_add_default:n, \@@_add_default:, \@@_add_default_E:nn}
+% Store the default value of an argument, or rather code that gives
+% that default value (it may involve other arguments). This is
+% \cs{c_novalue_tl} for arguments with no actual default or with
+% default |-NoValue-|; and (in a brace group) \cs{prg_do_nothing:}
+% followed by a default value for others. For \texttt{E}-type
+% arguments, pad the defaults |#2| with some \cs{c_novalue_tl}
+% until there are as many as embellishments~|#1|. These functions are
+% also used when defining expandable commands.
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_add_default:n #1
+ {
+ \tl_if_novalue:nTF {#1}
+ { \@@_add_default: }
+ {
+ \int_incr:N \l_@@_current_arg_int
+ \bool_set_true:N \l_@@_defaults_bool
+ \tl_put_right:Nn \l_@@_defaults_tl { { \prg_do_nothing: #1 } }
+ }
+ }
+\cs_new_protected:Npn \@@_add_default:
+ {
+ \int_incr:N \l_@@_current_arg_int
+ \tl_put_right:Nn \l_@@_defaults_tl { \c_novalue_tl }
+ }
+\cs_new_protected:Npn \@@_add_default_E:nn #1#2
+ {
+ \tl_map_function:nN {#2} \@@_add_default:n
+ \prg_replicate:nn
+ { \tl_count:n {#1} - \tl_count:n {#2} }
+ { \@@_add_default: }
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Setting up expandable types}
+%
+% The approach here is not dissimilar to that for standard types, but fewer types
+% are supported. There is
+% also a need to define the per-function auxiliaries: this is done here, while
+% the general grabbers are dealt with later.
+%
+% \begin{macro}{\@@_add_expandable_type_+:w}
+% We have already checked that short arguments are before long
+% arguments, so \cs{l_@@_long_bool} only changes from \texttt{false}
+% to \texttt{true} once (and there is no need to reset it after each
+% argument). Also knock back the argument count because |+| is not an
+% argument. Continue the loop.
+% \begin{macrocode}
+\cs_new_protected:cpn { @@_add_expandable_type_+:w }
+ {
+ \bool_set_true:N \l_@@_long_bool
+ \@@_prepare_signature:N
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@@_add_expandable_type_D:w}
+% \begin{macro}{\@@_add_expandable_type_D_aux:NNNn}
+% \begin{macro}{\@@_add_expandable_type_D_aux:NNN}
+% \begin{macro}{\@@_add_expandable_type_D_aux:NN}
+% The set up for \texttt{D}-type arguments involves constructing a
+% rather complex auxiliary which is used
+% repeatedly when grabbing. There is an auxiliary here so that the
+% \texttt{R}-type can share code readily: |#1| is |D| or~|R|.
+% The |_aux:NN| auxiliary is needed if the two delimiting tokens are
+% identical: in contrast to the non-expandable route, the grabber here
+% has to act differently for this case.
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_add_expandable_type_D:w
+ { \@@_add_expandable_type_D_aux:NNNn D }
+\cs_new_protected:Npn \@@_add_expandable_type_D_aux:NNNn #1#2#3#4
+ {
+ \@@_add_default:n {#4}
+ \tl_if_eq:nnTF {#2} {#3}
+ { \@@_add_expandable_type_D_aux:NN #1 #2 }
+ { \@@_add_expandable_type_D_aux:NNN #1 #2 #3 }
+ \@@_prepare_signature:N
+ }
+\cs_new_protected:Npn \@@_add_expandable_type_D_aux:NNN #1#2#3
+ {
+ \bool_if:NTF \l_@@_long_bool
+ { \cs_set:cpx }
+ { \cs_set_nopar:cpx }
+ { \l_@@_expandable_aux_name_tl } ##1 ##2 #2 ##3 \q_@@ ##4 #3
+ { ##1 {##2} {##3} {##4} }
+ \@@_add_expandable_grabber:nn {#1}
+ {
+ \exp_not:c { \l_@@_expandable_aux_name_tl }
+ \exp_not:n { #2 #3 }
+ }
+ }
+\cs_new_protected:Npn \@@_add_expandable_type_D_aux:NN #1#2
+ {
+ \bool_if:NTF \l_@@_long_bool
+ { \cs_set:cpx }
+ { \cs_set_nopar:cpx }
+ { \l_@@_expandable_aux_name_tl } ##1 #2 ##2 #2
+ { ##1 {##2} }
+ \@@_add_expandable_grabber:nn { #1_alt }
+ {
+ \exp_not:c { \l_@@_expandable_aux_name_tl }
+ \exp_not:n {#2}
+ }
+ }
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\@@_add_expandable_type_E:w}
+% \begin{macro}{\@@_add_expandable_type_E_aux:n}
+% For each embellishment, use \cs{@@_get_grabber:NN} to obtain an
+% auxiliary delimited by that token and store a pair constituted of
+% the auxiliary and the token in \cs{l_@@_tmpb_tl}, before appending
+% the whole set of these pairs to the signature, and an equal number
+% of |-NoValue-| markers (regardless of the default values of
+% arguments). Set the current argument appropriately.
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_add_expandable_type_E:w #1#2
+ {
+ \@@_add_default_E:nn {#1} {#2}
+ \tl_clear:N \l_@@_tmpb_tl
+ \tl_map_function:nN {#1} \@@_add_expandable_type_E_aux:n
+ \@@_add_expandable_grabber:nn
+ { E \bool_if:NT \l_@@_long_bool { _long } }
+ {
+ { \exp_not:o \l_@@_tmpb_tl }
+ {
+ \prg_replicate:nn { \tl_count:n {#1} }
+ { { \c_novalue_tl } }
+ }
+ }
+ \@@_prepare_signature:N
+ }
+\cs_new_protected:Npn \@@_add_expandable_type_E_aux:n #1
+ {
+ \@@_get_grabber:NN #1 \l_@@_tmpa_tl
+ \tl_put_right:Nx \l_@@_tmpb_tl
+ { \exp_not:o \l_@@_tmpa_tl \exp_not:N #1 }
+ }
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\@@_add_expandable_type_m:w}
+% Unlike the standard case, when working expandably each argument is always
+% grabbed separately.
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_add_expandable_type_m:w
+ {
+ \@@_add_default:
+ \@@_add_expandable_grabber:nn
+ { m \bool_if:NT \l_@@_long_bool { _long } } { }
+ \@@_prepare_signature:N
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@@_add_expandable_type_R:w}
+% The \texttt{R}-type is very similar to the \texttt{D}-type
+% argument, and so the same internals are used.
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_add_expandable_type_R:w
+ { \@@_add_expandable_type_D_aux:NNNn R }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@@_add_expandable_type_t:w}
+% An auxiliary delimited by |#1| is built now. It will be used to
+% test for the presence of that token.
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_add_expandable_type_t:w #1
+ {
+ \@@_add_default:
+ \@@_get_grabber:NN #1 \l_@@_tmpa_tl
+ \@@_add_expandable_grabber:nn { t }
+ {
+ \exp_not:o \l_@@_tmpa_tl
+ \exp_not:N #1
+ }
+ \@@_prepare_signature:N
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@@_add_expandable_grabber:nn}
+% This is called for all arguments to place the right grabber in the
+% signature.
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_add_expandable_grabber:nn #1#2
+ {
+ \tl_put_right:Nx \l_@@_signature_tl
+ { \exp_not:c { @@_expandable_grab_ #1 :w } #2 }
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@@_get_grabber:NN}
+% \begin{macro}{\@@_get_grabber_auxi:NN}
+% \begin{macro}{\@@_get_grabber_auxii:NN}
+% Given a token |#1|, defines an expandable function delimited by that
+% token and stores it in the token list~|#2|. The function is named
+% after the token, unless that function name is already taken by some
+% other grabber (this can happen in the rare case where delimiters
+% with different category codes are used in the same document): in
+% that case use a global counter to get a unique name. Since the
+% grabbers are not named after \pkg{xparse} commands they should not
+% be used to get material from the input stream.
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_get_grabber:NN #1#2
+ {
+ \cs_set:Npn \@@_tmp:w ##1 #1 {##1}
+ \exp_args:Nc \@@_get_grabber_auxi:NN
+ { @@_grabber_ \token_to_str:N #1 :w } #2
+ }
+\cs_new_protected:Npn \@@_get_grabber_auxi:NN #1#2
+ {
+ \cs_if_eq:NNTF \@@_tmp:w #1
+ { \tl_set:Nn #2 {#1} }
+ {
+ \cs_if_exist:NTF #1
+ {
+ \int_gincr:N \g_@@_grabber_int
+ \exp_args:Nc \@@_get_grabber_auxi:NN
+ {
+ @@_grabber_
+ - \int_use:N \g_@@_grabber_int :w
+ }
+ #2
+ }
+ { \@@_get_grabber_auxii:NN #1 #2 }
+ }
+ }
+\cs_new_protected:Npn \@@_get_grabber_auxii:NN #1#2
+ {
+ \cs_set_eq:NN #1 \@@_tmp:w
+ \tl_set:Nn #2 {#1}
+ }
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \subsection{Grabbing arguments}
+%
+% All of the grabbers follow the same basic pattern. The initial
+% function stores in \cs{l_@@_signature_tl} the code to grab further
+% arguments, defines (the function in) \cs{l_@@_fn_tl} that will grab
+% the argument, and calls it.
+%
+% Defining \cs{l_@@_fn_tl} means determining whether to use
+% \cs{cs_set:Npn} or \cs{cs_set_nopar:Npn}, and for optional arguments
+% whether to skip spaces. Once the argument is found, \cs{l_@@_fn_tl}
+% calls \cs{@@_add_arg:n}, responsible for calling processors and
+% grabbing further arguments.
+%
+% \begin{macro}
+% {
+% \@@_grab_b:w,
+% \@@_grab_b_long:w,
+% \@@_grab_b_obey_spaces:w,
+% \@@_grab_b_long_obey_spaces:w,
+% \@@_grab_b_aux:NNw,
+% \@@_grab_b_end:Nw
+% }
+% This uses the well-tested code of \texttt{D}-type arguments,
+% skipping the peeking step because the \texttt{b}-type argument is
+% always present, and adding a cleanup stage at the end by hijacking
+% the signature. The clean-up consists of properly
+% dealing with \cs{l_@@_args_tl} and also putting back the \cs{end}
+% that served as an end-delimiter: this \cs{end} receives the
+% environment name as its argument and is run normally. The
+% \texttt{D}-type code stores the argument found (body of the
+% environment) as a brace group in \cs{l_@@_args_tl} and depending on
+% the presence of a prefix~|!| we trim spaces or not before adding
+% this braced argument into the saved \cs{l_@@_args_tl}.
+% The strange \verb*|\begin | control sequence is there for display
+% purposes only: it has to look like |\begin| in the terminal but
+% not to delimited arguments.
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_grab_b:w
+ { \@@_grab_b_aux:NNw \cs_set_protected_nopar:Npn \tl_trim_spaces:n }
+\cs_new_protected:Npn \@@_grab_b_long:w
+ { \@@_grab_b_aux:NNw \cs_set_protected:Npn \tl_trim_spaces:n }
+\cs_new_protected:Npn \@@_grab_b_obey_spaces:w
+ { \@@_grab_b_aux:NNw \cs_set_protected_nopar:Npn \exp_not:n }
+\cs_new_protected:Npn \@@_grab_b_long_obey_spaces:w
+ { \@@_grab_b_aux:NNw \cs_set_protected:Npn \exp_not:n }
+\cs_new_protected:Npn \@@_grab_b_aux:NNw #1#2#3 \@@_run_code:
+ {
+ \@@_grab_D_aux:NNnN \begin \end {#3} #1
+ \tl_put_left:Nn \l_@@_signature_tl { \@@_grab_b_end:Nw #2 }
+ \tl_set_eq:NN \l_@@_saved_args_tl \l_@@_args_tl
+ \tl_clear:N \l_@@_args_tl
+ \exp_args:Nc \l_@@_fn_tl { begin ~ }
+ }
+\cs_new_protected:Npn \@@_grab_b_end:Nw #1#2 \@@_run_code:
+ {
+ \tl_set:Nx \l_@@_args_tl
+ {
+ \exp_not:V \l_@@_saved_args_tl
+ { \exp_after:wN #1 \l_@@_args_tl }
+ }
+ #2
+ \@@_run_code:
+ \end
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@@_grab_D:w}
+% \begin{macro}{\@@_grab_D_long:w}
+% \begin{macro}{\@@_grab_D_obey_spaces:w}
+% \begin{macro}{\@@_grab_D_long_obey_spaces:w}
+% The generic delimited argument grabber. The auxiliary function does
+% a peek test before calling \cs{@@_grab_D_call:Nw}, so that the
+% optional nature of the argument works as expected.
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_grab_D:w #1#2#3 \@@_run_code:
+ {
+ \@@_grab_D_aux:NNnNN #1 #2 {#3} \cs_set_protected_nopar:Npn
+ \@@_peek_nonspace_remove:NTF
+ }
+\cs_new_protected:Npn \@@_grab_D_long:w #1#2#3 \@@_run_code:
+ {
+ \@@_grab_D_aux:NNnNN #1 #2 {#3} \cs_set_protected:Npn
+ \@@_peek_nonspace_remove:NTF
+ }
+\cs_new_protected:Npn \@@_grab_D_obey_spaces:w #1#2#3 \@@_run_code:
+ {
+ \@@_grab_D_aux:NNnNN #1 #2 {#3} \cs_set_protected_nopar:Npn
+ \@@_peek_meaning_remove:NTF
+ }
+\cs_new_protected:Npn \@@_grab_D_long_obey_spaces:w #1#2#3 \@@_run_code:
+ {
+ \@@_grab_D_aux:NNnNN #1 #2 {#3} \cs_set_protected:Npn
+ \@@_peek_meaning_remove:NTF
+ }
+% \end{macrocode}
+% \begin{macro}{\@@_grab_D_aux:NNnNN}
+% \begin{macro}{\@@_grab_D_aux:NNnN}
+% This is a bit complicated. The idea is that, in order to check for
+% nested optional argument tokens (\texttt{[[...]]} and so on) the
+% argument needs to be grabbed without removing any braces at all. If
+% this is not done, then cases like |[{[}]| fail. So after testing for
+% an optional argument, it is collected piece-wise. Inserting a quark
+% prevents loss of braces, and there is then a test to see if there are
+% nested delimiters to handle.
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_grab_D_aux:NNnNN #1#2#3#4#5
+ {
+ \@@_grab_D_aux:NNnN #1#2 {#3} #4
+ #5 #1
+ { \@@_grab_D_call:Nw #1 }
+ { \@@_add_arg:o \c_novalue_tl }
+ }
+% \end{macrocode}
+% Inside the \enquote{standard} grabber, there is a test to see if the
+% grabbed argument is entirely enclosed by braces. There are a couple of
+% extra factors to allow for: the argument might be entirely empty, and
+% spaces at the start and end of the input must be retained around a brace
+% group. Also notice that a \emph{blank} argument might still contain
+% spaces.
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_grab_D_aux:NNnN #1#2#3#4
+ {
+ \tl_set:Nn \l_@@_signature_tl {#3}
+ \exp_after:wN #4 \l_@@_fn_tl ##1 #2
+ {
+ \tl_if_in:nnTF {##1} {#1}
+ { \@@_grab_D_nested:NNnN #1 #2 {##1} #4 }
+ {
+ \tl_if_blank:oTF { \use_none:n ##1 }
+ { \@@_add_arg:o { \use_none:n ##1 } }
+ {
+ \str_if_eq:eeTF
+ { \exp_not:o { \use_none:n ##1 } }
+ { { \exp_not:o { \use_ii:nnn ##1 \q_nil } } }
+ { \@@_add_arg:o { \use_ii:nn ##1 } }
+ { \@@_add_arg:o { \use_none:n ##1 } }
+ }
+ }
+ }
+ }
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \begin{macro}{\@@_grab_D_nested:NNnN}
+% \begin{macro}{\@@_grab_D_nested:w}
+% \begin{macro}{\l_@@_nesting_a_tl}
+% \begin{macro}{\l_@@_nesting_b_tl}
+% \begin{macro}{\q_@@}
+% Catching nested optional arguments means more work. The aim here is
+% to collect up each pair of optional tokens without \TeX{} helping out,
+% and without counting anything. The code above will already have
+% removed the leading opening token and a closing token, but the
+% wrong one. The aim is then to work through the material grabbed
+% so far and divide it up on each opening token, grabbing a closing
+% token to match (thus working in pairs). Once there are no opening
+% tokens, then there is a second check to see if there are any
+% opening tokens in the second part of the argument (for things
+% like |[][]|). Once everything has been found, the entire collected
+% material is added to the output as a single argument. The only tricky part
+% here is ensuring that any grabbing function that might run away is named
+% after the function currently being parsed and not after \pkg{xparse}. That
+% leads to some rather complex nesting! There is also a need to prevent the
+% loss of any braces, hence the insertion and removal of quarks along the
+% way.
+% \begin{macrocode}
+\tl_new:N \l_@@_nesting_a_tl
+\tl_new:N \l_@@_nesting_b_tl
+\quark_new:N \q_@@
+\cs_new_protected:Npn \@@_grab_D_nested:NNnN #1#2#3#4
+ {
+ \tl_clear:N \l_@@_nesting_a_tl
+ \tl_clear:N \l_@@_nesting_b_tl
+ \exp_after:wN #4 \l_@@_fn_tl ##1 #1 ##2 \q_@@ ##3 #2
+ {
+ \tl_put_right:No \l_@@_nesting_a_tl { \use_none:n ##1 #1 }
+ \tl_put_right:No \l_@@_nesting_b_tl { \use_i:nn #2 ##3 }
+ \tl_if_in:nnTF {##2} {#1}
+ {
+ \l_@@_fn_tl
+ \q_nil ##2 \q_@@ \ERROR
+ }
+ {
+ \tl_put_right:Nx \l_@@_nesting_a_tl
+ { \@@_grab_D_nested:w \q_nil ##2 \q_stop }
+ \tl_if_in:NnTF \l_@@_nesting_b_tl {#1}
+ {
+ \tl_set_eq:NN \l_@@_tmpa_tl \l_@@_nesting_b_tl
+ \tl_clear:N \l_@@_nesting_b_tl
+ \exp_after:wN \l_@@_fn_tl \exp_after:wN
+ \q_nil \l_@@_tmpa_tl \q_nil \q_@@ \ERROR
+ }
+ {
+ \tl_put_right:No \l_@@_nesting_a_tl
+ \l_@@_nesting_b_tl
+ \@@_add_arg:V \l_@@_nesting_a_tl
+ }
+ }
+ }
+ \l_@@_fn_tl #3 \q_nil \q_@@ \ERROR
+ }
+\cs_new:Npn \@@_grab_D_nested:w #1 \q_nil \q_stop
+ { \exp_not:o { \use_none:n #1 } }
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \begin{macro}{\@@_grab_D_call:Nw}
+% For \texttt{D} and \texttt{R}-type arguments, to avoid losing any
+% braces, a token needs to be inserted before the argument to be grabbed.
+% If the argument runs away because the closing token is missing then this
+% inserted token shows up in the terminal. Ideally, |#1| would therefore be
+% used directly, but that is no good as it will mess up the rest of the
+% grabber. Instead, a copy of |#1| with an altered category code is used,
+% as this will look right in the terminal but will not mess up the grabber.
+% The only issue then is that the category code of |#1| is unknown. So there
+% is a quick test to ensure that the inserted token can never be matched by
+% the grabber. (This assumes that the open and close delimiters are not the
+% same character with different category codes, but that really should not
+% happen in any sensible document-level syntax.)
+% An exception is when |#1| is a control sequence token, in which case the
+% character-token treatment is no good because if hit with \cs{token_to_str:N}
+% it would add sputios tokens to the argument. In this case a different
+% branch is taken. The token inserted is then the same \meta{csname} as |#1|,
+% but with a space appended, so that the grabber don't see it as another
+% of the same delimiter.
+% \begin{macrocode}
+\cs_new_protected_nopar:Npn \@@_grab_D_call:Nw #1
+ {
+ \token_if_eq_catcode:NNTF + #1
+ {
+ \exp_after:wN \exp_after:wN \exp_after:wN
+ \l_@@_fn_tl \char_generate:nn { `#1 } { 11 }
+ }
+ {
+ \@@_token_if_cs:NTF #1
+ {
+ \exp_after:wN \l_@@_fn_tl
+ \cs:w \cs_to_str:N #1 ~ \cs_end:
+ }
+ {
+ \exp_after:wN \l_@@_fn_tl
+ \token_to_str:N #1
+ }
+ }
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}
+% {
+% \@@_grab_E:w, \@@_grab_E_long:w,
+% \@@_grab_E_obey_spaces:w, \@@_grab_E_long_obey_spaces:w
+% }
+% \begin{macro}{\@@_grab_E:nnNN}
+% \begin{macro}{\@@_grab_E_loop:NnN}
+% \begin{macro}{\@@_grab_E_finalise:}
+% Everything here needs to point to a loop.
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_grab_E:w #1#2 \@@_run_code:
+ {
+ \@@_grab_E:nnNN {#1} {#2}
+ \cs_set_protected_nopar:Npn
+ \@@_peek_nonspace_remove:NTF
+ }
+\cs_new_protected:Npn \@@_grab_E_long:w #1#2 \@@_run_code:
+ {
+ \@@_grab_E:nnNN {#1} {#2}
+ \cs_set_protected:Npn
+ \@@_peek_nonspace_remove:NTF
+ }
+\cs_new_protected:Npn \@@_grab_E_obey_spaces:w #1#2 \@@_run_code:
+ {
+ \@@_grab_E:nnNN {#1} {#2}
+ \cs_set_protected_nopar:Npn
+ \@@_peek_meaning_remove:NTF
+ }
+\cs_new_protected:Npn \@@_grab_E_long_obey_spaces:w #1#2 \@@_run_code:
+ {
+ \@@_grab_E:nnNN {#1} {#2}
+ \cs_set_protected:Npn
+ \@@_peek_meaning_remove:NTF
+ }
+% \end{macrocode}
+% A loop is needed here to allow a random ordering of keys. These are
+% searched for one at a time, with any not found needing to be tracked:
+% they can appear later. The grabbed values are held in a property list
+% which is then turned into an ordered list to be passed back to the user.
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_grab_E:nnNN #1#2#3#4
+ {
+ \exp_after:wN #3 \l_@@_fn_tl ##1##2##3
+ {
+ \prop_put:Nnn \l_@@_tmp_prop {##1} {##3}
+ \@@_grab_E_loop:NnN #4 { } ##2 \q_recursion_stop
+ }
+ \prop_clear:N \l_@@_tmp_prop
+ \tl_set:Nn \l_@@_signature_tl {#2}
+ \cs_set_protected:Npn \@@_grab_E_finalise:
+ {
+ \tl_map_inline:nn {#1}
+ {
+ \prop_get:NnNF \l_@@_tmp_prop {####1} \l_@@_tmpb_tl
+ { \tl_set_eq:NN \l_@@_tmpb_tl \c_novalue_tl }
+ \tl_put_right:Nx \l_@@_args_tl
+ { { \exp_not:V \l_@@_tmpb_tl } }
+ }
+ \l_@@_signature_tl \@@_run_code:
+ }
+ \@@_grab_E_loop:NnN #4 { } #1 \q_recursion_tail \q_recursion_stop
+ }
+\cs_new_protected:Npn \@@_grab_E_loop:NnN #1#2#3#4 \q_recursion_stop
+ {
+ \cs_if_eq:NNTF #3 \q_recursion_tail
+ { \@@_grab_E_finalise: }
+ {
+ #1 #3
+ { \l_@@_fn_tl #3 {#2#4} }
+ { \@@_grab_E_loop:NnN #1 {#2#3} #4 \q_recursion_stop }
+ }
+ }
+\cs_new_protected:Npn \@@_grab_E_finalise: { }
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+%
+% \begin{macro}{\@@_grab_m:w}
+% \begin{macro}{\@@_grab_m_long:w}
+% Collecting a single mandatory argument is quite easy.
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_grab_m:w #1 \@@_run_code:
+ {
+ \tl_set:Nn \l_@@_signature_tl {#1}
+ \exp_after:wN \cs_set_protected_nopar:Npn \l_@@_fn_tl ##1
+ { \@@_add_arg:n {##1} }
+ \l_@@_fn_tl
+ }
+\cs_new_protected:Npn \@@_grab_m_long:w #1 \@@_run_code:
+ {
+ \tl_set:Nn \l_@@_signature_tl {#1}
+ \exp_after:wN \cs_set_protected:Npn \l_@@_fn_tl ##1
+ { \@@_add_arg:n {##1} }
+ \l_@@_fn_tl
+ }
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\@@_grab_m_1:w}
+% \begin{macro}{\@@_grab_m_2:w}
+% \begin{macro}{\@@_grab_m_3:w}
+% \begin{macro}{\@@_grab_m_4:w}
+% \begin{macro}{\@@_grab_m_5:w}
+% \begin{macro}{\@@_grab_m_6:w}
+% \begin{macro}{\@@_grab_m_7:w}
+% \begin{macro}{\@@_grab_m_8:w}
+% \begin{macro}{\@@_grab_m_9:w}
+% \begin{macro}{\@@_grab_m_aux:Nnnnnnnnn}
+% Grabbing 1--8 mandatory arguments is done by giving 8--1 known
+% arguments to a 9-argument function that stores them in
+% \cs{l_@@_args_tl}. For simplicity, grabbing 9 mandatory arguments
+% is done by grabbing 5 then 4 arguments.
+% \begin{macrocode}
+\cs_new_protected_nopar:Npn \@@_grab_m_aux:Nnnnnnnnn #1#2#3#4#5#6#7#8#9
+ {
+ \tl_put_right:No \l_@@_args_tl
+ { #1 {#2} {#3} {#4} {#5} {#6} {#7} {#8} {#9} }
+ \l_@@_signature_tl \@@_run_code:
+ }
+\cs_new_protected:cpn { @@_grab_m_1:w } #1 \@@_run_code:
+ {
+ \tl_set:Nn \l_@@_signature_tl {#1}
+ \exp_after:wN \cs_set_eq:NN \l_@@_fn_tl \@@_grab_m_aux:Nnnnnnnnn
+ \l_@@_fn_tl \use_none:nnnnnnn { } { } { } { } { } { } { }
+ }
+\cs_new_protected:cpn { @@_grab_m_2:w } #1 \@@_run_code:
+ {
+ \tl_set:Nn \l_@@_signature_tl {#1}
+ \exp_after:wN \cs_set_eq:NN \l_@@_fn_tl \@@_grab_m_aux:Nnnnnnnnn
+ \l_@@_fn_tl \use_none:nnnnnn { } { } { } { } { } { }
+ }
+\cs_new_protected:cpn { @@_grab_m_3:w } #1 \@@_run_code:
+ {
+ \tl_set:Nn \l_@@_signature_tl {#1}
+ \exp_after:wN \cs_set_eq:NN \l_@@_fn_tl \@@_grab_m_aux:Nnnnnnnnn
+ \l_@@_fn_tl \use_none:nnnnn { } { } { } { } { }
+ }
+\cs_new_protected:cpn { @@_grab_m_4:w } #1 \@@_run_code:
+ {
+ \tl_set:Nn \l_@@_signature_tl {#1}
+ \exp_after:wN \cs_set_eq:NN \l_@@_fn_tl \@@_grab_m_aux:Nnnnnnnnn
+ \l_@@_fn_tl \use_none:nnnn { } { } { } { }
+ }
+\cs_new_protected:cpn { @@_grab_m_5:w } #1 \@@_run_code:
+ {
+ \tl_set:Nn \l_@@_signature_tl {#1}
+ \exp_after:wN \cs_set_eq:NN \l_@@_fn_tl \@@_grab_m_aux:Nnnnnnnnn
+ \l_@@_fn_tl \use_none:nnn { } { } { }
+ }
+\cs_new_protected:cpn { @@_grab_m_6:w } #1 \@@_run_code:
+ {
+ \tl_set:Nn \l_@@_signature_tl {#1}
+ \exp_after:wN \cs_set_eq:NN \l_@@_fn_tl \@@_grab_m_aux:Nnnnnnnnn
+ \l_@@_fn_tl \use_none:nn { } { }
+ }
+\cs_new_protected:cpn { @@_grab_m_7:w } #1 \@@_run_code:
+ {
+ \tl_set:Nn \l_@@_signature_tl {#1}
+ \exp_after:wN \cs_set_eq:NN \l_@@_fn_tl \@@_grab_m_aux:Nnnnnnnnn
+ \l_@@_fn_tl \use_none:n { }
+ }
+\cs_new_protected:cpn { @@_grab_m_8:w } #1 \@@_run_code:
+ {
+ \tl_set:Nn \l_@@_signature_tl {#1}
+ \exp_after:wN \cs_set_eq:NN \l_@@_fn_tl \@@_grab_m_aux:Nnnnnnnnn
+ \l_@@_fn_tl \prg_do_nothing:
+ }
+\cs_new_protected:cpx { @@_grab_m_9:w }
+ {
+ \exp_not:c { @@_grab_m_5:w }
+ \exp_not:c { @@_grab_m_4:w }
+ }
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\@@_grab_R:w, \@@_grab_R_long:w}
+% \begin{macro}{\@@_grab_R_aux:NNnN}
+% The grabber for \texttt{R}-type arguments is basically the same as
+% that for \texttt{D}-type ones, but always skips spaces (as it is mandatory)
+% and has a hard-coded error message.
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_grab_R:w #1#2#3 \@@_run_code:
+ { \@@_grab_R_aux:NNnN #1 #2 {#3} \cs_set_protected_nopar:Npn }
+\cs_new_protected:Npn \@@_grab_R_long:w #1#2#3 \@@_run_code:
+ { \@@_grab_R_aux:NNnN #1 #2 {#3} \cs_set_protected:Npn }
+\cs_new_protected:Npn \@@_grab_R_aux:NNnN #1#2#3#4
+ {
+ \@@_grab_D_aux:NNnN #1 #2 {#3} #4
+ \@@_peek_nonspace_remove:NTF #1
+ { \@@_grab_D_call:Nw #1 }
+ {
+ \__kernel_msg_error:nnxx { ltcmd } { missing-required }
+ { \@@_environment_or_command: }
+ { \token_to_str:N #1 }
+ \@@_add_arg:o \c_novalue_tl
+ }
+ }
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\@@_grab_t:w}
+% \begin{macro}{\@@_grab_t_obey_spaces:w}
+% \begin{macro}{\@@_grab_t_aux:NNw}
+% Dealing with a token is quite easy. Check the match, remove the
+% token if needed and add a flag to the output.
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_grab_t:w
+ { \@@_grab_t_aux:NNw \@@_peek_nonspace_remove:NTF }
+\cs_new_protected:Npn \@@_grab_t_obey_spaces:w
+ { \@@_grab_t_aux:NNw \@@_peek_meaning_remove:NTF }
+\cs_new_protected:Npn \@@_grab_t_aux:NNw #1#2#3 \@@_run_code:
+ {
+ \tl_set:Nn \l_@@_signature_tl {#3}
+ \exp_after:wN \cs_set_protected:Npn \l_@@_fn_tl
+ {
+ #1 #2
+ { \@@_add_arg:n { \BooleanTrue } }
+ { \@@_add_arg:n { \BooleanFalse } }
+ }
+ \l_@@_fn_tl
+ }
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{variable}{\l_@@_v_arg_tl}
+% \begin{macrocode}
+\tl_new:N \l_@@_v_arg_tl
+% \end{macrocode}
+% \end{variable}
+%
+% \begin{macro}{\@@_grab_v:w}
+% \begin{macro}{\@@_grab_v_long:w}
+% \begin{macro}{\@@_grab_v_aux:w}
+% \begin{macro}{\@@_grab_v_group_end:}
+% The opening delimiter is the first non-space token, and is never
+% read verbatim. This is required by consistency with the case where
+% the preceding argument was optional and absent: then \TeX{} has
+% already read and tokenized that token when looking for the optional
+% argument. The first thing is thus to check is that this delimiter
+% is a character, and to distinguish the case of a left brace (in that
+% case, \cs{group_align_safe_end:} is needed to compensate for the
+% begin-group character that was just seen). Then set verbatim
+% catcodes with \cs{@@_grab_v_aux_catcodes:}.
+%
+% The group keep catcode changes local, and
+% \cs{group_align_safe_begin/end:} allow to use a character
+% with category code~$4$ (normally |&|) as the delimiter (all commands
+% do \cs{group_align_safe_begin/end:}, so there's no need to do that
+% again here).
+% It is ended by \cs{@@_grab_v_group_end:}, which smuggles
+% the collected argument out of the group.
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_grab_v:w
+ {
+ \bool_set_false:N \l_@@_long_bool
+ \@@_grab_v_aux:w
+ }
+\cs_new_protected:Npn \@@_grab_v_long:w
+ {
+ \bool_set_true:N \l_@@_long_bool
+ \@@_grab_v_aux:w
+ }
+\cs_new_protected:Npn \@@_grab_v_aux:w #1 \@@_run_code:
+ {
+ \tl_set:Nn \l_@@_signature_tl {#1}
+ \group_begin:
+ \tex_escapechar:D = 92 \scan_stop:
+ \tl_clear:N \l_@@_v_arg_tl
+ \peek_remove_spaces:n
+ {
+ \peek_meaning_remove:NTF \c_group_begin_token
+ {
+ \group_align_safe_end:
+ \@@_grab_v_bgroup:
+ }
+ {
+ \peek_N_type:TF
+ { \@@_grab_v_aux_test:N }
+ { \@@_grab_v_aux_abort:n { } }
+ }
+ }
+ }
+\cs_new_protected:Npn \@@_grab_v_group_end:
+ {
+ \exp_args:NNNo
+ \group_end:
+ \tl_set:Nn \l_@@_v_arg_tl { \l_@@_v_arg_tl }
+ }
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\@@_grab_v_aux_test:N}
+% \begin{macro}
+% {
+% \@@_grab_v_aux_loop:N,
+% \@@_grab_v_aux_loop:NN,
+% \@@_grab_v_aux_loop_end:
+% }
+% Check that the opening delimiter is a character, setup category codes,
+% then start reading tokens one by one, keeping the delimiter as an argument.
+% If the verbatim was not nested, we will be grabbing one character
+% at each step. Unfortunately, it can happen that what follows the
+% verbatim argument is already tokenized. Thus, we check at each step
+% that the next token is indeed a \enquote{nice}
+% character, \emph{i.e.}, is not a character with
+% category code $1$ (begin-group), $2$ (end-group)
+% or $6$ (macro parameter), nor the space character,
+% with category code~$10$ and character code~$32$,
+% nor a control sequence.
+% The partially built argument is stored in \cs{l_@@_v_arg_tl}.
+% If we ever meet a token which we cannot grab (non-N-type),
+% or which is not a character according to
+% \cs{@@_grab_v_token_if_char:NTF}, then we bail out with
+% \cs{@@_grab_v_aux_abort:n}. Otherwise, we stop at the first
+% character matching the delimiter.
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_grab_v_aux_test:N #1
+ {
+ \@@_grab_v_token_if_char:NTF #1
+ {
+ \@@_grab_v_aux_put:N #1
+ \@@_grab_v_aux_catcodes:
+ \@@_grab_v_aux_loop:N #1
+ }
+ { \@@_grab_v_aux_abort:n {#1} #1 }
+ }
+\cs_new_protected:Npn \@@_grab_v_aux_loop:N #1
+ {
+ \peek_N_type:TF
+ { \@@_grab_v_aux_loop:NN #1 }
+ { \@@_grab_v_aux_abort:n { } }
+ }
+\cs_new_protected:Npn \@@_grab_v_aux_loop:NN #1#2
+ {
+ \@@_grab_v_token_if_char:NTF #2
+ {
+ \token_if_eq_charcode:NNTF #1 #2
+ { \@@_grab_v_aux_loop_end: }
+ {
+ \@@_grab_v_aux_put:N #2
+ \@@_grab_v_aux_loop:N #1
+ }
+ }
+ { \@@_grab_v_aux_abort:n {#2} #2 }
+ }
+\cs_new_protected:Npn \@@_grab_v_aux_loop_end:
+ {
+ \@@_grab_v_group_end:
+ \@@_add_arg:x { \tl_tail:N \l_@@_v_arg_tl }
+ }
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{variable}{\l_@@_v_nesting_int}
+% \begin{macrocode}
+\int_new:N \l_@@_v_nesting_int
+% \end{macrocode}
+% \end{variable}
+%
+% \begin{macro}{\@@_grab_v_bgroup:}
+% \begin{macro}{\@@_grab_v_bgroup_loop:}
+% \begin{macro}{\@@_grab_v_bgroup_loop:N}
+% If the opening delimiter is a left brace, we keep track of
+% how many left and right braces were encountered so far in
+% \cs{l_@@_v_nesting_int} (the methods used for optional
+% arguments cannot apply here), and stop as soon as it reaches~$0$.
+%
+% Some care was needed when removing the opening delimiter, which
+% has already been assigned category code~$1$: using
+% \cs{peek_meaning_remove:NTF} in the \cs{@@_grab_v_aux:w}
+% function would break within alignments. Instead, we first
+% convert that token to a string, and remove the result as a
+% normal undelimited argument.
+% \begin{macrocode}
+\cs_new_protected:Npx \@@_grab_v_bgroup:
+ {
+ \exp_not:N \@@_grab_v_aux_catcodes:
+ \exp_not:n { \int_set:Nn \l_@@_v_nesting_int { 1 } }
+ \exp_not:N \@@_grab_v_aux_put:N \iow_char:N \{
+ \exp_not:N \@@_grab_v_bgroup_loop:
+ }
+\cs_new_protected:Npn \@@_grab_v_bgroup_loop:
+ {
+ \peek_N_type:TF
+ { \@@_grab_v_bgroup_loop:N }
+ { \@@_grab_v_aux_abort:n { } }
+ }
+\cs_new_protected:Npn \@@_grab_v_bgroup_loop:N #1
+ {
+ \@@_grab_v_token_if_char:NTF #1
+ {
+ \token_if_eq_charcode:NNTF \c_group_end_token #1
+ {
+ \int_decr:N \l_@@_v_nesting_int
+ \int_compare:nNnTF \l_@@_v_nesting_int > 0
+ {
+ \@@_grab_v_aux_put:N #1
+ \@@_grab_v_bgroup_loop:
+ }
+ { \@@_grab_v_aux_loop_end: }
+ }
+ {
+ \token_if_eq_charcode:NNT \c_group_begin_token #1
+ { \int_incr:N \l_@@_v_nesting_int }
+ \@@_grab_v_aux_put:N #1
+ \@@_grab_v_bgroup_loop:
+ }
+ }
+ { \@@_grab_v_aux_abort:n {#1} #1 }
+ }
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\@@_grab_v_aux_catcodes:}
+% \begin{macro}{\@@_grab_v_aux_abort:n}
+% The approach for short verbatim arguments is to make the end-line
+% character a macro parameter character: this is forbidden by the
+% rest of the code. Then the error branch can check what caused the
+% bail out and give the appropriate error message.
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_grab_v_aux_catcodes:
+ {
+ \cs_set_eq:NN \do \char_set_catcode_other:N
+ \dospecials
+ \tex_endlinechar:D = `\^^M \scan_stop:
+ \bool_if:NTF \l_@@_long_bool
+ { \char_set_catcode_other:n { \tex_endlinechar:D } }
+ { \char_set_catcode_parameter:n { \tex_endlinechar:D } }
+ }
+\cs_new_protected:Npn \@@_grab_v_aux_abort:n #1
+ {
+ \@@_grab_v_group_end:
+ \exp_after:wN \exp_after:wN \exp_after:wN
+ \peek_meaning_remove:NTF \char_generate:nn { \tex_endlinechar:D } { 6 }
+ {
+ \__kernel_msg_error:nnxxx { ltcmd } { verbatim-newline }
+ { \@@_environment_or_command: }
+ { \tl_to_str:N \l_@@_v_arg_tl }
+ { \tl_to_str:n {#1} }
+ \@@_add_arg:o \c_novalue_tl
+ }
+ {
+ \__kernel_msg_error:nnxxx { ltcmd } { verbatim-tokenized }
+ { \@@_environment_or_command: }
+ { \tl_to_str:N \l_@@_v_arg_tl }
+ { \tl_to_str:n {#1} }
+ \@@_add_arg:o \c_novalue_tl
+ }
+ }
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\@@_grab_v_aux_put:N}
+% Storing one token in the collected argument. Most tokens are
+% converted to category code $12$, with the exception of active
+% characters, and spaces (not sure what should be done for those).
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_grab_v_aux_put:N #1
+ {
+ \tl_put_right:Nx \l_@@_v_arg_tl
+ {
+ \token_if_active:NTF #1
+ { \exp_not:N #1 } { \token_to_str:N #1 }
+ }
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@@_grab_v_token_if_char:NTF}
+% This function assumes that the escape character is printable.
+% Then the string representation of control sequences is at least
+% two characters, and \cs{str_tail:n} only removes the escape
+% character. Macro parameter characters are doubled by
+% \cs{tl_to_str:n}, and will also yield a non-empty result,
+% hence are not considered as characters.
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_grab_v_token_if_char:NTF #1
+ { \str_if_eq:eeTF { } { \str_tail:n {#1} } }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@@_add_arg:n, \@@_add_arg:V, \@@_add_arg:o, \@@_add_arg:x}
+% When an argument is found it is stored, then further arguments are
+% grabbed by calling \cs{l_@@_signature_tl}.
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_add_arg:n #1
+ {
+ \tl_put_right:Nn \l_@@_args_tl { {#1} }
+ \l_@@_signature_tl \@@_run_code:
+ }
+\cs_generate_variant:Nn \@@_add_arg:n { V , o , x }
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Grabbing arguments expandably}
+%
+% \begin{macro}[EXP]{\@@_expandable_grab_D:w}
+% \begin{macro}[EXP]{\@@_expandable_grab_D:NNNwNNn}
+% \begin{macro}[EXP]{\@@_expandable_grab_D:NNNwNNnnn}
+% \begin{macro}[EXP]{\@@_expandable_grab_D:Nw}
+% \begin{macro}[EXP]{\@@_expandable_grab_D:nnNNNwNN}
+% The first step is to grab the first token or group. The generic grabbers
+% \cs{\meta{function}}\verb*| | and \cs{\meta{function}}\verb*| | are just after \cs{q_@@}, we go and find
+% them (and use the long one).
+% \begin{macrocode}
+\cs_new:Npn \@@_expandable_grab_D:w #1 \q_@@ #2#3
+ { #2 { \@@_expandable_grab_D:NNNwNNn #1 \q_@@ #2 #3 } }
+% \end{macrocode}
+% We then wish to test whether |#7|, which we just grabbed, is exactly |#2|.
+% A preliminary test is whether their string representations coincide, then
+% expand the only grabber function we have, |#1|, once: the two strings below
+% are equal if and only if |#7| matches |#2| exactly.\footnote{It is obvious
+% that if \texttt{\#7} matches \texttt{\#2} then the strings are equal. We
+% must check the converse. The right-hand-side of \cs{str_if_eq:onTF} does
+% not end with \texttt{\#3}, implying that the grabber function took
+% everything as its arguments. The first brace group can only be empty if
+% \texttt{\#7} starts with \texttt{\#2}, otherwise the brace group preceding
+% \texttt{\#7} would not vanish. The third brace group is empty, thus the
+% \cs{q_@@} that was used by our grabber \texttt{\#1} must be the one
+% that we inserted (not some token in \texttt{\#7}), hence the second brace
+% group contains the end of \texttt{\#7} followed by \texttt{\#2}. Since this
+% is \texttt{\#2} on the right-hand-side, and no brace can be lost there,
+% \texttt{\#7} must contain nothing else than its leading \texttt{\#2}.}
+% The preliminary test is needed as |#7| could validly contain
+% \tn{par} (because a later mandatory argument could be long) and our
+% grabber may be short. If
+% |#7| does not match |#2|, then the optional argument is missing, we use the
+% default |-NoValue-|, and put back the argument |#7| in the input stream.
+%
+% If it does match, then interesting things need to be done. We will grab the
+% argument piece by piece, with the following pattern:
+% \begin{quote}
+% \meta{grabber} \Arg{tokens} \\
+% ~~\cs{q_nil} \Arg{piece 1} \meta{piece 2} \cs{ERROR} \cs{q_@@}\\
+% ~~\cs{q_nil} \meta{input stream}
+% \end{quote}
+% The \meta{grabber} will find an opening delimiter in \meta{piece 2}, take
+% the \cs{q_@@} as a second delimiter, and find more material delimited
+% by the closing delimiter in the \meta{input stream}. We then move the part
+% before the opening delimiter from \meta{piece 2} to \meta{piece 1}, and the
+% material taken from the \meta{input stream} to the \meta{piece 2}. Thus,
+% the argument moves gradually from the \meta{input stream} to the
+% \meta{piece 2}, then to the \meta{piece 1} when we have made sure to find
+% all opening and closing delimiters. This two-step process ensures that
+% nesting works: the number of opening delimiters minus closing delimiters in
+% \meta{piece 1} is always equal to the number of closing delimiters in
+% \meta{piece 2}. We stop grabbing arguments once the \meta{piece 2} contains
+% no opening delimiter any more, hence the balance is reached, and the final
+% argument is \meta{piece 1} \meta{piece 2}.
+% The indirection via \cs{@@_tmp:w} allows to insert |-NoValue-| expanded.
+% \begin{macrocode}
+\cs_set_protected:Npn \@@_tmp:w #1
+ {
+ \cs_new:Npn \@@_expandable_grab_D:NNNwNNn ##1##2##3##4 \q_@@ ##5##6##7
+ {
+ \str_if_eq:nnTF {##2} {##7}
+ {
+ \str_if_eq:onTF
+ { ##1 { } { } ##7 ##2 \q_@@ ##3 }
+ { { } {##2} { } }
+ }
+ { \use_ii:nn }
+ {
+ ##1
+ { \@@_expandable_grab_D:NNNwNNnnn ##1##2##3##4 \q_@@ ##5##6 }
+ \q_nil { } ##2 \ERROR \q_@@ \ERROR
+ }
+ { ##4 {#1} \q_@@ ##5 ##6 {##7} }
+ }
+ }
+\exp_args:No \@@_tmp:w { \c_novalue_tl }
+% \end{macrocode}
+% At this stage, |#7| is \cs{q_nil} \Arg{piece 1} \meta{more for piece 1},
+% and we want to concatenate all that, removing \cs{q_nil}, and keeping the
+% opening delimiter |#2|. Simply use \cs{use_ii:nn}. Also, |#8| is
+% \meta{remainder of piece 2} \cs{ERROR}, and |#9| is \cs{ERROR} \meta{more
+% for piece 2}. We concatenate those, replacing the two \cs{ERROR} by the
+% closing delimiter |#3|.
+% \begin{macrocode}
+\cs_new:Npn \@@_expandable_grab_D:NNNwNNnnn #1#2#3#4 \q_@@ #5#6#7#8#9
+ {
+ \exp_args:Nof \@@_expandable_grab_D:nnNNNwNN
+ { \use_ii:nn #7 #2 }
+ { \@@_expandable_grab_D:Nw #3 \exp_stop_f: #8 #9 }
+ #1#2#3 #4 \q_@@ #5 #6
+ }
+\cs_new:Npn \@@_expandable_grab_D:Nw #1#2 \ERROR \ERROR { #2 #1 }
+% \end{macrocode}
+% Armed with our two new \meta{pieces}, we are ready to loop. However, we
+% must first see if \meta{piece 2} (here |#2|) contains any opening
+% delimiter |#4|. Again, we expand |#3|, this time removing its whole output
+% with \cs{use_none:nnn}. The test is similar to \cs{tl_if_in:nnTF}. The
+% token list is empty if and only if |#2| does not contain the opening
+% delimiter. In that case, we are done, and put the argument (from which we
+% remove a spurious pair of delimiters coming from how we started the loop).
+% Otherwise, we go back to looping with
+% \cs{@@_expandable_grab_D:NNNwNNnnn}. The code to deal with brace stripping
+% is much the same as for the non-expandable case.
+% \begin{macrocode}
+\cs_new:Npn \@@_expandable_grab_D:nnNNNwNN #1#2#3#4#5#6 \q_@@ #7#8
+ {
+ \exp_args:No \tl_if_empty:oTF
+ { #3 { \use_none:nnn } #2 \q_@@ #5 #4 \q_@@ #5 }
+ {
+ \tl_if_blank:oTF { \use_none:nn #1#2 }
+ { \@@_put_arg_expandable:ow { \use_none:nn #1#2 } }
+ {
+ \str_if_eq:eeTF
+ { \exp_not:o { \use_none:nn #1#2 } }
+ { { \exp_not:o { \use_iii:nnnn #1#2 \q_nil } } }
+ { \@@_put_arg_expandable:ow { \use_iii:nnn #1#2 } }
+ { \@@_put_arg_expandable:ow { \use_none:nn #1#2 } }
+ }
+ #6 \q_@@ #7 #8
+ }
+ {
+ #3
+ { \@@_expandable_grab_D:NNNwNNnnn #3#4#5#6 \q_@@ #7 #8 }
+ \q_nil {#1} #2 \ERROR \q_@@ \ERROR
+ }
+ }
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}[EXP]{\@@_expandable_grab_D_alt:w}
+% \begin{macro}[EXP]{\@@_expandable_grab_D_alt:NNwNNn}
+% \begin{macro}[EXP]{\@@_expandable_grab_D_alt:Nwn}
+% When the delimiters are identical, nesting is not possible and a simplified
+% approach is used. The test concept here is the same as for the case where
+% the delimiters are different but there cannot be any nesting.
+% \begin{macrocode}
+\cs_new:Npn \@@_expandable_grab_D_alt:w #1 \q_@@ #2#3
+ { #2 { \@@_expandable_grab_D_alt:NNwNNn #1 \q_@@ #2 #3 } }
+\cs_set_protected:Npn \@@_tmp:w #1
+ {
+ \cs_new:Npn \@@_expandable_grab_D_alt:NNwNNn ##1##2##3 \q_@@ ##4##5##6
+ {
+ \str_if_eq:nnTF {##6} {##2}
+ {
+ \str_if_eq:onTF
+ { ##1 { } ##6 ##2 ##2 }
+ { { } ##2 }
+ }
+ { \use_ii:nn }
+ {
+ ##1
+ { \@@_expandable_grab_D_alt:NNwn ##4 ##5 ##3 \q_@@ }
+ ##6 \ERROR
+ }
+ { ##3 {#1} \q_@@ ##4 ##5 {##6} }
+ }
+ }
+\exp_args:No \@@_tmp:w { \c_novalue_tl }
+\cs_new:Npn \@@_expandable_grab_D_alt:NNwn #1#2#3 \q_@@ #4
+ {
+ \tl_if_blank:oTF { \use_none:n #4 }
+ { \@@_put_arg_expandable:ow { \use_none:n #4 } }
+ {
+ \str_if_eq:eeTF
+ { \exp_not:o { \use_none:n #4 } }
+ { { \exp_not:o { \use_ii:nnn #4 \q_nil } } }
+ { \@@_put_arg_expandable:ow { \use_ii:nn #4 } }
+ { \@@_put_arg_expandable:ow { \use_none:n #4 } }
+ }
+ #3 \q_@@ #1 #2
+ }
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}[EXP]{\@@_expandable_grab_E:w, \@@_expandable_grab_E_long:w}
+% \begin{macro}[EXP]{\@@_expandable_grab_E_aux:w}
+% \begin{macro}[EXP]{\@@_expandable_grab_E_test:nnw}
+% \begin{macro}[EXP]{\@@_expandable_grab_E_loop:nnnNNw}
+% \begin{macro}[EXP]{\@@_expandable_grab_E_find:w}
+% \begin{macro}[EXP]{\@@_expandable_grab_E_find:nnw}
+% \begin{macro}[EXP]{\@@_expandable_grab_E_end:nnw}
+% We keep track of long/short by placing the appropriate grabber as
+% the third token after \cs{q_@@}; it is eventually removed by the
+% \texttt{end:nnw} auxiliary. The \texttt{aux:w} auxiliary will be
+% called repeatedly with two arguments: the set
+% of pairs \meta{parser} \meta{token}, and the set of arguments found
+% so far (initially all |{-NoValue-}|). At each step, grab what
+% follows in the input stream then call the \texttt{loop:nnnNNw}
+% auxiliary to compare it with each possible embellishment in turn.
+% This auxiliary's |#1| is what was found in the input, |#2| collects
+% \meta{parser} \meta{token} pairs that did not match, |#3| collects
+% the corresponding arguments found previously, |#4| and |#5| is the
+% current pair, |#6| is the remaining pairs, |#7| is empty or two
+% \cs{q_nil}, and |#8| is the current argument. If none of the pairs
+% matched (determined by \cs{quark_if_nil:NTF}) then call the
+% \texttt{end} auxiliary to stop looking for embellishments,
+% remembering to put what was grabbed in the input back where it
+% belongs, and storing the arguments found just before \cs{q_@@}. If
+% the current argument |#8| is not |-NoValue-| or if the input |#1|
+% does not match |#5| (see \texttt{t}-type arguments below for a
+% similar \cs{str_if_eq:onTF} test) then carry on the loop.
+% Otherwise, we found a new embellishment: grab the corresponding
+% argument in the input using the \texttt{find:w} auxiliary. To avoid
+% losing braces around that auxiliary's argument we include a
+% space, which will be eliminated in the next loop through
+% embellishments.
+% \begin{macrocode}
+\cs_new:Npn \@@_expandable_grab_E:w #1 \q_@@ #2#3
+ { \@@_expandable_grab_E_aux:w #1 \q_@@ #2 #3 #3 }
+\cs_new:Npn \@@_expandable_grab_E_long:w #1 \q_@@ #2#3
+ { \@@_expandable_grab_E_aux:w #1 \q_@@ #2 #3 #2 }
+\cs_new:Npn \@@_expandable_grab_E_aux:w #1 \q_@@ #2#3#4
+ { #2 { \@@_expandable_grab_E_test:nnw #1 \q_@@ #2 #3 #4 } }
+\cs_new:Npn \@@_expandable_grab_E_test:nnw #1#2#3 \q_@@ #4#5#6#7
+ {
+ \@@_expandable_grab_E_loop:nnnNNw {#7} { } { }
+ #1 \q_nil \q_nil \q_nil \q_mark #2 \q_nil
+ #3 \q_@@ #4 #5 #6
+ }
+\cs_new:Npn \@@_expandable_grab_E_loop:nnnNNw
+ #1#2#3#4#5#6 \q_nil #7 \q_mark #8
+ {
+ \quark_if_nil:NTF #4
+ { \@@_expandable_grab_E_end:nnw {#1} {#3} }
+ {
+ \tl_if_novalue:nTF {#8}
+ { \str_if_eq:onTF { #4 { } #1 #5 } {#5} }
+ { \use_ii:nn }
+ { \@@_expandable_grab_E_find:w { #2 #4 #5 #6 } {#3} ~ }
+ {
+ \@@_expandable_grab_E_loop:nnnNNw
+ {#1} { #2 #4 #5 } { #3 {#8} }
+ #6 \q_nil #7 \q_mark
+ }
+ }
+ }
+\cs_new:Npn \@@_expandable_grab_E_find:w #1 \q_@@ #2#3#4
+ { #4 { \@@_expandable_grab_E_find:nnw #1 \q_@@ #2 #3 #4 } }
+\cs_new:Npn \@@_expandable_grab_E_find:nnw #1#2#3 \q_nil #4 \q_@@ #5#6#7#8
+ { \@@_expandable_grab_E_aux:w {#1} { #2 {#8} #3 } #4 \q_@@ #5 #6 #7 }
+\cs_new:Npn \@@_expandable_grab_E_end:nnw #1#2#3 \q_@@ #4#5#6
+ { #3 #2 \q_@@ #4 #5 {#1} }
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}[EXP]{\@@_expandable_grab_m:w, \@@_expandable_grab_m_long:w}
+% \begin{macro}[EXP]{\@@_expandable_grab_m_aux:wNn}
+% The mandatory case is easy: find the auxiliary after the \cs{q_@@},
+% and use it directly to grab the argument, then correctly position
+% the argument before \cs{q_@@}.
+% \begin{macrocode}
+\cs_new:Npn \@@_expandable_grab_m:w #1 \q_@@ #2#3
+ { #3 { \@@_expandable_grab_m_aux:wNn #1 \q_@@ #2 #3 } }
+\cs_new:Npn \@@_expandable_grab_m_long:w #1 \q_@@ #2#3
+ { #2 { \@@_expandable_grab_m_aux:wNn #1 \q_@@ #2 #3 } }
+\cs_new:Npn \@@_expandable_grab_m_aux:wNn #1 \q_@@ #2#3#4
+ { #1 {#4} \q_@@ #2 #3 }
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}[EXP]{\@@_expandable_grab_R:w}
+% \begin{macro}[EXP]{\@@_expandable_grab_R_aux:NNNwNNn}
+% Much the same as for the \texttt{D}-type argument, with only the lead-off
+% function varying.
+% \begin{macrocode}
+\cs_new:Npn \@@_expandable_grab_R:w #1 \q_@@ #2#3
+ { #2 { \@@_expandable_grab_R_aux:NNNwNNn #1 \q_@@ #2#3 } }
+\cs_set_protected:Npn \@@_tmp:w #1
+ {
+ \cs_new:Npn \@@_expandable_grab_R_aux:NNNwNNn ##1##2##3##4 \q_@@ ##5##6##7
+ {
+ \str_if_eq:nnTF {##7} {##2}
+ {
+ \str_if_eq:onTF
+ { ##1 { } { } ##7 ##2 \q_@@ ##3 }
+ { { } {##2} { } }
+ }
+ { \use_ii:nn }
+ {
+ ##1
+ { \@@_expandable_grab_D:NNNwNNnnn ##1##2##3##4 \q_@@ ##5##6 }
+ \q_nil { } ##2 \ERROR \q_@@ \ERROR
+ }
+ {
+ \__kernel_msg_expandable_error:nnff
+ { ltcmd } { missing-required }
+ { \exp_args:Nf \tl_trim_spaces:n { \token_to_str:N ##5 } }
+ { \tl_to_str:n {##2} }
+ ##4 {#1} \q_@@ ##5 ##6 {##7}
+ }
+ }
+ }
+\exp_args:No \@@_tmp:w { \c_novalue_tl }
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}[EXP]{\@@_expandable_grab_R_alt:w}
+% \begin{macro}[EXP]{\@@_expandable_grab_R_alt_aux:NNwNNn}
+% When the delimiters are identical, nesting is not possible and a simplified
+% approach is used. The test concept here is the same as for the case where
+% the delimiters are different.
+% \begin{macrocode}
+\cs_new:Npn \@@_expandable_grab_R_alt:w #1 \q_@@ #2#3
+ { #2 { \@@_expandable_grab_R_alt_aux:NNwNNn #1 \q_@@ #2#3 } }
+\cs_set_protected:Npn \@@_tmp:w #1
+ {
+ \cs_new:Npn \@@_expandable_grab_R_alt_aux:NNwNNn ##1##2##3 \q_@@ ##4##5##6
+ {
+ \str_if_eq:nnTF {##6} {##2}
+ {
+ \str_if_eq:onTF
+ { ##1 { } ##6 ##2 ##2 }
+ { { } ##2 }
+ }
+ { \use_ii:nn }
+ {
+ ##1
+ { \@@_expandable_grab_D_alt:NNwn ##4 ##5 ##3 \q_@@ }
+ ##6 \ERROR
+ }
+ {
+ \__kernel_msg_expandable_error:nnff
+ { ltcmd } { missing-required }
+ { \exp_args:Nf \tl_trim_spaces:n { \token_to_str:N ##4 } }
+ { \tl_to_str:n {##2} }
+ ##3 {#1} \q_@@ ##4 ##5 {##6}
+ }
+ }
+ }
+\exp_args:No \@@_tmp:w { \c_novalue_tl }
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}[EXP]{\@@_expandable_grab_t:w}
+% \begin{macro}[EXP]{\@@_expandable_grab_t_aux:NNwn}
+% As for a \texttt{D}-type argument, here we compare the grabbed tokens using
+% the only parser we have in order to work out if |#2| is exactly equal to
+% the output of the grabber.
+% \begin{macrocode}
+\cs_new:Npn \@@_expandable_grab_t:w #1 \q_@@ #2#3
+ { #2 { \@@_expandable_grab_t_aux:NNwn #1 \q_@@ #2 #3 } }
+\cs_new:Npn \@@_expandable_grab_t_aux:NNwn #1#2#3 \q_@@ #4#5#6
+ {
+ \str_if_eq:onTF { #1 { } #6 #2 } {#2}
+ { #3 { \BooleanTrue } \q_@@ #4 #5 }
+ { #3 { \BooleanFalse } \q_@@ #4 #5 {#6} }
+ }
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}[EXP]
+% {\@@_put_arg_expandable:nw, \@@_put_arg_expandable:ow}
+% A useful helper, to store arguments when they are ready.
+% \begin{macrocode}
+\cs_new:Npn \@@_put_arg_expandable:nw #1#2 \q_@@ { #2 {#1} \q_@@ }
+\cs_generate_variant:Nn \@@_put_arg_expandable:nw { o }
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Argument processors}
+%
+% \begin{macro}{\@@_bool_reverse:N}
+% A simple reversal.
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_bool_reverse:N #1
+ {
+ \bool_if:NTF #1
+ { \tl_set:Nn \ProcessedArgument { \c_false_bool } }
+ { \tl_set:Nn \ProcessedArgument { \c_true_bool } }
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{variable}{\l_@@_split_list_seq, \l_@@_split_list_tl}
+% \begin{macro}{\@@_split_list:nn}
+% \begin{macro}{\@@_split_list_multi:nn, \@@_split_list_multi:nV}
+% \begin{macro}{\@@_split_list_single:Nn}
+% Splitting can take place either at a single token or at a longer
+% identifier. To deal with single active tokens, a two-part procedure is
+% needed.
+% \begin{macrocode}
+\seq_new:N \l_@@_split_list_seq
+\tl_new:N \l_@@_split_list_tl
+\cs_new_protected:Npn \@@_split_list:nn #1#2
+ {
+ \tl_if_single:nTF {#1}
+ {
+ \token_if_cs:NTF #1
+ { \@@_split_list_multi:nn {#1} {#2} }
+ { \@@_split_list_single:Nn #1 {#2} }
+ }
+ { \@@_split_list_multi:nn {#1} {#2} }
+ }
+\cs_new_protected:Npn \@@_split_list_multi:nn #1#2
+ {
+ \seq_set_split:Nnn \l_@@_split_list_seq {#1} {#2}
+ \tl_clear:N \ProcessedArgument
+ \seq_map_inline:Nn \l_@@_split_list_seq
+ { \tl_put_right:Nn \ProcessedArgument { {##1} } }
+ }
+\cs_generate_variant:Nn \@@_split_list_multi:nn { nV }
+\group_begin:
+\char_set_catcode_active:N \^^@
+\cs_new_protected:Npn \@@_split_list_single:Nn #1#2
+ {
+ \tl_set:Nn \l_@@_split_list_tl {#2}
+ \group_begin:
+ \char_set_lccode:nn { `\^^@ } { `#1 }
+ \tex_lowercase:D
+ {
+ \group_end:
+ \tl_replace_all:Nnn \l_@@_split_list_tl { ^^@ }
+ } {#1}
+ \@@_split_list_multi:nV {#1} \l_@@_split_list_tl
+ }
+\group_end:
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{variable}
+%
+% \begin{macro}{\@@_split_argument:nnn}
+% \begin{macro}{\@@_split_argument_aux:nnnn}
+% \begin{macro}[EXP]{\@@_split_argument_aux:n}
+% \begin{macro}[rEXP]{\@@_split_argument_aux:wn}
+% Splitting to a known number of items is a special version of splitting
+% a list, in which the limit is hard-coded and where there will always be
+% exactly the correct number of output items. An auxiliary function is
+% used to save on working out the token list length several times.
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_split_argument:nnn #1#2#3
+ {
+ \@@_split_list:nn {#2} {#3}
+ \exp_args:Nf \@@_split_argument_aux:nnnn
+ { \tl_count:N \ProcessedArgument }
+ {#1} {#2} {#3}
+ }
+\cs_new_protected:Npn \@@_split_argument_aux:nnnn #1#2#3#4
+ {
+ \int_compare:nNnF {#1} = { #2 + 1 }
+ {
+ \int_compare:nNnTF {#1} > { #2 + 1 }
+ {
+ \tl_set:Nx \ProcessedArgument
+ {
+ \exp_last_unbraced:NnNo
+ \@@_split_argument_aux:n
+ { #2 + 1 }
+ \use_none_delimit_by_q_stop:w
+ \ProcessedArgument
+ \q_stop
+ }
+ \__kernel_msg_error:nnxxx { ltcmd } { split-excess-tokens }
+ { \tl_to_str:n {#3} } { \int_eval:n { #2 + 1 } }
+ { \tl_to_str:n {#4} }
+ }
+ {
+ \tl_put_right:Nx \ProcessedArgument
+ {
+ \prg_replicate:nn { #2 + 1 - (#1) }
+ { { \exp_not:V \c_novalue_tl } }
+ }
+ }
+ }
+ }
+% \end{macrocode}
+% Auxiliaries to leave exactly the correct number of arguments in
+% \cs{ProcessedArgument}.
+% \begin{macrocode}
+\cs_new:Npn \@@_split_argument_aux:n #1
+ { \prg_replicate:nn {#1} { \@@_split_argument_aux:wn } }
+\cs_new:Npn \@@_split_argument_aux:wn #1 \use_none_delimit_by_q_stop:w #2
+ {
+ \exp_not:n { {#2} }
+ #1
+ \use_none_delimit_by_q_stop:w
+ }
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\@@_trim_spaces:n}
+% This one is almost trivial.
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_trim_spaces:n #1
+ { \tl_set:Nx \ProcessedArgument { \tl_trim_spaces:n {#1} } }
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Access to the argument specification}
+%
+% \begin{macro}{\@@_get_arg_spec_error:N, \@@_get_arg_spec_error:n}
+% \begin{macro}{\@@_get_arg_spec_error_aux:n}
+% Provide an informative error when trying to get the argument
+% specification of a non-\pkg{xparse} command or environment.
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_get_arg_spec_error:N #1
+ {
+ \bool_set_false:N \l_@@_environment_bool
+ \tl_set:Nn \l_@@_fn_tl {#1}
+ \@@_get_arg_spec_error_aux:n { \cs_if_exist:NTF #1 }
+ }
+\cs_new_protected:Npn \@@_get_arg_spec_error:n #1
+ {
+ \bool_set_true:N \l_@@_environment_bool
+ \str_set:Nx \l_@@_environment_str {#1}
+ \@@_get_arg_spec_error_aux:n
+ { \cs_if_exist:cTF { \l_@@_environment_str } }
+ }
+\cs_new_protected:Npn \@@_get_arg_spec_error_aux:n #1
+ {
+ #1
+ {
+ \__kernel_msg_error:nnx { ltcmd } { non-xparse }
+ { \@@_environment_or_command: }
+ }
+ {
+ \__kernel_msg_error:nnx { ltcmd } { unknown }
+ { \@@_environment_or_command: }
+ }
+ }
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\@@_get_arg_spec:NTF}
+% If the command is not an \pkg{xparse} command, complain. If it is,
+% its second \enquote{item} is the argument specification.
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_get_arg_spec:NTF #1#2#3
+ {
+ \@@_cmd_if_xparse:NTF #1
+ {
+ \tl_set:Nx \ArgumentSpecification { \tl_item:Nn #1 { 2 } }
+ #2
+ }
+ {#3}
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% Rolling forward from 2020-10-01 is tricky because the entire |ltcmd|
+% module is new, but the user-level commands have the same name, so only
+% these will clash. To work around that, in |latexrelease| mode we will
+% (temporarily) disable \cs{__kernel_chk_if_free_cs:N} for this final
+% part of the code, then restore at the end.
+% \begin{macrocode}
+%<latexrelease>\cs_new_eq:NN \@@_chk_if_free_cs:N \__kernel_chk_if_free_cs:N
+%<latexrelease>\cs_gset_eq:NN \__kernel_chk_if_free_cs:N \use_none:n
+% \end{macrocode}
+%
+% \begin{variable}{\ArgumentSpecification}
+% \begin{macrocode}
+\tl_new:N \ArgumentSpecification
+% \end{macrocode}
+% \end{variable}
+%
+% \begin{macro}{\@@_get_arg_spec:N}
+% \begin{macro}{\@@_get_arg_spec:n}
+% Recovering the argument specification is now trivial.
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_get_arg_spec:N #1
+ {
+ \@@_get_arg_spec:NTF #1 { }
+ { \@@_get_arg_spec_error:N #1 }
+ }
+\cs_new_protected:Npn \@@_get_arg_spec:n #1
+ {
+ \exp_args:Nc \@@_get_arg_spec:NTF
+ { environment~ \tl_to_str:n {#1} }
+ { }
+ { \@@_get_arg_spec_error:n {#1} }
+ }
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\@@_show_arg_spec:N}
+% \begin{macro}{\@@_show_arg_spec:n}
+% Showing the argument specification simply means finding it and then
+% calling the \cs{tl_show:N} function.
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_show_arg_spec:N #1
+ {
+ \@@_get_arg_spec:NTF #1
+ { \tl_show:N \ArgumentSpecification }
+ { \@@_get_arg_spec_error:N #1 }
+ }
+\cs_new_protected:Npn \@@_show_arg_spec:n #1
+ {
+ \exp_args:Nc \@@_get_arg_spec:NTF
+ { environment~ \tl_to_str:n {#1} }
+ { \tl_show:N \ArgumentSpecification }
+ { \@@_get_arg_spec_error:n {#1} }
+ }
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \subsection{Utilities}
+%
+% \begin{macro}{\@@_check_definable:nNT, \@@_check_definable_aux:nN}
+% Check that a token list is appropriate as a first argument of
+% \cs{NewDocumentCommand} and similar functions and otherwise
+% produce an error. First trim whitespace to allow for spaces around
+% the actual command to be defined. If the result has multiple
+% tokens, it is not a valid argument. The single token is a control
+% sequence exactly if its string representation has more than one
+% character (using \cs{token_to_str:N} rather than \cs{tl_to_str:n}
+% to avoid problems with macro parameter characters, and setting
+% \cs{tex_escapechar:D} to prevent it from being non-printable).
+% Finally, check for an active character: this is done by lowercasing
+% the token to fix its character code (arbitrarily to that of~|?|)
+% and comparing the result to an active~|?|. Both control sequences
+% and active characters are valid arguments, and non-active character
+% tokens are not. In all cases, the group opened to keep assignments
+% local must be closed.
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_check_definable:nNT #1
+ { \tl_trim_spaces_apply:nN {#1} \@@_check_definable_aux:nN }
+\group_begin:
+ \char_set_catcode_active:n { `? }
+ \cs_new_protected:Npn \@@_check_definable_aux:nN #1#2
+ {
+ \group_begin:
+ \tl_if_single_token:nTF {#1}
+ {
+ \int_set:Nn \tex_escapechar:D { 92 }
+ \exp_args:Nx \tl_if_empty:nTF
+ { \exp_args:No \str_tail:n { \token_to_str:N #1 } }
+ {
+ \exp_args:Nx \char_set_lccode:nn
+ { ` \str_head:n {#1} } { `? }
+ \tex_lowercase:D { \tl_if_eq:nnTF {#1} } { ? }
+ { \group_end: \use_iii:nnn }
+ { \group_end: \use_i:nnn }
+ }
+ { \group_end: \use_iii:nnn }
+ }
+ { \group_end: \use_ii:nnn }
+ {
+ \__kernel_msg_error:nnxx { ltcmd } { not-definable }
+ { \tl_to_str:n {#1} } { \token_to_str:N #2 }
+ }
+ {
+ \__kernel_msg_error:nnxx { ltcmd } { not-one-token }
+ { \tl_to_str:n {#1} } { \token_to_str:N #2 }
+ }
+ }
+\group_end:
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@@_token_if_cs:NTF}
+% Based on the definition of \cs{@@_check_definable_aux:nN} above, but
+% only checks for an actual control sequence (\emph{i.e.},
+% \cs[no-index]{\meta{anything}}). \cs{tex_escapechar:D} is
+% temporarily changed to a known value and then it checks if
+% |\string#1| contains more than one character: if it does, it's a
+% control sequence. This test differs from \cs{token_if_cs:NTF} for
+% example in \verb|\token_if_cs:NTF \c_group_begin_token {T}{F}|,
+% where \cs{token_if_cs:NTF} returns false.
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_token_if_cs:NTF #1
+ {
+ \group_begin:
+ \int_set:Nn \tex_escapechar:D { 92 }
+ \exp_args:Nx \tl_if_empty:nTF
+ { \exp_args:No \str_tail:n { \token_to_str:N #1 } }
+ { \group_end: \use_ii:nn }
+ { \group_end: \use_i:nn }
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@@_tl_mapthread_function:NNN, \@@_tl_mapthread_function:nnN}
+% \begin{macro}{\@@_tl_mapthread_loop:w}
+% Analogue of \cs{seq_mapthread_function:NNN} for token lists.
+% \begin{macrocode}
+\cs_new:Npn \@@_tl_mapthread_function:NNN #1#2#3
+ {
+ \exp_after:wN \exp_after:wN
+ \exp_after:wN \@@_tl_mapthread_loop:w
+ \exp_after:wN \exp_after:wN
+ \exp_after:wN #3
+ \exp_after:wN #1
+ \exp_after:wN \q_recursion_tail
+ \exp_after:wN \q_mark
+ #2
+ \q_recursion_tail
+ \q_recursion_stop
+ }
+\cs_new:Npn \@@_tl_mapthread_function:nnN #1#2#3
+ {
+ \@@_tl_mapthread_loop:w #3
+ #1 \q_recursion_tail \q_mark
+ #2 \q_recursion_tail \q_recursion_stop
+ }
+\cs_new:Npn \@@_tl_mapthread_loop:w #1#2#3 \q_mark #4
+ {
+ \quark_if_recursion_tail_stop:n {#2}
+ \quark_if_recursion_tail_stop:n {#4}
+ #1 {#2} {#4}
+ \@@_tl_mapthread_loop:w #1#3 \q_mark
+ }
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\@@_cmd_if_xparse:NTF}
+% \begin{macro}{\@@_cmd_if_xparse_aux:N}
+% To determine whether the command is an \pkg{xparse} command check
+% that its |arg_spec| is empty (this also excludes non-macros) and
+% that its |replacement_spec| starts with either \cs{@@_start:nNNnnn}
+% (non-expandable command) or \cs{@@_start_expandable:nNNNNn}
+% (expandable command) or \cs{@@_start_env:nnnnn} (environment).
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_cmd_if_xparse:NTF #1
+ {
+ \exp_args:Nf \str_case_e:nnTF
+ {
+ \exp_args:Nf \tl_if_empty:nT { \cs_argument_spec:N #1 }
+ {
+ \exp_last_unbraced:Nf \@@_cmd_if_xparse_aux:w
+ { \cs_replacement_spec:N #1 } ~ \q_stop
+ }
+ }
+ {
+ { \token_to_str:N \@@_start:nNNnnn } { }
+ { \token_to_str:N \@@_start_expandable:nNNNNn } { }
+ { \token_to_str:N \@@_start_env:nnnnn } { }
+ }
+ }
+\cs_new:Npn \@@_cmd_if_xparse_aux:w #1 ~ #2 \q_stop {#1}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\@@_peek_nonspace:NTF, \@@_peek_nonspace_remove:NTF, \@@_peek_nonspace_aux:nNNTF}
+% Collect spaces in a loop, and put the collected spaces back in the
+% false branch of a call to \cs{peek_meaning:NTF} or
+% \cs{peek_meaning_remove:NTF}.
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_peek_nonspace:NTF
+ { \@@_peek_nonspace_aux:nNNTF { } \@@_peek_meaning:NTF }
+\cs_new_protected:Npn \@@_peek_nonspace_remove:NTF
+ { \@@_peek_nonspace_aux:nNNTF { } \@@_peek_meaning_remove:NTF }
+\cs_new_protected:Npn \@@_peek_nonspace_aux:nNNTF #1#2#3#4#5
+ {
+ \peek_meaning_remove:NTF \c_space_token
+ { \@@_peek_nonspace_aux:nNNTF { #1 ~ } #2 #3 {#4} {#5} }
+ { #2 #3 { #4 } { #5 #1 } }
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@@_peek_meaning:NTF, \@@_peek_meaning_remove:NTF}
+% \begin{macro}{\@@_peek_cs_check_equal:NNN, \@@_peek_meaning_aux:NNTF, \@@_peek_true_remove:NNw}
+% Peek ahead for a token with a given meaning. In case the search
+% token is a control sequence, also check that the \meta{csname} is
+% the same as the control sequence peeked at. This extra verification
+% is necessary when the command is delimited by control sequence tokens
+% (as opposed to character tokens), and we want the the exact same
+% control sequence to match.
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_peek_meaning:NTF
+ { \@@_peek_meaning_aux:NNTF \c_false_bool }
+\cs_new_protected:Npn \@@_peek_meaning_remove:NTF
+ { \@@_peek_meaning_aux:NNTF \c_true_bool }
+\cs_new_protected:Npn \@@_peek_meaning_aux:NNTF #1#2#3#4
+ {
+ \tl_set:Nn \l_@@_tmpa_tl {#3}
+ \tl_set:Nn \l_@@_tmpb_tl {#4}
+ \peek_meaning:NTF #2
+ {
+ \token_if_eq_meaning:NNTF #2 \c_group_begin_token
+ { \@@_peek_true_remove:Nw #1 }
+ {
+ \@@_token_if_cs:NTF #2
+ { \@@_peek_cs_check_equal:NNN #1 #2 }
+ { \@@_peek_true_remove:Nw #1 }
+ }
+ }
+ { \l_@@_tmpb_tl }
+ }
+\cs_new_protected:Npn \@@_peek_cs_check_equal:NNN #1#2#3
+ {
+ \str_if_eq:nnTF {#2} {#3}
+ { \@@_peek_true_remove:Nw #1 }
+ { \l_@@_tmpb_tl }
+ #3
+ }
+\cs_new_protected:Npn \@@_peek_true_remove:Nw #1
+ {
+ \bool_if:NTF #1
+ {
+ \tex_afterassignment:D \l_@@_tmpa_tl
+ \cs_set_eq:NN \@@_tmp:w
+ }
+ { \l_@@_tmpa_tl }
+ }
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \subsection{Messages}
+%
+% \begin{variable}{\c_@@_ignore_def_tl}
+% \begin{macrocode}
+\tl_const:Nn \c_@@_ignore_def_tl
+ { \\ \\ LaTeX~will~ignore~this~entire~definition. }
+% \end{macrocode}
+% \end{variable}
+%
+% \begin{macro}{\@@_environment_or_command:}
+% Two texts used in several messages.
+% \begin{macrocode}
+\cs_new:Npn \@@_environment_or_command:
+ {
+ \bool_if:NTF \l_@@_environment_bool
+ { environment ~ ' \l_@@_environment_str ' }
+ {
+ command ~ '
+ \exp_args:Nf \tl_trim_spaces:n
+ { \exp_after:wN \token_to_str:N \l_@@_fn_tl }
+ '
+ }
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% Some messages intended as errors when defining commands/environments.
+% \begin{macrocode}
+\__kernel_msg_new:nnnn { ltcmd } { arg-after-body }
+ { In~the~definition~of~#1,~b~(body)~argument~must~be~last. }
+ {
+ The~'body'~argument~type~is~followed~by~'#2'~in~the~argument~
+ specification~of~the~#1.~This~is~not~allowed.
+ \c_@@_ignore_def_tl
+ }
+\__kernel_msg_new:nnnn { ltcmd } { bad-arg-spec }
+ { Bad~argument~specification~'#2'~for~#1. }
+ {
+ The~argument~specification~provided~was~not~valid:~
+ one~or~more~mandatory~pieces~of~information~were~missing.
+ \c_@@_ignore_def_tl
+ }
+\__kernel_msg_new:nnnn { ltcmd } { command-already-defined }
+ { Command~'#1'~already~defined! }
+ {
+ You~have~used~#2~
+ with~a~command~that~already~has~a~definition. \\ \\
+ The~existing~definition~of~'#1'~will~not~be~altered.
+ }
+\__kernel_msg_new:nnnn { ltcmd } { command-not-yet-defined }
+ { Command ~'#1'~not~yet~defined! }
+ {
+ You~have~used~#2~
+ with~a~command~that~was~never~defined.
+ \c_@@_ignore_def_tl
+ }
+\__kernel_msg_new:nnnn { ltcmd } { environment-already-defined }
+ { Environment~'#1'~already~defined! }
+ {
+ You~have~used~\NewDocumentEnvironment
+ with~an~environment~that~already~has~a~definition. \\ \\
+ The~existing~definition~of~'#1'~will~not~be~altered.
+ }
+\__kernel_msg_new:nnnn { ltcmd } { environment-not-yet-defined }
+ { Environment~'#1'~not~yet~defined! }
+ {
+ You~have~used~\RenewDocumentEnvironment
+ with~an~environment~that~was~never~defined.
+ \c_@@_ignore_def_tl
+ }
+\__kernel_msg_new:nnnn { ltcmd } { expandable-ending-optional }
+ {
+ Argument~specification~'#2'~for~expandable~command~'#1'~
+ ends~with~optional~argument.
+ }
+ {
+ Expandable~commands~must~have~a~final~mandatory~argument~
+ (or~no~arguments~at~all).~You~cannot~have~a~terminal~optional~
+ argument~with~expandable~commands.
+ }
+\__kernel_msg_new:nnnn { ltcmd } { inconsistent-long }
+ { Inconsistent~long~arguments~for~expandable~command~'#1'. }
+ {
+ The~arguments~for~an~expandable~command~must~not~involve~short~
+ arguments~after~long~arguments.~You~have~tried~to~mix~the~two~types.
+ }
+\__kernel_msg_new:nnnn { ltcmd } { invalid-command-arg }
+ { Argument~type~'#2'~not~available~for~#1. }
+ {
+ The~letter~'#2'~can~only~be~used~in~environment~argument~
+ specifications,~not~for~commands.
+ \\ \\
+ LaTeX~will~ignore~this~entire~definition.
+ }
+\__kernel_msg_new:nnnn { ltcmd } { invalid-expandable-argument-type }
+ { Argument~type~'#2'~not~available~for~expandable~command~'#1'. }
+ {
+ The~letter~'#2'~specifies~an~argument~type~which~cannot~be~used~
+ in~an~expandable~command.
+ \c_@@_ignore_def_tl
+ }
+\__kernel_msg_new:nnnn { ltcmd } { invalid-after-optional-expandably }
+ {
+ Argument~type~'#2'~not~available~after~optional~argument~
+ for~expandable~command~'#1'.
+ }
+ {
+ The~letter~'#2'~specifies~an~argument~type~which~cannot~be~used~
+ in~an~expandable~command~after~an~optional~argument.
+ \c_@@_ignore_def_tl
+ }
+\__kernel_msg_new:nnnn { ltcmd } { non-trailing-obey-spaces }
+ { Prefix~'!'~used~before~mandatory~argument~'#2'~of~#1. }
+ {
+ The~prefix~'!'~can~only~apply~to~trailing~optional~arguments.
+ \c_@@_ignore_def_tl
+ }
+\__kernel_msg_new:nnnn { ltcmd } { not-definable }
+ { First~argument~of~'#2'~must~be~a~command. }
+ {
+ The~first~argument~of~'#2'~should~be~the~document~command~that~will~
+ be~defined.~The~provided~argument~'#1'~is~a~character.~Perhaps~a~
+ backslash~is~missing?
+ \c_@@_ignore_def_tl
+ }
+\__kernel_msg_new:nnnn { ltcmd } { not-one-token }
+ { First~argument~of~'#2'~must~be~a~command. }
+ {
+ The~first~argument~of~'#2'~should~be~the~document~command~that~will~
+ be~defined.~The~provided~argument~'#1'~contains~more~than~one~
+ token.~Perhaps~a~backslash~is~missing?
+ \c_@@_ignore_def_tl
+ }
+\__kernel_msg_new:nnnn { ltcmd } { not-single-token }
+ {
+ Argument~delimiter~'#2'~for~the~#1~should~be~
+ a~single~non-space~token.
+ }
+ {
+ The~argument~specification~provided~was~not~valid:~in~a~place~
+ where~a~single~token~is~required,~LaTeX~found~'#2'.
+ \c_@@_ignore_def_tl
+ }
+\__kernel_msg_new:nnnn { ltcmd } { forbidden-implicit-group-token }
+ { Argument~delimiter~'#2'~for~the~#1~is~not~allowed. }
+ {
+ The~argument~specification~provided~was~not~valid:~the~implicit~
+ #3-group~token~'#2'~is~not~allowed~as~an~argument~delimiter.
+ \c_@@_ignore_def_tl
+ }
+\__kernel_msg_new:nnnn { ltcmd } { processor-in-expandable }
+ { Argument~processor~'>{#2}'~cannot~be~used~for~the~expandable~command~'#1'. }
+ {
+ The~argument~specification~for~#1~contains~a~processor~function:~
+ this~is~only~supported~for~standard~robust~commands.
+ \c_@@_ignore_def_tl
+ }
+\__kernel_msg_new:nnnn { ltcmd } { too-many-arguments }
+ { Too~many~arguments~in~argument~specification~'#2'~of~#1. }
+ {
+ The~argument~specification~provided~has~more~than~9~arguments.~
+ This~cannot~be~implemented.
+ \c_@@_ignore_def_tl
+ }
+\__kernel_msg_new:nnnn { ltcmd } { two-markers }
+ { Two~'#2'~apply~to~the~same~argument~in~argument~specification~of~#1. }
+ {
+ The~argument~specification~provided~has~two~markers~'#2'~applying~
+ to~the~same~argument;~these~are~redundant.
+ }
+\__kernel_msg_new:nnnn { ltcmd } { unknown-argument-type }
+ { Unknown~argument~type~'#2'~for~the~#1. }
+ {
+ The~letter~'#2'~does~not~specify~a~known~argument~type.
+ \c_@@_ignore_def_tl
+ }
+\__kernel_msg_new:nnnn { ltcmd } { xparse-argument-type }
+ { Deprecated~argument~type~'#2'~for~the~#1~requires~xparse. }
+ {
+ The~letter~'#2'~specifies~a~known~argument~type~that~requires~
+ the~xparse~package.
+ \c_@@_ignore_def_tl
+ }
+% \end{macrocode}
+%
+% Errors when using commands/environments. The \texttt{if-boolean}
+% message is always used in expandable errors. The
+% \texttt{loop-in-defaults} and \texttt{missing-required} messages can
+% be expandable or not expandable.
+% \begin{macrocode}
+\__kernel_msg_new:nnn { ltcmd } { if-boolean }
+ { Invalid~use~\iow_char:N\\IfBooleanTF~{#1} }
+\__kernel_msg_new:nnnn { ltcmd } { loop-in-defaults }
+ { Defaults~of~#1~have~circular~dependency. }
+ {
+ The~default~values~of~two~or~more~arguments~of~the~#1~
+ depend~on~each~other~in~a~way~that~cannot~be~resolved.
+ }
+\__kernel_msg_new:nnnn { ltcmd } { missing-required }
+ { Missing~required~argument~for~#1. }
+ {
+ The~current~#1~expects~an~argument~starting~with~'#2'.~
+ LaTeX~did~not~find~it,~and~will~insert~a~default~value~to~be~processed.
+ }
+\__kernel_msg_new:nnnn { ltcmd } { non-xparse }
+ { \str_uppercase:n #1~not~defined~using~xparse. }
+ {
+ You~have~asked~for~the~argument~specification~for~the~#1,~
+ but~this~was~not~defined~using~xparse.
+ }
+\__kernel_msg_new:nnnn { ltcmd } { split-excess-tokens }
+ { Too~many~'#1'~tokens~when~trying~to~split~argument. }
+ {
+ LaTeX~was~asked~to~split~the~input~'#3'~
+ at~each~occurrence~of~the~token~'#1',~up~to~a~maximum~of~#2~parts.~
+ There~were~too~many~'#1'~tokens.
+ }
+\__kernel_msg_new:nnnn { ltcmd } { unknown }
+ { Unknown~document~#1. }
+ {
+ You~have~asked~for~the~argument~specification~for~the~#1,~
+ but~it~is~not~defined.
+ }
+\__kernel_msg_new:nnnn { ltcmd } { verbatim-newline }
+ { Verbatim~argument~of~#1~ended~by~end~of~line. }
+ {
+ The~verbatim~argument~of~the~#1~cannot~contain~more~than~one~line,~
+ but~the~end~
+ of~the~current~line~has~been~reached.~You~may~have~forgotten~the~
+ closing~delimiter.
+ \\ \\
+ LaTeX~will~ignore~'#2'.
+ }
+\__kernel_msg_new:nnnn { ltcmd } { verbatim-tokenized }
+ { The~verbatim~#1~cannot~be~used~inside~an~argument. }
+ {
+ The~#1~takes~a~verbatim~argument.~
+ It~may~not~appear~within~the~argument~of~another~function.~
+ It~received~an~illegal~token \tl_if_empty:nF {#3} { ~'#3' } .
+ \\ \\
+ LaTeX~will~ignore~'#2'.
+ }
+% \end{macrocode}
+%
+% Intended more for information.
+% \begin{macrocode}
+\__kernel_msg_new:nnn { ltcmd } { define-command }
+ {
+ Defining~command~#1~
+ with~sig.~'#2'~\msg_line_context:.
+ }
+\__kernel_msg_new:nnn { ltcmd } { define-environment }
+ {
+ Defining~environment~'#1'~
+ with~sig.~'#2'~\msg_line_context:.
+ }
+\__kernel_msg_new:nnn { ltcmd } { redefine-command }
+ {
+ Redefining~command~#1~
+ with~sig.~'#2'~\msg_line_context:.
+ }
+\__kernel_msg_new:nnn { ltcmd } { redefine-environment }
+ {
+ Redefining~environment~'#1'~
+ with~sig.~'#2'~\msg_line_context:.
+ }
+\__kernel_msg_new:nnn { ltcmd } { optional-mandatory }
+ {
+ Since~the~mandatory~argument~'#1'~has~the~same~delimiter~'#2'~
+ as~a~previous~optional~argument,~it~will~not~be~possible~to~
+ omit~all~optional~arguments~when~calling~this~command.
+ }
+\__kernel_msg_new:nnn { ltcmd } { unsupported-let }
+ {
+ The~command~'#1'~was~undefined~but~not~the~associated~commands~
+ '#1~code'~and/or~'#1~defaults'.~Maybe~you~tried~using~
+ \iow_char:N\\let.~This~may~lead~to~an~infinite~loop.
+ }
+% \end{macrocode}
+%
+% \subsection{User functions}
+%
+% The user functions are more or less just the internal functions
+% renamed.
+%
+% \begin{macro}{\BooleanFalse}
+% \begin{macro}{\BooleanTrue}
+% Design-space names for the Boolean values.
+% \begin{macrocode}
+\cs_new_eq:NN \BooleanFalse \c_false_bool
+\cs_new_eq:NN \BooleanTrue \c_true_bool
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\NewDocumentCommand}
+% \begin{macro}{\RenewDocumentCommand}
+% \begin{macro}{\ProvideDocumentCommand}
+% \begin{macro}{\DeclareDocumentCommand}
+% The user macros are pretty simple wrappers around the internal ones.
+% There is however a check that the first argument is a single token,
+% possibly surrounded by spaces (hence the strange \cs{use:nnn}), and
+% is definable.
+% \begin{macrocode}
+\cs_new_protected:Npn \NewDocumentCommand #1#2#3
+ {
+ \@@_check_definable:nNT {#1} \NewDocumentCommand
+ {
+ \cs_if_exist:NTF #1
+ {
+ \__kernel_msg_error:nnxx { ltcmd } { command-already-defined }
+ { \use:nnn \token_to_str:N #1 { } }
+ { \token_to_str:N \NewDocumentCommand }
+ }
+ { \@@_declare_cmd:Nnn #1 {#2} {#3} }
+ }
+ }
+\cs_new_protected:Npn \RenewDocumentCommand #1#2#3
+ {
+ \@@_check_definable:nNT {#1} \RenewDocumentCommand
+ {
+ \cs_if_exist:NTF #1
+ { \@@_declare_cmd:Nnn #1 {#2} {#3} }
+ {
+ \__kernel_msg_error:nnxx { ltcmd } { command-not-yet-defined }
+ { \use:nnn \token_to_str:N #1 { } }
+ { \token_to_str:N \RenewDocumentCommand }
+ }
+ }
+ }
+\cs_new_protected:Npn \ProvideDocumentCommand #1#2#3
+ {
+ \@@_check_definable:nNT {#1} \ProvideDocumentCommand
+ { \cs_if_exist:NF #1 { \@@_declare_cmd:Nnn #1 {#2} {#3} } }
+ }
+\cs_new_protected:Npn \DeclareDocumentCommand #1#2#3
+ {
+ \@@_check_definable:nNT {#1} \DeclareDocumentCommand
+ { \@@_declare_cmd:Nnn #1 {#2} {#3} }
+ }
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\NewDocumentEnvironment}
+% \begin{macro}{\RenewDocumentEnvironment}
+% \begin{macro}{\ProvideDocumentEnvironment}
+% \begin{macro}{\DeclareDocumentEnvironment}
+% Very similar for environments.
+% \begin{macrocode}
+\cs_new_protected:Npn \NewDocumentEnvironment #1#2#3#4
+ {
+ \cs_if_exist:cTF {#1}
+ { \__kernel_msg_error:nnx { ltcmd } { environment-already-defined } {#1} }
+ { \@@_declare_env:nnnn {#1} {#2} {#3} {#4} }
+ }
+\cs_new_protected:Npn \RenewDocumentEnvironment #1#2#3#4
+ {
+ \cs_if_exist:cTF {#1}
+ { \@@_declare_env:nnnn {#1} {#2} {#3} {#4} }
+ { \__kernel_msg_error:nnx { ltcmd } { environment-not-yet-defined } {#1} }
+ }
+\cs_new_protected:Npn \ProvideDocumentEnvironment #1#2#3#4
+ { \cs_if_exist:cF {#1} { \@@_declare_env:nnnn {#1} {#2} {#3} {#4} } }
+\cs_new_protected:Npn \DeclareDocumentEnvironment #1#2#3#4
+ { \@@_declare_env:nnnn {#1} {#2} {#3} {#4} }
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\NewExpandableDocumentCommand}
+% \begin{macro}{\RenewExpandableDocumentCommand}
+% \begin{macro}{\ProvideExpandableDocumentCommand}
+% \begin{macro}{\DeclareExpandableDocumentCommand}
+% The expandable versions are essentially the same as the basic
+% functions. The strange \cs{use:nnn} is there in case |#1| is
+% surrounded with spaces, as can happen with usual document catcodes
+% in \cs{RenewExpandableDocumentCommand} |{| |\!| |}| \ldots{}
+% \begin{macrocode}
+\cs_new_protected:Npn \NewExpandableDocumentCommand #1#2#3
+ {
+ \@@_check_definable:nNT {#1} \NewExpandableDocumentCommand
+ {
+ \cs_if_exist:NTF #1
+ {
+ \__kernel_msg_error:nnxx { ltcmd } { command-already-defined }
+ { \use:nnn \token_to_str:N #1 { } }
+ { \token_to_str:N \NewExpandableDocumentCommand }
+ }
+ { \@@_declare_expandable_cmd:Nnn #1 {#2} {#3} }
+ }
+ }
+\cs_new_protected:Npn \RenewExpandableDocumentCommand #1#2#3
+ {
+ \@@_check_definable:nNT {#1} \RenewExpandableDocumentCommand
+ {
+ \cs_if_exist:NTF #1
+ { \@@_declare_expandable_cmd:Nnn #1 {#2} {#3} }
+ {
+ \__kernel_msg_error:nnxx { ltcmd } { command-not-yet-defined }
+ { \use:nnn \token_to_str:N #1 { } }
+ { \token_to_str:N \RenewExpandableDocumentCommand }
+ }
+ }
+ }
+\cs_new_protected:Npn \ProvideExpandableDocumentCommand #1#2#3
+ {
+ \@@_check_definable:nNT {#1} \ProvideExpandableDocumentCommand
+ {
+ \cs_if_exist:NF #1
+ { \@@_declare_expandable_cmd:Nnn #1 {#2} {#3} }
+ }
+ }
+\cs_new_protected:Npn \DeclareExpandableDocumentCommand #1#2#3
+ {
+ \@@_check_definable:nNT {#1} \DeclareExpandableDocumentCommand
+ { \@@_declare_expandable_cmd:Nnn #1 {#2} {#3} }
+ }
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\IfBooleanT, \IfBooleanF, \IfBooleanTF}
+% The logical \meta{true} and \meta{false} statements are just the
+% normal \cs{c_true_bool} and \cs{c_false_bool} so \cs{bool_if:NTF} is
+% almost enough. However, this code-level function blows up badly
+% when passed invalid input. We want \cs{IfBooleanTF} to accept a
+% single (non-space) token equal to \cs{c_true_bool} or
+% \cs{c_false_bool}, possibly surrounded by spaces. If the input is
+% blank or multiple items, jump to the error and pick the false
+% branch. If the input, ignoring spaces (we do this by omitting
+% braces in the \cs{tl_if_single_token:nF} test), is not a single
+% token then jump to the error as well. It is then safe to compare
+% the token to the two booleans, picking the appropriate branch. If
+% neither matches, we jump to the error as well.
+% \begin{macrocode}
+\cs_new:Npn \IfBooleanTF #1
+ {
+ \tl_if_single:nF {#1}
+ { \prg_break:n { \use:n } }
+ \tl_if_single_token:nF #1
+ { \prg_break:n { \use:n } }
+ \token_if_eq_meaning:NNT #1 \c_true_bool
+ { \prg_break:n { \use_ii:nnn } }
+ \token_if_eq_meaning:NNT #1 \c_false_bool
+ { \prg_break:n { \use_iii:nnn } }
+ \prg_break:n { \use:n }
+ \prg_break_point:
+ {
+ \__kernel_msg_expandable_error:nnn { ltcmd } { if-boolean } {#1}
+ \use_ii:nn
+ }
+ }
+\cs_new:Npn \IfBooleanT #1#2 { \IfBooleanTF {#1} {#2} { } }
+\cs_new:Npn \IfBooleanF #1 { \IfBooleanTF {#1} { } }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\IfNoValueT, \IfNoValueF, \IfNoValueTF}
+% Simple re-naming.
+% \begin{macrocode}
+\cs_new_eq:NN \IfNoValueF \tl_if_novalue:nF
+\cs_new_eq:NN \IfNoValueT \tl_if_novalue:nT
+\cs_new_eq:NN \IfNoValueTF \tl_if_novalue:nTF
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\IfValueT, \IfValueF, \IfValueTF}
+% Inverted logic.
+% \begin{macrocode}
+\cs_new:Npn \IfValueF { \tl_if_novalue:nT }
+\cs_new:Npn \IfValueT { \tl_if_novalue:nF }
+\cs_new:Npn \IfValueTF #1#2#3 { \tl_if_novalue:nTF {#1} {#3} {#2} }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ProcessedArgument}
+% Processed arguments are returned using this name, which is reserved
+% here although the definition will change.
+% \begin{macrocode}
+\tl_new:N \ProcessedArgument
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ReverseBoolean, \SplitArgument, \SplitList, \TrimSpaces}
+% Simple copies.
+% \begin{macrocode}
+\cs_new_eq:NN \ReverseBoolean \@@_bool_reverse:N
+\cs_new_eq:NN \SplitArgument \@@_split_argument:nnn
+\cs_new_eq:NN \SplitList \@@_split_list:nn
+\cs_new_eq:NN \TrimSpaces \@@_trim_spaces:n
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ProcessList}
+% To support \cs{SplitList}.
+% \begin{macrocode}
+\cs_new_eq:NN \ProcessList \tl_map_function:nN
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\GetDocumentCommandArgSpec}
+% \begin{macro}{\GetDocumentEnvironmentArgSpec}
+% \begin{macro}{\ShowDocumentCommandArgSpec}
+% \begin{macro}{\ShowDocumentEnvironmentArgSpec}
+% More simple mappings, with a check that the argument is a single
+% control sequence or active character.
+% \begin{macrocode}
+\cs_new_protected:Npn \GetDocumentCommandArgSpec #1
+ {
+ \@@_check_definable:nNT {#1} \GetDocumentCommandArgSpec
+ { \@@_get_arg_spec:N #1 }
+ }
+\cs_new_eq:NN \GetDocumentEnvironmentArgSpec \@@_get_arg_spec:n
+\cs_new_protected:Npn \ShowDocumentCommandArgSpec #1
+ {
+ \@@_check_definable:nNT {#1} \ShowDocumentCommandArgSpec
+ { \@@_show_arg_spec:N #1 }
+ }
+\cs_new_eq:NN \ShowDocumentEnvironmentArgSpec \@@_show_arg_spec:n
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% Finally as promised, restore \cs{__kernel_chk_if_free_cs:N}:
+% \begin{macrocode}
+%<latexrelease>\cs_gset_eq:NN \__kernel_chk_if_free_cs:N \@@_chk_if_free_cs:N
+%<latexrelease>\cs_undefine:N \@@_chk_if_free_cs:N
+% \end{macrocode}
+%
+% \begin{macrocode}
+\ExplSyntaxOff
+% \end{macrocode}
+%
+% \begin{macrocode}
+%</2ekernel|latexrelease>
+%<latexrelease>\EndIncludeInRelease
+%<latexrelease>\catcode`\^^@=\@latexrelease@catcode@null\relax
+%<latexrelease>
+%<latexrelease>\IncludeInRelease{2020/10/01}%
+%<latexrelease> {\NewDocumentCommand}{Document commands}%
+%<latexrelease>\@ifundefined{NewDocumentCommand}
+%<latexrelease> {%
+%<latexrelease> \IfFileExists{xparse.ltx}
+%<latexrelease> {\input xparse.ltx }
+%<latexrelease> {\@latex@error{LaTeX requires xparse}\@ehd}%
+%<latexrelease> }
+%<latexrelease> {}
+%<latexrelease>\EndIncludeInRelease
+%<latexrelease>
+%<latexrelease>\IncludeInRelease{0000/00/00}%
+%<latexrelease> {\NewDocumentCommand}{Document commands}%
+%<latexrelease>
+%<latexrelease>\EndIncludeInRelease
+% \end{macrocode}
+%
+% We need to stop DocStrip treating |@@| in a special way at this point.
+% \begin{macrocode}
+%<@@=>
+% \end{macrocode}
+%
+% \Finale
diff --git a/macros/latex-dev/base/ltcntrl.dtx b/macros/latex-dev/base/ltcntrl.dtx
index a9357a06b8..d65b3aee94 100644
--- a/macros/latex-dev/base/ltcntrl.dtx
+++ b/macros/latex-dev/base/ltcntrl.dtx
@@ -1,7 +1,7 @@
% \iffalse meta-comment
%
% Copyright (C) 1993-2021
-% The LaTeX3 Project and any individual authors listed elsewhere
+% The LaTeX Project and any individual authors listed elsewhere
% in this file.
%
% This file is part of the LaTeX base system.
diff --git a/macros/latex-dev/base/ltcounts.dtx b/macros/latex-dev/base/ltcounts.dtx
index 121979116c..445cac2f2e 100644
--- a/macros/latex-dev/base/ltcounts.dtx
+++ b/macros/latex-dev/base/ltcounts.dtx
@@ -1,7 +1,7 @@
% \iffalse meta-comment
%
% Copyright (C) 1993-2021
-% The LaTeX3 Project and any individual authors listed elsewhere
+% The LaTeX Project and any individual authors listed elsewhere
% in this file.
%
% This file is part of the LaTeX base system.
diff --git a/macros/latex-dev/base/ltdefns.dtx b/macros/latex-dev/base/ltdefns.dtx
index aff93510f9..ab9d4d0da1 100644
--- a/macros/latex-dev/base/ltdefns.dtx
+++ b/macros/latex-dev/base/ltdefns.dtx
@@ -1,7 +1,7 @@
% \iffalse meta-comment
%
% Copyright (C) 1993-2021
-% The LaTeX3 Project and any individual authors listed elsewhere
+% The LaTeX Project and any individual authors listed elsewhere
% in this file.
%
% This file is part of the LaTeX base system.
@@ -32,7 +32,7 @@
%<*driver>
% \fi
\ProvidesFile{ltdefns.dtx}
- [2020/11/25 v1.5o LaTeX Kernel (definition commands)]
+ [2021/01/15 v1.5o LaTeX Kernel (definition commands)]
% \iffalse
\documentclass{ltxdoc}
\GetFileInfo{ltdefns.dtx}
@@ -1471,7 +1471,7 @@
% \ldots
% \end{quote}
% \cs{robust@command@act} will iterate over the \meta{action-list}, evaluating
-% each \meta{if-type-$n$}\meta{robust-cmd}|{|\meta{true}|}{|\meta{false}|}|.
+% each \meta{if-type-$n$} \meta{robust-cmd} |{|\meta{true}|}{|\meta{false}|}|.
% If the \meta{if-type-$n$} conditional returns \meta{true}, then
% \meta{act-type-$n$}\meta{act-arg} is executed, and the loop ends. If the
% conditional returns \meta{false}, then \meta{if-type-$n+1$} is executed in
diff --git a/macros/latex-dev/base/ltdirchk.dtx b/macros/latex-dev/base/ltdirchk.dtx
index 0e85f0a405..36a1ca616c 100644
--- a/macros/latex-dev/base/ltdirchk.dtx
+++ b/macros/latex-dev/base/ltdirchk.dtx
@@ -1,7 +1,7 @@
% \iffalse meta-comment
%
% Copyright (C) 1993-2021
-% The LaTeX3 Project and any individual authors listed elsewhere
+% The LaTeX Project and any individual authors listed elsewhere
% in this file.
%
% This file is part of the LaTeX base system.
@@ -37,7 +37,7 @@
%<*driver>
% \fi
\ProvidesFile{ltdirchk.dtx}
- [2020/12/05 v1.3a LaTeX Kernel (System Dependent Parts)]
+ [2021/01/15 v1.3a LaTeX Kernel (System Dependent Parts)]
% \iffalse
\documentclass{ltxdoc}
\GetFileInfo{ltdirchk.dtx}
@@ -127,14 +127,16 @@
% |\input@path| should expand to a list of such directories, each in a
% |{}| group.
%
+% \begin{sloppypar}
% \DescribeMacro{\filename@parse}
% After a call of the form: |\filename@parse{|\meta{filename}|}|, the
-% three macros |\filename@area|,|\filename@base|,|\filename@ext| should
+% three macros |\filename@area|, |\filename@base| and |\filename@ext| should
% be defined to be the `area' (or directory), basename and
% extension respectively. If there was no extension specified in
% \meta{filename}, |\filename@ext| should be |\let| to |\relax| (so this
% case may be tested with |\@ifundefined{filename@ext}| and, perhaps a
% default extension substituted).
+% \end{sloppypar}
%
% Normally one would not need to define this macro in |texsys.cfg| as
% the automatic tests can supply parsers that work with UNIX and VMS and
@@ -470,14 +472,16 @@
% |{}| group.
%
%
+% \begin{sloppypar}
% \DescribeMacro{\filename@parse}
% After a call of the form: |\filename@parse{|\meta{filename}|}|, the
-% three macros |\filename@area|,|\filename@base|,|\filename@ext| should
+% three macros |\filename@area|, |\filename@base|, |\filename@ext| should
% be defined to be the `area' (or directory), basename and
% extension respectively. If there was no extension specified in
% \meta{filename}, |\filename@ext| should be |\let| to |\relax| (so this
% case may be tested with |\@ifundefined{filename@ext}| and, perhaps a
% default extension substituted).
+% \end{sloppypar}
%
% Normally one would not need to define this macro in |texsys.cfg| as
% the automatic tests can supply parsers that work with UNIX and VMS
diff --git a/macros/latex-dev/base/lterror.dtx b/macros/latex-dev/base/lterror.dtx
index 91d221bced..7f480a0171 100644
--- a/macros/latex-dev/base/lterror.dtx
+++ b/macros/latex-dev/base/lterror.dtx
@@ -1,7 +1,7 @@
% \iffalse meta-comment
%
% Copyright (C) 1993-2021
-% The LaTeX3 Project and any individual authors listed elsewhere
+% The LaTeX Project and any individual authors listed elsewhere
% in this file.
%
% This file is part of the LaTeX base system.
diff --git a/macros/latex-dev/base/ltexpl.dtx b/macros/latex-dev/base/ltexpl.dtx
index b642fd72a3..a9be1b0521 100644
--- a/macros/latex-dev/base/ltexpl.dtx
+++ b/macros/latex-dev/base/ltexpl.dtx
@@ -1,7 +1,7 @@
% \iffalse meta-comment
%
% Copyright (C) 2019-2021
-% The LaTeX3 Project and any individual authors listed elsewhere
+% The LaTeX Project and any individual authors listed elsewhere
% in this file.
%
% This file is part of the LaTeX base system.
@@ -33,7 +33,7 @@
%<*driver>
% \fi
\ProvidesFile{ltexpl.dtx}
- [2020/12/18 v1.2h LaTeX Kernel (expl3-dependent code)]
+ [2021/01/24 v1.3a LaTeX Kernel (expl3-dependent code)]
% \iffalse
\documentclass{ltxdoc}
\GetFileInfo{ltexpl.dtx}
@@ -101,14 +101,16 @@
% First define some blank commands, so that in case something goes wrong while
% loading \textsf{expl3}, we won't get strange \texttt{Undefined control
% sequence} errors.
+% \changes{v1.3a}{2021/01/24}{Define \pkg{expl3} hooks conditionally}
% \begin{macrocode}
%<*2ekernel|latexrelease>
%<latexrelease>\IncludeInRelease{2020/10/01}%
%<latexrelease> {\@expl@sys@load@backend@@}{Roll forward support}%
-\def\@expl@sys@load@backend@@{}
-\def\@expl@push@filename@@{}
-\def\@expl@push@filename@aux@@{}
-\def\@expl@pop@filename@@{}
+\def\reserved@a#1{\ifdefined#1\else\def#1{}\fi}
+\reserved@a\@expl@sys@load@backend@@
+\reserved@a\@expl@push@filename@@
+\reserved@a\@expl@push@filename@aux@@
+\reserved@a\@expl@pop@filename@@
%<latexrelease>\EndIncludeInRelease
%</2ekernel|latexrelease>
% \end{macrocode}
@@ -188,7 +190,9 @@
% In \texttt{2ekernel} mode, an error is fatal and building the format
% is aborted. Use \verb=\batchmode \read -1 to \tokenlist=, which errors
% with
-% \verb=! Emergency stop. (cannot \read from terminal in nonstop modes)=
+%\begin{verbatim}
+% ! Emergency stop. (cannot \read from terminal in nonstop modes)
+%\end{verbatim}
% and aborts the \TeX{} run. In \texttt{latexrelease} mode, raise an
% error and do nothing. Both ways, the error message shows the minimum
% \textsf{expl3} engine requirements.
@@ -214,7 +218,7 @@
%</2ekernel>
% \end{macrocode}
% We do not support a roll forward across 2019. You need to start
-% with 2019 if you want to get to 2020 or beyond.
+% with 2019 if you want to get to 2020 or beyond.
% \changes{v1.2g}{2020/11/24}{Support for roll forward (gh/434)}
% \begin{macrocode}
%<*latexrelease>
@@ -225,21 +229,18 @@
--- I'm giving up!\MessageBreak\MessageBreak
Note that manually loading the expl3 package\MessageBreak
from your distribution is not enough}%
- \@@end % die
+ \batchmode \read -1 to \reserved@a
%</latexrelease>
}%
- {%
- \input expl3.ltx
- \ifdefined\NewDocumentCommand
- \else
- \IfFileExists{xparse.ltx}
- {\input xparse.ltx }
- {}%
- \fi
- }%
+ {\input expl3.ltx }%
}
%<latexrelease>\EndIncludeInRelease
%<latexrelease>
+% \end{macrocode}
+% To support roll-forward for the case where \textsf{xparse} is fully
+% integrated into the kernel, we do not need to repeat the complex test
+% above as we can simply look for the marker command.
+% \begin{macrocode}
%<latexrelease>\IncludeInRelease{2020/02/02}%
%<latexrelease> {expl3}{Pre-load expl3}%
%<latexrelease>\IfFileExists{expl3.ltx}
@@ -262,35 +263,8 @@
%<latexrelease>\EndIncludeInRelease
% \end{macrocode}
%
-%
-% Starting with 2020-10 the kernel contains most of the
-% \texttt{xparse} interfaces loaded above. These interfaces are
-% later used to define various user command. However, if somebody
-% with an earlier installation tries to roll forward (using a
-% \texttt{latexrelease} package from a newer release) this will not
-% work as the earlier kernel doesn't contain commands such as
-% \cs{NewDocumentCommand}.
-%
-% We therefore add code into \texttt{latexrelease.sty} to load the
-% \texttt{xparse} package of the current installation instead. this
-% may not work if the installation is really old, but roll forward
-% can't do miracles.
-%
-% If the kernel is 2020-10 or later \cs{NewDocumentCommand} is
-% already known (whether or not you roll forward or back) so
-% nothing happens, but if you start from am earlier kernel the
-% \texttt{xparse} package gets loaded by \texttt{latexrelease}.
-% \changes{v1.2g}{2020/11/24}{Load xparse in latexrelease if needed (gh/434)}
-% \begin{macrocode}
-%<latexrelease>\IncludeInRelease{2020/10/01}%
-%<latexrelease> {\NewDocumentCommand}{Emergency loading xparse}%
-%<latexrelease>
-%<latexrelease>\ifdefined\NewDocumentCommand \else
-%<latexrelease> \RequirePackage{xparse}
-%<latexrelease>\fi
-%<latexrelease>
-%<latexrelease>\EndIncludeInRelease
-% \end{macrocode}
+% \changes{v1.3a}{2021/01/21}
+% {Move \pkg{xparse} rollback code to \texttt{ltcmd.dtx}}
%
% \subsection{Using expl3 code}
%
diff --git a/macros/latex-dev/base/ltfilehook-code.pdf b/macros/latex-dev/base/ltfilehook-code.pdf
index 54158158e3..27c4d70486 100644
--- a/macros/latex-dev/base/ltfilehook-code.pdf
+++ b/macros/latex-dev/base/ltfilehook-code.pdf
Binary files differ
diff --git a/macros/latex-dev/base/ltfilehook-doc.pdf b/macros/latex-dev/base/ltfilehook-doc.pdf
index 00ccfdaba9..2ee786f0c9 100644
--- a/macros/latex-dev/base/ltfilehook-doc.pdf
+++ b/macros/latex-dev/base/ltfilehook-doc.pdf
Binary files differ
diff --git a/macros/latex-dev/base/ltfilehook.dtx b/macros/latex-dev/base/ltfilehook.dtx
index b5b5de629a..85c758ae60 100644
--- a/macros/latex-dev/base/ltfilehook.dtx
+++ b/macros/latex-dev/base/ltfilehook.dtx
@@ -1,7 +1,7 @@
% \iffalse meta-comment
-%%
-%% File: ltfilehook.dtx (C) Copyright 2020,2021 Frank Mittelbach,
-%% Phelype Oleinik & LaTeX Team
+%
+% Copyright (C) 2020-2021
+% Frank Mittelbach, Phelype Oleinik & LaTeX Team
%
% This file is part of the LaTeX base system.
% -------------------------------------------
@@ -31,8 +31,8 @@
%%% From File: ltfilehook.dtx
%
% \begin{macrocode}
-\providecommand\ltfilehookversion{v1.0e}
-\providecommand\ltfilehookdate{2021/01/07}
+\providecommand\ltfilehookversion{v1.0g}
+\providecommand\ltfilehookdate{2021/02/08}
% \end{macrocode}
%
%<*driver>
@@ -55,6 +55,10 @@
}
\ExplSyntaxOff
+\providecommand\InternalDetectionOff{}
+\providecommand\InternalDetectionOn{}
+
+
\usepackage{structuredlog} % for demonstration
\EnableCrossrefs
@@ -622,6 +626,7 @@
% When rolling forward the following expl3 functions may not be defined.
% If we roll back the code does nothing.
% \changes{v1.0d}{2020/11/24}{Support for roll forward (gh/434)}
+% \InternalDetectionOff
% \begin{macrocode}
%<latexrelease>\IncludeInRelease{2020/10/01}%
%<latexrelease> {\file_parse_full_name_apply:nN}{Roll forward help}%
@@ -643,7 +648,8 @@
%<latexrelease> {
%<latexrelease> \tl_if_empty:nTF {#3}
%<latexrelease> { \__file_parse_full_name_base:nw { } #2 . \s__file_stop {#1} }
-%<latexrelease> { \__file_parse_full_name_area:nw { #1 / #2 } #3 \s__file_stop }
+%<latexrelease> { \__file_parse_full_name_area:nw { #1 / #2 }
+%<latexrelease> #3 \s__file_stop }
%<latexrelease> }
%<latexrelease>\cs_new:Npn \__file_parse_full_name_base:nw #1 #2 . #3 \s__file_stop
%<latexrelease> {
@@ -657,7 +663,8 @@
%<latexrelease> }
%<latexrelease> { \__file_parse_full_name_tidy:nnnN {#1} { .#2 } }
%<latexrelease> }
-%<latexrelease> { \__file_parse_full_name_base:nw { #1 . #2 } #3 \s__file_stop }
+%<latexrelease> { \__file_parse_full_name_base:nw { #1 . #2 }
+%<latexrelease> #3 \s__file_stop }
%<latexrelease> }
%<latexrelease>\cs_new:Npn \__file_parse_full_name_tidy:nnnN #1 #2 #3 #4
%<latexrelease> {
@@ -675,6 +682,7 @@
%<latexrelease>\EndIncludeInRelease
%<*2ekernel>
% \end{macrocode}
+% \InternalDetectionOn
%
% \begin{macrocode}
%<@@=>
@@ -847,6 +855,17 @@
%<latexrelease>\long\def \InputIfFileExists#1#2{%
%<latexrelease> \IfFileExists{#1}%
%<latexrelease> {#2\@addtofilelist{#1}\@@input \@filef@und}}
+% \end{macrocode}
+%
+% Also undo the internal command as some packages unfortunately test
+% for their existence instead of using \cs{IfFormatAtLeastTF}.
+% \changes{v1.0g}{2021/02/08}{Undo the internal for robust
+% \cs{InputIfFileExists} in rollback (gh/494)}
+% \begin{macrocode}
+%<latexrelease>\expandafter\let\csname InputIfFileExists \endcsname\@undefined
+% \end{macrocode}
+%
+% \begin{macrocode}
%<latexrelease>\let\@input@file@exists@with@hooks\@undefined
%<latexrelease>\let\unqu@tefilef@und\@undefined
%<latexrelease>\EndIncludeInRelease
@@ -897,7 +916,8 @@
@file-subst@
\@@_subst_file_normalize:Nn \use_ii_iii:nnn {#1}
}
- { \@@_subst_file_normalize:Nn \@@_file_name_compose:nnn {#2} }
+ { \@@_subst_file_normalize:Nn \@@_file_name_compose:nnn
+ {#2} }
\group_end:
}
\cs_new_protected:Npn \@@_subst_remove:n #1
@@ -990,6 +1010,7 @@
% \subsection{Selecting a file (\cs{set@curr@file})}
%
% \begin{macro}{\set@curr@file,\@curr@file,\@curr@file@reqd}
+% \changes{v1.0f}{2021/01/31}{set \cs{protect} to \cs{string} gh/481}
% Now we hook into \cs{set@curr@file} to resolve a possible file
% substitution, and add \cs{@expl@@@filehook@set@curr@file@@nNN}
% at the end, after \cs{@curr@file} is set.
@@ -1013,11 +1034,12 @@
% \begin{macrocode}
%</2ekernel>
%<*2ekernel|latexrelease>
-%<latexrelease>\IncludeInRelease{2020/10/01}%
+%<latexrelease>\IncludeInRelease{2021/05/01}%
%<latexrelease> {\set@curr@file}{Setting current file name}%
\def\set@curr@file#1{%
\begingroup
\escapechar\m@ne
+ \let\protect\string
\expandafter\def\csname\expandafter\endcsname
\expandafter{\csname\endcsname}%
% \end{macrocode}
@@ -1055,6 +1077,28 @@
% \end{macrocode}
%
% \begin{macrocode}
+%<latexrelease>\IncludeInRelease{2020/10/01}%
+%<latexrelease>\def\set@curr@file#1{%
+%<latexrelease> \begingroup
+%<latexrelease> \escapechar\m@ne
+%<latexrelease> \expandafter\def\csname\expandafter\endcsname
+%<latexrelease> \expandafter{\csname\endcsname}%
+%<latexrelease> \@expl@@@filehook@if@no@extension@@nTF{#1}%
+%<latexrelease> {\@tempswatrue}{\@tempswafalse}%
+%<latexrelease> \@kernel@make@file@csname\@curr@file
+%<latexrelease> \@expl@@@filehook@resolve@file@subst@@w {#1}%
+%<latexrelease> \@expl@@@filehook@if@file@replaced@@TF
+%<latexrelease> {\@kernel@make@file@csname\@curr@file@reqd
+%<latexrelease> \@expl@@@filehook@normalize@file@name@@w{#1}%
+%<latexrelease> \if@tempswa \@expl@@@filehook@drop@extension@@N\@curr@file@reqd \fi}%
+%<latexrelease> {\if@tempswa \@expl@@@filehook@drop@extension@@N\@curr@file \fi
+%<latexrelease> \global\let\@curr@file@reqd\@curr@file}%
+%<latexrelease> \@expl@@@filehook@clear@replacement@flag@@
+%<latexrelease> \endgroup}
+%<latexrelease>\EndIncludeInRelease
+% \end{macrocode}
+%
+% \begin{macrocode}
%<latexrelease>\IncludeInRelease{2019/10/01}%
%<latexrelease> {\set@curr@file}{Setting current file name}%
%<latexrelease>\def\set@curr@file#1{%
@@ -1106,7 +1150,8 @@
\expandafter\ifx\csname\endcsname#1%
.tex\else\string#1\fi}
% \end{macrocode}
-%
+%
+% \begin{sloppypar}
% Then we call \cs{@expl@@@filehook@set@curr@file@@nNN} once for
% \cs{@curr@file} to set \cs[no-index]{CurrentFile(Path)Used} and once for
% \cs{@curr@file@reqd} to set \cs[no-index]{CurrentFile(Path)}.
@@ -1116,6 +1161,7 @@
% \cs{@curr@file} and \cs{@curr@file@reqd} differ. This macro is
% issued separate from \cs{set@curr@file} because it changes
% \cs{CurrentFile}, and side-effects would quickly get out of control.
+% \end{sloppypar}
% \begin{macrocode}
\def\@filehook@set@CurrentFile{%
\@expl@@@filehook@set@curr@file@@nNN{\@curr@file}%
@@ -1185,7 +1231,7 @@
%</2ekernel>
%<*2ekernel|latexrelease>
%<latexrelease>\IncludeInRelease{2020/10/01}%
-%<latexrelease> {\@@_resolve_file_subst:w}{Replace files detect loops}%
+%<latexrelease> {\@@_resolve_file_subst:w}{Replace files detect loops}%
\ExplSyntaxOn
\cs_new:Npn \@@_resolve_file_subst:w #1 \@nil
{ \@@_file_parse_full_name:nN {#1} \@@_file_subst_begin:nnn }
@@ -1284,7 +1330,7 @@
%</2ekernel>
%<*2ekernel|latexrelease>
%<latexrelease>\IncludeInRelease{2020/10/01}%
-%<latexrelease> {\@@_file_subst_tortoise_hare:nn}{Tortoise and Hare}%
+%<latexrelease> {\@@_file_subst_tortoise_hare:nn}{Tortoise and Hare}%
\ExplSyntaxOn
\cs_new:Npn \@@_file_subst_tortoise_hare:nn #1 #2 #3
{
@@ -1437,7 +1483,7 @@
% \begin{macrocode}
%<@@=>
% \end{macrocode}
-%
+% \InternalDetectionOff
% \begin{macrocode}
%</2ekernel>
%<*2ekernel|latexrelease>
@@ -1495,6 +1541,7 @@
\cs_new_eq:NN \@expl@@@filehook@file@pop@assign@@nnnn
\__filehook_file_pop_assign:nnnn
% \end{macrocode}
+% \InternalDetectionOn
%
%
% \begin{macrocode}
diff --git a/macros/latex-dev/base/ltfiles.dtx b/macros/latex-dev/base/ltfiles.dtx
index f91dfe32aa..b27f910587 100644
--- a/macros/latex-dev/base/ltfiles.dtx
+++ b/macros/latex-dev/base/ltfiles.dtx
@@ -1,7 +1,7 @@
% \iffalse meta-comment
%
% Copyright (C) 1993-2021
-% The LaTeX3 Project and any individual authors listed elsewhere
+% The LaTeX Project and any individual authors listed elsewhere
% in this file.
%
% This file is part of the LaTeX base system.
@@ -32,7 +32,7 @@
%<*driver>
% \fi
\ProvidesFile{ltfiles.dtx}
- [2020/12/04 v1.2j LaTeX Kernel (File Handling)]
+ [2021/01/15 v1.2j LaTeX Kernel (File Handling)]
% \iffalse
\documentclass{ltxdoc}
\GetFileInfo{ltfiles.dtx}
@@ -49,6 +49,9 @@
\providecommand\pkg[1]{\texttt{#1}}
+\providecommand\InternalDetectionOff{}
+\providecommand\InternalDetectionOn{}
+
\begin{document}
\MaintainedByLaTeXTeam{latex}
\maketitle
@@ -458,12 +461,14 @@
% applied several times with harmful effects. We therefore
% explicitly drop it at this point. the coding is somewhat obscure
% due to the name of the macro which requires constructing.
+% \InternalDetectionOff
% \begin{macrocode}
\edef \@kernel@after@begindocument@before {%
\let\expandafter\noexpand\csname
__hook env/document/begin\endcsname
\noexpand\@empty}
% \end{macrocode}
+% \InternalDetectionOn
%
% \begin{macrocode}
\let \@kernel@before@begindocument \@empty
@@ -996,10 +1001,11 @@
% A side effect of the new code is that we will see quotes around
% file name displays where there haven't been any before.
%
-% For compatibility with existing code using |{abc}.tex| or |{one.two}.png|
-% an initial brace group is discarded before expansion and |\string| is applied
-% The content of the brace group is discarded. This means that a leading space
-% will be lost unless protected (by |{ }| or |" "| or |\space|) but filenames
+% For compatibility with existing code using |{abc}.tex| or
+% |{one.two}.png|, an initial brace group is discarded before
+% expansion and |\string| is applied. The content of the brace
+% group is discarded. This means that a leading space will be lost
+% unless protected (by |{ }| or |" "| or |\space|) but filenames
% with a space are hopefully rare.
%
% \changes{v1.2a}{2019/07/01}{Support UTF-8}
diff --git a/macros/latex-dev/base/ltfinal.dtx b/macros/latex-dev/base/ltfinal.dtx
index ee45ea5588..d6fa6e8a7b 100644
--- a/macros/latex-dev/base/ltfinal.dtx
+++ b/macros/latex-dev/base/ltfinal.dtx
@@ -1,7 +1,7 @@
% \iffalse meta-comment
%
% Copyright (C) 1993-2021
-% The LaTeX3 Project and any individual authors listed elsewhere
+% The LaTeX Project and any individual authors listed elsewhere
% in this file.
%
% This file is part of the LaTeX base system.
@@ -33,7 +33,7 @@
%<*driver>
% \fi
\ProvidesFile{ltfinal.dtx}
- [2021/01/06 v2.2l LaTeX Kernel (Final Settings)]
+ [2021/02/25 v2.2m LaTeX Kernel (Final Settings)]
% \iffalse
\documentclass{ltxdoc}
\GetFileInfo{ltfinal.dtx}
@@ -525,12 +525,13 @@
%</2ekernel>
%<*2ekernel|latexrelease>
%<latexrelease>\IncludeInRelease{2017/04/15}%
-%<latexrelease> {\document@default@language}{Save language for hyphenation}%
+%<latexrelease> {\document@default@language}{Save language for hyphenation}%
\let\document@default@language\m@ne
%</2ekernel|latexrelease>
%<latexrelease>\EndIncludeInRelease
%<latexrelease>\IncludeInRelease{0000/00/00}%
-%<latexrelease> {\document@default@language}{Save language for hyphenation}%
+%<latexrelease> {\document@default@language}{Save language for hyphenation}%
+%
%<latexrelease>\let\document@default@language\@undefined
%<latexrelease>\EndIncludeInRelease
%<*2ekernel>
@@ -565,6 +566,52 @@
\fi
% \end{macrocode}
%
+% For pdf\TeX\ preload and enable automatic glyph to Unicode mapping
+% for more reliable copy and paste support.
+% \changes{v2.2l}{2021/01/21}{Load glyphtounicode.tex for pdf\TeX}
+% \changes{v2.2m}{2021/02/25}{Improve speed of ToUnicode everyjob loading code}
+%
+% \begin{macrocode}
+%</2ekernel>
+%<*2ekernel|latexrelease>
+%<latexrelease>\IncludeInRelease{2021/05/01}%
+%<latexrelease> {\pdfgentounicode}{Preload glyphtounicode}%
+\ifx \pdfgentounicode \@undefined \else
+%<*2ekernel>
+ \ifnum 0=0%
+ \ifdefined\pdftexversion
+% \pdftexversion<140 does not have \pdfgentounicode, so we only check higher values
+ \ifnum \pdftexversion=140 \ifnum\pdftexrevision<22 1\fi\fi
+ \fi
+ \relax
+%</2ekernel>
+ \input glyphtounicode
+%<*2ekernel>
+ \else
+ \begingroup
+ \everyeof{\noexpand}\endlinechar-1
+ \edef\x{\endgroup
+ \everyjob{\the\everyjob\@@input glyphtounicode }%
+ }\x
+ \fi
+%</2ekernel>
+ \pdfgentounicode=1
+\fi
+%</2ekernel|latexrelease>
+%<latexrelease>\EndIncludeInRelease
+% \end{macrocode}
+% When rolling back we can't unload the glyphtounicode mappings, but we
+% can reset |\pdfgentounicode| to ensure that they aren't used.
+% \begin{macrocode}
+%<latexrelease>\IncludeInRelease{0000/00/00}%
+%<latexrelease> {\pdfgentounicode}{Preload glyphtounicode}%
+%<latexrelease>\ifx \pdfgentounicode \@undefined \else
+%<latexrelease> \pdfgentounicode=0
+%<latexrelease>\fi
+%<latexrelease>\EndIncludeInRelease
+%<*2ekernel>
+% \end{macrocode}
+%
% \subsection{Input encoding}
%
% \changes{v2.1a}{2018/03/25}{default to UTF-8}
@@ -1147,6 +1194,7 @@
% {Load first aid file if existing}
% \begin{macrocode}
\@input{latex2e-first-aid-for-external-files.ltx}
+\@input{ltpara.ltx}
% \end{macrocode}
%
%
diff --git a/macros/latex-dev/base/ltfloat.dtx b/macros/latex-dev/base/ltfloat.dtx
index 1c8f844bc3..f2324118a0 100644
--- a/macros/latex-dev/base/ltfloat.dtx
+++ b/macros/latex-dev/base/ltfloat.dtx
@@ -1,7 +1,7 @@
% \iffalse meta-comment
%
% Copyright (C) 1993-2021
-% The LaTeX3 Project and any individual authors listed elsewhere
+% The LaTeX Project and any individual authors listed elsewhere
% in this file.
%
% This file is part of the LaTeX base system.
@@ -31,7 +31,7 @@
%
%<*driver>
% \fi
-\ProvidesFile{ltfloat.dtx}[2020/12/05 v1.2d LaTeX Kernel (Floats)]
+\ProvidesFile{ltfloat.dtx}[2021/02/10 v1.2f LaTeX Kernel (Floats)]
% \iffalse
\documentclass{ltxdoc}
\GetFileInfo{ltfloat.dtx}
@@ -1004,7 +1004,12 @@
% \changes{v1.1m}{1995/05/25}{(CAR) Resettings moved to hook}
% \changes{v1.1n}{1996/07/26}{remove unnecessary \cs{global} before
% \cs{@minipage...}}
+% \changes{v1.2e}{2021/02/03}{Explicitly end with \cs{par} (gh/489)}
% \begin{macrocode}
+%</2ekernel>
+%<*2ekernel|latexrelease>
+%<latexrelease>\IncludeInRelease{2021/05/01}%
+%<latexrelease> {\@savemarbox}{Explicit par for marginpar}%
\long\def \@savemarbox #1#2{%
\global\setbox #1%
\color@vbox
@@ -1012,12 +1017,35 @@
\hsize\marginparwidth
\@parboxrestore
\@marginparreset
- #2%
+ #2\par
\@minipagefalse
\outer@nobreak
}%
\color@endbox
}
+%</2ekernel|latexrelease>
+%<latexrelease>\EndIncludeInRelease
+% \end{macrocode}
+%
+% \begin{macrocode}
+%<latexrelease>\IncludeInRelease{0000/00/00}%
+%<latexrelease> {\@savemarbox}{Explicit par for marginpar}%
+%<latexrelease>
+%<latexrelease>\long\def \@savemarbox #1#2{%
+%<latexrelease> \global\setbox #1%
+%<latexrelease> \color@vbox
+%<latexrelease> \vtop{%
+%<latexrelease> \hsize\marginparwidth
+%<latexrelease> \@parboxrestore
+%<latexrelease> \@marginparreset
+%<latexrelease> #2%
+%<latexrelease> \@minipagefalse
+%<latexrelease> \outer@nobreak
+%<latexrelease> }%
+%<latexrelease> \color@endbox
+%<latexrelease>}
+%<latexrelease>\EndIncludeInRelease
+%<*2ekernel>
% \end{macrocode}
% \end{macro}
%
@@ -1480,7 +1508,13 @@
% {Removed \cs{normalcolor} (again)}
% \changes{v1.1t}{1997/11/19}
% {Missing percent, again}
+% \changes{v1.2e}{2021/02/10}{Explicitly run \cs{par} at the end of footnote text
+% in preparation for paragraph hooks}
% \begin{macrocode}
+%</2ekernel>
+%<*2ekernel|latexrelease>
+%<latexrelease>\IncludeInRelease{2021/05/01}%
+%<latexrelease> {\@footnotetext}{footnotetext tagging}%
\long\def\@footnotetext#1{\insert\footins{%
\reset@font\footnotesize
\interlinepenalty\interfootnotelinepenalty
@@ -1493,7 +1527,32 @@
\color@begingroup
\@makefntext{%
\rule\z@\footnotesep\ignorespaces#1\@finalstrut\strutbox}%
+ \par
\color@endgroup}}%
+%</2ekernel|latexrelease>
+%<latexrelease>\EndIncludeInRelease
+% \end{macrocode}
+%
+% \begin{macrocode}
+%<latexrelease>\IncludeInRelease{0000/00/00}%
+%<latexrelease> {\@footnotetext}{footnotetext tagging}%
+%<latexrelease>
+%<latexrelease>\long\def\@footnotetext#1{\insert\footins{%
+%<latexrelease> \reset@font\footnotesize
+%<latexrelease> \interlinepenalty\interfootnotelinepenalty
+%<latexrelease> \splittopskip\footnotesep
+%<latexrelease> \splitmaxdepth \dp\strutbox \floatingpenalty \@MM
+%<latexrelease> \hsize\columnwidth \@parboxrestore
+%<latexrelease> \protected@edef\@currentlabel{%
+%<latexrelease> \csname p@footnote\endcsname\@thefnmark
+%<latexrelease> }%
+%<latexrelease> \color@begingroup
+%<latexrelease> \@makefntext{%
+%<latexrelease> \rule\z@\footnotesep\ignorespaces#1\@finalstrut\strutbox}%
+%<latexrelease> \color@endgroup}}%
+%<latexrelease>
+%<latexrelease>\EndIncludeInRelease
+%<*2ekernel>
% \end{macrocode}
% \end{macro}
%
@@ -1558,10 +1617,49 @@
% \begin{macrocode}
\def\@mpfn{footnote}
\def\thempfn{\thefootnote}
-%</2ekernel>
% \end{macrocode}
+%
% \end{macro}
% \end{macro}
%
+%
+%
+%
+% \begin{macro}{\footref}
+% This command generates a footnote mark. The value is produced by
+% referencing a \cs{label} placed into a \cs{footnote} elsewhere
+% (can be one in the main galley or in a minipage).
+% \changes{v1.2f}{2021/02/16}{\cs{footref} added}
+% \begin{macrocode}
+%</2ekernel>
+%<*2ekernel|latexrelease>
+%<latexrelease>\IncludeInRelease{2021/05/01}%
+%<latexrelease> {\footref}{Add footref}%
+\def\footref#1{%
+ \begingroup
+ \unrestored@protected@xdef\@thefnmark{\ref{#1}}%
+ \endgroup
+ \@footnotemark
+}
+%</2ekernel|latexrelease>
+%<latexrelease>\EndIncludeInRelease
+% \end{macrocode}
+% We don't remove it when rolling back.
+% \begin{macrocode}
+%%<latexrelease>\IncludeInRelease{0000/00/00}%
+%%<latexrelease> {\footref}{Add footref}%
+%%<latexrelease>
+%%<latexrelease>\let\footref\@undefined
+%%<latexrelease>
+%%<latexrelease>\EndIncludeInRelease
+%<*2ekernel>
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \begin{macrocode}
+%</2ekernel>
+% \end{macrocode}
+%
% \Finale
%
diff --git a/macros/latex-dev/base/ltfntcmd.dtx b/macros/latex-dev/base/ltfntcmd.dtx
index 8d587a848a..5f70053a68 100644
--- a/macros/latex-dev/base/ltfntcmd.dtx
+++ b/macros/latex-dev/base/ltfntcmd.dtx
@@ -1,7 +1,7 @@
% \iffalse meta-comment
%
% Copyright (C) 1993-2021
-% The LaTeX3 Project and any individual authors listed elsewhere
+% The LaTeX Project and any individual authors listed elsewhere
% in this file.
%
% This file is part of the LaTeX base system.
diff --git a/macros/latex-dev/base/ltfssaxes.dtx b/macros/latex-dev/base/ltfssaxes.dtx
index 4e3b4d983c..e0c0787455 100644
--- a/macros/latex-dev/base/ltfssaxes.dtx
+++ b/macros/latex-dev/base/ltfssaxes.dtx
@@ -1,7 +1,7 @@
% \iffalse meta-comment
%
% Copyright (C) 2019-2021
-% The LaTeX3 Project and any individual authors listed elsewhere
+% The LaTeX Project and any individual authors listed elsewhere
% in this file.
%
% This file is part of the LaTeX base system.
@@ -35,7 +35,7 @@
%
%
\ProvidesFile{ltfssaxes.dtx}
- [2020/12/22 v1.0h LaTeX Kernel (NFSS Axes handing)]
+ [2021/01/15 v1.0h LaTeX Kernel (NFSS Axes handing)]
% \iffalse
\documentclass{ltxdoc}
\begin{document}
@@ -764,8 +764,10 @@
%<latexrelease>\IncludeInRelease{2020/02/02}%
%<latexrelease> {\fontseries}{delay fontseries update}%
%<latexrelease>
-%<latexrelease>\DeclareRobustCommand\fontseries[1]{\@forced@seriesfalse\merge@font@series{#1}}
-%<latexrelease>\DeclareRobustCommand\fontseriesforce[1]{\@forced@seriestrue\edef\f@series{#1}}
+%<latexrelease>\DeclareRobustCommand\fontseries[1]{\@forced@seriesfalse
+%<latexrelease> \merge@font@series{#1}}
+%<latexrelease>\DeclareRobustCommand\fontseriesforce[1]{\@forced@seriestrue
+%<latexrelease> \edef\f@series{#1}}
%<latexrelease>\let\delayed@f@adjustment\@undefined
%<latexrelease>
% \end{macrocode}
diff --git a/macros/latex-dev/base/ltfssbas.dtx b/macros/latex-dev/base/ltfssbas.dtx
index d2dde745d4..6d575fc9d0 100644
--- a/macros/latex-dev/base/ltfssbas.dtx
+++ b/macros/latex-dev/base/ltfssbas.dtx
@@ -1,7 +1,7 @@
% \iffalse meta-comment
%
% Copyright (C) 1993-2021
-% The LaTeX3 Project and any individual authors listed elsewhere
+% The LaTeX Project and any individual authors listed elsewhere
% in this file.
%
% This file is part of the LaTeX base system.
diff --git a/macros/latex-dev/base/ltfsscmp.dtx b/macros/latex-dev/base/ltfsscmp.dtx
index 29580b8d5e..03be855127 100644
--- a/macros/latex-dev/base/ltfsscmp.dtx
+++ b/macros/latex-dev/base/ltfsscmp.dtx
@@ -1,7 +1,7 @@
% \iffalse meta-comment
%
% Copyright (C) 1993-2021
-% The LaTeX3 Project and any individual authors listed elsewhere
+% The LaTeX Project and any individual authors listed elsewhere
% in this file.
%
% This file is part of the LaTeX base system.
diff --git a/macros/latex-dev/base/ltfssdcl.dtx b/macros/latex-dev/base/ltfssdcl.dtx
index 725d0e39fc..9710d54382 100644
--- a/macros/latex-dev/base/ltfssdcl.dtx
+++ b/macros/latex-dev/base/ltfssdcl.dtx
@@ -1,7 +1,7 @@
% \iffalse meta-comment
%
% Copyright (C) 1993-2021
-% The LaTeX3 Project and any individual authors listed elsewhere
+% The LaTeX Project and any individual authors listed elsewhere
% in this file.
%
% This file is part of the LaTeX base system.
@@ -36,7 +36,7 @@
%
%
\ProvidesFile{ltfssdcl.dtx}
- [2020/12/05 v3.0v LaTeX Kernel (NFSS Declarative Interface)]
+ [2021/02/15 v3.0w LaTeX Kernel (NFSS Declarative Interface)]
% \iffalse
\documentclass{ltxdoc}
\begin{document}
@@ -490,7 +490,11 @@
in version \math@version}%
\@eha
\fi
- \else \expandafter\non@alpherr\fi
+% \end{macrocode}
+% extra \cs{expandafter} to remove the \cs{expandafter} added below
+% \changes{v3.0w}{2021/02/115}{fix for (gh/501)}
+% \begin{macrocode}
+ \else \expandafter\expandafter\expandafter\non@alpherr\fi
% \end{macrocode}
% If the legacy interface is used, e.g., \verb=$\sf -1$= the math
% alphabet \verb=#1= does not take an argument so we better do not
@@ -1526,7 +1530,7 @@
\def\set@mathdelimiter#1#2#3#4#5#6{%
% \end{macrocode}
% We use \cs{protected} not \cs{MakeRobust} so that
-% \verb=\bigl\lfoor= etc.\ works inside \cs{protected@edef}.
+% \verb=\bigl\lfoor= etc.\ works inside the argument of \cs{protected@edef}.
% \changes{v3.0s}{2019/08/27}{Make math delimiters robust}
% \changes{v3.0t}{2020/01/20}{fix for gh/251}
% \begin{macrocode}
@@ -1733,7 +1737,7 @@
\relax
% \end{macrocode}
% If it is undefined, fine otherwise check if it is a math alphabet
-% defined via |\DeclareSymbolFontAlphabet|:
+% defined via \\ |\DeclareSymbolFontAlphabet|:
% \begin{macrocode}
\else
\edef\reserved@a{%
diff --git a/macros/latex-dev/base/ltfssini.dtx b/macros/latex-dev/base/ltfssini.dtx
index a92321bf5d..361adac9c3 100644
--- a/macros/latex-dev/base/ltfssini.dtx
+++ b/macros/latex-dev/base/ltfssini.dtx
@@ -1,7 +1,7 @@
% \iffalse meta-comment
%
% Copyright (C) 1993-2021
-% The LaTeX3 Project and any individual authors listed elsewhere
+% The LaTeX Project and any individual authors listed elsewhere
% in this file.
%
% This file is part of the LaTeX base system.
@@ -36,7 +36,7 @@
%
%
\ProvidesFile{ltfssini.dtx}
- [2020/12/06 v3.2f LaTeX Kernel (NFSS Initialisation)]
+ [2021/01/15 v3.2f LaTeX Kernel (NFSS Initialisation)]
% \iffalse
\documentclass{ltxdoc}
\begin{document}
@@ -448,7 +448,7 @@
% \item \cs{bfseries} is called for a family using \texttt{bx}
% (e.g., CMR)
% \item Switch to a font family that is none of the meta
-% families, e.g., via \verb=\fontfamily{ptm}\selectfont=
+% families, e.g., via \verb=\fontfamily{ptm}\allowbreak\verb=\selectfont=
% \item Then none of the real meta families, match but the final
% \verb=\@elt{??}= will.
% \item Therefore if the current series is \cs{mddefault} or
@@ -1307,8 +1307,9 @@
}
% \end{macrocode}
% \end{macro}
-
-
+%
+%
+%
% \begin{macro}{\if@font@series@context}
% The boolean to signal if we found the requested font series context.
% \begin{macrocode}
@@ -1334,9 +1335,11 @@
%<latexrelease>\EndIncludeInRelease
%<*2ekernel>
% \end{macrocode}
-
-
-
+%
+%
+%
+%
+%
%
% \section{Supporting nested emphasis}
%
@@ -1401,9 +1404,9 @@
\let\emfontdeclare@clist\@empty
% \end{macrocode}
% \end{macro}
-
-
-
+%
+%
+%
% \begin{macro}{\emrest}
% Reset the font to upright and upper/lower case. With the default rules
% using \cs{shapedefault} does that for us but to be on the safe side we
@@ -1412,12 +1415,13 @@
\DeclareRobustCommand\emreset{\upshape\ulcshape}
% \end{macrocode}
% \end{macro}
-
-
-
+%
+%
+%
% \begin{macro}{\em}
-% The new definition for \cs{em} (and implicitly \cs{emph} is like
-% it was before if \cs{emfontdeclare@clist} is empty.
+%
+% The new definition for \cs{em} (and implicitly \cs{emph}) is the
+% same as before as long as \cs{emfontdeclare@clist} is empty.
% \begin{macrocode}
\DeclareRobustCommand\em{%
\@nomath\em
diff --git a/macros/latex-dev/base/ltfsstrc.dtx b/macros/latex-dev/base/ltfsstrc.dtx
index bd0f6fabd2..961abafc8a 100644
--- a/macros/latex-dev/base/ltfsstrc.dtx
+++ b/macros/latex-dev/base/ltfsstrc.dtx
@@ -1,7 +1,7 @@
% \iffalse meta-comment
%
% Copyright (C) 1993-2021
-% The LaTeX3 Project and any individual authors listed elsewhere
+% The LaTeX Project and any individual authors listed elsewhere
% in this file.
%
% This file is part of the LaTeX base system.
@@ -30,7 +30,7 @@
% \iffalse
%%% From File: ltfsstrc.dtx
%% Copyright (C) 1989-97 by Frank Mittelbach and Rainer Sch\"opf.
-%% Copyright (C) 1994-97 by LaTeX3 project. All rights reserved.
+%% Copyright (C) 1994-97 by LaTeX Project. All rights reserved.
%
%<package>\NeedsTeXFormat{LaTeX2e}[2021/05/01]
%<package>\ProvidesPackage{tracefnt}
diff --git a/macros/latex-dev/base/lthooks-code.pdf b/macros/latex-dev/base/lthooks-code.pdf
index 13d887db4e..d47079374c 100644
--- a/macros/latex-dev/base/lthooks-code.pdf
+++ b/macros/latex-dev/base/lthooks-code.pdf
Binary files differ
diff --git a/macros/latex-dev/base/lthooks-doc.pdf b/macros/latex-dev/base/lthooks-doc.pdf
index 6a45fe2788..2bca7b9184 100644
--- a/macros/latex-dev/base/lthooks-doc.pdf
+++ b/macros/latex-dev/base/lthooks-doc.pdf
Binary files differ
diff --git a/macros/latex-dev/base/lthooks.dtx b/macros/latex-dev/base/lthooks.dtx
index 404938d203..803914b4a7 100644
--- a/macros/latex-dev/base/lthooks.dtx
+++ b/macros/latex-dev/base/lthooks.dtx
@@ -1,7 +1,7 @@
% \iffalse meta-comment
-%%
-%% File: lthooks.dtx (C) Copyright 2020,2021 Frank Mittelbach,
-%% Phelype Oleinik & LaTeX Team
+%
+% Copyright (C) 2020-2021
+% Frank Mittelbach, Phelype Oleinik & LaTeX Team
%
% This file is part of the LaTeX base system.
% -------------------------------------------
@@ -32,7 +32,7 @@
%
% \begin{macrocode}
\def\lthooksversion{v1.0h}
-\def\lthooksdate{2021/01/07}
+\def\lthooksdate{2021/01/15}
% \end{macrocode}
%
%<*driver>
@@ -54,6 +54,9 @@
}
\ExplSyntaxOff
+\providecommand\InternalDetectionOff{}
+\providecommand\InternalDetectionOn{}
+
\EnableCrossrefs
\CodelineIndex
\begin{document}
@@ -1336,14 +1339,8 @@
% Like \cs{AtBeginDocument} but for the \hook{enddocument} hook.
% \end{function}
%
-%
-%
-% \begin{function}{\AtBeginDvi}
-% \begin{syntax}
-% \cs{AtBeginDvi} \oarg{label} \Arg{code}
-% \end{syntax}
-% This hook is discussed in conjunction with the shipout hooks.
-% \end{function}
+% There is also \cs{AtBeginDvi} which is discussed in conjunction
+% with the shipout hooks.
%
% \bigskip
%
@@ -1772,9 +1769,11 @@
%
% \begin{macro}[EXP]{\@@_str_compare:nn}
% Private copy of \cs{__str_if_eq:nn}
+% \InternalDetectionOff
% \begin{macrocode}
\cs_new_eq:NN \@@_str_compare:nn \__str_if_eq:nn
% \end{macrocode}
+% \InternalDetectionOn
% \end{macro}
%
% \subsection{Declarations}
@@ -2898,9 +2897,11 @@
% together in hook |#1|.
% \begin{macrocode}
\cs_new_protected:cpn { @@_rule_incompatible-error_gset:nnn } #1#2#3
- { \@@_tl_gset:cn { g_@@_#1_rule_ \@@_label_pair:nn {#2} {#3} _tl } { xE } }
+ { \@@_tl_gset:cn { g_@@_#1_rule_ \@@_label_pair:nn {#2} {#3} _tl }
+ { xE } }
\cs_new_protected:cpn { @@_rule_incompatible-warning_gset:nnn } #1#2#3
- { \@@_tl_gset:cn { g_@@_#1_rule_ \@@_label_pair:nn {#2} {#3} _tl } { xW } }
+ { \@@_tl_gset:cn { g_@@_#1_rule_ \@@_label_pair:nn {#2} {#3} _tl }
+ { xW } }
% \end{macrocode}
% \end{macro}
%
@@ -4449,6 +4450,7 @@
% \begin{macro}{\@expl@@@initialize@all@@,
% \@expl@@@hook@curr@name@pop@@}
%
+% \InternalDetectionOff
% \begin{macrocode}
\cs_new_eq:NN \@expl@@@initialize@all@@
\__hook_initialize_all:
@@ -4458,6 +4460,7 @@
\cs_new_eq:NN \@expl@@@hook@curr@name@pop@@
\__hook_curr_name_pop:
% \end{macrocode}
+% \InternalDetectionOn
% \end{macro}
%
%
diff --git a/macros/latex-dev/base/lthyphen.dtx b/macros/latex-dev/base/lthyphen.dtx
index f8321719c7..9244db0642 100644
--- a/macros/latex-dev/base/lthyphen.dtx
+++ b/macros/latex-dev/base/lthyphen.dtx
@@ -1,7 +1,7 @@
% \iffalse meta-comment
%
% Copyright (C) 1993-2021
-% The LaTeX3 Project and any individual authors listed elsewhere
+% The LaTeX Project and any individual authors listed elsewhere
% in this file.
%
% This file is part of the LaTeX base system.
@@ -40,7 +40,7 @@
%\iffalse This is a META comment
%
% File `lthyphen.dtx'.
-% Copyright (C) 1994-94 LaTeX3 project, Frank Mittelbach and
+% Copyright (C) 1994-94 LaTeX Project, Frank Mittelbach and
% Rainer Sch\"opf, all rights reserved.
%
%\fi
diff --git a/macros/latex-dev/base/ltidxglo.dtx b/macros/latex-dev/base/ltidxglo.dtx
index f435fea4d0..75a80cd439 100644
--- a/macros/latex-dev/base/ltidxglo.dtx
+++ b/macros/latex-dev/base/ltidxglo.dtx
@@ -1,7 +1,7 @@
% \iffalse meta-comment
%
% Copyright (C) 1993-2021
-% The LaTeX3 Project and any individual authors listed elsewhere
+% The LaTeX Project and any individual authors listed elsewhere
% in this file.
%
% This file is part of the LaTeX base system.
diff --git a/macros/latex-dev/base/ltlength.dtx b/macros/latex-dev/base/ltlength.dtx
index 388aac78d7..1be147547e 100644
--- a/macros/latex-dev/base/ltlength.dtx
+++ b/macros/latex-dev/base/ltlength.dtx
@@ -1,7 +1,7 @@
% \iffalse meta-comment
%
% Copyright (C) 1993-2021
-% The LaTeX3 Project and any individual authors listed elsewhere
+% The LaTeX Project and any individual authors listed elsewhere
% in this file.
%
% This file is part of the LaTeX base system.
diff --git a/macros/latex-dev/base/ltlists.dtx b/macros/latex-dev/base/ltlists.dtx
index 087b418847..fecb312588 100644
--- a/macros/latex-dev/base/ltlists.dtx
+++ b/macros/latex-dev/base/ltlists.dtx
@@ -1,7 +1,7 @@
% \iffalse meta-comment
%
% Copyright (C) 1993-2021
-% The LaTeX3 Project and any individual authors listed elsewhere
+% The LaTeX Project and any individual authors listed elsewhere
% in this file.
%
% This file is part of the LaTeX base system.
diff --git a/macros/latex-dev/base/ltlogos.dtx b/macros/latex-dev/base/ltlogos.dtx
index 6fd7b35c92..132eaf636f 100644
--- a/macros/latex-dev/base/ltlogos.dtx
+++ b/macros/latex-dev/base/ltlogos.dtx
@@ -1,7 +1,7 @@
% \iffalse meta-comment
%
% Copyright (C) 1993-2021
-% The LaTeX3 Project and any individual authors listed elsewhere
+% The LaTeX Project and any individual authors listed elsewhere
% in this file.
%
% This file is part of the LaTeX base system.
diff --git a/macros/latex-dev/base/ltluatex.dtx b/macros/latex-dev/base/ltluatex.dtx
index 957a71d848..e3fa9f9343 100644
--- a/macros/latex-dev/base/ltluatex.dtx
+++ b/macros/latex-dev/base/ltluatex.dtx
@@ -1,7 +1,7 @@
% \iffalse meta-comment
%
% Copyright (C) 2015-2021
-% The LaTeX3 Project and any individual authors listed elsewhere
+% The LaTeX Project and any individual authors listed elsewhere
% in this file.
%
% This file is part of the LaTeX base system.
@@ -28,7 +28,7 @@
\ProvidesFile{ltluatex.dtx}
%</driver>
%<*tex>
-[2020/12/06 v1.1s
+[2021/01/15 v1.1s
%</tex>
%<plain> LuaTeX support for plain TeX (core)
%<*tex>
@@ -38,6 +38,10 @@
%</tex>
%<*driver>
\documentclass{ltxdoc}
+
+\providecommand\InternalDetectionOff{}
+\providecommand\InternalDetectionOn{}
+
\GetFileInfo{ltluatex.dtx}
\begin{document}
\title{\filename\\(Lua\TeX{}-specific support)}
@@ -204,6 +208,7 @@
% The number is returned and also \meta{name} argument is added to the
% |lua.name| array at that index.
%
+% \begin{sloppypar}
% \noindent
% \DescribeMacro{new_luafunction}
% |luatexbase.new_luafunction(|\meta{functionname}|)|\\
@@ -211,6 +216,7 @@
% with |\luafunction|, |\lateluafunction|, and |\luadef|,
% indexed from~$1$. The optional \meta{functionname} argument
% is just used for logging.
+% \end{sloppypar}
%
% These functions all require access to a named \TeX{} count register
% to manage their allocations. The standard names are those defined
@@ -1116,6 +1122,7 @@ luatexbase.registernumber = registernumber
% \changes{v1.1c}{2017/02/18}{Parameterize count used in tracking}
% As attributes are used for Lua manipulations its useful to be able
% to assign from this end.
+% \InternalDetectionOff
% \begin{macrocode}
local attributes=setmetatable(
{},
@@ -1143,6 +1150,7 @@ local function new_attribute(name)
end
luatexbase.new_attribute = new_attribute
% \end{macrocode}
+% \InternalDetectionOn
% \end{macro}
%
% \subsection{Custom whatsit allocation}
diff --git a/macros/latex-dev/base/ltluatex.pdf b/macros/latex-dev/base/ltluatex.pdf
index b37fec19fb..120ea02dcb 100644
--- a/macros/latex-dev/base/ltluatex.pdf
+++ b/macros/latex-dev/base/ltluatex.pdf
Binary files differ
diff --git a/macros/latex-dev/base/ltmath.dtx b/macros/latex-dev/base/ltmath.dtx
index 58ca26b4a5..ca90e1980d 100644
--- a/macros/latex-dev/base/ltmath.dtx
+++ b/macros/latex-dev/base/ltmath.dtx
@@ -1,7 +1,7 @@
% \iffalse meta-comment
%
% Copyright (C) 1993-2021
-% The LaTeX3 Project and any individual authors listed elsewhere
+% The LaTeX Project and any individual authors listed elsewhere
% in this file.
%
% This file is part of the LaTeX base system.
diff --git a/macros/latex-dev/base/ltmiscen.dtx b/macros/latex-dev/base/ltmiscen.dtx
index c7254ad353..939bd51a2d 100644
--- a/macros/latex-dev/base/ltmiscen.dtx
+++ b/macros/latex-dev/base/ltmiscen.dtx
@@ -1,7 +1,7 @@
% \iffalse meta-comment
%
% Copyright (C) 1993-2021
-% The LaTeX3 Project and any individual authors listed elsewhere
+% The LaTeX Project and any individual authors listed elsewhere
% in this file.
%
% This file is part of the LaTeX base system.
@@ -32,7 +32,7 @@
%<*driver>
% \fi
\ProvidesFile{ltmiscen.dtx}
- [2020/12/18 v1.1x LaTeX Kernel (Misc. Environments)]
+ [2021/02/08 v1.1y LaTeX Kernel (Misc. Environments)]
% \iffalse
\documentclass{ltxdoc}
\GetFileInfo{ltmiscen.dtx}
@@ -868,6 +868,15 @@
%<latexrelease> \expandafter\endgroup\if@endpe\@doendpe\fi
%<latexrelease> \if@ignore\@ignorefalse\ignorespaces\fi}
%<latexrelease>
+% \end{macrocode}
+% Also undo the internal commands as some packages unfortunately test
+% for their existence instead of using \cs{IfFormatAtLeastTF}.
+% \changes{v1.1y}{2021/02/08}{Undo the internals for robust \cs{begin}
+% and \cs{end} in rollback (gh/494)}
+% \begin{macrocode}
+%<latexrelease>\expandafter\let\csname begin \endcsname\@undefined
+%<latexrelease>\expandafter\let\csname end \endcsname\@undefined
+%<latexrelease>
%<latexrelease>\EndIncludeInRelease
%<*2ekernel>
% \end{macrocode}
diff --git a/macros/latex-dev/base/ltnews.cls b/macros/latex-dev/base/ltnews.cls
index 632f068117..9271b56f1c 100644
--- a/macros/latex-dev/base/ltnews.cls
+++ b/macros/latex-dev/base/ltnews.cls
@@ -1,7 +1,7 @@
% \iffalse meta-comment
%
% Copyright 1993-2020
-% The LaTeX3 Project and any individual authors listed elsewhere
+% The LaTeX Project and any individual authors listed elsewhere
% in this file.
%
% This file is part of the LaTeX base system.
@@ -35,7 +35,7 @@
% with LaTeX. The changes log is at the end of the file.
% Copyright 1994-2004
-% Alan Jeffrey and the LaTeX3 project.
+% Alan Jeffrey and the LaTeX Project.
% This is a LaTeX2e document class.
@@ -437,7 +437,7 @@
\newcommand{\indicia}{\renewcommand{\@indicia}}
\newcommand{\@indicia}{%
\LaTeXNews, and the \LaTeX{} software,
- are brought to you by the \LaTeX3 Project Team;
+ are brought to you by the \LaTeX\ Project Team;
Copyright \@year, all rights reserved.
}
diff --git a/macros/latex-dev/base/ltnews.pdf b/macros/latex-dev/base/ltnews.pdf
index 1fad83e1e1..ed24b7b485 100644
--- a/macros/latex-dev/base/ltnews.pdf
+++ b/macros/latex-dev/base/ltnews.pdf
Binary files differ
diff --git a/macros/latex-dev/base/ltnews.tex b/macros/latex-dev/base/ltnews.tex
index e22f0b32e4..87982065d2 100644
--- a/macros/latex-dev/base/ltnews.tex
+++ b/macros/latex-dev/base/ltnews.tex
@@ -1,7 +1,9 @@
% \iffalse meta-comment
%
-% Copyright 2006, 2009, 2011, 2014 Heiko Oberdiek
-% Copyright (C) 2014-2020 The LaTeX3 Project
+% Copyright (C) 2006, 2009, 2011, 2014 Heiko Oberdiek
+% Copyright (C) 2014-2021
+% The LaTeX Project and any individual authors listed elsewhere
+% in this file.
%
% This file is part of the LaTeX base system.
% -------------------------------------------
diff --git a/macros/latex-dev/base/ltnews01.pdf b/macros/latex-dev/base/ltnews01.pdf
index 650b30ac91..02a6c7a776 100644
--- a/macros/latex-dev/base/ltnews01.pdf
+++ b/macros/latex-dev/base/ltnews01.pdf
Binary files differ
diff --git a/macros/latex-dev/base/ltnews01.tex b/macros/latex-dev/base/ltnews01.tex
index b8cff84839..3703f23f61 100644
--- a/macros/latex-dev/base/ltnews01.tex
+++ b/macros/latex-dev/base/ltnews01.tex
@@ -1,7 +1,7 @@
% \iffalse meta-comment
%
% Copyright (C) 1993-2021
-% The LaTeX3 Project and any individual authors listed elsewhere
+% The LaTeX Project and any individual authors listed elsewhere
% in this file.
%
% This file is part of the LaTeX base system.
@@ -52,8 +52,8 @@ fixes, newly available packages, or any other \LaTeX{} news.
The most important news is the release of \LaTeXe, the new version of
the \LaTeX{} software. This version has better support for fonts,
-graphics and colour, and will be actively maintained by the \LaTeX3
-project team. Upgrades will be issued every six months, in June and
+graphics and colour, and will be actively maintained by the \LaTeX\
+Project team. Upgrades will be issued every six months, in June and
December.
\section{Why a new \LaTeX?}
@@ -110,7 +110,7 @@ from the distributor who brought you \LaTeXe:
\item[graphics] for including images.
\item[mfnfss] for using bitmap fonts.
\item[psnfss] for using Type~1 fonts.
-\item[tools] other packages by the \LaTeX3 team.
+\item[tools] other packages by the \LaTeX\ Project team.
\end{citations}
The packages come with full documentation, and are also described in
\emph{\LaTeX: A Document Processing System} or
diff --git a/macros/latex-dev/base/ltnews02.pdf b/macros/latex-dev/base/ltnews02.pdf
index 6be0c94845..a9a388e900 100644
--- a/macros/latex-dev/base/ltnews02.pdf
+++ b/macros/latex-dev/base/ltnews02.pdf
Binary files differ
diff --git a/macros/latex-dev/base/ltnews02.tex b/macros/latex-dev/base/ltnews02.tex
index 8051e59535..e1fa2909dc 100644
--- a/macros/latex-dev/base/ltnews02.tex
+++ b/macros/latex-dev/base/ltnews02.tex
@@ -1,7 +1,7 @@
% \iffalse meta-comment
%
% Copyright (C) 1993-2021
-% The LaTeX3 Project and any individual authors listed elsewhere
+% The LaTeX Project and any individual authors listed elsewhere
% in this file.
%
% This file is part of the LaTeX base system.
diff --git a/macros/latex-dev/base/ltnews03.pdf b/macros/latex-dev/base/ltnews03.pdf
index b8d7f44886..256c443b84 100644
--- a/macros/latex-dev/base/ltnews03.pdf
+++ b/macros/latex-dev/base/ltnews03.pdf
Binary files differ
diff --git a/macros/latex-dev/base/ltnews03.tex b/macros/latex-dev/base/ltnews03.tex
index cb5776eaaf..f000d66e4d 100644
--- a/macros/latex-dev/base/ltnews03.tex
+++ b/macros/latex-dev/base/ltnews03.tex
@@ -1,7 +1,7 @@
% \iffalse meta-comment
%
% Copyright (C) 1993-2021
-% The LaTeX3 Project and any individual authors listed elsewhere
+% The LaTeX Project and any individual authors listed elsewhere
% in this file.
%
% This file is part of the LaTeX base system.
diff --git a/macros/latex-dev/base/ltnews04.pdf b/macros/latex-dev/base/ltnews04.pdf
index abc02c307c..6f9651308c 100644
--- a/macros/latex-dev/base/ltnews04.pdf
+++ b/macros/latex-dev/base/ltnews04.pdf
Binary files differ
diff --git a/macros/latex-dev/base/ltnews04.tex b/macros/latex-dev/base/ltnews04.tex
index 6d04da020b..cbcf151f12 100644
--- a/macros/latex-dev/base/ltnews04.tex
+++ b/macros/latex-dev/base/ltnews04.tex
@@ -1,7 +1,7 @@
% \iffalse meta-comment
%
% Copyright (C) 1993-2021
-% The LaTeX3 Project and any individual authors listed elsewhere
+% The LaTeX Project and any individual authors listed elsewhere
% in this file.
%
% This file is part of the LaTeX base system.
diff --git a/macros/latex-dev/base/ltnews05.pdf b/macros/latex-dev/base/ltnews05.pdf
index cb2dece233..01a5d7a1f8 100644
--- a/macros/latex-dev/base/ltnews05.pdf
+++ b/macros/latex-dev/base/ltnews05.pdf
Binary files differ
diff --git a/macros/latex-dev/base/ltnews05.tex b/macros/latex-dev/base/ltnews05.tex
index c3a87ab831..f8d611808b 100644
--- a/macros/latex-dev/base/ltnews05.tex
+++ b/macros/latex-dev/base/ltnews05.tex
@@ -1,7 +1,7 @@
% \iffalse meta-comment
%
% Copyright (C) 1993-2021
-% The LaTeX3 Project and any individual authors listed elsewhere
+% The LaTeX Project and any individual authors listed elsewhere
% in this file.
%
% This file is part of the LaTeX base system.
diff --git a/macros/latex-dev/base/ltnews06.pdf b/macros/latex-dev/base/ltnews06.pdf
index 57c96ffe6a..1c504ac583 100644
--- a/macros/latex-dev/base/ltnews06.pdf
+++ b/macros/latex-dev/base/ltnews06.pdf
Binary files differ
diff --git a/macros/latex-dev/base/ltnews06.tex b/macros/latex-dev/base/ltnews06.tex
index 7d8798e421..d0c5943b5e 100644
--- a/macros/latex-dev/base/ltnews06.tex
+++ b/macros/latex-dev/base/ltnews06.tex
@@ -1,7 +1,7 @@
% \iffalse meta-comment
%
% Copyright (C) 1993-2021
-% The LaTeX3 Project and any individual authors listed elsewhere
+% The LaTeX Project and any individual authors listed elsewhere
% in this file.
%
% This file is part of the LaTeX base system.
diff --git a/macros/latex-dev/base/ltnews07.pdf b/macros/latex-dev/base/ltnews07.pdf
index 7eeae6c33e..654abf8b13 100644
--- a/macros/latex-dev/base/ltnews07.pdf
+++ b/macros/latex-dev/base/ltnews07.pdf
Binary files differ
diff --git a/macros/latex-dev/base/ltnews07.tex b/macros/latex-dev/base/ltnews07.tex
index 47bb0d0003..53b8b778f4 100644
--- a/macros/latex-dev/base/ltnews07.tex
+++ b/macros/latex-dev/base/ltnews07.tex
@@ -1,7 +1,7 @@
% \iffalse meta-comment
%
% Copyright (C) 1993-2021
-% The LaTeX3 Project and any individual authors listed elsewhere
+% The LaTeX Project and any individual authors listed elsewhere
% in this file.
%
% This file is part of the LaTeX base system.
diff --git a/macros/latex-dev/base/ltnews08.pdf b/macros/latex-dev/base/ltnews08.pdf
index 0fef2ab505..a672d94340 100644
--- a/macros/latex-dev/base/ltnews08.pdf
+++ b/macros/latex-dev/base/ltnews08.pdf
Binary files differ
diff --git a/macros/latex-dev/base/ltnews08.tex b/macros/latex-dev/base/ltnews08.tex
index 2bb9bf48c5..5ea811267d 100644
--- a/macros/latex-dev/base/ltnews08.tex
+++ b/macros/latex-dev/base/ltnews08.tex
@@ -1,7 +1,7 @@
% \iffalse meta-comment
%
% Copyright (C) 1993-2021
-% The LaTeX3 Project and any individual authors listed elsewhere
+% The LaTeX Project and any individual authors listed elsewhere
% in this file.
%
% This file is part of the LaTeX base system.
diff --git a/macros/latex-dev/base/ltnews09.pdf b/macros/latex-dev/base/ltnews09.pdf
index 7119a3b1f6..c6e93c9496 100644
--- a/macros/latex-dev/base/ltnews09.pdf
+++ b/macros/latex-dev/base/ltnews09.pdf
Binary files differ
diff --git a/macros/latex-dev/base/ltnews09.tex b/macros/latex-dev/base/ltnews09.tex
index d3416545c8..0d959d9f92 100644
--- a/macros/latex-dev/base/ltnews09.tex
+++ b/macros/latex-dev/base/ltnews09.tex
@@ -1,7 +1,7 @@
% \iffalse meta-comment
%
% Copyright (C) 1993-2021
-% The LaTeX3 Project and any individual authors listed elsewhere
+% The LaTeX Project and any individual authors listed elsewhere
% in this file.
%
% This file is part of the LaTeX base system.
@@ -47,7 +47,7 @@
\section{New math font encodings}
-A joint working group of the \TeX{} Users Group and the \LaTeX3
+A joint working group of the \TeX{} Users Group and the \LaTeX\
Project is developing a new 8-bit math font encoding for \TeX{}.
It is designed to overcome several limitations and implementation
problems of the old math font encodings and to simplify switching
diff --git a/macros/latex-dev/base/ltnews10.pdf b/macros/latex-dev/base/ltnews10.pdf
index fb1324621e..7eba03fb13 100644
--- a/macros/latex-dev/base/ltnews10.pdf
+++ b/macros/latex-dev/base/ltnews10.pdf
Binary files differ
diff --git a/macros/latex-dev/base/ltnews10.tex b/macros/latex-dev/base/ltnews10.tex
index a888559e4c..bad9fda6ce 100644
--- a/macros/latex-dev/base/ltnews10.tex
+++ b/macros/latex-dev/base/ltnews10.tex
@@ -1,7 +1,7 @@
% \iffalse meta-comment
%
% Copyright (C) 1993-2021
-% The LaTeX3 Project and any individual authors listed elsewhere
+% The LaTeX Project and any individual authors listed elsewhere
% in this file.
%
% This file is part of the LaTeX base system.
diff --git a/macros/latex-dev/base/ltnews11.pdf b/macros/latex-dev/base/ltnews11.pdf
index f3a652baf4..3e4489ebce 100644
--- a/macros/latex-dev/base/ltnews11.pdf
+++ b/macros/latex-dev/base/ltnews11.pdf
Binary files differ
diff --git a/macros/latex-dev/base/ltnews11.tex b/macros/latex-dev/base/ltnews11.tex
index c300ae95c9..6d27fee067 100644
--- a/macros/latex-dev/base/ltnews11.tex
+++ b/macros/latex-dev/base/ltnews11.tex
@@ -1,7 +1,7 @@
% \iffalse meta-comment
%
% Copyright (C) 1993-2021
-% The LaTeX3 Project and any individual authors listed elsewhere
+% The LaTeX Project and any individual authors listed elsewhere
% in this file.
%
% This file is part of the LaTeX base system.
@@ -110,7 +110,7 @@ package.
\section{New math font encodings}
As we announced in \LaTeX{} News~9, a joint working group of the
-\TeX{} Users Group and the \LaTeX3 Project has developed a new
+\TeX{} Users Group and the \LaTeX\ Project has developed a new
\mbox{8-bit} math font encoding for \TeX{}.
The reason why this work is not yet released is because of other
exciting developments in the world of math fonts and math characters.
diff --git a/macros/latex-dev/base/ltnews12.pdf b/macros/latex-dev/base/ltnews12.pdf
index 1eb52def47..15ecabb663 100644
--- a/macros/latex-dev/base/ltnews12.pdf
+++ b/macros/latex-dev/base/ltnews12.pdf
Binary files differ
diff --git a/macros/latex-dev/base/ltnews12.tex b/macros/latex-dev/base/ltnews12.tex
index c0ee6fe411..8815c232ec 100644
--- a/macros/latex-dev/base/ltnews12.tex
+++ b/macros/latex-dev/base/ltnews12.tex
@@ -1,7 +1,7 @@
% \iffalse meta-comment
%
% Copyright (C) 1993-2021
-% The LaTeX3 Project and any individual authors listed elsewhere
+% The LaTeX Project and any individual authors listed elsewhere
% in this file.
%
% This file is part of the LaTeX base system.
diff --git a/macros/latex-dev/base/ltnews13.pdf b/macros/latex-dev/base/ltnews13.pdf
index 9ad4d3baf9..c1731bc652 100644
--- a/macros/latex-dev/base/ltnews13.pdf
+++ b/macros/latex-dev/base/ltnews13.pdf
Binary files differ
diff --git a/macros/latex-dev/base/ltnews13.tex b/macros/latex-dev/base/ltnews13.tex
index 49519a871e..185a080e2b 100644
--- a/macros/latex-dev/base/ltnews13.tex
+++ b/macros/latex-dev/base/ltnews13.tex
@@ -1,7 +1,7 @@
% \iffalse meta-comment
%
% Copyright (C) 1993-2021
-% The LaTeX3 Project and any individual authors listed elsewhere
+% The LaTeX Project and any individual authors listed elsewhere
% in this file.
%
% This file is part of the LaTeX base system.
diff --git a/macros/latex-dev/base/ltnews14.pdf b/macros/latex-dev/base/ltnews14.pdf
index 5b2c3e04a4..28c3a8adbd 100644
--- a/macros/latex-dev/base/ltnews14.pdf
+++ b/macros/latex-dev/base/ltnews14.pdf
Binary files differ
diff --git a/macros/latex-dev/base/ltnews14.tex b/macros/latex-dev/base/ltnews14.tex
index bc9b47d7cf..836591019e 100644
--- a/macros/latex-dev/base/ltnews14.tex
+++ b/macros/latex-dev/base/ltnews14.tex
@@ -1,7 +1,7 @@
% \iffalse meta-comment
%
% Copyright (C) 1993-2021
-% The LaTeX3 Project and any individual authors listed elsewhere
+% The LaTeX Project and any individual authors listed elsewhere
% in this file.
%
% This file is part of the LaTeX base system.
diff --git a/macros/latex-dev/base/ltnews15.pdf b/macros/latex-dev/base/ltnews15.pdf
index 7f6d955457..7e0bed9caa 100644
--- a/macros/latex-dev/base/ltnews15.pdf
+++ b/macros/latex-dev/base/ltnews15.pdf
Binary files differ
diff --git a/macros/latex-dev/base/ltnews15.tex b/macros/latex-dev/base/ltnews15.tex
index 6c602c60c5..4532111d98 100644
--- a/macros/latex-dev/base/ltnews15.tex
+++ b/macros/latex-dev/base/ltnews15.tex
@@ -1,7 +1,7 @@
% \iffalse meta-comment
%
% Copyright (C) 1993-2021
-% The LaTeX3 Project and any individual authors listed elsewhere
+% The LaTeX Project and any individual authors listed elsewhere
% in this file.
%
% This file is part of the LaTeX base system.
diff --git a/macros/latex-dev/base/ltnews16.pdf b/macros/latex-dev/base/ltnews16.pdf
index 2b01d63ba6..e8020df9f0 100644
--- a/macros/latex-dev/base/ltnews16.pdf
+++ b/macros/latex-dev/base/ltnews16.pdf
Binary files differ
diff --git a/macros/latex-dev/base/ltnews16.tex b/macros/latex-dev/base/ltnews16.tex
index 0e78e9b791..8f96ed197f 100644
--- a/macros/latex-dev/base/ltnews16.tex
+++ b/macros/latex-dev/base/ltnews16.tex
@@ -1,7 +1,7 @@
% \iffalse meta-comment
%
% Copyright (C) 1993-2021
-% The LaTeX3 Project and any individual authors listed elsewhere
+% The LaTeX Project and any individual authors listed elsewhere
% in this file.
%
% This file is part of the LaTeX base system.
@@ -49,7 +49,7 @@
\section{Anniversary news}
This anniversary \textit{Issue~16} takes a brief look into the future work of
-the \LaTeX3 Project Team, both short and longer range. Please let
+the \LaTeX\ Project Team, both short and longer range. Please let
us know if you want %\newline
to get involved with us in any of this work (see below).
diff --git a/macros/latex-dev/base/ltnews17.pdf b/macros/latex-dev/base/ltnews17.pdf
index 80c54ada96..6b267b1406 100644
--- a/macros/latex-dev/base/ltnews17.pdf
+++ b/macros/latex-dev/base/ltnews17.pdf
Binary files differ
diff --git a/macros/latex-dev/base/ltnews17.tex b/macros/latex-dev/base/ltnews17.tex
index c6d7678f1a..f850f8d64c 100644
--- a/macros/latex-dev/base/ltnews17.tex
+++ b/macros/latex-dev/base/ltnews17.tex
@@ -1,7 +1,7 @@
% \iffalse meta-comment
%
% Copyright (C) 1993-2021
-% The LaTeX3 Project and any individual authors listed elsewhere
+% The LaTeX Project and any individual authors listed elsewhere
% in this file.
%
% This file is part of the LaTeX base system.
diff --git a/macros/latex-dev/base/ltnews18.pdf b/macros/latex-dev/base/ltnews18.pdf
index 6a6a7e211b..d84aeeba0f 100644
--- a/macros/latex-dev/base/ltnews18.pdf
+++ b/macros/latex-dev/base/ltnews18.pdf
Binary files differ
diff --git a/macros/latex-dev/base/ltnews18.tex b/macros/latex-dev/base/ltnews18.tex
index 253f7057a3..518aeda067 100644
--- a/macros/latex-dev/base/ltnews18.tex
+++ b/macros/latex-dev/base/ltnews18.tex
@@ -1,7 +1,7 @@
% \iffalse meta-comment
%
% Copyright (C) 1993-2021
-% The LaTeX3 Project and any individual authors listed elsewhere
+% The LaTeX Project and any individual authors listed elsewhere
% in this file.
%
% This file is part of the LaTeX base system.
diff --git a/macros/latex-dev/base/ltnews19.pdf b/macros/latex-dev/base/ltnews19.pdf
index 848d719f7b..ad22c7254d 100644
--- a/macros/latex-dev/base/ltnews19.pdf
+++ b/macros/latex-dev/base/ltnews19.pdf
Binary files differ
diff --git a/macros/latex-dev/base/ltnews19.tex b/macros/latex-dev/base/ltnews19.tex
index 0c0bb5740b..4d50b98c82 100644
--- a/macros/latex-dev/base/ltnews19.tex
+++ b/macros/latex-dev/base/ltnews19.tex
@@ -1,7 +1,7 @@
% \iffalse meta-comment
%
% Copyright (C) 1993-2021
-% The LaTeX3 Project and any individual authors listed elsewhere
+% The LaTeX Project and any individual authors listed elsewhere
% in this file.
%
% This file is part of the LaTeX base system.
diff --git a/macros/latex-dev/base/ltnews20.pdf b/macros/latex-dev/base/ltnews20.pdf
index 66a63d909c..5eb13810e9 100644
--- a/macros/latex-dev/base/ltnews20.pdf
+++ b/macros/latex-dev/base/ltnews20.pdf
Binary files differ
diff --git a/macros/latex-dev/base/ltnews20.tex b/macros/latex-dev/base/ltnews20.tex
index a43aa37b7c..44acd1ec3e 100644
--- a/macros/latex-dev/base/ltnews20.tex
+++ b/macros/latex-dev/base/ltnews20.tex
@@ -1,7 +1,7 @@
% \iffalse meta-comment
%
% Copyright 1993--2019
-% The LaTeX3 Project and any individual authors listed elsewhere
+% The LaTeX Project and any individual authors listed elsewhere
% in this file.
%
% This file is part of the LaTeX base system.
diff --git a/macros/latex-dev/base/ltnews21.pdf b/macros/latex-dev/base/ltnews21.pdf
index 0f166e8e5c..c40d64c9f2 100644
--- a/macros/latex-dev/base/ltnews21.pdf
+++ b/macros/latex-dev/base/ltnews21.pdf
Binary files differ
diff --git a/macros/latex-dev/base/ltnews21.tex b/macros/latex-dev/base/ltnews21.tex
index d94df28b48..14de47c648 100644
--- a/macros/latex-dev/base/ltnews21.tex
+++ b/macros/latex-dev/base/ltnews21.tex
@@ -1,7 +1,7 @@
% \iffalse meta-comment
%
% Copyright 2019
-% The LaTeX3 Project and any individual authors listed elsewhere
+% The LaTeX Project and any individual authors listed elsewhere
% in this file.
%
% This file is part of the LaTeX base system.
diff --git a/macros/latex-dev/base/ltnews22.pdf b/macros/latex-dev/base/ltnews22.pdf
index b25ebf972c..bf670e208d 100644
--- a/macros/latex-dev/base/ltnews22.pdf
+++ b/macros/latex-dev/base/ltnews22.pdf
Binary files differ
diff --git a/macros/latex-dev/base/ltnews22.tex b/macros/latex-dev/base/ltnews22.tex
index 90eed223f1..e73fb4b7c4 100644
--- a/macros/latex-dev/base/ltnews22.tex
+++ b/macros/latex-dev/base/ltnews22.tex
@@ -1,7 +1,7 @@
% \iffalse meta-comment
%
% Copyright (C) 2015-2021
-% The LaTeX3 Project and any individual authors listed elsewhere
+% The LaTeX Project and any individual authors listed elsewhere
% in this file.
%
% This file is part of the LaTeX base system.
diff --git a/macros/latex-dev/base/ltnews23.pdf b/macros/latex-dev/base/ltnews23.pdf
index 9ef72c1507..f485261a67 100644
--- a/macros/latex-dev/base/ltnews23.pdf
+++ b/macros/latex-dev/base/ltnews23.pdf
Binary files differ
diff --git a/macros/latex-dev/base/ltnews23.tex b/macros/latex-dev/base/ltnews23.tex
index b645bbf4ed..36f8948e7d 100644
--- a/macros/latex-dev/base/ltnews23.tex
+++ b/macros/latex-dev/base/ltnews23.tex
@@ -1,7 +1,7 @@
% \iffalse meta-comment
%
% Copyright (C) 2015-2021
-% The LaTeX3 Project and any individual authors listed elsewhere
+% The LaTeX Project and any individual authors listed elsewhere
% in this file.
%
% This file is part of the LaTeX base system.
diff --git a/macros/latex-dev/base/ltnews24.pdf b/macros/latex-dev/base/ltnews24.pdf
index b486105173..513e3d8779 100644
--- a/macros/latex-dev/base/ltnews24.pdf
+++ b/macros/latex-dev/base/ltnews24.pdf
Binary files differ
diff --git a/macros/latex-dev/base/ltnews24.tex b/macros/latex-dev/base/ltnews24.tex
index 15588f27a6..5dee993186 100644
--- a/macros/latex-dev/base/ltnews24.tex
+++ b/macros/latex-dev/base/ltnews24.tex
@@ -1,7 +1,7 @@
% \iffalse meta-comment
%
% Copyright (C) 2015-2021
-% The LaTeX3 Project and any individual authors listed elsewhere
+% The LaTeX Project and any individual authors listed elsewhere
% in this file.
%
% This file is part of the LaTeX base system.
diff --git a/macros/latex-dev/base/ltnews25.pdf b/macros/latex-dev/base/ltnews25.pdf
index 973b4d7b63..085e5958bc 100644
--- a/macros/latex-dev/base/ltnews25.pdf
+++ b/macros/latex-dev/base/ltnews25.pdf
Binary files differ
diff --git a/macros/latex-dev/base/ltnews25.tex b/macros/latex-dev/base/ltnews25.tex
index 58ca8d78c7..e1881018ba 100644
--- a/macros/latex-dev/base/ltnews25.tex
+++ b/macros/latex-dev/base/ltnews25.tex
@@ -1,7 +1,7 @@
% \iffalse meta-comment
%
% Copyright (C) 2016-2021
-% The LaTeX3 Project and any individual authors listed elsewhere
+% The LaTeX Project and any individual authors listed elsewhere
% in this file.
%
% This file is part of the LaTeX base system.
diff --git a/macros/latex-dev/base/ltnews26.pdf b/macros/latex-dev/base/ltnews26.pdf
index 0a8d0c21d4..ce1f355dbf 100644
--- a/macros/latex-dev/base/ltnews26.pdf
+++ b/macros/latex-dev/base/ltnews26.pdf
Binary files differ
diff --git a/macros/latex-dev/base/ltnews26.tex b/macros/latex-dev/base/ltnews26.tex
index af3b44264e..e1ae85dda8 100644
--- a/macros/latex-dev/base/ltnews26.tex
+++ b/macros/latex-dev/base/ltnews26.tex
@@ -1,7 +1,7 @@
% \iffalse meta-comment
%
% Copyright (C) 2017-2021
-% The LaTeX3 Project and any individual authors listed elsewhere
+% The LaTeX Project and any individual authors listed elsewhere
% in this file.
%
% This file is part of the LaTeX base system.
diff --git a/macros/latex-dev/base/ltnews27.pdf b/macros/latex-dev/base/ltnews27.pdf
index f16a8a88d5..6cf574b621 100644
--- a/macros/latex-dev/base/ltnews27.pdf
+++ b/macros/latex-dev/base/ltnews27.pdf
Binary files differ
diff --git a/macros/latex-dev/base/ltnews27.tex b/macros/latex-dev/base/ltnews27.tex
index a4cf53705f..3572b5e0b1 100644
--- a/macros/latex-dev/base/ltnews27.tex
+++ b/macros/latex-dev/base/ltnews27.tex
@@ -1,7 +1,7 @@
% \iffalse meta-comment
%
% Copyright (C) 2017-2021
-% The LaTeX3 Project and any individual authors listed elsewhere
+% The LaTeX Project and any individual authors listed elsewhere
% in this file.
%
% This file is part of the LaTeX base system.
diff --git a/macros/latex-dev/base/ltnews28.pdf b/macros/latex-dev/base/ltnews28.pdf
index cea0c87f37..2d0c517c1c 100644
--- a/macros/latex-dev/base/ltnews28.pdf
+++ b/macros/latex-dev/base/ltnews28.pdf
Binary files differ
diff --git a/macros/latex-dev/base/ltnews28.tex b/macros/latex-dev/base/ltnews28.tex
index c1cdd6bdbf..59b01ed4fc 100644
--- a/macros/latex-dev/base/ltnews28.tex
+++ b/macros/latex-dev/base/ltnews28.tex
@@ -1,7 +1,7 @@
% \iffalse meta-comment
%
% Copyright (C) 2017-2021
-% The LaTeX3 Project and any individual authors listed elsewhere
+% The LaTeX Project and any individual authors listed elsewhere
% in this file.
%
% This file is part of the LaTeX base system.
@@ -353,7 +353,7 @@ between 2016 and 2018.
In: TUGboat, 38\#2, 2017.
\url{https://www.latex-project.org/publications/}
-\bibitem{amsldoc} American Mathematical Society and The \LaTeX3 Project:
+\bibitem{amsldoc} American Mathematical Society and The \LaTeX\ Project:
\emph{User's Guide for the \texttt{amsmath} package} (Version 2.1).
April 2018.
Available from
diff --git a/macros/latex-dev/base/ltnews29.pdf b/macros/latex-dev/base/ltnews29.pdf
index c13f8bb8fe..feefff5b52 100644
--- a/macros/latex-dev/base/ltnews29.pdf
+++ b/macros/latex-dev/base/ltnews29.pdf
Binary files differ
diff --git a/macros/latex-dev/base/ltnews29.tex b/macros/latex-dev/base/ltnews29.tex
index 895b6d0f0c..a5732eada9 100644
--- a/macros/latex-dev/base/ltnews29.tex
+++ b/macros/latex-dev/base/ltnews29.tex
@@ -1,7 +1,7 @@
% \iffalse meta-comment
%
% Copyright (C) 2018-2021
-% The LaTeX3 Project and any individual authors listed elsewhere
+% The LaTeX Project and any individual authors listed elsewhere
% in this file.
%
% This file is part of the LaTeX base system.
@@ -513,7 +513,7 @@ source code (with index etc.\@) and a number of other goodies.
\emph{\LaTeX{} Project publications on the \LaTeX{} Project Website}.\\
\url{https://latex-project.org/publications/}
-\bibitem{29:amsldoc} American Mathematical Society and The \LaTeX3 Project:
+\bibitem{29:amsldoc} American Mathematical Society and The \LaTeX\ Project:
\emph{User's Guide for the \texttt{amsmath} Package} (Version 2.1).
April 2018.
Available from
diff --git a/macros/latex-dev/base/ltnews30.pdf b/macros/latex-dev/base/ltnews30.pdf
index f46f249cb2..d55fccc019 100644
--- a/macros/latex-dev/base/ltnews30.pdf
+++ b/macros/latex-dev/base/ltnews30.pdf
Binary files differ
diff --git a/macros/latex-dev/base/ltnews30.tex b/macros/latex-dev/base/ltnews30.tex
index d09e1fe2b0..cfb67b0c68 100644
--- a/macros/latex-dev/base/ltnews30.tex
+++ b/macros/latex-dev/base/ltnews30.tex
@@ -1,7 +1,7 @@
% \iffalse meta-comment
%
% Copyright 2019
-% The LaTeX3 Project and any individual authors listed elsewhere
+% The LaTeX Project and any individual authors listed elsewhere
% in this file.
%
% This file is part of the LaTeX base system.
diff --git a/macros/latex-dev/base/ltnews31.pdf b/macros/latex-dev/base/ltnews31.pdf
index 93104e511e..fa449938c0 100644
--- a/macros/latex-dev/base/ltnews31.pdf
+++ b/macros/latex-dev/base/ltnews31.pdf
Binary files differ
diff --git a/macros/latex-dev/base/ltnews31.tex b/macros/latex-dev/base/ltnews31.tex
index 1b775a532e..61e8b00683 100644
--- a/macros/latex-dev/base/ltnews31.tex
+++ b/macros/latex-dev/base/ltnews31.tex
@@ -1,7 +1,7 @@
% \iffalse meta-comment
%
% Copyright 2019-2020
-% The LaTeX3 Project and any individual authors listed elsewhere
+% The LaTeX Project and any individual authors listed elsewhere
% in this file.
%
% This file is part of the LaTeX base system.
diff --git a/macros/latex-dev/base/ltnews32.pdf b/macros/latex-dev/base/ltnews32.pdf
index 6dceda4651..901c02a46e 100644
--- a/macros/latex-dev/base/ltnews32.pdf
+++ b/macros/latex-dev/base/ltnews32.pdf
Binary files differ
diff --git a/macros/latex-dev/base/ltnews32.tex b/macros/latex-dev/base/ltnews32.tex
index 85283a86a9..2f1db6c560 100644
--- a/macros/latex-dev/base/ltnews32.tex
+++ b/macros/latex-dev/base/ltnews32.tex
@@ -1,7 +1,7 @@
% \iffalse meta-comment
%
% Copyright 2019-2020
-% The LaTeX3 Project and any individual authors listed elsewhere
+% The LaTeX Project and any individual authors listed elsewhere
% in this file.
%
% This file is part of the LaTeX base system.
diff --git a/macros/latex-dev/base/ltnews33.pdf b/macros/latex-dev/base/ltnews33.pdf
index ec075df271..548bb7c4da 100644
--- a/macros/latex-dev/base/ltnews33.pdf
+++ b/macros/latex-dev/base/ltnews33.pdf
Binary files differ
diff --git a/macros/latex-dev/base/ltnews33.tex b/macros/latex-dev/base/ltnews33.tex
index f3341e7a99..922740a7ed 100644
--- a/macros/latex-dev/base/ltnews33.tex
+++ b/macros/latex-dev/base/ltnews33.tex
@@ -1,7 +1,7 @@
% \iffalse meta-comment
%
% Copyright 2019-2020
-% The LaTeX3 Project and any individual authors listed elsewhere
+% The LaTeX Project and any individual authors listed elsewhere
% in this file.
%
% This file is part of the LaTeX base system.
@@ -78,6 +78,7 @@
\let\cls\pkg
\providecommand\env[1]{\texttt{#1}}
+\providecommand\acro[1]{\textsc{#1}}
\vbadness=1400 % accept slightly empty columns
@@ -111,8 +112,104 @@
+\section{Extending the hook concept to paragraphs}
+
+Largely triggered by the need for better control of paragraph text
+processing, in particular when producing tagged PDF output (see
+\cite{33:blueprint}), we have extended the paragraph processing of
+\LaTeX{} so that the kernel gains control both at the start and the
+end of each paragraph. This is done in a manner that is (or should
+be) transparent to packages and user documents.
+
+Beside the internal control points for exclusive use of the \LaTeX{}
+kernel we also implemented four public hooks that can be used by
+packages or user via the hook management declarations to achieve
+special effects or implement manipulations that in the past were only
+possible through redefinitions of \cs{everypar} or \cs{par} with the
+usual issue that such changes would conflict with changes in other
+packages.
+
+The documentation of the hooks together with a few examples is
+provided in \file{ltpara-doc.pdf} and for those who want to study the
+(quite interesting) code is found in \file{ltpara-code.pdf}. At
+some point in the future it will get fully merged into the \LaTeX{}
+kernel and will then appear in \file{source2e.pdf}.
+
+
+
\section{Other changes to the \LaTeX{} kernel}
+\subsection{Adjusting \env{itemize} labels with \cs{labelitemfont}}
+
+The command \cs{labelitemfont} was in fact already introduced with the
+\LaTeX\ release 2020-02-02, but back then we forgot to describe it, so
+we do this now. Its purpose is to resolve some bad formatting issues
+with the \env{itemize} environment and at the same time make it easier
+to adjust its layout if necessary. What could happen in the past was the the
+\env{itemize} labels, e.g., the \textbullet{}, would sometimes react to
+surrounding font changes and could suddenly change shape, for example
+to \textit{\textbullet}.
+
+Now \cs{labelitemfont} is applied to each
+label defaulting to \cs{normalfont} which will prevent this behavior.
+By choosing a different settings other effects can be achieved, for example
+\begin{verbatim}
+ \renewcommand\labelitemfont
+ {\normalfont\fontfamily{lmss}\selectfont}
+ \renewcommand\labelitemfont
+ {\rmfamily\normalshape}
+\end{verbatim}
+The first will take the symbols from Latin Modern Sans so that you get
+%
+\def\myfont#1{{\let\labelitemfont\empty\fontfamily{lmss}\selectfont#1}}
+%
+\myfont\labelitemi, \myfont\labelitemii, \myfont\labelitemiii\ and
+\myfont\labelitemiv, while the second variant freezes the font family
+and shape, but leave the series variable, so that an \env{itemize} in
+a bold context would show bolder symbols. Making it empty would give
+you the buggy old behavior back.
+%
+\githubissue{497}
+
+
+\subsection{A note on file names with spaces, dots or UTF-8 characters}
+
+In one of the the recent \LaTeX{} releases we improved the interface
+for specifying file names so that they can now safely contain spaces
+(as is common on Windows but also elsewhere), UTF-8 characters
+outside the \acro{ascii} range as well as names with several dots in
+it. In the past this was only possible by applying a special syntax
+(in cases of spaces), not at all for most UTF-8 characters and
+not in all circumstances for files with several dots.
+
+However, \TeX{} has a built-in rule saying that you can leave out the
+extension if it is \texttt{.tex}. Because of that \verb=\input{file}=
+or \verb=\input{file.tex}= both load \file{file.tex} if it
+exists. While this is convenient most of the time it is a little
+awkward in some scenarios (for example, when both \file{file} and
+\file{file.tex} exist) and also when you manually try to implement
+that rule.
+
+\LaTeX{} therefore had one special syntax for \cs{include} and
+\cs{includeonly}: they always expected that their arguments contains a
+file name\footnote{In case of \cs{includeonly} a comma separated list
+ of such names.} without its extension, which had to be
+\texttt{.tex}. Thus when you mistakenly wrote
+\verb=\include{mychap.tex}= (for example, when you changed from \cs{input}
+to \cs{include} somewhere), \LaTeX{} went ahead and looked for the
+file \file{mychap.tex.tex} for inclusion and tried to write support
+information to the file \file{mychap.tex.aux}. The reason was that
+\cs{include} had to construct both physical file names from the
+argument and it didn't bother to do something special about the
+extension \texttt{.tex}.
+
+As a side effect of the new implementation this has now changed and
+the argument of \cs{include} now gets the extension \texttt{.tex}
+removed if it was used. Thus \verb=\include{mychap.tex}= now loads
+\file{mychap.tex} and no longer looks for \file{mychap.tex.tex}.
+%
+\githubissue{486}
+
\subsection{\cs{end}\texttt{\textbraceleft document\textbraceright}
should always start in v-mode}
@@ -139,8 +236,32 @@ the name. The coding has now been slightly altered to allow for this.
\githubissue{427}
+\subsection{Add a Lua callback to \pkg{ltshipout} to provide
+ a uniform location for applying custom attributes}
-\subsection{Provide hook in \cs{selectfont}}
+Just before shipping out a page, a new \LuaTeX{} callback
+\texttt{pre\_shipout\_filter} is now called to allow final
+adjustments to the box to be shipped out. This is particularly for
+Lua\TeX\ packages which flag certain elements of the page (e.g. using
+attributes or properties) in order to apply certain effects to these
+elements at shipout. An example for this is the \pkg{luacolor}
+package which could insert the color commands using this callback.
+
+
+\subsection{Improved copy\&paste support for \pdfTeX{} documents}
+
+When compiling with \pdfTeX{}, additional information is added to the
+PDF file to improve copying from and searching in text. This especially
+allows ligatures to copy correctly from \pdfTeX{} generated PDF files in
+most cases.
+
+Since this has been integrated into the kernel, most documents should no
+longer need to load the \pkg{cmap} package or input \texttt{glyphtounicode}.
+%
+\githubissue{465}
+
+
+\subsection{Provide a hook in \cs{selectfont}}
After \cs{selectfont} has altered the font we run a hook so that
packages can make final adjustments. This functionality was originally
@@ -173,6 +294,163 @@ the preamble.
+\subsection{Shipping out a page while bypassing hooks}
+
+In the 2020 October release several hooks were added to the page
+shipout process, e.g., to add some background or foreground material
+to some or all pages. We now also added a \cs{RawShipout} command that
+bypasses most of these hooks during the shipout. Some essential
+internal bookkeeping still takes place such as updating the
+\texttt{totalpages} counter or adding \texttt{shipout/firstpage} or
+\texttt{shipout/lastpage} material if the page happens to be the first
+or last.
+
+\subsection{Robust commands in filename arguments}
+The filename handling has been modified so that \verb|\string| is
+applied while normalizing robust commands while determining the file
+name. Previously \verb|\input{\sqrt{2}}| would cause \LaTeX\ to loop indefinitely.
+With the new behavior it accesses \verb|sqrt {2}.tex|.
+%
+\githubissue{481}
+
+
+\subsection{Additional support for Unicode characters from the
+ Latin Extended Additional block}
+
+\LaTeX\ is quite capable of typesetting characters such as
+\enquote{\d{m}}, but until now it lacked the Unicode mappings for some
+characters that are used to write Sanskrit words in Latin
+transliteration (as seen in books about yoga, Buddhist philosophy,
+etc.). These have now been added so that such characters can be
+entered directly instead of resorting to \verb=\d{m}= and so forth.
+%
+\githubissue{484}
+
+
+\subsection{Always have color groups set up}
+
+To use color in \LaTeX{} certain constructs, especially boxes, need an
+extra layer of groups to ensure that the color setting does not
+\emph{escape} and continue outside the box when it shouldn't. To
+arrange for this the \LaTeX{} kernel defined a number of commands, e.g.,
+\cs{color@begingroup} to be used in such places. They have been
+initially no-ops and only the color packages redefined them to become
+real groups. This arrangement complicates the coding as one has to
+account for a group being there (or not there) depending of what is
+loaded in the document. So now the kernel already adds the groups.
+%
+\githubissue{488}
+
+
+\subsection{Execute \cs{par} at the end of \cs{marginpar} arguments}
+
+In preparation for tagged PDF it is important to properly tag all
+paragraphs and this requires running code at the beginning and end of
+each. At the end of a paragraph this is done inside the \cs{par}
+command, but the way \cs{marginpar} was coded, \LaTeX{} ended the
+marginal note without ever explicitly calling \cs{par}. This has now
+been changed.
+%
+\githubissue{489}
+
+
+
+\subsection{Producing several footnote marks to one footnote}
+
+It is sometimes necessary to reference the same footnote several
+times, i.e., produce several footnote marks with the same number or
+symbol. This is now always possible by placing a \cs{label} into the
+\cs{footnote} and reference it with the command \cs{footref}
+elsewhere. This way marks refering to footnotes anywhere on the page
+(including those in \texttt{minipage}s) can be generated. In the past
+this command was only available with certain classes or when loading
+the \pkg{footmisc} package.
+%
+\githubissue{482}
+
+
+
+\subsection{Providing the raw option list of packages or documentclass to key/value handlers}
+
+\LaTeXe{} has always normalized space in option lists so\\
+\verb|\documentclass[ a4paper , 12pt ]{article}|\\
+processed the intended options \texttt{a4paper} and \texttt{12pt}.
+
+Unfortunately the mechanism used was designed for the simple option
+names of the standard option processing. Many classes and packages
+now use extended \emph{keyval} processing, however this white space
+normalisation makes this difficult:
+\verb|[bb=1 2 3 4]|
+which might be expected to pass a bounding box of four numbers is
+normalised to \texttt{bb=1234} and
+\verb|[bb={1 2 3 4}]|\\
+which might be expected to quote the spaces results in low level \TeX{}
+parsing errors.
+
+
+For compatibility reasons, the standard option processing has not been
+changed however the original un-normalised package and class option lists
+are now saved. They are not used in the standard processing, however
+extended package option systems may use these \enquote{raw} option list
+macros if they are defined.
+
+The one change affecting the standard processing is that the low level
+error mentioned above is now avoided as values (any tokens to the
+right of an = sign) are removed from consideration from the \enquote{unused
+option list}. In this release \texttt{clip=true} and
+\texttt{clip=false} both contribute \texttt{clip} to the list of
+options that have been used.
+%
+\githubissue{85}
+
+
+
+\subsection{Poor man's \cs{textasteriskcentered} if missing}
+
+The \cs{textasteriskcentered} symbol, used as part of the set of
+footnote symbols in \LaTeX{}, is assumed to be implemented by
+every font in the \texttt{TS1} encoding (when \pdfTeX{} is used) or
+in the \texttt{TU} encoding for the Unicode engines. Unfortunately,
+that assumption is not correct for all fonts, for example, for the
+\texttt{stix2} fonts don't offer the glyph, with the result that one
+gets missing glyphs when using \cs{thanks} etc.
+
+For that reason the definition for \cs{textasteriskcentered} was
+altered to check if there is a glyph in the right position and if not
+a normal \enquote{*} is used, slightly enlarged and lowered. That may
+not be perfect in all cases, but certainly better than nothing show
+up.
+%
+\githubissue{502}
+
+
+
+\subsection{Provide more ``dashes'' in encodings \texttt{OT1}, \texttt{T1} and \texttt{TU}}
+
+When pasting in text from external sources one sometimes encounters the Unicode characters
+%
+\texttt{"2011} (non-breaking hyphen),
+\texttt{"2012} (figure dash) and
+\texttt{"2015} (horizontal bar)
+%
+in addition to the common \texttt{"2013} (en-dash) and \texttt{"2014}
+(em-dash). In the past the first three characters produced an error
+message when used with \pdfTeX{}. Now they typeset an approximation
+(as they are unavailable in \texttt{OT1} or \texttt{T1} encoded fonts
+used by \pdfTeX{}), e.g., the figure dash is approximated by an en-dash.
+
+In Unicode engines they either work (if contained in the selected
+Unicode font) or typeset nothing and produce a ``Missing character''
+warning in the log file.
+
+However, what works in all engines now, is to access the characters
+via the command names \cs{textnonbreakinghyphen}, \cs{textfiguredash}
+and \cs{texthorizontalbar}, respectively.
+%
+\githubissue{404}
+
+
+
\subsection{\ldots}
\emph{to be written}
@@ -181,7 +459,6 @@ the preamble.
-
\section{Changes to packages in the \pkg{graphics} category}
\subsection{\ldots}
@@ -193,10 +470,23 @@ the preamble.
\section{Changes to packages in the \pkg{tools} category}
-\subsection{\ldots}
+\subsection{\pkg{layout}: Support Japanese as a language option}
+The package now recognizes \texttt{japanese} as a language option.
+%
+\githubissue{353}
+
+
+\subsection{\pkg{longtable}: General bug fix update}
+Minor update to \pkg{longtable} to fix bugs reported. Notably the
+possibility of incorrect page breaks if floats appear on the same page
+that a \env{longtable} starts. As this may affect page breaking in
+existing documents, a rollback to \pkg{longtable 4.13}
+(\file{longtable-2020-01-07.sty}) is supported.
%
-\githubissue{xxx}
+\gnatsissue{tools}{3512}
+
+
@@ -208,16 +498,23 @@ the preamble.
\githubissue{xxx}
+\medskip
+\begin{thebibliography}{9}
+
+\fontsize{9.3}{11.3}\selectfont
+
+\bibitem{33:blueprint} Frank Mittelbach and Chris Rowley:
+ \emph{\LaTeX{} Tagged PDF — A blueprint for a large project}.\\
+ \url{https://latex-project.org/publications/indexbyyear/2020/}
+\end{thebibliography}
-\end{document}
+\end{document}
-\medskip
-\begin{thebibliography}{9}
-\fontsize{9.3}{11.3}\selectfont
+\endinput % needed for ltnews processing
\bibitem{32:ltnews31} \LaTeX{} Project Team:
\emph{\LaTeXe{} news 31}.\\
@@ -236,5 +533,5 @@ the preamble.
\emph{Babel---Localization and internationalization}.\\
\url{https://www.ctan.org/pkg/babel}
-\end{thebibliography}
+
diff --git a/macros/latex-dev/base/ltoutenc.dtx b/macros/latex-dev/base/ltoutenc.dtx
index 4eea0ad41e..73146428c0 100644
--- a/macros/latex-dev/base/ltoutenc.dtx
+++ b/macros/latex-dev/base/ltoutenc.dtx
@@ -1,7 +1,7 @@
% \iffalse meta-comment
%
% Copyright (C) 1993-2021
-% The LaTeX3 Project and any individual authors listed elsewhere
+% The LaTeX Project and any individual authors listed elsewhere
% in this file.
%
% This file is part of the LaTeX base system.
@@ -37,14 +37,14 @@
%<TS1>\ProvidesFile{ts1enc.def}[2001/06/05 v3.0e (jk/car/fm)
%<TU>\ProvidesFile{tuenc.def}
%<package>\ProvidesPackage{fontenc}
-%<OT1|T1|OMS|OML|OT4|TU|package> [2020/08/10 v2.0s
+%<OT1|T1|OMS|OML|OT4|TU|package> [2021/02/19 v2.0u
%<OT1|T1|OMS|OML|OT4|TS1|TU> Standard LaTeX file]
%<package> Standard LaTeX package]
%
%<*driver>
% \fi
\ProvidesFile{ltoutenc.dtx}
- [2020/12/05 v2.0s LaTeX Kernel (font encodings)]
+ [2021/02/19 v2.0u LaTeX Kernel (font encodings)]
% \iffalse
\documentclass{ltxdoc}
\GetFileInfo{ltoutenc.dtx}
@@ -1717,6 +1717,17 @@
\DeclareTextSymbol{\textemdash}{OT1}{124}
\DeclareTextSymbol{\textendash}{OT1}{123}
% \end{macrocode}
+%
+% The \verb=\nobreak\hskip\z@= is there to prevent a break after
+% the hyphen but allow later breaks in the remainder of the word.
+% \changes{v2.0u}{2021/02/19}{Add \cs{textnonbreakinghyphen}, \cs{textfiguredash}
+% and \cs{texthorizontalbar} (gh/404)}
+% \begin{macrocode}
+\DeclareTextCommand{\textnonbreakinghyphen}{OT1}{\mbox{-}\nobreak\hskip\z@}
+\DeclareTextCommand{\textfiguredash} {OT1}{\textendash}
+\DeclareTextCommand{\texthorizontalbar} {OT1}{\textemdash}
+% \end{macrocode}
+%
% Using the ligatures helps with OT1 fonts that have
% |\textexclamdown| and |\textquestiondown| in unusual positions.
% \changes{v1.95}{2002/06/17}{Definition of \cs{textexclamdown} changed (pr/3368)}
@@ -2045,6 +2056,19 @@
\DeclareTextSymbol{\textdollar}{T1}{`\$}
\DeclareTextSymbol{\textemdash}{T1}{22}
\DeclareTextSymbol{\textendash}{T1}{21}
+% \end{macrocode}
+%
+% The \verb=\nobreak\hskip\z@= is there to prevent a break after
+% the hyphen but allow later breaks in the remainder of the word.
+% \changes{v2.0u}{2021/02/19}{Add \cs{textnonbreakinghyphen}, \cs{textfiguredash}
+% and \cs{texthorizontalbar} (gh/404)}
+% \begin{macrocode}
+\DeclareTextCommand{\textnonbreakinghyphen}{T1}{\mbox{-}\nobreak\hskip\z@}
+\DeclareTextCommand{\textfiguredash} {T1}{\textendash}
+\DeclareTextCommand{\texthorizontalbar} {T1}{\textemdash}
+% \end{macrocode}
+%
+% \begin{macrocode}
\DeclareTextSymbol{\textexclamdown}{T1}{189}
\DeclareTextSymbol{\textgreater}{T1}{`\>}
%\DeclareTextSymbol{\texthyphenchar}{T1}{127}
@@ -2583,8 +2607,31 @@
\DeclareTextSymbol{\textquotesingle}{TS1}{39}
% \end{macrocode}
% "28 = 40
-% \begin{macrocode}
-\DeclareTextSymbol{\textasteriskcentered}{TS1}{42}
+%
+% The symbol \cs{textasteriskcentered} ``\textasteriskcentered'' is
+% supposed to be always available in \texttt{TS1} and that is
+% important as it is used in footnote symbols. However, in a few
+% fonts it is missing even though they are otherwise fairly
+% complete. We therefore use a rather elaborate method and check if
+% the slot has a glyph and if not produce a poor man's version by
+% using a normal ``*'' slightly enlarged and somewhat lowered.
+% The main application for this symbol is in footnote symbols and
+% there it should produce a comparable size and show a similar placement.
+% \changes{v2.0t}{2021/02/17}{Special definition for
+% \cs{textasteriskcentered} when missing in TS1 (gh/502)}
+% \begin{macrocode}
+%\DeclareTextSymbol{\textasteriskcentered}{TS1}{42} % that's wanted
+\DeclareTextCommand \textasteriskcentered{TS1}{% % and that's needed
+ \iffontchar\font 42 \char42 \else
+ \begingroup\fontencoding{T1}%
+ \fontsize
+ {\the\dimexpr1.3\dimexpr\f@size pt\relax}%
+ {\f@baselineskip}%
+ \selectfont
+ \raisebox{-0.7ex}[\dimexpr\height-0.7ex][0pt]{*}%
+ \endgroup
+ \fi
+}
% \end{macrocode}
% Note that '054 is a comma and '056 is a full stop: these make
% numbers using oldstyle digits easier to input.
@@ -3106,8 +3153,34 @@
\DeclareTextSymbol{\textbaht} \UnicodeEncodingName{"0E3F}
\DeclareTextSymbol{\SS} \UnicodeEncodingName{"1E9E}
\DeclareTextSymbol{\textcompwordmark} \UnicodeEncodingName{"200C}
+% \end{macrocode}
+%
+% \changes{v2.0u}{2021/02/19}{Add \cs{textnonbreakinghyphen}, \cs{textfiguredash}
+% and \cs{texthorizontalbar} (gh/404)}
+% \begin{macrocode}
+%\DeclareTextSymbol{\textnonbreakinghyphen} \UnicodeEncodingName{"2011}
+%\DeclareTextSymbol{\textfiguredash} \UnicodeEncodingName{"2012}
\DeclareTextSymbol{\textendash} \UnicodeEncodingName{"2013}
\DeclareTextSymbol{\textemdash} \UnicodeEncodingName{"2014}
+%\DeclareTextSymbol{\texthorizontalbar} \UnicodeEncodingName{"2015}
+% \end{macrocode}
+% Unfortunately some fonts do not implement \texttt{"2011}, \texttt{"2012} and/or
+% \texttt{"2015} (including the \LaTeX{} default fonts for Unicode
+% engines) so we provide some approximations if the glyph is
+% missing, like we do for \texttt{OT1} and \texttt{T1}.
+%
+% The \verb=\nobreak\hskip\z@= is there to prevent a break after
+% the hyphen but allow later breaks in the remainder of the word.
+% \begin{macrocode}
+\DeclareTextCommand{\textnonbreakinghyphen} \UnicodeEncodingName
+ {\iffontchar\font "2011 \char "2011 \else \mbox{-}\nobreak\hskip\z@ \fi}
+\DeclareTextCommand{\textfiguredash} \UnicodeEncodingName
+ {\iffontchar\font "2012 \char "2012 \else \char "2013 \fi}
+\DeclareTextCommand{\texthorizontalbar} \UnicodeEncodingName
+ {\iffontchar\font "2015 \char "2015 \else \char "2014 \fi}
+% \end{macrocode}
+%
+% \begin{macrocode}
\DeclareTextSymbol{\textbardbl} \UnicodeEncodingName{"2016}
\DeclareTextSymbol{\textquoteleft} \UnicodeEncodingName{"2018}
\DeclareTextSymbol{\textquoteright} \UnicodeEncodingName{"2019}
@@ -3159,15 +3232,17 @@
% \end{macrocode}
%
% Not all fonts have U+2217 but using U+002A requires some adjustment.
+% \changes{v2.0t}{2021/02/17}{Adjust values for
+% \cs{textasteriskcentered} To match TS1 definition (gh/502)}
% \begin{macrocode}
\DeclareTextCommand{\textasteriskcentered}\UnicodeEncodingName{%
\iffontchar\font"2217 \char"2217 \else
\begingroup
\fontsize
- {\the\dimexpr1.2\dimexpr\f@size pt\relax}%
+ {\the\dimexpr1.3\dimexpr\f@size pt\relax}%
{\f@baselineskip}%
\selectfont
- \raisebox{-0.6ex}[\dimexpr\height-0.6ex][0pt]{*}%
+ \raisebox{-0.7ex}[\dimexpr\height-0.7ex][0pt]{*}%
\endgroup
\fi
}
diff --git a/macros/latex-dev/base/ltoutenc.ins b/macros/latex-dev/base/ltoutenc.ins
index 23c27697f8..1330b5c44e 100644
--- a/macros/latex-dev/base/ltoutenc.ins
+++ b/macros/latex-dev/base/ltoutenc.ins
@@ -4,7 +4,7 @@
%% LaTeX or TeX.
%%
%% Copyright (C) 1993-2021
-%% The LaTeX3 Project and any individual authors listed elsewhere
+%% The LaTeX Project and any individual authors listed elsewhere
%% in this file.
%%
%% This file is part of the LaTeX base system.
@@ -49,7 +49,7 @@ reports for it can be opened at https://latex-project.org/bugs.html
Copyright (C) 1993-2021
-The LaTeX3 Project and any individual authors listed elsewhere
+The LaTeX Project and any individual authors listed elsewhere
in this file.
This file was generated from file(s) of the LaTeX base system.
diff --git a/macros/latex-dev/base/ltoutput.dtx b/macros/latex-dev/base/ltoutput.dtx
index f418459f66..69bfa1f036 100644
--- a/macros/latex-dev/base/ltoutput.dtx
+++ b/macros/latex-dev/base/ltoutput.dtx
@@ -1,7 +1,7 @@
% \iffalse meta-comment
%
% Copyright (C) 1993-2021
-% The LaTeX3 Project and any individual authors listed elsewhere
+% The LaTeX Project and any individual authors listed elsewhere
% in this file.
%
% This file is part of the LaTeX base system.
@@ -57,7 +57,7 @@
% \iffalse
% LATEX VERSION 2e
% Copyright (C) 1992 by Leslie Lamport
-% Copyright (C) 1994-2000 by Leslie Lamport, LaTeX3 project
+% Copyright (C) 1994-2000 by Leslie Lamport, LaTeX Project
%
% LaTeX 2e kernel file for the output routine.
%
diff --git a/macros/latex-dev/base/ltpage.dtx b/macros/latex-dev/base/ltpage.dtx
index ce6681e7e0..4504033f54 100644
--- a/macros/latex-dev/base/ltpage.dtx
+++ b/macros/latex-dev/base/ltpage.dtx
@@ -1,7 +1,7 @@
% \iffalse meta-comment
%
% Copyright (C) 1993-2021
-% The LaTeX3 Project and any individual authors listed elsewhere
+% The LaTeX Project and any individual authors listed elsewhere
% in this file.
%
% This file is part of the LaTeX base system.
diff --git a/macros/latex-dev/base/ltpageno.dtx b/macros/latex-dev/base/ltpageno.dtx
index 80055c7c5d..03d36a53d9 100644
--- a/macros/latex-dev/base/ltpageno.dtx
+++ b/macros/latex-dev/base/ltpageno.dtx
@@ -1,7 +1,7 @@
% \iffalse meta-comment
%
% Copyright (C) 1993-2021
-% The LaTeX3 Project and any individual authors listed elsewhere
+% The LaTeX Project and any individual authors listed elsewhere
% in this file.
%
% This file is part of the LaTeX base system.
diff --git a/macros/latex-dev/base/ltpar.dtx b/macros/latex-dev/base/ltpar.dtx
index 169954f9ea..f4f3d5e63f 100644
--- a/macros/latex-dev/base/ltpar.dtx
+++ b/macros/latex-dev/base/ltpar.dtx
@@ -1,7 +1,7 @@
% \iffalse meta-comment
%
% Copyright (C) 1993-2021
-% The LaTeX3 Project and any individual authors listed elsewhere
+% The LaTeX Project and any individual authors listed elsewhere
% in this file.
%
% This file is part of the LaTeX base system.
diff --git a/macros/latex-dev/base/ltpara-code.pdf b/macros/latex-dev/base/ltpara-code.pdf
new file mode 100644
index 0000000000..cee442360d
--- /dev/null
+++ b/macros/latex-dev/base/ltpara-code.pdf
Binary files differ
diff --git a/macros/latex-dev/base/ltpara-code.tex b/macros/latex-dev/base/ltpara-code.tex
new file mode 100644
index 0000000000..2e5beda31c
--- /dev/null
+++ b/macros/latex-dev/base/ltpara-code.tex
@@ -0,0 +1,4 @@
+% this will typeset documentation + code
+
+\AtBeginDocument{\AlsoImplementation}
+\input{ltpara.dtx}
diff --git a/macros/latex-dev/base/ltpara-doc.pdf b/macros/latex-dev/base/ltpara-doc.pdf
new file mode 100644
index 0000000000..a264538a99
--- /dev/null
+++ b/macros/latex-dev/base/ltpara-doc.pdf
Binary files differ
diff --git a/macros/latex-dev/base/ltpara-doc.tex b/macros/latex-dev/base/ltpara-doc.tex
new file mode 100644
index 0000000000..c3892b8180
--- /dev/null
+++ b/macros/latex-dev/base/ltpara-doc.tex
@@ -0,0 +1,6 @@
+% this will typeset only documentation but not the code
+
+\AtBeginDocument{\OnlyDescription
+ \let\tableofcontents\relax
+ }
+\input{ltpara.dtx}
diff --git a/macros/latex-dev/base/ltpara.dtx b/macros/latex-dev/base/ltpara.dtx
new file mode 100644
index 0000000000..1a3df95a6e
--- /dev/null
+++ b/macros/latex-dev/base/ltpara.dtx
@@ -0,0 +1,1159 @@
+% \iffalse meta-comment
+%
+%% File: ltpara.dtx (C) Copyright 2020-2021
+% Frank Mittelbach, LaTeX Team
+%
+% It may be distributed and/or modified under the conditions of the
+% LaTeX Project Public License (LPPL), either version 1.3c of this
+% license or (at your option) any later version. The latest version
+% of this license is in the file
+%
+% https://www.latex-project.org/lppl.txt
+%
+%
+%%% From File: lthooks.dtx
+%
+% \begin{macrocode}
+\def\ltparaversion{v1.0d}
+\def\ltparadate{2021/02/18}
+% \end{macrocode}
+%<*driver>
+\documentclass{l3doc}
+
+%\usepackage{ltpara}
+
+% Fixing footnotes in functions and variables: this should be in l3doc!
+\newcommand\fixfootnote[2]{\footnotemark
+ \AddToHookNext{env/#1/after}{\footnotetext{#2}}}
+\AddToHook{env/function/begin}{\def\footnote{\fixfootnote{function}}}
+\AddToHook{env/variable/begin}{\def\footnote{\fixfootnote{variable}}}
+
+\EnableCrossrefs
+\CodelineIndex
+\begin{document}
+ \DocInput{ltpara.dtx}
+\end{document}
+%</driver>
+%
+% \fi
+%
+% \providecommand\hook[1]{\texttt{#1}}
+% \providecommand\env[1]{\texttt{#1}}
+%
+%
+%
+% \title{The \texttt{ltpara.dtx} code\thanks{This file has version
+% \ltparaversion\ dated \ltparadate, \copyright\ \LaTeX\
+% Project.}}
+% \author{Frank Mittelbach}
+%
+% \maketitle
+%
+%
+% \begin{abstract}
+% This code defines four special kernel hooks to support paragraph
+% tagging as well as four public hooks which can be occasionally
+% useful.
+% \end{abstract}
+%
+% \tableofcontents
+%
+%
+% \section{Introduction}
+%
+%
+% The building of paragraphs in the \TeX{} engine(s) has a number
+% of peculiarities that makes it on one hand fairly flexible but on
+% the other hand somewhat awkward to control or reliably to extend.
+% Thus to better understand the code below we start with a brief introduction
+% of the mechanism; for more details refer to the
+% \TeX{}book~\cite[chap.~14]{texbook} (for the full truth you may
+% even have to study the program code).
+%
+% \subsection{The default processing done by the engine}
+%
+% \TeX{} automatically starts building a paragraph when it is
+% currently in vertical mode and encounters anything that can only
+% live in horizontal mode. Most often this is a character, but
+% there are also many commands that can be used only in horizontal mode.
+% If any of them is encountered, \TeX{} will immediately back up
+% (i.e., the character or command is read later again), adds a
+% \cs{parskip} glue to the current vertical list unless the list is
+% empty, switches to
+% horizontal mode, starts its special \enquote{start of paragraph
+% processing} and only then rereads the character or command that
+% caused the mode change.\footnote{Already not quite true: the
+% command \cs{noindent} starts the paragraph but influences the
+% special processing by suppressing the paragraph indentation box
+% normally inserted by it.}
+%
+% This \enquote{start of paragraph
+% processing} first adds an empty box at the start of the
+% horizontal list of width \cs{parindent} (which represents the
+% paragraph indentation) unless the paragraph was started with
+% \cs{noindent} in which case no such box is
+% added\footnote{That's a bit different from placing a zero-sized
+% box!}. It then reads and processes all tokens stored in the
+% special engine token register \cs{everypar}. After that it reads
+% and processes whatever has caused the paragraph to start.
+%
+% Thus out of the box, \TeX{} offers the possibility to put some
+% special code into \cs{everypar} to gain control at (more or less)
+% the start of the paragraph. For example, in LaTeX{} and a number
+% of packages, special code like the following is sometimes used:
+%\begin{verbatim}
+% \everypar{{\setbox\z@\lastbox}\everypar{} ...}
+%\end{verbatim}
+% This removes the paragraph indentation box again (that was already
+% placed by \TeX), then resets \cs{everypar} so that it doesn't do
+% anything on the next paragraph start and then does whatever it
+% wants to do, e.g., in an \cs{item} of a list it will typeset the label in
+% front of the paragraph text.
+% However, there is only one such \cs{everypar} token register and
+% if different packages and/or the kernel all attempt to add their
+% own code here, coordination is very difficult if not impossible.
+%
+% The process when the paragraph ends has different mechanisms and interfaces.
+% A paragraph ends when the engine primitive \cs{par} is called
+% while \TeX{} is in unrestricted horizontal mode, i.e., is
+% building a paragraph. At other times this primitive does nothing
+% or generates as an error depending on the mode \TeX{} is in,
+% e.g., the \cs{par} in
+% \verb=\hbox{a\par b}= is ignored, but \verb=$a\par b$= would complain.
+%
+% If this primitive ends the paragraph it does some special
+% \enquote{end of horizontal list} processing, then calls \TeX{} paragraph
+% builder that breaks the horizontal list into lines then these
+% lines are added as boxes to the enclosing vertical list and
+% \TeX{} returns to vertical mode.
+%
+% This \cs{par} command can be given explicitly, but there are also
+% situations in which \TeX{} is generating it on the fly. Most
+% often this happens when \TeX\ encounters a blank line which is
+% automatically changed to a \cs{par} command which is then
+% executed. The other possibility is that \TeX{} encounters a
+% command which is incompatible with horizontal processing, e.g.,
+% \cs{vskip} (a request for adding vertical space). In such case it
+% silently backs up, and inserts a \cs{par} in the hope that this
+% gets it out of horizontal mode and makes the offending command
+% acceptable.
+
+% The important point to note here is that \TeX{} really inserts
+% the command \cs{par} which can be redefined. Thus, it may not have
+% its original \enquote{primitive} meaning and therefore may not end the
+% horizontal list and call the paragraph builder. This approach
+% offers some flexibility but also allows you to easily produce a
+% \TeX{} document that loops forever, for example, the simple line
+%\begin{verbatim}
+% A \let\par\relax \vskip
+%\end{verbatim}
+% will start a horizontal list at \texttt{A}, redefines \cs{par},
+% then sees \cs{vskip} and inserts \cs{par} to end the
+% paragraph. But this now only runs \cs{relax} so nothing changes
+% and \cs{vskip} is read again, issues a \cs{par} which \ldots. In
+% short, it takes a plain \TeX{} document with five tokens to run
+% forever (as not even memory is consumed and therefore eventually
+% exhausted).
+%
+% There are no other ways than changing \cs{par} to gain control at
+% the end of a paragraph, i.e., there is no token list like
+% \cs{everypar} that is inserted, i.e., the only way to change the
+% default behavior is to modify the action that \cs{par} executes
+% with similar issues as outlined before: different processes need
+% to ensure that they do not overwrite their modifications or
+% worse, think that the \cs{par} in front of them is the engine
+% primitive while in fact it has already been changed by other
+% code.
+%
+%
+% To make matters slightly worse there are a few places where
+% \TeX{} handles the situation differently (most likely for speed
+% reasons back when computers were much slower). If \TeX{} finds
+% itself in unrestricted horizontal mode at the end of building a
+% vertical box (or an \cs{insert}, \cs{vadjust} or at the end of
+% executing the output routine code), it will finish the horizontal
+% list not by issuing a \cs{par} command (which would be consistent
+% with all other places, but by simply executing the primitive version
+% of \cs{par} regardless of the definition that \cs{par} has at the
+% time.
+%
+% Thus, if you have carefully crafted a redefined \cs{par} to execute
+% some special actions at the end of a paragraph and you write
+% something like
+%\begin{verbatim}
+% \vbox{Some paragraph ... text.}
+%\end{verbatim}
+% you will find that your code has never run for the last paragraph
+% in that box. \LaTeX{} avoids this problem, by making sure that
+% all its boxes (such as \cs{parbox} or the \env{minipage}
+% environment, etc.) all internally add an explicit \cs{par} at the
+% end so that such code is run and \TeX{} finds itself in vertical
+% mode already without the need to start up the paragraph builder
+% internally. But, of course, this only works for boxes under direct
+% control of the \LaTeX{} kernel, if some package uses low-level
+% \cs{vbox}es without adding this precaution the \TeX{}
+% optimization kicks in and no special \cs{par} code is executed.
+%
+% And there is another optimization that is painful: if a paragraph
+% is interrupted by a mathematical display, e.g., \verb=\[...\]= in
+% \LaTeX{} or \verb=$$...$$= in plain \TeX{}, then \TeX{} will
+% resume horizontal mode afterward, i.e., build a new horizontal
+% list (without inserting an indentation box or \cs{everypar} at
+% that point). However, if that list immediately ends with an
+% explicit or implicit \cs{par} then \TeX{} will simply throw away
+% this \enquote{null} paragraph and not do its usual \enquote{end
+% of horizontal list} processing, so this special case need to be
+% accounted for when introducing some extended processing.
+%
+%
+%
+% \section{The new mechanism implemented for \LaTeX{}}
+%
+% To improve the situation (and also to support automatic tagging
+% of PDF documents) we now offer public as well as private hooks at
+% the start and end of the paragraph processing. The public hooks
+% can be used by packages (or by the user in the preamble or
+% within the document) and using the hook mechanisms it is possible
+% to reorder or arrange code from different packages in a way that
+% it can safely coexist.
+%
+% To make that happen we have to make use of the basic
+% functionality that is offered by \TeX{}, e.g., we install
+% special code inside \cs{everypar} to provide hooks at the
+% beginning and we redefine \cs{par} to do some special processing
+% when appropriate to install hooks at the end of the paragraph.
+%
+% In order to make this work, we have to ensure that package use of
+% \cs{everypar} is not overwriting our code. This is done through a
+% trick: we basically hide the real \cs{everypar} from the packages
+% and offer them a new token register (with the same name). So if
+% they install their own code it doesn't overwrite ours. Our code
+% then inserts the new \cs{everypar} at the right place inside the
+% process so that it looks as if it was the primitive
+% \cs{everypar}.\footnote{Ideally, \cs{everypar} wouldn't be used
+% at all by packages and instead they would simply write their code
+% into the hooks now offered by the kernel. However, while this is
+% the longterm goal and clearly an improvement (because then the
+% packages do no longer need to worry about getting their code
+% overwritten or needing to account for already existing code in
+% \cs{everypar}), this will not happen overnight. For that reason
+% support for this legacy method is retained.}
+%
+% At the end of the paragraph it would be great if we could use a
+% similar trick. However, due to the fact that \TeX{} inserts the
+% token \cs{par} (that doesn't have a defined meaning) we can't hide
+% \enquote{the real thing\textsuperscript{TM}} and offer the
+% package an indistinguishable alternate.
+%
+% Fortunately, \LaTeX{} has already redefined \cs{par} for its own
+% purposes. As a result there aren't many packages that attempt to
+% change \cs{par}, because without a lot of extra care that would
+% fail miserably. But bottom line, if you load a package that
+% alters \cs{par} then the end of paragraph hooks are most likely
+% not executing while that redefinition is
+% active.\footnote{Similarly to the \cs{everypar} situation, the
+% remedy is that such packages stop doing this and instead add
+% their alterations into the paragraph hooks now provided.}
+%
+%
+%
+% \subsection{The provided hooks}
+%
+%
+% \begin{variable}{para/before,
+% para/begin,
+% para/end,
+% para/after
+% }
+% The following four public hooks are defined and executed for
+% each paragraph:
+% \begin{description}
+%
+% \item[\hook{para/before}]
+%
+% This hook is executed after the kernel hook
+% \cs{@kernel@before@para@before} (discussed below) in vertical
+% mode immediately after \TeX{} has contributed \cs{parskip} to
+% the vertical list and before the actual paragraph processing in
+% horizontal mode starts.
+%
+% This hook should either not produce any typeset material or add
+% only vertical material. If it starts a paragraph an error is
+% generated. The reason is that we are in the starting process of
+% processing a paragraph and so this would lead to endless
+% recursion.\footnote{One could allow it but only if the newly
+% started paragraph is processed without any hooks. Furthermore
+% correct spacing would be a bit of a nightmare so for now this
+% is forbidden.}
+%
+% \end{description}
+% \end{variable}
+%
+% \vspace{-\bigskipamount}
+%
+% \begin{description}
+%
+% \item[\hook{para/begin}]
+%
+% This hook is executed after the kernel hook
+% \cs{@kernel@before@para@begin} (discussed below) in horizontal
+% mode immediately before the indentation box is placed (if there
+% is any, i.e., if the paragraph hasn't been started with
+% \cs{noindent}).
+%
+% The indentation box to be typeset is available to the hook as
+% \cs{IndentationBox} and its automatic placement (after the hook is
+% executed) can be prevented through \cs{SuppressIndentationBox}.
+%
+% If not suppressed, then the indentation is typeset directly
+% after the hook execution by something equivalent to
+% \cs{box}\cs{IndentationBox} followed by the current content of
+% the token register \cs{everypar} as it is available to the
+% kernel or to packages (that run some legacy code).
+%
+% One has to be careful not to add any code to the hook that
+% starts its own paragraph (e.g., by adding a \cs{parbox} or a
+% \cs{marginpar} inside) because that would call the hook inside
+% again (as a new paragraph is started there) and thus lead to an
+% endless recursion ending only after exhausting the available
+% memory. This can only be done by making sure that is not
+% executed for the inner paragraphs (or at least not recursively
+% forever).
+%
+%
+% \item[\hook{para/end}]
+%
+% This hook is executed at the end of a paragraph when \TeX{} is
+% ready to return to vertical mode and after it has removed the
+% last horizontal glue (but not kern) placed on the horizontal
+% list. The code is still executed in horizontal mode so it is
+% possible to add further horizontal material at this point, but
+% it should not alter the mode (even a temporary exit from
+% horizontal mode would create chaos---any attempt will cause an
+% error message)! After the hook has ended the kernel hook
+% \cs{@kernel@after@para@end} is executed and then \TeX{} returns to
+% vertical mode.
+%
+% The hook is offered as public hook, but because of the
+% requirement to stay within horizontal mode one needs to be
+% careful in what is placed into the hook.\footnote{Maybe we
+% should guard against that, but it would be rather tricky to
+% implement as mode changes can happen across group boundaries so
+% one would need to keep a private stack just for that. Well,
+% something to ponder.}
+%
+% This hook is implemented as a reversed hook.
+%
+% \item[\hook{para/after}]
+%
+% This hook is executed directly after \TeX{} has returned to
+% vertical mode and after any material that migrated out of the
+% horizontal list (e.g., from a \cs{vadjust}) has processed.
+%
+% This hook should either not produce any typeset material or add
+% only vertical material.
+% However, for this hook starting a new paragraph is not a
+% disaster so that it isn't prevented.
+%
+% This hook is implemented as a reversed hook.
+%
+% Once that hook code has been processed the kernel hook
+% \cs{@kernel@after@para@after} is executed as the final action
+% of the paragraph processing.
+%
+% \end{description}
+%
+% \begin{variable}{\@kernel@before@para@before,
+% \@kernel@after@para@after,
+% \@kernel@before@para@begin,
+% \@kernel@after@para@end,
+% }
+% As already mentioned above there are also four kernel hooks that
+% are executed at the start and end of the processing.
+% \begin{description}
+%
+% \item[\cs{@kernel@before@para@before}]
+% For future extensions, not currently used by the kernel.
+%
+
+% \item[\cs{@kernel@after@para@after}]
+% For future extensions, not currently used by the kernel.
+%
+%
+% \item[\cs{@kernel@before@para@begin}]
+%
+% Used by the kernel to implement tagging. This hook is executed
+% at the very beginning of a paragraph after \TeX{} has switched to
+% horizontal mode but before any indentation box got added or any
+% \cs{everypar} was run.
+%
+% It should not generate typeset material that could alter the
+% position. Note that it should never leave hmode, otherwise you
+% will end with a loop! We could guard against this, but since it
+% is an internal kernel hook that shouldn't be touched this isn't
+% checked.
+% \end{description}
+% \end{variable}
+%
+% \vspace{-\bigskipamount}
+%
+% \begin{description}
+%
+% \item[\cs{@kernel@after@para@end}]
+%
+% Used by the kernel to implement tagging. It is executed
+% directly after the public \hook{para/end} hook. After it there
+% is a quick check that we are still in horizontal mode, i.e.,
+% that the public hook has not mistakenly ended horizontal mode
+% prematurely (this is an incomplete check just testing the mode
+% and could perhaps be improved (at the cost of speed)).
+%
+% \end{description}
+%
+%
+% \subsection{Altered and newly provided commands}
+%
+% \begin{function}{\par,\endgraf,\para_end:}
+% An explicit request for ending a paragraph is known in plain
+% \TeX{} under the name \cs{endgraf} where it simply calls the
+% paragraph primitive (regardless of what \cs{par} may have as its
+% current definition). In \LaTeX{} \cs{endgraf} with that behavior
+% was also made available.
+%
+% With the new paragraph handling in \LaTeX{}, ending a paragraph
+% means a bit more than just calling the engine's paragraph
+% builder: the process also has to add any hook code for the end of
+% a paragraph. Thus
+% \cs{endgraf} was changed to provide this additional functionality
+% (and so by extension \cs{par} subject to its current meaning).
+%
+% The \pkg{expl3} name for the functionality is \cs{para_end:}.
+% \end{function}
+%
+% \begin{quote}
+% \textbf{Note:} \em The next two commands are still under
+% discussion and may slightly change their semantics (as described
+% in the document) and/or their names between now and the 2021
+% Spring release!
+% \end{quote}
+%
+% \begin{function}{\SuppressIndentationBox,\para_suppress_indentation:}
+% Inside the \hook{para/begin} hook one can use this command to
+% suppress the indentation box at the start of the
+% paragraph. (Technically it is possible to use this command
+% outside the hook as well, but this should not be relied upon.)
+% The box itself remains available for use.
+%
+% The \pkg{expl3} name for the function is \cs{para_suppress_indentation:}.
+% \end{function}
+%
+% \begin{variable}{\IndentationBox,\g_para_indentation_box}
+% The box register holding the indentation box for the paragraph is
+% available for inspection (or changes) inside hooks. It remains
+% available even if the \cs{SuppressIndentationBox} command was
+% used; in that case it will just not be automatically placed.
+%
+% The \pkg{expl3} name for the box register is \cs{g_para_indentation_box}.
+% \end{variable}
+%
+%
+%
+%
+% \subsection{Examples}
+%
+% None of the examples in this section are meant for real use as
+% they are far too simpleminded but they should give some ideas of
+% what could be possible if a bit more care is applied.
+%
+% \subsubsection{Testing the mechanism}
+%
+% The idea is to output for each paragraph encountered some
+% information: a paragraph sequence number, a level number in roman
+% numerals, the environment in which this paragraph appears, and
+% the line number where the start or end of the paragraph is, e.g.,
+% something like
+%\begin{verbatim}
+% PARA: 1-i start (document env. on input line 38)
+% PARA: 1-i end (document env. on input line 38)
+% PARA: 2-i start (document env. on input line 40)
+% PARA: 3-ii start (minipage env. on input line 40)
+% PARA: 3-ii end (minipage env. on input line 40)
+% PARA: 2-i end (document env. on input line 41)
+%\end{verbatim}
+% As you can see paragraph 2 starts on line 40 and ends on 41 and
+% inside a minipage started paragraph 3 (start and end on line 40).
+% If you run this on some document you will find that \LaTeX{}
+% considers more things \enquote{a paragraph} than you have
+% probably thought.
+%
+% This was generated by the following hook code:
+%\begin{verbatim}
+% \newcounter{paracnt} % sequence counter
+% \newcounter{paralevel} % level counter
+%\end{verbatim}
+%
+% To support paragraph nesting we need to maintain a stack of the
+% sequence numbers. This is most easily done using \pkg{expl3}
+% functions, so we switch over. This is not a very general
+% implementation, just enough for what we need and a bit of
+% \LaTeXe{} thrown in as well. When popping the result gets stored
+% in \cs{paracntvalue} and the \cs{ERROR} should never happen
+% because it means we have tried to pop from an empty stack.
+%\begin{verbatim}
+% \ExplSyntaxOn
+% \seq_new:N \g_para_seq
+% \cs_new:Npn \ParaPush
+% {\seq_gpush:No \g_para_seq {\the\value{paracnt}}}
+% \cs_new:Npn \ParaPop {\seq_gpop:NNF \g_para_seq \paracntvalue \ERROR }
+% \ExplSyntaxOff
+%\end{verbatim}
+% At the start of the paragraph increment both sequence counter and
+% level and also save the then current sequence number on our stack.
+%\begin{verbatim}
+% \AddToHook{para/begin}{%
+% \stepcounter{paracnt}\stepcounter{paralevel}%
+% \ParaPush
+%\end{verbatim}
+% To display the sequence number we \cs{typeout} the current
+% sequence and level number. The command \cs{@currenvir} gives us
+% the current environment and \cs{on@line} produces a space and
+% the current input line number.
+%\begin{verbatim}
+% \typeout{PARA: \arabic{paracnt}-\roman{paralevel} start
+% (\@currenvir\space env.\on@line)}%
+%\end{verbatim}
+% We also typeset the sequence number as a tiny red number in a box
+% that takes up no horizontal space. This helps us seeing where
+% \LaTeX{} sees the start and end of the paragraphs in the
+% document.
+%\begin{verbatim}
+% \llap{\color{red}\tiny\arabic{paracnt}\ }%
+% }
+%\end{verbatim}
+%
+% At the end of the paragraph we display sequence number and
+% level again. The level counter has the correct value but we need
+% to retrieve the right sequence value by popping it off the stack
+% after which it is available in \cs{paracntvalue} the way we have
+% set this up above.
+%\begin{verbatim}
+% \AddToHook{para/end}{%
+% \ParaPop
+% \typeout{PARA: \paracntvalue-\roman{paralevel} end \space\space
+% (\@currenvir\space env.\on@line)}%
+%\end{verbatim}
+% We also typeset again a tiny red number with that value, this
+% time sticking out to the right.\footnote{Note that this can alter
+% the document pagination, because a paragraph ending in a display
+% (e.g., an equation) will get an extra line---in that case our tiny number
+% has an effect even though it doesn't take up any space, because
+% it paragraph is no longer empty and thus isn't dropped!}
+% We also decrement the level counter since our level has finished.
+%\begin{verbatim}
+% \rlap{\color{red}\tiny\ \paracntvalue}%
+% \addtocounter{paralevel}{-1}%
+% }
+% \makeatother
+%\end{verbatim}
+%
+%
+%
+% \subsubsection{Mark the first paragraph of each \env{itemize}}
+%
+% The code for this is rather simple. We apply hook code that is
+% executed only once inside a hook that is executed at the begin of
+% each \env{itemize}. We explicitly change the color back and
+% forth so that we don't introduce grouping around the paragraph.
+%\begin{verbatim}
+% \AddToHook{env/itemize/begin}{%
+% \AddToHookNext{para/begin}{\color{blue}}%
+% \AddToHookNext{para/end}{\color{black}}%
+% }
+%\end{verbatim}
+% As a result the first paragraph of each \env{itemize} will appear
+% in blue.
+%
+%
+% \StopEventually{\setlength\IndexMin{200pt} \PrintIndex }
+%
+%
+% \section{The Implementation}
+%
+% \begin{macrocode}
+%<*2ekernel>
+% \end{macrocode}
+%
+% \begin{macrocode}
+%<@@=para>
+\ExplSyntaxOn
+% \end{macrocode}
+
+
+%
+%
+% \subsection{Providing hooks for paragraphs}
+%
+%
+% \begin{macro}{para/before,para/after,para/begin,para/end}
+% The public hooks. They are implemented as a paired set of hooks.
+% \begin{macrocode}
+\hook_new_pair:nn{para/before}{para/after}
+\hook_new_pair:nn{para/begin}{para/end}
+% \end{macrocode}
+% \end{macro}
+%
+%
+%
+% \begin{macro}{\@kernel@before@para@before,
+% \@kernel@after@para@after,
+% \@kernel@before@para@begin,
+% \@kernel@after@para@end}
+% The corresponding kernel hooks (for tagging and future extensions).
+% \begin{macrocode}
+\let \@kernel@before@para@before \@empty
+\let \@kernel@before@para@begin \@empty
+\let \@kernel@after@para@end \@empty
+\let \@kernel@after@para@after \@empty
+% \end{macrocode}
+% \end{macro}
+%
+%
+%
+%
+%
+% \begin{macro}{\g_@@_standard_everypar_tl}
+% Whenever \TeX{} starts a paragraph it inserts first an
+% indentation box and then executes the tokens stored in
+% \cs{tex_everypar:D} (known to \LaTeX{} as \cs{everypar}). We
+% alter this behavior slightly here, so that hooks are added
+% into the right place. Otherwise the process change remains
+% transparent to any legacy code for this space.
+%
+% We keep the standard code to be used by \cs{tex_everypar:D} in a
+% separate token list because we have to switch back and forth
+% for error recovery and so altering \cs{tex_everypar:D} all the
+% time should be a tiny bit faster.
+% \begin{macrocode}
+\tl_new:N \g_@@_standard_everypar_tl
+% \end{macrocode}
+% Here is now its definition:
+% \begin{macrocode}
+\tl_gset:Nn \g_@@_standard_everypar_tl {
+% \end{macrocode}
+% First we remove the indentation box and store it in
+% \cs{g_para_indentation_box}. If there was none because the paragraph
+% was started by \cs{noindent} the box register will be void.
+% \begin{macrocode}
+ \box_gset_to_last:N \g_para_indentation_box
+% \end{macrocode}
+%
+% This will make the newly started horizontal list empty, so if we
+% stop it now and return to vertical mode it will be dropped by
+% \TeX{}. We do that but inside a group so that any \cs{parshape}
+% settings will not get lost as we need them for later.
+% \begin{macrocode}
+ \group_begin:
+ \tex_par:D
+ \group_end:
+% \end{macrocode}
+% We then change \cs{tex_everypar:D} to generate an error so that
+% we can detect and report if the \hook{para/before} hook illegally
+% changed out of vmode.
+% \begin{macrocode}
+ \tex_everypar:D { \__kernel_msg_error:nnnn {para}{mode}{before}{vertical} }
+ \@kernel@before@para@before
+ \hook_use:n {para/before}
+% \end{macrocode}
+% Assuming the hooks have been well behaved it is time to return to
+% horizontal mode and start the paragraph in earnest. We already
+% have the indentation box saved away so we now have to restart the
+% paragraph with an empty \cs{tex_everypar:D} and with
+% \cs{tex_noindent:D}. And we need to make sure not to get another
+% \cs{parskip} or rather (since we can't prevent that) that it is
+% of zero size.
+% \begin{macrocode}
+ \group_begin:
+ \tex_everypar:D {}
+ \skip_zero:N \tex_parskip:D
+ \tex_noindent:D
+ \group_end:
+% \end{macrocode}
+% That brings us back to the start of the horizontal list but we
+% need to change \cs{tex_everypar:D} back to its normal content in
+% case there are nested paragraphs coming up.
+% \begin{macrocode}
+ \tex_everypar:D{\g_@@_standard_everypar_tl}
+% \showthe\tex_everypar:D
+% \end{macrocode}
+% Then we set up \cs{@@_handle_indent:} to reinsert the indentation
+% box later. This can be undone via \cs{SuppressIndentationBox}
+% inside the hook(s).
+% \begin{macrocode}
+ \cs_set_eq:NN \@@_handle_indent: \@@_add_indentation_box:
+% \end{macrocode}
+%
+% This is followed by executing the kernel and the public hook. The
+% kernel hook is there to enable tagging.
+% \begin{macrocode}
+ \@kernel@before@para@begin
+ \hook_use:n {para/begin}
+% \end{macrocode}
+% If we aren't in horizontal mode any longer the hooks above misbehaved.
+% \begin{macrocode}
+ \if_mode_horizontal: \else:
+ \__kernel_msg_error:nnnn {para}{mode}{begin}{vertical} \fi:
+% \end{macrocode}
+% Finally we reinsert the indentation box (unless suppressed) and
+% then call \cs{everypar} the way legacy \LaTeX\ code expects it.
+%
+% However, adding the public \cs{everypar} is a bit tricky (see below) so
+% we add that later, and indirectly.
+% \begin{macrocode}
+ \@@_handle_indent:
+% \the \everypar % <--- done differently
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[int]{\tex_everypar:D}
+% \cs{tex_everypar:D} then only has to execute
+% \cs{g_@@_standard_everypar_tl} by default.
+% \begin{macrocode}
+\tex_everypar:D{\g_@@_standard_everypar_tl}
+% \end{macrocode}
+% \end{macro}
+%
+%
+%
+% \begin{macro}[int]{\everypar}
+%
+% Tokens inserted at the beginning of the paragraph are placed into
+% \cs{everypar} inside legacy \LaTeX{} code, e.g., by the list
+% environments or by headings to handle \cs{clubpenalty}, etc. Now
+% this isn't any longer the primitive but simply a toks register
+% used in the code above but to legacy \LaTeX{} code that is
+% transparent.
+%
+% There is, however, a problem: a handful packages use exactly the
+% same trick and replace the primitive with a token register and
+% call the token register inside the renamed primitive. That is
+% they assume that \cs{everypar} is the primitive and that it will
+% still be called at the start of the paragraph even if renamed.
+%
+% But if we have already replaced it by a token register then all
+% they do is to give that token register a new name. Thus our code
+% in \cs{tex_everypar:D} would call \cs{everypar} (which is their
+% now token register) and the code that they added ends up in our
+% token register which is then never used at all. A bit mind
+% boggling I guess.
+%
+% So what we have to do is not to call the token register
+% \cs{everypar} by its name inside \cs{tex_everypar:D} but by using
+% its actual register number.
+% \begin{macrocode}
+\newtoks \everypar
+% \end{macrocode}
+%
+% After we have allocated a new toks register with the name
+% \cs{everypar} the actual register number is available (briefly)
+% inside \cs{allocationnumber}. So instead of \cs{the}\cs{everypar}
+% we have to put \cs{the}\cs{toks}\meta{allocated number} at the end of
+% \cs{tex_everypar:D}.
+%
+% So what remains doing is to append a few tokens to the token list
+% \cs{g_@@_standard_everypar_tl} which we do now. We use \texttt{x}
+% expansion here to get the value of \cs{allocationnumber} in, all
+% the other tokens should not be expanded at this point.
+
+% One important point here is to terminate the register allocation
+% number with a real space. This space will get swallowed up when
+% the number is read. Anything else, such as \cs{scan_stop:} would
+% remain in the input and that would mean that it would interfere
+% with \cs{everypar} code that attempts to scan ahead to see how
+% the paragraph text starts.
+% \begin{macrocode}
+\tl_gput_right:Nx \g_@@_standard_everypar_tl {
+ \exp_not:N \the
+ \exp_not:N \toks
+ \the \allocationnumber
+ \c_space_tl
+}
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \begin{macro}{\g_para_indentation_box}
+% For managing the indentation we need to provide a public
+% accessible box register
+% \begin{macrocode}
+\box_new:N \g_para_indentation_box
+% \end{macrocode}
+% \end{macro}
+
+% \begin{macro}{\@@_handle_indent:,\@@_add_indentation_box:}
+% Adding (typesetting) the indent box is straight forward, the
+% default action for is \cs{@@_handle_indent:} is
+% \cs{@@_add_indentation_box:}.
+% \begin{macrocode}
+\cs_new:Npn \@@_add_indentation_box: {
+ \box_use_drop:N \g_para_indentation_box
+}
+\cs_new_eq:NN \@@_handle_indent: \@@_add_indentation_box:
+% \end{macrocode}
+% The declaration \cs{para_suppress_indentation:} (or
+% \cs{SuppressIndentationBox}) changes that to do nothing.
+% \begin{macrocode}
+\cs_new:Npn \para_suppress_indentation: {
+ \cs_set_eq:NN \@@_handle_indent: \prg_do_nothing:
+}
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \begin{macro}{\IndentationBox,\SuppressIndentationBox}
+% The \LaTeXe{} names for the indentation box and for suppressing it
+% for use in the \hook{para/begin} hook.
+% \begin{macrocode}
+\cs_set_eq:NN \IndentationBox \g_para_indentation_box
+\cs_set_eq:NN \SuppressIndentationBox \para_suppress_indentation:
+% \end{macrocode}
+% \end{macro}
+%
+%
+%
+%
+%
+%
+% \begin{macro}{\para_end:}
+% Adding hooks to the end of a paragraph is similar but here we
+% need to alter the command that is used by \TeX{} to end horizontal
+% mode and return to vertical mode, i.e., \cs{par}.
+%
+% This is a bit more complicated as this command can appear anywhere
+% either explicitly or implicitly added by \TeX{} in certain
+% situations:
+% \begin{itemize}
+% \item
+% when using \cs{par} in the code or the document
+% \item
+% when using a blank line (which is converted to \cs{par})
+% \item
+% when \TeX{} finds any commands incompatible with horizontal
+% mode it issues a \cs{par} and then rereads the command.
+% \end{itemize}
+%
+% Unfortunately, \TeX{} has some (these days) unnecessary
+% optimization: if a \cs{vbox} ends and \TeX{} is still in
+% horizontal mode it simply exercises the paragraph builder instead
+% of issuing a \cs{par}. It is therefore necessary for \LaTeX{} to
+% ensure that this case doesn't happen and all boxes internally
+% have a \cs{par} command at their end.
+%
+% This \cs{par} may or may not run the ``par primitive'' (which is
+% always available as \cs{tex_par:D} in \pkg{expl3}); it is
+% permissible to have a changed meaning and it is in fact changed
+% by \LaTeX{} in various ways at various points inside
+% \texttt{latex.ltx}. For this \LaTeXe{} code has the following
+% conventions: \cs{@@@@par} and \cs{endgraf} both refer to the
+% default meaning (in the past this was the initex primitive) while
+% \cs{par} is the current meaning which may does something else.
+%
+%
+% We are now going to change this default meaning to run
+% \cs{para_end:} instead, which ultimately executes the initex
+% primitive but additionally adds our hooks when appropriate.
+% This way the change is again transparent to the legacy \LaTeXe{}
+% code.
+%
+% In most cases \cs{para_end:} should behave exactly like the
+% primitive and we achieve this by simply expanding it to the
+% primitive which is available to us as \cs{tex_par:D}. This way we
+% don't have to care about whether \TeX{} just does nothing (e.g.,
+% if in vertical mode already) or generate an error, etc.
+% \begin{macrocode}
+\cs_new_protected:Npn \para_end: {
+% \end{macrocode}
+%
+% The only case we care about is when we are in horizontal mode
+% (i.e., doing typesetting) and not also in inner mode (i.e.,
+% making paragraphs and not building an \cs{hbox}.
+% \begin{macrocode}
+% \bool_lazy_and:nnT
+% { \mode_if_horizontal_p: }
+% { \bool_not_p:n { \mode_if_inner_p: } }
+% { ...
+% \end{macrocode}
+% Since this is executed for each and every paragraph in a document
+% we try to stay a fast as possible, So we are aren't using the
+% above construct but two conditionals instead. Using low-level
+% \cs{if_mode...} conditions would be even faster but has the
+% danger to conflict with conditionals in the user hooks.
+% \begin{macrocode}
+ \mode_if_horizontal:TF {
+ \mode_if_inner:F {
+% \end{macrocode}
+% In that case the action of the primitive would be to remove the
+% last glue (not kern) from the horizontal list constructed to form
+% a paragraph then append the a penalty of 10000 and the
+% \cs{parfillskip} at the end and pass the whole list to the
+% paragraph builder which breaks it into lines and \TeX{} then
+% returns to vertical mode.
+%
+% What we want to do instead is to add our hook code at the end of
+% the horizontal list before that happens and the code is passed to
+% the paragraph builder. If there was a glue item at the end then
+% it should get removed before the hook code gets added so we have
+% to arrange for its removal ourselves.
+%
+% There is not much point in checking if there was really a glue
+% item at the end of the horizontal list, instead we simply try to
+% remove one using \cs{tex_unskip:D}, if there wasn't one this will
+% do nothing.
+% \begin{macrocode}
+ \tex_unskip:D
+% \end{macrocode}
+% The we execute the public hook (which may add final typesetting
+% material) followed by the kernel hook we need for adding tagging
+% support. None of this is supposed to change the mode---at the
+% moment we make only a very simple test for this, more devious
+% changes go unnoticed, but too bad, that will then probably
+% badly backfire.
+% \begin{macrocode}
+ \hook_use:n{para/end}
+ \@kernel@after@para@end
+ \mode_if_horizontal:TF {
+% \end{macrocode}
+% The final action (before getting to the point where
+% \cs{tex_par:D} is called) is to add a kern item so that the
+% primitive is prevented from removing glue (if there was some). If
+% we don't do this and the
+% horizontal list ended in several glue items we would end up with
+% removing two instead of just the last one, which would be wrong.
+% We use a kern as that is minimally faster.
+%
+% There is however one other \TeX{} optimization that hurts: in a
+% sequence like this \verb=$$ ... $$ \par= \TeX{} will be in
+% horizontal mode after the display, ready to receive further
+% paragraph text, but since the \cs{par} follows immediately there
+% is a ``null'' paragraph at the end and \TeX{} simply throws that
+% away. The space between \verb=$$= and \cs{par} got already
+% dropped during the display processing so the \cs{par} is not
+% removing any space and appending \cs{parfillskip}, instead it
+% simply goes silently to vmode. Now if we would had added something (to
+% prevent glue removal) that would look to \TeX{} like material
+% after the display and so we would end up with an empty paragraph
+% just containing \cs{parfillskip}.
+%
+% We therefore check if the current hlist is empty
+% (\cs{tex_lastnodetype:D} has the value \texttt{-1} and
+% only if not we add our kern.
+% \begin{macrocode}
+ \if_int_compare:w 0 < \tex_lastnodetype:D
+ \tex_kern:D \c_zero_dim
+ \fi:
+% \end{macrocode}
+% To run the \hook{para/after} hook we first end the
+% paragraph. This means that the \cs{tex_par:D} at the very end is
+% unnecessary but executing it there unnecessarily is better than
+% having code that test for all the different mode possibilities.
+% \begin{macrocode}
+ \tex_par:D
+ \hook_use:n{para/after}
+ \@kernel@after@para@after
+ }
+% \end{macrocode}
+% If we haven't been in horizontal mode then the earlier hook
+% \hook{para/end} is at fault and we report that.
+% \begin{macrocode}
+ { \__kernel_msg_error:nnnn {para}{mode}{end}{horizontal} }
+% \end{macrocode}
+% Finally close out the nested conditionals.
+% \begin{macrocode}
+ }
+ }
+% \end{macrocode}
+%
+% \begin{macrocode}
+ \tex_par:D
+}
+% \end{macrocode}
+% \end{macro}
+%
+% This ends the \texttt{para} module code.
+% \begin{macrocode}
+%<@@=>
+% \end{macrocode}
+%
+% \begin{macro}{\par,\endgraf}
+% \begin{macro}[int]{\@@par}
+%
+% Having the new default definition for \cs{par} we also have to
+% set it up so that it gets used. This is needed in three places
+% \cs{par}, \cs{@@par} (to which \LaTeX{} resets \cs{par}
+% occasionally) and \cs{endgraf} which is another name for the
+% ``default'' action of \cs{par}.
+% \begin{macrocode}
+\cs_set_eq:NN \par \para_end:
+\cs_set_eq:NN \@@par \para_end:
+\cs_set_eq:NN \endgraf \para_end:
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% While this is not integrated properly into the format we have to
+% redo the \cs{everypar} setting from the kernel, otherwise that
+% gets lost (as it happens before that file is loaded).
+% \begin{macrocode}
+\everypar{\@nodocument} %% To get an error if text appears before the
+% \end{macrocode}
+%
+%
+% \subsection{The error messages}
+%
+% Well, one really, first argument is the hook name second the mode
+% it should have stayed in but didn't.
+% \begin{macrocode}
+\__kernel_msg_new:nnnn {para} {mode}
+ {
+ Illegal~mode~ change~ in~ hook~ 'para/#1'.\\
+ Hook~ code~ did~ not~ remain~ in~ #2~ mode.
+ }
+ {
+ Paragraph~ hooks~ cannot~ change~ the~ TeX~ mode~ without~ causing~
+ endless~ recursion.~ The~ hook~ code~ in~ 'para/#1'~ needs~ to~ stay~
+ in~ #2~ mode,~ but~ it~ didn't.~ Examine~ the~ hook~
+ code~ with~ \ShowHook~ to~ find~ the~ issue.
+ }
+% \end{macrocode}
+%
+% \begin{macrocode}
+\ExplSyntaxOff
+% \end{macrocode}
+%
+% \subsection{Kernel corrections}
+%
+% These corrections/changes are already part of the 2021/05
+% release, i.e., but for testing with older releases they have been
+% included here for now. So this section will vanish soon.
+%
+%
+% Marginpar boxes are missing a final internal \cs{par}.
+% \begin{macrocode}
+\IfFormatAtLeastTF{2021/05/01}{}
+{
+\long\def \@savemarbox #1#2{%
+ \global\setbox #1%
+ \color@vbox
+ \vtop{%
+ \hsize\marginparwidth
+ \@parboxrestore
+ \@marginparreset
+ #2\par % <-- needed
+ \@minipagefalse
+ \outer@nobreak
+ }%
+ \color@endbox
+}
+% \end{macrocode}
+%
+% Two sample definitions for the kernel hooks to help a bit with
+% tracing.
+% \begin{macrocode}
+\newcounter{paracnt}
+\def\@kernel@before@para@begin{%
+ \stepcounter{paracnt}%
+ \typeout{PARA: \arabic{paracnt} start
+ (\@currenvir\space level\on@line)}%
+}
+\def\@kernel@after@para@end {%
+ \typeout{PARA: \arabic{paracnt} end \space\space
+ (\@currenvir\space level\on@line)}%
+ \addtocounter{paracnt}{-1}%
+}
+% \end{macrocode}
+%
+%
+% The next lines belong in the kernel and just make sure that we
+% avoid the these days unnecessary optimization that \TeX{} doesn't
+% call on \cs{par} if a vertical box ends in hmode. Instead \TeX{}
+% directly calls the par builder in that case :-(.
+% \begin{macrocode}
+\let\color@begingroup\begingroup
+\def\color@endgroup{\endgraf\endgroup}
+\def\color@setgroup{\color@begingroup} % \def\color@setgroup{\color@begingroup\set@color}
+\def\color@hbox{\hbox\bgroup\color@begingroup}
+\def\color@vbox{\vbox\bgroup\color@begingroup}
+\def\color@endbox{\color@endgroup\egroup}
+}
+% \end{macrocode}
+%
+%
+%
+% \begin{macrocode}
+%<*2ekernel>
+% \end{macrocode}
+%
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\endinput
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+
+%%%% unused as hok was dropped
+
+% \subsubsection{Put the first word of each paragraph in an \cs{fbox} and append
+% a \P{} sign at the end of the paragraph}
+%
+% We make the assumption that the first word ends in a space so
+% that we can grab it easily (which
+% is of course not quite right). So here is the code for that.
+%\begin{verbatim}
+% \def\firstwordboxed#1 {\fbox{#1} }
+%\end{verbatim}
+% Installing that is then just a matter of putting it into the right
+% hook. Since we don't want to box the indentation (or what comes
+% from \cs{everypar} we shouldn't use \hook{para/begin} but
+% \hook{para/textbegin}.
+% Adding the \P{} is equally simple.
+%\begin{verbatim}
+% \AddToHook{para/textbegin}{\firstwordboxed}
+% \AddToHook{para/end}{\P}
+%\end{verbatim}
+% While this will work more or less flawless (if you accept that it
+% will pick up any punctuation after the first word), it will fail
+% in at least two cases.
+% \begin{itemize}
+% \item Single word paragraphs ending with \cs{par} instead of an
+% empty line will blow up because the \cs{par} will be picked up as
+% part of the argument and error as our \cs{firstwordboxed} doesn't
+% accept a \cs{par} not being long. That is actually good, because
+% picking it up would be worse: it would get ignored inside
+% \cs{fbox} and so the paragraph would be combined with the next
+% (or worse).
+%
+% \item The second problem is, of course, that sticking it into
+% every \hook{para/textbegin} means it get applied to places like
+% \cs{section} which is not really what you want. So some more
+% elaborate mechanism would be necessary---a task for another rainy
+% day.
+% \end{itemize}
+%
+% There is one other point to note here. The \cs{firstwordboxed} is
+% expected to scan ahead. So can that kind of code be placed into a
+% hook? The answer is a kind of yes and no.
+
+% Hooks can receive code from different places, but obviously only
+% one chunk of code can do some scanning ahead, the one that comes
+% last. Any hook code in a different position would see any
+% following code from later chunks as part of the scanning which
+% may or may not be a problem. In fact, even in our simple example,
+% the argument picked up by \cs{firstwordboxed} isn't really the
+% first word of the paragraph. It is that but in front of it there
+% is also the code responsible for running
+% \verb=\AddTohookNext{para/textbegin}=. As long as this is not
+% doing anything harmful it doesn't hurt in this case, but it
+% clearly shows that this example is not as simple as it
+% claims to be and on the whole we have to conclude that hooks
+% aren't really meant to do such scanning or at least not without a
+% lot of precaution.
+%
diff --git a/macros/latex-dev/base/ltpictur.dtx b/macros/latex-dev/base/ltpictur.dtx
index 10773f376c..b958d43760 100644
--- a/macros/latex-dev/base/ltpictur.dtx
+++ b/macros/latex-dev/base/ltpictur.dtx
@@ -1,7 +1,7 @@
% \iffalse meta-comment
%
% Copyright (C) 1993-2021
-% The LaTeX3 Project and any individual authors listed elsewhere
+% The LaTeX Project and any individual authors listed elsewhere
% in this file.
%
% This file is part of the LaTeX base system.
diff --git a/macros/latex-dev/base/ltplain.dtx b/macros/latex-dev/base/ltplain.dtx
index 0b03fd1364..fa53cc17ec 100644
--- a/macros/latex-dev/base/ltplain.dtx
+++ b/macros/latex-dev/base/ltplain.dtx
@@ -1,7 +1,7 @@
% \iffalse meta-comment
%
% Copyright (C) 1993-2021
-% The LaTeX3 Project and any individual authors listed elsewhere
+% The LaTeX Project and any individual authors listed elsewhere
% in this file.
%
% This file is part of the LaTeX base system.
diff --git a/macros/latex-dev/base/ltsect.dtx b/macros/latex-dev/base/ltsect.dtx
index 70106e2e58..29ea142ba6 100644
--- a/macros/latex-dev/base/ltsect.dtx
+++ b/macros/latex-dev/base/ltsect.dtx
@@ -1,7 +1,7 @@
% \iffalse meta-comment
%
% Copyright (C) 1993-2021
-% The LaTeX3 Project and any individual authors listed elsewhere
+% The LaTeX Project and any individual authors listed elsewhere
% in this file.
%
% This file is part of the LaTeX base system.
diff --git a/macros/latex-dev/base/ltshipout-code.pdf b/macros/latex-dev/base/ltshipout-code.pdf
index 7c92232d13..f234cc2d02 100644
--- a/macros/latex-dev/base/ltshipout-code.pdf
+++ b/macros/latex-dev/base/ltshipout-code.pdf
Binary files differ
diff --git a/macros/latex-dev/base/ltshipout-doc.pdf b/macros/latex-dev/base/ltshipout-doc.pdf
index 384a4a09f1..6592e23b4e 100644
--- a/macros/latex-dev/base/ltshipout-doc.pdf
+++ b/macros/latex-dev/base/ltshipout-doc.pdf
Binary files differ
diff --git a/macros/latex-dev/base/ltshipout.dtx b/macros/latex-dev/base/ltshipout.dtx
index 2ea0a1b665..565f35f529 100644
--- a/macros/latex-dev/base/ltshipout.dtx
+++ b/macros/latex-dev/base/ltshipout.dtx
@@ -1,6 +1,7 @@
% \iffalse meta-comment
%%
-%% File: ltshipout.dtx (C) Copyright 2020,2021 Frank Mittelbach, LaTeX Team
+%% Copyright (C) 2020-2021
+%% Frank Mittelbach, LaTeX Team
%%
%
% This file is part of the LaTeX base system.
@@ -31,8 +32,8 @@
%%% From File: ltshipout.dtx
%
% \begin{macrocode}
-\providecommand\ltshipoutversion{v1.0d}
-\providecommand\ltshipoutdate{2020/12/06}
+\providecommand\ltshipoutversion{v1.0i}
+\providecommand\ltshipoutdate{2021/01/25}
% \end{macrocode}
%
%<*driver>
@@ -55,6 +56,9 @@
}
\ExplSyntaxOff
+\providecommand\InternalDetectionOff{}
+\providecommand\InternalDetectionOn{}
+
\EnableCrossrefs
\CodelineIndex
\begin{document}
@@ -108,11 +112,50 @@
% It then stores it in a named box register. This box can then be
% manipulated through a set of hooks after which it is shipped out
% for real.
+%
+% Each shipout that actually happens (i.e., where the material is
+% not discarded for one or the other reason) is recorded and the
+% total number is available in a readonly variable and in a
+% \LaTeX{} counter.
+% \end{function}
+%
+%
+% \begin{function}{\RawShipout}
+% This command implements a simplified shipout that bypasses the
+% foreground and background
+% hooks, e.g., only \hook{shipout/firstpage} and
+% \hook{shipout/lastpage} are executed and the total shipout
+% counters are incremented.
+%
+% The command doesn't use \cs{ShipoutBox} but its own private box
+% register so that it can be used inside of shipout hooks to do
+% some additional shipouts while already in the output routine with
+% the current page being stored in \cs{ShipoutBox}. It does have
+% access to \cs{ShipoutBox} if it is used in \hook{shipout/before}
+% (or \hook{shipout/after}) and can use its content.
+%
+% It is safe to use it in \hook{shipout/before} or
+% \hook{shipout/after} but not necessarily in the other
+% \hook{shipout/...} hooks as they are intended for special
+% processing.
% \end{function}
%
% \begin{variable}{\ShipoutBox,\l_shipout_box}
-% This box register is called \cs{ShipoutBox} (alternatively available via the
-% L3 name \cs{l_shipout_box}).
+% This box register is called \cs{ShipoutBox} (alternatively
+% available via the L3 name \cs{l_shipout_box}).
+%
+% During the execution of \hook{shipout/before} this box contains
+% the accumulated material for the page, but not yet any material
+% added by other shipout hooks.
+% During execution of \hook{shipout/after}, i.e., after the shipout
+% has happened, the box also contains any background or foreground
+% material.
+%
+% Material from the hooks \hook{shipout/firstpage} or
+% \hook{shipout/lastpage} is not included (but only used during the
+% actual shipout) to facilitate reuse of the box data (e.g.,
+% \hook{shipout/firstpage} material should never be added to a
+% later page of the output).
% \end{variable}
%
%
@@ -133,11 +176,11 @@
%
% \subsection{Provided hooks}
%
-% \begin{variable}{shipout/before,
+% \begin{variable}{shipout/before,shipout/after,
% shipout/foreground,shipout/background,
% shipout/firstpage,
% shipout/lastpage}
-% The code offers a number of hooks into which packages (or the
+% The code for \cs{shipout} offers a number of hooks into which packages (or the
% user) can add code to support different use cases.
% These are:
% \begin{description}
@@ -148,6 +191,20 @@
% It can be used to alter that box content or to discard it
% completely (see \cs{DiscardShipoutBox} below).
%
+% You can use \cs{RawShipout} inside this hook for special use
+% cases. It can make use of \cs{ShipoutBox} (which doesn't yet
+% include the background and foreground material).
+%
+% \textbf{Note:} It is not possible (or say advisable) to try
+% and use this hook to typeset material with the intention to
+% return it to main vertical list, it will go wrong and give
+% unexpected results in many cases---for starters it will appear
+% after the current page not before or it will vanish or the
+% vertical spacing will be wrong!
+% \end{description}
+% \end{variable}
+%
+% \begin{description}
% \item[\hook{shipout/background}]
%
% This hook adds a picture environment into the background of
@@ -186,9 +243,14 @@
% not discarded at the last minute). It should only contain
% \cs{special} or similar commands needed to direct post processors
% handling the \texttt{.dvi} or \texttt{.pdf} output.\footnotemark
+% \footnotetext{In
+% \LaTeXe{} that was already existing, but implemented using a box
+% register with the name \cs{@begindvibox}.}
%
% ^^A \fmi{not sure it has to be that restrictive.}
%
+% This hook is added to the very first page regardless of how it
+% is shipped out (i.e., with \cs{shipout} or \cs{RawShipout}).
%
% \item[\hook{shipout/lastpage}]
%
@@ -196,6 +258,7 @@
% the output file. It is only executed on the very last page of
% the output file ---
% or rather on the page that \LaTeX{} believes is the last one.
+% Again it is executed regardless of the shipout method.
%
% It may not be possible for \LaTeX{} to correctly determine
% which page is the last one without several reruns. If this
@@ -203,17 +266,32 @@
% extra page to place the material and also request a rerun to
% get the correct placement sorted out.
%
+% \item[\hook{shipout/after}]
+%
+% This hook is executed after a shipout has happened. If the
+% shipout box is discarded this hook is not looked at.
+%
+% You can use \cs{RawShipout} inside this hook for special use
+% cases and the main \cs{ShipoutBox} is still available at this
+% point (but in contrast to \hook{shipout/before} it now
+% includes the background and foreground material).
+%
+% \textbf{Note:} Just like \hook{shipout/before} this hook is
+% not meant to be used for adding adding typeset material back
+% to the main vertical list---it might vanish or the
+% vertical spacing will be wrong!
+%
+%
% \end{description}
-% \end{variable}\footnotetext{In
-% \LaTeXe{} that was already existing, but implemented using a box
-% register with the name \cs{@begindvibox}.}
%
% As mentioned above the hook \hook{shipout/before} is executed
% first and can manipulate the prepared shipout box stored in
% \cs{ShipoutBox} or set things up for use in \cs{write} during the
-% actual shipout. The other hooks are added inside hboxes to the
-% box being shipped out in the following
-% order:
+% actual shipout. It is even run if there was a
+% \cs{DiscardShipoutBox} request in the document.
+%
+% The other hooks (except \hook{shipout/after}) are added inside
+% hboxes to the box being shipped out in the following order:
% \begin{center}
% \begin{tabular}{ll}
% \hook{shipout/firstpage} & only on the first page \\
@@ -226,14 +304,22 @@
% If any of the hooks has no code then that particular no box is
% added at that point.
%
+% Once the (page) box has been shipped out the \hook{shipout/after}
+% hook is called (while you are still inside the output routine). It
+% is not called if the shipout box was discarded.
+%
% In a document that doesn't produce pages, e.g., only makes
-% \cs{typeout}s, none of the hooks are executed (as there is no
+% \cs{typeout}s, none of the hooks are ever executed (as there is no
% \cs{shipout}) not even the \hook{shipout/lastpage} hook.
%
+% If \cs{RawShipout} is used instead of \cs{shipout} then only the
+% hooks \hook{shipout/firstpage} and \hook{shipout/lastpage} are
+% executed (on the first or last page), all others are bypassed.
%
-% \subsection{Legacy \LaTeX{} commands}
%
%
+% \subsection{Legacy \LaTeX{} commands}
+%
% \begin{function}{\AtBeginDvi,\AtEndDvi}
% \cs{AtBeginDvi} is the existing \LaTeXe{} interface to fill the
% \hook{shipout/firstpage} hook. This is not really a good name
@@ -256,12 +342,12 @@
%
% \subsection{Special commands for use inside the hooks}
%
-% \begin{function}{\DiscardShipoutBox,\shipout_discard_box:}
+% \begin{function}{\DiscardShipoutBox,\shipout_discard:}
% \begin{syntax}
% \cs{AddToHookNext} \texttt{\{shipout/before\} \{...\cs{DiscardShipoutBox}...\}}
% \end{syntax}
% The \cs{DiscardShipoutBox} declaration (L3 name
-% \cs{shipout_discard_box:})
+% \cs{shipout_discard:})
% requests that on the next
% shipout the page box is thrown away instead of being shipped to
% the \texttt{.dvi} or \texttt{.pdf} file.
@@ -272,6 +358,8 @@
% Note that if this declaration is used directly in the document it
% may depend on the placement to which page it applies, given that
% \LaTeX{} output routine is called in an asynchronous manner!
+% Thus normally one would use this only as part of the
+% \hook{shipout/before} code.
%
% \fmi{Once we have a new mark mechanism available we can improve
% on that and make sure that the declaration applies to the page
@@ -290,12 +378,28 @@
% names as given below.
%
%
+%
+% \subsection{Provided Lua\TeX\ callbacks}
+%
+% \begin{variable}{pre_shipout_filter}
+% Under Lua\TeX{} the \texttt{pre\_shipout\_filter} Lua callback is
+% provided which gets called immediately before the shipout primitive gets invoked.
+% The signature is
+% \begin{verbatim}
+% function(<node> head)
+% return true
+% end
+% \end{verbatim}
+% The \texttt{head} is the list node corresponding to the box to be shipped out.
+% The return value should always be \texttt{true}.
+% \end{variable}
+%
% \subsection{Information counters}
%
%
% \begin{variable}{\ReadonlyShipoutCounter,\g_shipout_readonly_int}
% \begin{syntax}
-% \cs{ifnum}\cs{ReadOnlyShipoutCounter}\texttt{=...}
+% \cs{ifnum}\cs{ReadonlyShipoutCounter}\texttt{=...}
% \cs{int_use:N} \cs{g_shipout_readonly_int} \texttt{\% expl3 usage}
% \end{syntax}
% This integer holds the number of pages shipped out up to now
@@ -303,6 +407,7 @@
% routine). More precisely, it is incremented only after it is
% clear that a page will be shipped out, i.e., after the
% \hook{shipout/before} hook (because that might discard the page)!
+% In contrast \hook{shipout/after} sees the incremented value.
%
% Just like with the \texttt{page} counter its value is
% only accurate within the output routine. In the body of the
@@ -310,10 +415,11 @@
% asynchronously!
%
% Also important: it \emph{must not} be set, only read. There are
-% no provisions to prevent that but if you do, chaos will be the
-% result. To emphasize this fact it is not provided as a \LaTeX{}
-% counter but as a \TeX{} counter (i.e., a command), so
-% \cs{Alph}\Arg{\cs{ReadonlyShipoutCounter}} etc, would not work.
+% no provisions to prevent that restriction, but if you manipulate
+% it, chaos will be the result. To emphasize this fact it is not
+% provided as a \LaTeX{} counter but as a \TeX{} counter (i.e., a
+% command), so \cs{Alph}\verb={=\cs{ReadonlyShipoutCounter}\verb=}=
+% etc, would not work.
% \end{variable}
%
% \begin{variable}{totalpages,\g_shipout_totalpages_int}
@@ -325,7 +431,8 @@
% \texttt{totalpages} counter is a \LaTeX{} counter and incremented
% for each shipout attempt including those pages that are discarded
% for one or the other reason. Again \hook{shipout/before} sees
-% the counter before it is incremented).
+% the counter before it is incremented. In contrast
+% \hook{shipout/after} sees the incremented value.
%
% Furthermore, while it is incremented for each page, its value is
% never used by \LaTeX. It can therefore be freely reset or changed by user
@@ -427,6 +534,21 @@
% This is the name of the shipout box as \pkg{atbegshi} knows it.
% \end{function}
%
+%
+% \begin{function}{\AtBeginShipoutOriginalShipout}
+% This is the name of the \cs{shipout} primitive as \pkg{atbegshi}
+% knows it. This bypasses all the mechanisms set up by the \LaTeX{}
+% kernel and there are various scenarios in which it can therefore
+% fail. It should only be used to run existing legacy
+% \pkg{atbegshi} code but not in newly developed applications.
+%
+% The kernel alternative is \cs{RawShipout} which is integrated
+% with the \LaTeX{} mechanisms and updates, for example, the
+% \cs{ReadonlyShipoutCounter} counter. Please use \cs{RawShipout}
+% for new code if you want to bypass the before, foreground and
+% background hooks.
+% \end{function}
+%
% \begin{function}{\AtBeginShipoutInit}
% By default \pkg{atbegshi} delayed its action until
% \verb=\begin{document}=. This command was forcing it in an earlier
@@ -591,6 +713,41 @@
% \end{macro}
%
%
+% \begin{macro}{\l_@@_raw_box}
+% The \cs{RawShipout} gets its own box but it is internal as there
+% is no hook manipulation for it.
+% \begin{macrocode}
+\box_new:N \l_@@_raw_box
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \begin{macro}{\@@_finalize_box:}
+% For Lua\TeX{} invoke the \texttt{pre\_shipout\_filter} callback.
+% \changes{v1.0i}{2021/01/22}{Add \texttt{pre\_shipout\_filter} Lua callback}
+% \begin{macrocode}
+\sys_if_engine_luatex:TF
+ {
+ \newluafunction \@@_finalize_box:
+ \exp_args:Nx \everyjob {
+ \exp_not:V \everyjob
+ \exp_not:N \lua_now:n {
+ luatexbase.create_callback('pre_shipout_filter', 'list')
+ local~call, getbox, setbox = luatexbase.call_callback, tex.getbox, tex.setbox~
+ lua.get_functions_table()[\the \@@_finalize_box:] = function()
+ local~result = call('pre_shipout_filter', getbox(\the \l_shipout_box))
+ if~not (result == true) then~
+ setbox(\the \l_shipout_box, result~or~nil)
+ end~
+ end
+ }
+ }
+ \protected \luadef \@@_finalize_box: \the \@@_finalize_box:
+ } {
+ \cs_set_eq:NN \@@_finalize_box: \scan_stop:
+ }
+% \end{macrocode}
+% \end{macro}
%
%
% \begin{macro}{\@@_execute:}
@@ -618,7 +775,8 @@
%
% \begin{macro}{\l_@@_group_level_tl}
% Helper token list to record the group level at which
-% \cs{@@_execute:} is encountered. \begin{macrocode}
+% \cs{@@_execute:} is encountered.
+% \begin{macrocode}
\tl_new:N \l_@@_group_level_tl
% \end{macrocode}
% \end{macro}
@@ -632,28 +790,78 @@
\cs_new:Npn \@@_execute_test_level: {
\int_compare:nNnT
\l_@@_group_level_tl < \tex_currentgrouplevel:D
- \tex_aftergroup:D
- \@@_execute_cont:
+ \tex_aftergroup:D \@@_execute_cont:
}
% \end{macrocode}
% \end{macro}
%
%
% \begin{macro}{\@@_execute_cont:}
+% This does the actual shipout running several hooks as part of it.
+% The code for them is passed as argument \verb=#2= to \verb=#4=
+% to \cs{@@_execute_main_cont:Nnnn}; the first argument is the box
+% to be shipped out.
+% \begin{macrocode}
+\cs_new:Npn \@@_execute_cont: {
+ \@@_execute_main_cont:Nnnn
+ \l_shipout_box
+ { \hook_use:n {shipout/before} }
+ { \hook_if_empty:nF {shipout/foreground}
+ { \@@_add_foreground_picture:n
+ { \hook_use:n {shipout/foreground} } }
+% \end{macrocode}
+% If the user hook for the background (\hook{shipout/background}) has
+% no code, there might still code in the kernel hook so we need to
+% test for this too.
+% We only test for the \cs{@kernel@before@shipout@background}
+% though. If the \cs{@kernel@after@shipout@background} needs
+% executing even if the user hook is empty then we can add another
+% test (or the kernel could put something into the before hook).
+%
+% \changes{v1.0d}{2020/11/23}{Check for both kernel and user hook (gh/431)}
+% \changes{v1.0f}{2021/01/08}{Added another kernel hook for more
+% flexibility (cf \texttt{https://github.com/pgf-tikz/pgf/issues/960}}
+% \begin{macrocode}
+ \bool_lazy_and:nnF
+ { \hook_if_empty_p:n {shipout/background} }
+ { \tl_if_empty_p:N \@kernel@before@shipout@background }
+ { \@@_add_background_picture:n
+ { \@kernel@before@shipout@background
+ \hook_use:n {shipout/background}
+ \@kernel@after@shipout@background }
+ }
+ }
+ { \hook_use:n {shipout/after} }
+}
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \begin{macro}{\@@_execute_main_cont:Nnnn}
% When we have reached this point the shipout box has been
% processed and is available in \cs{l_shipout_box} and ready for
-% real ship out (perhaps)..
+% real ship out (unless it gets discarded during the process).
+%
+% The three arguments hold hook code that is executed just before the
+% actual shipout (\verb=#1=), within the shipout adding
+% background and foreground material (\verb=#2=) and after the
+% shipout has happened (\verb=#3=).
+% These are passed as arguments because the same code without those
+% hooks is also used when doing a ``raw'' shipout implemented by
+% \cs{RawShipout}.
+% The only hook that is always executed is that for the very last
+% page, i.e., \hook{shipout/lastpage}.
%
% First we quickly check if it is void (can't happen in the
% standard \LaTeX{} output routine but \cs{shipout} might be called
% from a package that has some special processing logic). If it is
% void we aren't shipping anything out and processing ends.\footnote{In that
-% case we don't reset the deadcyles, that would be up to the OR
+% case we don't reset the deadcycles, that would be up to the OR
% processing logic to do.}
% \begin{macrocode}
-\cs_new:Npn \@@_execute_cont: {
- \box_if_empty:NTF \l_shipout_box
- { \PackageWarning{ltshipout}{Ignoring~ void~ shipout~ box} }
+\cs_new:Npn \@@_execute_main_cont:Nnnn #1#2#3#4 {
+ \box_if_empty:NTF #1
+ { \@latex@warning{Ignoring~ void~ shipout~ box} }
{
% \end{macrocode}
% Otherwise we assume that we will ship something and prepare for
@@ -661,7 +869,8 @@
% \cs{protect} while we are running the hook code).
% We also save the current \cs{protect} state to restore it later.
% \begin{macrocode}
- \bool_gset_false:N \g_@@_discard_bool
+% \bool_gset_false:N \g_@@_discard_bool % setting this would disable
+ % \DiscardShipoutBox on doc-level
\cs_set_eq:NN \@@_saved_protect: \protect
\set@typeset@protect
% \end{macrocode}
@@ -670,11 +879,12 @@
% necessary as the code could access them via \cs{box_ht:N}, etc.,
% but it is perhaps convenient.}
% \begin{macrocode}
- \@@_get_box_size:N \l_shipout_box
+ \@@_get_box_size:N #1
% \end{macrocode}
-% Then we execute the \hook{shipout/before} hook.
+% Then we execute the \hook{shipout/before} hook (or nothing in
+% case of \cs{RawShipout}).
% \begin{macrocode}
- \hook_use:n {shipout/before}
+ #2
% \end{macrocode}
% In \cs{g_shipout_totalpages_int} we count all shipout attempts so
% we increment that counter already here (the other one is
@@ -693,7 +903,7 @@
% we now test for it.
% \begin{macrocode}
\bool_if:NTF \g_@@_discard_bool
- { \PackageInfo{ltshipout}{Completed~ page~ discarded}
+ { \@latex@info@no@line{Completed~ page~ discarded}
\bool_gset_false:N \g_@@_discard_bool
% \end{macrocode}
% As we are discarding the page box and not shipping anything out,
@@ -707,7 +917,7 @@
% needed? Or the resetting of \cs{protect} to its kernel value?}
% \begin{macrocode}
% \group_begin:
-% \box_set_eq_drop:NN \l_shipout_box \l_shipout_box
+% \box_set_eq_drop:NN #1 #1
% \group_end:
% \cs_set_eq:NN \protect \exp_not:N
}
@@ -718,8 +928,8 @@
% once more but this time make it a warning, because the best
% practice way is to use the request mechanism.
% \begin{macrocode}
- { \box_if_empty:NTF \l_shipout_box
- { \PackageWarning{ltshipout}{
+ { \box_if_empty:NTF #1
+ { \@latex@warning{
Shipout~ box~ was~ voided~ by~ hook,\MessageBreak
ignoring~ shipout~ box }
}
@@ -743,33 +953,36 @@
% changed) and then look at the hooks \hook{shipout/foreground}
% and \hook{shipout/background}. If either or both are non-empty
% we add a \texttt{picture} environment to the box (in the
-% foreground and or in the background) and execute the hook code
+% foreground and/or in the background) and execute the hook code
% inside that environment.
%
% \begin{macrocode}
- \@@_get_box_size:N \l_shipout_box
- \hook_if_empty:nF {shipout/foreground}
- { \@@_add_foreground_picture:n
- { \hook_use:n {shipout/foreground} } }
+ \@@_get_box_size:N #1
% \end{macrocode}
-% If there is no user hook, there might still code in the kernel hook.
-% \changes{v1.0d}{2020/11/23}{Check for both kernel and user hook (gh/431)}
+% The first hook we run is the \hook{shipout/firstpage} hook. This
+% is only done once, then the \cs{@@_run_firstpage_hook:}
+% command redefines itself to do nothing. If the hook contains
+% \cs{special}s for integration at the top of the page they will be
+% temporarily stored in a safe place and added later with
+% \cs{@@_add_firstpage_specials:}.
+% \begin{macrocode}
+ \@@_run_firstpage_hook:
+% \end{macrocode}
+% Run the hooks for background and foreground or, if this
+% is called by \cs{RawShipout}, copy the box \cs{l_@@_raw_box} to
+% \cs{l_shipout_box} so that firstpage and lastpage material gets
+% added if necessary (that is always done to \cs{l_shipout_box}.
% \begin{macrocode}
- \bool_lazy_and:nnF
- { \hook_if_empty_p:n {shipout/background} }
- { \tl_if_empty_p:N \@kernel@before@shipout@background }
- { \@@_add_background_picture:n
- { \@kernel@before@shipout@background
- \hook_use:n {shipout/background} } }
+ #3
% \end{macrocode}
-% We then run \cs{@@_execute_firstpage_hook:} that adds
+% We then run \cs{@@_add_firstpage_specials:} that adds
% the content of the hook \hook{shipout/firstpage} to the
% start of the first page (if non-empty). It is then redefined to
% do nothing on later pages.
% \begin{macrocode}
- \@@_execute_firstpage_hook:
+ \@@_add_firstpage_specials:
% \end{macrocode}
-% The we check if we have to add the \hook{shipout/lastpage} hook
+% Then we check if we have to add the \hook{shipout/lastpage} hook
% or the corresponding kernel hook
% because we have reached the last page. This test will be false for
% all but one (and hopefully the correct) page.
@@ -780,12 +993,14 @@
{ \hook_if_empty_p:n {shipout/lastpage} }
{ \tl_if_empty_p:N \@kernel@after@shipout@lastpage }
{ \@@_debug:n { \typeout{Executing~ lastpage~ hook~
- on~ page~ \int_use:N \g_shipout_readonly_int } }
- \_@@_add_foreground_box:n { \UseHook{shipout/lastpage}
- \@kernel@after@shipout@lastpage }
+ on~ page~ \int_use:N \g_shipout_readonly_int } }
+ \_@@_add_foreground_box:n
+ { \UseHook{shipout/lastpage}
+ \@kernel@after@shipout@lastpage }
}
\bool_gset_true:N \g_@@_lastpage_handled_bool
}
+ \@@_finalize_box:
% \end{macrocode}
% Finally we run the actual \TeX{} primitive for shipout. As that will
% expand delayed \cs{write} statements inside the page in which
@@ -794,6 +1009,21 @@
% \begin{macrocode}
\cs_set_eq:NN \protect \exp_not:N
\tex_shipout:D \box_use:N \l_shipout_box
+% \end{macrocode}
+% The \cs{l_shipout_box} may contain the firstpage material if this
+% was the very first shipout. That makes it unsuitable for reuse in
+% another shipout, so as a safety measure the next command resets
+% \cs{l_shipout_box} to its earlier state if that is necessary. On
+% later pages this is then a no-op.
+% \begin{macrocode}
+ \@@_drop_firstpage_specials:
+% \end{macrocode}
+% The \hook{shipout/after} hook (if in \verb=#4=) needs to run with
+% \cs{protect}ed commands again being executed, because that hook
+% will ``typeset'' material added at the top of the next page.
+% \begin{macrocode}
+ \set@typeset@protect
+ #4
}
}
% \end{macrocode}
@@ -808,6 +1038,54 @@
% \end{macro}
%
%
+%
+%
+% \begin{macro}{\@@_execute_raw:,
+% \@@_execute_test_level_raw:}
+%
+% This implements the ``raw'' shipout which bypasses the before,
+% foreground, background and after hooks. It follows the same pattern than
+% \cs{_@@_execute_raw:} except that it finally calls
+% \cs{_@@_execute_main_cont:Nnnn} with three empty arguments.
+% instead of the hook code.
+% \begin{macrocode}
+\cs_set_protected:Npn \@@_execute_raw: {
+ \tl_set:Nx \l_@@_group_level_tl
+ { \int_value:w \tex_currentgrouplevel:D }
+ \tex_afterassignment:D \@@_execute_test_level_raw:
+ \tex_setbox:D \l_@@_raw_box
+}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\cs_new:Npn \@@_execute_test_level_raw: {
+ \int_compare:nNnT
+ \l_@@_group_level_tl < \tex_currentgrouplevel:D
+ \tex_aftergroup:D \@@_execute_nohooks_cont:
+}
+% \end{macrocode}
+% Well, not totally empty arguments, we add some debugging if we
+% are actually doing a shipout.
+% \begin{macrocode}
+\cs_new:Npn \@@_execute_nohooks_cont: {
+ \@@_execute_main_cont:Nnnn \l_@@_raw_box
+ {} { \@@_debug:n{ \typeout{Doing~ raw~ shipout~ ...} }
+ \box_set_eq:NN \l_shipout_box \l_@@_raw_box } {}
+}
+% \end{macrocode}
+% \end{macro}
+
+% \begin{macro}{\RawShipout}
+% The interface name for raw shipout.
+% \changes{v1.0g}{2021/01/10}{Macro added}
+% \begin{macrocode}
+\cs_gset_eq:NN \RawShipout \@@_execute_raw:
+% \end{macrocode}
+% \end{macro}
+%
+%
+%
+%
% \begin{macro}{\@@_saved_protect:}
% Remember the current \cs{protect} state.
% \begin{macrocode}
@@ -815,13 +1093,14 @@
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{shipout/before,
+% \begin{macro}{shipout/before,shipout/after,
% shipout/foreground,shipout/background,
% shipout/firstpage,
% shipout/lastpage}
% Declaring all hooks for the shipout code.
% \begin{macrocode}
\hook_new:n{shipout/before}
+\hook_new:n{shipout/after}
\hook_new:n{shipout/foreground}
\hook_new:n{shipout/background}
\hook_new:n{shipout/firstpage}
@@ -832,36 +1111,71 @@
%
%
% \begin{macro}{\@kernel@after@shipout@lastpage,
-% \@kernel@before@shipout@background}
+% \@kernel@before@shipout@background,
+% \@kernel@after@shipout@background}
% And here are the internal kernel hooks going before or after the
% public ones where needed.
+% \changes{v1.0g}{2021/01/10}{Internal hook
+% \cs{@kernel@after@shipout@background} added}
% \begin{macrocode}
\let\@kernel@after@shipout@lastpage\@empty
\let\@kernel@before@shipout@background\@empty
+\let\@kernel@after@shipout@background\@empty
% \end{macrocode}
% \end{macro}
%
%
-% \begin{macro}{\@@_execute_firstpage_hook: }
-% This command adds any specials into a box and adds that to the
-% very beginning of the first box shipped out. After that we
-% redefine it to do nothing on later pages.
+% \begin{macro}{\@@_run_firstpage_hook:}
+%
+% \changes{v1.0h}{2021/01/19}{Handling of firstpage hook altered}
+%
+% There are three commands to handle the \hook{shipout/firstpage}
+% hook:
+% \cs{@@_run_firstpage_hook:}, \cs{@@_add_firstpage_specials:} and
+% \cs{@@_drop_firstpage_specials:}.
+%
+% That hook is supposed to contain \cs{special}s and similar
+% material to be placed at the very beginning of the output page
+% and so it needs careful placing to avoid that anything else gets
+% in front of it. And this means we have to wait with this until
+% other hooks such as \hook{shipout/background} have added their
+% bits. It is also important that such \cs{special}s show up only
+% on the very first page, so if this page gets saved before
+% \cs{shipout} for later reuse, we have to make sure that they
+% aren't in the saved version.
+%
+% In addition the hook may also contain code to be executed ``first'', e.g.,
+% visible from code in \hook{shipout/background} and this conflicts
+% with adding the \cs{special}s late.
+%
+% Therefore the processing is split into different parts:
+% \cs{@@_run_firstpage_hook:} is done early and checks if there is
+% any material in the hook.
% \begin{macrocode}
-\cs_new:Npn \@@_execute_firstpage_hook: {
+\cs_new:Npn \@@_run_firstpage_hook: {
+ \hook_if_empty:nTF {shipout/firstpage}
% \end{macrocode}
-% Adding something to the beginning means adding it to the
-% background as that layer is done first in the output. Of course
-% that is only needed if the hook actually contains anything.
+% If not then we define the other two commands to do nothing.
% \begin{macrocode}
- \hook_if_empty:nF {shipout/firstpage}
- { \@@_add_background_box:n { \UseHook{shipout/firstpage} } }
+ {
+ \cs_gset_eq:NN \@@_add_firstpage_specials: \prg_do_nothing:
+ \cs_gset_eq:NN \@@_drop_firstpage_specials: \prg_do_nothing:
+ }
+% \end{macrocode}
+% If there is material we execute inside a box, which means any
+% \cs{special} will end up in that box and any other code is
+% executed and can have side effects (as long as they are global).
+% \begin{macrocode}
+ {
+ \hbox_set:Nn \l_@@_firstpage_box { \UseHook{shipout/firstpage} }
+ }
% \end{macrocode}
% Once we are here we change the definition to do nothing next time
% and we also change the command used to implement \cs{AtBeginDvi}
-% to become a warning and not add further material to a hook that
+% to become a warning and not add further material to a hook that
% is never used again.
% \begin{macrocode}
- \cs_gset_eq:NN \@@_execute_firstpage_hook: \prg_do_nothing:
+ \cs_gset_eq:NN \@@_run_firstpage_hook: \prg_do_nothing:
\cs_gset:Npn \@@_add_firstpage_material:Nn ##1 ##2 {
\@latex@warning{
First~ page~ is~ already~ shipped~ out,~ ignoring\MessageBreak
@@ -869,8 +1183,67 @@
}
}
% \end{macrocode}
+% \end{macro}
+%
+%
+%
+% \begin{macro}{\@@_add_firstpage_specials:,\@@_drop_firstpage_specials:}
+% The \cs{@@_add_firstpage_specials:} then adds the \cs{special}s
+% stored in \cs{l_@@_firstpage_box} to the page to be shipped out
+% when the time is ready. Note that if there was no material in the
+% \hook{shipout/firstpage} hook then this command gets redefined to
+% do nothing. But for most documents there is something, e.g., some
+% PostScript header, or some meta data declaration, etc.\ so by
+% default we assume there is something to do.
+% \begin{macrocode}
+\cs_new:Npn \@@_add_firstpage_specials: {
+% \end{macrocode}
+% First we make a copy of the \cs{l_shipout_box} that we can
+% restore it later on.
+% \begin{macrocode}
+ \box_set_eq:NN \l_@@_raw_box \l_shipout_box
+% \end{macrocode}
+% Adding something to the beginning means adding it to the
+% background as that layer is done first in the output.
+% \begin{macrocode}
+ \@@_add_background_box:n { \hbox_unpack_drop:N \l_@@_firstpage_box }
+% \end{macrocode}
+% After the actual shipout \cs{@@_drop_firstpage_specials:} is
+% run to
+% restore the earlier content of \cs{l_shipout_box} and then
+% redefines itself again to do nothing.
+%
+% As a final act we change the definition to do nothing next time.
+% \begin{macrocode}
+ \cs_gset_eq:NN \@@_add_firstpage_specials: \prg_do_nothing:
+}
+% \end{macrocode}
+%
+% The \cs{@@_drop_firstpage_specials:} is run after the shipout has
+% occurred but before the \hook{shipout/afterpage} hook is executed.
+% That is the point where we have to restore the \cs{ShipoutBox} to
+% its state without the \hook{shipout/firstpage} material.
+% \begin{macrocode}
+\cs_new:Npn \@@_drop_firstpage_specials: {
+ \box_set_eq:NN \l_shipout_box \l_@@_raw_box
+% \end{macrocode}
+% If there was no such material then \cs{@@_run_firstpage_hook:}
+% will have changed the definition to a no-op already. Otherwise
+% this is what we do here.
+% \begin{macrocode}
+ \cs_gset_eq:NN \@@_drop_firstpage_specials: \prg_do_nothing:
+ }
+% \end{macrocode}
% \end{macro}
%
+
+% \begin{macro}{\l_@@_firstpage_box}
+% The box to hold any firstpage \cs{special}s.
+% \begin{macrocode}
+\box_new:N \l_@@_firstpage_box
+% \end{macrocode}
+% \end{macro}
+
%
% \begin{macro}{\g_@@_lastpage_handled_bool}
% A boolean to signal if we have already handled the
@@ -911,8 +1284,8 @@
\dim_set:Nn \l_shipout_box_ht_dim { \box_ht:N #1 }
\dim_set:Nn \l_shipout_box_dp_dim { \box_dp:N #1 }
\dim_set:Nn \l_shipout_box_wd_dim { \box_wd:N #1 }
- \dim_set:Nn \l_shipout_box_ht_plus_dp_dim { \l_shipout_box_ht_dim +
- \l_shipout_box_dp_dim }
+ \dim_set:Nn \l_shipout_box_ht_plus_dp_dim
+ { \l_shipout_box_ht_dim + \l_shipout_box_dp_dim }
}
% \end{macrocode}
% \end{macro}
@@ -1442,7 +1815,8 @@
% defined so we better not use \cs{cs_new_protected:Npn} here.
% \changes{v1.0d}{2020/11/24}{Support for roll forward (gh/434)}
% \begin{macrocode}
-\cs_set_protected:Npn \AtBeginDvi {\@@_add_firstpage_material:Nn \AtBeginDvi}
+\cs_set_protected:Npn \AtBeginDvi
+ {\@@_add_firstpage_material:Nn \AtBeginDvi}
% \end{macrocode}
% \end{macro}
%
@@ -1471,6 +1845,7 @@
% \@expl@@@shipout@add@foreground@picture@@n}
% Some internals needed elsewhere.
%
+% \InternalDetectionOff
% \begin{macrocode}
\cs_set_eq:NN \@expl@@@shipout@add@firstpage@material@@Nn
\__shipout_add_firstpage_material:Nn
@@ -1495,6 +1870,7 @@
\cs_set_eq:NN \@expl@@@shipout@add@foreground@picture@@n
\__shipout_add_foreground_picture:n
% \end{macrocode}
+% \InternalDetectionOn
% \end{macro}
%
% \begin{macrocode}
@@ -1524,6 +1900,7 @@
%<latexrelease> \csname tex_shipout:D\endcsname
%<latexrelease>\fi
%<latexrelease>
+%<latexrelease>\let \RawShipout\@undefined
%<latexrelease>\let \ShipoutBox\@undefined
%<latexrelease>\let \ReadonlyShipoutCounter \@undefined
%<latexrelease>\let \c@totalpages \@undefined
@@ -1547,23 +1924,13 @@
%<latexrelease>\let \ShipoutBoxDepth \@undefined
%<latexrelease>\let \ShipoutBoxWidth \@undefined
%<latexrelease>
-%<latexrelease>\let \AtBeginShipoutDiscard \@undefined
-%<latexrelease>
-%<latexrelease>\let \AtBeginShipoutAddToBox \@undefined
-%<latexrelease>\let \AtBeginShipoutAddToBoxForeground \@undefined
-%<latexrelease>\let \AtBeginShipoutUpperLeft \@undefined
-%<latexrelease>\let \AtBeginShipoutUpperLeftForeground \@undefined
-%<latexrelease>
% \end{macrocode}
% We do not undo a substitution when rolling back. As the file
% support gets undone the underlying data is no longer used (and
% sufficiently obscure that it should not interfere with existing
% commands) and properly removing it would mean we need to make the
-% \cs{unclare@...} and its support macros available in all earlier
+% \cs{undeclare@...} and its support macros available in all earlier
% kernel releases which is pointless (and actually worse).
-% \begin{macrocode}
-%\undeclare@file@substitution{everyshi.sty}
-% \end{macrocode}
%
% \begin{macrocode}
%<latexrelease>
@@ -1647,7 +2014,7 @@
% \begin{macrocode}
%<*atbegshi-ltx>
\ProvidesPackage{atbegshi-ltx}
- [2020/10/15 v1.0b
+ [2021/01/10 v1.0c
Emulation of the original atbegshi^^Jpackage with kernel methods]
% \end{macrocode}
%
@@ -1659,6 +2026,7 @@
% \end{macro}
%
%
+%
% \begin{macro}{\AtBeginShipoutInit}
% Compatibility only, we aren't delaying \ldots
% \begin{macrocode}
@@ -1712,6 +2080,19 @@
% \end{macrocode}
% \end{macro}
%
+% \begin{macro}{\AtBeginShipoutOriginalShipout}
+% This offers the raw \cs{shipout} primitive of the engine. A page
+% shipped out with this is not counted by
+% \cs{ReadonlyShipoutCounter} counter and thus the mechanism to
+% place \cs{special}s at the very end of the output might fail,
+% etc. It should therefore not be used in new applications but is
+% only provided to allow running legacy code. For new code use the
+% commands provided by the kernel instead.
+% \begin{macrocode}
+\ExplSyntaxOn
+\cs_new_eq:NN \AtBeginShipoutOriginalShipout \tex_shipout:D
+% \end{macrocode}
+% \end{macro}
%
%
% \begin{macro}{\ShipoutBoxHeight,\ShipoutBoxWidth,\ShipoutBoxDepth}
@@ -1720,7 +2101,6 @@
% \verb=\the\ht<box>= value. This may has some implications in some
% use cases and if that is a problem then it might need changing.
% \begin{macrocode}
-\ExplSyntaxOn
\cs_new:Npn \ShipoutBoxHeight { \dim_use:N \l_shipout_box_ht_dim }
\cs_new:Npn \ShipoutBoxDepth { \dim_use:N \l_shipout_box_dp_dim }
\cs_new:Npn \ShipoutBoxWidth { \dim_use:N \l_shipout_box_wd_dim }
@@ -1747,56 +2127,8 @@
%
% \subsection{Package \pkg{everyshi} emulation}
%
-% \begin{macrocode}
-%<*everyshi-ltx>
-% \end{macrocode}
-%
-% \begin{macrocode}
-\ProvidesPackage{everyshi-ltx}
- [2020/10/15 v1.0b
- Emulation of the original everyshi^^Jpackage with kernel methods]
-% \end{macrocode}
-%
-% \begin{macro}{\EveryShipout,\AtNextShipout}
-% This package has only two public commands so simulating it is easy:
-% \begin{macrocode}
-\protected \def \EveryShipout {\AddToHook{shipout/before}}
-\protected \def \AtNextShipout {\AddToHookNext{shipout/before}}
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macrocode}
-% This is one difference between \pkg{everyshi} and the kernel
-% implementation, the latter does not directly use box 255.
-%
-% For usage by ordinary users this makes no difference but of a
-% package use complicated code together with \pkg{everyshi} and
-% directly manipulates box 255 then this package needs updating.
-% In most cases the updates are simple because the kernel offers
-% hooks that makes such complicated code unnecessary.
-%
-% We therefore add a little file into the adjusted package
-% \begin{macrocode}
-%%
-%% In normal circumstances the above emulation is sufficient and in
-%% all known packages (we know of) that use everyshi it either works or
-%% the packages have been adjusted.
-%%
-%% Code that directly manipulates box 255, however, might fail.
-%% If that is the case look at the shipout hooks offered now as
-%% they are normally sufficient to avoid such manipulations (or
-%% replace box 255 with \ShipoutBox in the code.
-%%
-%</everyshi-ltx>
-% \end{macrocode}
-%
-%
-% If the package is requested we substitute the one above:
-% \begin{macrocode}
-%<*2ekernel>
-\declare@file@substitution{everyshi.sty}{everyshi-ltx.sty}
-%</2ekernel>
-% \end{macrocode}
+% This is now directly handled in that package so emulation is not
+% necessary any more.
%
%
% Rather important :-)
diff --git a/macros/latex-dev/base/ltspace.dtx b/macros/latex-dev/base/ltspace.dtx
index 8b933e8c97..17fb0d6518 100644
--- a/macros/latex-dev/base/ltspace.dtx
+++ b/macros/latex-dev/base/ltspace.dtx
@@ -1,7 +1,7 @@
% \iffalse meta-comment
%
% Copyright (C) 1993-2021
-% The LaTeX3 Project and any individual authors listed elsewhere
+% The LaTeX Project and any individual authors listed elsewhere
% in this file.
%
% This file is part of the LaTeX base system.
diff --git a/macros/latex-dev/base/lttab.dtx b/macros/latex-dev/base/lttab.dtx
index 545b30d3af..a964b36575 100644
--- a/macros/latex-dev/base/lttab.dtx
+++ b/macros/latex-dev/base/lttab.dtx
@@ -1,7 +1,7 @@
% \iffalse meta-comment
%
% Copyright (C) 1993-2021
-% The LaTeX3 Project and any individual authors listed elsewhere
+% The LaTeX Project and any individual authors listed elsewhere
% in this file.
%
% This file is part of the LaTeX base system.
diff --git a/macros/latex-dev/base/lttextcomp.dtx b/macros/latex-dev/base/lttextcomp.dtx
index 3ea90d005f..d840f0448b 100644
--- a/macros/latex-dev/base/lttextcomp.dtx
+++ b/macros/latex-dev/base/lttextcomp.dtx
@@ -1,7 +1,7 @@
% \iffalse meta-comment
%
% Copyright (C) 2019-2021
-% The LaTeX3 Project and any individual authors listed elsewhere
+% The LaTeX Project and any individual authors listed elsewhere
% in this file.
%
% This file is part of the LaTeX base system.
@@ -26,6 +26,9 @@
% extension .ins) which are part of the distribution.
%
% \fi
+%
+%%% From File: lttextcomp.dtx
+%
% \iffalse
%
%<*driver>
@@ -33,7 +36,7 @@
%
%
\ProvidesFile{lttextcomp.dtx}
- [2020/12/05 v1.0d LaTeX Kernel (text companion symbols)]
+ [2021/01/20 v1.0d LaTeX Kernel (text companion symbols)]
% \iffalse
\documentclass{ltxdoc}
\begin{document}
@@ -362,13 +365,14 @@
}
% \end{macrocode}
% \end{macro}
-
-
-
-
+%
+%
+%
+%
+%
% \begin{macro}{\tc@fake@euro}
% |\tc@fake@euro| is an example of a ``fake'' definition to use in arg |#3| of
-% |\CheckEncodingSubset| when a symbol is not available in a
+% the command |\CheckEncodingSubset| when a symbol is not available in a
% certain font family. Here we produce a poor man's Euro symbol by combining
% a ``C'' with a ``=''.
% \begin{macrocode}
@@ -386,10 +390,10 @@
}
% \end{macrocode}
% \end{macro}
-
-
-
-
+%
+%
+%
+%
% \begin{macro}{\tc@check@symbol}
% \begin{macro}{\tc@check@accent}
% These are two abbreviations that we use below to check symbols
@@ -401,12 +405,12 @@
% to ensure that |\textcurrency| is only typeset if the current
% font has a \texttt{TS1} subset id of less than 3. Otherwise
% |\tc@error| is called telling the user that for this font family
-% |\textcurreny| is not available.
+% |\textcurrency| is not available.
% \begin{macrocode}
\def\tc@check@symbol{\CheckEncodingSubset\UseTextSymbol{TS1}\tc@subst}
% \end{macrocode}
%
-% Accents and been mad an error in the \texttt{textcomp} package when
+% Accents have been made an error in the \texttt{textcomp} package when
% not available. Now that we provide the functionality in the
% kernel we avoid the error by swapping in a \texttt{T1} accent if
% the \texttt{TS1} accent is not available.
@@ -415,7 +419,8 @@
% \end{macrocode}
%
% \begin{macrocode}
-\def\tc@check@accent#1{\CheckEncodingSubset\UseTextAccent{TS1}{\tc@swap@accent#1}}
+\def\tc@check@accent#1{\CheckEncodingSubset\UseTextAccent
+ {TS1}{\tc@swap@accent#1}}
\def\tc@swap@accent#1#2{\UseTextAccent{T1}#1}
% \end{macrocode}
% \end{macro}
@@ -430,17 +435,17 @@
%
% \begin{macrocode}
\DeclareTextSymbolDefault{\textdollar}{TS1}
-\UndeclareTextCommand{\textdollar} {OT1} % don't use the OT1 def any longer
+\UndeclareTextCommand{\textdollar}{OT1} % don't use the OT1 def any longer
% \end{macrocode}
%
% \begin{macrocode}
\DeclareTextSymbolDefault{\textsterling}{TS1}
-\UndeclareTextCommand{\textsterling}{OT1} % don't use the OT1 def any longer
+\UndeclareTextCommand{\textsterling}{OT1}% don't use the OT1 def any longer
% \end{macrocode}
%
% \begin{macrocode}
\DeclareTextSymbolDefault{\textperthousand}{TS1}
-\UndeclareTextCommand{\textperthousand}{T1} % don't use the T1 def
+\UndeclareTextCommand{\textperthousand}{T1} % don't use the T1 def
% \end{macrocode}
% Using \cs{UndeclareTextCommand} above is enough only if the
% encoding definition files are not reloaded afterwards. In the
@@ -462,9 +467,9 @@
% \end{macrocode}
%
% And here are the other \texttt{TS1} glyphs that are implemented
-% by every font (or nearly everyone---a few are commented out and
+% by every font (or nearly every---a few are commented out and
% moved to sub-encoding 9,
-% because they aren't around in one or two fonts.
+% because they aren't around in some fonts.
% \begin{macrocode}
%%\DeclareTextSymbolDefault{\textbardbl}{TS1} % subst in sub-enc 9 above
\DeclareTextSymbolDefault{\textbrokenbar}{TS1}
@@ -541,31 +546,49 @@
%
% \begin{macrocode}
\ifx\Umathcode\@undefined
- \DeclareTextCommandDefault{\capitalacute} {\tc@check@accent{\'}2\capitalacute}
- \DeclareTextCommandDefault{\capitalbreve} {\tc@check@accent{\u}2\capitalbreve}
- \DeclareTextCommandDefault{\capitalcaron} {\tc@check@accent{\v}2\capitalcaron}
- \DeclareTextCommandDefault{\capitalcedilla} {\tc@check@accent{\c}2\capitalcedilla}
- \DeclareTextCommandDefault{\capitalcircumflex} {\tc@check@accent{\^}2\capitalcircumflex}
- \DeclareTextCommandDefault{\capitaldieresis} {\tc@check@accent{\"}2\capitaldieresis}
- \DeclareTextCommandDefault{\capitaldotaccent} {\tc@check@accent{\.}2\capitaldotaccent}
- \DeclareTextCommandDefault{\capitalgrave} {\tc@check@accent{\`}2\capitalgrave}
- \DeclareTextCommandDefault{\capitalhungarumlaut}{\tc@check@accent{\H}2\capitalhungarumlaut}
- \DeclareTextCommandDefault{\capitalmacron} {\tc@check@accent{\=}2\capitalmacron}
- \DeclareTextCommandDefault{\capitalogonek} {\tc@check@accent{\k}2\capitalogonek}
- \DeclareTextCommandDefault{\capitalring} {\tc@check@accent{\r}2\capitalring}
- \DeclareTextCommandDefault{\capitaltie} {\tc@check@accent{\t}2\capitaltie}
- \DeclareTextCommandDefault{\capitaltilde} {\tc@check@accent{\~}2\capitaltilde}
+ \DeclareTextCommandDefault{\capitalacute}
+ {\tc@check@accent{\'}2\capitalacute}
+ \DeclareTextCommandDefault{\capitalbreve}
+ {\tc@check@accent{\u}2\capitalbreve}
+ \DeclareTextCommandDefault{\capitalcaron}
+ {\tc@check@accent{\v}2\capitalcaron}
+ \DeclareTextCommandDefault{\capitalcedilla}
+ {\tc@check@accent{\c}2\capitalcedilla}
+ \DeclareTextCommandDefault{\capitalcircumflex}
+ {\tc@check@accent{\^}2\capitalcircumflex}
+ \DeclareTextCommandDefault{\capitaldieresis}
+ {\tc@check@accent{\"}2\capitaldieresis}
+ \DeclareTextCommandDefault{\capitaldotaccent}
+ {\tc@check@accent{\.}2\capitaldotaccent}
+ \DeclareTextCommandDefault{\capitalgrave}
+ {\tc@check@accent{\`}2\capitalgrave}
+ \DeclareTextCommandDefault{\capitalhungarumlaut}
+ {\tc@check@accent{\H}2\capitalhungarumlaut}
+ \DeclareTextCommandDefault{\capitalmacron}
+ {\tc@check@accent{\=}2\capitalmacron}
+ \DeclareTextCommandDefault{\capitalogonek}
+ {\tc@check@accent{\k}2\capitalogonek}
+ \DeclareTextCommandDefault{\capitalring}
+ {\tc@check@accent{\r}2\capitalring}
+ \DeclareTextCommandDefault{\capitaltie}
+ {\tc@check@accent{\t}2\capitaltie}
+ \DeclareTextCommandDefault{\capitaltilde}
+ {\tc@check@accent{\~}2\capitaltilde}
% \end{macrocode}
% For \cs{newtie} and \cs{capitalnewtie} this is actually wrong, they should pick up
% the accent from the substitution font (not done yet).
% \begin{macrocode}
- \DeclareTextCommandDefault{\newtie} {\tc@check@accent{\t}2\newtie}
- \DeclareTextCommandDefault{\capitalnewtie} {\tc@check@accent{\t}2\capitalnewtie}
+ \DeclareTextCommandDefault{\newtie}
+ {\tc@check@accent{\t}2\newtie}
+ \DeclareTextCommandDefault{\capitalnewtie}
+ {\tc@check@accent{\t}2\capitalnewtie}
% \end{macrocode}
%
% In Unicode engines we just execute the simple accents:
-% \changes{v1.0c}{2020/02/10}{Use \cs{@tabacckludge} for tabbing where necessary (gh/271)}
-% \changes{v1.0d}{2020/04/29}{Make all capital accents text commands for hyperref (gh/332)}
+% \changes{v1.0c}{2020/02/10}{Use \cs{@tabacckludge} for
+% tabbing where necessary (gh/271)}
+% \changes{v1.0d}{2020/04/29}{Make all capital accents text
+% commands for hyperref (gh/332)}
% \begin{macrocode}
\else
\DeclareTextCommandDefault\capitalacute{\@tabacckludge'}
@@ -593,8 +616,10 @@
% The next two symbols exist in some fonts (faked?), but we ignore
% that to keep the subsets reasonable compact and most important linear.
% \begin{macrocode}
-\DeclareTextCommandDefault{\textlbrackdbl} {\tc@check@symbol2\textlbrackdbl}
-\DeclareTextCommandDefault{\textrbrackdbl} {\tc@check@symbol2\textrbrackdbl}
+\DeclareTextCommandDefault{\textlbrackdbl}
+ {\tc@check@symbol2\textlbrackdbl}
+\DeclareTextCommandDefault{\textrbrackdbl}
+ {\tc@check@symbol2\textrbrackdbl}
% \end{macrocode}
%
%
@@ -603,72 +628,118 @@
% claim they aren't in sub-encoding 2 as that's true for most
% fonts.
% \begin{macrocode}
-\DeclareTextCommandDefault{\texteightoldstyle} {\tc@check@symbol2\texteightoldstyle}
-\DeclareTextCommandDefault{\textfiveoldstyle} {\tc@check@symbol2\textfiveoldstyle}
-\DeclareTextCommandDefault{\textfouroldstyle} {\tc@check@symbol2\textfouroldstyle}
-\DeclareTextCommandDefault{\textnineoldstyle} {\tc@check@symbol2\textnineoldstyle}
-\DeclareTextCommandDefault{\textoneoldstyle} {\tc@check@symbol2\textoneoldstyle}
-\DeclareTextCommandDefault{\textsevenoldstyle} {\tc@check@symbol2\textsevenoldstyle}
-\DeclareTextCommandDefault{\textsixoldstyle} {\tc@check@symbol2\textsixoldstyle}
-\DeclareTextCommandDefault{\textthreeoldstyle} {\tc@check@symbol2\textthreeoldstyle}
-\DeclareTextCommandDefault{\texttwooldstyle} {\tc@check@symbol2\texttwooldstyle}
-\DeclareTextCommandDefault{\textzerooldstyle} {\tc@check@symbol2\textzerooldstyle}
-% \end{macrocode}
-%
-%
-%
-% The next set of glyphs is special to TeX fonts (and available
-% with a few older PS fonts supported in the virtual fonts), but
+\DeclareTextCommandDefault{\texteightoldstyle}
+ {\tc@check@symbol2\texteightoldstyle}
+\DeclareTextCommandDefault{\textfiveoldstyle}
+ {\tc@check@symbol2\textfiveoldstyle}
+\DeclareTextCommandDefault{\textfouroldstyle}
+ {\tc@check@symbol2\textfouroldstyle}
+\DeclareTextCommandDefault{\textnineoldstyle}
+ {\tc@check@symbol2\textnineoldstyle}
+\DeclareTextCommandDefault{\textoneoldstyle}
+ {\tc@check@symbol2\textoneoldstyle}
+\DeclareTextCommandDefault{\textsevenoldstyle}
+ {\tc@check@symbol2\textsevenoldstyle}
+\DeclareTextCommandDefault{\textsixoldstyle}
+ {\tc@check@symbol2\textsixoldstyle}
+\DeclareTextCommandDefault{\textthreeoldstyle}
+ {\tc@check@symbol2\textthreeoldstyle}
+\DeclareTextCommandDefault{\texttwooldstyle}
+ {\tc@check@symbol2\texttwooldstyle}
+\DeclareTextCommandDefault{\textzerooldstyle}
+ {\tc@check@symbol2\textzerooldstyle}
+% \end{macrocode}
+%
+%
+%
+% The next set of glyphs is special to \TeX{} fonts (and available
+% with a few older PS fonts supported through virtual fonts), but
% not any longer in the majority of fonts provided through
% autoinst, so we pretend there aren't available in sub-encoding 2
% and below.
% \begin{macrocode}
-\DeclareTextCommandDefault{\textacutedbl} {\tc@check@symbol2\textacutedbl}
-\DeclareTextCommandDefault{\textasciiacute} {\tc@check@symbol2\textasciiacute}
-\DeclareTextCommandDefault{\textasciibreve} {\tc@check@symbol2\textasciibreve}
-\DeclareTextCommandDefault{\textasciicaron} {\tc@check@symbol2\textasciicaron}
-\DeclareTextCommandDefault{\textasciidieresis} {\tc@check@symbol2\textasciidieresis}
-\DeclareTextCommandDefault{\textasciigrave} {\tc@check@symbol2\textasciigrave}
-\DeclareTextCommandDefault{\textasciimacron} {\tc@check@symbol2\textasciimacron}
-\DeclareTextCommandDefault{\textgravedbl} {\tc@check@symbol2\textgravedbl}
-\DeclareTextCommandDefault{\texttildelow} {\tc@check@symbol2\texttildelow}
+\DeclareTextCommandDefault{\textacutedbl}
+ {\tc@check@symbol2\textacutedbl}
+\DeclareTextCommandDefault{\textasciiacute}
+ {\tc@check@symbol2\textasciiacute}
+\DeclareTextCommandDefault{\textasciibreve}
+ {\tc@check@symbol2\textasciibreve}
+\DeclareTextCommandDefault{\textasciicaron}
+ {\tc@check@symbol2\textasciicaron}
+\DeclareTextCommandDefault{\textasciidieresis}
+ {\tc@check@symbol2\textasciidieresis}
+\DeclareTextCommandDefault{\textasciigrave}
+ {\tc@check@symbol2\textasciigrave}
+\DeclareTextCommandDefault{\textasciimacron}
+ {\tc@check@symbol2\textasciimacron}
+\DeclareTextCommandDefault{\textgravedbl}
+ {\tc@check@symbol2\textgravedbl}
+\DeclareTextCommandDefault{\texttildelow}
+ {\tc@check@symbol2\texttildelow}
% \end{macrocode}
%
%
% Finally those below are only available in CM-based fonts but in
% no font that has its origin outside of the \TeX{} world.
% \begin{macrocode}
-\DeclareTextCommandDefault{\textbaht} {\tc@check@symbol2\textbaht}
-\DeclareTextCommandDefault{\textbigcircle} {\tc@check@symbol2\textbigcircle}
-\DeclareTextCommandDefault{\textborn} {\tc@check@symbol2\textborn}
-\DeclareTextCommandDefault{\textcentoldstyle} {\tc@check@symbol2\textcentoldstyle}
-\DeclareTextCommandDefault{\textcircledP} {\tc@check@symbol2\textcircledP}
-\DeclareTextCommandDefault{\textcopyleft} {\tc@check@symbol2\textcopyleft}
-\DeclareTextCommandDefault{\textdblhyphenchar} {\tc@check@symbol2\textdblhyphenchar}
-\DeclareTextCommandDefault{\textdblhyphen} {\tc@check@symbol2\textdblhyphen}
-\DeclareTextCommandDefault{\textdied} {\tc@check@symbol2\textdied}
-\DeclareTextCommandDefault{\textdiscount} {\tc@check@symbol2\textdiscount}
-\DeclareTextCommandDefault{\textdivorced} {\tc@check@symbol2\textdivorced}
-\DeclareTextCommandDefault{\textdollaroldstyle} {\tc@check@symbol2\textdollaroldstyle}
-\DeclareTextCommandDefault{\textguarani} {\tc@check@symbol2\textguarani}
-\DeclareTextCommandDefault{\textleaf} {\tc@check@symbol2\textleaf}
-\DeclareTextCommandDefault{\textlquill} {\tc@check@symbol2\textlquill}
-\DeclareTextCommandDefault{\textmarried} {\tc@check@symbol2\textmarried}
-\DeclareTextCommandDefault{\textmho} {\tc@check@symbol2\textmho}
-\DeclareTextCommandDefault{\textmusicalnote} {\tc@check@symbol2\textmusicalnote}
-\DeclareTextCommandDefault{\textnaira} {\tc@check@symbol2\textnaira}
-\DeclareTextCommandDefault{\textopenbullet} {\tc@check@symbol2\textopenbullet}
-\DeclareTextCommandDefault{\textpeso} {\tc@check@symbol2\textpeso}
-\DeclareTextCommandDefault{\textpilcrow} {\tc@check@symbol2\textpilcrow}
-\DeclareTextCommandDefault{\textrecipe} {\tc@check@symbol2\textrecipe}
-\DeclareTextCommandDefault{\textreferencemark} {\tc@check@symbol2\textreferencemark}
-\DeclareTextCommandDefault{\textrquill} {\tc@check@symbol2\textrquill}
-\DeclareTextCommandDefault{\textservicemark} {\tc@check@symbol2\textservicemark}
-\DeclareTextCommandDefault{\textsurd} {\tc@check@symbol2\textsurd}
+\DeclareTextCommandDefault{\textbaht}
+ {\tc@check@symbol2\textbaht}
+\DeclareTextCommandDefault{\textbigcircle}
+ {\tc@check@symbol2\textbigcircle}
+\DeclareTextCommandDefault{\textborn}
+ {\tc@check@symbol2\textborn}
+\DeclareTextCommandDefault{\textcentoldstyle}
+ {\tc@check@symbol2\textcentoldstyle}
+\DeclareTextCommandDefault{\textcircledP}
+ {\tc@check@symbol2\textcircledP}
+\DeclareTextCommandDefault{\textcopyleft}
+ {\tc@check@symbol2\textcopyleft}
+\DeclareTextCommandDefault{\textdblhyphenchar}
+ {\tc@check@symbol2\textdblhyphenchar}
+\DeclareTextCommandDefault{\textdblhyphen}
+ {\tc@check@symbol2\textdblhyphen}
+\DeclareTextCommandDefault{\textdied}
+ {\tc@check@symbol2\textdied}
+\DeclareTextCommandDefault{\textdiscount}
+ {\tc@check@symbol2\textdiscount}
+\DeclareTextCommandDefault{\textdivorced}
+ {\tc@check@symbol2\textdivorced}
+\DeclareTextCommandDefault{\textdollaroldstyle}
+ {\tc@check@symbol2\textdollaroldstyle}
+\DeclareTextCommandDefault{\textguarani}
+ {\tc@check@symbol2\textguarani}
+\DeclareTextCommandDefault{\textleaf}
+ {\tc@check@symbol2\textleaf}
+\DeclareTextCommandDefault{\textlquill}
+ {\tc@check@symbol2\textlquill}
+\DeclareTextCommandDefault{\textmarried}
+ {\tc@check@symbol2\textmarried}
+\DeclareTextCommandDefault{\textmho}
+ {\tc@check@symbol2\textmho}
+\DeclareTextCommandDefault{\textmusicalnote}
+ {\tc@check@symbol2\textmusicalnote}
+\DeclareTextCommandDefault{\textnaira}
+ {\tc@check@symbol2\textnaira}
+\DeclareTextCommandDefault{\textopenbullet}
+ {\tc@check@symbol2\textopenbullet}
+\DeclareTextCommandDefault{\textpeso}
+ {\tc@check@symbol2\textpeso}
+\DeclareTextCommandDefault{\textpilcrow}
+ {\tc@check@symbol2\textpilcrow}
+\DeclareTextCommandDefault{\textrecipe}
+ {\tc@check@symbol2\textrecipe}
+\DeclareTextCommandDefault{\textreferencemark}
+ {\tc@check@symbol2\textreferencemark}
+\DeclareTextCommandDefault{\textrquill}
+ {\tc@check@symbol2\textrquill}
+\DeclareTextCommandDefault{\textservicemark}
+ {\tc@check@symbol2\textservicemark}
+\DeclareTextCommandDefault{\textsurd}
+ {\tc@check@symbol2\textsurd}
% \end{macrocode}
%
% The \cs{textpertenthousand} also belongs in this group but here
-% we have a choice: in T1 there is definition for
+% we have a choice: in T1 there is a definition for
% \cs{textpertenthousand} making the symbol up from \% and
% \verb=\char 24= (twice) but in many fonts that char doesn't exist
% and the slot is reused for random ligatures. So better not use it
@@ -679,7 +750,8 @@
% Alternatively we could just state that the symbol is unavailable in
% those fonts. For now I substitute.
% \begin{macrocode}
-\DeclareTextCommandDefault{\textpertenthousand} {\tc@check@symbol2\textpertenthousand}
+\DeclareTextCommandDefault{\textpertenthousand}
+ {\tc@check@symbol2\textpertenthousand}
\UndeclareTextCommand{\textpertenthousand}{T1}
% \end{macrocode}
%
@@ -691,8 +763,10 @@
% symbols. In the higher-numbered sub-encodings we see only a few
% dropped additionally.
% \begin{macrocode}
-\DeclareTextCommandDefault{\textlangle} {\tc@check@symbol3\textlangle}
-\DeclareTextCommandDefault{\textrangle} {\tc@check@symbol3\textrangle}
+\DeclareTextCommandDefault{\textlangle}
+ {\tc@check@symbol3\textlangle}
+\DeclareTextCommandDefault{\textrangle}
+ {\tc@check@symbol3\textrangle}
% \end{macrocode}
%
%
@@ -702,14 +776,22 @@
% \subsection{Sub-encoding \texttt{4}}
%
% \begin{macrocode}
-\DeclareTextCommandDefault{\textcolonmonetary} {\tc@check@symbol4\textcolonmonetary}
-\DeclareTextCommandDefault{\textdong} {\tc@check@symbol4\textdong}
-\DeclareTextCommandDefault{\textdownarrow} {\tc@check@symbol4\textdownarrow}
-\DeclareTextCommandDefault{\textleftarrow} {\tc@check@symbol4\textleftarrow}
-\DeclareTextCommandDefault{\textlira} {\tc@check@symbol4\textlira}
-\DeclareTextCommandDefault{\textrightarrow} {\tc@check@symbol4\textrightarrow}
-\DeclareTextCommandDefault{\textuparrow} {\tc@check@symbol4\textuparrow}
-\DeclareTextCommandDefault{\textwon} {\tc@check@symbol4\textwon}
+\DeclareTextCommandDefault{\textcolonmonetary}
+ {\tc@check@symbol4\textcolonmonetary}
+\DeclareTextCommandDefault{\textdong}
+ {\tc@check@symbol4\textdong}
+\DeclareTextCommandDefault{\textdownarrow}
+ {\tc@check@symbol4\textdownarrow}
+\DeclareTextCommandDefault{\textleftarrow}
+ {\tc@check@symbol4\textleftarrow}
+\DeclareTextCommandDefault{\textlira}
+ {\tc@check@symbol4\textlira}
+\DeclareTextCommandDefault{\textrightarrow}
+ {\tc@check@symbol4\textrightarrow}
+\DeclareTextCommandDefault{\textuparrow}
+ {\tc@check@symbol4\textuparrow}
+\DeclareTextCommandDefault{\textwon}
+ {\tc@check@symbol4\textwon}
% \end{macrocode}
%
%
@@ -727,15 +809,17 @@
%
% But the coverage is so random that it is impossible to sort them
% properly and if we tried to ensure that they only typeset those
-% glyphs that are really always available would put them all into
-% sub-encoding \texttt{9} so that's a compromise really.
+% glyphs that are really always available, we would have to put them all into
+% sub-encoding \texttt{9}; so putting them into 5 is really a compromise.
%
-% Modern fonts that don't typeset a tofu character if a glyph is
-% missing are only cataloged as sub-encoding \texttt{5} if they
-% really support of its glyph set.
+% Modern fonts usually don't typeset a tofu character if a glyph is
+% missing. They are therefore only classified as sub-encoding \texttt{5} if they
+% really support its glyph set completely.
% \begin{macrocode}
-\DeclareTextCommandDefault{\textestimated} {\tc@check@symbol5\textestimated}
-\DeclareTextCommandDefault{\textnumero} {\tc@check@symbol5\textnumero}
+\DeclareTextCommandDefault{\textestimated}
+ {\tc@check@symbol5\textestimated}
+\DeclareTextCommandDefault{\textnumero}
+ {\tc@check@symbol5\textnumero}
% \end{macrocode}
%
%
@@ -744,8 +828,10 @@
% \subsection{Sub-encoding \texttt{6}}
%
% \begin{macrocode}
-\DeclareTextCommandDefault{\textflorin} {\tc@check@symbol6\textflorin}
-\DeclareTextCommandDefault{\textcurrency} {\tc@check@symbol6\textcurrency}
+\DeclareTextCommandDefault{\textflorin}
+ {\tc@check@symbol6\textflorin}
+\DeclareTextCommandDefault{\textcurrency}
+ {\tc@check@symbol6\textcurrency}
% \end{macrocode}
%
%
@@ -753,10 +839,14 @@
% \subsection{Sub-encoding \texttt{7}}
%
% \begin{macrocode}
-\DeclareTextCommandDefault{\textfractionsolidus}{\tc@check@symbol7\textfractionsolidus}
-\DeclareTextCommandDefault{\textohm} {\tc@check@symbol7\textohm}
-\DeclareTextCommandDefault{\textmu} {\tc@check@symbol7\textmu}
-\DeclareTextCommandDefault{\textminus} {\tc@check@symbol7\textminus}
+\DeclareTextCommandDefault{\textfractionsolidus}
+ {\tc@check@symbol7\textfractionsolidus}
+\DeclareTextCommandDefault{\textohm}
+ {\tc@check@symbol7\textohm}
+\DeclareTextCommandDefault{\textmu}
+ {\tc@check@symbol7\textmu}
+\DeclareTextCommandDefault{\textminus}
+ {\tc@check@symbol7\textminus}
% \end{macrocode}
%
%
@@ -764,16 +854,19 @@
% \subsection{Sub-encoding \texttt{8}}
%
% \begin{macrocode}
-\DeclareTextCommandDefault{\textblank} {\tc@check@symbol{8}\textblank}
-\DeclareTextCommandDefault{\textinterrobangdown}{\tc@check@symbol{8}\textinterrobangdown}
-\DeclareTextCommandDefault{\textinterrobang} {\tc@check@symbol{8}\textinterrobang}
+\DeclareTextCommandDefault{\textblank}
+ {\tc@check@symbol{8}\textblank}
+\DeclareTextCommandDefault{\textinterrobangdown}
+ {\tc@check@symbol{8}\textinterrobangdown}
+\DeclareTextCommandDefault{\textinterrobang}
+ {\tc@check@symbol{8}\textinterrobang}
% \end{macrocode}
%
% Fonts with this sub-encoding don't have a Euro symbol, but
% instead of substituting we fake it.
% \begin{macrocode}
\DeclareTextCommandDefault{\texteuro}
- {\CheckEncodingSubset\UseTextSymbol{TS1}\tc@fake@euro{8}\texteuro}
+ {\CheckEncodingSubset\UseTextSymbol{TS1}\tc@fake@euro{8}\texteuro}
% \end{macrocode}
%
%
@@ -782,13 +875,20 @@
% \subsection{Sub-encoding \texttt{9} (most missing)}
%
% \begin{macrocode}
-\DeclareTextCommandDefault{\textcelsius}{\tc@check@symbol{9}\textcelsius}
-\DeclareTextCommandDefault{\textonesuperior}{\tc@check@symbol{9}\textonesuperior}
-\DeclareTextCommandDefault{\textthreequartersemdash}{\tc@check@symbol{9}\textthreequartersemdash}
-\DeclareTextCommandDefault{\textthreesuperior}{\tc@check@symbol{9}\textthreesuperior}
-\DeclareTextCommandDefault{\texttwelveudash}{\tc@check@symbol{9}\texttwelveudash}
-\DeclareTextCommandDefault{\texttwosuperior}{\tc@check@symbol{9}\texttwosuperior}
-\DeclareTextCommandDefault{\textbardbl}{\tc@check@symbol{9}\textbardbl}
+\DeclareTextCommandDefault{\textcelsius}
+ {\tc@check@symbol{9}\textcelsius}
+\DeclareTextCommandDefault{\textonesuperior}
+ {\tc@check@symbol{9}\textonesuperior}
+\DeclareTextCommandDefault{\textthreequartersemdash}
+ {\tc@check@symbol{9}\textthreequartersemdash}
+\DeclareTextCommandDefault{\textthreesuperior}
+ {\tc@check@symbol{9}\textthreesuperior}
+\DeclareTextCommandDefault{\texttwelveudash}
+ {\tc@check@symbol{9}\texttwelveudash}
+\DeclareTextCommandDefault{\texttwosuperior}
+ {\tc@check@symbol{9}\texttwosuperior}
+\DeclareTextCommandDefault{\textbardbl}
+ {\tc@check@symbol{9}\textbardbl}
% \end{macrocode}
%
%
@@ -832,18 +932,18 @@
% \end{macrocode}
% These have Unicode slots so this should be integrated into TU explicitly
% \begin{macrocode}
-\DeclareTextSymbol{\textpilcrow} \UnicodeEncodingName{"00B6}
-\DeclareTextSymbol{\textborn} \UnicodeEncodingName{"002A}
-\DeclareTextSymbol{\textdied} \UnicodeEncodingName{"2020}
-\DeclareTextSymbol{\textlbrackdbl} \UnicodeEncodingName{"27E6}
-\DeclareTextSymbol{\textrbrackdbl} \UnicodeEncodingName{"27E7}
-\DeclareTextSymbol{\textguarani} \UnicodeEncodingName{"20B2}
+\DeclareTextSymbol{\textpilcrow} \UnicodeEncodingName{"00B6}
+\DeclareTextSymbol{\textborn} \UnicodeEncodingName{"002A}
+\DeclareTextSymbol{\textdied} \UnicodeEncodingName{"2020}
+\DeclareTextSymbol{\textlbrackdbl} \UnicodeEncodingName{"27E6}
+\DeclareTextSymbol{\textrbrackdbl} \UnicodeEncodingName{"27E7}
+\DeclareTextSymbol{\textguarani} \UnicodeEncodingName{"20B2}
% \end{macrocode}
% We could make \cs{textcentoldstyle} and \cs{textdollaroldstyle}
% point to dollar and cent in the Unicode encoding
% \begin{macrocode}
-%\DeclareTextSymbol{\textcentoldstyle} \UnicodeEncodingName{"00A2}
-%\DeclareTextSymbol{\textdollaroldstyle} \UnicodeEncodingName{"0024}
+%\DeclareTextSymbol{\textcentoldstyle} \UnicodeEncodingName{"00A2}
+%\DeclareTextSymbol{\textdollaroldstyle}\UnicodeEncodingName{"0024}
% \end{macrocode}
% but I think it is better to pick them up from TS1 even if that
% usually means LMR fonts
@@ -908,7 +1008,8 @@
\DeclareEncodingSubset{TS1}{lmss} {1}
\DeclareEncodingSubset{TS1}{lmssq} {1}
\DeclareEncodingSubset{TS1}{lmvtt} {1}
-\DeclareEncodingSubset{TS1}{lmtt} {1} % missing TM, SM, pertenthousand for some reason
+\DeclareEncodingSubset{TS1}{lmtt} {1} % missing TM, SM and
+ % pertenthousand for some reason
% \end{macrocode}
%
% \begin{macrocode}
@@ -918,33 +1019,33 @@
% \end{macrocode}
%
% \begin{macrocode}
-\DeclareEncodingSubset{TS1}{bch} {5} % tofu for blank, ohm
-\DeclareEncodingSubset{TS1}{futj} {5} % tofu for blank, interrobang/down, ohm
-\DeclareEncodingSubset{TS1}{futs} {5} % tofu for blank, ohm
-\DeclareEncodingSubset{TS1}{futx} {5} % probably (currently broken distrib)
-\DeclareEncodingSubset{TS1}{pag} {5} % tofu for blank, interrobang/down, ohm
-\DeclareEncodingSubset{TS1}{pbk} {5} % tofu for blank, interrobang/down, ohm
-\DeclareEncodingSubset{TS1}{pcr} {5} % tofu for blank, interrobang/down, ohm
-\DeclareEncodingSubset{TS1}{phv} {5} % tofu for blank, interrobang/down, ohm
-\DeclareEncodingSubset{TS1}{pnc} {5} % tofu for blank, interrobang/down, ohm
-\DeclareEncodingSubset{TS1}{pplj} {5} % tofu for blank
-\DeclareEncodingSubset{TS1}{pplx} {5} % tofu for blank
-\DeclareEncodingSubset{TS1}{ppl} {5} % tofu for blank interrobang/down
-\DeclareEncodingSubset{TS1}{ptm} {5} % tofu for blank, interrobang/down, ohm
-\DeclareEncodingSubset{TS1}{pzc} {5} % tofu for blank, interrobang/down, ohm
-\DeclareEncodingSubset{TS1}{ul9} {5} % tofu for blank, interrobang/down, ohm
+\DeclareEncodingSubset{TS1}{bch} {5} % tofu for blank, ohm
+\DeclareEncodingSubset{TS1}{futj}{5} % tofu for blank, interrobang/down, ohm
+\DeclareEncodingSubset{TS1}{futs}{5} % tofu for blank, ohm
+\DeclareEncodingSubset{TS1}{futx}{5} % probably (currently broken distrib)
+\DeclareEncodingSubset{TS1}{pag} {5} % tofu for blank, interrobang/down, ohm
+\DeclareEncodingSubset{TS1}{pbk} {5} % tofu for blank, interrobang/down, ohm
+\DeclareEncodingSubset{TS1}{pcr} {5} % tofu for blank, interrobang/down, ohm
+\DeclareEncodingSubset{TS1}{phv} {5} % tofu for blank, interrobang/down, ohm
+\DeclareEncodingSubset{TS1}{pnc} {5} % tofu for blank, interrobang/down, ohm
+\DeclareEncodingSubset{TS1}{pplj}{5} % tofu for blank
+\DeclareEncodingSubset{TS1}{pplx}{5} % tofu for blank
+\DeclareEncodingSubset{TS1}{ppl} {5} % tofu for blank interrobang/down
+\DeclareEncodingSubset{TS1}{ptm} {5} % tofu for blank, interrobang/down, ohm
+\DeclareEncodingSubset{TS1}{pzc} {5} % tofu for blank, interrobang/down, ohm
+\DeclareEncodingSubset{TS1}{ul9} {5} % tofu for blank, interrobang/down, ohm
% \end{macrocode}
%
% \begin{macrocode}
-\DeclareEncodingSubset{TS1}{dayroms} {6} % tofu for blank, interrobang/down, ohm
-\DeclareEncodingSubset{TS1}{dayrom} {6} % tofu for blank, interrobang/down, ohm
+\DeclareEncodingSubset{TS1}{dayroms}{6} % tofu for blank, interrobang/down, ohm
+\DeclareEncodingSubset{TS1}{dayrom} {6} % tofu for blank, interrobang/down, ohm
% \end{macrocode}
%
% \begin{macrocode}
-\DeclareEncodingSubset{TS1}{augie} {8} % really only missing euro
-\DeclareEncodingSubset{TS1}{put} {8}
-\DeclareEncodingSubset{TS1}{uag} {8} % probably (currently broken distrib)
-\DeclareEncodingSubset{TS1}{ugq} {8}
+\DeclareEncodingSubset{TS1}{augie}{8} % really only missing euro
+\DeclareEncodingSubset{TS1}{put} {8}
+\DeclareEncodingSubset{TS1}{uag} {8} % probably (currently broken distrib)
+\DeclareEncodingSubset{TS1}{ugq} {8}
% \end{macrocode}
%
% \begin{macrocode}
@@ -976,14 +1077,14 @@
% substituted.
%
% \begin{macrocode}
-\DeclareEncodingSubset{TS1}{lato-*} {0} % with a bunch of tofu inside
-\DeclareEncodingSubset{TS1}{opensans-*} {0} % with a bunch of tofu inside
-\DeclareEncodingSubset{TS1}{cantarell-*} {0} % with a bunch of tofu inside
-\DeclareEncodingSubset{TS1}{fbb-*} {0} % missing centoldstyle
+\DeclareEncodingSubset{TS1}{lato-*} {0} % with a bunch of tofu inside
+\DeclareEncodingSubset{TS1}{opensans-*} {0} % with a bunch of tofu inside
+\DeclareEncodingSubset{TS1}{cantarell-*} {0} % with a bunch of tofu inside
+\DeclareEncodingSubset{TS1}{fbb-*} {0} % missing centoldstyle
% \end{macrocode}
%
% \begin{macrocode}
-\DeclareEncodingSubset{TS1}{tli} {1} % with lots of tofu inside
+\DeclareEncodingSubset{TS1}{tli} {1} % with lots of tofu inside
% \end{macrocode}
%
% \begin{macrocode}
@@ -1109,7 +1210,7 @@
\DeclareEncodingSubset{TS1}{erewhon-*} {7}
\DeclareEncodingSubset{TS1}{ComicNeue-TLF} {7}
\DeclareEncodingSubset{TS1}{ComicNeueAngular-TLF} {7}
-\DeclareEncodingSubset{TS1}{Forum-LF} {7} % the superiors are missing
+\DeclareEncodingSubset{TS1}{Forum-LF} {7} % the superiors are missing
% \end{macrocode}
%
% \begin{macrocode}
@@ -1237,26 +1338,32 @@
%<latexrelease>\let\textbrokenbar\@undefined
%<latexrelease>\let\textcelsius\@undefined
%<latexrelease>\let\textcent\@undefined
-%<latexrelease>\DeclareTextCommandDefault{\textcopyright}{\textcircled{c}}
+%<latexrelease>\DeclareTextCommandDefault{\textcopyright}
+%<latexrelease> {\textcircled{c}}
%<latexrelease>\let\textdegree\@undefined
%<latexrelease>\let\textdiv\@undefined
%<latexrelease>\let\textlnot\@undefined
%<latexrelease>\let\textonehalf\@undefined
%<latexrelease>\let\textonequarter\@undefined
%<latexrelease>\let\textonesuperior\@undefined
-%<latexrelease>\DeclareTextCommandDefault{\textordfeminine}{\textsuperscript{a}}
-%<latexrelease>\DeclareTextCommandDefault{\textordmasculine}{\textsuperscript{o}}
+%<latexrelease>\DeclareTextCommandDefault{\textordfeminine}
+%<latexrelease> {\textsuperscript{a}}
+%<latexrelease>\DeclareTextCommandDefault{\textordmasculine}
+%<latexrelease> {\textsuperscript{o}}
%<latexrelease>\let\textpm\@undefined
%<latexrelease>\let\textquotesingle\@undefined
%<latexrelease>\let\textquotestraightbase\@undefined
%<latexrelease>\let\textquotestraightdblbase\@undefined
-%<latexrelease>\DeclareTextCommandDefault{\textregistered}{\textcircled{%
-%<latexrelease> \check@mathfonts\fontsize\sf@size\z@\math@fontsfalse\selectfont R}}
+%<latexrelease>\DeclareTextCommandDefault{\textregistered}
+%<latexrelease> {\textcircled{%
+%<latexrelease> \check@mathfonts\fontsize\sf@size\z@
+%<latexrelease> \math@fontsfalse\selectfont R}}
%<latexrelease>\let\textthreequartersemdash\@undefined
%<latexrelease>\let\textthreequarters\@undefined
%<latexrelease>\let\textthreesuperior\@undefined
%<latexrelease>\let\texttimes\@undefined
-%<latexrelease>\DeclareTextCommandDefault{\texttrademark}{\textsuperscript{TM}}
+%<latexrelease>\DeclareTextCommandDefault{\texttrademark}
+%<latexrelease> {\textsuperscript{TM}}
%<latexrelease>\let\texttwelveudash\@undefined
%<latexrelease>\let\texttwosuperior\@undefined
%<latexrelease>\let\textyen\@undefined
@@ -1433,9 +1540,12 @@
% kernel is info only). Using the package options you can change this behavior.
% \changes{v2.0n}{2020/02/05}{Changed the package default to info (gh/262)}
% \begin{macrocode}
-\DeclareOption{error}{\gdef\tc@errorwarn{\PackageError{textcomp}}}
-\DeclareOption{warn}{\gdef\tc@errorwarn#1#2{\PackageWarning{textcomp}{#1}}}
-\DeclareOption{info}{\gdef\tc@errorwarn#1#2{\PackageInfo{textcomp}{#1}}}
+\DeclareOption{error}
+ {\gdef\tc@errorwarn{\PackageError{textcomp}}}
+\DeclareOption{warn}
+ {\gdef\tc@errorwarn#1#2{\PackageWarning{textcomp}{#1}}}
+\DeclareOption{info}
+ {\gdef\tc@errorwarn#1#2{\PackageInfo{textcomp}{#1}}}
\DeclareOption{quiet}{\gdef\tc@errorwarn#1#2{}}
% \end{macrocode}
%
@@ -1773,7 +1883,7 @@
% to ensure that |\textcurrency| is only typeset if the current
% font has a \texttt{TS1} subset id of less than 3. Otherwise
% |\tc@error| is called telling the user that for this font family
-% |\textcurreny| is not available.
+% |\textcurrency| is not available.
% \begin{macrocode}
\def\tc@check@symbol{\CheckEncodingSubset\UseTextSymbol{TS1}\tc@subst}
\def\tc@check@accent{\CheckEncodingSubset\UseTextAccent{TS1}\tc@error}
@@ -2008,7 +2118,7 @@
%
% Finally input the encoding-specific definitions for
% \texttt{TS1} thus making the top-level definitions
-% optimised for this encoding (and not for the default
+% optimized for this encoding (and not for the default
% encoding).
% \changes{v1.9o}{1998/03/20}{Load decls after defaults for speed.}
% \begin{macrocode}
diff --git a/macros/latex-dev/base/ltthm.dtx b/macros/latex-dev/base/ltthm.dtx
index c33ea4202f..00fe97c77a 100644
--- a/macros/latex-dev/base/ltthm.dtx
+++ b/macros/latex-dev/base/ltthm.dtx
@@ -1,7 +1,7 @@
% \iffalse meta-comment
%
% Copyright (C) 1993-2021
-% The LaTeX3 Project and any individual authors listed elsewhere
+% The LaTeX Project and any individual authors listed elsewhere
% in this file.
%
% This file is part of the LaTeX base system.
diff --git a/macros/latex-dev/base/ltvers.dtx b/macros/latex-dev/base/ltvers.dtx
index df57faf23b..26eaee9890 100644
--- a/macros/latex-dev/base/ltvers.dtx
+++ b/macros/latex-dev/base/ltvers.dtx
@@ -1,7 +1,7 @@
% \iffalse meta-comment
%
% Copyright (C) 1993-2021
-% The LaTeX3 Project and any individual authors listed elsewhere
+% The LaTeX Project and any individual authors listed elsewhere
% in this file.
%
% This file is part of the LaTeX base system.
@@ -33,7 +33,7 @@
%<*driver>
% \fi
\ProvidesFile{ltvers.dtx}
- [2020/12/05 v1.1e LaTeX Kernel (Version Info)]
+ [2021/01/15 v1.1e LaTeX Kernel (Version Info)]
% \iffalse
\documentclass{ltxdoc}
\GetFileInfo{ltvers.dtx}
@@ -115,7 +115,7 @@
{2021-05-01}
%</2ekernel|latexrelease>
%<*2ekernel>
-\def\patch@level{-1}
+\def\patch@level{-2}
% \end{macrocode}
%
% \begin{macro}{\development@branch@name}
@@ -181,28 +181,30 @@
% \begin{macrocode}
\ifnum0\ifnum\patch@level=0 \ifx\development@branch@name\@empty 1\fi\fi>0 %
\everyjob\expandafter{\the\everyjob
- \typeout{\fmtname \space<\fmtversion>}}
+ \typeout{\fmtname\space <\fmtversion>}}
\immediate
\write16{\fmtname \space<\fmtversion>}
\else\ifnum\patch@level>0
\everyjob\expandafter{\the\everyjob
- \typeout{\fmtname \space<\fmtversion> patch level \patch@level}}
+ \typeout{\fmtname\space <\fmtversion> patch level \patch@level}}
\immediate
- \write16{\fmtname \space<\fmtversion> patch level \patch@level}
+ \write16{\fmtname\space <\fmtversion> patch level \patch@level}
\else
\everyjob\expandafter{\the\everyjob
- \typeout{\fmtname \space<\fmtversion> pre-release-\number-\patch@level\space
- \ifx\development@branch@name\@undefined \else
- \ifx\development@branch@name\@empty \else
- \space (\development@branch@name\space branch)%
+ \typeout{\fmtname\space <\fmtversion>
+ pre-release-\number-\patch@level\space
+ \ifx\development@branch@name\@undefined \else
+ \ifx\development@branch@name\@empty \else
+ \space (\development@branch@name\space branch)%
\fi
\fi
}}
\immediate
- \write16{\fmtname \space<\fmtversion> pre-release-\number-\patch@level\space
- \ifx\development@branch@name\@undefined \else
- \ifx\development@branch@name\@empty \else
- \space (\development@branch@name\space branch)%
+ \write16{\fmtname\space <\fmtversion>
+ pre-release-\number-\patch@level\space
+ \ifx\development@branch@name\@undefined \else
+ \ifx\development@branch@name\@empty \else
+ \space (\development@branch@name\space branch)%
\fi
\fi
}
diff --git a/macros/latex-dev/base/ltx3info.pdf b/macros/latex-dev/base/ltx3info.pdf
index 62baa68782..98075fb822 100644
--- a/macros/latex-dev/base/ltx3info.pdf
+++ b/macros/latex-dev/base/ltx3info.pdf
Binary files differ
diff --git a/macros/latex-dev/base/ltx3info.tex b/macros/latex-dev/base/ltx3info.tex
index b786a1f622..2a376f6431 100644
--- a/macros/latex-dev/base/ltx3info.tex
+++ b/macros/latex-dev/base/ltx3info.tex
@@ -1,7 +1,7 @@
% \iffalse meta-comment
%
% Copyright (C) 1993-2021
-% The LaTeX3 Project and any individual authors listed elsewhere
+% The LaTeX Project and any individual authors listed elsewhere
% in this file.
%
% This file is part of the LaTeX base system.
diff --git a/macros/latex-dev/base/ltxcheck.tex b/macros/latex-dev/base/ltxcheck.tex
index 478f9ea107..9e013bc2af 100644
--- a/macros/latex-dev/base/ltxcheck.tex
+++ b/macros/latex-dev/base/ltxcheck.tex
@@ -1,7 +1,7 @@
% \iffalse meta-comment
%
% Copyright (C) 1993-2021
-% The LaTeX3 Project and any individual authors listed elsewhere
+% The LaTeX Project and any individual authors listed elsewhere
% in this file.
%
% This file is part of the LaTeX base system.
@@ -29,7 +29,7 @@
%
% \iffalse
%% File `ltxcheck.tex'.
-%% Copyright (C) 1994-1997 LaTeX3 project, David Carlisle
+%% Copyright (C) 1994-1997 LaTeX Project, David Carlisle
%%
% LaTeX Test File.
% ================
diff --git a/macros/latex-dev/base/ltxdoc.dtx b/macros/latex-dev/base/ltxdoc.dtx
index e00f9bcb9f..7a21f7d871 100644
--- a/macros/latex-dev/base/ltxdoc.dtx
+++ b/macros/latex-dev/base/ltxdoc.dtx
@@ -1,7 +1,7 @@
% \iffalse meta-comment
%
% Copyright (C) 1993-2021
-% The LaTeX3 Project and any individual authors listed elsewhere
+% The LaTeX Project and any individual authors listed elsewhere
% in this file.
%
% This file is part of the LaTeX base system.
diff --git a/macros/latex-dev/base/ltxdoc.pdf b/macros/latex-dev/base/ltxdoc.pdf
index 4c74c8d46b..5b9dc2b119 100644
--- a/macros/latex-dev/base/ltxdoc.pdf
+++ b/macros/latex-dev/base/ltxdoc.pdf
Binary files differ
diff --git a/macros/latex-dev/base/ltxguide.cls b/macros/latex-dev/base/ltxguide.cls
index f70c91dcd9..b743fd9cda 100644
--- a/macros/latex-dev/base/ltxguide.cls
+++ b/macros/latex-dev/base/ltxguide.cls
@@ -1,7 +1,7 @@
% \iffalse meta-comment
%
% Copyright 1993-2019
-% The LaTeX3 Project and any individual authors listed elsewhere
+% The LaTeX Project and any individual authors listed elsewhere
% in this file.
%
% This file is part of the LaTeX base system.
@@ -34,7 +34,7 @@
% and `LaTeX2e for class and package writers'. The changes log is at
% the end of the file.
-% Copyright 1994 1999 Alan Jeffrey and the LaTeX3 project.
+% Copyright 1994-1999 Alan Jeffrey and the LaTeX Project.
% This is a LaTeX2e document class.
diff --git a/macros/latex-dev/base/ltxref.dtx b/macros/latex-dev/base/ltxref.dtx
index 4e78deec4a..dd482299b2 100644
--- a/macros/latex-dev/base/ltxref.dtx
+++ b/macros/latex-dev/base/ltxref.dtx
@@ -1,7 +1,7 @@
% \iffalse meta-comment
%
% Copyright (C) 1993-2021
-% The LaTeX3 Project and any individual authors listed elsewhere
+% The LaTeX Project and any individual authors listed elsewhere
% in this file.
%
% This file is part of the LaTeX base system.
diff --git a/macros/latex-dev/base/makeindx.dtx b/macros/latex-dev/base/makeindx.dtx
index c4a76ffabe..e8e48e60b0 100644
--- a/macros/latex-dev/base/makeindx.dtx
+++ b/macros/latex-dev/base/makeindx.dtx
@@ -1,7 +1,7 @@
% \iffalse meta-comment
%
% Copyright (C) 1993-2021
-% The LaTeX3 Project and any individual authors listed elsewhere
+% The LaTeX Project and any individual authors listed elsewhere
% in this file.
%
% This file is part of the LaTeX base system.
@@ -28,7 +28,7 @@
% \fi
%\iffalse
% Copyright (C) 1985 by Leslie Lamport
-% Copyright (C) 1994-98 by \LaTeX3 Project and Johannes Braams
+% Copyright (C) 1994-98 by LaTeX Project and Johannes Braams
%\fi
%
% \changes{1.0b}{1994/01/21}{added a missing \cs{end\{macro\}}, a
diff --git a/macros/latex-dev/base/makeindx.ins b/macros/latex-dev/base/makeindx.ins
index 771e3b12c6..427d4c7967 100644
--- a/macros/latex-dev/base/makeindx.ins
+++ b/macros/latex-dev/base/makeindx.ins
@@ -4,7 +4,7 @@
%% LaTeX or TeX.
%%
%% Copyright (C) 1993-2021
-%% The LaTeX3 Project and any individual authors listed elsewhere
+%% The LaTeX Project and any individual authors listed elsewhere
%% in this file.
%%
%% This file is part of the LaTeX base system.
@@ -49,7 +49,7 @@ reports for it can be opened at https://latex-project.org/bugs.html
Copyright (C) 1993-2021
-The LaTeX3 Project and any individual authors listed elsewhere
+The LaTeX Project and any individual authors listed elsewhere
in this file.
This file was generated from file(s) of the LaTeX base system.
diff --git a/macros/latex-dev/base/makeindx.pdf b/macros/latex-dev/base/makeindx.pdf
index a23fd5ccd5..a0b1e589aa 100644
--- a/macros/latex-dev/base/makeindx.pdf
+++ b/macros/latex-dev/base/makeindx.pdf
Binary files differ
diff --git a/macros/latex-dev/base/manifest.txt b/macros/latex-dev/base/manifest.txt
index 0cf27343c1..65e6f80389 100644
--- a/macros/latex-dev/base/manifest.txt
+++ b/macros/latex-dev/base/manifest.txt
@@ -135,6 +135,7 @@
% -----------------
%
% ltexpl.dtx -- Basic support
+% ltcmd.dtx -- Document command definition
% lthooks.dtx -- Hook management
% ltfilehook.dtx -- Hook management for file loading
% ltshipout.dtx -- Hook management for \shipout
@@ -185,6 +186,7 @@
% doc.dtx -- Package for self documenting code.
% docstrip.dtx -- Module for removing comments.
% ltxdoc.dtx -- Class file for printing documentation.
+% doc-v3beta.sty -- New version of doc, current for internal use only.
%
%
% Installation scripts for the various parts:
diff --git a/macros/latex-dev/base/manual.pdf b/macros/latex-dev/base/manual.pdf
index 8d00af366a..d6c5c7c6f3 100644
--- a/macros/latex-dev/base/manual.pdf
+++ b/macros/latex-dev/base/manual.pdf
Binary files differ
diff --git a/macros/latex-dev/base/minimal.cls b/macros/latex-dev/base/minimal.cls
index b38e4be093..9024a23bca 100644
--- a/macros/latex-dev/base/minimal.cls
+++ b/macros/latex-dev/base/minimal.cls
@@ -1,7 +1,7 @@
% \iffalse meta-comment
%
% Copyright 1993-2019
-% The LaTeX3 Project and any individual authors listed elsewhere
+% The LaTeX Project and any individual authors listed elsewhere
% in this file.
%
% This file is part of the LaTeX base system.
diff --git a/macros/latex-dev/base/modguide.pdf b/macros/latex-dev/base/modguide.pdf
index ae7a44a56d..86e0031dca 100644
--- a/macros/latex-dev/base/modguide.pdf
+++ b/macros/latex-dev/base/modguide.pdf
Binary files differ
diff --git a/macros/latex-dev/base/modguide.tex b/macros/latex-dev/base/modguide.tex
index 5374094e8b..15aad3358f 100644
--- a/macros/latex-dev/base/modguide.tex
+++ b/macros/latex-dev/base/modguide.tex
@@ -1,7 +1,7 @@
% \iffalse meta-comment
%
% Copyright (C) 1993-2021
-% The LaTeX3 Project and any individual authors listed elsewhere
+% The LaTeX Project and any individual authors listed elsewhere
% in this file.
%
% This file is part of the LaTeX base system.
@@ -40,7 +40,7 @@
\title{Modifying \LaTeX}
-\author{\copyright~Copyright 1995, \LaTeX3 Project Team.\\
+\author{\copyright~Copyright 1995, \LaTeX\ Project Team.\\
All rights reserved.}
\date{12 December 1995}
diff --git a/macros/latex-dev/base/newdc.ins b/macros/latex-dev/base/newdc.ins
index 0ea4999661..e2ce183f05 100644
--- a/macros/latex-dev/base/newdc.ins
+++ b/macros/latex-dev/base/newdc.ins
@@ -4,7 +4,7 @@
%% LaTeX or TeX.
%%
%% Copyright (C) 1993-2021
-%% The LaTeX3 Project and any individual authors listed elsewhere
+%% The LaTeX Project and any individual authors listed elsewhere
%% in this file.
%%
%% This file is part of the LaTeX base system.
@@ -49,7 +49,7 @@ reports for it can be opened at https://latex-project.org/bugs.html
Copyright (C) 1993-2021
-The LaTeX3 Project and any individual authors listed elsewhere
+The LaTeX Project and any individual authors listed elsewhere
in this file.
This file was generated from file(s) of the LaTeX base system.
diff --git a/macros/latex-dev/base/newlfont.dtx b/macros/latex-dev/base/newlfont.dtx
index 085d2348ba..3b6e001075 100644
--- a/macros/latex-dev/base/newlfont.dtx
+++ b/macros/latex-dev/base/newlfont.dtx
@@ -1,7 +1,7 @@
% \iffalse meta-comment
%
% Copyright (C) 1993-2021
-% The LaTeX3 Project and any individual authors listed elsewhere
+% The LaTeX Project and any individual authors listed elsewhere
% in this file.
%
% This file is part of the LaTeX base system.
diff --git a/macros/latex-dev/base/nfssfont.dtx b/macros/latex-dev/base/nfssfont.dtx
index 09d91dc51d..554c7ae8f0 100644
--- a/macros/latex-dev/base/nfssfont.dtx
+++ b/macros/latex-dev/base/nfssfont.dtx
@@ -1,7 +1,7 @@
% \iffalse meta-comment
%
% Copyright (C) 1993-2021
-% The LaTeX3 Project and any individual authors listed elsewhere
+% The LaTeX Project and any individual authors listed elsewhere
% in this file.
%
% This file is part of the LaTeX base system.
diff --git a/macros/latex-dev/base/nfssfont.ins b/macros/latex-dev/base/nfssfont.ins
index 24a2e115e0..7d1b9cc41a 100644
--- a/macros/latex-dev/base/nfssfont.ins
+++ b/macros/latex-dev/base/nfssfont.ins
@@ -4,7 +4,7 @@
%% LaTeX or TeX.
%%
%% Copyright (C) 1993-2021
-%% The LaTeX3 Project and any individual authors listed elsewhere
+%% The LaTeX Project and any individual authors listed elsewhere
%% in this file.
%%
%% This file is part of the LaTeX base system.
@@ -49,7 +49,7 @@ reports for it can be opened at https://latex-project.org/bugs.html
Copyright (C) 1993-2021
-The LaTeX3 Project and any individual authors listed elsewhere
+The LaTeX Project and any individual authors listed elsewhere
in this file.
This file was generated from file(s) of the LaTeX base system.
diff --git a/macros/latex-dev/base/nfssfont.pdf b/macros/latex-dev/base/nfssfont.pdf
index d2a17482d6..bdbd184b27 100644
--- a/macros/latex-dev/base/nfssfont.pdf
+++ b/macros/latex-dev/base/nfssfont.pdf
Binary files differ
diff --git a/macros/latex-dev/base/olddc.ins b/macros/latex-dev/base/olddc.ins
index 7401e29f6d..d878507d8e 100644
--- a/macros/latex-dev/base/olddc.ins
+++ b/macros/latex-dev/base/olddc.ins
@@ -4,7 +4,7 @@
%% LaTeX or TeX.
%%
%% Copyright (C) 1993-2021
-%% The LaTeX3 Project and any individual authors listed elsewhere
+%% The LaTeX Project and any individual authors listed elsewhere
%% in this file.
%%
%% This file is part of the LaTeX base system.
@@ -49,7 +49,7 @@ reports for it can be opened at https://latex-project.org/bugs.html
Copyright (C) 1993-2021
-The LaTeX3 Project and any individual authors listed elsewhere
+The LaTeX Project and any individual authors listed elsewhere
in this file.
This file was generated from file(s) of the LaTeX base system.
diff --git a/macros/latex-dev/base/oldlfont.dtx b/macros/latex-dev/base/oldlfont.dtx
index 56204af7ae..d04ddb6323 100644
--- a/macros/latex-dev/base/oldlfont.dtx
+++ b/macros/latex-dev/base/oldlfont.dtx
@@ -1,7 +1,7 @@
% \iffalse meta-comment
%
% Copyright (C) 1993-2021
-% The LaTeX3 Project and any individual authors listed elsewhere
+% The LaTeX Project and any individual authors listed elsewhere
% in this file.
%
% This file is part of the LaTeX base system.
diff --git a/macros/latex-dev/base/preload.dtx b/macros/latex-dev/base/preload.dtx
index 22554b429f..b2ca24bce5 100644
--- a/macros/latex-dev/base/preload.dtx
+++ b/macros/latex-dev/base/preload.dtx
@@ -1,7 +1,7 @@
% \iffalse meta-comment
%
% Copyright (C) 1993-2021
-% The LaTeX3 Project and any individual authors listed elsewhere
+% The LaTeX Project and any individual authors listed elsewhere
% in this file.
%
% This file is part of the LaTeX base system.
diff --git a/macros/latex-dev/base/proc.dtx b/macros/latex-dev/base/proc.dtx
index 814006e411..7a1329fb82 100644
--- a/macros/latex-dev/base/proc.dtx
+++ b/macros/latex-dev/base/proc.dtx
@@ -1,7 +1,7 @@
% \iffalse meta-comment
%
% Copyright (C) 1993-2021
-% The LaTeX3 Project and any individual authors listed elsewhere
+% The LaTeX Project and any individual authors listed elsewhere
% in this file.
%
% This file is part of the LaTeX base system.
@@ -28,8 +28,8 @@
% \fi
%
% \iffalse
-% Copyright (C) 1991,1992 by Leslie Lamport \and
-% Copyright (C) 1994-2020 by the \LaTeX3 project \and Johannes Braams
+% Copyright (C) 1991,1992 by Leslie Lamport and
+% Copyright (C) 1994-2020 by the LaTeX Project and Johannes Braams
%
% \changes{v1.1}{1994/01/25}{Made `proc' a document class and provide
% a .sty file for compatibility mode}
diff --git a/macros/latex-dev/base/proc.ins b/macros/latex-dev/base/proc.ins
index b9c3cbe064..cfed5bd6a3 100644
--- a/macros/latex-dev/base/proc.ins
+++ b/macros/latex-dev/base/proc.ins
@@ -4,7 +4,7 @@
%% LaTeX or TeX.
%%
%% Copyright (C) 1993-2021
-%% The LaTeX3 Project and any individual authors listed elsewhere
+%% The LaTeX Project and any individual authors listed elsewhere
%% in this file.
%%
%% This file is part of the LaTeX base system.
@@ -49,7 +49,7 @@ reports for it can be opened at https://latex-project.org/bugs.html
Copyright (C) 1993-2021
-The LaTeX3 Project and any individual authors listed elsewhere
+The LaTeX Project and any individual authors listed elsewhere
in this file.
This file was generated from file(s) of the LaTeX base system.
diff --git a/macros/latex-dev/base/proc.pdf b/macros/latex-dev/base/proc.pdf
index 1fdce920aa..f3813139e4 100644
--- a/macros/latex-dev/base/proc.pdf
+++ b/macros/latex-dev/base/proc.pdf
Binary files differ
diff --git a/macros/latex-dev/base/slides.dtx b/macros/latex-dev/base/slides.dtx
index 9c83a3d851..883e7d34f0 100644
--- a/macros/latex-dev/base/slides.dtx
+++ b/macros/latex-dev/base/slides.dtx
@@ -1,7 +1,7 @@
% \iffalse meta-comment
%
% Copyright (C) 1993-2021
-% The LaTeX3 Project and any individual authors listed elsewhere
+% The LaTeX Project and any individual authors listed elsewhere
% in this file.
%
% This file is part of the LaTeX base system.
@@ -28,7 +28,7 @@
% \fi
%
% \iffalse
-% Copyright (C) 1994-97 LaTeX3 project, Frank Mittelbach
+% Copyright (C) 1994-97 LaTeX Project, Frank Mittelbach
% and Rainer Sch\"opf, all rights reserved.
%
% \begin{macrocode}
diff --git a/macros/latex-dev/base/slides.ins b/macros/latex-dev/base/slides.ins
index 1213d4f4d9..43ec2bebdf 100644
--- a/macros/latex-dev/base/slides.ins
+++ b/macros/latex-dev/base/slides.ins
@@ -4,7 +4,7 @@
%% LaTeX or TeX.
%%
%% Copyright (C) 1993-2021
-%% The LaTeX3 Project and any individual authors listed elsewhere
+%% The LaTeX Project and any individual authors listed elsewhere
%% in this file.
%%
%% This file is part of the LaTeX base system.
@@ -49,7 +49,7 @@ reports for it can be opened at https://latex-project.org/bugs.html
Copyright (C) 1993-2021
-The LaTeX3 Project and any individual authors listed elsewhere
+The LaTeX Project and any individual authors listed elsewhere
in this file.
This file was generated from file(s) of the LaTeX base system.
@@ -97,7 +97,7 @@ extension .ins) which are part of the distribution.
This is a generated file.
Copyright (C) 1993-2021
-The LaTeX3 Project and any individual authors listed elsewhere
+The LaTeX Project and any individual authors listed elsewhere
in this file.
This file was generated from file(s) of the LaTeX base system.
@@ -139,7 +139,7 @@ reports for it can be opened at https://latex-project.org/bugs.html
Copyright (C) 1993-2021
-The LaTeX3 Project and any individual authors listed elsewhere
+The LaTeX Project and any individual authors listed elsewhere
in this file.
This file was generated from file(s) of the LaTeX base system.
diff --git a/macros/latex-dev/base/slides.pdf b/macros/latex-dev/base/slides.pdf
index 14519c0530..28983111b2 100644
--- a/macros/latex-dev/base/slides.pdf
+++ b/macros/latex-dev/base/slides.pdf
Binary files differ
diff --git a/macros/latex-dev/base/slifonts.fdd b/macros/latex-dev/base/slifonts.fdd
index d3951cfa57..ec8b802596 100644
--- a/macros/latex-dev/base/slifonts.fdd
+++ b/macros/latex-dev/base/slifonts.fdd
@@ -1,7 +1,7 @@
% \iffalse meta-comment
%
% Copyright 1993-2019
-% The LaTeX3 Project and any individual authors listed elsewhere
+% The LaTeX Project and any individual authors listed elsewhere
% in this file.
%
% This file is part of the LaTeX base system.
@@ -30,7 +30,7 @@
%\iffalse This is a META comment
%
% File `slifonts.fdd'.
-% Copyright (C) 1989-1998 LaTeX3 project, Frank Mittelbach and
+% Copyright (C) 1989-1998 LaTeX Project, Frank Mittelbach and
% Rainer Sch\"opf, all rights reserved.
%
%<lcmss&!ec>\ProvidesFile{ot1lcmss.fd}
diff --git a/macros/latex-dev/base/slifonts.pdf b/macros/latex-dev/base/slifonts.pdf
index e0b6be9b94..24115796a7 100644
--- a/macros/latex-dev/base/slifonts.pdf
+++ b/macros/latex-dev/base/slifonts.pdf
Binary files differ
diff --git a/macros/latex-dev/base/source2e.pdf b/macros/latex-dev/base/source2e.pdf
index de20a00439..181f2b6bf6 100644
--- a/macros/latex-dev/base/source2e.pdf
+++ b/macros/latex-dev/base/source2e.pdf
Binary files differ
diff --git a/macros/latex-dev/base/source2e.tex b/macros/latex-dev/base/source2e.tex
index ad6f5c9fb0..28a516b9e9 100644
--- a/macros/latex-dev/base/source2e.tex
+++ b/macros/latex-dev/base/source2e.tex
@@ -1,7 +1,7 @@
% \iffalse meta-comment
%
% Copyright (C) 1993-2021
-% The LaTeX3 Project and any individual authors listed elsewhere
+% The LaTeX Project and any individual authors listed elsewhere
% in this file.
%
% This file is part of the LaTeX base system.
@@ -248,6 +248,8 @@ page_precedence "rnaA"
\DocInclude{ltdefns} % Initial definitions.
+ \DocInclude{ltcmd} % Document command creation
+
\DocInclude{lthooks} % Hook management (L3 module)
\DocInclude{ltalloc} % Allocation of counters and others.
diff --git a/macros/latex-dev/base/source2edoc.cls b/macros/latex-dev/base/source2edoc.cls
index e06108230d..ba6acf9f80 100644
--- a/macros/latex-dev/base/source2edoc.cls
+++ b/macros/latex-dev/base/source2edoc.cls
@@ -2,7 +2,7 @@
% This class is buggy and needs fixing
\ProvidesClass{source2edoc}
- [2020/12/02 v0.2 Quick hack to typeset source2.tex
+ [2021/01/14 v0.2b Quick hack to typeset source2.tex
(not usable for anything else and buggy -- will vanish again)!]
\LoadClass{l3doc}
@@ -106,6 +106,31 @@
\fi
\cs_set_eq:NN \@auxout \@mainaux
}
+
+
+% change the setup here: we have a lot of long names so better run raggeded
+
+\cs_set_protected:Npn \__codedoc_macro_end_style:n #1
+ {
+ \nobreak \noindent
+ { \raggedright\hangindent1pc \footnotesize ( \emph{#1} ) \par }
+ }
+
+
+% next two declarations should move to l3doc.cls in the l3kernel eventually
+% they should be ``new'' not ``set'' but to avoid getting in timing issues
+% when they will be officially defined we use ``set'' here
+
+\cs_set_eq:NN \__codedoc_saved_detect_internals:N \__codedoc_detect_internals:N
+
+% maybe this change should be local so that it automatically reverts on \verb=\end{macro}=
+% without the need to explicitly turn it on again.
+
+\cs_new_protected:Npn \InternalDetectionOff
+ { \cs_gset_eq:NN \__codedoc_detect_internals:N \use_none:n }
+\cs_new_protected:Npn \InternalDetectionOn
+ { \cs_gset_eq:NN \__codedoc_detect_internals:N \__codedoc_saved_detect_internals:N }
+
\ExplSyntaxOff
\def\partname{File}
@@ -257,7 +282,7 @@ Bug reports can be opened (category \texttt{#1}) at\\%
{}
-%\errorstopmode
+\errorstopmode
\batchmode
-
+
\endinput
diff --git a/macros/latex-dev/base/syntonly.dtx b/macros/latex-dev/base/syntonly.dtx
index 55b2ad3cec..b214c49ae4 100644
--- a/macros/latex-dev/base/syntonly.dtx
+++ b/macros/latex-dev/base/syntonly.dtx
@@ -1,7 +1,7 @@
% \iffalse meta-comment
%
% Copyright (C) 1993-2021
-% The LaTeX3 Project and any individual authors listed elsewhere
+% The LaTeX Project and any individual authors listed elsewhere
% in this file.
%
% This file is part of the LaTeX base system.
diff --git a/macros/latex-dev/base/syntonly.ins b/macros/latex-dev/base/syntonly.ins
index 3717d1e6fe..6b4113ed11 100644
--- a/macros/latex-dev/base/syntonly.ins
+++ b/macros/latex-dev/base/syntonly.ins
@@ -4,7 +4,7 @@
%% LaTeX or TeX.
%%
%% Copyright (C) 1993-2021
-%% The LaTeX3 Project and any individual authors listed elsewhere
+%% The LaTeX Project and any individual authors listed elsewhere
%% in this file.
%%
%% This file is part of the LaTeX base system.
@@ -49,7 +49,7 @@ reports for it can be opened at https://latex-project.org/bugs.html
Copyright (C) 1993-2021
-The LaTeX3 Project and any individual authors listed elsewhere
+The LaTeX Project and any individual authors listed elsewhere
in this file.
This file was generated from file(s) of the LaTeX base system.
diff --git a/macros/latex-dev/base/syntonly.pdf b/macros/latex-dev/base/syntonly.pdf
index 6e2933bdd4..f3cc919750 100644
--- a/macros/latex-dev/base/syntonly.pdf
+++ b/macros/latex-dev/base/syntonly.pdf
Binary files differ
diff --git a/macros/latex-dev/base/testpage.tex b/macros/latex-dev/base/testpage.tex
index d8af7d0bc1..ff17984ee1 100644
--- a/macros/latex-dev/base/testpage.tex
+++ b/macros/latex-dev/base/testpage.tex
@@ -1,7 +1,7 @@
% \iffalse meta-comment
%
% Copyright (C) 1993-2021
-% The LaTeX3 Project and any individual authors listed elsewhere
+% The LaTeX Project and any individual authors listed elsewhere
% in this file.
%
% This file is part of the LaTeX base system.
diff --git a/macros/latex-dev/base/texpert.txt b/macros/latex-dev/base/texpert.txt
index 8215f952a7..0eb1dd7784 100644
--- a/macros/latex-dev/base/texpert.txt
+++ b/macros/latex-dev/base/texpert.txt
@@ -207,4 +207,4 @@ the distributed files with names <*>guide.tex. You will need
to install the new version before you can typeset these files.
---- Copyright 1995-2019 the LaTeX3 project. All rights reserved ---
+--- Copyright (C) 1995-2019 the LaTeX Project. All rights reserved ---
diff --git a/macros/latex-dev/base/tlc2.pdf b/macros/latex-dev/base/tlc2.pdf
index e6f27b0a5a..a37da64384 100644
--- a/macros/latex-dev/base/tlc2.pdf
+++ b/macros/latex-dev/base/tlc2.pdf
Binary files differ
diff --git a/macros/latex-dev/base/tulm.fdd b/macros/latex-dev/base/tulm.fdd
index 9308d801ff..5c1566a5ba 100644
--- a/macros/latex-dev/base/tulm.fdd
+++ b/macros/latex-dev/base/tulm.fdd
@@ -1,7 +1,7 @@
% \iffalse meta-comment
%
% Copyright 2016-2019
-% The LaTeX3 Project and any individual authors listed elsewhere
+% The LaTeX Project and any individual authors listed elsewhere
% in this file.
%
% This file is part of the LaTeX base system.
@@ -30,7 +30,7 @@
%\iffalse This is a META comment
%
% File `cmfonts.fdd'.
-% Copyright (C) 2016-2019 LaTeX3 Project
+% Copyright (C) 2016-2019 LaTeX Project
%
%
%<TUlmr>\ProvidesFile{tulmr.fd}
@@ -51,7 +51,7 @@
\title{The file \texttt{tulm.fdd} for use with
\LaTeXe.\thanks{This file has version
number \fileversion, dated \filedate.}}
-\date{\filedate}\author{LaTeX3 Project}
+\date{\filedate}\author{\LaTeX\ Project}
\addtolength\textwidth{30pt}
\begin{document}
\MaintainedByLaTeXTeam{latex}
diff --git a/macros/latex-dev/base/tulm.ins b/macros/latex-dev/base/tulm.ins
index 1c4e45e8c4..98962f2b20 100644
--- a/macros/latex-dev/base/tulm.ins
+++ b/macros/latex-dev/base/tulm.ins
@@ -4,7 +4,7 @@
%% LaTeX or TeX.
%%
%% Copyright (C) 2016-2021
-%% The LaTeX3 Project and any individual authors listed elsewhere
+%% The LaTeX Project and any individual authors listed elsewhere
%% in this file.
%%
%% This file is part of the LaTeX base system.
@@ -49,7 +49,7 @@ reports for it can be opened at https://latex-project.org/bugs.html
Copyright (C) 2016-2021
-The LaTeX3 Project and any individual authors listed elsewhere
+The LaTeX Project and any individual authors listed elsewhere
in this file.
This file was generated from file(s) of the LaTeX base system.
diff --git a/macros/latex-dev/base/tulm.pdf b/macros/latex-dev/base/tulm.pdf
index c4319f500a..4eac541e92 100644
--- a/macros/latex-dev/base/tulm.pdf
+++ b/macros/latex-dev/base/tulm.pdf
Binary files differ
diff --git a/macros/latex-dev/base/unpack.ins b/macros/latex-dev/base/unpack.ins
index 9df3403f5b..6332fcb5c0 100644
--- a/macros/latex-dev/base/unpack.ins
+++ b/macros/latex-dev/base/unpack.ins
@@ -4,7 +4,7 @@
%% LaTeX or TeX.
%%
%% Copyright (C) 1993-2021
-%% The LaTeX3 Project and any individual authors listed elsewhere
+%% The LaTeX Project and any individual authors listed elsewhere
%% in this file.
%%
%% This file is part of the LaTeX base system.
diff --git a/macros/latex-dev/base/usrguide.pdf b/macros/latex-dev/base/usrguide.pdf
index 42b3dba05b..92e5852045 100644
--- a/macros/latex-dev/base/usrguide.pdf
+++ b/macros/latex-dev/base/usrguide.pdf
Binary files differ
diff --git a/macros/latex-dev/base/usrguide.tex b/macros/latex-dev/base/usrguide.tex
index a51bb43855..a94d8a6a70 100644
--- a/macros/latex-dev/base/usrguide.tex
+++ b/macros/latex-dev/base/usrguide.tex
@@ -1,7 +1,7 @@
% \iffalse meta-comment
%
% Copyright (C) 1993-2021
-% The LaTeX3 Project and any individual authors listed elsewhere
+% The LaTeX Project and any individual authors listed elsewhere
% in this file.
%
% This file is part of the LaTeX base system.
@@ -34,7 +34,7 @@
\title{\LaTeXe~for authors}
-\author{\copyright~Copyright 1995--2020, \LaTeX3 Project Team.\\
+\author{\copyright~Copyright 1995--2020, \LaTeX\ Project Team.\\
All rights reserved.}
\date{25 May 2020}
@@ -103,10 +103,10 @@ A brief description of the project can be found in the document
|ltx3info.tex|.
If you would like to support the project then you are welcome to send
-donations to the \LaTeX3 Project Fund; this has been set up to help
+donations to the \LaTeX\ Project Fund; this has been set up to help
the research team by financing various expenses associated with this
voluntary work of maintaining the current \LaTeX{} and developing
-\LaTeX3.
+\LaTeX\ further.
The fund is administered by The \TeX{} Users Group and by various
local user groups. Information about making donations and joining
diff --git a/macros/latex-dev/base/usrguide3.pdf b/macros/latex-dev/base/usrguide3.pdf
index 59db944a75..a6e9571db4 100644
--- a/macros/latex-dev/base/usrguide3.pdf
+++ b/macros/latex-dev/base/usrguide3.pdf
Binary files differ
diff --git a/macros/latex-dev/base/usrguide3.tex b/macros/latex-dev/base/usrguide3.tex
index 40ef882fba..b14e753ea1 100644
--- a/macros/latex-dev/base/usrguide3.tex
+++ b/macros/latex-dev/base/usrguide3.tex
@@ -1,7 +1,7 @@
% \iffalse meta-comment
%
-% Copyright (C) 2020,2021
-% The LaTeX3 Project and any individual authors listed elsewhere
+% Copyright (C) 2020-2021
+% The LaTeX Project and any individual authors listed elsewhere
% in this file.
%
% This file is part of the LaTeX base system.
@@ -32,7 +32,7 @@
\usepackage[T1]{fontenc} % needed for \textbackslash in tt
-\title{\LaTeX3 methods for authors}
+\title{New \LaTeX\ methods for authors (starting 2020)}
\author{\copyright~Copyright 2020, \LaTeX\ Project Team.\\
All rights reserved.}
diff --git a/macros/latex-dev/base/utf8ienc.dtx b/macros/latex-dev/base/utf8ienc.dtx
index cd11cb0f2a..79c725915c 100644
--- a/macros/latex-dev/base/utf8ienc.dtx
+++ b/macros/latex-dev/base/utf8ienc.dtx
@@ -1,7 +1,7 @@
% \iffalse meta-comment
%
% Copyright (C) 1993-2021
-% The LaTeX3 Project and any individual authors listed elsewhere
+% The LaTeX Project and any individual authors listed elsewhere
% in this file.
%
% This file is part of the LaTeX base system.
@@ -216,7 +216,7 @@
%<+ts1> \ProvidesFile{ts1enc.dfu}
%<+x2> \ProvidesFile{x2enc.dfu}
%<+all> \ProvidesFile{utf8enc.dfu}
-%<-utf8-2018> [2020/11/26 v1.2k UTF-8 support for inputenc]
+%<-utf8-2018> [2021/01/27 v1.2l UTF-8 support for inputenc]
% \end{macrocode}
%
% \begin{macrocode}
@@ -1137,7 +1137,7 @@
% \changes{v1.1q}{2015/12/02}{Add remaining latin uses of accents in T1}
% \changes{v1.1r}{2015/12/03}{Add some more ogonek cases}
% \changes{v1.1s}{2016/01/11}{Add some more caron and acute}
-% \changes{v1.1t}{2017/01/28}{Add caron cominations for GgYy}
+% \changes{v1.1t}{2017/01/28}{Add caron combinations for GgYy}
% \begin{macrocode}
%<all,t1,ot1,ly1>\DeclareUnicodeCharacter{00A0}{\nobreakspace}
%<all,t1,ot1,ly1>\DeclareUnicodeCharacter{00A1}{\textexclamdown}
@@ -1701,6 +1701,18 @@
%<all,ts1>\DeclareUnicodeCharacter{0E3F}{\textbaht}
%<all,t1>\DeclareUnicodeCharacter{1E02}{\.B}
%<all,t1>\DeclareUnicodeCharacter{1E03}{\.b}
+% \end{macrocode}
+% \changes{v1.2k}{2021/01/27}{Added various additional dot accents (gh/484)}
+% \begin{macrocode}
+%<all,t1>\DeclareUnicodeCharacter{1E0D}{\d d}
+%<all,t1>\DeclareUnicodeCharacter{1E25}{\d h}
+%<all,t1>\DeclareUnicodeCharacter{1E37}{\d l}
+%<all,t1>\DeclareUnicodeCharacter{1E43}{\d m}
+%<all,t1>\DeclareUnicodeCharacter{1E45}{\.n}
+%<all,t1>\DeclareUnicodeCharacter{1E47}{\d n}
+%<all,t1>\DeclareUnicodeCharacter{1E5B}{\d r}
+%<all,t1>\DeclareUnicodeCharacter{1E63}{\d s}
+%<all,t1>\DeclareUnicodeCharacter{1E6D}{\d t}
%<all,t1>\DeclareUnicodeCharacter{1E9E}{\SS}
%<all,x2,t2c,t2b,t2a,t1,utf8>\DeclareUnicodeCharacter{200C}{\textcompwordmark}
% \end{macrocode}
diff --git a/macros/latex-dev/base/utf8ienc.pdf b/macros/latex-dev/base/utf8ienc.pdf
index 4e8f36ed7d..207600f959 100644
--- a/macros/latex-dev/base/utf8ienc.pdf
+++ b/macros/latex-dev/base/utf8ienc.pdf
Binary files differ
diff --git a/macros/latex-dev/base/webcomp.pdf b/macros/latex-dev/base/webcomp.pdf
index 02223d1fac..51a3b66f36 100644
--- a/macros/latex-dev/base/webcomp.pdf
+++ b/macros/latex-dev/base/webcomp.pdf
Binary files differ
diff --git a/macros/latex-dev/required/tools/README.md b/macros/latex-dev/required/tools/README.md
index c94a29741c..3ea0557c49 100644
--- a/macros/latex-dev/required/tools/README.md
+++ b/macros/latex-dev/required/tools/README.md
@@ -1,7 +1,7 @@
The LaTeX `tools` bundle
========================
-Release 2021-05-01 pre-release 0
+Release 2021-05-01 pre-release 1
Overview
--------
diff --git a/macros/latex-dev/required/tools/afterpage.dtx b/macros/latex-dev/required/tools/afterpage.dtx
index 600d221cb6..e5fa69f515 100644
--- a/macros/latex-dev/required/tools/afterpage.dtx
+++ b/macros/latex-dev/required/tools/afterpage.dtx
@@ -1,8 +1,8 @@
% \iffalse meta-comment
%
-% Copyright (C) 1993-2020
+% Copyright (C) 1993-2021
%
-% The LaTeX3 Project and any individual authors listed elsewhere
+% The LaTeX Project and any individual authors listed elsewhere
% in this file.
%
% This file is part of the Standard LaTeX `Tools Bundle'.
diff --git a/macros/latex-dev/required/tools/afterpage.ins b/macros/latex-dev/required/tools/afterpage.ins
index 96cba1ed0c..0cfc531f19 100644
--- a/macros/latex-dev/required/tools/afterpage.ins
+++ b/macros/latex-dev/required/tools/afterpage.ins
@@ -3,8 +3,8 @@
%% driver files from the doc files in this package when run through
%% LaTeX or TeX.
%%
-%% Copyright (C) 1993-2020
-%% The LaTeX3 Project and any individual authors listed elsewhere
+%% Copyright (C) 1993-2021
+%% The LaTeX Project and any individual authors listed elsewhere
%% in this file.
%%
%% This file is part of the Standard LaTeX `Tools Bundle'.
@@ -45,8 +45,8 @@ The source is maintained by the LaTeX Project team and bug
reports for it can be opened at https://latex-project.org/bugs/
(but please observe conditions on bug reports sent to that address!)
-Copyright (C) 1993-2020
-The LaTeX3 Project and any individual authors listed elsewhere
+Copyright (C) 1993-2021
+The LaTeX Project and any individual authors listed elsewhere
in this file.
This file was generated from file(s) of the Standard LaTeX `Tools Bundle'.
diff --git a/macros/latex-dev/required/tools/afterpage.pdf b/macros/latex-dev/required/tools/afterpage.pdf
index 3657302b7f..88b0ebd7bc 100644
--- a/macros/latex-dev/required/tools/afterpage.pdf
+++ b/macros/latex-dev/required/tools/afterpage.pdf
Binary files differ
diff --git a/macros/latex-dev/required/tools/array-2016-10-06.sty b/macros/latex-dev/required/tools/array-2016-10-06.sty
index 10fd5e8d17..f079fd4975 100644
--- a/macros/latex-dev/required/tools/array-2016-10-06.sty
+++ b/macros/latex-dev/required/tools/array-2016-10-06.sty
@@ -2,7 +2,7 @@
%% This is an old release of `array.sty',
%%
%% Copyright 1993-2016
-%% The LaTeX3 Project and any individual authors listed elsewhere
+%% The LaTeX Project and any individual authors listed elsewhere
%% in this file.
%%
%% This file was generated from file(s) of the Standard LaTeX `Tools Bundle'.
diff --git a/macros/latex-dev/required/tools/array-2020-02-10.sty b/macros/latex-dev/required/tools/array-2020-02-10.sty
index 9fddc0d490..1243f25f74 100644
--- a/macros/latex-dev/required/tools/array-2020-02-10.sty
+++ b/macros/latex-dev/required/tools/array-2020-02-10.sty
@@ -14,7 +14,7 @@
%%
%%
%% Copyright (C) 1993-2020
-%% The LaTeX3 Project and any individual authors listed elsewhere
+%% The LaTeX Project and any individual authors listed elsewhere
%% in this file.
%%
%% This file was generated from file(s) of the Standard LaTeX `Tools Bundle'.
diff --git a/macros/latex-dev/required/tools/array.dtx b/macros/latex-dev/required/tools/array.dtx
index ff963d7f51..1ca08036d9 100644
--- a/macros/latex-dev/required/tools/array.dtx
+++ b/macros/latex-dev/required/tools/array.dtx
@@ -1,8 +1,8 @@
% \iffalse meta-comment
%
-% Copyright (C) 1993-2020
+% Copyright (C) 1993-2021
%
-% The LaTeX3 Project and any individual authors listed elsewhere
+% The LaTeX Project and any individual authors listed elsewhere
% in this file.
%
% This file is part of the Standard LaTeX `Tools Bundle'.
@@ -33,7 +33,7 @@
%<+package>\DeclareCurrentRelease{}{2020-10-01}
%<+package>
%<+package>\ProvidesPackage{array}
-%<+package> [2020/10/01 v2.5c Tabular extension package (FMi)]
+%<+package> [2021/02/10 v2.5d Tabular extension package (FMi)]
%
% \fi
%
@@ -188,7 +188,7 @@
% David Carlisle\thanks{David kindly agreed on the inclusion
% of the \texttt{\textbackslash{}newcolumntype} implementation,
% formerly in
-% \texttt{newarray.sty} into this package }}
+% \texttt{newarray.sty} into this package.}}
%
% \date{Printed \today}
%
@@ -361,6 +361,56 @@
% columns have predefined widths.
% \end{itemize}
%
+%
+% \subsection{The behavior of the \texttt{\string\\} command}
+%
+% In the basic \texttt{tabular} implementation of \LaTeX{} the \cs{\bslash}
+% command ending the rows of the \texttt{tabular} or \texttt{array} has
+% a somewhat inconsistent behavior if its optional argument is used. The
+% result then depends on the type of rightmost column and as remarked in
+% Leslie Lamport's \LaTeX{} manual~\cite{bk:lamport} may not always produce the
+% expected extra space.
+%
+%
+% Without the \textsf{array} package the extra space requested by the
+% optional argument of \cs{\bslash} is measured from the last baseline of
+% the rightmost column (indicated by ``x'' in the following
+% example). As a result, swapping the column will give different
+% results:
+% \begin{verbatim}
+% \begin{tabular}[t]{lp{1cm}}
+% 1 & 1\newline x \\[20pt] 2 & 2 \end{tabular}
+% \begin{tabular}[t]{p{1cm}l}
+% 1\newline 1 & x \\[20pt] 2 & 2 \end{tabular}
+% \end{verbatim}
+% \pagebreak
+% If you run this without the \textsf{array} package you will get the
+% following result:
+% \begin{center}
+% \begin{tabular}[t]{lp{1cm}}
+% 1 & 1\newline x \\[32pt] 2 & 2 \end{tabular}
+% \begin{tabular}[t]{p{1cm}l}
+% 1\newline 1 & x \\[20pt] 2 & 2 \end{tabular}
+% \end{center}
+% In contrast, when the \textsf{array} package is loaded, the requested
+% space in the optional argument is always measured from the baseline of
+% the whole row and not from the last baseline of the rightmost column, thus
+% swapping columns doesn't change the spacing and we same table height
+% with an effective 8pt of extra space (as the second line already takes
+% up 12pt of the requested 20pt):
+% \begin{center}
+% \begin{tabular}[t]{lp{1cm}}
+% 1 & 1\newline x \\[20pt] 2 & 2 \end{tabular}
+% \begin{tabular}[t]{p{1cm}l}
+% 1\newline 1 & x \\[20pt] 2 & 2 \end{tabular}
+% \end{center}
+%
+% This correction of behavior only makes a difference if the rightmost column
+% is a \texttt{p}-column. Thus if you add the \textsf{array}
+% package to an existing document, you should verify the spacing in all
+% tables that have this kind of structure.
+%
+%
% \subsection{Defining new column specifiers}
%
% \DeleteShortVerb{\=}
@@ -1958,8 +2008,9 @@
% \changes{v2.2d}{1994/05/16}{Use \LaTeXe \cs{@finalstrut}}
% \changes{v2.3g}{1996/05/07}{Add \cs{hfil} for tools/2120}
% \changes{v2.4i}{2018/09/13}{Add group to prevent color leak (gh/72)}
+% \changes{v2.5d}{2021/02/10}{Explicitly run \cs{par} at the end of pboxes}
% \begin{macrocode}
-\def\@endpbox{\@finalstrut\@arstrutbox \color@endgroup \egroup\hfil}
+\def\@endpbox{\@finalstrut\@arstrutbox \par \color@endgroup \egroup\hfil}
% \end{macrocode}
% \end{macro}
%
diff --git a/macros/latex-dev/required/tools/array.pdf b/macros/latex-dev/required/tools/array.pdf
index 9e44426740..6c5188a5a3 100644
--- a/macros/latex-dev/required/tools/array.pdf
+++ b/macros/latex-dev/required/tools/array.pdf
Binary files differ
diff --git a/macros/latex-dev/required/tools/bm.dtx b/macros/latex-dev/required/tools/bm.dtx
index 096f6c4bc2..80c73f5718 100644
--- a/macros/latex-dev/required/tools/bm.dtx
+++ b/macros/latex-dev/required/tools/bm.dtx
@@ -1,8 +1,8 @@
% \iffalse meta-comment
%
-% Copyright (C) 1993-2020
+% Copyright (C) 1993-2021
%
-% The LaTeX3 Project and any individual authors listed elsewhere
+% The LaTeX Project and any individual authors listed elsewhere
% in this file.
%
% This file is part of the Standard LaTeX `Tools Bundle'.
diff --git a/macros/latex-dev/required/tools/bm.ins b/macros/latex-dev/required/tools/bm.ins
index e963d1d88e..c00a3e5cca 100644
--- a/macros/latex-dev/required/tools/bm.ins
+++ b/macros/latex-dev/required/tools/bm.ins
@@ -3,8 +3,8 @@
%% driver files from the doc files in this package when run through
%% LaTeX or TeX.
%%
-%% Copyright (C) 1993-2020
-%% The LaTeX3 Project and any individual authors listed elsewhere
+%% Copyright (C) 1993-2021
+%% The LaTeX Project and any individual authors listed elsewhere
%% in this file.
%%
%% This file is part of the Standard LaTeX `Tools Bundle'.
@@ -45,8 +45,8 @@ The source is maintained by the LaTeX Project team and bug
reports for it can be opened at https://latex-project.org/bugs/
(but please observe conditions on bug reports sent to that address!)
-Copyright (C) 1993-2020
-The LaTeX3 Project and any individual authors listed elsewhere
+Copyright (C) 1993-2021
+The LaTeX Project and any individual authors listed elsewhere
in this file.
This file was generated from file(s) of the Standard LaTeX `Tools Bundle'.
diff --git a/macros/latex-dev/required/tools/bm.pdf b/macros/latex-dev/required/tools/bm.pdf
index 71932e42ab..94f2877ffc 100644
--- a/macros/latex-dev/required/tools/bm.pdf
+++ b/macros/latex-dev/required/tools/bm.pdf
Binary files differ
diff --git a/macros/latex-dev/required/tools/calc.dtx b/macros/latex-dev/required/tools/calc.dtx
index 62fe27489b..78b6167fe6 100644
--- a/macros/latex-dev/required/tools/calc.dtx
+++ b/macros/latex-dev/required/tools/calc.dtx
@@ -1,8 +1,8 @@
% \iffalse meta-comment
%
-% Copyright (C) 1993-2020
+% Copyright (C) 1993-2021
%
-% The LaTeX3 Project and any individual authors listed elsewhere
+% The LaTeX Project and any individual authors listed elsewhere
% in this file.
%
% This file is part of the Standard LaTeX `Tools Bundle'.
@@ -25,7 +25,7 @@
%% Copyright (C) 1992--1995
%% Kresten Krab Thorup and Frank Jensen.
%% Copyright (C) 1997--2007
-%% Kresten Krab Thorup, Frank Jensen and the LaTeX3 Project.
+%% Kresten Krab Thorup, Frank Jensen and the LaTeX Project.
%%
%% The original authors (fj@hugin.dk and krab@daimi.aau.dk) have
%% contributed this package to the LaTeX distribution.
diff --git a/macros/latex-dev/required/tools/calc.pdf b/macros/latex-dev/required/tools/calc.pdf
index 0064d2531e..64253a0f2f 100644
--- a/macros/latex-dev/required/tools/calc.pdf
+++ b/macros/latex-dev/required/tools/calc.pdf
Binary files differ
diff --git a/macros/latex-dev/required/tools/changes.txt b/macros/latex-dev/required/tools/changes.txt
index a355652199..e1a1c1bf94 100644
--- a/macros/latex-dev/required/tools/changes.txt
+++ b/macros/latex-dev/required/tools/changes.txt
@@ -5,6 +5,34 @@ completeness or accuracy and it contains some references to files that
are not part of the distribution.
=======================================================================
+2021-02-25 David Carlisle <David.Carlisle@latex-project.org>
+
+ * longtable.dtx
+ (subsection{User Settable Parameters}):
+ Increase default chunksize from 20 to 200
+
+ (subsection{The \env{longtable} environment}):
+ Guard against shrink glue on current page tools/3396 and gh/183
+ Rearrange vertical space tests for tools/3512 (floats on same page)
+
+ (subsection{The {\ttfamily\bslash\bslash} and \cs{kill} Commands}):
+ allocated global box (tools/2914)
+
+ (subsection{The Output Routine}):
+ Remove box from final page gh/3512
+
+2021-02-10 Frank Mittelbach <Frank.Mittelbach@latex-project.org>
+
+ * array.dtx (section{The macros \texttt{\textbackslash @classz}):
+ Explicitly run \par at the end of pboxes in preparation for
+ paragraph hooks
+
+2020-07-25 Johannes Braams <Johannes.Braams@latex-project.org>
+
+ * layout.dtx: (subsection{Options}):
+ Option japanese added (gh/353)
+
+
================================================================================
All changes above are only part of the development branch for the next release.
================================================================================
diff --git a/macros/latex-dev/required/tools/dcolumn.dtx b/macros/latex-dev/required/tools/dcolumn.dtx
index 1899cce556..069e633221 100644
--- a/macros/latex-dev/required/tools/dcolumn.dtx
+++ b/macros/latex-dev/required/tools/dcolumn.dtx
@@ -1,8 +1,8 @@
% \iffalse meta-comment
%
-% Copyright (C) 1993-2020
+% Copyright (C) 1993-2021
%
-% The LaTeX3 Project and any individual authors listed elsewhere
+% The LaTeX Project and any individual authors listed elsewhere
% in this file.
%
% This file is part of the Standard LaTeX `Tools Bundle'.
diff --git a/macros/latex-dev/required/tools/dcolumn.pdf b/macros/latex-dev/required/tools/dcolumn.pdf
index dc1c6228d3..6e4bc50606 100644
--- a/macros/latex-dev/required/tools/dcolumn.pdf
+++ b/macros/latex-dev/required/tools/dcolumn.pdf
Binary files differ
diff --git a/macros/latex-dev/required/tools/delarray.dtx b/macros/latex-dev/required/tools/delarray.dtx
index 17cac2052c..cc503707b0 100644
--- a/macros/latex-dev/required/tools/delarray.dtx
+++ b/macros/latex-dev/required/tools/delarray.dtx
@@ -1,8 +1,8 @@
% \iffalse meta-comment
%
-% Copyright (C) 1993-2020
+% Copyright (C) 1993-2021
%
-% The LaTeX3 Project and any individual authors listed elsewhere
+% The LaTeX Project and any individual authors listed elsewhere
% in this file.
%
% This file is part of the Standard LaTeX `Tools Bundle'.
diff --git a/macros/latex-dev/required/tools/delarray.pdf b/macros/latex-dev/required/tools/delarray.pdf
index e9b59eb3c3..4edd0c7f7a 100644
--- a/macros/latex-dev/required/tools/delarray.pdf
+++ b/macros/latex-dev/required/tools/delarray.pdf
Binary files differ
diff --git a/macros/latex-dev/required/tools/enumerate.dtx b/macros/latex-dev/required/tools/enumerate.dtx
index 3ce463e601..150a7386b8 100644
--- a/macros/latex-dev/required/tools/enumerate.dtx
+++ b/macros/latex-dev/required/tools/enumerate.dtx
@@ -1,8 +1,8 @@
% \iffalse meta-comment
%
-% Copyright (C) 1993-2020
+% Copyright (C) 1993-2021
%
-% The LaTeX3 Project and any individual authors listed elsewhere
+% The LaTeX Project and any individual authors listed elsewhere
% in this file.
%
% This file is part of the Standard LaTeX `Tools Bundle'.
diff --git a/macros/latex-dev/required/tools/enumerate.pdf b/macros/latex-dev/required/tools/enumerate.pdf
index 1eda6840cf..a3019efa0a 100644
--- a/macros/latex-dev/required/tools/enumerate.pdf
+++ b/macros/latex-dev/required/tools/enumerate.pdf
Binary files differ
diff --git a/macros/latex-dev/required/tools/fileerr.dtx b/macros/latex-dev/required/tools/fileerr.dtx
index 16a95e2820..d916304116 100644
--- a/macros/latex-dev/required/tools/fileerr.dtx
+++ b/macros/latex-dev/required/tools/fileerr.dtx
@@ -1,8 +1,8 @@
% \iffalse meta-comment
%
-% Copyright (C) 1993-2020
+% Copyright (C) 1993-2021
%
-% The LaTeX3 Project and any individual authors listed elsewhere
+% The LaTeX Project and any individual authors listed elsewhere
% in this file.
%
% This file is part of the Standard LaTeX `Tools Bundle'.
diff --git a/macros/latex-dev/required/tools/fileerr.pdf b/macros/latex-dev/required/tools/fileerr.pdf
index 3a171e2059..eec8fa5414 100644
--- a/macros/latex-dev/required/tools/fileerr.pdf
+++ b/macros/latex-dev/required/tools/fileerr.pdf
Binary files differ
diff --git a/macros/latex-dev/required/tools/fontsmpl.dtx b/macros/latex-dev/required/tools/fontsmpl.dtx
index a5fb2964a9..b720826773 100644
--- a/macros/latex-dev/required/tools/fontsmpl.dtx
+++ b/macros/latex-dev/required/tools/fontsmpl.dtx
@@ -1,8 +1,8 @@
% \iffalse meta-comment
%
-% Copyright (C) 1993-2020
+% Copyright (C) 1993-2021
%
-% The LaTeX3 Project and any individual authors listed elsewhere
+% The LaTeX Project and any individual authors listed elsewhere
% in this file.
%
% This file is part of the Standard LaTeX `Tools Bundle'.
diff --git a/macros/latex-dev/required/tools/fontsmpl.pdf b/macros/latex-dev/required/tools/fontsmpl.pdf
index 4ca39e9996..356c9515f4 100644
--- a/macros/latex-dev/required/tools/fontsmpl.pdf
+++ b/macros/latex-dev/required/tools/fontsmpl.pdf
Binary files differ
diff --git a/macros/latex-dev/required/tools/ftnright.dtx b/macros/latex-dev/required/tools/ftnright.dtx
index e5fffdfcd9..e8da56aa20 100644
--- a/macros/latex-dev/required/tools/ftnright.dtx
+++ b/macros/latex-dev/required/tools/ftnright.dtx
@@ -1,8 +1,8 @@
% \iffalse meta-comment
%
-% Copyright (C) 1993-2020
+% Copyright (C) 1993-2021
%
-% The LaTeX3 Project and any individual authors listed elsewhere
+% The LaTeX Project and any individual authors listed elsewhere
% in this file.
%
% This file is part of the Standard LaTeX `Tools Bundle'.
@@ -314,7 +314,7 @@
% \newblock Addison-Wesley, Reading, Massachusetts, 1986.
%
% \bibitem{src:ltxiii94}
-% \LaTeX3 project.
+% \LaTeX\ Project.
% \newblock \LaTeXe distribution, 1994.
% \newblock Sources for {\LaTeXe} the successor to \LaTeX~2.09.
%
diff --git a/macros/latex-dev/required/tools/ftnright.pdf b/macros/latex-dev/required/tools/ftnright.pdf
index 9f6ea62ca5..9571d279ee 100644
--- a/macros/latex-dev/required/tools/ftnright.pdf
+++ b/macros/latex-dev/required/tools/ftnright.pdf
Binary files differ
diff --git a/macros/latex-dev/required/tools/hhline.dtx b/macros/latex-dev/required/tools/hhline.dtx
index b9234b5aa2..98d6802451 100644
--- a/macros/latex-dev/required/tools/hhline.dtx
+++ b/macros/latex-dev/required/tools/hhline.dtx
@@ -1,8 +1,8 @@
% \iffalse meta-comment
%
-% Copyright (C) 1993-2020
+% Copyright (C) 1993-2021
%
-% The LaTeX3 Project and any individual authors listed elsewhere
+% The LaTeX Project and any individual authors listed elsewhere
% in this file.
%
% This file is part of the Standard LaTeX `Tools Bundle'.
diff --git a/macros/latex-dev/required/tools/hhline.pdf b/macros/latex-dev/required/tools/hhline.pdf
index 4bc7f7f379..48010575fb 100644
--- a/macros/latex-dev/required/tools/hhline.pdf
+++ b/macros/latex-dev/required/tools/hhline.pdf
Binary files differ
diff --git a/macros/latex-dev/required/tools/indentfirst.dtx b/macros/latex-dev/required/tools/indentfirst.dtx
index 7123be04c5..e54df284ae 100644
--- a/macros/latex-dev/required/tools/indentfirst.dtx
+++ b/macros/latex-dev/required/tools/indentfirst.dtx
@@ -1,8 +1,8 @@
% \iffalse meta-comment
%
-% Copyright (C) 1993-2020
+% Copyright (C) 1993-2021
%
-% The LaTeX3 Project and any individual authors listed elsewhere
+% The LaTeX Project and any individual authors listed elsewhere
% in this file.
%
% This file is part of the Standard LaTeX `Tools Bundle'.
diff --git a/macros/latex-dev/required/tools/indentfirst.pdf b/macros/latex-dev/required/tools/indentfirst.pdf
index effd7b4f71..4338ddc436 100644
--- a/macros/latex-dev/required/tools/indentfirst.pdf
+++ b/macros/latex-dev/required/tools/indentfirst.pdf
Binary files differ
diff --git a/macros/latex-dev/required/tools/layout.dtx b/macros/latex-dev/required/tools/layout.dtx
index 8918ffdca4..6962674255 100644
--- a/macros/latex-dev/required/tools/layout.dtx
+++ b/macros/latex-dev/required/tools/layout.dtx
@@ -1,8 +1,8 @@
% \iffalse meta-comment
%
-% Copyright (C) 1993-2020
+% Copyright (C) 1993-2021
%
-% The LaTeX3 Project and any individual authors listed elsewhere
+% The LaTeX Project and any individual authors listed elsewhere
% in this file.
%
% This file is part of the Standard LaTeX `Tools Bundle'.
@@ -30,7 +30,7 @@
%<+package>\ProvidesPackage{layout}
%<+driver>\ProvidesFile{layout.drv}
%\ProvidesFile{layout.dtx}
- [2014/10/28 v1.2c Show layout parameters]
+ [2020-07-25 v1.2d Show layout parameters]
%
% A short driver is provided that can be extracted if necessary by
% the \textsf{DocStrip} program provided with \LaTeXe.
@@ -54,6 +54,17 @@
% \changes{v1.1d}{1994/09/08}{Stored texts in control sequences to
% allow other languages}
%
+% \makeatletter
+% \def\allowtofu{^^A
+%\def\UTFviii@undefined@err##1{^^A
+% \PackageWarning{inputenc}{Unicode character \expandafter
+% \UTFviii@splitcsname\string##1\relax
+% \MessageBreak
+% not set up for use with LaTeX}^^A
+% \raisebox{.8pt}{\fboxsep1pt\kern.1pt\fbox{$\cdot$}\kern.1pt}^^A
+% }}
+% \makeatother
+%
% \GetFileInfo{layout.dtx}
% \title{Displaying page layout variables}
% \author{Kent McPherson a.o.\thanks{Converted for \LaTeXe\ by
@@ -172,6 +183,20 @@
\def\notshown{non mostrato}
}
% \end{macrocode}
+%
+% \changes{v1.2d}{2020-07-25}{Added option for Japanese (gh353)}
+% \begin{allowtofu}
+% \begin{macrocode}
+\DeclareOption{japanese}{%
+ \def\Headertext{天}
+ \def\Bodytext{基本版面}
+ \def\Footertext{地}
+ \def\MarginNotestext{傍\\注}
+ \def\oneinchtext{1インチ}
+ \def\notshown{非表示}
+ }
+% \end{macrocode}
+% \end{allowtofu}
%
% This package has an option \Lopt{verbose}. Using it will make the
% command |\layout| type some of the parameters on the terminal.
diff --git a/macros/latex-dev/required/tools/layout.pdf b/macros/latex-dev/required/tools/layout.pdf
index ad341879df..7dcf6ad05c 100644
--- a/macros/latex-dev/required/tools/layout.pdf
+++ b/macros/latex-dev/required/tools/layout.pdf
Binary files differ
diff --git a/macros/latex-dev/required/tools/longtable-2020-01-07.sty b/macros/latex-dev/required/tools/longtable-2020-01-07.sty
new file mode 100644
index 0000000000..f79c691e10
--- /dev/null
+++ b/macros/latex-dev/required/tools/longtable-2020-01-07.sty
@@ -0,0 +1,448 @@
+%%
+%% This is file `longtable.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% longtable.dtx (with options: `package')
+%%
+%% This is a generated file.
+%%
+%% The source is maintained by the LaTeX Project team and bug
+%% reports for it can be opened at https://latex-project.org/bugs/
+%% (but please observe conditions on bug reports sent to that address!)
+%%
+%% Copyright (C) 1993-2020
+%% The LaTeX3 Project and any individual authors listed elsewhere
+%% in this file.
+%%
+%% This file was generated from file(s) of the Standard LaTeX `Tools Bundle'.
+%% --------------------------------------------------------------------------
+%%
+%% It may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3c
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%% https://www.latex-project.org/lppl.txt
+%% and version 1.3c or later is part of all distributions of LaTeX
+%% version 2005/12/01 or later.
+%%
+%% This file may only be distributed together with a copy of the LaTeX
+%% `Tools Bundle'. You may however distribute the LaTeX `Tools Bundle'
+%% without such generated files.
+%%
+%% The list of all files belonging to the LaTeX `Tools Bundle' is
+%% given in the file `manifest.txt'.
+%%
+%% File: longtable.dtx Copyright (C) 1990-2020 David Carlisle
+\NeedsTeXFormat{LaTeX2e}[1995/06/01]
+\ProvidesPackage{longtable}
+ [2020/01/07 v4.13 Multi-page Table package (DPC)]
+\def\LT@err{\PackageError{longtable}}
+\def\LT@warn{\PackageWarning{longtable}}
+\def\LT@final@warn{%
+ \AtEndDocument{%
+ \LT@warn{Table \@width s have changed. Rerun LaTeX.\@gobbletwo}}%
+ \global\let\LT@final@warn\relax}
+\DeclareOption{errorshow}{%
+ \def\LT@warn{\PackageInfo{longtable}}}
+\DeclareOption{pausing}{%
+ \def\LT@warn#1{%
+ \LT@err{#1}{This is not really an error}}}
+\DeclareOption{set}{}
+\DeclareOption{final}{}
+\ProcessOptions
+\newskip\LTleft \LTleft=\fill
+\newskip\LTright \LTright=\fill
+\newskip\LTpre \LTpre=\bigskipamount
+\newskip\LTpost \LTpost=\bigskipamount
+\newcount\LTchunksize \LTchunksize=20
+\let\c@LTchunksize\LTchunksize
+\newdimen\LTcapwidth \LTcapwidth=4in
+\newbox\LT@head
+\newbox\LT@firsthead
+\newbox\LT@foot
+\newbox\LT@lastfoot
+\newcount\LT@cols
+\newcount\LT@rows
+\newcounter{LT@tables}
+\newcounter{LT@chunks}[LT@tables]
+\ifx\c@table\undefined
+ \newcounter{table}
+ \def\fnum@table{\tablename~\thetable}
+\fi
+\ifx\tablename\undefined
+ \def\tablename{Table}
+\fi
+\newtoks\LT@p@ftn
+\mathchardef\LT@end@pen=30000
+\def\longtable{%
+ \par
+ \ifx\multicols\@undefined
+ \else
+ \ifnum\col@number>\@ne
+ \@twocolumntrue
+ \fi
+ \fi
+ \if@twocolumn
+ \LT@err{longtable not in 1-column mode}\@ehc
+ \fi
+ \begingroup
+ \@ifnextchar[\LT@array{\LT@array[x]}}
+\def\LT@array[#1]#2{%
+ \refstepcounter{table}\stepcounter{LT@tables}%
+ \if l#1%
+ \LTleft\z@ \LTright\fill
+ \else\if r#1%
+ \LTleft\fill \LTright\z@
+ \else\if c#1%
+ \LTleft\fill \LTright\fill
+ \fi\fi\fi
+ \let\LT@mcol\multicolumn
+ \let\LT@@tabarray\@tabarray
+ \let\LT@@hl\hline
+ \def\@tabarray{%
+ \let\hline\LT@@hl
+ \LT@@tabarray}%
+ \let\\\LT@tabularcr\let\tabularnewline\\%
+ \def\newpage{\noalign{\break}}%
+ \def\pagebreak{\noalign{\ifnum`}=0\fi\@testopt{\LT@no@pgbk-}4}%
+ \def\nopagebreak{\noalign{\ifnum`}=0\fi\@testopt\LT@no@pgbk4}%
+ \let\hline\LT@hline \let\kill\LT@kill\let\caption\LT@caption
+ \@tempdima\ht\strutbox
+ \let\@endpbox\LT@endpbox
+ \ifx\extrarowheight\@undefined
+ \let\@acol\@tabacol
+ \let\@classz\@tabclassz \let\@classiv\@tabclassiv
+ \def\@startpbox{\vtop\LT@startpbox}%
+ \let\@@startpbox\@startpbox
+ \let\@@endpbox\@endpbox
+ \let\LT@LL@FM@cr\@tabularcr
+ \else
+ \advance\@tempdima\extrarowheight
+ \col@sep\tabcolsep
+ \let\@startpbox\LT@startpbox\let\LT@LL@FM@cr\@arraycr
+ \fi
+ \setbox\@arstrutbox\hbox{\vrule
+ \@height \arraystretch \@tempdima
+ \@depth \arraystretch \dp \strutbox
+ \@width \z@}%
+ \let\@sharp##\let\protect\relax
+ \begingroup
+ \@mkpream{#2}%
+ \xdef\LT@bchunk{%
+ \global\advance\c@LT@chunks\@ne
+ \global\LT@rows\z@\setbox\z@\vbox\bgroup
+ \LT@setprevdepth
+ \tabskip\LTleft \noexpand\halign to\hsize\bgroup
+ \tabskip\z@ \@arstrut \@preamble \tabskip\LTright \cr}%
+ \endgroup
+ \expandafter\LT@nofcols\LT@bchunk&\LT@nofcols
+ \LT@make@row
+ \m@th\let\par\@empty
+ \everycr{}\lineskip\z@\baselineskip\z@
+ \LT@bchunk}
+\def\LT@no@pgbk#1[#2]{\penalty #1\@getpen{#2}\ifnum`{=0\fi}}
+\def\LT@start{%
+ \let\LT@start\endgraf
+ \endgraf\penalty\z@\vskip\LTpre\endgraf
+ \dimen@\pagetotal
+ \advance\dimen@ \ht\ifvoid\LT@firsthead\LT@head\else\LT@firsthead\fi
+ \advance\dimen@ \dp\ifvoid\LT@firsthead\LT@head\else\LT@firsthead\fi
+ \advance\dimen@ \ht\LT@foot
+ \dimen@ii\vfuzz
+ \vfuzz\maxdimen
+ \setbox\tw@\copy\z@
+ \setbox\tw@\vsplit\tw@ to \ht\@arstrutbox
+ \setbox\tw@\vbox{\unvbox\tw@}%
+ \vfuzz\dimen@ii
+ \advance\dimen@ \ht
+ \ifdim\ht\@arstrutbox>\ht\tw@\@arstrutbox\else\tw@\fi
+ \advance\dimen@\dp
+ \ifdim\dp\@arstrutbox>\dp\tw@\@arstrutbox\else\tw@\fi
+ \advance\dimen@ -\pagegoal
+ \ifdim \dimen@>\z@\vfil\break\fi
+ \global\@colroom\@colht
+ \ifvoid\LT@foot\else
+ \advance\vsize-\ht\LT@foot
+ \global\advance\@colroom-\ht\LT@foot
+ \dimen@\pagegoal\advance\dimen@-\ht\LT@foot\pagegoal\dimen@
+ \maxdepth\z@
+ \fi
+ \ifvoid\LT@firsthead\copy\LT@head\else\box\LT@firsthead\fi\nobreak
+ \output{\LT@output}}
+\def\endlongtable{%
+ \crcr
+ \noalign{%
+ \let\LT@entry\LT@entry@chop
+ \xdef\LT@save@row{\LT@save@row}}%
+ \LT@echunk
+ \LT@start
+ \unvbox\z@
+ \LT@get@widths
+ \if@filesw
+ {\let\LT@entry\LT@entry@write\immediate\write\@auxout{%
+ \gdef\expandafter\noexpand
+ \csname LT@\romannumeral\c@LT@tables\endcsname
+ {\LT@save@row}}}%
+ \fi
+ \ifx\LT@save@row\LT@@save@row
+ \else
+ \LT@warn{Column \@width s have changed\MessageBreak
+ in table \thetable}%
+ \LT@final@warn
+ \fi
+ \endgraf\penalty -\LT@end@pen
+ \endgroup
+ \global\@mparbottom\z@
+ \pagegoal\vsize
+ \endgraf\penalty\z@\addvspace\LTpost
+ \ifvoid\footins\else\insert\footins{}\fi}
+\def\LT@nofcols#1&{%
+ \futurelet\@let@token\LT@n@fcols}
+\def\LT@n@fcols{%
+ \advance\LT@cols\@ne
+ \ifx\@let@token\LT@nofcols
+ \expandafter\@gobble
+ \else
+ \expandafter\LT@nofcols
+ \fi}
+\def\LT@tabularcr{%
+ \relax\iffalse{\fi\ifnum0=`}\fi
+ \@ifstar
+ {\def\crcr{\LT@crcr\noalign{\nobreak}}\let\cr\crcr
+ \LT@t@bularcr}%
+ {\LT@t@bularcr}}
+\let\LT@crcr\crcr
+\let\LT@setprevdepth\relax
+\def\LT@t@bularcr{%
+ \global\advance\LT@rows\@ne
+ \ifnum\LT@rows=\LTchunksize
+ \gdef\LT@setprevdepth{%
+ \prevdepth\z@\global
+ \global\let\LT@setprevdepth\relax}%
+ \expandafter\LT@xtabularcr
+ \else
+ \ifnum0=`{}\fi
+ \expandafter\LT@LL@FM@cr
+ \fi}
+\def\LT@xtabularcr{%
+ \@ifnextchar[\LT@argtabularcr\LT@ntabularcr}
+\def\LT@ntabularcr{%
+ \ifnum0=`{}\fi
+ \LT@echunk
+ \LT@start
+ \unvbox\z@
+ \LT@get@widths
+ \LT@bchunk}
+\def\LT@argtabularcr[#1]{%
+ \ifnum0=`{}\fi
+ \ifdim #1>\z@
+ \unskip\@xargarraycr{#1}%
+ \else
+ \@yargarraycr{#1}%
+ \fi
+ \LT@echunk
+ \LT@start
+ \unvbox\z@
+ \LT@get@widths
+ \LT@bchunk}
+\def\LT@echunk{%
+ \crcr\LT@save@row\cr\egroup
+ \global\setbox\@ne\lastbox
+ \unskip
+ \egroup}
+\def\LT@entry#1#2{%
+ \ifhmode\@firstofone{&}\fi\omit
+ \ifnum#1=\c@LT@chunks
+ \else
+ \kern#2\relax
+ \fi}
+\def\LT@entry@chop#1#2{%
+ \noexpand\LT@entry
+ {\ifnum#1>\c@LT@chunks
+ 1}{0pt%
+ \else
+ #1}{#2%
+ \fi}}
+\def\LT@entry@write{%
+ \noexpand\LT@entry^^J%
+ \@spaces}
+\def\LT@kill{%
+ \LT@echunk
+ \LT@get@widths
+ \expandafter\LT@rebox\LT@bchunk}
+\def\LT@rebox#1\bgroup{%
+ #1\bgroup
+ \unvbox\z@
+ \unskip
+ \setbox\z@\lastbox}
+\def\LT@blank@row{%
+ \xdef\LT@save@row{\expandafter\LT@build@blank
+ \romannumeral\number\LT@cols 001 }}
+\def\LT@build@blank#1{%
+ \if#1m%
+ \noexpand\LT@entry{1}{0pt}%
+ \expandafter\LT@build@blank
+ \fi}
+\def\LT@make@row{%
+ \global\expandafter\let\expandafter\LT@save@row
+ \csname LT@\romannumeral\c@LT@tables\endcsname
+ \ifx\LT@save@row\relax
+ \LT@blank@row
+ \else
+ {\let\LT@entry\or
+ \if!%
+ \ifcase\expandafter\expandafter\expandafter\LT@cols
+ \expandafter\@gobble\LT@save@row
+ \or
+ \else
+ \relax
+ \fi
+ !%
+ \else
+ \aftergroup\LT@blank@row
+ \fi}%
+ \fi}
+\let\setlongtables\relax
+\def\LT@get@widths{%
+ \setbox\tw@\hbox{%
+ \unhbox\@ne
+ \let\LT@old@row\LT@save@row
+ \global\let\LT@save@row\@empty
+ \count@\LT@cols
+ \loop
+ \unskip
+ \setbox\tw@\lastbox
+ \ifhbox\tw@
+ \LT@def@row
+ \advance\count@\m@ne
+ \repeat}%
+ \ifx\LT@@save@row\@undefined
+ \let\LT@@save@row\LT@save@row
+ \fi}
+\def\LT@def@row{%
+ \let\LT@entry\or
+ \edef\@tempa{%
+ \ifcase\expandafter\count@\LT@old@row
+ \else
+ {1}{0pt}%
+ \fi}%
+ \let\LT@entry\relax
+ \xdef\LT@save@row{%
+ \LT@entry
+ \expandafter\LT@max@sel\@tempa
+ \LT@save@row}}
+\def\LT@max@sel#1#2{%
+ {\ifdim#2=\wd\tw@
+ #1%
+ \else
+ \number\c@LT@chunks
+ \fi}%
+ {\the\wd\tw@}}
+\def\LT@hline{%
+ \noalign{\ifnum0=`}\fi
+ \penalty\@M
+ \futurelet\@let@token\LT@@hline}
+\def\LT@@hline{%
+ \ifx\@let@token\hline
+ \global\let\@gtempa\@gobble
+ \gdef\LT@sep{\penalty-\@medpenalty\vskip\doublerulesep}%
+ \else
+ \global\let\@gtempa\@empty
+ \gdef\LT@sep{\penalty-\@lowpenalty\vskip-\arrayrulewidth}%
+ \fi
+ \ifnum0=`{\fi}%
+ \multispan\LT@cols
+ \unskip\leaders\hrule\@height\arrayrulewidth\hfill\cr
+ \noalign{\LT@sep}%
+ \multispan\LT@cols
+ \unskip\leaders\hrule\@height\arrayrulewidth\hfill\cr
+ \noalign{\penalty\@M}%
+ \@gtempa}
+\def\LT@caption{%
+ \noalign\bgroup
+ \@ifnextchar[{\egroup\LT@c@ption\@firstofone}\LT@capti@n}
+\def\LT@c@ption#1[#2]#3{%
+ \LT@makecaption#1\fnum@table{#3}%
+ \def\@tempa{#2}%
+ \ifx\@tempa\@empty\else
+ {\let\\\space
+ \addcontentsline{lot}{table}{\protect\numberline{\thetable}{#2}}}%
+ \fi}
+\def\LT@capti@n{%
+ \@ifstar
+ {\egroup\LT@c@ption\@gobble[]}%
+ {\egroup\@xdblarg{\LT@c@ption\@firstofone}}}
+\def\LT@makecaption#1#2#3{%
+ \LT@mcol\LT@cols c{\hbox to\z@{\hss\parbox[t]\LTcapwidth{%
+ \sbox\@tempboxa{#1{#2: }#3}%
+ \ifdim\wd\@tempboxa>\hsize
+ #1{#2: }#3%
+ \else
+ \hbox to\hsize{\hfil\box\@tempboxa\hfil}%
+ \fi
+ \endgraf\vskip\baselineskip}%
+ \hss}}}
+\def\LT@output{%
+ \ifnum\outputpenalty <-\@Mi
+ \ifnum\outputpenalty > -\LT@end@pen
+ \LT@err{floats and marginpars not allowed in a longtable}\@ehc
+ \else
+ \setbox\z@\vbox{\unvbox\@cclv}%
+ \ifdim \ht\LT@lastfoot>\ht\LT@foot
+ \dimen@\pagegoal
+ \advance\dimen@-\ht\LT@lastfoot
+ \ifdim\dimen@<\ht\z@
+ \setbox\@cclv\vbox{\unvbox\z@\copy\LT@foot\vss}%
+ \@makecol
+ \@outputpage
+ \setbox\z@\vbox{\box\LT@head}%
+ \fi
+ \fi
+ \global\@colroom\@colht
+ \global\vsize\@colht
+ \vbox
+ {\unvbox\z@\box\ifvoid\LT@lastfoot\LT@foot\else\LT@lastfoot\fi}%
+ \fi
+ \else
+ \setbox\@cclv\vbox{\unvbox\@cclv\copy\LT@foot\vss}%
+ \@makecol
+ \@outputpage
+ \global\vsize\@colroom
+ \copy\LT@head\nobreak
+ \fi}
+\def\LT@end@hd@ft#1{%
+ \LT@echunk
+ \ifx\LT@start\endgraf
+ \LT@err
+ {Longtable head or foot not at start of table}%
+ {Increase LTchunksize}%
+ \fi
+ \setbox#1\box\z@
+ \LT@get@widths
+ \LT@bchunk}
+\def\endfirsthead{\LT@end@hd@ft\LT@firsthead}
+\def\endhead{\LT@end@hd@ft\LT@head}
+\def\endfoot{\LT@end@hd@ft\LT@foot}
+\def\endlastfoot{\LT@end@hd@ft\LT@lastfoot}
+\def\LT@startpbox#1{%
+ \bgroup
+ \color@begingroup
+ \let\@footnotetext\LT@p@ftntext
+ \setlength\hsize{#1}%
+ \@arrayparboxrestore
+ \vrule \@height \ht\@arstrutbox \@width \z@}
+\def\LT@endpbox{%
+ \@finalstrut\@arstrutbox
+ \color@endgroup
+ \egroup
+ \the\LT@p@ftn
+ \global\LT@p@ftn{}%
+ \hfil}
+\def\LT@p@ftntext#1{%
+ \edef\@tempa{\the\LT@p@ftn\noexpand\footnotetext[\the\c@footnote]}%
+ \global\LT@p@ftn\expandafter{\@tempa{#1}}}%
+\endinput
+%%
+%% End of file `longtable.sty'.
diff --git a/macros/latex-dev/required/tools/longtable.dtx b/macros/latex-dev/required/tools/longtable.dtx
index 004d630fce..c236aabb20 100644
--- a/macros/latex-dev/required/tools/longtable.dtx
+++ b/macros/latex-dev/required/tools/longtable.dtx
@@ -1,8 +1,8 @@
% \iffalse meta-comment
%
-% Copyright (C) 1993-2020
+% Copyright (C) 1993-2021
%
-% The LaTeX3 Project and any individual authors listed elsewhere
+% The LaTeX Project and any individual authors listed elsewhere
% in this file.
%
% This file is part of the Standard LaTeX `Tools Bundle'.
@@ -27,11 +27,17 @@
\ProvidesFile{longtable.dtx}
%</dtx>
%<package>\NeedsTeXFormat{LaTeX2e}[1995/06/01]
+%<package>\providecommand\DeclareRelease[3]{}
+%<package>\providecommand\DeclareCurrentRelease[2]{}
+%<package>
+%<package>\DeclareRelease{}{2020-01-02}{longtable-2020-01-07.sty}
+%<package>\DeclareCurrentRelease{}{2020-02-07}
+%<package>
%<package>\ProvidesPackage{longtable}
%<driver> \ProvidesFile{longtable.drv}
% \fi
% \ProvidesFile{longtable.dtx}
- [2020/01/07 v4.13 Multi-page Table package (DPC)]
+ [2020-02-07 v4.14 Multi-page Table package (DPC)]
%
% \iffalse
%<*driver>
@@ -303,7 +309,7 @@
% (see below), the "LTchunksize" must be at least as large as the
% number of rows in each of the head or foot sections.
%
-% This document specifies "\setcounter{LTchunksize}{10}". If you look
+% This document specifies "\setcounter{LTchunksize}{200}". If you look
% at the previous table, after the \emph{first} run of \LaTeX\ you will
% see that various parts of the table do not line up.
% \LaTeX\ will also have printed a warning that the column
@@ -877,9 +883,11 @@
% \end{macro}
%
% \begin{macro}{\LTchunksize}
-% Chunk size (The number of rows taken per "\halign"). Default 20.
+% \changes{v4.14}{2020/02/07}
+% {Increase default chunksize from 20 to 200}
+% Chunk size (The number of rows taken per "\halign"). Default 200.
% \begin{macrocode}
-\newcount\LTchunksize \LTchunksize=20
+\newcount\LTchunksize \LTchunksize=200
% \end{macrocode}
% \end{macro}
%
@@ -916,6 +924,14 @@
% \end{macro}
% \end{macro}
%
+% \begin{macro}{\LT@gbox}
+% \changes{v4.14}{2020/02/07}
+% {global box added (tools/2914)}
+% \begin{macrocode}
+\newbox\LT@gbox
+% \end{macrocode}
+% \end{macro}
+%
% \begin{macro}{\LT@cols}
% Counter for number of columns.
% \begin{macrocode}
@@ -1212,7 +1228,7 @@
% \end{macro}
%
% \begin{macro}{\LT@start}
-% % \changes{v4.13}{2020/01/07}
+% \changes{v4.13}{2020/01/07}
% {fix issue https://github.com/davidcarlisle/dpctex/issues/8}
% This macro starts the process of putting the table on the current
% page. It is not called until either a "\\" or "\endlongtable" command
@@ -1228,6 +1244,34 @@
\let\LT@start\endgraf
\endgraf\penalty\z@\vskip\LTpre\endgraf
% \end{macrocode}
+% \changes{v4.14}{2020/02/07}
+% {Guard against shrink glue on current page tools/3396 and github 183}
+% This next block was suggested by Lars Hellström in pr tools/3396
+% He documents it as:
+%
+% The original problem occurs because TeX has not yet found an awfully bad
+% "(b=*)" breakpoint and is therefore still collecting material to see if there
+% is a really good break somewhere just ahead. As we know there aren't, we
+% want to make it stop looking and break the page, so that "\pagetotal" will be
+% for the page where the table will actually end up. To achieve this, we
+% need to give \TeX\ an awfully bad, but legal, breakpoint. The simplest way of
+% doing this seems to be to insert a "\kern" that counters the "\pageshrink" for
+% the page, followed by a "\penalty" and a "\par" (to exercise the page builder).
+% We also have to make sure that this breakpoint doesn't affect how the next
+% page is broken, so we make the penalty 9999 (10000 is infinite and thus not
+% a legal breakpoint) and cancel out the "\kern" with a new "\kern".
+%
+% I don't think this is the \emph{right} solution to the problem (that would be
+% that the standard output routine has a feature for syncronizing with
+% typesetting, as part of the preparations for switching output routine), but
+% it's OK. Perhaps XOR will make it better.
+% \begin{macrocode}
+ \ifdim \pagetotal<\pagegoal \else
+ \dimen@=\pageshrink
+ \advance \dimen@ 1sp %
+ \kern\dimen@\penalty 9999\endgraf \kern-\dimen@
+ \fi
+% \end{macrocode}
% Start a new page if there is not enough room for the table head, foot,
% and one extra line.
% \begin{macrocode}
@@ -1259,7 +1303,18 @@
%
% \begin{macrocode}
\advance\dimen@ -\pagegoal
- \ifdim \dimen@>\z@\vfil\break\fi
+ \ifdim \dimen@>\z@
+ \vfil\break
+ \else
+% \end{macrocode}
+%
+% \changes{v4.14}{2020/02/07}
+% {Guard against shrink glue on current page see github 183}
+% The LT output routine does not handle shrink on the page, which can cause
+% The first page to be over-long, so forget it is there.
+% \begin{macrocode}
+ \ifdim\pageshrink>\z@\pageshrink\z@\fi
+ \fi
% \end{macrocode}
% Store height of page minus table foot in "\@colroom".
% \changes{v3.14}{1995/05/02}
@@ -1269,9 +1324,12 @@
% \end{macrocode}
% If the foot is non empty, reduce the "\vsize" and "\@colroom"
% accordingly.
+% \changes{v4.14}{2020/02/07}
+% {Rearrange vertical space tests for tools/3512 (floats on same page)}
% \begin{macrocode}
\ifvoid\LT@foot\else
- \advance\vsize-\ht\LT@foot
+% \advance\vsize-\ht\LT@foot
+ \global\advance\vsize-\ht\LT@foot
\global\advance\@colroom-\ht\LT@foot
\dimen@\pagegoal\advance\dimen@-\ht\LT@foot\pagegoal\dimen@
\maxdepth\z@
@@ -1350,8 +1408,15 @@
\fi
% \end{macrocode}
% Force one more go with the \env{longtable} output routine.
+% \changes{v4.14}{2020/02/07}
+% {Rearrange vertical space tests for tools/3512 (floats on same page)}
% \begin{macrocode}
\endgraf\penalty -\LT@end@pen
+ \ifvoid\LT@foot\else
+ \global\advance\vsize\ht\LT@foot
+ \global\advance\@colroom\ht\LT@foot
+ \dimen@\pagegoal\advance\dimen@\ht\LT@foot\pagegoal\dimen@
+ \fi
% \end{macrocode}
% Now close the group to return to the standard routine.
% \begin{macrocode}
@@ -1361,9 +1426,11 @@
% table.\footnote{This can not be the correct. However if it is omitted,
% there is a problem with marginpars, for example on page~3 of this
% document. Any Output Routine Gurus out there?}
+% \changes{v4.14}{2020/02/07}
+% {Rearrange vertical space tests for tools/3512 (floats on same page)}
% \begin{macrocode}
\global\@mparbottom\z@
- \pagegoal\vsize
+% \pagegoal\vsize
\endgraf\penalty\z@\addvspace\LTpost
% \end{macrocode}
% Footnotes. As done in the \package{multicol} package.
@@ -1452,6 +1519,8 @@
% \begin{macro}{\LT@setprevdepth}
% \changes{v4.05}{1996/11/12}
% {Macro added}
+% \changes{v4.14}{2020/02/07}
+% {spurious \cs{global} removed}
% This will be redefined to set the "\prevdepth"
% at the start of a chunk.
% \begin{macrocode}
@@ -1471,7 +1540,7 @@
\global\advance\LT@rows\@ne
\ifnum\LT@rows=\LTchunksize
\gdef\LT@setprevdepth{%
- \prevdepth\z@\global
+ \prevdepth\z@
\global\let\LT@setprevdepth\relax}%
\expandafter\LT@xtabularcr
\else
@@ -1528,11 +1597,13 @@
% \begin{macro}{\LT@echunk}
% \changes{v4.05}{1996/11/12}
% {\cs{unskip} added for pagebreak support}
+% \changes{v4.14}{2020/02/07}
+% {allocated global box (tools/2914)}
% This ends the current chunk, and removes the dummy row.
% \begin{macrocode}
\def\LT@echunk{%
\crcr\LT@save@row\cr\egroup
- \global\setbox\@ne\lastbox
+ \global\setbox\LT@gbox\lastbox
% \end{macrocode}
% The following line was added in v4.05.
% \package{longtable} relies on "\lineskip" glue (which is 0pt) to
@@ -1753,9 +1824,11 @@
% Loop through the last row, discarding glue, and saving box widths. At
% V3.04 changed the scratch box to 2, as the new "\kill" requires that
% "\box0" be preserved.
+% \changes{v4.14}{2020/02/07}
+% {allocated global box (tools/2914)}
% \begin{macrocode}
\setbox\tw@\hbox{%
- \unhbox\@ne
+ \unhbox\LT@gbox
\let\LT@old@row\LT@save@row
\global\let\LT@save@row\@empty
\count@\LT@cols
@@ -1973,13 +2046,17 @@
% vsplit off a bit of the last chunk, so that the last page did not just
% have head and foot sections, but it is hard to do this in a consistent
% manner.}
+% \changes{v4.14}{2020/02/07}
+% {Rearrange vertical space tests for tools/3512 (floats on same page)}
% \begin{macrocode}
\dimen@\pagegoal
+ \advance\dimen@\ht\LT@foot
\advance\dimen@-\ht\LT@lastfoot
\ifdim\dimen@<\ht\z@
\setbox\@cclv\vbox{\unvbox\z@\copy\LT@foot\vss}%
\@makecol
\@outputpage
+ \global\vsize\@colroom
\setbox\z@\vbox{\box\LT@head}%
% \end{macrocode}
% End of "\ifdim\dimen@<\ht\@cclc".
@@ -1993,14 +2070,17 @@
% Reset "\@colroom".
% \changes{v3.14}{1995/05/02}
% {Reset \cs{@colroom}, for tools/1584}
+% \changes{v4.14}{2020/02/07}
+% {Rearrange vertical space tests for tools/3512 (floats on same page)}
% \begin{macrocode}
- \global\@colroom\@colht
- \global\vsize\@colht
+% \global\@colroom\@colht
+% \global\vsize\@colht
% \end{macrocode}
% Put the last page of the table on to the main vertical list.
+% \changes{v4.14}{2020/02/07}
+% {Remove box from final page tools/3512}
% \begin{macrocode}
- \vbox
- {\unvbox\z@\box\ifvoid\LT@lastfoot\LT@foot\else\LT@lastfoot\fi}%
+ \unvbox\z@\box\ifvoid\LT@lastfoot\LT@foot\else\LT@lastfoot\fi
% \end{macrocode}
% End of "\ifnum\outputpenalty > -\LT@end@pen".
% \begin{macrocode}
diff --git a/macros/latex-dev/required/tools/longtable.ins b/macros/latex-dev/required/tools/longtable.ins
index 7ada121ea9..92a04e00d4 100644
--- a/macros/latex-dev/required/tools/longtable.ins
+++ b/macros/latex-dev/required/tools/longtable.ins
@@ -3,8 +3,8 @@
%% driver files from the doc files in this package when run through
%% LaTeX or TeX.
%%
-%% Copyright (C) 1993-2020
-%% The LaTeX3 Project and any individual authors listed elsewhere
+%% Copyright (C) 1993-2021
+%% The LaTeX Project and any individual authors listed elsewhere
%% in this file.
%%
%% This file is part of the Standard LaTeX `Tools Bundle'.
@@ -45,8 +45,8 @@ The source is maintained by the LaTeX Project team and bug
reports for it can be opened at https://latex-project.org/bugs/
(but please observe conditions on bug reports sent to that address!)
-Copyright (C) 1993-2020
-The LaTeX3 Project and any individual authors listed elsewhere
+Copyright (C) 1993-2021
+The LaTeX Project and any individual authors listed elsewhere
in this file.
This file was generated from file(s) of the Standard LaTeX `Tools Bundle'.
diff --git a/macros/latex-dev/required/tools/longtable.pdf b/macros/latex-dev/required/tools/longtable.pdf
index 0bca721bdc..3872426dec 100644
--- a/macros/latex-dev/required/tools/longtable.pdf
+++ b/macros/latex-dev/required/tools/longtable.pdf
Binary files differ
diff --git a/macros/latex-dev/required/tools/manifest.txt b/macros/latex-dev/required/tools/manifest.txt
index 12cd1b909c..004245d1d5 100644
--- a/macros/latex-dev/required/tools/manifest.txt
+++ b/macros/latex-dev/required/tools/manifest.txt
@@ -1,7 +1,7 @@
% \iffalse meta-comment
%
-% Copyright 1993-2016
-% The LaTeX3 Project and any individual authors listed elsewhere
+% Copyright (C) 1993-2021
+% The LaTeX Project and any individual authors listed elsewhere
% in this file.
%
% This file is part of the Standard LaTeX `Tools Bundle'.
diff --git a/macros/latex-dev/required/tools/multicol-2017-04-11.sty b/macros/latex-dev/required/tools/multicol-2017-04-11.sty
index c708ae6c48..9e346656bb 100644
--- a/macros/latex-dev/required/tools/multicol-2017-04-11.sty
+++ b/macros/latex-dev/required/tools/multicol-2017-04-11.sty
@@ -6,7 +6,7 @@
%% (but please observe conditions on bug reports sent to that address!)
%%
%% Copyright 1993-2016
-%% The LaTeX3 Project and any individual authors listed elsewhere
+%% The LaTeX Project and any individual authors listed elsewhere
%% in this file.
%%
%% This file was generated from file(s) of the Standard LaTeX `Tools Bundle'.
@@ -79,7 +79,7 @@
%% not for the payment of a license fee per se (which might or might
%% not follow from this evaluation).
%%
-%% The license fee, if any, can be payed either to the LaTeX3 fund
+%% The license fee, if any, can be payed either to the LaTeX fund
%% (see ltx3info.txt in the base LaTeX distribution) or to the author of
%% the program who can be contacted at
%%
diff --git a/macros/latex-dev/required/tools/multicol.dtx b/macros/latex-dev/required/tools/multicol.dtx
index 39bccef2d7..1d16a01c15 100644
--- a/macros/latex-dev/required/tools/multicol.dtx
+++ b/macros/latex-dev/required/tools/multicol.dtx
@@ -77,7 +77,7 @@
%% not for the payment of a license fee per se (which might or might
%% not follow from this evaluation).
%%
-%% The license fee, if any, can be payed either to the LaTeX3 fund
+%% The license fee, if any, can be payed either to the LaTeX fund
%% (see ltx3info.txt in the base LaTeX distribution) or to the author of
%% the program who can be contacted at
%%
diff --git a/macros/latex-dev/required/tools/multicol.ins b/macros/latex-dev/required/tools/multicol.ins
index f872b83cde..c8838f8be2 100644
--- a/macros/latex-dev/required/tools/multicol.ins
+++ b/macros/latex-dev/required/tools/multicol.ins
@@ -3,8 +3,8 @@
%% driver files from the doc files in this package when run through
%% LaTeX or TeX.
%%
-%% Copyright (C) 1993-2020
-%% The LaTeX3 Project and any individual authors listed elsewhere
+%% Copyright (C) 1993-2021
+%% The LaTeX Project and any individual authors listed elsewhere
%% in this file.
%%
%% This file is part of the Standard LaTeX `Tools Bundle'.
@@ -45,8 +45,8 @@ The source is maintained by the LaTeX Project team and bug
reports for it can be opened at https://latex-project.org/bugs/
(but please observe conditions on bug reports sent to that address!)
-Copyright (C) 1993-2020
-The LaTeX3 Project and any individual authors listed elsewhere
+Copyright (C) 1993-2021
+The LaTeX Project and any individual authors listed elsewhere
in this file.
This file was generated from file(s) of the Standard LaTeX `Tools Bundle'.
diff --git a/macros/latex-dev/required/tools/multicol.pdf b/macros/latex-dev/required/tools/multicol.pdf
index 268ce0e0c2..dfcb6eabd0 100644
--- a/macros/latex-dev/required/tools/multicol.pdf
+++ b/macros/latex-dev/required/tools/multicol.pdf
Binary files differ
diff --git a/macros/latex-dev/required/tools/rawfonts.dtx b/macros/latex-dev/required/tools/rawfonts.dtx
index 9c5daa57a5..f54aeaf44d 100644
--- a/macros/latex-dev/required/tools/rawfonts.dtx
+++ b/macros/latex-dev/required/tools/rawfonts.dtx
@@ -1,8 +1,8 @@
% \iffalse meta-comment
%
-% Copyright (C) 1993-2020
+% Copyright (C) 1993-2021
%
-% The LaTeX3 Project and any individual authors listed elsewhere
+% The LaTeX Project and any individual authors listed elsewhere
% in this file.
%
% This file is part of the Standard LaTeX `Tools Bundle'.
diff --git a/macros/latex-dev/required/tools/rawfonts.pdf b/macros/latex-dev/required/tools/rawfonts.pdf
index 6216df2c53..2bfd04d9ae 100644
--- a/macros/latex-dev/required/tools/rawfonts.pdf
+++ b/macros/latex-dev/required/tools/rawfonts.pdf
Binary files differ
diff --git a/macros/latex-dev/required/tools/shellesc.dtx b/macros/latex-dev/required/tools/shellesc.dtx
index 3b96c3e9ee..54027cada7 100644
--- a/macros/latex-dev/required/tools/shellesc.dtx
+++ b/macros/latex-dev/required/tools/shellesc.dtx
@@ -1,8 +1,8 @@
% \iffalse
%% Source File: shellesc.dtx
-%% Copyright (C) 2015-2020
+%% Copyright (C) 2015-2021
%%
-%% The LaTeX3 Project and any individual authors listed elsewhere
+%% The LaTeX Project and any individual authors listed elsewhere
%% in this file.
%%
%% This file may be distributed under the terms of the LPPL.
@@ -36,7 +36,7 @@
% \title{The \textsf{shellesc} Package\thanks{This file
% has version number \fileversion, last
% revised \filedate.}}
-% \author{\LaTeX3 project}
+% \author{\LaTeX\ project}
% \date{\filedate}
%
%
diff --git a/macros/latex-dev/required/tools/shellesc.pdf b/macros/latex-dev/required/tools/shellesc.pdf
index ab4e6a3120..7abddc7dbf 100644
--- a/macros/latex-dev/required/tools/shellesc.pdf
+++ b/macros/latex-dev/required/tools/shellesc.pdf
Binary files differ
diff --git a/macros/latex-dev/required/tools/showkeys.dtx b/macros/latex-dev/required/tools/showkeys.dtx
index 59eb699ae8..3c9236f2ef 100644
--- a/macros/latex-dev/required/tools/showkeys.dtx
+++ b/macros/latex-dev/required/tools/showkeys.dtx
@@ -1,8 +1,8 @@
% \iffalse meta-comment
%
-% Copyright (C) 1993-2020
+% Copyright (C) 1993-2021
%
-% The LaTeX3 Project and any individual authors listed elsewhere
+% The LaTeX Project and any individual authors listed elsewhere
% in this file.
%
% This file is part of the Standard LaTeX `Tools Bundle'.
@@ -22,7 +22,7 @@
% \fi
% \iffalse
%% File: showkeys.dtx Copyright (C) 1992-1997 David Carlisle
-%% File: showkeys.dtx Copyright (C) 2006-2019 David Carlisle, LaTeX3 Project
+%% File: showkeys.dtx Copyright (C) 2006-2019 David Carlisle, LaTeX Project
%
%<*dtx>
\ProvidesFile{showkeys.dtx}
diff --git a/macros/latex-dev/required/tools/showkeys.pdf b/macros/latex-dev/required/tools/showkeys.pdf
index 4d49ba0dd9..46943fcc0d 100644
--- a/macros/latex-dev/required/tools/showkeys.pdf
+++ b/macros/latex-dev/required/tools/showkeys.pdf
Binary files differ
diff --git a/macros/latex-dev/required/tools/somedefs.dtx b/macros/latex-dev/required/tools/somedefs.dtx
index 120ad98078..825a93ec66 100644
--- a/macros/latex-dev/required/tools/somedefs.dtx
+++ b/macros/latex-dev/required/tools/somedefs.dtx
@@ -1,8 +1,8 @@
% \iffalse meta-comment
%
-% Copyright (C) 1993-2020
+% Copyright (C) 1993-2021
%
-% The LaTeX3 Project and any individual authors listed elsewhere
+% The LaTeX Project and any individual authors listed elsewhere
% in this file.
%
% This file is part of the Standard LaTeX `Tools Bundle'.
diff --git a/macros/latex-dev/required/tools/somedefs.pdf b/macros/latex-dev/required/tools/somedefs.pdf
index 971033ccd0..71027f1072 100644
--- a/macros/latex-dev/required/tools/somedefs.pdf
+++ b/macros/latex-dev/required/tools/somedefs.pdf
Binary files differ
diff --git a/macros/latex-dev/required/tools/tabularx.dtx b/macros/latex-dev/required/tools/tabularx.dtx
index 577730e665..a0f75fc4fa 100644
--- a/macros/latex-dev/required/tools/tabularx.dtx
+++ b/macros/latex-dev/required/tools/tabularx.dtx
@@ -1,8 +1,8 @@
% \iffalse meta-comment
%
-% Copyright (C) 1993-2020
+% Copyright (C) 1993-2021
%
-% The LaTeX3 Project and any individual authors listed elsewhere
+% The LaTeX Project and any individual authors listed elsewhere
% in this file.
%
% This file is part of the Standard LaTeX `Tools Bundle'.
diff --git a/macros/latex-dev/required/tools/tabularx.ins b/macros/latex-dev/required/tools/tabularx.ins
index 05effd3342..a0d39c2564 100644
--- a/macros/latex-dev/required/tools/tabularx.ins
+++ b/macros/latex-dev/required/tools/tabularx.ins
@@ -3,8 +3,8 @@
%% driver files from the doc files in this package when run through
%% LaTeX or TeX.
%%
-%% Copyright (C) 1993-2020
-%% The LaTeX3 Project and any individual authors listed elsewhere
+%% Copyright (C) 1993-2021
+%% The LaTeX Project and any individual authors listed elsewhere
%% in this file.
%%
%% This file is part of the Standard LaTeX `Tools Bundle'.
@@ -45,8 +45,8 @@ The source is maintained by the LaTeX Project team and bug
reports for it can be opened at https://latex-project.org/bugs/
(but please observe conditions on bug reports sent to that address!)
-Copyright (C) 1993-2020
-The LaTeX3 Project and any individual authors listed elsewhere
+Copyright (C) 1993-2021
+The LaTeX Project and any individual authors listed elsewhere
in this file.
This file was generated from file(s) of the Standard LaTeX `Tools Bundle'.
diff --git a/macros/latex-dev/required/tools/tabularx.pdf b/macros/latex-dev/required/tools/tabularx.pdf
index 073a06b611..7ca0a8a02e 100644
--- a/macros/latex-dev/required/tools/tabularx.pdf
+++ b/macros/latex-dev/required/tools/tabularx.pdf
Binary files differ
diff --git a/macros/latex-dev/required/tools/theorem.dtx b/macros/latex-dev/required/tools/theorem.dtx
index 0df7dbb764..8543ff9d7c 100644
--- a/macros/latex-dev/required/tools/theorem.dtx
+++ b/macros/latex-dev/required/tools/theorem.dtx
@@ -1,8 +1,8 @@
% \iffalse meta-comment
%
-% Copyright (C) 1993-2020
+% Copyright (C) 1993-2021
%
-% The LaTeX3 Project and any individual authors listed elsewhere
+% The LaTeX Project and any individual authors listed elsewhere
% in this file.
%
% This file is part of the Standard LaTeX `Tools Bundle'.
diff --git a/macros/latex-dev/required/tools/theorem.pdf b/macros/latex-dev/required/tools/theorem.pdf
index e05d762426..f534d21bc2 100644
--- a/macros/latex-dev/required/tools/theorem.pdf
+++ b/macros/latex-dev/required/tools/theorem.pdf
Binary files differ
diff --git a/macros/latex-dev/required/tools/tools-overview.pdf b/macros/latex-dev/required/tools/tools-overview.pdf
index 3e5e185e08..403e819139 100644
--- a/macros/latex-dev/required/tools/tools-overview.pdf
+++ b/macros/latex-dev/required/tools/tools-overview.pdf
Binary files differ
diff --git a/macros/latex-dev/required/tools/tools-overview.tex b/macros/latex-dev/required/tools/tools-overview.tex
index a0b3285db9..a2dae49e8f 100644
--- a/macros/latex-dev/required/tools/tools-overview.tex
+++ b/macros/latex-dev/required/tools/tools-overview.tex
@@ -1,13 +1,13 @@
\NeedsTeXFormat{LaTeX2e}
\ProvidesFile{tools-overview.tex}[2015/03/31 v1.0 Tools overview]
-% Copyright (C) 2006-2020
+% Copyright (C) 2006-2021
%
-% The LaTeX3 Project and any individual authors listed elsewhere
+% The LaTeX Project and any individual authors listed elsewhere
% in this file.
%
% Copyright (c) 2006-2014 Heiko Oberdiek
-% (c) 2015-2019 The LaTeX3 Project
+% (c) 2015-2019 The LaTeX Project
%
% This file is part of the Standard LaTeX `Tools Bundle'.
% -------------------------------------------------------
diff --git a/macros/latex-dev/required/tools/tools.ins b/macros/latex-dev/required/tools/tools.ins
index 5e97871221..15c64ac80a 100644
--- a/macros/latex-dev/required/tools/tools.ins
+++ b/macros/latex-dev/required/tools/tools.ins
@@ -3,8 +3,8 @@
%% driver files from the doc files in this package when run through
%% LaTeX or TeX.
%%
-%% Copyright (C) 1993-2020
-%% The LaTeX3 Project and any individual authors listed elsewhere
+%% Copyright (C) 1993-2021
+%% The LaTeX Project and any individual authors listed elsewhere
%% in this file.
%%
%% This file is part of the Standard LaTeX `Tools Bundle'.
@@ -49,8 +49,8 @@ reports for it can be opened at https://latex-project.org/bugs/
(but please observe conditions on bug reports sent to that address!)
-Copyright (C) 1993-2020
-The LaTeX3 Project and any individual authors listed elsewhere
+Copyright (C) 1993-2021
+The LaTeX Project and any individual authors listed elsewhere
in this file.
This file was generated from file(s) of the Standard LaTeX `Tools Bundle'.
diff --git a/macros/latex-dev/required/tools/trace.dtx b/macros/latex-dev/required/tools/trace.dtx
index 4a08f569bb..7ab6e18e25 100644
--- a/macros/latex-dev/required/tools/trace.dtx
+++ b/macros/latex-dev/required/tools/trace.dtx
@@ -1,8 +1,8 @@
% \iffalse meta-comment
%
-% Copyright (C) 1993-2020
+% Copyright (C) 1993-2021
%
-% The LaTeX3 Project and any individual authors listed elsewhere
+% The LaTeX Project and any individual authors listed elsewhere
% in this file.
%
% This file is part of the Standard LaTeX `Tools Bundle'.
diff --git a/macros/latex-dev/required/tools/trace.pdf b/macros/latex-dev/required/tools/trace.pdf
index 9ca1ce2f17..5d66b884d1 100644
--- a/macros/latex-dev/required/tools/trace.pdf
+++ b/macros/latex-dev/required/tools/trace.pdf
Binary files differ
diff --git a/macros/latex-dev/required/tools/varioref-2016-02-16.sty b/macros/latex-dev/required/tools/varioref-2016-02-16.sty
index 054157117e..747e89dc60 100644
--- a/macros/latex-dev/required/tools/varioref-2016-02-16.sty
+++ b/macros/latex-dev/required/tools/varioref-2016-02-16.sty
@@ -13,7 +13,7 @@
%% (but please observe conditions on bug reports sent to that address!)
%%
%% Copyright 1993-2017
-%% The LaTeX3 Project and any individual authors listed elsewhere
+%% The LaTeX Project and any individual authors listed elsewhere
%% in this file.
%%
%% This file was generated from file(s) of the Standard LaTeX `Tools Bundle'.
diff --git a/macros/latex-dev/required/tools/varioref.dtx b/macros/latex-dev/required/tools/varioref.dtx
index 2bba60465e..eac06580e7 100644
--- a/macros/latex-dev/required/tools/varioref.dtx
+++ b/macros/latex-dev/required/tools/varioref.dtx
@@ -1,8 +1,8 @@
% \iffalse meta-comment
%
-% Copyright (C) 1993-2020
+% Copyright (C) 1993-2021
%
-% The LaTeX3 Project and any individual authors listed elsewhere
+% The LaTeX Project and any individual authors listed elsewhere
% in this file.
%
% This file is part of the Standard LaTeX `Tools Bundle'.
diff --git a/macros/latex-dev/required/tools/varioref.ins b/macros/latex-dev/required/tools/varioref.ins
index 951eedad89..559f1f2854 100644
--- a/macros/latex-dev/required/tools/varioref.ins
+++ b/macros/latex-dev/required/tools/varioref.ins
@@ -3,8 +3,8 @@
%% driver files from the doc files in this package when run through
%% LaTeX or TeX.
%%
-%% Copyright (C) 1993-2020
-%% The LaTeX3 Project and any individual authors listed elsewhere
+%% Copyright (C) 1993-2021
+%% The LaTeX Project and any individual authors listed elsewhere
%% in this file.
%%
%% This file is part of the Standard LaTeX `Tools Bundle'.
@@ -45,8 +45,8 @@ The source is maintained by the LaTeX Project team and bug
reports for it can be opened at https://latex-project.org/bugs/
(but please observe conditions on bug reports sent to that address!)
-Copyright (C) 1993-2020
-The LaTeX3 Project and any individual authors listed elsewhere
+Copyright (C) 1993-2021
+The LaTeX Project and any individual authors listed elsewhere
in this file.
This file was generated from file(s) of the Standard LaTeX `Tools Bundle'.
diff --git a/macros/latex-dev/required/tools/varioref.pdf b/macros/latex-dev/required/tools/varioref.pdf
index 99d919a796..0bb2015760 100644
--- a/macros/latex-dev/required/tools/varioref.pdf
+++ b/macros/latex-dev/required/tools/varioref.pdf
Binary files differ
diff --git a/macros/latex-dev/required/tools/verbatim.dtx b/macros/latex-dev/required/tools/verbatim.dtx
index e62886e003..fcbaf28172 100644
--- a/macros/latex-dev/required/tools/verbatim.dtx
+++ b/macros/latex-dev/required/tools/verbatim.dtx
@@ -1,8 +1,8 @@
% \iffalse meta-comment
%
-% Copyright (C) 1993-2020
+% Copyright (C) 1993-2021
%
-% The LaTeX3 Project and any individual authors listed elsewhere
+% The LaTeX Project and any individual authors listed elsewhere
% in this file.
%
% This file is part of the Standard LaTeX `Tools Bundle'.
diff --git a/macros/latex-dev/required/tools/verbatim.pdf b/macros/latex-dev/required/tools/verbatim.pdf
index c1e439f38f..dfe2c00886 100644
--- a/macros/latex-dev/required/tools/verbatim.pdf
+++ b/macros/latex-dev/required/tools/verbatim.pdf
Binary files differ
diff --git a/macros/latex-dev/required/tools/xr.dtx b/macros/latex-dev/required/tools/xr.dtx
index a963886cde..c0d0b90c0f 100644
--- a/macros/latex-dev/required/tools/xr.dtx
+++ b/macros/latex-dev/required/tools/xr.dtx
@@ -1,8 +1,8 @@
% \iffalse meta-comment
%
-% Copyright (C) 1993-2020
+% Copyright (C) 1993-2021
%
-% The LaTeX3 Project and any individual authors listed elsewhere
+% The LaTeX Project and any individual authors listed elsewhere
% in this file.
%
% This file is part of the Standard LaTeX `Tools Bundle'.
diff --git a/macros/latex-dev/required/tools/xr.pdf b/macros/latex-dev/required/tools/xr.pdf
index 70f7f47d00..aa07a176cd 100644
--- a/macros/latex-dev/required/tools/xr.pdf
+++ b/macros/latex-dev/required/tools/xr.pdf
Binary files differ
diff --git a/macros/latex-dev/required/tools/xspace.dtx b/macros/latex-dev/required/tools/xspace.dtx
index ebe8d0f947..adcfe154da 100644
--- a/macros/latex-dev/required/tools/xspace.dtx
+++ b/macros/latex-dev/required/tools/xspace.dtx
@@ -1,8 +1,8 @@
% \iffalse meta-comment
%
-% Copyright (C) 1993-2020
+% Copyright (C) 1993-2021
%
-% The LaTeX3 Project and any individual authors listed elsewhere
+% The LaTeX Project and any individual authors listed elsewhere
% in this file.
%
% This file is part of the Standard LaTeX `Tools Bundle'.
diff --git a/macros/latex-dev/required/tools/xspace.pdf b/macros/latex-dev/required/tools/xspace.pdf
index 679ca0d7cf..6d9e938780 100644
--- a/macros/latex-dev/required/tools/xspace.pdf
+++ b/macros/latex-dev/required/tools/xspace.pdf
Binary files differ