summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/source')
-rw-r--r--Master/texmf-dist/source/generic/babel-french/frenchb.dtx38
-rw-r--r--Master/texmf-dist/source/generic/lt3luabridge/lt3luabridge.dtx87
-rw-r--r--Master/texmf-dist/source/generic/markdown/docstrip.cfg10
-rw-r--r--Master/texmf-dist/source/generic/markdown/markdown.dtx4635
-rw-r--r--Master/texmf-dist/source/generic/markdown/markdown.ins6
-rw-r--r--Master/texmf-dist/source/generic/pst-diffraction/Makefile55
-rw-r--r--Master/texmf-dist/source/generic/tex4ht/ChangeLog95
-rw-r--r--Master/texmf-dist/source/generic/tex4ht/Makefile4
-rw-r--r--Master/texmf-dist/source/generic/tex4ht/mktex4ht-cnf.tex4
-rw-r--r--Master/texmf-dist/source/generic/tex4ht/tex4ht-4ht.tex257
-rw-r--r--Master/texmf-dist/source/generic/tex4ht/tex4ht-cpright.tex4
-rw-r--r--Master/texmf-dist/source/generic/tex4ht/tex4ht-env.tex17
-rw-r--r--Master/texmf-dist/source/generic/tex4ht/tex4ht-fonts-noncjk.tex65
-rw-r--r--Master/texmf-dist/source/generic/tex4ht/tex4ht-html4.tex59
-rw-r--r--Master/texmf-dist/source/generic/tex4ht/tex4ht-jats.tex26
-rw-r--r--Master/texmf-dist/source/generic/tex4ht/tex4ht-mathjax.tex24
-rw-r--r--Master/texmf-dist/source/generic/tex4ht/tex4ht-mathml.tex215
-rw-r--r--Master/texmf-dist/source/latex-dev/base/alltt.dtx4
-rw-r--r--Master/texmf-dist/source/latex-dev/base/classes.dtx12
-rw-r--r--Master/texmf-dist/source/latex-dev/base/doc.dtx8
-rw-r--r--Master/texmf-dist/source/latex-dev/base/fontdef.dtx15
-rw-r--r--Master/texmf-dist/source/latex-dev/base/latexrelease.dtx4
-rw-r--r--Master/texmf-dist/source/latex-dev/base/letter.dtx5
-rw-r--r--Master/texmf-dist/source/latex-dev/base/ltboxes.dtx51
-rw-r--r--Master/texmf-dist/source/latex-dev/base/ltcmd.dtx152
-rw-r--r--Master/texmf-dist/source/latex-dev/base/ltcmdhooks.dtx3
-rw-r--r--Master/texmf-dist/source/latex-dev/base/ltfinal.dtx4
-rw-r--r--Master/texmf-dist/source/latex-dev/base/ltfssbas.dtx11
-rw-r--r--Master/texmf-dist/source/latex-dev/base/lthooks.dtx53
-rw-r--r--Master/texmf-dist/source/latex-dev/base/ltkeys.dtx135
-rw-r--r--Master/texmf-dist/source/latex-dev/base/ltlists.dtx126
-rw-r--r--Master/texmf-dist/source/latex-dev/base/ltluatex.dtx16
-rw-r--r--Master/texmf-dist/source/latex-dev/base/ltmarks.dtx8
-rw-r--r--Master/texmf-dist/source/latex-dev/base/ltmiscen.dtx252
-rw-r--r--Master/texmf-dist/source/latex-dev/base/ltpara.dtx28
-rw-r--r--Master/texmf-dist/source/latex-dev/base/ltpictur.dtx3
-rw-r--r--Master/texmf-dist/source/latex-dev/base/ltproperties.dtx6
-rw-r--r--Master/texmf-dist/source/latex-dev/base/ltsockets.dtx8
-rw-r--r--Master/texmf-dist/source/latex-dev/base/lttab.dtx4
-rw-r--r--Master/texmf-dist/source/latex-dev/base/lttagging.dtx146
-rw-r--r--Master/texmf-dist/source/latex-dev/base/ltvers.dtx2
-rw-r--r--Master/texmf-dist/source/latex-dev/graphics/color.dtx9
-rw-r--r--Master/texmf-dist/source/latex-dev/graphics/graphics.dtx5
-rw-r--r--Master/texmf-dist/source/latex-dev/l3kernel/expl3.dtx13
-rw-r--r--Master/texmf-dist/source/latex-dev/l3kernel/l3basics.dtx9
-rw-r--r--Master/texmf-dist/source/latex-dev/l3kernel/l3bitset.dtx2
-rw-r--r--Master/texmf-dist/source/latex-dev/l3kernel/l3bootstrap.dtx2
-rw-r--r--Master/texmf-dist/source/latex-dev/l3kernel/l3box.dtx6
-rw-r--r--Master/texmf-dist/source/latex-dev/l3kernel/l3cctab.dtx2
-rw-r--r--Master/texmf-dist/source/latex-dev/l3kernel/l3clist.dtx6
-rw-r--r--Master/texmf-dist/source/latex-dev/l3kernel/l3coffins.dtx2
-rw-r--r--Master/texmf-dist/source/latex-dev/l3kernel/l3color.dtx32
-rw-r--r--Master/texmf-dist/source/latex-dev/l3kernel/l3debug.dtx4
-rw-r--r--Master/texmf-dist/source/latex-dev/l3kernel/l3deprecation.dtx8
-rw-r--r--Master/texmf-dist/source/latex-dev/l3kernel/l3doc.dtx40
-rw-r--r--Master/texmf-dist/source/latex-dev/l3kernel/l3docstrip.dtx2
-rw-r--r--Master/texmf-dist/source/latex-dev/l3kernel/l3expan.dtx6
-rw-r--r--Master/texmf-dist/source/latex-dev/l3kernel/l3file.dtx8
-rw-r--r--Master/texmf-dist/source/latex-dev/l3kernel/l3flag.dtx2
-rw-r--r--Master/texmf-dist/source/latex-dev/l3kernel/l3fp-assign.dtx2
-rw-r--r--Master/texmf-dist/source/latex-dev/l3kernel/l3fp-aux.dtx2
-rw-r--r--Master/texmf-dist/source/latex-dev/l3kernel/l3fp-basics.dtx2
-rw-r--r--Master/texmf-dist/source/latex-dev/l3kernel/l3fp-convert.dtx2
-rw-r--r--Master/texmf-dist/source/latex-dev/l3kernel/l3fp-expo.dtx2
-rw-r--r--Master/texmf-dist/source/latex-dev/l3kernel/l3fp-extended.dtx2
-rw-r--r--Master/texmf-dist/source/latex-dev/l3kernel/l3fp-functions.dtx2
-rw-r--r--Master/texmf-dist/source/latex-dev/l3kernel/l3fp-logic.dtx2
-rw-r--r--Master/texmf-dist/source/latex-dev/l3kernel/l3fp-parse.dtx2
-rw-r--r--Master/texmf-dist/source/latex-dev/l3kernel/l3fp-random.dtx2
-rw-r--r--Master/texmf-dist/source/latex-dev/l3kernel/l3fp-round.dtx2
-rw-r--r--Master/texmf-dist/source/latex-dev/l3kernel/l3fp-symbolic.dtx2
-rw-r--r--Master/texmf-dist/source/latex-dev/l3kernel/l3fp-traps.dtx2
-rw-r--r--Master/texmf-dist/source/latex-dev/l3kernel/l3fp-trig.dtx2
-rw-r--r--Master/texmf-dist/source/latex-dev/l3kernel/l3fp-types.dtx2
-rw-r--r--Master/texmf-dist/source/latex-dev/l3kernel/l3fp.dtx4
-rw-r--r--Master/texmf-dist/source/latex-dev/l3kernel/l3fparray.dtx2
-rw-r--r--Master/texmf-dist/source/latex-dev/l3kernel/l3int.dtx17
-rw-r--r--Master/texmf-dist/source/latex-dev/l3kernel/l3intarray.dtx2
-rw-r--r--Master/texmf-dist/source/latex-dev/l3kernel/l3kernel-functions.dtx2
-rw-r--r--Master/texmf-dist/source/latex-dev/l3kernel/l3keys.dtx28
-rw-r--r--Master/texmf-dist/source/latex-dev/l3kernel/l3legacy.dtx2
-rw-r--r--Master/texmf-dist/source/latex-dev/l3kernel/l3luatex.dtx2
-rw-r--r--Master/texmf-dist/source/latex-dev/l3kernel/l3msg.dtx2
-rw-r--r--Master/texmf-dist/source/latex-dev/l3kernel/l3names.dtx2
-rw-r--r--Master/texmf-dist/source/latex-dev/l3kernel/l3pdf.dtx14
-rw-r--r--Master/texmf-dist/source/latex-dev/l3kernel/l3prg.dtx2
-rw-r--r--Master/texmf-dist/source/latex-dev/l3kernel/l3prop.dtx42
-rw-r--r--Master/texmf-dist/source/latex-dev/l3kernel/l3quark.dtx4
-rw-r--r--Master/texmf-dist/source/latex-dev/l3kernel/l3regex.dtx2
-rw-r--r--Master/texmf-dist/source/latex-dev/l3kernel/l3seq.dtx2
-rw-r--r--Master/texmf-dist/source/latex-dev/l3kernel/l3skip.dtx2
-rw-r--r--Master/texmf-dist/source/latex-dev/l3kernel/l3sort.dtx2
-rw-r--r--Master/texmf-dist/source/latex-dev/l3kernel/l3str-convert.dtx2
-rw-r--r--Master/texmf-dist/source/latex-dev/l3kernel/l3str.dtx4
-rw-r--r--Master/texmf-dist/source/latex-dev/l3kernel/l3sys.dtx2
-rw-r--r--Master/texmf-dist/source/latex-dev/l3kernel/l3text-case.dtx2
-rw-r--r--Master/texmf-dist/source/latex-dev/l3kernel/l3text-map.dtx2
-rw-r--r--Master/texmf-dist/source/latex-dev/l3kernel/l3text-purify.dtx2
-rw-r--r--Master/texmf-dist/source/latex-dev/l3kernel/l3text.dtx16
-rw-r--r--Master/texmf-dist/source/latex-dev/l3kernel/l3tl-analysis.dtx2
-rw-r--r--Master/texmf-dist/source/latex-dev/l3kernel/l3tl-build.dtx2
-rw-r--r--Master/texmf-dist/source/latex-dev/l3kernel/l3tl.dtx2
-rw-r--r--Master/texmf-dist/source/latex-dev/l3kernel/l3token.dtx2
-rw-r--r--Master/texmf-dist/source/latex-dev/l3kernel/l3unicode.dtx17
-rw-r--r--Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-amsmath.dtx6
-rw-r--r--Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-bib.dtx10
-rw-r--r--Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-block.dtx94
-rw-r--r--Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-firstaid.dtx8
-rw-r--r--Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-float.dtx4
-rw-r--r--Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-footnotes.dtx28
-rw-r--r--Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-graphic.dtx10
-rw-r--r--Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-marginpar.dtx35
-rw-r--r--Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-math.dtx573
-rw-r--r--Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-mathtools.dtx4
-rw-r--r--Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-minipage.dtx51
-rw-r--r--Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-namespace.dtx4
-rw-r--r--Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-sec.dtx8
-rw-r--r--Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-table.dtx447
-rw-r--r--Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-testphase.dtx2
-rw-r--r--Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-toc-kernel-changes.dtx91
-rw-r--r--Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-toc.dtx93
-rw-r--r--Master/texmf-dist/source/latex-dev/tools/array.dtx52
-rw-r--r--Master/texmf-dist/source/latex-dev/tools/longtable.dtx156
-rw-r--r--Master/texmf-dist/source/latex-dev/tools/multicol.dtx37
-rw-r--r--Master/texmf-dist/source/latex-dev/tools/theorem.dtx3
-rw-r--r--Master/texmf-dist/source/latex/acmart/Makefile26
-rw-r--r--Master/texmf-dist/source/latex/acmart/acmart.dtx180
-rw-r--r--Master/texmf-dist/source/latex/acmart/acmart.ins1
-rw-r--r--Master/texmf-dist/source/latex/babel/babel.dtx2296
-rw-r--r--Master/texmf-dist/source/latex/babel/babel.ins2
-rw-r--r--Master/texmf-dist/source/latex/babel/bbcompat.dtx2
-rw-r--r--Master/texmf-dist/source/latex/babel/locale.zipbin1088254 -> 1090114 bytes
-rw-r--r--Master/texmf-dist/source/latex/base/ltpara.dtx22
-rw-r--r--Master/texmf-dist/source/latex/base/ltvers.dtx2
-rw-r--r--Master/texmf-dist/source/latex/bib2qr/bib2qr.dtx594
-rw-r--r--Master/texmf-dist/source/latex/bib2qr/bib2qr.ins85
-rw-r--r--Master/texmf-dist/source/latex/bxjscls/bxjscls.dtx90
-rw-r--r--Master/texmf-dist/source/latex/catppuccinpalette/catppuccinpalette.dtx430
-rw-r--r--Master/texmf-dist/source/latex/catppuccinpalette/catppuccinpalette.ins66
-rw-r--r--Master/texmf-dist/source/latex/changebar/changebar.dtx158
-rw-r--r--Master/texmf-dist/source/latex/cjs-rcs-article/cjs-rcs-article.dtx1038
-rw-r--r--Master/texmf-dist/source/latex/cjs-rcs-article/cjs-rcs-bst-en.dbj611
-rw-r--r--Master/texmf-dist/source/latex/cjs-rcs-article/cjs-rcs-bst-fr.dbj603
-rw-r--r--Master/texmf-dist/source/latex/cjs-rcs-article/cjs-rcs-class.dbj39
-rw-r--r--Master/texmf-dist/source/latex/cjs-rcs-article/cjs-rcs-english.mbs420
-rw-r--r--Master/texmf-dist/source/latex/cjs-rcs-article/cjs-rcs-french.mbs370
-rw-r--r--Master/texmf-dist/source/latex/cjs-rcs-article/cjs-rcs-merlin.mbs8009
-rw-r--r--Master/texmf-dist/source/latex/colortbl/colortbl.dtx34
-rw-r--r--Master/texmf-dist/source/latex/dccpaper/dccpaper.dtx24
-rw-r--r--Master/texmf-dist/source/latex/delimset/delimset.dtx1202
-rw-r--r--Master/texmf-dist/source/latex/delimset/delimset.ins4
-rw-r--r--Master/texmf-dist/source/latex/doibanner/doibanner.dtx412
-rw-r--r--Master/texmf-dist/source/latex/doibanner/doibanner.ins85
-rw-r--r--Master/texmf-dist/source/latex/easybook/easybook.dtx560
-rw-r--r--Master/texmf-dist/source/latex/enverb/enverb.dtx720
-rw-r--r--Master/texmf-dist/source/latex/fancyhdr/fancyhdr.dtx244
-rw-r--r--Master/texmf-dist/source/latex/fillwith/fillwith.dtx747
-rw-r--r--Master/texmf-dist/source/latex/fillwith/fillwith.ins68
-rw-r--r--Master/texmf-dist/source/latex/firstaid/latex2e-first-aid-for-external-files.dtx27
-rw-r--r--Master/texmf-dist/source/latex/gridset/gridset.dtx61
-rw-r--r--Master/texmf-dist/source/latex/gridset/gridset.ins38
-rw-r--r--Master/texmf-dist/source/latex/heria/heria.dtx170
-rw-r--r--Master/texmf-dist/source/latex/heria/heria.ins4
-rw-r--r--Master/texmf-dist/source/latex/hypcap/hypcap.dtx (renamed from Master/texmf-dist/source/latex/oberdiek/hypcap.dtx)73
-rw-r--r--Master/texmf-dist/source/latex/hyperref/hluatex.dtx4
-rw-r--r--Master/texmf-dist/source/latex/hyperref/hyperref-linktarget.dtx2
-rw-r--r--Master/texmf-dist/source/latex/hyperref/hyperref-patches.dtx2
-rw-r--r--Master/texmf-dist/source/latex/hyperref/hyperref.dtx9
-rw-r--r--Master/texmf-dist/source/latex/hyperref/xr-hyper.dtx2
-rw-r--r--Master/texmf-dist/source/latex/isosafety/isosafety.dtx143
-rw-r--r--Master/texmf-dist/source/latex/isosafety/isosafety.ins56
-rw-r--r--Master/texmf-dist/source/latex/iwonamath/Makefile6
-rw-r--r--Master/texmf-dist/source/latex/iwonamath/iwonamath.dtx6
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/expl3.dtx13
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3basics.dtx2
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3bitset.dtx2
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3bootstrap.dtx2
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3box.dtx6
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3cctab.dtx2
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3clist.dtx16
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3coffins.dtx2
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3color.dtx30
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3debug.dtx4
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3deprecation.dtx8
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3doc.dtx4
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3docstrip.dtx2
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3expan.dtx2
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3file.dtx2
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3flag.dtx2
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3fp-assign.dtx2
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3fp-aux.dtx2
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3fp-basics.dtx2
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3fp-convert.dtx2
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3fp-expo.dtx2
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3fp-extended.dtx2
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3fp-functions.dtx2
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3fp-logic.dtx2
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3fp-parse.dtx2
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3fp-random.dtx2
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3fp-round.dtx2
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3fp-symbolic.dtx2
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3fp-traps.dtx2
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3fp-trig.dtx2
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3fp-types.dtx2
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3fp.dtx4
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3fparray.dtx2
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3int.dtx17
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3intarray.dtx2
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3kernel-functions.dtx2
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3keys.dtx41
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3legacy.dtx2
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3luatex.dtx2
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3msg.dtx2
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3names.dtx2
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3pdf.dtx14
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3prg.dtx2
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3prop.dtx42
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3quark.dtx4
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3regex.dtx2
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3seq.dtx2
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3skip.dtx2
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3sort.dtx2
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3str-convert.dtx2
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3str.dtx4
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3sys.dtx2
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3text-case.dtx2
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3text-map.dtx2
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3text-purify.dtx2
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3text.dtx16
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3tl-analysis.dtx2
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3tl-build.dtx2
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3tl.dtx2
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3token.dtx2
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3unicode.dtx2
-rw-r--r--Master/texmf-dist/source/latex/l3packages/l3keys2e/l3keys2e.dtx4
-rw-r--r--Master/texmf-dist/source/latex/l3packages/xfp/xfp.dtx4
-rw-r--r--Master/texmf-dist/source/latex/l3packages/xparse/xparse.dtx25
-rw-r--r--Master/texmf-dist/source/latex/l3packages/xtemplate/xtemplate.dtx5
-rw-r--r--Master/texmf-dist/source/latex/lastpage/lastpage.drv13
-rw-r--r--Master/texmf-dist/source/latex/lastpage/lastpage.dtx179
-rw-r--r--Master/texmf-dist/source/latex/lastpage/lastpage.ins20
-rw-r--r--Master/texmf-dist/source/latex/lettrine/lettrine.dtx32
-rw-r--r--Master/texmf-dist/source/latex/lni/lni.dtx108
-rw-r--r--Master/texmf-dist/source/latex/lstaddons/lstautogobble.dtx6
-rw-r--r--Master/texmf-dist/source/latex/lstaddons/lstlinebgrd.dtx17
-rw-r--r--Master/texmf-dist/source/latex/magicwatermark/magicwatermark.dtx597
-rw-r--r--Master/texmf-dist/source/latex/mailing/mailing.dtx38
-rw-r--r--Master/texmf-dist/source/latex/mailing/mailing.ins42
-rw-r--r--Master/texmf-dist/source/latex/mathastext/mathastext.dtx5913
-rw-r--r--Master/texmf-dist/source/latex/moloch/beamercolorthememoloch.dtx2
-rw-r--r--Master/texmf-dist/source/latex/moloch/beamerfontthememoloch.dtx187
-rw-r--r--Master/texmf-dist/source/latex/moloch/beamerinnerthememoloch.dtx19
-rw-r--r--Master/texmf-dist/source/latex/moloch/beamerouterthememoloch.dtx42
-rw-r--r--Master/texmf-dist/source/latex/moloch/beamerthememoloch.dtx58
-rw-r--r--Master/texmf-dist/source/latex/moremath/moremath.dtx5761
-rw-r--r--Master/texmf-dist/source/latex/moremath/moremath.ins66
-rw-r--r--Master/texmf-dist/source/latex/nicematrix/nicematrix-code.dtx594
-rw-r--r--Master/texmf-dist/source/latex/oberdiek/aliascnt.dtx4
-rw-r--r--Master/texmf-dist/source/latex/oberdiek/bmpsize.dtx4
-rw-r--r--Master/texmf-dist/source/latex/oberdiek/centernot.dtx2
-rw-r--r--Master/texmf-dist/source/latex/oberdiek/chemarr.dtx2
-rw-r--r--Master/texmf-dist/source/latex/oberdiek/classlist.dtx4
-rw-r--r--Master/texmf-dist/source/latex/oberdiek/colonequals.dtx2
-rw-r--r--Master/texmf-dist/source/latex/oberdiek/dvipscol.dtx2
-rw-r--r--Master/texmf-dist/source/latex/oberdiek/engord.dtx2
-rw-r--r--Master/texmf-dist/source/latex/oberdiek/enparen.dtx10
-rw-r--r--Master/texmf-dist/source/latex/oberdiek/eolgrab.dtx2
-rw-r--r--Master/texmf-dist/source/latex/oberdiek/fibnum.dtx2
-rw-r--r--Master/texmf-dist/source/latex/oberdiek/flags.dtx2
-rw-r--r--Master/texmf-dist/source/latex/oberdiek/holtxdoc.dtx2
-rw-r--r--Master/texmf-dist/source/latex/oberdiek/hypbmsec.dtx8
-rw-r--r--Master/texmf-dist/source/latex/oberdiek/hypgotoe.dtx4
-rw-r--r--Master/texmf-dist/source/latex/oberdiek/hyphsubst.dtx2
-rw-r--r--Master/texmf-dist/source/latex/oberdiek/ifdraft.dtx2
-rw-r--r--Master/texmf-dist/source/latex/oberdiek/iflang.dtx8
-rw-r--r--Master/texmf-dist/source/latex/oberdiek/oberdiek.ins4
-rw-r--r--Master/texmf-dist/source/latex/oberdiek/oberdiek.tex33
-rw-r--r--Master/texmf-dist/source/latex/oberdiek/pdfcolparallel.dtx2
-rw-r--r--Master/texmf-dist/source/latex/oberdiek/pdfcolparcolumns.dtx2
-rw-r--r--Master/texmf-dist/source/latex/oberdiek/pdfcrypt.dtx2
-rw-r--r--Master/texmf-dist/source/latex/oberdiek/protecteddef.dtx4
-rw-r--r--Master/texmf-dist/source/latex/oberdiek/resizegather.dtx2
-rw-r--r--Master/texmf-dist/source/latex/oberdiek/rotchiffre.dtx4
-rw-r--r--Master/texmf-dist/source/latex/oberdiek/scrindex.dtx4
-rw-r--r--Master/texmf-dist/source/latex/oberdiek/setouterhbox.dtx6
-rw-r--r--Master/texmf-dist/source/latex/oberdiek/settobox.dtx4
-rw-r--r--Master/texmf-dist/source/latex/oberdiek/stackrel.dtx2
-rw-r--r--Master/texmf-dist/source/latex/oberdiek/stampinclude.dtx6
-rw-r--r--Master/texmf-dist/source/latex/oberdiek/tabularht.dtx6
-rw-r--r--Master/texmf-dist/source/latex/oberdiek/tabularkv.dtx2
-rw-r--r--Master/texmf-dist/source/latex/oberdiek/thepdfnumber.dtx12
-rw-r--r--Master/texmf-dist/source/latex/oberdiek/twoopt.dtx2
-rw-r--r--Master/texmf-dist/source/latex/orcidlink/orcidlink.dtx91
-rw-r--r--Master/texmf-dist/source/latex/orcidlink/orcidlink.ins4
-rw-r--r--Master/texmf-dist/source/latex/overarrows/overarrows.dtx1142
-rw-r--r--Master/texmf-dist/source/latex/pdfmanagement-testphase/hyperref-generic.dtx48
-rw-r--r--Master/texmf-dist/source/latex/pdfmanagement-testphase/l3backend-testphase.dtx20
-rw-r--r--Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdfannot.dtx6
-rw-r--r--Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdfdict.dtx4
-rw-r--r--Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdffield-action.dtx6
-rw-r--r--Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdffield-checkbox.dtx2
-rw-r--r--Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdffield-choice.dtx21
-rw-r--r--Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdffield-pushbutton.dtx2
-rw-r--r--Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdffield-radiobutton.dtx2
-rw-r--r--Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdffield-textfield.dtx2
-rw-r--r--Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdffield.dtx10
-rw-r--r--Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdffile.dtx6
-rw-r--r--Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdfmanagement.dtx26
-rw-r--r--Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdfmeta.dtx49
-rw-r--r--Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdftools.dtx6
-rw-r--r--Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdfxform.dtx4
-rw-r--r--Master/texmf-dist/source/latex/pdfmanagement-testphase/ltdocinit.dtx4
-rw-r--r--Master/texmf-dist/source/latex/pdfmanagement-testphase/pdfmanagement-firstaid.dtx4
-rw-r--r--Master/texmf-dist/source/latex/pdfmanagement-testphase/pdfmanagement-testphase.dtx6
-rw-r--r--Master/texmf-dist/source/latex/pdfx/pdfx.dtx1536
-rw-r--r--Master/texmf-dist/source/latex/pdfx/pdfx.ins4
-rw-r--r--Master/texmf-dist/source/latex/polyglossia/polyglossia.dtx8728
-rw-r--r--Master/texmf-dist/source/latex/preview/preview.dtx14
-rw-r--r--Master/texmf-dist/source/latex/reledmac/reledmac.dtx4
-rw-r--r--Master/texmf-dist/source/latex/reledmac/reledpar.dtx49
-rw-r--r--Master/texmf-dist/source/latex/reptheorem/reptheorem.dtx84
-rw-r--r--Master/texmf-dist/source/latex/reptheorem/reptheorem.ins2
-rw-r--r--Master/texmf-dist/source/latex/se2thesis/se2colors.dtx2
-rw-r--r--Master/texmf-dist/source/latex/se2thesis/se2fonts.dtx2
-rw-r--r--Master/texmf-dist/source/latex/se2thesis/se2packages.dtx4
-rw-r--r--Master/texmf-dist/source/latex/se2thesis/se2thesis.dtx97
-rw-r--r--Master/texmf-dist/source/latex/sillypage/sillypage.dtx34
-rw-r--r--Master/texmf-dist/source/latex/siunitx/siunitx-angle.dtx130
-rw-r--r--Master/texmf-dist/source/latex/siunitx/siunitx-complex.dtx45
-rw-r--r--Master/texmf-dist/source/latex/siunitx/siunitx-number.dtx8
-rw-r--r--Master/texmf-dist/source/latex/siunitx/siunitx-table.dtx51
-rw-r--r--Master/texmf-dist/source/latex/siunitx/siunitx.dtx5
-rw-r--r--Master/texmf-dist/source/latex/siunitx/siunitx.tex12
-rw-r--r--Master/texmf-dist/source/latex/sjtutex/sjtutex.dtx31
-rw-r--r--Master/texmf-dist/source/latex/spelatex/spelatex.dtx462
-rw-r--r--Master/texmf-dist/source/latex/subeqn/subeqn.dtx57
-rw-r--r--Master/texmf-dist/source/latex/subeqn/subeqn.ins49
-rw-r--r--Master/texmf-dist/source/latex/subeqnarray/subeqnarray.dtx85
-rw-r--r--Master/texmf-dist/source/latex/subeqnarray/subeqnarray.ins56
-rw-r--r--Master/texmf-dist/source/latex/supertabular/supertabular.dtx323
-rw-r--r--Master/texmf-dist/source/latex/synthslant/Makefile133
-rw-r--r--Master/texmf-dist/source/latex/synthslant/synthslant.dtx752
-rw-r--r--Master/texmf-dist/source/latex/synthslant/synthslant.ins21
-rw-r--r--Master/texmf-dist/source/latex/tablvar/tablvar.dtx583
-rw-r--r--Master/texmf-dist/source/latex/tablvar/tablvar.ins6
-rw-r--r--Master/texmf-dist/source/latex/tagpdf/tagpdf-backend.dtx99
-rw-r--r--Master/texmf-dist/source/latex/tagpdf/tagpdf-checks.dtx8
-rw-r--r--Master/texmf-dist/source/latex/tagpdf/tagpdf-data.dtx20
-rw-r--r--Master/texmf-dist/source/latex/tagpdf/tagpdf-mc-generic.dtx10
-rw-r--r--Master/texmf-dist/source/latex/tagpdf/tagpdf-mc-luacode.dtx8
-rw-r--r--Master/texmf-dist/source/latex/tagpdf/tagpdf-mc-shared.dtx6
-rw-r--r--Master/texmf-dist/source/latex/tagpdf/tagpdf-roles.dtx36
-rw-r--r--Master/texmf-dist/source/latex/tagpdf/tagpdf-space.dtx8
-rw-r--r--Master/texmf-dist/source/latex/tagpdf/tagpdf-struct.dtx23
-rw-r--r--Master/texmf-dist/source/latex/tagpdf/tagpdf-tree.dtx10
-rw-r--r--Master/texmf-dist/source/latex/tagpdf/tagpdf-user.dtx6
-rw-r--r--Master/texmf-dist/source/latex/tagpdf/tagpdf.dtx33
-rw-r--r--Master/texmf-dist/source/latex/telprint/telprint.dtx (renamed from Master/texmf-dist/source/latex/oberdiek/telprint.dtx)79
-rw-r--r--Master/texmf-dist/source/latex/texvc/Makefile17
-rw-r--r--Master/texmf-dist/source/latex/texvc/texvc.dtx48
-rw-r--r--Master/texmf-dist/source/latex/texvc/texvc.ins84
-rw-r--r--Master/texmf-dist/source/latex/thuthesis/thuthesis.dtx46
-rw-r--r--Master/texmf-dist/source/latex/typog/Makefile183
-rw-r--r--Master/texmf-dist/source/latex/typog/typog.dtx3217
-rw-r--r--Master/texmf-dist/source/latex/typog/typog.ins30
-rw-r--r--Master/texmf-dist/source/latex/uantwerpendocs/uantwerpendocs.dtx31
-rw-r--r--Master/texmf-dist/source/latex/ulthese/ulthese.dtx2046
-rw-r--r--Master/texmf-dist/source/latex/ulthese/ulthese.ins43
-rw-r--r--Master/texmf-dist/source/latex/ut-thesis/ut-thesis.dtx16
-rw-r--r--Master/texmf-dist/source/latex/ut-thesis/ut-thesis.ins21
-rw-r--r--Master/texmf-dist/source/latex/zref-clever/zref-clever.dtx256
-rw-r--r--Master/texmf-dist/source/lualatex/innerscript/innerscript_code.dtx56
-rw-r--r--Master/texmf-dist/source/lualatex/luamml/luamml.dtx531
-rw-r--r--Master/texmf-dist/source/lualatex/piton/piton.dtx1385
-rw-r--r--Master/texmf-dist/source/luatex/luamplib/Makefile1
-rw-r--r--Master/texmf-dist/source/luatex/luamplib/luamplib.dtx2336
376 files changed, 49164 insertions, 19067 deletions
diff --git a/Master/texmf-dist/source/generic/babel-french/frenchb.dtx b/Master/texmf-dist/source/generic/babel-french/frenchb.dtx
index 331a0195e04..b52e5c67e76 100644
--- a/Master/texmf-dist/source/generic/babel-french/frenchb.dtx
+++ b/Master/texmf-dist/source/generic/babel-french/frenchb.dtx
@@ -75,7 +75,7 @@ Please report errors to: <daniel (dot) flipo (at) free (dot) fr>
%<frenchb>\ProvidesLanguage{frenchb}
%<lua>--[[
%<lua> File `frenchb.lua’ generated from frenchb.dtx
- [2024-05-24 v3.6a French support from the babel system]
+ [2024-07-25 v3.6c French support from the babel system]
%<lua> Copyright © 2014-2024 Daniel Flipo
%<lua> <daniel (dot) flipo (at) free (dot) fr>
%<lua> License LPPL: see french.ldf.
@@ -854,7 +854,7 @@ Please report errors to: <daniel (dot) flipo (at) free (dot) fr>
% \subsubsection*{What’s new in version 3.6?}
%
% Version 3.6a no longer loads the \pkg{keyval} package, replaced by
-% core LaTeX commands (\pkg{ltkeys}). The thin space added before
+% core LaTeX commands (\pkg{l3keys}). The thin space added before
% footnote’s calls is now customisable (suggested by Thomas Savary),
% the command’s name is |\FBfnmarkspace|.
%
@@ -1150,11 +1150,6 @@ Please report errors to: <daniel (dot) flipo (at) free (dot) fr>
% \end{macrocode}
% \end{macro}
%
-% Check LaTeX2e version (support for \pkg{ltkeys} required).
-% \begin{macrocode}
-\ifLaTeXe \NeedsTeXFormat{LaTeX2e}[2022/06/01] \fi
-% \end{macrocode}
-%
%\begin{macro}{\ifFBunicode}
% \begin{macro}{\ifFBLuaTeX}
% \begin{macro}{\ifFBXeTeX}
@@ -2779,16 +2774,22 @@ return french_punctuation
% active punctuation characters (if any).
% It is engine independent (works for TeX, LuaTeX and
% XeTeX based engines) and is meant to be used inside a group.
+% The faked definition of |\texorpdfstring| will be overwritten
+% by \file{hyperref.sty}.
%
% \changes{v3.2b}{2016/04/18}{\cs{NoAutoSpacing} made robust.}
%
% \changes{v3.2c}{2016/05/14}{New definition based on
% \cs{FB@spacing@off} common to all engines.}
%
+% \changes{v3.6b}{2024/06/26}{\cs{NoAutoSpacing} must be inhibited
+% in bookmarks.}
+%
% \begin{macrocode}
+\providecommand\texorpdfstring[2]{#1}
\DeclareRobustCommand*{\NoAutoSpacing}{%
- \FB@spacing@off
- \ifFB@active@punct\shorthandoff{;:!?}\fi
+ \texorpdfstring{\FB@spacing@off
+ \ifFB@active@punct\shorthandoff{;:!?}\fi}{}%
}
% \end{macrocode}
% \end{macro}
@@ -2860,7 +2861,6 @@ return french_punctuation
%
% |\FB@og| and |\FB@fg| are now designed to work in bookmarks.
% \begin{macrocode}
-\providecommand\texorpdfstring[2]{#1}
\newcommand*{\FB@og}{\texorpdfstring{\@FB@og}{\guillemotleft\space}}
\newcommand*{\FB@fg}{\texorpdfstring{\@FB@fg}{\space\guillemotright}}
% \end{macrocode}
@@ -4264,7 +4264,7 @@ return french_punctuation
}
% \end{macrocode}
%
-% \subsection{Setup options: key/value stuff (ltkeys)}
+% \subsection{Setup options: key/value stuff (l3keys)}
% \label{ssec-keyval}
%
% \changes{v2.0}{2006/11/06}{New command \cs{frenchbsetup} added
@@ -4274,11 +4274,15 @@ return french_punctuation
% reorganised, now \cs{babel@save} and\cs{babel@savevariable} are
% usable for French.}
%
-% \changes{v3.6a}{2024/05/16}{Internal `ltkeys’ replaces package
+% \changes{v3.6a}{2024/05/16}{Internal `l3keys’ replaces package
% `keyval’ for options’ management.}
%
+% Check LaTeX2e version (support for \pkg{l3keys} required).
+% \begin{macrocode}
+\NeedsTeXFormat{LaTeX2e}[2022-06-01]
+% \end{macrocode}
% All setup options are handled by command \fbsetup{} based on
-% the \file{ltkeys}’ |\SetKeys{}| command. A list of flags is
+% the \file{l3keys}’ |\SetKeys{}| command. A list of flags is
% defined beforehand and set to default values which will possibly
% be changed `AtEndOfPackage’ in case French is the main language.
% After this, \fbsetup{} eventually modifies the preset values of
@@ -4578,6 +4582,10 @@ return french_punctuation
\@onlypreamble\frenchbsetup
% \end{macrocode}
%
+% \changes{v3.6c}{2024/07/25}{Removed spurious @ in
+% \cs{FBCompactItemize@setup} and \cs{FBListOldLayout@setup}
+% commands’ names.}
+%
% The following commands, defined with property |.code| in
% |DeclareKeys{}|, execute some post-treatment required to
% immediately take the flags value into account.
@@ -4619,14 +4627,14 @@ return french_punctuation
Reported}%
\fi
}
-\newcommand*{\FB@ListOldLayout@setup}[1]%
+\newcommand*{\FBListOldLayout@setup}[1]%
{\csname FBListOldLayout#1\endcsname
\ifFBListOldLayout
\FBStandardEnumerateEnvtrue
\renewcommand*{\FrenchLabelItem}{\textendash}%
\fi
}
-\newcommand*{\FB@CompactItemize@setup}[1]%
+\newcommand*{\FBCompactItemize@setup}[1]%
{\csname FBCompactItemize#1\endcsname
\ifFBCompactItemize
\FBStandardItemizeEnvfalse
diff --git a/Master/texmf-dist/source/generic/lt3luabridge/lt3luabridge.dtx b/Master/texmf-dist/source/generic/lt3luabridge/lt3luabridge.dtx
index 67cc73c7387..d8bb7a3beec 100644
--- a/Master/texmf-dist/source/generic/lt3luabridge/lt3luabridge.dtx
+++ b/Master/texmf-dist/source/generic/lt3luabridge/lt3luabridge.dtx
@@ -47,7 +47,7 @@
% }^^A
% }
%
-% \date{Released 2024-02-14}
+% \date{Released 2024-07-03}
%
% \maketitle
%
@@ -151,7 +151,7 @@
% \texttt{-output-directory} parameter of the \TeX{} engine.
% \end{variable}
%
-% \begin{variable}[added = 2022-06-26]{\c_luabridge_default_output_dirname_str}
+% \begin{variable}[added = 2022-06-26, updated = 2024-07-03]{\c_luabridge_default_output_dirname_str}
% This constant is the default value of \cs{g_luabridge_output_dirname_str}.
% \end{variable}
%
@@ -261,9 +261,42 @@
=
{ \c_luabridge_method_shell_int }
{
- \str_const:Nn
- \c_luabridge_default_output_dirname_str
- { . }
+% \end{macrocode}
+%
+% Instead of assuming the current working directory as the output directory,
+% try to determine the output directory from the environmental variable
+% \texttt{TEXMF_OUTPUT_DIRECTORY}, which is automatically defined by \TeX{}
+% engines and accessible from child processes.
+%
+% \begin{macrocode}
+ \sys_if_platform_unix:TF
+ {
+ \str_const:Nn
+ \c_luabridge_default_output_dirname_str
+ { $TEXMF_OUTPUT_DIRECTORY }
+ }
+ {
+ \sys_if_platform_windows:TF
+ {
+ \str_set:Nn
+ \l_tmpa_str
+ { TEXMF_OUTPUT_DIRECTORY }
+ \str_put_left:NV
+ \l_tmpa_str
+ \c_percent_str
+ \str_put_right:NV
+ \l_tmpa_str
+ \c_percent_str
+ \str_const:NV
+ \c_luabridge_default_output_dirname_str
+ \l_tmpa_str
+ }
+ {
+ \str_const:Nn
+ \c_luabridge_default_output_dirname_str
+ { . }
+ }
+ }
\str_const:Nx
\c_luabridge_default_helper_script_filename_str
{ \jobname.luabridge.lua }
@@ -358,9 +391,43 @@
\g_luabridge_helper_script_filename_str
\sys_get_shell:xnNTF
{
- texlua~
- \g_luabridge_output_dirname_str /
- \g_luabridge_helper_script_filename_str
+% \end{macrocode}
+%
+% If the environmental variable \texttt{TEXMF_OUTPUT_DIRECTORY} is undefined,
+% use the current working directory (\texttt{.}) instead.
+%
+% \begin{macrocode}
+ \str_if_eq:NNTF
+ \g_luabridge_output_dirname_str
+ \c_luabridge_default_output_dirname_str
+ {
+ \sys_if_platform_windows:TF
+ {
+ if~not~defined~TEXMF_OUTPUT_DIRECTORY~(
+ texlua~
+ \g_luabridge_helper_script_filename_str
+ )~else~(
+ texlua~
+ \g_luabridge_output_dirname_str /
+ \g_luabridge_helper_script_filename_str
+ )
+ }
+ {
+ \sys_if_platform_unix:T
+ {
+ TEXMF_OUTPUT_DIRECTORY =
+ ${TEXMF_OUTPUT_DIRECTORY:-.} \iow_newline:
+ }
+ texlua~
+ \g_luabridge_output_dirname_str /
+ \g_luabridge_helper_script_filename_str
+ }
+ }
+ {
+ texlua~
+ \g_luabridge_output_dirname_str /
+ \g_luabridge_helper_script_filename_str
+ }
}
{ }
#1
@@ -492,8 +559,8 @@
\RequirePackage{expl3}
\ProvidesExplPackage
{lt3luabridge}%
- {2024-02-14}%
- {2.1.0}%
+ {2024-07-03}%
+ {2.2.0}%
{An expl3 package that allows you to execute Lua code in LuaTeX or any other
TeX engine that exposes the shell}
\input lt3luabridge\relax
diff --git a/Master/texmf-dist/source/generic/markdown/docstrip.cfg b/Master/texmf-dist/source/generic/markdown/docstrip.cfg
index 9dc5f652309..44429e7b974 100644
--- a/Master/texmf-dist/source/generic/markdown/docstrip.cfg
+++ b/Master/texmf-dist/source/generic/markdown/docstrip.cfg
@@ -11,18 +11,18 @@
-- permit persons to whom the Software is furnished to do so, subject to^^J%
-- the following conditions:^^J%
--^^J%
--- The above copyright notice and this permission notice shall be included^^J%
--- in all copies or substantial portions of the Software.^^J%
+-- The above copyright notice and this permission notice shall be^^J%
+-- included in all copies or substantial portions of the Software.^^J%
--^^J%
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,^^J%
-- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF^^J%
--- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.^^J%
+-- MERCHANTABILITY, FITNESS FOR PARTICULAR PURPOSE AND NONINFRINGEMENT.^^J%
-- IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY^^J%
-- CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,^^J%
-- TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE^^J%
-- SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.^^J%
--^^J%
--- Copyright (C) 2016-2024 Vít Starý Novotný^^J%
+-- Copyright (C) 2016-2024 Vít Starý Novotný, Andrej GenÄur^^J%
--^^J%
-- This work may be distributed and/or modified under the^^J%
-- conditions of the LaTeX Project Public License, either version 1.3^^J%
@@ -62,7 +62,7 @@
\let\luapostamble\empty
\declarepreamble\texpreamble
-Copyright (C) 2016-2024 Vít Starý Novotný
+Copyright (C) 2016-2024 Vít Starý Novotný, Andrej GenÄur
This work may be distributed and/or modified under the
conditions of the LaTeX Project Public License, either version 1.3c
diff --git a/Master/texmf-dist/source/generic/markdown/markdown.dtx b/Master/texmf-dist/source/generic/markdown/markdown.dtx
index 6ad42a46b26..2ad94e6e9c9 100644
--- a/Master/texmf-dist/source/generic/markdown/markdown.dtx
+++ b/Master/texmf-dist/source/generic/markdown/markdown.dtx
@@ -122,7 +122,7 @@
---
title: A Markdown Interpreter for \TeX
url: https://github.com/witiko/markdown
-authors: [Vít Starý Novotný]
+authors: [Vít Starý Novotný, Andrej GenÄur]
email: witiko@mail.muni.cz
revision: \markdownVersion
date: \markdownLastModified
@@ -796,6 +796,7 @@ abbr {
%<*themes-witiko-markdown-techdoc>
\ProvidesPackage{markdownthemewitiko_markdown_techdoc}[2022/12/13]
\RequirePackage{etoolbox}
+\gdef\ltd@title@author{\@gobble}%
\markdownSetup{
renderers = {
head*Four = {\paragraph{#1}\leavevmode},
@@ -804,6 +805,7 @@ abbr {
codeSpan = {\inline{#1}},
jekyllData(End) = {%
\AfterEndPreamble{%
+ \hypersetup{pdfauthor=\ltd@title@author}%
\printtitlepage
\tableofcontents
{\def\addcontentsline##1##2##3{}\listoffigures}%
@@ -812,8 +814,9 @@ abbr {
},
jekyllDataRenderers = {
/authors/* = {%
- \gdef\ltd@title@author{#1}%
- \hypersetup{pdfauthor={#1}}%
+ \expandafter\gdef
+ \expandafter\ltd@title@author
+ \expandafter{\ltd@title@author, #1}%
},
title = {%
\gdef\ltd@title@title{#1}%
@@ -875,7 +878,7 @@ abbr {
---
title: Markdown Package User Manual
-author: Vít Starý Novotný
+author: Vít Starý Novotný, Andrej GenÄur
date: \markdownVersion{} \markdownLastModified{}
---
@@ -890,7 +893,7 @@ Introduction
The [Markdown package][pkg] converts [CommonMark][] markup to \TeX{} commands. The
functionality is provided both as a Lua module and as plain \TeX{}, \LaTeX{}, and
\Hologo{ConTeXt} macro packages that can be used to directly typeset \TeX{} documents
-containing markdown markup. Unlike other convertors, the Markdown package
+containing markdown markup. Unlike other converters, the Markdown package
does not require any external programs, and makes it easy to redefine how each
and every markdown element is rendered. Creative abuse of the markdown
syntax is encouraged. 😉
@@ -922,21 +925,23 @@ documentation][techdoc].
(A Markdown Interpreter for TeX)
%</manual>
-%<*lua,lua-cli>
+%<*lua,lua-cli,lua-loader>
% \fi
% \begin{macrocode}
local metadata = {
version = "(((VERSION)))",
- comment = "A module for the conversion from markdown to plain TeX",
- author = "John MacFarlane, Hans Hagen, Vít Starý Novotný",
+ comment = "A module for the conversion from markdown "
+ .. "to plain TeX",
+ author = "John MacFarlane, Hans Hagen, Vít Starý Novotný, "
+ .. "Andrej GenÄur",
copyright = {"2009-2016 John MacFarlane, Hans Hagen",
- "2016-2023 Vít Starý Novotný"},
+ "2016-2024 Vít Starý Novotný, Andrej GenÄur"},
license = "LPPL 1.3c"
}
% \end{macrocode}
% \iffalse
-%</lua,lua-cli>
+%</lua,lua-cli,lua-loader>
%<*lua>
% \fi
% \begin{macrocode}
@@ -965,22 +970,30 @@ requirements.
Installation
------------
-If Markdown is not included in your \TeX{} distribution, you will need to
-install it.
+If the Markdown package is not included in your \TeX{} distribution, you will
+need to install it.
-First, download the package from the repository using Git:
+From [Releases][], download [an archive `markdown.zip` for this version of the
+Markdown package (\markdownShortVersion{})][this-release] or a different version
+that you wish to install. Then, unzip the archive. If you downloaded an archive
+for a different version of the Markdown package, you should now locate a file
+named `markdown.html` with the user manual for that version, open it, and
+follow the installation steps in it rather than the steps from this manual.
+
+ [releases]: https://github.com/witiko/markdown/releases (Releases - witiko/markdown)
+ [this-release]: https://github.com/witiko/markdown/releases/download/\markdownShortVersion{}/markdown.zip (Release \markdownShortVersion{} - witiko/markdown)
+
+Alternatively, download the package from the repository using Git, enter the
+directory named `markdown` and run the `make base` command using GNU Make:
``` sh
git clone https://github.com/witiko/markdown
-``````
-Next, enter the directory named `markdown` and run the `make base` command using
-GNU Make:
-``` sh
cd markdown
make base
``````
-This should produce the following files:
-* `markdown.lua`: The Lua module
+Either of the two abovelisted approaches should produce the following files:
+
+* `markdown.lua` and `markdown-parser.lua`: The Lua module
* `libraries/markdown-tinyyaml.lua`: An external library for reading \acro{yaml}
* `markdown-cli.lua`: The Lua command-line interface
* `markdown.tex`: The plain \TeX{} macro package
@@ -1001,6 +1014,7 @@ directory structure. This is generally where the individual files should be
placed:
* `⟨TEXMF⟩/tex/luatex/markdown/markdown.lua`
+* `⟨TEXMF⟩/tex/luatex/markdown/markdown-parser.lua`
* `⟨TEXMF⟩/tex/luatex/markdown/markdown-tinyyaml.lua`
* `⟨TEXMF⟩/scripts/markdown/markdown-cli.lua`
* `⟨TEXMF⟩/tex/generic/markdown/markdown.tex`
@@ -1027,6 +1041,7 @@ portably typeset on legacy \TeX{} distributions.
This is where the individual files should be placed:
* `./markdown.lua`
+* `./markdown-parser.lua`
* `./markdown-tinyyaml.lua`
* `./markdown-cli.lua`
* `./markdown/markdown.tex`
@@ -1039,6 +1054,8 @@ This is where the individual files should be placed:
* `./markdownthemewitiko_markdown_defaults.sty`
* `./t-markdownthemewitiko_markdown_defaults.tex`
+The file `markdown.tex` *must* be placed in a directory named `markdown`.
+
%</manual>
%<*lua>
% \fi
@@ -1093,9 +1110,17 @@ local unicode = require("unicode")
% Live${}\geq{}2008$).
%
% \end{markdown}
+% \iffalse
+%</lua>
+%<*lua,lua-loader>
+% \fi
% \begin{macrocode}
local md5 = require("md5");
% \end{macrocode}
+% \iffalse
+%</lua,lua-loader>
+%<*lua>
+% \fi
% \begin{markdown}
%
% \pkg{Kpathsea}
@@ -1138,6 +1163,17 @@ end)()
%: A package that implements Unicode case-folding in \TeX{} Live${}\geq{}2020$.
%
% \end{markdown}
+% \iffalse
+%</lua>
+%<*depends>
+% \fi
+% \begin{macrocode}
+hard lua-uni-algos
+% \end{macrocode}
+% \iffalse
+%</depends>
+%<*lua>
+% \fi
% \begin{macrocode}
local uni_algos = require("lua-uni-algos")
% \end{macrocode}
@@ -1156,6 +1192,13 @@ local uni_algos = require("lua-uni-algos")
% \end{markdown}
% \iffalse
%</lua>
+%<*depends>
+% \fi
+% \begin{macrocode}
+# hard lua-tinyyaml # TODO: Uncomment after TeX Live 2022 deprecation.
+% \end{macrocode}
+% \iffalse
+%</depends>
%<*tex>
% \fi
% \par
@@ -1175,18 +1218,33 @@ local uni_algos = require("lua-uni-algos")
% such as options, renderers, and renderer prototypes.
%
% \end{markdown}
-% \begin{macrocode}
+% \iffalse
%</tex>
+%<*depends>
+% \fi
+% \begin{macrocode}
+hard l3kernel
+% \end{macrocode}
+% \iffalse
+%</depends>
%<*context>
+% \fi
+% \begin{macrocode}
\unprotect
+% \end{macrocode}
+% \iffalse
%</context>
%<*context,tex>
+% \fi
+% \begin{macrocode}
\ifx\ExplSyntaxOn\undefined
\input expl3-generic
\fi
+% \end{macrocode}
+% \iffalse
%</context,tex>
%<*tex>
-% \end{macrocode}
+% \fi
% \begin{markdown}
%
% \pkg{lt3luabridge}
@@ -1195,6 +1253,20 @@ local uni_algos = require("lua-uni-algos")
% with other TeX engines that provide the *shell escape* capability,
% which allows them to execute code with the system's shell.
%
+% \end{markdown}
+% \iffalse
+%</tex>
+%<*depends>
+% \fi
+% \begin{macrocode}
+hard lt3luabridge
+% \end{macrocode}
+% \iffalse
+%</depends>
+%<*tex>
+% \fi
+% \begin{markdown}
+%
% The plain \TeX{} part of the package also requires the following Lua module:
%
% \pkg{Lua File System}
@@ -1239,10 +1311,13 @@ local uni_algos = require("lua-uni-algos")
%<*themes-witiko-dot,latex-themes-witiko-graphicx-http>
% \fi
% \begin{macrocode}
-\NeedsTeXFormat{LaTeX2e}%
+\NeedsTeXFormat{LaTeX2e}
+\RequirePackage{expl3}
% \end{macrocode}
% \iffalse
%</themes-witiko-dot,latex-themes-witiko-graphicx-http>
+%</latex>
+%<*depends>
% \fi
% \begin{markdown}
% a \TeX{} engine that extends \Hologo{eTeX}, and all the plain \TeX{}
@@ -1259,10 +1334,23 @@ local uni_algos = require("lua-uni-algos")
%
%: A package that provides the `\url` macro for the typesetting of links.
%
+% \end{markdown}
+% \begin{macrocode}
+soft url
+% \end{macrocode}
+% \begin{markdown}
+%
% \pkg{graphicx}
%
%: A package that provides the `\includegraphics` macro for the typesetting
-% of images.
+% of images.Furthermore, it also provides a key-value interface that is
+% used in the default renderer prototypes for image attribute contexts.
+%
+% \end{markdown}
+% \begin{macrocode}
+soft graphics
+% \end{macrocode}
+% \begin{markdown}
%
% \pkg{paralist}
%
@@ -1271,45 +1359,85 @@ local uni_algos = require("lua-uni-algos")
% ordered lists, and definition lists as well as the rendering of
% fancy lists.
%
+% \end{markdown}
+% \begin{macrocode}
+soft paralist
+% \end{macrocode}
+% \begin{markdown}
+%
% \pkg{ifthen}
%
%: A package that provides a concise syntax for the inspection of macro
% values. It is used in the `witiko/dot` \LaTeX{} theme (see Section
% <#sec:latexthemes>).
%
+% \end{markdown}
+% \begin{macrocode}
+soft latex
+soft epstopdf-pkg # required by `latex`
+% \end{macrocode}
+% \begin{markdown}
+%
% \pkg{fancyvrb}
%
%: A package that provides the `\VerbatimInput` macros for the verbatim
% inclusion of files containing code.
%
+% \end{markdown}
+% \begin{macrocode}
+soft fancyvrb
+% \end{macrocode}
+% \begin{markdown}
+%
% \pkg{csvsimple}
%
%: A package that provides the `\csvautotabular` macro for typesetting
% \acro{csv} files in the default renderer prototypes for iA\\,Writer
% content blocks.
%
+% \end{markdown}
+% \begin{macrocode}
+soft csvsimple
+soft pgf # required by `csvsimple`, which loads `pgfkeys.sty`
+soft tools # required by `csvsimple`, which loads `shellesc.sty`
+% \end{macrocode}
+% \begin{markdown}
+%
% \pkg{gobble}
%
%: A package that provides the `\@gobblethree` \TeX{} command that
% is used in the default renderer prototype for citations. The package
% is included in \TeX Live${}\geq{}2016$.
%
+% \end{markdown}
+% \begin{macrocode}
+soft gobble
+% \end{macrocode}
+% \begin{markdown}
+%
% \pkg{amsmath} and \pkg{amssymb}
%
%: Packages that provide symbols used for drawing ticked and unticked
% boxes.
%
+% \end{markdown}
+% \begin{macrocode}
+soft amsmath
+soft amsfonts
+% \end{macrocode}
+% \begin{markdown}
+%
% \pkg{catchfile}
%
%: A package that catches the contents of a file and puts it in a macro. It
% is used in the `witiko/graphicx/http` \LaTeX{} theme, see Section
% <#sec:latexthemes>.
%
-% \pkg{graphicx}
-%
-%: A package that builds upon the \pkg{graphics} package, which is part of
-% the \LaTeXe{} kernel. It provides a key-value interface that is used in
-% the default renderer prototypes for image attribute contexts.
+% \end{markdown}
+% \begin{macrocode}
+soft catchfile
+% \end{macrocode}
+% \begin{markdown}
%
% \pkg{grffile}
%
@@ -1320,6 +1448,12 @@ local uni_algos = require("lua-uni-algos")
% the `witiko/dot` and `witiko/graphicx/http` \LaTeX{} themes, see Section
% <#sec:latexthemes>.
%
+% \end{markdown}
+% \begin{macrocode}
+soft grffile
+% \end{macrocode}
+% \begin{markdown}
+%
% \pkg{etoolbox}
%
%: A package that is used to polyfill the general hook management system in
@@ -1327,10 +1461,23 @@ local uni_algos = require("lua-uni-algos")
% <#sec:latex-yaml-metadata>, and also in the default renderer prototype
% for identifier attributes.
%
+% \end{markdown}
+% \begin{macrocode}
+soft etoolbox
+% \end{macrocode}
+% \begin{markdown}
+%
% \pkg{soulutf8}
%
%: A package that is used in the default renderer prototype for
% strike-throughs and marked text.
+% <!-- TODO: 1,$s/soulutf8/soul/g in TeX Live 2023. -->
+%
+% \end{markdown}
+% \begin{macrocode}
+soft soul
+% \end{macrocode}
+% \begin{markdown}
%
% \pkg{ltxcmds}
%
@@ -1338,6 +1485,12 @@ local uni_algos = require("lua-uni-algos")
% \pkg{listings} packages are loaded in the default renderer prototype
% for fenced code blocks.
%
+% \end{markdown}
+% \begin{macrocode}
+soft ltxcmds
+% \end{macrocode}
+% \begin{markdown}
+%
% \pkg{verse}
%
%: A package that is used in the default renderer prototypes for
@@ -1345,10 +1498,13 @@ local uni_algos = require("lua-uni-algos")
%
% \end{markdown}
% \begin{macrocode}
-\RequirePackage{expl3}
+soft verse
% \end{macrocode}
+% \begin{markdown}
+%
+% \end{markdown}
% \iffalse
-%</latex>
+%</depends>
%<*context>
% \fi
% \par
@@ -1691,9 +1847,6 @@ In this section, I will describe the individual parts of the Markdown package.
Each part will be shown by example, leaving the implementation details to the
[technical documentation][techdoc].
- [techdoc]: https://mirrors.ctan.org/macros/generic/markdown/markdown.pdf
- (A Markdown Interpreter for \TeX{})
-
/markdown-interfaces.md
/markdown-options.md
/markdown-tokens.md
@@ -1732,7 +1885,7 @@ module and a command-line interface (CLI).
(Lua library for conversion between markup formats)
%</manual-interfaces>
-%<*lua>
+%<*lua,lua-loader>
% \fi
% \begin{markdown}
%
@@ -1747,6 +1900,10 @@ module and a command-line interface (CLI).
% \begin{macrocode}
local M = {metadata = metadata}
% \end{macrocode}
+% \iffalse
+% \fi
+%</lua,lua-loader>
+%<*lua>
% \par
% \begin{markdown}
%
@@ -2023,7 +2180,7 @@ In this section, I will describe all the options recognized by the Markdown
package.
%</manual-options>
-%<*lua,lua-cli>
+%<*lua,lua-cli,lua-loader>
% \fi
% \begin{macrocode}
local defaultOptions = {}
@@ -2032,7 +2189,7 @@ local defaultOptions = {}
% \markdownSetup{snippet=lua-options}
% \par
% \iffalse
-%</lua,lua-cli>
+%</lua,lua-cli,lua-loader>
%<*manual-options>
### Lua
@@ -2066,7 +2223,9 @@ interfaces and all the way up to the \LaTeX{} and \Hologo{ConTeXt} interfaces.
\prop_new:N \g_@@_default_lua_options_prop
\seq_new:N \g_@@_option_layers_seq
\tl_const:Nn \c_@@_option_layer_lua_tl { lua }
-\seq_gput_right:NV \g_@@_option_layers_seq \c_@@_option_layer_lua_tl
+\seq_gput_right:NV
+ \g_@@_option_layers_seq
+ \c_@@_option_layer_lua_tl
\cs_new:Nn
\@@_add_lua_option:nnn
{
@@ -2143,21 +2302,50 @@ interfaces and all the way up to the \LaTeX{} and \Hologo{ConTeXt} interfaces.
\cs_generate_variant:Nn
\msg_error:nnnn
{ nnnV }
-\seq_new:N \g_@@_option_types_seq
-\tl_const:Nn \c_@@_option_type_clist_tl { clist }
-\seq_gput_right:NV \g_@@_option_types_seq \c_@@_option_type_clist_tl
-\tl_const:Nn \c_@@_option_type_counter_tl { counter }
-\seq_gput_right:NV \g_@@_option_types_seq \c_@@_option_type_counter_tl
-\tl_const:Nn \c_@@_option_type_boolean_tl { boolean }
-\seq_gput_right:NV \g_@@_option_types_seq \c_@@_option_type_boolean_tl
-\tl_const:Nn \c_@@_option_type_number_tl { number }
-\seq_gput_right:NV \g_@@_option_types_seq \c_@@_option_type_number_tl
-\tl_const:Nn \c_@@_option_type_path_tl { path }
-\seq_gput_right:NV \g_@@_option_types_seq \c_@@_option_type_path_tl
-\tl_const:Nn \c_@@_option_type_slice_tl { slice }
-\seq_gput_right:NV \g_@@_option_types_seq \c_@@_option_type_slice_tl
-\tl_const:Nn \c_@@_option_type_string_tl { string }
-\seq_gput_right:NV \g_@@_option_types_seq \c_@@_option_type_string_tl
+\seq_new:N
+ \g_@@_option_types_seq
+\tl_const:Nn
+ \c_@@_option_type_clist_tl
+ { clist }
+\seq_gput_right:NV
+ \g_@@_option_types_seq
+ \c_@@_option_type_clist_tl
+\tl_const:Nn
+ \c_@@_option_type_counter_tl
+ { counter }
+\seq_gput_right:NV
+ \g_@@_option_types_seq
+ \c_@@_option_type_counter_tl
+\tl_const:Nn
+ \c_@@_option_type_boolean_tl
+ { boolean }
+\seq_gput_right:NV
+ \g_@@_option_types_seq
+ \c_@@_option_type_boolean_tl
+\tl_const:Nn
+ \c_@@_option_type_number_tl
+ { number }
+\seq_gput_right:NV
+ \g_@@_option_types_seq
+ \c_@@_option_type_number_tl
+\tl_const:Nn
+ \c_@@_option_type_path_tl
+ { path }
+\seq_gput_right:NV
+ \g_@@_option_types_seq
+ \c_@@_option_type_path_tl
+\tl_const:Nn
+ \c_@@_option_type_slice_tl
+ { slice }
+\seq_gput_right:NV
+ \g_@@_option_types_seq
+ \c_@@_option_type_slice_tl
+\tl_const:Nn
+ \c_@@_option_type_string_tl
+ { string }
+\seq_gput_right:NV
+ \g_@@_option_types_seq
+ \c_@@_option_type_string_tl
\cs_new:Nn
\@@_get_option_type:nN
{
@@ -2379,20 +2567,23 @@ interfaces and all the way up to the \LaTeX{} and \Hologo{ConTeXt} interfaces.
#### Option `eagerCache`
-`eagerCache` (default value: `false`)
+`eagerCache` (default value: `true`)
% \fi
% \begin{markdown}
%
-% \Optitem[false]{eagerCache}{\opt{true}, \opt{false}}
+% \Optitem[true]{eagerCache}{\opt{true}, \opt{false}}
%
: true
: Converted markdown documents will be cached in \Opt{cacheDir}. This can be
useful for post-processing the converted documents and for recovering
- historical versions of the documents from the cache. However, it also
- produces a large number of auxiliary files on the disk and obscures the
- output of the Lua command-line interface when it is used for plumbing.
+ historical versions of the documents from the cache. Furthermore, it can
+ also significantly improve the processing speed for documents that require
+ multiple compilation runs, since each markdown document is only converted once.
+ However, it also produces a large number of auxiliary files on the disk
+ and obscures the output of the Lua command-line interface when it is
+ used for plumbing.
This behavior will always be used if the \Opt{finalizeCache} option is
enabled.
@@ -2401,7 +2592,11 @@ interfaces and all the way up to the \LaTeX{} and \Hologo{ConTeXt} interfaces.
: Converted markdown documents will not be cached. This decreases the number
of auxiliary files that we produce and makes it easier to use the Lua
- command-line interface for plumbing.
+ command-line interface for plumbing. However, it makes it impossible to
+ post-process the converted documents and recover historical versions of
+ the documents from the cache. Furthermore, it can significantly reduce
+ the processing speed for documents that require multiple compilation
+ runs, since each markdown document is converted multiple times needlessly.
This behavior will only be used when the \Opt{finalizeCache} option is
disabled.
@@ -2463,18 +2658,18 @@ Hello \markdownRendererEmphasis{world}!\relax
\@@_add_lua_option:nnn
{ eagerCache }
{ boolean }
- { false }
+ { true }
% \end{macrocode}
% \iffalse
%</tex>
-%<*lua,lua-cli>
+%<*lua,lua-cli,lua-loader>
% \fi
% \begin{macrocode}
-defaultOptions.eagerCache = false
+defaultOptions.eagerCache = true
% \end{macrocode}
% \par
% \iffalse
-%</lua,lua-cli>
+%</lua,lua-cli,lua-loader>
%<*manual-options>
#### Option `singletonCache`
@@ -2502,11 +2697,11 @@ defaultOptions.eagerCache = false
: Every call to the function \luamref{new}`(options)` will produce a new
conversion function that will not be cached. This is slower than
caching conversion functions and may expose bugs related to memory
- leaks in the creation of conversion functions, see also issue [#226][1].
+ leaks in the creation of conversion functions, see also [#226 (comment)][226-comment].
This was the default behavior until version 3.0.0 of the Markdown package.
- [1]: https://github.com/witiko/markdown/pull/226#issuecomment-1599641634
+ [226-comment]: https://github.com/witiko/markdown/pull/226#issuecomment-1599641634
% \end{markdown}
% \iffalse
@@ -2555,13 +2750,13 @@ conversion function.
% \end{macrocode}
% \iffalse
%</tex>
-%<*lua,lua-cli>
+%<*lua,lua-cli,lua-loader>
% \fi
% \begin{macrocode}
defaultOptions.singletonCache = true
% \end{macrocode}
% \iffalse
-%</lua,lua-cli>
+%</lua,lua-cli,lua-loader>
%<*lua>
% \fi
% \begin{macrocode}
@@ -2610,14 +2805,14 @@ local singletonCache = {
% \end{macrocode}
% \iffalse
%</tex>
-%<*lua,lua-cli>
+%<*lua,lua-cli,lua-loader>
% \fi
% \begin{macrocode}
defaultOptions.unicodeNormalization = true
% \end{macrocode}
% \par
% \iffalse
-%</lua,lua-cli>
+%</lua,lua-cli,lua-loader>
%<*manual-options>
#### Option `unicodeNormalizationForm`
@@ -2666,14 +2861,14 @@ defaultOptions.unicodeNormalization = true
% \end{macrocode}
% \iffalse
%</tex>
-%<*lua,lua-cli>
+%<*lua,lua-cli,lua-loader>
% \fi
% \begin{macrocode}
defaultOptions.unicodeNormalizationForm = "nfc"
% \end{macrocode}
% \par
% \iffalse
-%</lua,lua-cli>
+%</lua,lua-cli,lua-loader>
%<*manual-options>
% \fi
% \begin{markdown}
@@ -2842,14 +3037,14 @@ option.
% \end{macrocode}
% \iffalse
%</tex>
-%<*lua,lua-cli>
+%<*lua,lua-cli,lua-loader>
% \fi
% \begin{macrocode}
defaultOptions.cacheDir = "."
% \end{macrocode}
% \par
% \iffalse
-%</lua,lua-cli>
+%</lua,lua-cli,lua-loader>
%<*manual-options>
#### Option `contentBlocksLanguageMap`
@@ -3006,14 +3201,14 @@ following text:
% \end{macrocode}
% \iffalse
%</tex>
-%<*lua,lua-cli>
+%<*lua,lua-cli,lua-loader>
% \fi
% \begin{macrocode}
defaultOptions.contentBlocksLanguageMap = "markdown-languages.json"
% \end{macrocode}
% \par
% \iffalse
-%</lua,lua-cli>
+%</lua,lua-cli,lua-loader>
%<*manual-options>
#### Option `debugExtensionsFileName`
@@ -3055,14 +3250,14 @@ defaultOptions.contentBlocksLanguageMap = "markdown-languages.json"
% \end{macrocode}
% \iffalse
%</tex>
-%<*lua,lua-cli>
+%<*lua,lua-cli,lua-loader>
% \fi
% \begin{macrocode}
defaultOptions.debugExtensionsFileName = "debug-extensions.json"
% \end{macrocode}
% \par
% \iffalse
-%</lua,lua-cli>
+%</lua,lua-cli,lua-loader>
%<*manual-options>
#### Option `frozenCacheFileName`
@@ -3297,14 +3492,14 @@ the markdown document from “Hello *world*!†to “Hi *world*!†was not ref
% \end{macrocode}
% \iffalse
%</tex>
-%<*lua,lua-cli>
+%<*lua,lua-cli,lua-loader>
% \fi
% \begin{macrocode}
defaultOptions.frozenCacheFileName = "frozenCache.tex"
% \end{macrocode}
% \par
% \iffalse
-%</lua,lua-cli>
+%</lua,lua-cli,lua-loader>
%<*manual-options>
% \fi
% \begin{markdown}
@@ -3354,14 +3549,14 @@ See also the option \Opt{gfmAutoIdentifiers}.
% \end{macrocode}
% \iffalse
%</tex>
-%<*lua,lua-cli>
+%<*lua,lua-cli,lua-loader>
% \fi
% \begin{macrocode}
defaultOptions.autoIdentifiers = false
% \end{macrocode}
% \par
% \iffalse
-%</lua,lua-cli>
+%</lua,lua-cli,lua-loader>
%<*manual-options>
#### Option `blankBeforeBlockquote`
@@ -3578,14 +3773,14 @@ following text:
% \end{macrocode}
% \iffalse
%</tex>
-%<*lua,lua-cli>
+%<*lua,lua-cli,lua-loader>
% \fi
% \begin{macrocode}
defaultOptions.blankBeforeBlockquote = false
% \end{macrocode}
% \par
% \iffalse
-%</lua,lua-cli>
+%</lua,lua-cli,lua-loader>
%<*manual-options>
#### Option `blankBeforeCodeFence`
@@ -3835,14 +4030,14 @@ following text:
% \end{macrocode}
% \iffalse
%</tex>
-%<*lua,lua-cli>
+%<*lua,lua-cli,lua-loader>
% \fi
% \begin{macrocode}
defaultOptions.blankBeforeCodeFence = false
% \end{macrocode}
% \par
% \iffalse
-%</lua,lua-cli>
+%</lua,lua-cli,lua-loader>
%<*manual-options>
#### Option `blankBeforeDivFence`
@@ -3918,14 +4113,14 @@ following text:
% \end{macrocode}
% \iffalse
%</tex>
-%<*lua,lua-cli>
+%<*lua,lua-cli,lua-loader>
% \fi
% \begin{macrocode}
defaultOptions.blankBeforeDivFence = false
% \end{macrocode}
% \par
% \iffalse
-%</lua,lua-cli>
+%</lua,lua-cli,lua-loader>
%<*manual-options>
#### Option `blankBeforeHeading`
@@ -4158,14 +4353,14 @@ following text:
% \end{macrocode}
% \iffalse
%</tex>
-%<*lua,lua-cli>
+%<*lua,lua-cli,lua-loader>
% \fi
% \begin{macrocode}
defaultOptions.blankBeforeHeading = false
% \end{macrocode}
% \par
% \iffalse
-%</lua,lua-cli>
+%</lua,lua-cli,lua-loader>
%<*manual-options>
#### Option `blankBeforeList`
@@ -4384,14 +4579,14 @@ following text:
% \end{macrocode}
% \iffalse
%</tex>
-%<*lua,lua-cli>
+%<*lua,lua-cli,lua-loader>
% \fi
% \begin{macrocode}
defaultOptions.blankBeforeList = false
% \end{macrocode}
% \par
% \iffalse
-%</lua,lua-cli>
+%</lua,lua-cli,lua-loader>
%<*manual-options>
#### Option `bracketedSpans`
@@ -4480,14 +4675,14 @@ following text:
% \end{macrocode}
% \iffalse
%</tex>
-%<*lua,lua-cli>
+%<*lua,lua-cli,lua-loader>
% \fi
% \begin{macrocode}
defaultOptions.bracketedSpans = false
% \end{macrocode}
% \par
% \iffalse
-%</lua,lua-cli>
+%</lua,lua-cli,lua-loader>
%<*manual-options>
#### Option `breakableBlockquotes`
@@ -4714,14 +4909,14 @@ following text:
% \end{macrocode}
% \iffalse
%</tex>
-%<*lua,lua-cli>
+%<*lua,lua-cli,lua-loader>
% \fi
% \begin{macrocode}
defaultOptions.breakableBlockquotes = true
% \end{macrocode}
% \par
% \iffalse
-%</lua,lua-cli>
+%</lua,lua-cli,lua-loader>
%<*manual-options>
#### Option `citationNbsps`
@@ -4808,14 +5003,14 @@ following text, where the middot (`·`) denotes a non-breaking space:
% \end{macrocode}
% \iffalse
%</tex>
-%<*lua,lua-cli>
+%<*lua,lua-cli,lua-loader>
% \fi
% \begin{macrocode}
defaultOptions.citationNbsps = true
% \end{macrocode}
% \par
% \iffalse
-%</lua,lua-cli>
+%</lua,lua-cli,lua-loader>
%<*manual-options>
#### Option `citations`
@@ -4911,14 +5106,14 @@ following text:
% \end{macrocode}
% \iffalse
%</tex>
-%<*lua,lua-cli>
+%<*lua,lua-cli,lua-loader>
% \fi
% \begin{macrocode}
defaultOptions.citations = false
% \end{macrocode}
% \par
% \iffalse
-%</lua,lua-cli>
+%</lua,lua-cli,lua-loader>
%<*manual-options>
#### Option `codeSpans`
@@ -5137,14 +5332,14 @@ following text:
% \end{macrocode}
% \iffalse
%</tex>
-%<*lua,lua-cli>
+%<*lua,lua-cli,lua-loader>
% \fi
% \begin{macrocode}
defaultOptions.codeSpans = true
% \end{macrocode}
% \par
% \iffalse
-%</lua,lua-cli>
+%</lua,lua-cli,lua-loader>
%<*manual-options>
#### Option `contentBlocks`
@@ -5311,14 +5506,14 @@ following text:
% \end{macrocode}
% \iffalse
%</tex>
-%<*lua,lua-cli>
+%<*lua,lua-cli,lua-loader>
% \fi
% \begin{macrocode}
defaultOptions.contentBlocks = false
% \end{macrocode}
% \par
% \iffalse
-%</lua,lua-cli>
+%</lua,lua-cli,lua-loader>
%<*manual-options>
#### Option `contentLevel`
@@ -5448,14 +5643,14 @@ following text:
% \end{macrocode}
% \iffalse
%</tex>
-%<*lua,lua-cli>
+%<*lua,lua-cli,lua-loader>
% \fi
% \begin{macrocode}
defaultOptions.contentLevel = "block"
% \end{macrocode}
% \par
% \iffalse
-%</lua,lua-cli>
+%</lua,lua-cli,lua-loader>
%<*manual-options>
#### Option `debugExtensions`
@@ -5603,14 +5798,14 @@ inserted to the grammar of markdown.
% \end{macrocode}
% \iffalse
%</tex>
-%<*lua,lua-cli>
+%<*lua,lua-cli,lua-loader>
% \fi
% \begin{macrocode}
defaultOptions.debugExtensions = false
% \end{macrocode}
% \par
% \iffalse
-%</lua,lua-cli>
+%</lua,lua-cli,lua-loader>
%<*manual-options>
#### Option `definitionLists`
@@ -5742,14 +5937,60 @@ following text:
% \end{macrocode}
% \iffalse
%</tex>
-%<*lua,lua-cli>
+%<*lua,lua-cli,lua-loader>
% \fi
% \begin{macrocode}
defaultOptions.definitionLists = false
% \end{macrocode}
% \par
% \iffalse
-%</lua,lua-cli>
+%</lua,lua-cli,lua-loader>
+%<*manual-options>
+
+#### Option `ensureJekyllData`
+
+`ensureJekyllData` (default value: `false`)
+
+% \fi
+% \begin{markdown}
+%
+% \Optitem[false]{ensureJekyllData}{\opt{true}, \opt{false}}
+%
+: false
+
+ : When the \Opt{jekyllData} and \Opt{expectJekyllData} options are
+ enabled, then a markdown document may begin directly with \acro{yaml}
+ metadata and may contain nothing but \acro{yaml} metadata. Otherwise,
+ the markdown document is processed as markdown text.
+
+: true
+
+ : When the \Opt{jekyllData} and \Opt{expectJekyllData} options are
+ enabled, then a markdown document must begin directly with \acro{yaml}
+ metadata and must contain nothing but \acro{yaml} metadata. Otherwise,
+ an error is produced.
+
+% \end{markdown}
+% \iffalse
+%</manual-options>
+%<*tex>
+% \fi
+% \begin{macrocode}
+\@@_add_lua_option:nnn
+ { ensureJekyllData }
+ { boolean }
+ { false }
+% \end{macrocode}
+% \iffalse
+%</tex>
+%<*lua,lua-cli,lua-loader>
+% \fi
+% \begin{macrocode}
+defaultOptions.ensureJekyllData = false
+% \end{macrocode}
+% \par
+% \iffalse
+%</lua,lua-cli,lua-loader>
%<*manual-options>
#### Option `expectJekyllData`
@@ -5866,14 +6107,14 @@ following text:
% \end{macrocode}
% \iffalse
%</tex>
-%<*lua,lua-cli>
+%<*lua,lua-cli,lua-loader>
% \fi
% \begin{macrocode}
defaultOptions.expectJekyllData = false
% \end{macrocode}
% \par
% \iffalse
-%</lua,lua-cli>
+%</lua,lua-cli,lua-loader>
%<*manual-options>
#### Option `extensions`
@@ -6017,14 +6258,14 @@ following text:
% \end{macrocode}
% \iffalse
%</tex>
-%<*lua,lua-cli>
+%<*lua,lua-cli,lua-loader>
% \fi
% \begin{macrocode}
defaultOptions.extensions = {}
% \end{macrocode}
% \par
% \iffalse
-%</lua,lua-cli>
+%</lua,lua-cli,lua-loader>
%<*manual-options>
#### Option `fancyLists`
@@ -6119,14 +6360,14 @@ following text:
% \end{macrocode}
% \iffalse
%</tex>
-%<*lua,lua-cli>
+%<*lua,lua-cli,lua-loader>
% \fi
% \begin{macrocode}
defaultOptions.fancyLists = false
% \end{macrocode}
% \par
% \iffalse
-%</lua,lua-cli>
+%</lua,lua-cli,lua-loader>
%<*manual-options>
#### Option `fencedCode`
@@ -6286,14 +6527,14 @@ following text:
% \end{macrocode}
% \iffalse
%</tex>
-%<*lua,lua-cli>
+%<*lua,lua-cli,lua-loader>
% \fi
% \begin{macrocode}
defaultOptions.fencedCode = true
% \end{macrocode}
% \par
% \iffalse
-%</lua,lua-cli>
+%</lua,lua-cli,lua-loader>
%<*manual-options>
#### Option `fencedCodeAttributes`
@@ -6386,14 +6627,14 @@ following text:
% \end{macrocode}
% \iffalse
%</tex>
-%<*lua,lua-cli>
+%<*lua,lua-cli,lua-loader>
% \fi
% \begin{macrocode}
defaultOptions.fencedCodeAttributes = false
% \end{macrocode}
% \par
% \iffalse
-%</lua,lua-cli>
+%</lua,lua-cli,lua-loader>
%<*manual-options>
#### Option `fencedDivs` {#fenced-divs}
@@ -6465,14 +6706,14 @@ following text:
% \end{macrocode}
% \iffalse
%</tex>
-%<*lua,lua-cli>
+%<*lua,lua-cli,lua-loader>
% \fi
% \begin{macrocode}
defaultOptions.fencedDivs = false
% \end{macrocode}
% \par
% \iffalse
-%</lua,lua-cli>
+%</lua,lua-cli,lua-loader>
%<*manual-options>
#### Option `finalizeCache`
@@ -6629,14 +6870,14 @@ the markdown document from “Hello *world*!†to “Hi *world*!†was not ref
% \end{macrocode}
% \iffalse
%</tex>
-%<*lua,lua-cli>
+%<*lua,lua-cli,lua-loader>
% \fi
% \begin{macrocode}
defaultOptions.finalizeCache = false
% \end{macrocode}
% \par
% \iffalse
-%</lua,lua-cli>
+%</lua,lua-cli,lua-loader>
%<*manual-options>
#### Option `frozenCacheCounter`
@@ -6698,14 +6939,14 @@ requested using the `frozenCacheCounter` option.
% \end{macrocode}
% \iffalse
%</tex>
-%<*lua,lua-cli>
+%<*lua,lua-cli,lua-loader>
% \fi
% \begin{macrocode}
defaultOptions.frozenCacheCounter = 0
% \end{macrocode}
% \par
% \iffalse
-%</lua,lua-cli>
+%</lua,lua-cli,lua-loader>
%<*manual-options>
#### Option `gfmAutoIdentifiers`
@@ -6747,14 +6988,14 @@ See also the option \Opt{autoIdentifiers}.
% \end{macrocode}
% \iffalse
%</tex>
-%<*lua,lua-cli>
+%<*lua,lua-cli,lua-loader>
% \fi
% \begin{macrocode}
defaultOptions.gfmAutoIdentifiers = false
% \end{macrocode}
% \par
% \iffalse
-%</lua,lua-cli>
+%</lua,lua-cli,lua-loader>
%<*manual-options>
#### Option `hashEnumerators`
@@ -6878,14 +7119,14 @@ following text:
% \end{macrocode}
% \iffalse
%</tex>
-%<*lua,lua-cli>
+%<*lua,lua-cli,lua-loader>
% \fi
% \begin{macrocode}
defaultOptions.hashEnumerators = false
% \end{macrocode}
% \par
% \iffalse
-%</lua,lua-cli>
+%</lua,lua-cli,lua-loader>
%<*manual-options>
#### Option `headerAttributes` {#header-attributes}
@@ -6927,14 +7168,14 @@ defaultOptions.hashEnumerators = false
% \end{macrocode}
% \iffalse
%</tex>
-%<*lua,lua-cli>
+%<*lua,lua-cli,lua-loader>
% \fi
% \begin{macrocode}
defaultOptions.headerAttributes = false
% \end{macrocode}
% \par
% \iffalse
-%</lua,lua-cli>
+%</lua,lua-cli,lua-loader>
%<*manual-options>
#### Option `html`
@@ -7199,14 +7440,14 @@ following text:
% \end{macrocode}
% \iffalse
%</tex>
-%<*lua,lua-cli>
+%<*lua,lua-cli,lua-loader>
% \fi
% \begin{macrocode}
defaultOptions.html = true
% \end{macrocode}
% \par
% \iffalse
-%</lua,lua-cli>
+%</lua,lua-cli,lua-loader>
%<*manual-options>
#### Option `hybrid`
@@ -7229,7 +7470,7 @@ defaultOptions.html = true
: false
: Enable the escaping of special plain \TeX{} characters outside verbatim
- environments, so that they are not interpretted by \TeX{}. This is
+ environments, so that they are not interpreted by \TeX{}. This is
encouraged when typesetting automatically generated content or
markdown documents that were not prepared with this package in mind.
@@ -7425,14 +7666,14 @@ following text:
% \end{macrocode}
% \iffalse
%</tex>
-%<*lua,lua-cli>
+%<*lua,lua-cli,lua-loader>
% \fi
% \begin{macrocode}
defaultOptions.hybrid = false
% \end{macrocode}
% \par
% \iffalse
-%</lua,lua-cli>
+%</lua,lua-cli,lua-loader>
%<*manual-options>
#### Option `inlineCodeAttributes`
@@ -7521,14 +7762,14 @@ following text:
% \end{macrocode}
% \iffalse
%</tex>
-%<*lua,lua-cli>
+%<*lua,lua-cli,lua-loader>
% \fi
% \begin{macrocode}
defaultOptions.inlineCodeAttributes = false
% \end{macrocode}
% \par
% \iffalse
-%</lua,lua-cli>
+%</lua,lua-cli,lua-loader>
%<*manual-options>
#### Option `inlineNotes`
@@ -7622,14 +7863,14 @@ following text:
% \end{macrocode}
% \iffalse
%</tex>
-%<*lua,lua-cli>
+%<*lua,lua-cli,lua-loader>
% \fi
% \begin{macrocode}
defaultOptions.inlineNotes = false
% \end{macrocode}
% \par
% \iffalse
-%</lua,lua-cli>
+%</lua,lua-cli,lua-loader>
%<*manual-options>
#### Option `jekyllData`
@@ -7789,14 +8030,14 @@ following text:
% \end{macrocode}
% \iffalse
%</tex>
-%<*lua,lua-cli>
+%<*lua,lua-cli,lua-loader>
% \fi
% \begin{macrocode}
defaultOptions.jekyllData = false
% \end{macrocode}
% \par
% \iffalse
-%</lua,lua-cli>
+%</lua,lua-cli,lua-loader>
%<*manual-options>
#### Option `linkAttributes`
@@ -7886,14 +8127,14 @@ image (from [Martin Scharrer's mwe package][mwe]) displayed at size 5cm × 4cm.
% \end{macrocode}
% \iffalse
%</tex>
-%<*lua,lua-cli>
+%<*lua,lua-cli,lua-loader>
% \fi
% \begin{macrocode}
defaultOptions.linkAttributes = false
% \end{macrocode}
% \par
% \iffalse
-%</lua,lua-cli>
+%</lua,lua-cli,lua-loader>
%<*manual-options>
#### Option `lineBlocks`
@@ -8021,14 +8262,14 @@ following text:
% \end{macrocode}
% \iffalse
%</tex>
-%<*lua,lua-cli>
+%<*lua,lua-cli,lua-loader>
% \fi
% \begin{macrocode}
defaultOptions.lineBlocks = false
% \end{macrocode}
% \par
% \iffalse
-%</lua,lua-cli>
+%</lua,lua-cli,lua-loader>
%<*manual-options>
#### Option `mark`
@@ -8092,14 +8333,14 @@ following text:
% \end{macrocode}
% \iffalse
%</tex>
-%<*lua,lua-cli>
+%<*lua,lua-cli,lua-loader>
% \fi
% \begin{macrocode}
defaultOptions.mark = false
% \end{macrocode}
% \par
% \iffalse
-%</lua,lua-cli>
+%</lua,lua-cli,lua-loader>
%<*manual-options>
#### Option `notes`
@@ -8182,10 +8423,6 @@ following text:
> Here is a note reference,[^1] and another.[^longnote]
>
-> [^1]: Here is the note.
->
-> [^longnote]: Here's one with multiple blocks.
->
> Subsequent paragraphs are indented to show that they
> belong to the previous note.
>
@@ -8236,10 +8473,6 @@ following text:
> Here is a note reference,[^1] and another.[^longnote]
>
-> [^1]: Here is the note.
->
-> [^longnote]: Here's one with multiple blocks.
->
> Subsequent paragraphs are indented to show that they
> belong to the previous note.
>
@@ -8263,14 +8496,14 @@ following text:
% \end{macrocode}
% \iffalse
%</tex>
-%<*lua,lua-cli>
+%<*lua,lua-cli,lua-loader>
% \fi
% \begin{macrocode}
defaultOptions.notes = false
% \end{macrocode}
% \par
% \iffalse
-%</lua,lua-cli>
+%</lua,lua-cli,lua-loader>
%<*manual-options>
#### Option `pipeTables` {#pipe-tables}
@@ -8372,14 +8605,14 @@ following text:
% \end{macrocode}
% \iffalse
%</tex>
-%<*lua,lua-cli>
+%<*lua,lua-cli,lua-loader>
% \fi
% \begin{macrocode}
defaultOptions.pipeTables = false
% \end{macrocode}
% \par
% \iffalse
-%</lua,lua-cli>
+%</lua,lua-cli,lua-loader>
%<*manual-options>
#### Option `preserveTabs`
@@ -8412,14 +8645,14 @@ defaultOptions.pipeTables = false
% \end{macrocode}
% \iffalse
%</tex>
-%<*lua,lua-cli>
+%<*lua,lua-cli,lua-loader>
% \fi
% \begin{macrocode}
defaultOptions.preserveTabs = true
% \end{macrocode}
% \par
% \iffalse
-%</lua,lua-cli>
+%</lua,lua-cli,lua-loader>
%<*manual-options>
#### Option `rawAttribute`
@@ -8507,14 +8740,14 @@ following text:
% \end{macrocode}
% \iffalse
%</tex>
-%<*lua,lua-cli>
+%<*lua,lua-cli,lua-loader>
% \fi
% \begin{macrocode}
defaultOptions.rawAttribute = false
% \end{macrocode}
% \par
% \iffalse
-%</lua,lua-cli>
+%</lua,lua-cli,lua-loader>
%<*manual-options>
#### Option `relativeReferences`
@@ -8528,7 +8761,7 @@ defaultOptions.rawAttribute = false
%
: true
- : Enable [relative references][1] in autolinks:
+ : Enable [relative references][rfc3986] in autolinks:
``` md
I conclude in Section <#conclusion>.
@@ -8544,7 +8777,7 @@ defaultOptions.rawAttribute = false
: Disable relative references in autolinks.
- [1]: https://datatracker.ietf.org/doc/html/rfc3986#section-4.2
+ [rfc3986]: https://datatracker.ietf.org/doc/html/rfc3986#section-4.2
% \end{markdown}
% \iffalse
@@ -8596,14 +8829,14 @@ following text:
% \end{macrocode}
% \iffalse
%</tex>
-%<*lua,lua-cli>
+%<*lua,lua-cli,lua-loader>
% \fi
% \begin{macrocode}
defaultOptions.relativeReferences = false
% \end{macrocode}
% \par
% \iffalse
-%</lua,lua-cli>
+%</lua,lua-cli,lua-loader>
%<*manual-options>
#### Option `shiftHeadings`
@@ -8736,14 +8969,14 @@ following text:
% \end{macrocode}
% \iffalse
%</tex>
-%<*lua,lua-cli>
+%<*lua,lua-cli,lua-loader>
% \fi
% \begin{macrocode}
defaultOptions.shiftHeadings = 0
% \end{macrocode}
% \par
% \iffalse
-%</lua,lua-cli>
+%</lua,lua-cli,lua-loader>
%<*manual-options>
#### Option `slice`
@@ -8954,14 +9187,14 @@ following text:
% \end{macrocode}
% \iffalse
%</tex>
-%<*lua,lua-cli>
+%<*lua,lua-cli,lua-loader>
% \fi
% \begin{macrocode}
defaultOptions.slice = "^ $"
% \end{macrocode}
% \par
% \iffalse
-%</lua,lua-cli>
+%</lua,lua-cli,lua-loader>
%<*manual-options>
#### Option `smartEllipses`
@@ -9169,14 +9402,14 @@ following text:
% \end{macrocode}
% \iffalse
%</tex>
-%<*lua,lua-cli>
+%<*lua,lua-cli,lua-loader>
% \fi
% \begin{macrocode}
defaultOptions.smartEllipses = false
% \end{macrocode}
% \par
% \iffalse
-%</lua,lua-cli>
+%</lua,lua-cli,lua-loader>
%<*manual-options>
#### Option `startNumber`
@@ -9305,14 +9538,14 @@ following text:
% \end{macrocode}
% \iffalse
%</tex>
-%<*lua,lua-cli>
+%<*lua,lua-cli,lua-loader>
% \fi
% \begin{macrocode}
defaultOptions.startNumber = true
% \end{macrocode}
% \par
% \iffalse
-%</lua,lua-cli>
+%</lua,lua-cli,lua-loader>
%<*manual-options>
#### Option `strikeThrough`
@@ -9427,14 +9660,14 @@ following text:
% \end{macrocode}
% \iffalse
%</tex>
-%<*lua,lua-cli>
+%<*lua,lua-cli,lua-loader>
% \fi
% \begin{macrocode}
defaultOptions.strikeThrough = false
% \end{macrocode}
% \par
% \iffalse
-%</lua,lua-cli>
+%</lua,lua-cli,lua-loader>
%<*manual-options>
#### Option `stripIndent`
@@ -9540,14 +9773,14 @@ text “Hello *world*!â€
% \end{macrocode}
% \iffalse
%</tex>
-%<*lua,lua-cli>
+%<*lua,lua-cli,lua-loader>
% \fi
% \begin{macrocode}
defaultOptions.stripIndent = false
% \end{macrocode}
% \par
% \iffalse
-%</lua,lua-cli>
+%</lua,lua-cli,lua-loader>
%<*manual-options>
#### Option `subscripts`
@@ -9632,14 +9865,14 @@ following text:
% \end{macrocode}
% \iffalse
%</tex>
-%<*lua,lua-cli>
+%<*lua,lua-cli,lua-loader>
% \fi
% \begin{macrocode}
defaultOptions.subscripts = false
% \end{macrocode}
% \par
% \iffalse
-%</lua,lua-cli>
+%</lua,lua-cli,lua-loader>
%<*manual-options>
#### Option `superscripts`
@@ -9724,14 +9957,14 @@ following text:
% \end{macrocode}
% \iffalse
%</tex>
-%<*lua,lua-cli>
+%<*lua,lua-cli,lua-loader>
% \fi
% \begin{macrocode}
defaultOptions.superscripts = false
% \end{macrocode}
% \par
% \iffalse
-%</lua,lua-cli>
+%</lua,lua-cli,lua-loader>
%<*manual-options>
#### Option `tableAttributes`
@@ -9849,14 +10082,14 @@ following text:
% \end{macrocode}
% \iffalse
%</tex>
-%<*lua,lua-cli>
+%<*lua,lua-cli,lua-loader>
% \fi
% \begin{macrocode}
defaultOptions.tableAttributes = false
% \end{macrocode}
% \par
% \iffalse
-%</lua,lua-cli>
+%</lua,lua-cli,lua-loader>
%<*manual-options>
#### Option `tableCaptions` {#table-captions}
@@ -9979,14 +10212,14 @@ following text:
% \end{macrocode}
% \iffalse
%</tex>
-%<*lua,lua-cli>
+%<*lua,lua-cli,lua-loader>
% \fi
% \begin{macrocode}
defaultOptions.tableCaptions = false
% \end{macrocode}
% \par
% \iffalse
-%</lua,lua-cli>
+%</lua,lua-cli,lua-loader>
%<*manual-options>
#### Option `taskLists`
@@ -10092,14 +10325,14 @@ following text:
% \end{macrocode}
% \iffalse
%</tex>
-%<*lua,lua-cli>
+%<*lua,lua-cli,lua-loader>
% \fi
% \begin{macrocode}
defaultOptions.taskLists = false
% \end{macrocode}
% \par
% \iffalse
-%</lua,lua-cli>
+%</lua,lua-cli,lua-loader>
%<*manual-options>
#### Option `texComments`
@@ -10208,14 +10441,14 @@ text “Hello *world*!â€
% \end{macrocode}
% \iffalse
%</tex>
-%<*lua,lua-cli>
+%<*lua,lua-cli,lua-loader>
% \fi
% \begin{macrocode}
defaultOptions.texComments = false
% \end{macrocode}
% \par
% \iffalse
-%</lua,lua-cli>
+%</lua,lua-cli,lua-loader>
%<*manual-options>
#### Option `texMathDollars`
@@ -10419,14 +10652,14 @@ following text:
% \end{macrocode}
% \iffalse
%</tex>
-%<*lua,lua-cli>
+%<*lua,lua-cli,lua-loader>
% \fi
% \begin{macrocode}
defaultOptions.texMathDollars = false
% \end{macrocode}
% \par
% \iffalse
-%</lua,lua-cli>
+%</lua,lua-cli,lua-loader>
%<*manual-options>
#### Option `texMathDoubleBackslash`
@@ -10486,9 +10719,9 @@ luatex document.tex
A PDF document named `document.pdf` should be produced and contain the
following text:
-> \\(E=mc^2\\)
+> \(E=mc^2\)
>
-> \\[\hat{f} \left ( \xi \right )= \int_{-\infty}^{\infty} f\left ( x \right ) e^{-i2\pi \xi x} dx\\]
+> \[\hat{f} \left ( \xi \right )= \int_{-\infty}^{\infty} f\left ( x \right ) e^{-i2\pi \xi x} dx\]
##### Lua CLI Example {.unnumbered}
@@ -10528,13 +10761,13 @@ script file using [Kpathsea][].
A PDF document named `document.pdf` should be produced and contain the
following text:
-> \\\(E=mc^2\\)
->
-> \\\[\hat{f} \left ( \xi \right )= \int_{-\infty}^{\infty} f\left ( x \right ) e^{-i2\pi \xi x} dx\\]
->
> \\(E=mc^2\\)
>
> \\[\hat{f} \left ( \xi \right )= \int_{-\infty}^{\infty} f\left ( x \right ) e^{-i2\pi \xi x} dx\\]
+>
+> \(E=mc^2\)
+>
+> \[\hat{f} \left ( \xi \right )= \int_{-\infty}^{\infty} f\left ( x \right ) e^{-i2\pi \xi x} dx\]
##### Plain \TeX{} Example {.unnumbered}
@@ -10559,9 +10792,9 @@ luatex document.tex
A PDF document named `document.pdf` should be produced and contain the
following text:
-> \\(E=mc^2\\)
+> \(E=mc^2\)
>
-> \\[\hat{f} \left ( \xi \right )= \int_{-\infty}^{\infty} f\left ( x \right ) e^{-i2\pi \xi x} dx\\]
+> \[\hat{f} \left ( \xi \right )= \int_{-\infty}^{\infty} f\left ( x \right ) e^{-i2\pi \xi x} dx\]
##### \LaTeX{} Example {.unnumbered}
@@ -10587,9 +10820,9 @@ lualatex document.tex
A PDF document named `document.pdf` should be produced and contain the
following text:
-> \\(E=mc^2\\)
+> \(E=mc^2\)
>
-> \\[\hat{f} \left ( \xi \right )= \int_{-\infty}^{\infty} f\left ( x \right ) e^{-i2\pi \xi x} dx\\]
+> \[\hat{f} \left ( \xi \right )= \int_{-\infty}^{\infty} f\left ( x \right ) e^{-i2\pi \xi x} dx\]
##### \Hologo{ConTeXt} Example {.unnumbered}
@@ -10615,9 +10848,9 @@ context --luatex document.tex
A PDF document named `document.pdf` should be produced and contain the
following text:
-> \\(E=mc^2\\)
+> \(E=mc^2\)
>
-> \\[\hat{f} \left ( \xi \right )= \int_{-\infty}^{\infty} f\left ( x \right ) e^{-i2\pi \xi x} dx\\]
+> \[\hat{f} \left ( \xi \right )= \int_{-\infty}^{\infty} f\left ( x \right ) e^{-i2\pi \xi x} dx\]
%</manual-options>
%<*tex>
@@ -10630,14 +10863,14 @@ following text:
% \end{macrocode}
% \iffalse
%</tex>
-%<*lua,lua-cli>
+%<*lua,lua-cli,lua-loader>
% \fi
% \begin{macrocode}
defaultOptions.texMathDoubleBackslash = false
% \end{macrocode}
% \par
% \iffalse
-%</lua,lua-cli>
+%</lua,lua-cli,lua-loader>
%<*manual-options>
#### Option `texMathSingleBackslash`
@@ -10841,14 +11074,14 @@ following text:
% \end{macrocode}
% \iffalse
%</tex>
-%<*lua,lua-cli>
+%<*lua,lua-cli,lua-loader>
% \fi
% \begin{macrocode}
defaultOptions.texMathSingleBackslash = false
% \end{macrocode}
% \par
% \iffalse
-%</lua,lua-cli>
+%</lua,lua-cli,lua-loader>
%<*manual-options>
#### Option `tightLists`
@@ -10962,14 +11195,14 @@ following text:
% \end{macrocode}
% \iffalse
%</tex>
-%<*lua,lua-cli>
+%<*lua,lua-cli,lua-loader>
% \fi
% \begin{macrocode}
defaultOptions.tightLists = true
% \end{macrocode}
% \par
% \iffalse
-%</lua,lua-cli>
+%</lua,lua-cli,lua-loader>
%<*manual-options>
#### Option `underscores`
@@ -11105,14 +11338,14 @@ following text:
% \end{macrocode}
% \iffalse
%</tex>
-%<*lua,lua-cli>
+%<*lua,lua-cli,lua-loader>
% \fi
% \begin{macrocode}
defaultOptions.underscores = true
% \end{macrocode}
% \endgroup
% \iffalse
-%</lua,lua-cli>
+%</lua,lua-cli,lua-loader>
%<*lua-cli>
% \fi
% \par
@@ -11198,7 +11431,8 @@ Copyright (C) ]] .. table.concat(metadata.copyright,
License: ]] .. metadata.license
local function warn(s)
- io.stderr:write("Warning: " .. s .. "\n") end
+ io.stderr:write("Warning: " .. s .. "\n")
+end
local function error(s)
io.stderr:write("Error: " .. s .. "\n")
@@ -11289,8 +11523,8 @@ for i = 1, #arg do
if default_type == "nil" then
warn('Option "' .. key .. '" not recognized.')
else
- warn('Option "' .. key .. '" type not recognized, please file ' ..
- 'a report to the package maintainer.')
+ warn('Option "' .. key .. '" type not recognized, ' ..
+ 'please file a report to the package maintainer.')
end
warn('Parsing the ' .. 'value "' .. value ..'" of option "' ..
key .. '" as a string.')
@@ -11322,7 +11556,7 @@ for i = 1, #arg do
end
% \end{macrocode}
% \begin{markdown}
-% The first argument that matches none of the above patters is assumed to be
+% The first argument that matches none of the above patterns is assumed to be
% the input filename. The input filename should correspond to the Markdown
% document that is going to be converted to a \TeX{} document.
% \end{markdown}
@@ -11331,7 +11565,7 @@ for i = 1, #arg do
input_filename = arg[i]
% \end{macrocode}
% \begin{markdown}
-% The first argument that matches none of the above patters is assumed to be
+% The first argument that matches none of the above patterns is assumed to be
% the output filename. The output filename should correspond to the \TeX{}
% document that will result from the conversion.
% \end{markdown}
@@ -11625,7 +11859,9 @@ pdftex --shell-escape document.tex
% \begin{macrocode}
\prop_new:N \g_@@_plain_tex_option_types_prop
\prop_new:N \g_@@_default_plain_tex_options_prop
-\seq_gput_right:NV \g_@@_option_layers_seq \c_@@_option_layer_plain_tex_tl
+\seq_gput_right:NV
+ \g_@@_option_layers_seq
+ \c_@@_option_layer_plain_tex_tl
\cs_new:Nn
\@@_add_plain_tex_option:nnn
{
@@ -11856,47 +12092,10 @@ For more information, see the examples for the \Opt{finalizeCache} option.
%
% \end{markdown}
% \begin{macrocode}
-\cs_generate_variant:Nn
- \@@_add_plain_tex_option:nnn
- { nnV }
-% \end{macrocode}
-% \begin{markdown}
-%
-% Use the \pkg{lt3luabridge} library to determine the default value of the
-% \mref{markdownOptionOutputDir} macro by using the environmental variable
-% `TEXMF_OUTPUT_DIRECTORY` that is available since TeX~Live 2024.
-%
-% \end{markdown}
-% \begin{macrocode}
-\ExplSyntaxOff
-\input lt3luabridge.tex
-\ExplSyntaxOn
-\bool_if:nTF
- {
- \cs_if_exist_p:N
- \luabridge_tl_set:Nn &&
- (
- \int_compare_p:nNn
- { \g_luabridge_method_int }
- =
- { \c_luabridge_method_directlua_int } ||
- \sys_if_shell_unrestricted_p:
- )
- }
- {
- \luabridge_tl_set:Nn
- \l_tmpa_tl
- { print(os.getenv("TEXMF_OUTPUT_DIRECTORY") or ".") }
- }
- {
- \tl_set:Nn
- \l_tmpa_tl
- { . }
- }
-\@@_add_plain_tex_option:nnV
+\@@_add_plain_tex_option:nnn
{ outputDir }
{ path }
- \l_tmpa_tl
+ { . }
% \end{macrocode}
% \iffalse
%</tex>
@@ -12172,22 +12371,73 @@ A PDF document named `document.pdf` should be produced and contain the text
% \end{macrocode}
% \begin{markdown}
%
-% Do not override options defined before loading the package.
+% Use the \pkg{lt3luabridge} library to determine the default value of the
+% \mref{markdownOptionOutputDir} macro by using the environmental variable
+% `TEXMF_OUTPUT_DIRECTORY` that is available since TeX~Live 2024.
%
% \end{markdown}
% \begin{macrocode}
- \@@_option_tl_to_csname:nN
+ \str_if_eq:nnTF
{ #1 }
- \l_tmpa_tl
- \cs_if_exist:cF
- { \l_tmpa_tl }
+ { outputDir }
+ { \@@_define_option_command_output_dir: }
{
- \@@_get_default_option_value:nN
- { #1 }
- \l_tmpa_tl
- \@@_set_option_value:nV
+% \end{macrocode}
+% \begin{markdown}
+%
+% Do not override options defined before loading the package.
+%
+% \end{markdown}
+% \begin{macrocode}
+ \@@_option_tl_to_csname:nN
{ #1 }
\l_tmpa_tl
+ \cs_if_exist:cF
+ { \l_tmpa_tl }
+ {
+ \@@_get_default_option_value:nN
+ { #1 }
+ \l_tmpa_tl
+ \@@_set_option_value:nV
+ { #1 }
+ \l_tmpa_tl
+ }
+ }
+ }
+\ExplSyntaxOff
+\input lt3luabridge.tex
+\ExplSyntaxOn
+\cs_new:Nn
+ \@@_define_option_command_output_dir:
+ {
+ \cs_if_free:NT
+ \markdownOptionOutputDir
+ {
+ \bool_if:nTF
+ {
+ \cs_if_exist_p:N
+ \luabridge_tl_set:Nn &&
+ (
+ \int_compare_p:nNn
+ { \g_luabridge_method_int }
+ =
+ { \c_luabridge_method_directlua_int } ||
+ \sys_if_shell_unrestricted_p:
+ )
+ }
+ {
+ \luabridge_tl_set:Nn
+ \l_tmpa_tl
+ { print(os.getenv("TEXMF_OUTPUT_DIRECTORY") or ".") }
+ \tl_gset:NV
+ \markdownOptionOutputDir
+ \l_tmpa_tl
+ }
+ {
+ \tl_gset:Nn
+ \markdownOptionOutputDir
+ { . }
+ }
}
}
\cs_new:Nn
@@ -12682,10 +12932,14 @@ options locally.
{ redefined-snippet }
\l_tmpa_tl
}
- \prop_gput:NVn
+ \keys_precompile:nnN
+ { markdown/options }
+ { #2 }
+ \l_tmpb_tl
+ \prop_gput:NVV
\g_@@_snippets_prop
\l_tmpa_tl
- { #2 }
+ \l_tmpb_tl
}
\cs_gset_eq:NN
\markdownSetupSnippet
@@ -12751,7 +13005,7 @@ options locally.
\g_@@_snippets_prop
\l_tmpa_tl
\l_tmpb_tl
- \@@_setup:V
+ \tl_use:N
\l_tmpb_tl
}
{
@@ -12766,9 +13020,6 @@ options locally.
{ markdown }
{ undefined-snippet }
{ Can't~invoke~undefined~snippet~#1 }
-\cs_generate_variant:Nn
- \@@_setup:n
- { V }
\ExplSyntaxOff
% \end{macrocode}
% \iffalse
@@ -14039,7 +14290,7 @@ following text:
#### Code Block Renderers
The \mdef{markdownRendererInputVerbatim} macro represents a code
block. The macro receives a single argument that corresponds to the
-filename of a file contaning the code block contents.
+filename of a file containing the code block contents.
% \end{markdown}
%
@@ -14073,7 +14324,7 @@ filename of a file contaning the code block contents.
The \mdef{markdownRendererInputFencedCode} macro represents a fenced code
block. This macro will only be produced, when the \Opt{fencedCode} option is
enabled. The macro receives three arguments that correspond to the filename of
-a file contaning the code block contents, the fully escaped code fence infostring
+a file containing the code block contents, the fully escaped code fence infostring
that can be directly typeset, and the raw code fence infostring that can be used
outside typesetting.
@@ -15289,7 +15540,7 @@ following text:
% \begin{markdown}
#### Ellipsis Renderer
-The \mdef{markdownRendererEllipsis} macro replaces any occurance of ASCII
+The \mdef{markdownRendererEllipsis} macro replaces any occurrence of ASCII
ellipses in the input text. This macro will only be produced, when the
\Opt{smartEllipses} option is enabled. The macro receives no arguments.
@@ -15553,8 +15804,8 @@ following text:
% \begin{markdown}
#### Fenced Code Attribute Context Renderers
-The following macros are only produced, when the \Opt{fencedCode} option is
-enabled.
+The following macros are only produced, when the \Opt{fencedCode} and
+\Opt{fencedCodeAttributes} options are enabled.
The \mdef{markdownRendererFencedCodeAttributeContextBegin} and
\mdef{markdownRendererFencedCodeAttributeContextEnd} macros represent the
@@ -18435,7 +18686,7 @@ following text:
#### Raw Content Renderers
The \mdef{markdownRendererInputRawInline} macro represents an inline raw span.
-The macro receives two arguments: the filename of a file contaning the inline
+The macro receives two arguments: the filename of a file containing the inline
raw span contents and the raw attribute that designates the format of the
inline raw span. This macro will only be produced, when the \Opt{rawAttribute}
option is enabled.
@@ -18470,7 +18721,7 @@ option is enabled.
% \begin{markdown}
The \mdef{markdownRendererInputRawBlock} macro represents a raw block. The
-macro receives two arguments: the filename of a file contaning the raw block
+macro receives two arguments: the filename of a file containing the raw block
and the raw attribute that designates the format of the raw block. This macro
will only be produced, when the \Opt{rawAttribute} and \Opt{fencedCode} options
are enabled.
@@ -19368,7 +19619,7 @@ following content:
\markdownSetup{
renderers = {
table = {%
- This is a table with caption \emph{#1} that is #3 colums wide
+ This is a table with caption \emph{#1} that is #3 columns wide
and #2 rows long.
\rowCounter=0%
\def\rowTotal{#2}%
@@ -19397,7 +19648,7 @@ A PDF document named `document.pdf` should be produced and contain the
following text:
> This is a table with caption *Demonstration of pipe table syntax* that is 4
-> colums wide and 4 rows long. As for the alignment, column number 1 is
+> columns wide and 4 rows long. As for the alignment, column number 1 is
> right-aligned, column number 2 is left-aligned, column number 3 has default
> alignment, and column number 4 is centered. In row 1, column number 1 says
> *Right*, column number 2 says *Left*, column number 3 says *Default*, and
@@ -19454,7 +19705,7 @@ following content:
\input markdown
\def\markdownOptionTexMathDollars{true}
\def\markdownRendererInlineMath#1{$#1\dots$}
-\def\markdownRendererDisplayMath#1{$$#1\eqno(1)$$}
+\def\markdownRendererDisplayMath#1{$$#1\nonumber$$}
\markdownBegin
$E=mc^2$
@@ -19471,7 +19722,7 @@ following text:
> $E=mc^2\dots$
>
-> $$\hat{f} \left ( \xi \right )= \int_{-\infty}^{\infty} f\left ( x \right ) e^{-i2\pi \xi x} dx\eqno(1)$$
+> $$\hat{f} \left ( \xi \right )= \int_{-\infty}^{\infty} f\left ( x \right ) e^{-i2\pi \xi x} dx\nonumber$$
##### \LaTeX{} Example {.unnumbered}
@@ -19810,6 +20061,50 @@ following text:
%
% \begin{markdown}
+#### Warning and Error Renderers
+
+The \mdef{markdownRendererWarning} and \mdef{markdownRendererError} macros
+represent warnings and errors produced by the markdown parser. Both macros
+receive a single parameter with the text of the warning or error.
+
+% \end{markdown}
+%
+% \iffalse
+%</manual-tokens>
+%<*tex>
+% \fi
+%
+% \begin{macrocode}
+\def\markdownRendererWarning{%
+ \markdownRendererWarningPrototype}%
+\def\markdownRendererError{%
+ \markdownRendererErrorPrototype}%
+\ExplSyntaxOn
+\seq_gput_right:Nn
+ \g_@@_renderers_seq
+ { warning }
+\prop_gput:Nnn
+ \g_@@_renderer_arities_prop
+ { warning }
+ { 1 }
+\seq_gput_right:Nn
+ \g_@@_renderers_seq
+ { error }
+\prop_gput:Nnn
+ \g_@@_renderer_arities_prop
+ { error }
+ { 1 }
+\ExplSyntaxOff
+% \end{macrocode}
+% \par
+%
+% \iffalse
+%</tex>
+%<*manual-tokens>
+% \fi
+%
+% \begin{markdown}
+
#### YAML Metadata Renderers {#yamlmetadatarenderers}
The \mdef{markdownRendererJekyllDataBegin} macro represents the beginning of a
@@ -20084,12 +20379,24 @@ following \acro{yaml} serialization rules.
%
% \begin{markdown}
-The \mdef{markdownRendererJekyllDataString} macro represents a string scalar
-value in a \acro{yaml} document. This macro will only be produced when the
-\Opt{jekyllData} option is enabled. The macro receives two arguments: the
+The \mdef{markdownRendererJekyllDataTypographicString} and
+\mdef{markdownRendererJekyllDataProgrammaticString} macros represent string
+scalar values in a \acro{yaml} document. This macro will only be produced when
+the \Opt{jekyllData} option is enabled. The macro receives two arguments: the
scalar key in the parent structure, cast to a string following \acro{yaml}
serialization rules, and the scalar value.
+For each string scalar value, both macros are produced. Whereas
+\mref{markdownRendererJekyllDataTypographicString} receives the scalar value
+after all markdown markup and special \TeX{} characters in the string have been
+replaced by \TeX{} macros, \mref{markdownRendererJekyllDataProgrammaticString}
+receives the raw scalar value. Therefore, whereas the
+\mref{markdownRendererJekyllDataTypographicString} macro is more appropriate
+for texts that are supposed to be typeset with \TeX{}, such as document titles,
+author names, or exam questions, the
+\mref{markdownRendererJekyllDataProgrammaticString} macro is more appropriate
+for identifiers and other programmatic text that won't be typeset by \TeX{}.
+
% \end{markdown}
%
% \iffalse
@@ -20098,11 +20405,83 @@ serialization rules, and the scalar value.
% \fi
%
% \begin{macrocode}
-\def\markdownRendererJekyllDataString{%
- \markdownRendererJekyllDataStringPrototype}%
+\def\markdownRendererJekyllDataTypographicString{%
+ \markdownRendererJekyllDataTypographicStringPrototype}%
+\def\markdownRendererJekyllDataProgrammaticString{%
+ \markdownRendererJekyllDataProgrammaticStringPrototype}%
\ExplSyntaxOn
\seq_gput_right:Nn
\g_@@_renderers_seq
+ { jekyllDataTypographicString }
+\prop_gput:Nnn
+ \g_@@_renderer_arities_prop
+ { jekyllDataTypographicString }
+ { 2 }
+\seq_gput_right:Nn
+ \g_@@_renderers_seq
+ { jekyllDataProgrammaticString }
+\prop_gput:Nnn
+ \g_@@_renderer_arities_prop
+ { jekyllDataProgrammaticString }
+ { 2 }
+\ExplSyntaxOff
+% \end{macrocode}
+% \par
+%
+% \iffalse
+%</tex>
+%<*manual-tokens>
+% \fi
+%
+% \begin{markdown}
+
+Before Markdown 3.7.0, the \mref{markdownRendererJekyllDataTypographicString}
+macro was named \mref{markdownRendererJekyllDataString} and the
+\mref{markdownRendererJekyllDataProgrammaticString} macro was not produced.
+The \mref{markdownRendererJekyllDataString} has been deprecated and will be
+removed in Markdown 4.0.0.
+
+% \end{markdown}
+%
+% \iffalse
+%</manual-tokens>
+%<*tex>
+% \fi
+%
+% \begin{macrocode}
+\ExplSyntaxOn
+\cs_gset:Npn
+ \markdownRendererJekyllDataTypographicString
+ {
+ \cs_if_exist:NTF
+ \markdownRendererJekyllDataString
+ {
+ \markdownWarning
+ {
+ The~jekyllDataString~renderer~has~been~deprecated,~
+ to~be~removed~in~Markdown~4.0.0
+ }
+ \markdownRendererJekyllDataString
+ }
+ {
+ \cs_if_exist:NTF
+ \markdownRendererJekyllDataStringPrototype
+ {
+ \markdownWarning
+ {
+ The~jekyllDataString~renderer~prototype~
+ has~been~deprecated,~
+ to~be~removed~in~Markdown~4.0.0
+ }
+ \markdownRendererJekyllDataStringPrototype
+ }
+ {
+ \markdownRendererJekyllDataTypographicStringPrototype
+ }
+ }
+ }
+\seq_gput_right:Nn
+ \g_@@_renderers_seq
{ jekyllDataString }
\prop_gput:Nnn
\g_@@_renderer_arities_prop
@@ -20162,7 +20541,7 @@ following content:
``` tex
\input markdown
\def\markdownOptionJekyllData{true}
-\def\markdownRendererJekyllDataString#1#2{\gdef\name{#2}}
+\def\markdownRendererJekyllDataTypographicString#1#2{\gdef\name{#2}}
\def\markdownRendererJekyllDataNumber#1#2{\gdef\age{#2}}
\def\markdownRendererJekyllDataEnd{%
\name{} is \age{} years old.}
@@ -20192,7 +20571,7 @@ following content:
\usepackage[jekyllData]{markdown}
\markdownSetup{
renderers = {
- jekyllDataString = {\gdef\name{#2}},
+ jekyllDataTypographicString = {\gdef\name{#2}},
jekyllDataNumber = {\gdef\age{#2}},
jekyllDataEnd = {\name{} is \age{} years old.},
}
@@ -20224,7 +20603,7 @@ following content:
``` tex
\usemodule[t][markdown]
\setupmarkdown[jekyllData = yes]
-\def\markdownRendererJekyllDataString#1#2{\gdef\name{#2}}
+\def\markdownRendererJekyllDataTypographicString#1#2{\gdef\name{#2}}
\def\markdownRendererJekyllDataNumber#1#2{\gdef\age{#2}}
\def\markdownRendererJekyllDataEnd{%
\name{} is \age{} years old.}
@@ -20256,7 +20635,7 @@ following text:
%#### Generating Plain \TeX{} Token Renderer Macros and Key-Values {#plain-tex-renderers}
%
% We define the command \mdef{@@_define_renderers:} that defines plain \TeX{}
-% macros for token renderers. Futhermore, the `\markdownSetup` macro also accepts
+% macros for token renderers. Furthermore, the `\markdownSetup` macro also accepts
% the `renderers` key, whose value must be a list of key-values, where the keys
% correspond to the markdown token renderer macros and the values are new
% definitions of these token renderers.
@@ -20266,9 +20645,26 @@ following text:
\ExplSyntaxOn
\cs_new:Nn \@@_define_renderers:
{
- \seq_map_function:NN
+ \seq_map_inline:Nn
\g_@@_renderers_seq
- \@@_define_renderer:n
+ {
+% \end{macrocode}
+% \par
+% \begin{markdown}
+%
+% The \mref{markdownRendererJekyllDataString} has been deprecated and will be
+% removed in Markdown 4.0.0.
+%
+% \end{markdown}
+% \begin{macrocode}
+ \str_if_eq:nnF
+ { ##1 }
+ { jekyllDataString }
+ {
+ \@@_define_renderer:n
+ { ##1 }
+ }
+ }
}
\cs_new:Nn \@@_define_renderer:n
{
@@ -20974,7 +21370,7 @@ following text:
%#### Generating Plain \TeX{} Token Renderer Prototype Macros and Key-Values {#plain-tex-renderer-prototypes}
%
% We define the command \mdef{@@_define_renderer_prototypes:} that defines plain \TeX{}
-% macros for token renderer prototypes. Futhermore, the `\markdownSetup` macro also accepts
+% macros for token renderer prototypes. Furthermore, the `\markdownSetup` macro also accepts
% the `rendererPrototype` key, whose value must be a list of key-values, where the keys
% correspond to the markdown token renderer prototype macros and the values are new
% definitions of these token renderer prototypes.
@@ -20984,9 +21380,26 @@ following text:
\ExplSyntaxOn
\cs_new:Nn \@@_define_renderer_prototypes:
{
- \seq_map_function:NN
+ \seq_map_inline:Nn
\g_@@_renderers_seq
- \@@_define_renderer_prototype:n
+ {
+% \end{macrocode}
+% \par
+% \begin{markdown}
+%
+% The \mref{markdownRendererJekyllDataString} has been deprecated and will be
+% removed in Markdown 4.0.0.
+%
+% \end{markdown}
+% \begin{macrocode}
+ \str_if_eq:nnF
+ { ##1 }
+ { jekyllDataString }
+ {
+ \@@_define_renderer_prototype:n
+ { ##1 }
+ }
+ }
}
\cs_new:Nn \@@_define_renderer_prototype:n
{
@@ -21466,9 +21879,10 @@ pdflatex --shell-escape document.tex
% \LaTeX{} environments, and redefines the \mref{markinline} and
% \mref{markdownInput} commands.
%
+%#### The `markdown` and `markdown*` \LaTeX{} environments
% The \envmref{markdown} and \envmref{markdown*} \LaTeX{} environments are used
% to typeset markdown document fragments. Both \LaTeX{} environments accept
-% \LaTeX{} interface options (see ection <#sec:latex-options>) as the only
+% \LaTeX{} interface options (see Section <#sec:latex-options>) as the only
% argument. This argument is optional for the \envmref{markdown} environment
% and mandatory for the \envmref{markdown*} environment.
%
@@ -21505,6 +21919,52 @@ pdflatex --shell-escape document.tex
% \end{document} \end{document}
% ```````
%
+% You can't directly extend the \envmref{markdown} \LaTeX{} environment by
+% using it in other environments as follows:
+%
+% ``` tex
+% \newenvironment{foo}\%
+% {code before \begin{markdown}[some, options]}\%
+% {\end{markdown} code after}
+% ```
+%
+% This is because the implementation looks for the literal string
+% `\end{markdown}` to stop scanning the markdown text. However, you can work
+% around this limitation by using the \mref{markdown} and \mref{markdownEnd}
+% macros directly in the definition as follows:
+%
+% \markdownEnd
+% \begin{markdown}
+%
+% ``` tex
+% \newenvironment{foo}\%
+% {code before \markdown[some, options]}\%
+% {\markdownEnd code after}
+% ```
+%
+% Specifically, the \mref{markdown} macro must appear at the end of the
+% replacement text and must be followed by text that has not yet been ingested
+% by \TeX's input processor. Furthermore, using the \mref{markdownEnd} macro is
+% optional and only makes a difference if you redefined it to produce special
+% effects before and after the \envmref{markdown} \LaTeX{} environment. Lastly,
+% you can't nest the other environments. For example, the following definition
+% is incorrect:
+%
+% ``` tex
+% \newenvironment{bar}{\begin{foo}}{\end{foo}}
+% ```
+%
+% In this example, you should use the \mref{markdown} macro directly in the
+% definition of the environment `bar`:
+%
+% ``` tex
+% \newenvironment{bar}{\markdown[some, options]}{\markdownEnd}
+% ```
+%
+% \end{markdown}
+% \markdownBegin
+%
+%#### The `\markinline` and `\markdownInput` macros
% The \mref{markinline} macro accepts a single mandatory parameter containing
% inline markdown content and expands to the result of the conversion of the
% input markdown document to plain \TeX{}. Unlike the \mref{markinline} macro
@@ -21600,7 +22060,7 @@ following code in our \LaTeX{} document:
We can also set all plain \TeX{} options directly from \LaTeX{}. For example,
to set the `\markdownOptionInputTempFileName` plain \TeX{} option to
-`helper-script.lua`, we would inclde the following code in our \LaTeX{}
+`helper-script.lua`, we would include the following code in our \LaTeX{}
document:
``` tex
@@ -22249,14 +22709,14 @@ Built-in \Hologo{ConTeXt} themes provided with the Markdown package include:
% \end{markdown}
% \iffalse
%</manual-options>
-%<*themes-witiko-markdown-defaults-context>
+%<*themes-witiko-markdown-defaults-ctx>
% \fi
% \begin{macrocode}
\startmodule[markdownthemewitiko_markdown_defaults]
\unprotect
% \end{macrocode}
% \iffalse
-%</themes-witiko-markdown-defaults-context>
+%</themes-witiko-markdown-defaults-ctx>
%<*manual-options>
% \fi
% \begin{markdown}
@@ -22317,9 +22777,17 @@ local P, R, S, V, C, Cg, Cb, Cmt, Cc, Ct, B, Cs, Cp, any =
% `lunamark/util.lua` file in the Lunamark Lua module.
%
% \end{markdown}
+% \iffalse
+%</lua>
+%<*lua,lua-loader>
+% \fi
% \begin{macrocode}
local util = {}
% \end{macrocode}
+% \iffalse
+%</lua,lua-loader>
+%<*lua>
+% \fi
% \par
% \begin{markdown}
%
@@ -22334,13 +22802,17 @@ function util.err(msg, exit_code)
os.exit(exit_code or 1)
end
% \end{macrocode}
+% \iffalse
+%</lua>
+%<*lua,lua-loader>
+% \fi
% \par
% \begin{markdown}
%
-% The \luamdef{util.cache} method computes the digest of `string` and
-% `salt`, adds the `suffix` and looks into the directory `dir`, whether a
-% file with such a name exists. If it does not, it gets created with
-% `transform(string)` as its content. The filename is then returned.
+% The \luamdef{util.cache} method used `dir`, `string`, `salt`, and `suffix`
+% to determine a pathname. If a file with such a pathname does not exists,
+% it gets created with `transform(string)` as its content. Regardless, the
+% pathname is then returned.
%
% \end{markdown}
% \begin{macrocode}
@@ -22348,7 +22820,7 @@ function util.cache(dir, string, salt, transform, suffix)
local digest = md5.sumhexa(string .. (salt or ""))
local name = util.pathname(dir, digest .. suffix)
local file = io.open(name, "r")
- if file == nil then -- If no cache entry exists, then create a new one.
+ if file == nil then -- If no cache entry exists, create a new one.
file = assert(io.open(name, "w"),
[[Could not open file "]] .. name .. [[" for writing]])
local result = string
@@ -22361,6 +22833,10 @@ function util.cache(dir, string, salt, transform, suffix)
return name
end
% \end{macrocode}
+% \iffalse
+%</lua,lua-loader>
+%<*lua>
+% \fi
% \par
% \begin{markdown}
%
@@ -22559,7 +23035,7 @@ end
% Given a table `char_escapes` mapping escapable characters to escaped
% strings and optionally a table `string_escapes` mapping escapable strings
% to escaped strings, the \luamdef{util.escaper} method returns an escaper
-% function that escapes all occurances of escapable strings and characters (in
+% function that escapes all occurrences of escapable strings and characters (in
% this order).
%
% The method uses \pkg{LPeg}, which is faster than the Lua `string.gsub`
@@ -22588,7 +23064,7 @@ function util.escaper(char_escapes, string_escapes)
% \begin{markdown}
% If `string_escapes` is provided, turn `escapable` into the
% $$\sum^^B{(`k`, `v`)\in`string_escapes`}`P(k) / v` + `escapable`$$
-% capture that replaces any occurance of the string `k` with the string
+% capture that replaces any occurrence of the string `k` with the string
% `v` for each $(`k`, `v`)\in`string_escapes`$. Note that the pattern
% summation is not commutative and its operands are inspected in the
% summation order during the matching. As a corrolary, the strings always
@@ -22619,6 +23095,10 @@ function util.escaper(char_escapes, string_escapes)
end
end
% \end{macrocode}
+% \iffalse
+%</lua>
+%<*lua,lua-loader>
+% \fi
% \par
% \begin{markdown}
%
@@ -22638,6 +23118,43 @@ end
% \par
% \begin{markdown}
%
+% The \luamdef{util.salt} method produces cryptographic salt out of a table of
+% options `options`.
+%
+% \end{markdown}
+% \begin{macrocode}
+function util.salt(options)
+ local opt_string = {}
+ for k, _ in pairs(defaultOptions) do
+ local v = options[k]
+ if type(v) == "table" then
+ for _, i in ipairs(v) do
+ opt_string[#opt_string+1] = k .. "=" .. tostring(i)
+ end
+% \end{macrocode}
+% \begin{markdown}
+%
+% The \Opt{cacheDir} option is disregarded.
+%
+% \end{markdown}
+% \begin{macrocode}
+ elseif k ~= "cacheDir" then
+ opt_string[#opt_string+1] = k .. "=" .. tostring(v)
+ end
+ end
+ table.sort(opt_string)
+ local salt = table.concat(opt_string, ",")
+ .. "," .. metadata.version
+ return salt
+end
+% \end{macrocode}
+% \iffalse
+%</lua,lua-loader>
+%<*lua>
+% \fi
+% \par
+% \begin{markdown}
+%
%### HTML Entities
% This section documents the \acro{HTML} entities recognized by the
% markdown reader. These functions are encapsulated in the `entities`
@@ -24954,15 +25471,6 @@ function M.writer.new(options)
% \par
% \begin{markdown}
%
-% Define \luamdef{writer->suffix} as the suffix of the produced cache files.
-%
-% \end{markdown}
-% \begin{macrocode}
- self.suffix = ".tex"
-% \end{macrocode}
-% \par
-% \begin{markdown}
-%
% Define \luamdef{writer->space} as the output format of a space character.
%
% \end{markdown}
@@ -25007,19 +25515,6 @@ function M.writer.new(options)
% \par
% \begin{markdown}
%
-% Define \luamdef{writer->pack} as a function that will take the filename
-% `name` of the output file prepared by the reader and transform it to the
-% output format.
-%
-% \end{markdown}
-% \begin{macrocode}
- function self.pack(name)
- return [[\input{]] .. name .. [[}\relax]]
- end
-% \end{macrocode}
-% \par
-% \begin{markdown}
-%
% Define \luamdef{writer->interblocksep} as the output format of a block
% element separator.
%
@@ -25123,13 +25618,17 @@ function M.writer.new(options)
["{"] = "\\markdownRendererLeftBrace{}",
["}"] = "\\markdownRendererRightBrace{}",
["\\"] = "\\markdownRendererBackslash{}",
+ ["\r"] = " ",
+ ["\n"] = " ",
}
self.escaped_minimal_strings = {
- ["^^"] = "\\markdownRendererCircumflex\\markdownRendererCircumflex ",
+ ["^^"] = "\\markdownRendererCircumflex"
+ .. "\\markdownRendererCircumflex ",
["☒"] = "\\markdownRendererTickedBox{}",
["⌛"] = "\\markdownRendererHalfTickedBox{}",
["â˜"] = "\\markdownRendererUntickedBox{}",
- [entities.hex_entity('FFFD')] = "\\markdownRendererReplacementCharacter{}",
+ [entities.hex_entity('FFFD')]
+ = "\\markdownRendererReplacementCharacter{}",
}
% \end{macrocode}
% \par
@@ -25164,7 +25663,8 @@ function M.writer.new(options)
["^"] = "\\markdownRendererCircumflex{}",
["~"] = "\\markdownRendererTilde{}",
["|"] = "\\markdownRendererPipe{}",
- [entities.hex_entity('0000')] = "\\markdownRendererReplacementCharacter{}",
+ [entities.hex_entity('0000')]
+ = "\\markdownRendererReplacementCharacter{}",
}
% \end{macrocode}
% \par
@@ -25172,9 +25672,9 @@ function M.writer.new(options)
%
% Use the \luamref{writer->escaped_chars}, \luamref{writer->escaped_uri_chars},
% and \luamref{writer->escaped_minimal_strings} tables to create the
-% \luamdef{writer->escape_typographic_text},
-% \luamdef{writer->escape_programmatic_text}, and
-% \luamdef{writer->escape_minimal} escaper functions.
+% \luamdef{escape_typographic_text},
+% \luamdef{escape_programmatic_text}, and
+% \luamdef{escape_minimal} local escaper functions.
%
% \end{markdown}
% \begin{macrocode}
@@ -25226,6 +25726,30 @@ function M.writer.new(options)
% \par
% \begin{markdown}
%
+% Define \luamdef{writer->warning} as a function that will transform an input
+% warning `t` to the output format.
+%
+% \end{markdown}
+% \begin{macrocode}
+ function self.warning(t)
+ return {"\\markdownRendererWarning{", self.identifier(t), "}"}
+ end
+% \end{macrocode}
+% \par
+% \begin{markdown}
+%
+% Define \luamdef{writer->error} as a function that will transform an input
+% error `t` to the output format.
+%
+% \end{markdown}
+% \begin{macrocode}
+ function self.error(t)
+ return {"\\markdownRendererError{", self.identifier(t), "}"}
+ end
+% \end{macrocode}
+% \par
+% \begin{markdown}
+%
% Define \luamdef{writer->code} as a function that will transform an input
% inline code span `s` with optional attributes `attributes` to the output
% format.
@@ -25425,7 +25949,8 @@ function M.writer.new(options)
% \begin{macrocode}
function self.inline_html_tag(contents)
if self.flatten_inlines then return contents end
- return {"\\markdownRendererInlineHtmlTag{",self.string(contents),"}"}
+ return {"\\markdownRendererInlineHtmlTag{",
+ self.string(contents),"}"}
end
% \end{macrocode}
% \par
@@ -25716,8 +26241,10 @@ function M.writer.new(options)
% \begin{macrocode}
function self.push_attributes(attribute_type, attributes,
start_output, end_output)
- local attribute_type_level = self.attribute_type_levels[attribute_type]
- self.attribute_type_levels[attribute_type] = attribute_type_level + 1
+ local attribute_type_level
+ = self.attribute_type_levels[attribute_type]
+ self.attribute_type_levels[attribute_type]
+ = attribute_type_level + 1
-- index attributes in a hash table for easy lookup
attributes = attributes or {}
@@ -25772,8 +26299,10 @@ function M.writer.new(options)
local attributes, _, end_output
current_attribute_type, attributes, _, end_output = table.unpack(
self.active_attributes[#self.active_attributes])
- local attribute_type_level = self.attribute_type_levels[current_attribute_type]
- self.attribute_type_levels[current_attribute_type] = attribute_type_level - 1
+ local attribute_type_level
+ = self.attribute_type_levels[current_attribute_type]
+ self.attribute_type_levels[current_attribute_type]
+ = attribute_type_level - 1
if self.is_writing and end_output ~= nil then
table.insert(buf, end_output)
end
@@ -25807,7 +26336,8 @@ function M.writer.new(options)
local prev_space = false
local letter_found = false
local normalized_s = s
- if not options.unicodeNormalization or options.unicodeNormalizationForm ~= "nfc" then
+ if not options.unicodeNormalization
+ or options.unicodeNormalizationForm ~= "nfc" then
normalized_s = uni_algos.normalize.NFC(normalized_s)
end
@@ -25824,7 +26354,8 @@ function M.writer.new(options)
end
end
- -- Remove all non-alphanumeric characters, except underscores, hyphens, and periods.
+ -- Remove all non-alphanumeric characters, except underscores,
+ -- hyphens, and periods.
if not unicode.utf8.match(char, "[%w_%-%.%s]") then
goto continue
end
@@ -25852,7 +26383,8 @@ function M.writer.new(options)
table.remove(buffer)
end
- local identifier = #buffer == 0 and "section" or table.concat(buffer, "")
+ local identifier = #buffer == 0 and "section"
+ or table.concat(buffer, "")
return identifier
end
% \end{macrocode}
@@ -25867,7 +26399,8 @@ function M.writer.new(options)
local prev_space = false
local letter_found = false
local normalized_s = s
- if not options.unicodeNormalization or options.unicodeNormalizationForm ~= "nfc" then
+ if not options.unicodeNormalization
+ or options.unicodeNormalizationForm ~= "nfc" then
normalized_s = uni_algos.normalize.NFC(normalized_s)
end
@@ -25884,7 +26417,8 @@ function M.writer.new(options)
end
end
- -- Remove all non-alphanumeric characters, except underscores and hyphens.
+ -- Remove all non-alphanumeric characters, except underscores
+ -- and hyphens.
if not unicode.utf8.match(char, "[%w_%-%s]") then
prev_space = false
goto continue
@@ -25913,7 +26447,8 @@ function M.writer.new(options)
table.remove(buffer)
end
- local identifier = #buffer == 0 and "section" or table.concat(buffer, "")
+ local identifier = #buffer == 0 and "section"
+ or table.concat(buffer, "")
return identifier
end
% \end{macrocode}
@@ -25952,9 +26487,11 @@ function M.writer.new(options)
table.insert(auto_identifiers, create_auto_identifier(flat_text))
end
if self.options.gfmAutoIdentifiers then
- table.insert(auto_identifiers, create_gfm_auto_identifier(flat_text))
+ table.insert(auto_identifiers,
+ create_gfm_auto_identifier(flat_text))
end
- local normalized_attributes = normalize_attributes(attributes, auto_identifiers)
+ local normalized_attributes = normalize_attributes(attributes,
+ auto_identifiers)
-- push attributes for the new section
local start_output = {}
@@ -25970,7 +26507,8 @@ function M.writer.new(options)
-- render the heading and its attributes
if self.is_writing and #normalized_attributes > 0 then
- table.insert(buf, "\\markdownRendererHeaderAttributeContextBegin\n")
+ table.insert(buf,
+ "\\markdownRendererHeaderAttributeContextBegin\n")
table.insert(buf, self.attributes(normalized_attributes, false))
end
@@ -26143,34 +26681,91 @@ parsers.ascii_punctuation = S("!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~")
%
% \end{markdown}
% \begin{macrocode}
-parsers.punctuation = {}
-(function()
- local pathname = kpse.lookup("UnicodeData.txt")
+;(function()
+ local pathname = assert(kpse.find_file("UnicodeData.txt"),
+ [[Could not locate file "UnicodeData.txt"]])
local file = assert(io.open(pathname, "r"),
[[Could not open file "UnicodeData.txt"]])
+% \end{macrocode}
+% \par
+% \begin{markdown}
+%
+% In order to minimize the size and speed of the parser, we will first
+% construct a prefix tree of UTF-8 encodings for all codepoints of a
+% given code length.
+%
+% \end{markdown}
+% \begin{macrocode}
+ local prefix_trees = {}
for line in file:lines() do
local codepoint, major_category = line:match("^(%x+);[^;]*;(%a)")
if major_category == "P" or major_category == "S" then
local code = unicode.utf8.char(tonumber(codepoint, 16))
- if parsers.punctuation[#code] == nil then
- parsers.punctuation[#code] = parsers.fail
+ if prefix_trees[#code] == nil then
+ prefix_trees[#code] = {}
end
- local code_parser = parsers.succeed
+ local node = prefix_trees[#code]
for i = 1, #code do
local byte = code:sub(i, i)
- local byte_parser = S(byte)
- code_parser = code_parser
- * byte_parser
+ if i < #code then
+ if node[byte] == nil then
+ node[byte] = {}
+ end
+ node = node[byte]
+ else
+ table.insert(node, byte)
+ end
end
- parsers.punctuation[#code] = parsers.punctuation[#code]
- + code_parser
end
end
assert(file:close())
+% \end{macrocode}
+% \par
+% \begin{markdown}
+%
+% Next, we will construct a parser out of the prefix tree.
+%
+% \end{markdown}
+% \begin{macrocode}
+ local function depth_first_search(node, path, visit, leave)
+ visit(node, path)
+ for label, child in pairs(node) do
+ if type(child) == "table" then
+ depth_first_search(child, path .. label, visit, leave)
+ else
+ visit(child, path)
+ end
+ end
+ leave(node, path)
+ end
+
+ parsers.punctuation = {}
+ for length, prefix_tree in pairs(prefix_trees) do
+ local subparsers = {}
+ depth_first_search(prefix_tree, "", function(node, path)
+ if type(node) == "table" then
+ subparsers[path] = parsers.fail
+ else
+ assert(type(node) == "string")
+ subparsers[path] = subparsers[path] + S(node)
+ end
+ end, function(_, path)
+ if #path > 0 then
+ local byte = path:sub(#path, #path)
+ local parent_path = path:sub(1, #path-1)
+ subparsers[parent_path] = subparsers[parent_path]
+ + S(byte) * subparsers[path]
+ else
+ parsers.punctuation[length] = subparsers[path]
+ end
+ end)
+ assert(parsers.punctuation[length] ~= nil)
+ end
end)()
parsers.escapable = parsers.ascii_punctuation
-parsers.anyescaped = parsers.backslash / "" * parsers.escapable
+parsers.anyescaped = parsers.backslash / ""
+ * parsers.escapable
+ parsers.any
parsers.spacechar = S("\t ")
@@ -26189,14 +26784,18 @@ parsers.linechar = P(1 - parsers.newline)
parsers.blankline = parsers.optionalspace
* parsers.newline / "\n"
parsers.blanklines = parsers.blankline^0
-parsers.skipblanklines = (parsers.optionalspace * parsers.newline)^0
+parsers.skipblanklines = ( parsers.optionalspace
+ * parsers.newline)^0
parsers.indentedline = parsers.indent /""
- * C(parsers.linechar^1 * parsers.newline^-1)
+ * C( parsers.linechar^1
+ * parsers.newline^-1)
parsers.optionallyindentedline = parsers.indent^-1 /""
- * C(parsers.linechar^1 * parsers.newline^-1)
+ * C( parsers.linechar^1
+ * parsers.newline^-1)
parsers.sp = parsers.spacing^0
parsers.spnl = parsers.optionalspace
- * (parsers.newline * parsers.optionalspace)^-1
+ * ( parsers.newline
+ * parsers.optionalspace)^-1
parsers.line = parsers.linechar^0 * parsers.newline
parsers.nonemptyline = parsers.line - parsers.blankline
% \end{macrocode}
@@ -26279,7 +26878,8 @@ local function update_indent_table(indent_table, new_indent, add)
if add then
indent_table.indents[#indent_table.indents + 1] = new_indent
else
- if indent_table.indents[#indent_table.indents].name == new_indent.name then
+ if indent_table.indents[#indent_table.indents].name
+ == new_indent.name then
indent_table.indents[#indent_table.indents] = nil
end
end
@@ -26295,10 +26895,12 @@ end
% \end{markdown}
% \begin{macrocode}
local function remove_indent(name)
- local function remove_indent_level(s, i, indent_table) -- luacheck: ignore s i
- indent_table = update_indent_table(indent_table, {name=name}, false)
- return true, indent_table
- end
+ local remove_indent_level =
+ function(s, i, indent_table) -- luacheck: ignore s i
+ indent_table = update_indent_table(indent_table, {name=name},
+ false)
+ return true, indent_table
+ end
return Cg(Cmt(Cb("indent_info"), remove_indent_level), "indent_info")
end
@@ -26314,7 +26916,8 @@ end
%
% \end{markdown}
% \begin{macrocode}
-local function process_starter_spacing(indent, spacing, minimum, left_strip_length)
+local function process_starter_spacing(indent, spacing,
+ minimum, left_strip_length)
left_strip_length = left_strip_length or 0
local count = 0
@@ -26351,14 +26954,16 @@ local function process_starter_spacing(indent, spacing, minimum, left_strip_leng
minimum_remainder = minimum_remainder .. character
elseif (count >= minimum) then
minimum_found = true
- minimum_remainder = minimum_remainder .. string.rep(" ", count - minimum)
+ minimum_remainder = minimum_remainder
+ .. string.rep(" ", count - minimum)
end
if (code_started) then
code_start = code_start .. character
elseif (count >= minimum + 4) then
code_started = true
- code_start = code_start .. string.rep(" ", count - (minimum + 4))
+ code_start = code_start
+ .. string.rep(" ", count - (minimum + 4))
end
end
end
@@ -26425,7 +27030,8 @@ end
%
% \end{markdown}
% \begin{macrocode}
-local function process_starter_indent(_, _, indent_table, starter, is_blank, indent_type, breakable)
+local function process_starter_indent(_, _, indent_table, starter,
+ is_blank, indent_type, breakable)
local last_trail = starter[1]
local delimiter = starter[2]
local raw_new_trail = starter[3]
@@ -26453,11 +27059,13 @@ local function process_starter_indent(_, _, indent_table, starter, is_blank, ind
local last_trail_length = #last_trail
local delimiter_length = total_delimiter_length(delimiter)
- local total_indent_level = preceding_indentation + last_trail_length + delimiter_length
+ local total_indent_level = preceding_indentation + last_trail_length
+ + delimiter_length
local sp = {}
if not is_blank then
- sp = process_starter_spacing(total_indent_level, raw_new_trail, 0, 1)
+ sp = process_starter_spacing(total_indent_level, raw_new_trail,
+ 0, 1)
end
local del_trail_length = sp.left_total_stripped
@@ -26467,12 +27075,17 @@ local function process_starter_indent(_, _, indent_table, starter, is_blank, ind
del_trail_length = del_trail_length + #sp.remainder
end
- local indent_length = last_trail_length + delimiter_length + del_trail_length
+ local indent_length = last_trail_length + delimiter_length
+ + del_trail_length
local new_indent_info = {name=indent_type, length=indent_length}
- indent_table = update_indent_table(indent_table, new_indent_info, true)
- indent_table = add_trail(indent_table, {is_code=sp.is_code, remainder=sp.remainder, total_length=sp.total_length,
- full_remainder=sp.full_remainder})
+ indent_table = update_indent_table(indent_table, new_indent_info,
+ true)
+ indent_table = add_trail(indent_table,
+ {is_code=sp.is_code,
+ remainder=sp.remainder,
+ total_length=sp.total_length,
+ full_remainder=sp.full_remainder})
return true, indent_table
end
@@ -26490,7 +27103,8 @@ local function decode_pattern(name)
delimeter = parsers.more
end
- return C(parsers.optionalspace) * C(delimeter) * C(parsers.optionalspace) * Cp()
+ return C(parsers.optionalspace) * C(delimeter)
+ * C(parsers.optionalspace) * Cp()
end
% \end{macrocode}
@@ -26531,7 +27145,8 @@ end
%
% \end{markdown}
% \begin{macrocode}
-local function traverse_indent(s, i, indent_table, is_optional, is_blank, current_line_indents)
+local function traverse_indent(s, i, indent_table, is_optional,
+ is_blank, current_line_indents)
local new_index = i
local preceding_indentation = 0
@@ -26550,12 +27165,17 @@ local function traverse_indent(s, i, indent_table, is_optional, is_blank, curren
-- match decoded pattern
local new_indent_info = lpeg.match(Ct(pattern), s, new_index)
if new_indent_info == nil then
- local blankline_end = lpeg.match(Ct(parsers.blankline * Cg(Cp(), "pos")), s, new_index)
- if is_optional or not indent_table.ignore_blockquote_blank or not blankline_end then
- return is_optional, new_index, current_trail, current_line_indents
+ local blankline_end = lpeg.match(
+ Ct(parsers.blankline * Cg(Cp(), "pos")), s, new_index)
+ if is_optional or not indent_table.ignore_blockquote_blank
+ or not blankline_end then
+ return is_optional, new_index, current_trail,
+ current_line_indents
end
- return traverse_indent(s, tonumber(blankline_end.pos), indent_table, is_optional, is_blank, current_line_indents)
+ return traverse_indent(s, tonumber(blankline_end.pos),
+ indent_table, is_optional, is_blank,
+ current_line_indents)
end
local raw_last_trail = new_indent_info[1]
@@ -26568,13 +27188,15 @@ local function traverse_indent(s, i, indent_table, is_optional, is_blank, curren
-- check previous trail
if not space_only and next(current_trail) == nil then
local sp = process_starter_spacing(0, raw_last_trail, 0, 0)
- current_trail = {is_code=sp.is_code, remainder=sp.remainder, total_length=sp.total_length,
+ current_trail = {is_code=sp.is_code, remainder=sp.remainder,
+ total_length=sp.total_length,
full_remainder=sp.full_remainder}
end
if next(current_trail) ~= nil then
if not space_only and current_trail.is_code then
- return is_optional, new_index, current_trail, current_line_indents
+ return is_optional, new_index, current_trail,
+ current_line_indents
end
if current_trail.internal_remainder ~= nil then
raw_last_trail = current_trail.internal_remainder
@@ -26589,7 +27211,8 @@ local function traverse_indent(s, i, indent_table, is_optional, is_blank, curren
raw_last_trail_length = #raw_last_trail
end
- local total_indent_level = preceding_indentation + raw_last_trail_length + delimiter_length
+ local total_indent_level = preceding_indentation
+ + raw_last_trail_length + delimiter_length
local spacing_to_process
local minimum = 0
@@ -26603,13 +27226,17 @@ local function traverse_indent(s, i, indent_table, is_optional, is_blank, curren
minimum = value.length
end
- local sp = process_starter_spacing(total_indent_level, spacing_to_process, minimum, left_strip_length)
+ local sp = process_starter_spacing(total_indent_level,
+ spacing_to_process, minimum,
+ left_strip_length)
if space_only and not sp.is_minimum then
- return is_optional or (is_blank and blank_starter <= index), new_index, current_trail, current_line_indents
+ return is_optional or (is_blank and blank_starter <= index),
+ new_index, current_trail, current_line_indents
end
- local indent_length = raw_last_trail_length + delimiter_length + sp.left_total_stripped
+ local indent_length = raw_last_trail_length + delimiter_length
+ + sp.left_total_stripped
-- update info for the next pattern
if not space_only then
@@ -26618,8 +27245,10 @@ local function traverse_indent(s, i, indent_table, is_optional, is_blank, curren
preceding_indentation = preceding_indentation + value.length
end
- current_trail = {is_code=sp.is_code, remainder=sp.remainder, internal_remainder=sp.minimum_remainder,
- total_length=sp.total_length, full_remainder=sp.full_remainder}
+ current_trail = {is_code=sp.is_code, remainder=sp.remainder,
+ internal_remainder=sp.minimum_remainder,
+ total_length=sp.total_length,
+ full_remainder=sp.full_remainder}
current_line_indents[#current_line_indents + 1] = new_indent_info
new_index = next_index
@@ -26647,34 +27276,36 @@ end
%
% \end{markdown}
% \begin{macrocode}
-local function check_trail_joined(s, i, indent_table, spacing, expect_code, omit_remainder) -- luacheck: ignore s i
- local is_code
- local remainder
+local check_trail_joined =
+ function(s, i, indent_table, -- luacheck: ignore s i
+ spacing, expect_code, omit_remainder)
+ local is_code
+ local remainder
- if has_trail(indent_table) then
- local trail = indent_table.trail
- is_code = trail.is_code
- if is_code then
- remainder = trail.remainder
- else
- remainder = trail.full_remainder
- end
- else
- local sp = process_starter_spacing(0, spacing, 0, 0)
- is_code = sp.is_code
- if is_code then
- remainder = sp.remainder
+ if has_trail(indent_table) then
+ local trail = indent_table.trail
+ is_code = trail.is_code
+ if is_code then
+ remainder = trail.remainder
+ else
+ remainder = trail.full_remainder
+ end
else
- remainder = sp.full_remainder
+ local sp = process_starter_spacing(0, spacing, 0, 0)
+ is_code = sp.is_code
+ if is_code then
+ remainder = sp.remainder
+ else
+ remainder = sp.full_remainder
+ end
end
- end
- local result = check_trail(expect_code, is_code)
- if omit_remainder then
- return result
+ local result = check_trail(expect_code, is_code)
+ if omit_remainder then
+ return result
+ end
+ return result, remainder
end
- return result, remainder
-end
% \end{macrocode}
% \begin{markdown}
@@ -26683,22 +27314,24 @@ end
%
% \end{markdown}
% \begin{macrocode}
-local function check_trail_length(s, i, indent_table, spacing, min, max) -- luacheck: ignore s i
- local trail
+local check_trail_length =
+ function(s, i, indent_table, -- luacheck: ignore s i
+ spacing, min, max)
+ local trail
- if has_trail(indent_table) then
- trail = indent_table.trail
- else
- trail = process_starter_spacing(0, spacing, 0, 0)
- end
+ if has_trail(indent_table) then
+ trail = indent_table.trail
+ else
+ trail = process_starter_spacing(0, spacing, 0, 0)
+ end
- local total_length = trail.total_length
- if total_length == nil then
- return false
- end
+ local total_length = trail.total_length
+ if total_length == nil then
+ return false
+ end
- return min <= total_length and total_length <= max
-end
+ return min <= total_length and total_length <= max
+ end
% \end{macrocode}
% \begin{markdown}
@@ -26708,7 +27341,8 @@ end
%
% \end{markdown}
% \begin{macrocode}
-local function check_continuation_indentation(s, i, indent_table, is_optional, is_blank)
+local function check_continuation_indentation(s, i, indent_table,
+ is_optional, is_blank)
if not has_indents(indent_table) then
return true
end
@@ -26761,27 +27395,29 @@ end
%
% \end{markdown}
% \begin{macrocode}
-local function check_trail_type(s, i, trail, spacing, trail_type) -- luacheck: ignore s i
- if trail == nil then
- trail = process_starter_spacing(0, spacing, 0, 0)
- end
+local check_trail_type =
+ function(s, i, -- luacheck: ignore s i
+ trail, spacing, trail_type)
+ if trail == nil then
+ trail = process_starter_spacing(0, spacing, 0, 0)
+ end
- if trail_type == "non-code" then
- return check_trail(false, trail.is_code)
- end
- if trail_type == "code" then
- return check_trail(true, trail.is_code)
- end
- if trail_type == "full-code" then
- if (trail.is_code) then
- return i, trail.remainder
+ if trail_type == "non-code" then
+ return check_trail(false, trail.is_code)
+ end
+ if trail_type == "code" then
+ return check_trail(true, trail.is_code)
+ end
+ if trail_type == "full-code" then
+ if (trail.is_code) then
+ return i, trail.remainder
+ end
+ return i, ""
+ end
+ if trail_type == "full-any" then
+ return i, trail.internal_remainder
end
- return i, ""
- end
- if trail_type == "full-any" then
- return i, trail.internal_remainder
end
-end
% \end{macrocode}
% \begin{markdown}
@@ -26790,20 +27426,22 @@ end
%
% \end{markdown}
% \begin{macrocode}
-local function trail_freezing(s, i, indent_table, is_freezing) -- luacheck: ignore s i
- if is_freezing then
- if indent_table.is_trail_frozen then
- indent_table.trail = indent_table.frozen_trail
+local trail_freezing =
+ function(s, i, -- luacheck: ignore s i
+ indent_table, is_freezing)
+ if is_freezing then
+ if indent_table.is_trail_frozen then
+ indent_table.trail = indent_table.frozen_trail
+ else
+ indent_table.frozen_trail = indent_table.trail
+ indent_table.is_trail_frozen = true
+ end
else
- indent_table.frozen_trail = indent_table.trail
- indent_table.is_trail_frozen = true
+ indent_table.frozen_trail = nil
+ indent_table.is_trail_frozen = false
end
- else
- indent_table.frozen_trail = nil
- indent_table.is_trail_frozen = false
+ return true, indent_table
end
- return true, indent_table
-end
% \end{macrocode}
% \begin{markdown}
@@ -26814,53 +27452,59 @@ end
%
% \end{markdown}
% \begin{macrocode}
-local function check_continuation_indentation_and_trail(s, i, indent_table, is_optional, is_blank, trail_type,
- reset_rem, omit_remainder)
- if not has_indents(indent_table) then
- local spacing, new_index = lpeg.match(C(parsers.spacechar^0) * Cp(), s, i)
- local result, remainder = check_trail_type(s, i, indent_table.trail, spacing, trail_type)
- if remainder == nil then
+local check_continuation_indentation_and_trail =
+ function (s, i, indent_table, is_optional, is_blank, trail_type,
+ reset_rem, omit_remainder)
+ if not has_indents(indent_table) then
+ local spacing, new_index = lpeg.match( C(parsers.spacechar^0)
+ * Cp(), s, i)
+ local result, remainder = check_trail_type(s, i,
+ indent_table.trail, spacing, trail_type)
+ if remainder == nil then
+ if result then
+ return new_index
+ end
+ return false
+ end
if result then
- return new_index
+ return new_index, remainder
end
return false
end
- if result then
- return new_index, remainder
- end
- return false
- end
- local passes, new_index, current_trail = traverse_indent(s, i, indent_table, is_optional, is_blank)
+ local passes, new_index, current_trail = traverse_indent(s, i,
+ indent_table, is_optional, is_blank)
+
+ if passes then
+ local spacing
+ if current_trail == nil then
+ local newer_spacing, newer_index = lpeg.match(
+ C(parsers.spacechar^0) * Cp(), s, i)
+ current_trail = process_starter_spacing(0, newer_spacing, 0, 0)
+ new_index = newer_index
+ spacing = newer_spacing
+ else
+ spacing = current_trail.remainder
+ end
+ local result, remainder = check_trail_type(s, new_index,
+ current_trail, spacing, trail_type)
+ if remainder == nil or omit_remainder then
+ if result then
+ return new_index
+ end
+ return false
+ end
- if passes then
- local spacing
- if current_trail == nil then
- local newer_spacing, newer_index = lpeg.match(C(parsers.spacechar^0) * Cp(), s, i)
- current_trail = process_starter_spacing(0, newer_spacing, 0, 0)
- new_index = newer_index
- spacing = newer_spacing
- else
- spacing = current_trail.remainder
- end
- local result, remainder = check_trail_type(s, new_index, current_trail, spacing, trail_type)
- if remainder == nil or omit_remainder then
+ if is_blank and reset_rem then
+ remainder = remove_remainder_if_blank(indent_table, remainder)
+ end
if result then
- return new_index
+ return new_index, remainder
end
return false
end
-
- if is_blank and reset_rem then
- remainder = remove_remainder_if_blank(indent_table, remainder)
- end
- if result then
- return new_index, remainder
- end
return false
end
- return false
-end
% \end{macrocode}
% \begin{markdown}
@@ -26869,14 +27513,20 @@ end
%
% \end{markdown}
% \begin{macrocode}
-parsers.check_trail = Cmt(Cb("indent_info") * C(parsers.spacechar^0) * Cc(false), check_trail_joined)
+parsers.check_trail = Cmt( Cb("indent_info") * C(parsers.spacechar^0)
+ * Cc(false), check_trail_joined)
-parsers.check_trail_no_rem = Cmt(Cb("indent_info") * C(parsers.spacechar^0) * Cc(false) * Cc(true), check_trail_joined)
+parsers.check_trail_no_rem = Cmt( Cb("indent_info")
+ * C(parsers.spacechar^0) * Cc(false)
+ * Cc(true), check_trail_joined)
-parsers.check_code_trail = Cmt(Cb("indent_info") * C(parsers.spacechar^0) * Cc(true), check_trail_joined)
+parsers.check_code_trail = Cmt( Cb("indent_info")
+ * C(parsers.spacechar^0)
+ * Cc(true), check_trail_joined)
parsers.check_trail_length_range = function(min, max)
- return Cmt(Cb("indent_info") * C(parsers.spacechar^0) * Cc(min) * Cc(max), check_trail_length)
+ return Cmt( Cb("indent_info") * C(parsers.spacechar^0) * Cc(min)
+ * Cc(max), check_trail_length)
end
parsers.check_trail_length = function(n)
@@ -26891,9 +27541,11 @@ end
%
% \end{markdown}
% \begin{macrocode}
-parsers.freeze_trail = Cg(Cmt(Cb("indent_info") * Cc(true), trail_freezing), "indent_info")
+parsers.freeze_trail = Cg( Cmt(Cb("indent_info")
+ * Cc(true), trail_freezing), "indent_info")
-parsers.unfreeze_trail = Cg(Cmt(Cb("indent_info") * Cc(false), trail_freezing), "indent_info")
+parsers.unfreeze_trail = Cg(Cmt(Cb("indent_info") * Cc(false),
+ trail_freezing), "indent_info")
% \end{macrocode}
% \begin{markdown}
@@ -26902,11 +27554,16 @@ parsers.unfreeze_trail = Cg(Cmt(Cb("indent_info") * Cc(false), trail_freezing),
%
% \end{markdown}
% \begin{macrocode}
-parsers.check_minimal_indent = Cmt(Cb("indent_info") * Cc(false), check_continuation_indentation)
+parsers.check_minimal_indent = Cmt(Cb("indent_info") * Cc(false),
+ check_continuation_indentation)
-parsers.check_optional_indent = Cmt(Cb("indent_info") * Cc(true), check_continuation_indentation)
+parsers.check_optional_indent = Cmt(Cb("indent_info") * Cc(true),
+ check_continuation_indentation)
-parsers.check_minimal_blank_indent = Cmt(Cb("indent_info") * Cc(false) * Cc(true), check_continuation_indentation)
+parsers.check_minimal_blank_indent
+ = Cmt( Cb("indent_info") * Cc(false)
+ * Cc(true)
+ , check_continuation_indentation)
% \end{macrocode}
% \begin{markdown}
@@ -26917,37 +27574,45 @@ parsers.check_minimal_blank_indent = Cmt(Cb("indent_info") * Cc(false) * Cc(true
% \end{markdown}
% \begin{macrocode}
-parsers.check_minimal_indent_and_trail = Cmt( Cb("indent_info")
- * Cc(false) * Cc(false) * Cc("non-code") * Cc(true),
- check_continuation_indentation_and_trail)
+parsers.check_minimal_indent_and_trail =
+ Cmt( Cb("indent_info")
+ * Cc(false) * Cc(false) * Cc("non-code") * Cc(true)
+ , check_continuation_indentation_and_trail)
-parsers.check_minimal_indent_and_code_trail = Cmt( Cb("indent_info")
- * Cc(false) * Cc(false) * Cc("code") * Cc(false),
- check_continuation_indentation_and_trail)
+parsers.check_minimal_indent_and_code_trail =
+ Cmt( Cb("indent_info")
+ * Cc(false) * Cc(false) * Cc("code") * Cc(false)
+ , check_continuation_indentation_and_trail)
-parsers.check_minimal_blank_indent_and_full_code_trail = Cmt( Cb("indent_info")
- * Cc(false) * Cc(true) * Cc("full-code") * Cc(true),
- check_continuation_indentation_and_trail)
+parsers.check_minimal_blank_indent_and_full_code_trail =
+ Cmt( Cb("indent_info")
+ * Cc(false) * Cc(true) * Cc("full-code") * Cc(true)
+ , check_continuation_indentation_and_trail)
-parsers.check_minimal_indent_and_any_trail = Cmt( Cb("indent_info")
- * Cc(false) * Cc(false) * Cc("full-any") * Cc(true) * Cc(false),
- check_continuation_indentation_and_trail)
+parsers.check_minimal_indent_and_any_trail =
+ Cmt( Cb("indent_info")
+ * Cc(false) * Cc(false) * Cc("full-any") * Cc(true) * Cc(false)
+ , check_continuation_indentation_and_trail)
-parsers.check_minimal_blank_indent_and_any_trail = Cmt( Cb("indent_info")
- * Cc(false) * Cc(true) * Cc("full-any") * Cc(true) * Cc(false),
- check_continuation_indentation_and_trail)
+parsers.check_minimal_blank_indent_and_any_trail =
+ Cmt( Cb("indent_info")
+ * Cc(false) * Cc(true) * Cc("full-any") * Cc(true) * Cc(false)
+ , check_continuation_indentation_and_trail)
-parsers.check_minimal_blank_indent_and_any_trail_no_rem = Cmt( Cb("indent_info")
- * Cc(false) * Cc(true) * Cc("full-any") * Cc(true) * Cc(true),
- check_continuation_indentation_and_trail)
+parsers.check_minimal_blank_indent_and_any_trail_no_rem =
+ Cmt( Cb("indent_info")
+ * Cc(false) * Cc(true) * Cc("full-any") * Cc(true) * Cc(true)
+ , check_continuation_indentation_and_trail)
-parsers.check_optional_indent_and_any_trail = Cmt( Cb("indent_info")
- * Cc(true) * Cc(false) * Cc("full-any") * Cc(true) * Cc(false),
- check_continuation_indentation_and_trail)
+parsers.check_optional_indent_and_any_trail =
+ Cmt( Cb("indent_info")
+ * Cc(true) * Cc(false) * Cc("full-any") * Cc(true) * Cc(false)
+ , check_continuation_indentation_and_trail)
-parsers.check_optional_blank_indent_and_any_trail = Cmt( Cb("indent_info")
- * Cc(true) * Cc(true) * Cc("full-any") * Cc(true) * Cc(false),
- check_continuation_indentation_and_trail)
+parsers.check_optional_blank_indent_and_any_trail =
+ Cmt( Cb("indent_info")
+ * Cc(true) * Cc(true) * Cc("full-any") * Cc(true) * Cc(false)
+ , check_continuation_indentation_and_trail)
% \end{macrocode}
% \begin{markdown}
@@ -26958,7 +27623,8 @@ parsers.check_optional_blank_indent_and_any_trail = Cmt( Cb("indent_info")
% \begin{macrocode}
parsers.spnlc_noexc = parsers.optionalspace
- * (parsers.newline * parsers.check_minimal_indent_and_any_trail)^-1
+ * ( parsers.newline
+ * parsers.check_minimal_indent_and_any_trail)^-1
parsers.spnlc = parsers.optionalspace
* (V("EndlineNoSub"))^-1
@@ -26966,7 +27632,8 @@ parsers.spnlc = parsers.optionalspace
parsers.spnlc_sep = parsers.optionalspace * V("EndlineNoSub")
+ parsers.spacechar^1
-parsers.only_blank = parsers.spacechar^0 * (parsers.newline + parsers.eof)
+parsers.only_blank = parsers.spacechar^0
+ * (parsers.newline + parsers.eof)
% \end{macrocode}
% \begin{figure}
@@ -27013,64 +27680,66 @@ parsers.commented_line_letter = parsers.linechar
+ parsers.newline
- parsers.backslash
- parsers.percent
-parsers.commented_line = Cg(Cc(""), "backslashes")
- * ((#(parsers.commented_line_letter
- - parsers.newline)
- * Cb("backslashes")
- * Cs(parsers.commented_line_letter
- - parsers.newline)^1 -- initial
- * Cg(Cc(""), "backslashes"))
- + #(parsers.backslash * parsers.backslash)
- * Cg((parsers.backslash -- even backslash
- * parsers.backslash)^1, "backslashes")
- + (parsers.backslash
- * (#parsers.percent
- * Cb("backslashes")
- / function(backslashes)
- return string.rep("\\", #backslashes / 2)
- end
- * C(parsers.percent)
- + #parsers.commented_line_letter
- * Cb("backslashes")
- * Cc("\\")
- * C(parsers.commented_line_letter))
- * Cg(Cc(""), "backslashes")))^0
- * (#parsers.percent
- * Cb("backslashes")
- / function(backslashes)
- return string.rep("\\", #backslashes / 2)
- end
- * ((parsers.percent -- comment
- * parsers.line
- * #parsers.blankline) -- blank line
- / "\n"
- + parsers.percent -- comment
- * parsers.line
- * parsers.optionalspace) -- leading tabs and spaces
- + #(parsers.newline)
- * Cb("backslashes")
- * C(parsers.newline))
-
-parsers.chunk = parsers.line * (parsers.optionallyindentedline
- - parsers.blankline)^0
-
-parsers.attribute_key_char = parsers.alphanumeric + S("-_:.")
-parsers.attribute_raw_char = parsers.alphanumeric + S("-_")
-parsers.attribute_key = (parsers.attribute_key_char
- - parsers.dash - parsers.digit)
- * parsers.attribute_key_char^0
-parsers.attribute_value = ( (parsers.dquote / "")
- * (parsers.anyescaped - parsers.dquote)^0
- * (parsers.dquote / ""))
- + ( (parsers.squote / "")
- * (parsers.anyescaped - parsers.squote)^0
- * (parsers.squote / ""))
- + ( parsers.anyescaped - parsers.dquote - parsers.rbrace
- - parsers.space)^0
-parsers.attribute_identifier = parsers.attribute_key_char^1
-parsers.attribute_classname = parsers.letter
- * parsers.attribute_key_char^0
-parsers.attribute_raw = parsers.attribute_raw_char^1
+parsers.commented_line = Cg(Cc(""), "backslashes")
+ * ((#(parsers.commented_line_letter
+ - parsers.newline)
+ * Cb("backslashes")
+ * Cs(parsers.commented_line_letter
+ - parsers.newline)^1 -- initial
+ * Cg(Cc(""), "backslashes"))
+ + #(parsers.backslash * parsers.backslash)
+ * Cg((parsers.backslash -- even backslash
+ * parsers.backslash)^1, "backslashes")
+ + (parsers.backslash
+ * (#parsers.percent
+ * Cb("backslashes")
+ / function(backslashes)
+ return string.rep("\\", #backslashes / 2)
+ end
+ * C(parsers.percent)
+ + #parsers.commented_line_letter
+ * Cb("backslashes")
+ * Cc("\\")
+ * C(parsers.commented_line_letter))
+ * Cg(Cc(""), "backslashes")))^0
+ * (#parsers.percent
+ * Cb("backslashes")
+ / function(backslashes)
+ return string.rep("\\", #backslashes / 2)
+ end
+ * ((parsers.percent -- comment
+ * parsers.line
+ * #parsers.blankline) -- blank line
+ / "\n"
+ + parsers.percent -- comment
+ * parsers.line
+ * parsers.optionalspace) -- leading spaces
+ + #(parsers.newline)
+ * Cb("backslashes")
+ * C(parsers.newline))
+
+parsers.chunk = parsers.line * (parsers.optionallyindentedline
+ - parsers.blankline)^0
+
+parsers.attribute_key_char = parsers.alphanumeric + S("-_:.")
+parsers.attribute_raw_char = parsers.alphanumeric + S("-_")
+parsers.attribute_key = (parsers.attribute_key_char
+ - parsers.dash - parsers.digit)
+ * parsers.attribute_key_char^0
+parsers.attribute_value = ( (parsers.dquote / "")
+ * (parsers.anyescaped - parsers.dquote)^0
+ * (parsers.dquote / ""))
+ + ( (parsers.squote / "")
+ * (parsers.anyescaped - parsers.squote)^0
+ * (parsers.squote / ""))
+ + ( parsers.anyescaped
+ - parsers.dquote
+ - parsers.rbrace
+ - parsers.space)^0
+parsers.attribute_identifier = parsers.attribute_key_char^1
+parsers.attribute_classname = parsers.letter
+ * parsers.attribute_key_char^0
+parsers.attribute_raw = parsers.attribute_raw_char^1
parsers.attribute = (parsers.dash * Cc(".unnumbered"))
+ C( parsers.hash
@@ -27078,7 +27747,9 @@ parsers.attribute = (parsers.dash * Cc(".unnumbered"))
+ C( parsers.period
* parsers.attribute_classname)
+ Cs( parsers.attribute_key
- * parsers.optionalspace * parsers.equal * parsers.optionalspace
+ * parsers.optionalspace
+ * parsers.equal
+ * parsers.optionalspace
* parsers.attribute_value)
parsers.attributes = parsers.lbrace
* parsers.optionalspace
@@ -27088,7 +27759,6 @@ parsers.attributes = parsers.lbrace
* parsers.optionalspace
* parsers.rbrace
-
parsers.raw_attribute = parsers.lbrace
* parsers.optionalspace
* parsers.equal
@@ -27100,7 +27770,10 @@ parsers.raw_attribute = parsers.lbrace
-- indented blocks with first line indented.
parsers.indented_blocks = function(bl)
return Cs( bl
- * (parsers.blankline^1 * parsers.indent * -parsers.blankline * bl)^0
+ * ( parsers.blankline^1
+ * parsers.indent
+ * -parsers.blankline
+ * bl)^0
* (parsers.blankline^1 + parsers.eof) )
end
% \end{macrocode}
@@ -27116,15 +27789,18 @@ local function repeat_between(pattern, min, max)
end
parsers.hexentity = parsers.ampersand * parsers.hash * C(S("Xx"))
- * C(repeat_between(parsers.hexdigit, 1, 6)) * parsers.semicolon
+ * C(repeat_between(parsers.hexdigit, 1, 6))
+ * parsers.semicolon
parsers.decentity = parsers.ampersand * parsers.hash
- * C(repeat_between(parsers.digit, 1, 7)) * parsers.semicolon
+ * C(repeat_between(parsers.digit, 1, 7))
+ * parsers.semicolon
parsers.tagentity = parsers.ampersand * C(parsers.alphanumeric^1)
* parsers.semicolon
-parsers.html_entities = parsers.hexentity / entities.hex_entity_with_x_char
- + parsers.decentity / entities.dec_entity
- + parsers.tagentity / entities.char_entity
+parsers.html_entities
+ = parsers.hexentity / entities.hex_entity_with_x_char
+ + parsers.decentity / entities.dec_entity
+ + parsers.tagentity / entities.char_entity
% \end{macrocode}
% \par
% \begin{markdown}
@@ -27138,7 +27814,8 @@ parsers.bullet = function(bullet_char, interrupting)
if interrupting then
allowed_end = C(parsers.spacechar^1) * #parsers.linechar
else
- allowed_end = C(parsers.spacechar^1) + #(parsers.newline + parsers.eof)
+ allowed_end = C(parsers.spacechar^1)
+ + #(parsers.newline + parsers.eof)
end
return parsers.check_trail
* Ct(C(bullet_char) * Cc(""))
@@ -27196,7 +27873,8 @@ parsers.inticks = parsers.openticks
%
% \end{markdown}
% \begin{macrocode}
--- case-insensitive match (we assume s is lowercase). must be single byte encoding
+-- case-insensitive match (we assume s is lowercase)
+-- must be single byte encoding
parsers.keyword_exact = function(s)
local parser = P(0)
for i=1,#s do
@@ -27278,13 +27956,14 @@ parsers.block_keyword =
parsers.keyword_exact("ul")
-- end conditions
-parsers.html_blankline_end_condition = parsers.linechar^0
- * ( parsers.newline
- * (parsers.check_minimal_blank_indent_and_any_trail
- * #parsers.blankline
- + parsers.check_minimal_indent_and_any_trail)
- * parsers.linechar^1)^0
- * (parsers.newline^-1 / "")
+parsers.html_blankline_end_condition
+ = parsers.linechar^0
+ * ( parsers.newline
+ * (parsers.check_minimal_blank_indent_and_any_trail
+ * #parsers.blankline
+ + parsers.check_minimal_indent_and_any_trail)
+ * parsers.linechar^1)^0
+ * (parsers.newline^-1 / "")
local function remove_trailing_blank_lines(s)
return s:gsub("[\n\r]+%s*$", "")
@@ -27306,9 +27985,14 @@ parsers.html_attribute_spacing = parsers.optionalspace
* parsers.optionalspace
+ parsers.spacechar^1
-parsers.html_attribute_name = (parsers.letter + parsers.colon + parsers.underscore)
- * (parsers.alphanumeric + parsers.colon + parsers.underscore
- + parsers.period + parsers.dash)^0
+parsers.html_attribute_name = ( parsers.letter
+ + parsers.colon
+ + parsers.underscore)
+ * ( parsers.alphanumeric
+ + parsers.colon
+ + parsers.underscore
+ + parsers.period
+ + parsers.dash)^0
parsers.html_attribute_value = parsers.squote
* (parsers.linechar - parsers.squote)^0
@@ -27316,9 +28000,15 @@ parsers.html_attribute_value = parsers.squote
+ parsers.dquote
* (parsers.linechar - parsers.dquote)^0
* parsers.dquote
- + ( parsers.any - parsers.spacechar - parsers.newline
- - parsers.dquote - parsers.squote - parsers.backtick
- - parsers.equal - parsers.less - parsers.more)^1
+ + ( parsers.any
+ - parsers.spacechar
+ - parsers.newline
+ - parsers.dquote
+ - parsers.squote
+ - parsers.backtick
+ - parsers.equal
+ - parsers.less
+ - parsers.more)^1
parsers.html_inline_attribute_value = parsers.squote
* (V("NoSoftLineBreakEndline")
@@ -27332,30 +28022,41 @@ parsers.html_inline_attribute_value = parsers.squote
- parsers.blankline^2
- parsers.dquote)^0
* parsers.dquote
- + (parsers.any - parsers.spacechar - parsers.newline
- - parsers.dquote - parsers.squote - parsers.backtick
- - parsers.equal - parsers.less - parsers.more)^1
-
-parsers.html_attribute_value_specification = parsers.optionalspace
- * parsers.equal
- * parsers.optionalspace
- * parsers.html_attribute_value
+ + (parsers.any
+ - parsers.spacechar
+ - parsers.newline
+ - parsers.dquote
+ - parsers.squote
+ - parsers.backtick
+ - parsers.equal
+ - parsers.less
+ - parsers.more)^1
+
+parsers.html_attribute_value_specification
+ = parsers.optionalspace
+ * parsers.equal
+ * parsers.optionalspace
+ * parsers.html_attribute_value
parsers.html_spnl = parsers.optionalspace
- * (V("NoSoftLineBreakEndline") * parsers.optionalspace)^-1
+ * (V("NoSoftLineBreakEndline")
+ * parsers.optionalspace)^-1
-parsers.html_inline_attribute_value_specification = parsers.html_spnl
- * parsers.equal
- * parsers.html_spnl
- * parsers.html_inline_attribute_value
+parsers.html_inline_attribute_value_specification
+ = parsers.html_spnl
+ * parsers.equal
+ * parsers.html_spnl
+ * parsers.html_inline_attribute_value
-parsers.html_attribute = parsers.html_attribute_spacing
- * parsers.html_attribute_name
- * parsers.html_inline_attribute_value_specification^-1
+parsers.html_attribute
+ = parsers.html_attribute_spacing
+ * parsers.html_attribute_name
+ * parsers.html_inline_attribute_value_specification^-1
-parsers.html_non_newline_attribute = parsers.spacechar^1
- * parsers.html_attribute_name
- * parsers.html_attribute_value_specification^-1
+parsers.html_non_newline_attribute
+ = parsers.spacechar^1
+ * parsers.html_attribute_name
+ * parsers.html_attribute_value_specification^-1
parsers.nested_breaking_blank = parsers.newline
* parsers.check_minimal_blank_indent
@@ -27365,49 +28066,59 @@ parsers.html_comment_start = P("<!--")
parsers.html_comment_end = P("-->")
-parsers.html_comment = Cs( parsers.html_comment_start
- * parsers.html_until_end(parsers.html_comment_end))
+parsers.html_comment
+ = Cs( parsers.html_comment_start
+ * parsers.html_until_end(parsers.html_comment_end))
parsers.html_inline_comment = (parsers.html_comment_start / "")
* -P(">") * -P("->")
- * Cs((V("NoSoftLineBreakEndline") + parsers.any
- - parsers.nested_breaking_blank - parsers.html_comment_end)^0)
+ * Cs(( V("NoSoftLineBreakEndline")
+ + parsers.any
+ - parsers.nested_breaking_blank
+ - parsers.html_comment_end)^0)
* (parsers.html_comment_end / "")
parsers.html_cdatasection_start = P("<![CDATA[")
parsers.html_cdatasection_end = P("]]>")
-parsers.html_cdatasection = Cs( parsers.html_cdatasection_start
- * parsers.html_until_end(parsers.html_cdatasection_end))
+parsers.html_cdatasection
+ = Cs( parsers.html_cdatasection_start
+ * parsers.html_until_end(parsers.html_cdatasection_end))
-parsers.html_inline_cdatasection = parsers.html_cdatasection_start
- * Cs(V("NoSoftLineBreakEndline") + parsers.any
- - parsers.nested_breaking_blank - parsers.html_cdatasection_end)^0
- * parsers.html_cdatasection_end
+parsers.html_inline_cdatasection
+ = parsers.html_cdatasection_start
+ * Cs(V("NoSoftLineBreakEndline") + parsers.any
+ - parsers.nested_breaking_blank - parsers.html_cdatasection_end)^0
+ * parsers.html_cdatasection_end
parsers.html_declaration_start = P("<!") * parsers.letter
parsers.html_declaration_end = P(">")
-parsers.html_declaration = Cs( parsers.html_declaration_start
- * parsers.html_until_end(parsers.html_declaration_end))
+parsers.html_declaration
+ = Cs( parsers.html_declaration_start
+ * parsers.html_until_end(parsers.html_declaration_end))
-parsers.html_inline_declaration = parsers.html_declaration_start
- * Cs(V("NoSoftLineBreakEndline") + parsers.any
- - parsers.nested_breaking_blank - parsers.html_declaration_end)^0
- * parsers.html_declaration_end
+parsers.html_inline_declaration
+ = parsers.html_declaration_start
+ * Cs(V("NoSoftLineBreakEndline") + parsers.any
+ - parsers.nested_breaking_blank - parsers.html_declaration_end)^0
+ * parsers.html_declaration_end
parsers.html_instruction_start = P("<?")
parsers.html_instruction_end = P("?>")
-parsers.html_instruction = Cs( parsers.html_instruction_start
- * parsers.html_until_end(parsers.html_instruction_end))
+parsers.html_instruction
+ = Cs( parsers.html_instruction_start
+ * parsers.html_until_end(parsers.html_instruction_end))
parsers.html_inline_instruction = parsers.html_instruction_start
- * Cs(V("NoSoftLineBreakEndline") + parsers.any
- - parsers.nested_breaking_blank - parsers.html_instruction_end)^0
+ * Cs( V("NoSoftLineBreakEndline")
+ + parsers.any
+ - parsers.nested_breaking_blank
+ - parsers.html_instruction_end)^0
* parsers.html_instruction_end
parsers.html_blankline = parsers.newline
@@ -27453,25 +28164,28 @@ parsers.incomplete_tag_following = parsers.spacechar
+ parsers.slash * parsers.more
+ #(parsers.newline + parsers.eof)
-parsers.incomplete_special_tag_following = parsers.spacechar
- + parsers.more
- + #(parsers.newline + parsers.eof)
+parsers.incomplete_special_tag_following = parsers.spacechar
+ + parsers.more
+ + #( parsers.newline
+ + parsers.eof)
parsers.html_incomplete_open_tag = parsers.html_tag_start
* parsers.block_keyword
* parsers.incomplete_tag_following
-parsers.html_incomplete_open_special_tag = parsers.html_tag_start
- * parsers.special_block_keyword
- * parsers.incomplete_special_tag_following
+parsers.html_incomplete_open_special_tag
+ = parsers.html_tag_start
+ * parsers.special_block_keyword
+ * parsers.incomplete_special_tag_following
parsers.html_incomplete_close_tag = parsers.html_tag_closing_start
* parsers.block_keyword
* parsers.incomplete_tag_following
-parsers.html_incomplete_close_special_tag = parsers.html_tag_closing_start
- * parsers.special_block_keyword
- * parsers.incomplete_tag_following
+parsers.html_incomplete_close_special_tag
+ = parsers.html_tag_closing_start
+ * parsers.special_block_keyword
+ * parsers.incomplete_tag_following
-- closing tags
parsers.html_close_tag = parsers.html_tag_closing_start
@@ -27509,27 +28223,33 @@ parsers.html_empty_special_tag = parsers.html_tag_start
* parsers.html_attribute^0
* parsers.html_empty_tag_end
-parsers.html_incomplete_blocks = parsers.html_incomplete_open_tag
- + parsers.html_incomplete_open_special_tag
- + parsers.html_incomplete_close_tag
+parsers.html_incomplete_blocks
+ = parsers.html_incomplete_open_tag
+ + parsers.html_incomplete_open_special_tag
+ + parsers.html_incomplete_close_tag
-- parse special html blocks
-parsers.html_blankline_ending_special_block_opening = (parsers.html_close_special_tag
- + parsers.html_empty_special_tag)
- * #(parsers.optionalspace
- * (parsers.newline + parsers.eof))
+parsers.html_blankline_ending_special_block_opening
+ = ( parsers.html_close_special_tag
+ + parsers.html_empty_special_tag)
+ * #( parsers.optionalspace
+ * (parsers.newline + parsers.eof))
-parsers.html_blankline_ending_special_block = parsers.html_blankline_ending_special_block_opening
- * parsers.html_blankline_end_condition
+parsers.html_blankline_ending_special_block
+ = parsers.html_blankline_ending_special_block_opening
+ * parsers.html_blankline_end_condition
-parsers.html_special_block_opening = parsers.html_incomplete_open_special_tag
- - parsers.html_empty_special_tag
+parsers.html_special_block_opening
+ = parsers.html_incomplete_open_special_tag
+ - parsers.html_empty_special_tag
-parsers.html_closing_special_block = parsers.html_special_block_opening
- * parsers.html_until_end(parsers.html_close_special_tag)
+parsers.html_closing_special_block
+ = parsers.html_special_block_opening
+ * parsers.html_until_end(parsers.html_close_special_tag)
-parsers.html_special_block = parsers.html_blankline_ending_special_block
- + parsers.html_closing_special_block
+parsers.html_special_block
+ = parsers.html_blankline_ending_special_block
+ + parsers.html_closing_special_block
-- parse html blocks
parsers.html_block_opening = parsers.html_incomplete_open_tag
@@ -27539,18 +28259,21 @@ parsers.html_block = parsers.html_block_opening
* parsers.html_blankline_end_condition
-- parse any html blocks
-parsers.html_any_block_opening = (parsers.html_any_open_tag
- + parsers.html_any_close_tag
- + parsers.html_any_empty_tag)
- * #(parsers.optionalspace * (parsers.newline + parsers.eof))
+parsers.html_any_block_opening
+ = ( parsers.html_any_open_tag
+ + parsers.html_any_close_tag
+ + parsers.html_any_empty_tag)
+ * #(parsers.optionalspace * (parsers.newline + parsers.eof))
parsers.html_any_block = parsers.html_any_block_opening
* parsers.html_blankline_end_condition
parsers.html_inline_comment_full = parsers.html_comment_start
* -P(">") * -P("->")
- * Cs((V("NoSoftLineBreakEndline") + parsers.any - P("--")
- - parsers.nested_breaking_blank - parsers.html_comment_end)^0)
+ * Cs(( V("NoSoftLineBreakEndline")
+ + parsers.any - P("--")
+ - parsers.nested_breaking_blank
+ - parsers.html_comment_end)^0)
* parsers.html_comment_end
parsers.html_inline_tags = parsers.html_inline_comment_full
@@ -27583,21 +28306,25 @@ parsers.auto_link_scheme = parsers.letter
* parsers.auto_link_scheme_part^-30
parsers.absolute_uri = parsers.auto_link_scheme * parsers.colon
- * (parsers.any - parsers.spacing - parsers.less - parsers.more)^0
+ * ( parsers.any - parsers.spacing
+ - parsers.less - parsers.more)^0
parsers.printable_characters = S(".!#$%&'*+/=?^_`{|}~-")
parsers.email_address_local_part_char = parsers.alphanumeric
+ parsers.printable_characters
-parsers.email_address_local_part = parsers.email_address_local_part_char^1
+parsers.email_address_local_part
+ = parsers.email_address_local_part_char^1
parsers.email_address_dns_label = parsers.alphanumeric
- * (parsers.alphanumeric + parsers.dash)^-62
+ * ( parsers.alphanumeric
+ + parsers.dash)^-62
* B(parsers.alphanumeric)
parsers.email_address_domain = parsers.email_address_dns_label
- * (parsers.period * parsers.email_address_dns_label)^0
+ * ( parsers.period
+ * parsers.email_address_dns_label)^0
parsers.email_address = parsers.email_address_local_part
* parsers.at
@@ -27653,26 +28380,40 @@ parsers.link_text = parsers.lbracket
+ parsers.autolink
+ V("InlineHtml")
+ ( parsers.backslash * parsers.backslash)
- + ( parsers.backslash * (parsers.lbracket + parsers.rbracket)
+ + ( parsers.backslash
+ * ( parsers.lbracket
+ + parsers.rbracket)
+ V("NoSoftLineBreakSpace")
+ V("NoSoftLineBreakEndline")
+ (parsers.any
- - (parsers.newline + parsers.lbracket + parsers.rbracket + parsers.blankline^2))))^0)
+ - ( parsers.newline
+ + parsers.lbracket
+ + parsers.rbracket
+ + parsers.blankline^2))))^0)
* parsers.rbracket
+parsers.link_label_body = -#(parsers.sp * parsers.rbracket)
+ * #( ( parsers.any
+ - parsers.rbracket)^-999
+ * parsers.rbracket)
+ * Cs((parsers.alphanumeric^1
+ + parsers.inticks
+ + parsers.autolink
+ + V("InlineHtml")
+ + ( parsers.backslash * parsers.backslash)
+ + ( parsers.backslash
+ * ( parsers.lbracket
+ + parsers.rbracket)
+ + V("NoSoftLineBreakSpace")
+ + V("NoSoftLineBreakEndline")
+ + (parsers.any
+ - ( parsers.newline
+ + parsers.lbracket
+ + parsers.rbracket
+ + parsers.blankline^2))))^1)
+
parsers.link_label = parsers.lbracket
- * -#(parsers.sp * parsers.rbracket)
- * #((parsers.any - parsers.rbracket)^-999 * parsers.rbracket)
- * Cs((parsers.alphanumeric^1
- + parsers.inticks
- + parsers.autolink
- + V("InlineHtml")
- + ( parsers.backslash * parsers.backslash)
- + ( parsers.backslash * (parsers.lbracket + parsers.rbracket)
- + V("NoSoftLineBreakSpace")
- + V("NoSoftLineBreakEndline")
- + (parsers.any
- - (parsers.newline + parsers.lbracket + parsers.rbracket + parsers.blankline^2))))^1)
+ * parsers.link_label_body
* parsers.rbracket
parsers.inparens_url = P{ parsers.lparent
@@ -27699,29 +28440,38 @@ parsers.title_s = parsers.squote
* Cs((parsers.html_entities
+ V("NoSoftLineBreakSpace")
+ V("NoSoftLineBreakEndline")
- + (parsers.anyescaped - parsers.newline - parsers.squote - parsers.blankline^2))^0)
+ + ( parsers.anyescaped
+ - parsers.newline
+ - parsers.squote
+ - parsers.blankline^2))^0)
* parsers.squote
parsers.title_d = parsers.dquote
* Cs((parsers.html_entities
+ V("NoSoftLineBreakSpace")
+ V("NoSoftLineBreakEndline")
- + (parsers.anyescaped - parsers.newline - parsers.dquote - parsers.blankline^2))^0)
+ + ( parsers.anyescaped
+ - parsers.newline
+ - parsers.dquote
+ - parsers.blankline^2))^0)
* parsers.dquote
parsers.title_p = parsers.lparent
* Cs((parsers.html_entities
+ V("NoSoftLineBreakSpace")
+ V("NoSoftLineBreakEndline")
- + (parsers.anyescaped - parsers.newline - parsers.lparent - parsers.rparent
+ + ( parsers.anyescaped
+ - parsers.newline
+ - parsers.lparent
+ - parsers.rparent
- parsers.blankline^2))^0)
* parsers.rparent
-parsers.title = parsers.title_d + parsers.title_s + parsers.title_p
+parsers.title
+ = parsers.title_d + parsers.title_s + parsers.title_p
parsers.optionaltitle
- = parsers.spnlc * parsers.title * parsers.spacechar^0
- + Cc("")
+ = parsers.spnlc * parsers.title * parsers.spacechar^0 + Cc("")
% \end{macrocode}
% \par
@@ -27732,9 +28482,11 @@ parsers.optionaltitle
% \end{markdown}
% \begin{macrocode}
-- parse a reference definition: [foo]: /bar "title"
-parsers.define_reference_parser = (parsers.check_trail / "") * parsers.link_label * parsers.colon
+parsers.define_reference_parser = (parsers.check_trail / "")
+ * parsers.link_label * parsers.colon
* parsers.spnlc * parsers.url
- * ( parsers.spnlc_sep * parsers.title * parsers.only_blank
+ * ( parsers.spnlc_sep * parsers.title
+ * parsers.only_blank
+ Cc("") * parsers.only_blank)
% \end{macrocode}
% \par
@@ -27749,7 +28501,10 @@ parsers.Inline = V("Inline")
-- parse many p between starter and ender
parsers.between = function(p, starter, ender)
local ender2 = B(parsers.nonspacechar) * ender
- return (starter * #parsers.nonspacechar * Ct(p * (p - ender2)^0) * ender2)
+ return ( starter
+ * #parsers.nonspacechar
+ * Ct(p * (p - ender2)^0)
+ * ender2)
end
% \end{macrocode}
@@ -27761,7 +28516,8 @@ end
% \end{markdown}
% \begin{macrocode}
parsers.lineof = function(c)
- return (parsers.check_trail_no_rem * (P(c) * parsers.optionalspace)^3
+ return ( parsers.check_trail_no_rem
+ * (P(c) * parsers.optionalspace)^3
* (parsers.newline + parsers.eof))
end
@@ -27781,8 +28537,11 @@ parsers.heading_start = #parsers.hash * C(parsers.hash^-6)
* -parsers.hash / length
-- parse setext header ending and return level
-parsers.heading_level = parsers.nonindentspace * parsers.equal^1 * parsers.optionalspace * #parsers.newline * Cc(1)
- + parsers.nonindentspace * parsers.dash^1 * parsers.optionalspace * #parsers.newline * Cc(2)
+parsers.heading_level
+ = parsers.nonindentspace * parsers.equal^1
+ * parsers.optionalspace * #parsers.newline * Cc(1)
+ + parsers.nonindentspace * parsers.dash^1
+ * parsers.optionalspace * #parsers.newline * Cc(2)
local function strip_atx_end(s)
return s:gsub("%s+#*%s*\n$","")
@@ -27954,9 +28713,11 @@ function M.reader.new(writer, options)
local prefix = lpeg.match(C(parsers.optionalspace), line)
local prefix_length = #prefix
local is_shorter = min_prefix_length == nil
- is_shorter = is_shorter or prefix_length < min_prefix_length
+ if not is_shorter then
+ is_shorter = prefix_length < min_prefix_length
+ end
if is_shorter then
- min_prefix_length, min_prefix = prefix_length, prefix
+ min_prefix_length, min_prefix = prefix_length, prefix
end
return line
end)
@@ -27978,7 +28739,8 @@ function M.reader.new(writer, options)
end
local res = lpeg.match(grammar(), str)
if res == nil then
- error(format("%s failed on:\n%s", name, str:sub(1,20)))
+ return writer.error(format("%s failed on:\n%s",
+ name, str:sub(1,20)))
else
return res
end
@@ -28028,35 +28790,47 @@ function M.reader.new(writer, options)
%
% \end{markdown}
% \begin{macrocode}
- parsers.minimally_indented_blankline = parsers.check_minimal_indent * (parsers.blankline / "")
+ parsers.minimally_indented_blankline
+ = parsers.check_minimal_indent * (parsers.blankline / "")
- parsers.minimally_indented_block = parsers.check_minimal_indent * V("Block")
+ parsers.minimally_indented_block
+ = parsers.check_minimal_indent * V("Block")
- parsers.minimally_indented_block_or_paragraph = parsers.check_minimal_indent * V("BlockOrParagraph")
+ parsers.minimally_indented_block_or_paragraph
+ = parsers.check_minimal_indent * V("BlockOrParagraph")
- parsers.minimally_indented_paragraph = parsers.check_minimal_indent * V("Paragraph")
+ parsers.minimally_indented_paragraph
+ = parsers.check_minimal_indent * V("Paragraph")
- parsers.minimally_indented_plain = parsers.check_minimal_indent * V("Plain")
+ parsers.minimally_indented_plain
+ = parsers.check_minimal_indent * V("Plain")
- parsers.minimally_indented_par_or_plain = parsers.minimally_indented_paragraph
- + parsers.minimally_indented_plain
+ parsers.minimally_indented_par_or_plain
+ = parsers.minimally_indented_paragraph
+ + parsers.minimally_indented_plain
- parsers.minimally_indented_par_or_plain_no_blank = parsers.minimally_indented_par_or_plain
- - parsers.minimally_indented_blankline
+ parsers.minimally_indented_par_or_plain_no_blank
+ = parsers.minimally_indented_par_or_plain
+ - parsers.minimally_indented_blankline
- parsers.minimally_indented_ref = parsers.check_minimal_indent * V("Reference")
+ parsers.minimally_indented_ref
+ = parsers.check_minimal_indent * V("Reference")
- parsers.minimally_indented_blank = parsers.check_minimal_indent * V("Blank")
+ parsers.minimally_indented_blank
+ = parsers.check_minimal_indent * V("Blank")
- parsers.conditionally_indented_blankline = parsers.check_minimal_blank_indent * (parsers.blankline / "")
+ parsers.conditionally_indented_blankline
+ = parsers.check_minimal_blank_indent * (parsers.blankline / "")
- parsers.minimally_indented_ref_or_block = parsers.minimally_indented_ref
- + parsers.minimally_indented_block
- - parsers.minimally_indented_blankline
+ parsers.minimally_indented_ref_or_block
+ = parsers.minimally_indented_ref
+ + parsers.minimally_indented_block
+ - parsers.minimally_indented_blankline
- parsers.minimally_indented_ref_or_block_or_par = parsers.minimally_indented_ref
- + parsers.minimally_indented_block_or_paragraph
- - parsers.minimally_indented_blankline
+ parsers.minimally_indented_ref_or_block_or_par
+ = parsers.minimally_indented_ref
+ + parsers.minimally_indented_block_or_paragraph
+ - parsers.minimally_indented_blankline
% \end{macrocode}
% \begin{markdown}
@@ -28066,7 +28840,8 @@ function M.reader.new(writer, options)
% \end{markdown}
% \begin{macrocode}
- parsers.separator_loop = function(separated_block, paragraph, block_separator, paragraph_separator)
+ function parsers.separator_loop(separated_block, paragraph,
+ block_separator, paragraph_separator)
return separated_block
+ block_separator
* paragraph
@@ -28075,10 +28850,14 @@ function M.reader.new(writer, options)
* paragraph
end
- parsers.create_loop_body_pair = function(separated_block, paragraph, block_separator, paragraph_separator)
+ function parsers.create_loop_body_pair(separated_block, paragraph,
+ block_separator,
+ paragraph_separator)
return {
- block = parsers.separator_loop(separated_block, paragraph, block_separator, block_separator),
- par = parsers.separator_loop(separated_block, paragraph, block_separator, paragraph_separator)
+ block = parsers.separator_loop(separated_block, paragraph,
+ block_separator, block_separator),
+ par = parsers.separator_loop(separated_block, paragraph,
+ block_separator, paragraph_separator)
}
end
@@ -28101,18 +28880,20 @@ function M.reader.new(writer, options)
parsers.content_blank = parsers.minimally_indented_blankline
- parsers.ref_or_block_separated = parsers.sep_group_no_output(parsers.content_blank)
- * ( parsers.minimally_indented_ref
- - parsers.content_blank)
- + parsers.block_sep_group(parsers.content_blank)
- * ( parsers.minimally_indented_block
- - parsers.content_blank)
+ parsers.ref_or_block_separated
+ = parsers.sep_group_no_output(parsers.content_blank)
+ * ( parsers.minimally_indented_ref
+ - parsers.content_blank)
+ + parsers.block_sep_group(parsers.content_blank)
+ * ( parsers.minimally_indented_block
+ - parsers.content_blank)
parsers.loop_body_pair =
- parsers.create_loop_body_pair(parsers.ref_or_block_separated,
- parsers.minimally_indented_par_or_plain_no_blank,
- parsers.block_sep_group(parsers.content_blank),
- parsers.par_sep_group(parsers.content_blank))
+ parsers.create_loop_body_pair(
+ parsers.ref_or_block_separated,
+ parsers.minimally_indented_par_or_plain_no_blank,
+ parsers.block_sep_group(parsers.content_blank),
+ parsers.par_sep_group(parsers.content_blank))
parsers.content_loop = ( V("Block")
* parsers.loop_body_pair.block^0
@@ -28136,7 +28917,8 @@ function M.reader.new(writer, options)
parsers.add_indent = function(pattern, name, breakable)
return Cg(Cmt( Cb("indent_info")
* Ct(pattern)
- * (#parsers.linechar * Cc(false) + Cc(true)) -- check if starter is blank
+ * ( #parsers.linechar -- check if starter is blank
+ * Cc(false) + Cc(true))
* Cc(name)
* Cc(breakable),
process_starter_indent), "indent_info")
@@ -28164,7 +28946,8 @@ function M.reader.new(writer, options)
allowed_end = C(parsers.spacechar^1) * #parsers.linechar
else
delimiter_range = parsers.dig * parsers.dig^-8
- allowed_end = C(parsers.spacechar^1) + #(parsers.newline + parsers.eof)
+ allowed_end = C(parsers.spacechar^1)
+ + #(parsers.newline + parsers.eof)
end
return parsers.check_trail
@@ -28186,16 +28969,21 @@ function M.reader.new(writer, options)
%
% \end{markdown}
% \begin{macrocode}
- parsers.blockquote_start = parsers.check_trail * C(parsers.more) * C(parsers.spacechar^0)
+ parsers.blockquote_start
+ = parsers.check_trail
+ * C(parsers.more)
+ * C(parsers.spacechar^0)
- parsers.blockquote_body = parsers.add_indent(parsers.blockquote_start, "bq", true)
- * parsers.indented_content()
- * remove_indent("bq")
+ parsers.blockquote_body
+ = parsers.add_indent(parsers.blockquote_start, "bq", true)
+ * parsers.indented_content()
+ * remove_indent("bq")
if not options.breakableBlockquotes then
- parsers.blockquote_body = parsers.add_indent(parsers.blockquote_start, "bq", false)
- * parsers.indented_content()
- * remove_indent("bq")
+ parsers.blockquote_body
+ = parsers.add_indent(parsers.blockquote_start, "bq", false)
+ * parsers.indented_content()
+ * remove_indent("bq")
end
% \end{macrocode}
% \par
@@ -28209,7 +28997,8 @@ function M.reader.new(writer, options)
% \begin{macrocode}
local function parse_content_part(content_part)
local rope = util.rope_to_string(content_part)
- local parsed = self.parser_functions.parse_inlines_no_link_or_emphasis(rope)
+ local parsed
+ = self.parser_functions.parse_inlines_no_link_or_emphasis(rope)
parsed.indent_info = nil
return parsed
end
@@ -28221,37 +29010,40 @@ function M.reader.new(writer, options)
%
% \end{markdown}
% \begin{macrocode}
- local function collect_emphasis_content(t, opening_index, closing_index)
- local content = {}
+ local collect_emphasis_content =
+ function(t, opening_index, closing_index)
+ local content = {}
- local content_part = {}
- for i = opening_index, closing_index do
- local value = t[i]
+ local content_part = {}
+ for i = opening_index, closing_index do
+ local value = t[i]
- if value.rendered ~= nil then
- content[#content + 1] = parse_content_part(content_part)
- content_part = {}
- content[#content + 1] = value.rendered
- value.rendered = nil
- else
- if value.type == "delimiter" and value.element == "emphasis" then
- if value.is_active then
- content_part[#content_part + 1] = string.rep(value.character, value.current_count)
- end
+ if value.rendered ~= nil then
+ content[#content + 1] = parse_content_part(content_part)
+ content_part = {}
+ content[#content + 1] = value.rendered
+ value.rendered = nil
else
- content_part[#content_part + 1] = value.content
+ if value.type == "delimiter"
+ and value.element == "emphasis" then
+ if value.is_active then
+ content_part[#content_part + 1]
+ = string.rep(value.character, value.current_count)
+ end
+ else
+ content_part[#content_part + 1] = value.content
+ end
+ value.content = ''
+ value.is_active = false
end
- value.content = ''
- value.is_active = false
end
- end
- if next(content_part) ~= nil then
- content[#content + 1] = parse_content_part(content_part)
- end
+ if next(content_part) ~= nil then
+ content[#content + 1] = parse_content_part(content_part)
+ end
- return content
- end
+ return content
+ end
% \end{macrocode}
% \begin{markdown}
@@ -28262,7 +29054,9 @@ function M.reader.new(writer, options)
% \end{markdown}
% \begin{macrocode}
local function fill_emph(t, opening_index, closing_index)
- local content = collect_emphasis_content(t, opening_index + 1, closing_index - 1)
+ local content
+ = collect_emphasis_content(t, opening_index + 1,
+ closing_index - 1)
t[opening_index + 1].is_active = true
t[opening_index + 1].rendered = writer.emphasis(content)
end
@@ -28276,7 +29070,9 @@ function M.reader.new(writer, options)
% \end{markdown}
% \begin{macrocode}
local function fill_strong(t, opening_index, closing_index)
- local content = collect_emphasis_content(t, opening_index + 1, closing_index - 1)
+ local content
+ = collect_emphasis_content(t, opening_index + 1,
+ closing_index - 1)
t[opening_index + 1].is_active = true
t[opening_index + 1].rendered = writer.strong(content)
end
@@ -28290,9 +29086,12 @@ function M.reader.new(writer, options)
% \end{markdown}
% \begin{macrocode}
local function breaks_three_rule(opening_delimiter, closing_delimiter)
- return (opening_delimiter.is_closing or closing_delimiter.is_opening) and
- ((opening_delimiter.original_count + closing_delimiter.original_count) % 3 == 0) and
- (opening_delimiter.original_count % 3 ~= 0 or closing_delimiter.original_count % 3 ~= 0)
+ return ( opening_delimiter.is_closing
+ or closing_delimiter.is_opening)
+ and (( opening_delimiter.original_count
+ + closing_delimiter.original_count) % 3 == 0)
+ and ( opening_delimiter.original_count % 3 ~= 0
+ or closing_delimiter.original_count % 3 ~= 0)
end
% \end{macrocode}
@@ -28304,7 +29103,8 @@ function M.reader.new(writer, options)
%
% \end{markdown}
% \begin{macrocode}
- local function find_emphasis_opener(t, bottom_index, latest_index, character, closing_delimiter)
+ local find_emphasis_opener = function(t, bottom_index, latest_index,
+ character, closing_delimiter)
for i = latest_index, bottom_index, -1 do
local value = t[i]
if value.is_active and
@@ -28368,12 +29168,18 @@ function M.reader.new(writer, options)
local is_opening = value.is_opening
local closing_length_modulo_three = value.original_count % 3
- local current_openers_bottom = openers_bottom[character][is_opening][closing_length_modulo_three + 1]
+ local current_openers_bottom
+ = openers_bottom[character][is_opening]
+ [closing_length_modulo_three + 1]
- local opener_position = find_emphasis_opener(t, current_openers_bottom, current_position - 1, character, value)
+ local opener_position
+ = find_emphasis_opener(t, current_openers_bottom,
+ current_position - 1, character, value)
if (opener_position == nil) then
- openers_bottom[character][is_opening][closing_length_modulo_three + 1] = current_position
+ openers_bottom[character][is_opening]
+ [closing_length_modulo_three + 1]
+ = current_position
current_position = current_position + 1
goto continue
end
@@ -28383,7 +29189,8 @@ function M.reader.new(writer, options)
local current_opening_count = opening_delimiter.current_count
local current_closing_count = t[current_position].current_count
- if (current_opening_count >= 2) and (current_closing_count >= 2) then
+ if (current_opening_count >= 2)
+ and (current_closing_count >= 2) then
opening_delimiter.current_count = current_opening_count - 2
t[current_position].current_count = current_closing_count - 2
fill_strong(t, opener_position, current_position)
@@ -28467,15 +29274,19 @@ function M.reader.new(writer, options)
return check_unicode_type(s, i, 0, 3, "%s")
end
- parsers.unicode_preceding_punctuation = B(parsers.escapable)
- + Cmt(parsers.succeed, check_preceding_unicode_punctuation)
+ parsers.unicode_preceding_punctuation
+ = B(parsers.escapable)
+ + Cmt(parsers.succeed, check_preceding_unicode_punctuation)
- parsers.unicode_preceding_whitespace = Cmt(parsers.succeed, check_preceding_unicode_whitespace)
+ parsers.unicode_preceding_whitespace
+ = Cmt(parsers.succeed, check_preceding_unicode_whitespace)
- parsers.unicode_following_punctuation = #parsers.escapable
- + Cmt(parsers.succeed, check_following_unicode_punctuation)
+ parsers.unicode_following_punctuation
+ = #parsers.escapable
+ + Cmt(parsers.succeed, check_following_unicode_punctuation)
- parsers.unicode_following_whitespace = Cmt(parsers.succeed, check_following_unicode_whitespace)
+ parsers.unicode_following_whitespace
+ = Cmt(parsers.succeed, check_following_unicode_whitespace)
parsers.delimiter_run = function(character)
return (B(parsers.backslash * character) + -B(character))
@@ -28485,49 +29296,58 @@ function M.reader.new(writer, options)
parsers.left_flanking_delimiter_run = function(character)
return (B( parsers.any)
- * (parsers.unicode_preceding_punctuation + parsers.unicode_preceding_whitespace)
+ * ( parsers.unicode_preceding_punctuation
+ + parsers.unicode_preceding_whitespace)
+ -B(parsers.any))
* parsers.delimiter_run(character)
* parsers.unicode_following_punctuation
+ parsers.delimiter_run(character)
- * -#(parsers.unicode_following_punctuation + parsers.unicode_following_whitespace
+ * -#( parsers.unicode_following_punctuation
+ + parsers.unicode_following_whitespace
+ parsers.eof)
end
parsers.right_flanking_delimiter_run = function(character)
return parsers.unicode_preceding_punctuation
* parsers.delimiter_run(character)
- * (parsers.unicode_following_punctuation + parsers.unicode_following_whitespace
+ * ( parsers.unicode_following_punctuation
+ + parsers.unicode_following_whitespace
+ parsers.eof)
+ (B(parsers.any)
- * -(parsers.unicode_preceding_punctuation + parsers.unicode_preceding_whitespace))
+ * -( parsers.unicode_preceding_punctuation
+ + parsers.unicode_preceding_whitespace))
* parsers.delimiter_run(character)
end
if options.underscores then
- parsers.emph_start = parsers.left_flanking_delimiter_run(parsers.asterisk)
- + (-#parsers.right_flanking_delimiter_run(parsers.underscore)
- + (parsers.unicode_preceding_punctuation
- * #parsers.right_flanking_delimiter_run(parsers.underscore)))
- * parsers.left_flanking_delimiter_run(parsers.underscore)
-
- parsers.emph_end = parsers.right_flanking_delimiter_run(parsers.asterisk)
- + (-#parsers.left_flanking_delimiter_run(parsers.underscore)
- + #(parsers.left_flanking_delimiter_run(parsers.underscore)
- * parsers.unicode_following_punctuation))
- * parsers.right_flanking_delimiter_run(parsers.underscore)
+ parsers.emph_start
+ = parsers.left_flanking_delimiter_run(parsers.asterisk)
+ + ( -#parsers.right_flanking_delimiter_run(parsers.underscore)
+ + ( parsers.unicode_preceding_punctuation
+ * #parsers.right_flanking_delimiter_run(parsers.underscore)))
+ * parsers.left_flanking_delimiter_run(parsers.underscore)
+
+ parsers.emph_end
+ = parsers.right_flanking_delimiter_run(parsers.asterisk)
+ + ( -#parsers.left_flanking_delimiter_run(parsers.underscore)
+ + #( parsers.left_flanking_delimiter_run(parsers.underscore)
+ * parsers.unicode_following_punctuation))
+ * parsers.right_flanking_delimiter_run(parsers.underscore)
else
- parsers.emph_start = parsers.left_flanking_delimiter_run(parsers.asterisk)
+ parsers.emph_start
+ = parsers.left_flanking_delimiter_run(parsers.asterisk)
- parsers.emph_end = parsers.right_flanking_delimiter_run(parsers.asterisk)
+ parsers.emph_end
+ = parsers.right_flanking_delimiter_run(parsers.asterisk)
end
- parsers.emph_capturing_open_and_close = #parsers.emph_start * #parsers.emph_end
- * Ct( Cg(Cc("delimiter"), "type")
- * Cg(Cc("emphasis"), "element")
- * Cg(C(parsers.emph_start), "content")
- * Cg(Cc(true), "is_opening")
- * Cg(Cc(true), "is_closing"))
+ parsers.emph_capturing_open_and_close
+ = #parsers.emph_start * #parsers.emph_end
+ * Ct( Cg(Cc("delimiter"), "type")
+ * Cg(Cc("emphasis"), "element")
+ * Cg(C(parsers.emph_start), "content")
+ * Cg(Cc(true), "is_opening")
+ * Cg(Cc(true), "is_closing"))
parsers.emph_capturing_open = Ct( Cg(Cc("delimiter"), "type")
* Cg(Cc("emphasis"), "element")
@@ -28562,6 +29382,9 @@ function M.reader.new(writer, options)
-- List of references defined in the document
local references
+ -- List of note references defined in the document
+ parsers.rawnotes = {}
+
% \end{macrocode}
% \par
% \begin{markdown}
@@ -28599,19 +29422,39 @@ function M.reader.new(writer, options)
return references[self.normalize_tag(tag)]
end
+% \end{macrocode}
+% \par
+% \begin{markdown}
+%
+% The \luamdef{reader->lookup_note_reference} method looks up a
+% note reference with label `tag`.
+%
+% \end{markdown}
+% \begin{macrocode}
+ function self.lookup_note_reference(tag)
+ return parsers.rawnotes[self.normalize_tag(tag)]
+ end
+
parsers.title_s_direct_ref = parsers.squote
* Cs((parsers.html_entities
- + (parsers.anyescaped - parsers.squote - parsers.blankline^2))^0)
+ + ( parsers.anyescaped
+ - parsers.squote
+ - parsers.blankline^2))^0)
* parsers.squote
parsers.title_d_direct_ref = parsers.dquote
* Cs((parsers.html_entities
- + (parsers.anyescaped - parsers.dquote - parsers.blankline^2))^0)
+ + ( parsers.anyescaped
+ - parsers.dquote
+ - parsers.blankline^2))^0)
* parsers.dquote
parsers.title_p_direct_ref = parsers.lparent
* Cs((parsers.html_entities
- + (parsers.anyescaped - parsers.lparent - parsers.rparent - parsers.blankline^2))^0)
+ + ( parsers.anyescaped
+ - parsers.lparent
+ - parsers.rparent
+ - parsers.blankline^2))^0)
* parsers.rparent
parsers.title_direct_ref = parsers.title_s_direct_ref
@@ -28621,7 +29464,8 @@ function M.reader.new(writer, options)
parsers.inline_direct_ref_inside = parsers.lparent * parsers.spnl
* Cg(parsers.url + Cc(""), "url")
* parsers.spnl
- * Cg(parsers.title_direct_ref + Cc(""), "title")
+ * Cg( parsers.title_direct_ref
+ + Cc(""), "title")
* parsers.spnl * parsers.rparent
parsers.inline_direct_ref = parsers.lparent * parsers.spnlc
@@ -28649,7 +29493,8 @@ function M.reader.new(writer, options)
* Cg(Cc("inline"), "link_type")
+ #(parsers.exclamation * parsers.full_link)
* Cg(Cc("full"), "link_type")
- + #(parsers.exclamation * parsers.collapsed_link)
+ + #( parsers.exclamation
+ * parsers.collapsed_link)
* Cg(Cc("collapsed"), "link_type")
+ #(parsers.exclamation * parsers.shortcut_link)
* Cg(Cc("shortcut"), "link_type")
@@ -28669,22 +29514,61 @@ function M.reader.new(writer, options)
+ #parsers.link_text
* Cg(Cc("link_text"), "link_type")
+ parsers.note_opening = #(parsers.circumflex * parsers.link_text)
+ * Cg(Cc("note_inline"), "link_type")
+
+ parsers.raw_note_opening = #( parsers.lbracket
+ * parsers.circumflex
+ * parsers.link_label_body
+ * parsers.rbracket)
+ * Cg(Cc("raw_note"), "link_type")
+
+ local inline_note_element = Cg(Cc("note"), "element")
+ * parsers.note_opening
+ * Cg( parsers.circumflex
+ * parsers.lbracket, "content")
+
+ local image_element = Cg(Cc("image"), "element")
+ * parsers.image_opening
+ * Cg( parsers.exclamation
+ * parsers.lbracket, "content")
+
+ local note_element = Cg(Cc("note"), "element")
+ * parsers.raw_note_opening
+ * Cg( parsers.lbracket
+ * parsers.circumflex, "content")
+
+ local link_element = Cg(Cc("link"), "element")
+ * parsers.link_opening
+ * Cg(parsers.lbracket, "content")
+
+ local opening_elements = parsers.fail
+
+ if options.inlineNotes then
+ opening_elements = opening_elements + inline_note_element
+ end
+
+ opening_elements = opening_elements + image_element
+
+ if options.notes then
+ opening_elements = opening_elements + note_element
+ end
+
+ opening_elements = opening_elements + link_element
+
parsers.link_image_opening = Ct( Cg(Cc("delimiter"), "type")
* Cg(Cc(true), "is_opening")
* Cg(Cc(false), "is_closing")
- * ( Cg(Cc("image"), "element")
- * parsers.image_opening
- * Cg(parsers.exclamation * parsers.lbracket, "content")
- + Cg(Cc("link"), "element")
- * parsers.link_opening
- * Cg(parsers.lbracket, "content")))
+ * opening_elements)
parsers.link_image_closing = Ct( Cg(Cc("delimiter"), "type")
* Cg(Cc("link"), "element")
* Cg(Cc(false), "is_opening")
* Cg(Cc(true), "is_closing")
* ( Cg(Cc(true), "is_direct")
- * Cg(parsers.rbracket * #parsers.inline_direct_ref, "content")
+ * Cg( parsers.rbracket
+ * #parsers.inline_direct_ref,
+ "content")
+ Cg(Cc(false), "is_direct")
* Cg(parsers.rbracket, "content")))
@@ -28708,19 +29592,21 @@ function M.reader.new(writer, options)
* -parsers.starter) / "")
* parsers.spacechar^0 / "\n"
- parsers.link_and_emph_content = Ct( Cg(Cc("content"), "type")
- * Cg(Cs(( parsers.link_emph_precedence
- + parsers.backslash * parsers.any
- + parsers.link_and_emph_endline
- + (parsers.linechar
- - parsers.blankline^2
- - parsers.link_image_open_or_close
- - parsers.emph_open_or_close))^0), "content"))
+ parsers.link_and_emph_content
+ = Ct( Cg(Cc("content"), "type")
+ * Cg(Cs(( parsers.link_emph_precedence
+ + parsers.backslash * parsers.any
+ + parsers.link_and_emph_endline
+ + (parsers.linechar
+ - parsers.blankline^2
+ - parsers.link_image_open_or_close
+ - parsers.emph_open_or_close))^0), "content"))
- parsers.link_and_emph_table = (parsers.link_image_opening + parsers.emph_open)
- * parsers.link_and_emph_content
- * ((parsers.link_image_open_or_close + parsers.emph_open_or_close)
- * parsers.link_and_emph_content)^1
+ parsers.link_and_emph_table
+ = (parsers.link_image_opening + parsers.emph_open)
+ * parsers.link_and_emph_content
+ * ((parsers.link_image_open_or_close + parsers.emph_open_or_close)
+ * parsers.link_and_emph_content)^1
% \end{macrocode}
% \begin{markdown}
@@ -28750,7 +29636,9 @@ function M.reader.new(writer, options)
local value = t[i]
if value.type == "delimiter" and
value.is_opening and
- (value.element == "link" or value.element == "image")
+ ( value.element == "link"
+ or value.element == "image"
+ or value.element == "note")
and not value.removed then
if value.is_active then
return i
@@ -28831,11 +29719,12 @@ function M.reader.new(writer, options)
%
% \end{markdown}
% \begin{macrocode}
- local function delete_parsed_content_in_range(t, opening_index, closing_index)
- for i = opening_index, closing_index do
- t[i].rendered = nil
+ local delete_parsed_content_in_range =
+ function(t, opening_index, closing_index)
+ for i = opening_index, closing_index do
+ t[i].rendered = nil
+ end
end
- end
% \end{macrocode}
% \begin{markdown}
@@ -28880,25 +29769,40 @@ function M.reader.new(writer, options)
%
% \end{markdown}
% \begin{macrocode}
- local function render_link_or_image(t, opening_index, closing_index, content_end_index, reference)
- process_emphasis(t, opening_index, content_end_index)
- local mapped = collect_emphasis_content(t, opening_index + 1, content_end_index - 1)
+ local render_link_or_image =
+ function(t, opening_index, closing_index, content_end_index,
+ reference)
+ process_emphasis(t, opening_index, content_end_index)
+ local mapped = collect_emphasis_content(t, opening_index + 1,
+ content_end_index - 1)
- local rendered = {}
- if (t[opening_index].element == "link") then
- rendered = writer.link(mapped, reference.url, reference.title, reference.attributes)
- end
+ local rendered = {}
+ if (t[opening_index].element == "link") then
+ rendered = writer.link(mapped, reference.url,
+ reference.title, reference.attributes)
+ end
- if (t[opening_index].element == "image") then
- rendered = writer.image(mapped, reference.url, reference.title, reference.attributes)
- end
+ if (t[opening_index].element == "image") then
+ rendered = writer.image(mapped, reference.url, reference.title,
+ reference.attributes)
+ end
- t[opening_index].rendered = rendered
- delete_parsed_content_in_range(t, opening_index + 1, closing_index)
- empty_content_in_range(t, opening_index, closing_index)
- disable_previous_link_openers(t, opening_index)
- disable_range(t, opening_index, closing_index)
- end
+ if (t[opening_index].element == "note") then
+ if (t[opening_index].link_type == "note_inline") then
+ rendered = writer.note(mapped)
+ end
+ if (t[opening_index].link_type == "raw_note") then
+ rendered = writer.note(reference)
+ end
+ end
+
+ t[opening_index].rendered = rendered
+ delete_parsed_content_in_range(t, opening_index + 1,
+ closing_index)
+ empty_content_in_range(t, opening_index, closing_index)
+ disable_previous_link_openers(t, opening_index)
+ disable_range(t, opening_index, closing_index)
+ end
% \end{macrocode}
% \begin{markdown}
@@ -28909,123 +29813,185 @@ function M.reader.new(writer, options)
%
% \end{markdown}
% \begin{macrocode}
- local function resolve_inline_following_content(t, closing_index, match_reference, match_link_attributes)
- local content = ""
- for i = closing_index + 1, #t do
- content = content .. t[i].content
- end
+ local resolve_inline_following_content =
+ function(t, closing_index, match_reference, match_link_attributes)
+ local content = ""
+ for i = closing_index + 1, #t do
+ content = content .. t[i].content
+ end
- local matching_content = parsers.succeed
+ local matching_content = parsers.succeed
- if match_reference then
- matching_content = matching_content * parsers.inline_direct_ref_inside
- end
+ if match_reference then
+ matching_content = matching_content
+ * parsers.inline_direct_ref_inside
+ end
- if match_link_attributes then
- matching_content = matching_content * Cg(Ct(parsers.attributes^-1), "attributes")
- end
+ if match_link_attributes then
+ matching_content = matching_content
+ * Cg(Ct(parsers.attributes^-1), "attributes")
+ end
- local matched = lpeg.match(Ct(matching_content * Cg(Cp(), "end_position")), content)
+ local matched = lpeg.match(Ct( matching_content
+ * Cg(Cp(), "end_position")), content)
- local matched_count = matched.end_position - 1
- for i = closing_index + 1, #t do
- local value = t[i]
+ local matched_count = matched.end_position - 1
+ for i = closing_index + 1, #t do
+ local value = t[i]
- local chars_left = matched_count
- matched_count = matched_count - #value.content
+ local chars_left = matched_count
+ matched_count = matched_count - #value.content
- if matched_count <= 0 then
- value.content = value.content:sub(chars_left + 1)
- break
+ if matched_count <= 0 then
+ value.content = value.content:sub(chars_left + 1)
+ break
+ end
+
+ value.content = ''
+ value.is_active = false
end
- value.content = ''
- value.is_active = false
- end
+ local attributes = matched.attributes
+ if attributes == nil or next(attributes) == nil then
+ attributes = nil
+ end
- local attributes = matched.attributes
- if attributes == nil or next(attributes) == nil then
- attributes = nil
+ return {
+ url = matched.url or "",
+ title = matched.title or "",
+ attributes = attributes
+ }
end
- return {
- url = matched.url or "",
- title = matched.title or "",
- attributes = attributes
- }
- end
-
% \end{macrocode}
% \begin{markdown}
%
-% Resolve an inline link [a](b "c") from the delimiters at `opening_index` and `closing_index`
+% Resolve an inline link `[a](b "c")` from the delimiters at `opening_index` and `closing_index`
% within a delimiter table `t`. Here, compared to other types of links, no reference definition is needed.
%
% \end{markdown}
% \begin{macrocode}
local function resolve_inline_link(t, opening_index, closing_index)
- local inline_content = resolve_inline_following_content(t, closing_index, true, t.match_link_attributes)
- render_link_or_image(t, opening_index, closing_index, closing_index, inline_content)
+ local inline_content
+ = resolve_inline_following_content(t, closing_index, true,
+ t.match_link_attributes)
+ render_link_or_image(t, opening_index, closing_index,
+ closing_index, inline_content)
end
% \end{macrocode}
% \begin{markdown}
%
-% Resolve a shortcut link [a] from the delimiters at `opening_index` and `closing_index` within a delimiter table `t`.
+% Resolve an inline note `^[a]` from the delimiters at `opening_index` and `closing_index`
+% within a delimiter table `t`.
+%
+% \end{markdown}
+% \begin{macrocode}
+ local resolve_note_inline_link =
+ function(t, opening_index, closing_index)
+ local inline_content
+ = resolve_inline_following_content(t, closing_index,
+ false, false)
+ render_link_or_image(t, opening_index, closing_index,
+ closing_index, inline_content)
+ end
+
+% \end{macrocode}
+% \begin{markdown}
+%
+% Resolve a shortcut link `[a]` from the delimiters at `opening_index` and `closing_index` within a delimiter table `t`.
% Continue if a tag `a` is not found in the references.
%
% \end{markdown}
% \begin{macrocode}
local function resolve_shortcut_link(t, opening_index, closing_index)
- local content = collect_link_content(t, opening_index + 1, closing_index - 1)
+ local content
+ = collect_link_content(t, opening_index + 1, closing_index - 1)
local r = self.lookup_reference(content)
if r then
- local inline_content = resolve_inline_following_content(t, closing_index, false, t.match_link_attributes)
- r.attributes = join_attributes(r.attributes, inline_content.attributes)
- render_link_or_image(t, opening_index, closing_index, closing_index, r)
+ local inline_content
+ = resolve_inline_following_content(t, closing_index, false,
+ t.match_link_attributes)
+ r.attributes
+ = join_attributes(r.attributes, inline_content.attributes)
+ render_link_or_image(t, opening_index, closing_index,
+ closing_index, r)
end
end
% \end{macrocode}
% \begin{markdown}
%
-% Resolve a full link [a][b] from the delimiters at `opening_index` and `closing_index` within a delimiter table `t`.
+% Resolve a note `[^a]` from the delimiters at `opening_index` and `closing_index` within a delimiter table `t`.
+% Continue if a tag `a` is not found in the rawnotes.
+%
+% \end{markdown}
+% \begin{macrocode}
+ local function resolve_raw_note_link(t, opening_index, closing_index)
+ local content
+ = collect_link_content(t, opening_index + 1, closing_index - 1)
+ local r = self.lookup_note_reference(content)
+
+ if r then
+ local parsed_ref = self.parser_functions.parse_blocks_nested(r)
+ render_link_or_image(t, opening_index, closing_index,
+ closing_index, parsed_ref)
+ end
+ end
+
+% \end{macrocode}
+% \begin{markdown}
+%
+% Resolve a full link `[a][b]` from the delimiters at `opening_index` and `closing_index` within a delimiter table `t`.
% Continue if a tag `b` is not found in the references.
%
% \end{markdown}
% \begin{macrocode}
local function resolve_full_link(t, opening_index, closing_index)
- local next_link_closing_index = find_next_link_closing_index(t, closing_index + 4)
- local next_link_content = collect_link_content(t, closing_index + 3, next_link_closing_index - 1)
+ local next_link_closing_index
+ = find_next_link_closing_index(t, closing_index + 4)
+ local next_link_content
+ = collect_link_content(t, closing_index + 3,
+ next_link_closing_index - 1)
local r = self.lookup_reference(next_link_content)
if r then
- local inline_content = resolve_inline_following_content(t, next_link_closing_index, false,
- t.match_link_attributes)
- r.attributes = join_attributes(r.attributes, inline_content.attributes)
- render_link_or_image(t, opening_index, next_link_closing_index, closing_index, r)
+ local inline_content
+ = resolve_inline_following_content(t, next_link_closing_index,
+ false,
+ t.match_link_attributes)
+ r.attributes
+ = join_attributes(r.attributes, inline_content.attributes)
+ render_link_or_image(t, opening_index, next_link_closing_index,
+ closing_index, r)
end
end
% \end{macrocode}
% \begin{markdown}
%
-% Resolve a collapsed link [a][] from the delimiters at `opening_index` and `closing_index`
+% Resolve a collapsed link `[a][]` from the delimiters at `opening_index` and `closing_index`
% within a delimiter table `t`.
% Continue if a tag `a` is not found in the references.
%
% \end{markdown}
% \begin{macrocode}
local function resolve_collapsed_link(t, opening_index, closing_index)
- local next_link_closing_index = find_next_link_closing_index(t, closing_index + 4)
- local content = collect_link_content(t, opening_index + 1, closing_index - 1)
+ local next_link_closing_index
+ = find_next_link_closing_index(t, closing_index + 4)
+ local content
+ = collect_link_content(t, opening_index + 1, closing_index - 1)
local r = self.lookup_reference(content)
if r then
- local inline_content = resolve_inline_following_content(t, closing_index, false, t.match_link_attributes)
- r.attributes = join_attributes(r.attributes, inline_content.attributes)
- render_link_or_image(t, opening_index, next_link_closing_index, closing_index, r)
+ local inline_content
+ = resolve_inline_following_content(t, closing_index, false,
+ t.match_link_attributes)
+ r.attributes
+ = join_attributes(r.attributes, inline_content.attributes)
+ render_link_or_image(t, opening_index, next_link_closing_index,
+ closing_index, r)
end
end
@@ -29045,9 +30011,12 @@ function M.reader.new(writer, options)
end
for i,value in ipairs(t) do
- if not value.is_closing or
- value.type ~= "delimiter" or
- not (value.element == "link" or value.element == "image") then
+ if not value.is_closing
+ or value.type ~= "delimiter"
+ or not ( value.element == "link"
+ or value.element == "image"
+ or value.element == "note")
+ or value.removed then
goto continue
end
@@ -29073,6 +30042,12 @@ function M.reader.new(writer, options)
if (link_type == "collapsed") then
resolve_collapsed_link(t, opener_position, i)
end
+ if (link_type == "note_inline") then
+ resolve_note_inline_link(t, opener_position, i)
+ end
+ if (link_type == "raw_note") then
+ resolve_raw_note_link(t, opener_position, i)
+ end
::continue::
end
@@ -29098,7 +30073,8 @@ function M.reader.new(writer, options)
%
% \end{markdown}
% \begin{macrocode}
- parsers.Str = (parsers.normalchar * (parsers.normalchar + parsers.at)^0)
+ parsers.Str = ( parsers.normalchar
+ * (parsers.normalchar + parsers.at)^0)
/ writer.string
parsers.Symbol = (parsers.backtick^1 + V("SpecialChar"))
@@ -29126,25 +30102,28 @@ function M.reader.new(writer, options)
parsers.interrupting_bullets = parsers.fail
parsers.interrupting_enumerators = parsers.fail
else
- parsers.interrupting_bullets = parsers.bullet(parsers.dash, true)
- + parsers.bullet(parsers.asterisk, true)
- + parsers.bullet(parsers.plus, true)
-
- parsers.interrupting_enumerators = parsers.enumerator(parsers.period, true)
- + parsers.enumerator(parsers.rparent, true)
+ parsers.interrupting_bullets
+ = parsers.bullet(parsers.dash, true)
+ + parsers.bullet(parsers.asterisk, true)
+ + parsers.bullet(parsers.plus, true)
+
+ parsers.interrupting_enumerators
+ = parsers.enumerator(parsers.period, true)
+ + parsers.enumerator(parsers.rparent, true)
end
if options.html then
- parsers.html_interrupting = parsers.check_trail
- * ( parsers.html_incomplete_open_tag
- + parsers.html_incomplete_close_tag
- + parsers.html_incomplete_open_special_tag
- + parsers.html_comment_start
- + parsers.html_cdatasection_start
- + parsers.html_declaration_start
- + parsers.html_instruction_start
- - parsers.html_close_special_tag
- - parsers.html_empty_special_tag)
+ parsers.html_interrupting
+ = parsers.check_trail
+ * ( parsers.html_incomplete_open_tag
+ + parsers.html_incomplete_close_tag
+ + parsers.html_incomplete_open_special_tag
+ + parsers.html_comment_start
+ + parsers.html_cdatasection_start
+ + parsers.html_declaration_start
+ + parsers.html_instruction_start
+ - parsers.html_close_special_tag
+ - parsers.html_empty_special_tag)
else
parsers.html_interrupting = parsers.fail
end
@@ -29166,7 +30145,7 @@ function M.reader.new(writer, options)
* -V("EndlineExceptions")
+ parsers.check_optional_indent
* -V("EndlineExceptions")
- * -parsers.starter)
+ * -parsers.starter) / function(_) return end
* parsers.spacechar^0
parsers.Endline = parsers.endline
@@ -29192,30 +30171,37 @@ function M.reader.new(writer, options)
parsers.Space = parsers.spacechar^2 * parsers.Endline
/ writer.hard_line_break
- + parsers.spacechar^1 * parsers.Endline^-1 * parsers.eof / self.expandtabs
+ + parsers.spacechar^1
+ * parsers.Endline^-1
+ * parsers.eof / self.expandtabs
+ parsers.spacechar^1 * parsers.Endline
/ writer.soft_line_break
- + parsers.spacechar^1 * -parsers.newline / self.expandtabs
+ + parsers.spacechar^1
+ * -parsers.newline / self.expandtabs
parsers.NoSoftLineBreakSpace
= parsers.spacechar^2 * parsers.Endline
/ writer.hard_line_break
- + parsers.spacechar^1 * parsers.Endline^-1 * parsers.eof / self.expandtabs
+ + parsers.spacechar^1
+ * parsers.Endline^-1
+ * parsers.eof / self.expandtabs
+ parsers.spacechar^1 * parsers.Endline
/ writer.soft_line_break
- + parsers.spacechar^1 * -parsers.newline / self.expandtabs
+ + parsers.spacechar^1
+ * -parsers.newline / self.expandtabs
parsers.NonbreakingEndline
= parsers.endline
- / writer.soft_line_break
+ / writer.nbsp
parsers.NonbreakingSpace
- = parsers.spacechar^2 * parsers.Endline
- / writer.hard_line_break
- + parsers.spacechar^1 * parsers.Endline^-1 * parsers.eof / ""
- + parsers.spacechar^1 * parsers.Endline
+ = parsers.spacechar^2 * parsers.endline
+ / writer.nbsp
+ + parsers.spacechar^1
+ * parsers.endline^-1 * parsers.eof / ""
+ + parsers.spacechar^1 * parsers.endline
* parsers.optionalspace
- / writer.soft_line_break
+ / writer.nbsp
+ parsers.spacechar^1 * parsers.optionalspace
/ writer.nbsp
@@ -29264,18 +30250,20 @@ end
parsers.LinkAndEmph = Ct(parsers.link_and_emph_table)
/ self.defer_link_and_emphasis_processing
- parsers.EscapedChar = parsers.backslash * C(parsers.escapable) / writer.string
+ parsers.EscapedChar = parsers.backslash
+ * C(parsers.escapable) / writer.string
- parsers.InlineHtml = Cs(parsers.html_inline_comment) / writer.inline_html_comment
- + Cs(parsers.html_any_empty_inline_tag
- + parsers.html_inline_instruction
- + parsers.html_inline_cdatasection
- + parsers.html_inline_declaration
- + parsers.html_any_open_inline_tag
- + parsers.html_any_close_tag)
- / writer.inline_html_tag
+ parsers.InlineHtml = Cs(parsers.html_inline_comment)
+ / writer.inline_html_comment
+ + Cs(parsers.html_any_empty_inline_tag
+ + parsers.html_inline_instruction
+ + parsers.html_inline_cdatasection
+ + parsers.html_inline_declaration
+ + parsers.html_any_open_inline_tag
+ + parsers.html_any_close_tag)
+ / writer.inline_html_tag
- parsers.HtmlEntity = parsers.html_entities / writer.string
+ parsers.HtmlEntity = parsers.html_entities / writer.string
% \end{macrocode}
% \par
% \begin{markdown}
@@ -29294,15 +30282,18 @@ end
+ parsers.html_declaration))
/ writer.block_html_element
- parsers.indented_non_blank_line = parsers.indentedline - parsers.blankline
+ parsers.indented_non_blank_line = parsers.indentedline
+ - parsers.blankline
- parsers.Verbatim = Cs(
- parsers.check_code_trail
- * (parsers.line - parsers.blankline)
- * ((parsers.check_minimal_blank_indent_and_full_code_trail * parsers.blankline)^0
- * ((parsers.check_minimal_indent / "") * parsers.check_code_trail
- * (parsers.line - parsers.blankline))^1)^0
- ) / self.expandtabs / writer.verbatim
+ parsers.Verbatim
+ = Cs( parsers.check_code_trail
+ * (parsers.line - parsers.blankline)
+ * (( parsers.check_minimal_blank_indent_and_full_code_trail
+ * parsers.blankline)^0
+ * ( (parsers.check_minimal_indent / "")
+ * parsers.check_code_trail
+ * (parsers.line - parsers.blankline))^1)^0)
+ / self.expandtabs / writer.verbatim
parsers.Blockquote = parsers.blockquote_body
/ writer.blockquote
@@ -29341,73 +30332,79 @@ end
parsers.list_blank = parsers.conditionally_indented_blankline
- parsers.ref_or_block_list_separated = parsers.sep_group_no_output(parsers.list_blank)
- * parsers.minimally_indented_ref
- + parsers.block_sep_group(parsers.list_blank)
- * parsers.minimally_indented_block
-
- parsers.ref_or_block_non_separated = parsers.minimally_indented_ref
- + (parsers.succeed / writer.interblocksep)
- * parsers.minimally_indented_block
- - parsers.minimally_indented_blankline
-
- parsers.tight_list_loop_body_pair =
- parsers.create_loop_body_pair(parsers.ref_or_block_non_separated,
- parsers.minimally_indented_par_or_plain_no_blank,
- (parsers.succeed / writer.interblocksep),
- (parsers.succeed / writer.paragraphsep))
-
- parsers.loose_list_loop_body_pair =
- parsers.create_loop_body_pair(parsers.ref_or_block_list_separated,
- parsers.minimally_indented_par_or_plain,
- parsers.block_sep_group(parsers.list_blank),
- parsers.par_sep_group(parsers.list_blank))
-
- parsers.tight_list_content_loop = V("Block")
- * parsers.tight_list_loop_body_pair.block^0
- + (V("Paragraph") + V("Plain"))
- * parsers.ref_or_block_non_separated
- * parsers.tight_list_loop_body_pair.block^0
- + (V("Paragraph") + V("Plain"))
- * parsers.tight_list_loop_body_pair.par^0
-
- parsers.loose_list_content_loop = V("Block")
- * parsers.loose_list_loop_body_pair.block^0
- + (V("Paragraph") + V("Plain"))
- * parsers.ref_or_block_list_separated
- * parsers.loose_list_loop_body_pair.block^0
- + (V("Paragraph") + V("Plain"))
- * parsers.loose_list_loop_body_pair.par^0
-
- parsers.list_item_tightness_condition = -#( parsers.list_blank^0
- * parsers.minimally_indented_ref_or_block_or_par)
- * remove_indent("li")
- + remove_indent("li")
- * parsers.fail
-
- parsers.indented_content_tight = Ct( (parsers.blankline / "")
- * #parsers.list_blank
- * remove_indent("li")
- + ( (V("Reference") + (parsers.blankline / ""))
- * parsers.check_minimal_indent
- * parsers.tight_list_content_loop
- + (V("Reference") + (parsers.blankline / ""))
- + (parsers.tickbox^-1 / writer.escape)
- * parsers.tight_list_content_loop
- )
- * parsers.list_item_tightness_condition
- )
-
- parsers.indented_content_loose = Ct( (parsers.blankline / "")
- * #parsers.list_blank
- + ( (V("Reference") + (parsers.blankline / ""))
- * parsers.check_minimal_indent
- * parsers.loose_list_content_loop
- + (V("Reference") + (parsers.blankline / ""))
- + (parsers.tickbox^-1 / writer.escape)
- * parsers.loose_list_content_loop
- )
- )
+ parsers.ref_or_block_list_separated
+ = parsers.sep_group_no_output(parsers.list_blank)
+ * parsers.minimally_indented_ref
+ + parsers.block_sep_group(parsers.list_blank)
+ * parsers.minimally_indented_block
+
+ parsers.ref_or_block_non_separated
+ = parsers.minimally_indented_ref
+ + (parsers.succeed / writer.interblocksep)
+ * parsers.minimally_indented_block
+ - parsers.minimally_indented_blankline
+
+ parsers.tight_list_loop_body_pair =
+ parsers.create_loop_body_pair(
+ parsers.ref_or_block_non_separated,
+ parsers.minimally_indented_par_or_plain_no_blank,
+ (parsers.succeed / writer.interblocksep),
+ (parsers.succeed / writer.paragraphsep))
+
+ parsers.loose_list_loop_body_pair =
+ parsers.create_loop_body_pair(
+ parsers.ref_or_block_list_separated,
+ parsers.minimally_indented_par_or_plain,
+ parsers.block_sep_group(parsers.list_blank),
+ parsers.par_sep_group(parsers.list_blank))
+
+ parsers.tight_list_content_loop
+ = V("Block")
+ * parsers.tight_list_loop_body_pair.block^0
+ + (V("Paragraph") + V("Plain"))
+ * parsers.ref_or_block_non_separated
+ * parsers.tight_list_loop_body_pair.block^0
+ + (V("Paragraph") + V("Plain"))
+ * parsers.tight_list_loop_body_pair.par^0
+
+ parsers.loose_list_content_loop
+ = V("Block")
+ * parsers.loose_list_loop_body_pair.block^0
+ + (V("Paragraph") + V("Plain"))
+ * parsers.ref_or_block_list_separated
+ * parsers.loose_list_loop_body_pair.block^0
+ + (V("Paragraph") + V("Plain"))
+ * parsers.loose_list_loop_body_pair.par^0
+
+ parsers.list_item_tightness_condition
+ = -#( parsers.list_blank^0
+ * parsers.minimally_indented_ref_or_block_or_par)
+ * remove_indent("li")
+ + remove_indent("li")
+ * parsers.fail
+
+ parsers.indented_content_tight
+ = Ct( (parsers.blankline / "")
+ * #parsers.list_blank
+ * remove_indent("li")
+ + ( (V("Reference") + (parsers.blankline / ""))
+ * parsers.check_minimal_indent
+ * parsers.tight_list_content_loop
+ + (V("Reference") + (parsers.blankline / ""))
+ + (parsers.tickbox^-1 / writer.escape)
+ * parsers.tight_list_content_loop
+ )
+ * parsers.list_item_tightness_condition)
+
+ parsers.indented_content_loose
+ = Ct( (parsers.blankline / "")
+ * #parsers.list_blank
+ + ( (V("Reference") + (parsers.blankline / ""))
+ * parsers.check_minimal_indent
+ * parsers.loose_list_content_loop
+ + (V("Reference") + (parsers.blankline / ""))
+ + (parsers.tickbox^-1 / writer.escape)
+ * parsers.loose_list_content_loop))
parsers.TightListItem = function(starter)
return -parsers.ThematicBreak
@@ -29465,13 +30462,15 @@ end
local enumerator = parsers.enumerator(delimiter_type)
return Cg(enumerator, "listtype")
* (Ct( parsers.TightListItem(Cb("listtype"))
- * ((parsers.check_minimal_indent / "") * parsers.TightListItem(enumerator))^0)
+ * ( (parsers.check_minimal_indent / "")
+ * parsers.TightListItem(enumerator))^0)
* Cc(true)
* -#((parsers.list_blank^0 / "")
* parsers.check_minimal_indent * enumerator)
+ Ct( parsers.LooseListItem(Cb("listtype"))
* ((parsers.list_blank^0 / "")
- * (parsers.check_minimal_indent / "") * parsers.LooseListItem(enumerator))^0)
+ * (parsers.check_minimal_indent / "")
+ * parsers.LooseListItem(enumerator))^0)
* Cc(false)
) * Ct(Cb("listtype")) / ordered_list
end
@@ -29524,15 +30523,21 @@ end
- parsers.thematic_break_lines
parsers.heading_text = parsers.heading_line
- * ((V("Endline") / "\n") * (parsers.heading_line - parsers.heading_level))^0
+ * ( (V("Endline") / "\n")
+ * ( parsers.heading_line
+ - parsers.heading_level))^0
* parsers.newline^-1
- parsers.SetextHeading = parsers.freeze_trail * parsers.check_trail_no_rem
- * #(parsers.heading_text
- * parsers.check_minimal_indent * parsers.check_trail * parsers.heading_level)
+ parsers.SetextHeading = parsers.freeze_trail
+ * parsers.check_trail_no_rem
+ * #( parsers.heading_text
+ * parsers.check_minimal_indent
+ * parsers.check_trail
+ * parsers.heading_level)
* Cs(parsers.heading_text)
/ parsers.parse_heading_text
- * parsers.check_minimal_indent_and_trail * parsers.heading_level
+ * parsers.check_minimal_indent_and_trail
+ * parsers.heading_level
* parsers.newline
* parsers.unfreeze_trail
/ writer.heading
@@ -29584,14 +30589,18 @@ end
local current_extension_name = nil
self.insert_pattern = function(selector, pattern, pattern_name)
assert(pattern_name == nil or type(pattern_name) == "string")
- local _, _, lhs, pos, rhs = selector:find("^(%a+)%s+([%a%s]+%a+)%s+(%a+)$")
+ local _, _, lhs, pos, rhs
+ = selector:find("^(%a+)%s+([%a%s]+%a+)%s+(%a+)$")
assert(lhs ~= nil,
- [[Expected selector in form "LHS (before|after|instead of) RHS", not "]]
+ [[Expected selector in form ]]
+ .. [["LHS (before|after|instead of) RHS", not "]]
.. selector .. [["]])
assert(walkable_syntax[lhs] ~= nil,
- [[Rule ]] .. lhs .. [[ -> ... does not exist in markdown grammar]])
+ [[Rule ]] .. lhs
+ .. [[ -> ... does not exist in markdown grammar]])
assert(pos == "before" or pos == "after" or pos == "instead of",
- [[Expected positional specifier "before", "after", or "instead of", not "]]
+ [[Expected positional specifier "before", "after", ]]
+ .. [[or "instead of", not "]]
.. pos .. [["]])
local rule = walkable_syntax[lhs]
local index = nil
@@ -29609,10 +30618,12 @@ end
.. [[ does not exist in markdown grammar]])
local accountable_pattern
if current_extension_name then
- accountable_pattern = { pattern, current_extension_name, pattern_name }
+ accountable_pattern
+ = {pattern, current_extension_name, pattern_name}
else
assert(type(pattern) == "string",
- [[reader->insert_pattern() was called outside an extension with ]]
+ [[reader->insert_pattern() was called outside ]]
+ .. [[an extension with ]]
.. [[a PEG pattern instead of a rule name]])
accountable_pattern = pattern
end
@@ -29635,11 +30646,9 @@ end
local syntax =
{ "Blocks",
- Blocks = V("InitializeState")
- * ( V("ExpectedJekyllData")
- * (V("Blank")^0 / writer.interblocksep)
- )^-1
- * V("Blank")^0
+ Blocks = V("InitializeState")
+ * V("ExpectedJekyllData")
+ * V("Blank")^0
% \end{macrocode}
% \par
% \begin{markdown}
@@ -29650,71 +30659,72 @@ end
%
% \end{markdown}
% \begin{macrocode}
- * ( V("Block")
- * ( V("Blank")^0 * parsers.eof
- + ( V("Blank")^2 / writer.paragraphsep
- + V("Blank")^0 / writer.interblocksep
- )
- )
- + ( V("Paragraph") + V("Plain") )
- * ( V("Blank")^0 * parsers.eof
- + ( V("Blank")^2 / writer.paragraphsep
- + V("Blank")^0 / writer.interblocksep
- )
- )
- * V("Block")
- * ( V("Blank")^0 * parsers.eof
- + ( V("Blank")^2 / writer.paragraphsep
- + V("Blank")^0 / writer.interblocksep
- )
- )
- + ( V("Paragraph") + V("Plain") )
- * ( V("Blank")^0 * parsers.eof
- + V("Blank")^0 / writer.paragraphsep
- )
- )^0,
-
- ExpectedJekyllData = parsers.fail,
-
- Blank = parsers.Blank,
- Reference = parsers.Reference,
-
- Blockquote = parsers.Blockquote,
- Verbatim = parsers.Verbatim,
- ThematicBreak = parsers.ThematicBreak,
- BulletList = parsers.BulletList,
- OrderedList = parsers.OrderedList,
- DisplayHtml = parsers.DisplayHtml,
- Heading = parsers.Heading,
- Paragraph = parsers.Paragraph,
- Plain = parsers.Plain,
-
- EndlineExceptions = parsers.EndlineExceptions,
+ * ( V("Block")
+ * ( V("Blank")^0 * parsers.eof
+ + ( V("Blank")^2 / writer.paragraphsep
+ + V("Blank")^0 / writer.interblocksep
+ )
+ )
+ + ( V("Paragraph") + V("Plain") )
+ * ( V("Blank")^0 * parsers.eof
+ + ( V("Blank")^2 / writer.paragraphsep
+ + V("Blank")^0 / writer.interblocksep
+ )
+ )
+ * V("Block")
+ * ( V("Blank")^0 * parsers.eof
+ + ( V("Blank")^2 / writer.paragraphsep
+ + V("Blank")^0 / writer.interblocksep
+ )
+ )
+ + ( V("Paragraph") + V("Plain") )
+ * ( V("Blank")^0 * parsers.eof
+ + V("Blank")^0 / writer.paragraphsep
+ )
+ )^0,
+
+ ExpectedJekyllData = parsers.succeed,
+
+ Blank = parsers.Blank,
+ Reference = parsers.Reference,
+
+ Blockquote = parsers.Blockquote,
+ Verbatim = parsers.Verbatim,
+ ThematicBreak = parsers.ThematicBreak,
+ BulletList = parsers.BulletList,
+ OrderedList = parsers.OrderedList,
+ DisplayHtml = parsers.DisplayHtml,
+ Heading = parsers.Heading,
+ Paragraph = parsers.Paragraph,
+ Plain = parsers.Plain,
+
+ EndlineExceptions = parsers.EndlineExceptions,
NoSoftLineBreakEndlineExceptions
- = parsers.NoSoftLineBreakEndlineExceptions,
-
- Str = parsers.Str,
- Space = parsers.Space,
- NoSoftLineBreakSpace = parsers.NoSoftLineBreakSpace,
- OptionalIndent = parsers.OptionalIndent,
- Endline = parsers.Endline,
- EndlineNoSub = parsers.EndlineNoSub,
+ = parsers.NoSoftLineBreakEndlineExceptions,
+
+ Str = parsers.Str,
+ Space = parsers.Space,
+ NoSoftLineBreakSpace
+ = parsers.NoSoftLineBreakSpace,
+ OptionalIndent = parsers.OptionalIndent,
+ Endline = parsers.Endline,
+ EndlineNoSub = parsers.EndlineNoSub,
NoSoftLineBreakEndline
- = parsers.NoSoftLineBreakEndline,
- EndlineBreak = parsers.EndlineBreak,
- LinkAndEmph = parsers.LinkAndEmph,
- Code = parsers.Code,
- AutoLinkUrl = parsers.AutoLinkUrl,
- AutoLinkEmail = parsers.AutoLinkEmail,
+ = parsers.NoSoftLineBreakEndline,
+ EndlineBreak = parsers.EndlineBreak,
+ LinkAndEmph = parsers.LinkAndEmph,
+ Code = parsers.Code,
+ AutoLinkUrl = parsers.AutoLinkUrl,
+ AutoLinkEmail = parsers.AutoLinkEmail,
AutoLinkRelativeReference
- = parsers.AutoLinkRelativeReference,
- InlineHtml = parsers.InlineHtml,
- HtmlEntity = parsers.HtmlEntity,
- EscapedChar = parsers.EscapedChar,
- Smart = parsers.Smart,
- Symbol = parsers.Symbol,
- SpecialChar = parsers.fail,
- InitializeState = parsers.succeed,
+ = parsers.AutoLinkRelativeReference,
+ InlineHtml = parsers.InlineHtml,
+ HtmlEntity = parsers.HtmlEntity,
+ EscapedChar = parsers.EscapedChar,
+ Smart = parsers.Smart,
+ Symbol = parsers.Symbol,
+ SpecialChar = parsers.fail,
+ InitializeState = parsers.succeed,
}
% \end{macrocode}
% \par
@@ -29732,13 +30742,17 @@ end
self.update_rule = function(rule_name, get_pattern)
assert(current_extension_name ~= nil)
assert(syntax[rule_name] ~= nil,
- [[Rule ]] .. rule_name .. [[ -> ... does not exist in markdown grammar]])
+ [[Rule ]] .. rule_name
+ .. [[ -> ... does not exist in markdown grammar]])
local previous_pattern
local extension_name
if walkable_syntax[rule_name] then
- local previous_accountable_pattern = walkable_syntax[rule_name][1]
+ local previous_accountable_pattern
+ = walkable_syntax[rule_name][1]
previous_pattern = previous_accountable_pattern[1]
- extension_name = previous_accountable_pattern[2] .. ", " .. current_extension_name
+ extension_name
+ = previous_accountable_pattern[2]
+ .. ", " .. current_extension_name
else
previous_pattern = nil
extension_name = current_extension_name
@@ -29868,9 +30882,11 @@ end
pattern_name = "Anonymous Pattern"
end
local extension_name = rhs[2]
- human_readable_rhs = pattern_name .. [[ (]] .. extension_name .. [[)]]
+ human_readable_rhs = pattern_name .. [[ (]]
+ .. extension_name .. [[)]]
end
- local encoded_rhs = util.encode_json_string(human_readable_rhs)
+ local encoded_rhs
+ = util.encode_json_string(human_readable_rhs)
local output_line = [[ ]] .. encoded_rhs
if rhs_index < #rule then
output_line = output_line .. ","
@@ -29888,7 +30904,8 @@ end
local output = table.concat(output_lines, "\n")
local output_filename = options.debugExtensionsFileName
local output_file = assert(io.open(output_filename, "w"),
- [[Could not open file "]] .. output_filename .. [[" for writing]])
+ [[Could not open file "]] .. output_filename
+ .. [[" for writing]])
assert(output_file:write(output))
assert(output_file:close())
end
@@ -29981,7 +30998,7 @@ end
end
local blocks_nested_t = util.table_copy(syntax)
- blocks_nested_t.ExpectedJekyllData = parsers.fail
+ blocks_nested_t.ExpectedJekyllData = parsers.succeed
parsers.blocks_nested = Ct(blocks_nested_t)
parsers.blocks = Ct(syntax)
@@ -30011,8 +31028,10 @@ end
local inlines_no_link_or_emphasis_t = util.table_copy(inlines_t)
inlines_no_link_or_emphasis_t.LinkAndEmph = parsers.fail
- inlines_no_link_or_emphasis_t.EndlineExceptions = parsers.EndlineExceptions - parsers.eof
- parsers.inlines_no_link_or_emphasis = Ct(inlines_no_link_or_emphasis_t)
+ inlines_no_link_or_emphasis_t.EndlineExceptions
+ = parsers.EndlineExceptions - parsers.eof
+ parsers.inlines_no_link_or_emphasis
+ = Ct(inlines_no_link_or_emphasis_t)
% \end{macrocode}
% \par
% \begin{markdown}
@@ -30039,7 +31058,8 @@ end
elseif form == "nfkd" then
input = uni_algos.normalize.NFKD(input)
else
- error(format("Unknown normalization form %s", form))
+ return writer.error(
+ format("Unknown normalization form %s", form))
end
end
% \end{macrocode}
@@ -30055,30 +31075,12 @@ end
end
% \end{macrocode}
% \begin{markdown}
-% When determining the name of the cache file, create salt for the hashing
-% function out of the package version and the passed options recognized by the
-% Lua interface (see Section <#sec:lua-options>). The \Opt{cacheDir} option
-% is disregarded.
+% Clear the table of references.
% \end{markdown}
% \begin{macrocode}
references = {}
- local opt_string = {}
- for k, _ in pairs(defaultOptions) do
- local v = options[k]
- if type(v) == "table" then
- for _, i in ipairs(v) do
- opt_string[#opt_string+1] = k .. "=" .. tostring(i)
- end
- elseif k ~= "cacheDir" then
- opt_string[#opt_string+1] = k .. "=" .. tostring(v)
- end
- end
- table.sort(opt_string)
- local salt = table.concat(opt_string, ",") .. "," .. metadata.version
- local output
- local function convert(input)
- local document = self.parser_functions.parse_blocks(input)
- local output = util.rope_to_string(writer.document(document))
+ local document = self.parser_functions.parse_blocks(input)
+ local output = util.rope_to_string(writer.document(document))
% \end{macrocode}
% \begin{markdown}
% Remove block element / paragraph separators immediately followed by the
@@ -30086,82 +31088,49 @@ end
% Then, remove any leftover output of \luamref{writer->undosep}.
% \end{markdown}
% \begin{macrocode}
- local undosep_start, undosep_end
- local potential_secend_start, secend_start
- local potential_sep_start, sep_start
+ local undosep_start, undosep_end
+ local potential_secend_start, secend_start
+ local potential_sep_start, sep_start
+ while true do
+ -- find a `writer->undosep`
+ undosep_start, undosep_end
+ = output:find(writer.undosep_text, 1, true)
+ if undosep_start == nil then break end
+ -- skip any preceding section ends
+ secend_start = undosep_start
while true do
- -- find a `writer->undosep`
- undosep_start, undosep_end = output:find(writer.undosep_text, 1, true)
- if undosep_start == nil then break end
- -- skip any preceding section ends
- secend_start = undosep_start
- while true do
- potential_secend_start = secend_start - #writer.secend_text
- if potential_secend_start < 1
- or output:sub(potential_secend_start, secend_start - 1) ~= writer.secend_text then
- break
- end
- secend_start = potential_secend_start
+ potential_secend_start = secend_start - #writer.secend_text
+ if potential_secend_start < 1
+ or output:sub(potential_secend_start,
+ secend_start - 1) ~= writer.secend_text
+ then
+ break
end
- -- find an immediately preceding block element / paragraph separator
- sep_start = secend_start
- potential_sep_start = sep_start - #writer.interblocksep_text
+ secend_start = potential_secend_start
+ end
+ -- find an immediately preceding
+ -- block element / paragraph separator
+ sep_start = secend_start
+ potential_sep_start = sep_start - #writer.interblocksep_text
+ if potential_sep_start >= 1
+ and output:sub(potential_sep_start,
+ sep_start - 1) == writer.interblocksep_text
+ then
+ sep_start = potential_sep_start
+ else
+ potential_sep_start = sep_start - #writer.paragraphsep_text
if potential_sep_start >= 1
- and output:sub(potential_sep_start, sep_start - 1) == writer.interblocksep_text then
+ and output:sub(potential_sep_start,
+ sep_start - 1) == writer.paragraphsep_text
+ then
sep_start = potential_sep_start
- else
- potential_sep_start = sep_start - #writer.paragraphsep_text
- if potential_sep_start >= 1
- and output:sub(potential_sep_start, sep_start - 1) == writer.paragraphsep_text then
- sep_start = potential_sep_start
- end
end
- -- remove `writer->undosep` and immediately preceding block element / paragraph separator
- output = output:sub(1, sep_start - 1)
- .. output:sub(secend_start, undosep_start - 1)
- .. output:sub(undosep_end + 1)
- end
- return output
- end
-% \end{macrocode}
-% \begin{markdown}
-% If we cache markdown documents, produce the cache file and transform its
-% filename to plain \TeX{} output via the \luamref{writer->pack} method.
-% \end{markdown}
-% \begin{macrocode}
- if options.eagerCache or options.finalizeCache then
- local name = util.cache(options.cacheDir, input, salt, convert,
- ".md" .. writer.suffix)
- output = writer.pack(name)
-% \end{macrocode}
-% \begin{markdown}
-% Otherwise, return the result of the conversion directly.
-% \end{markdown}
-% \begin{macrocode}
- else
- output = convert(input)
- end
-% \end{macrocode}
-% \begin{markdown}
-% If the \Opt{finalizeCache} option is enabled, populate the frozen cache in
-% the file \Opt{frozenCacheFileName} with an entry for markdown document
-% number \Opt{frozenCacheCounter}.
-% \end{markdown}
-% \begin{macrocode}
- if options.finalizeCache then
- local file, mode
- if options.frozenCacheCounter > 0 then
- mode = "a"
- else
- mode = "w"
end
- file = assert(io.open(options.frozenCacheFileName, mode),
- [[Could not open file "]] .. options.frozenCacheFileName
- .. [[" for writing]])
- assert(file:write([[\expandafter\global\expandafter\def\csname ]]
- .. [[markdownFrozenCache]] .. options.frozenCacheCounter
- .. [[\endcsname{]] .. output .. [[}]] .. "\n"))
- assert(file:close())
+ -- remove `writer->undosep` and immediately preceding
+ -- block element / paragraph separator
+ output = output:sub(1, sep_start - 1)
+ .. output:sub(secend_start, undosep_start - 1)
+ .. output:sub(undosep_end + 1)
end
return output
end
@@ -30223,10 +31192,13 @@ M.extensions.bracketed_spans = function()
+ parsers.autolink
+ V("InlineHtml")
+ ( parsers.backslash * parsers.backslash)
- + ( parsers.backslash * (parsers.lbracket + parsers.rbracket)
+ + ( parsers.backslash
+ * (parsers.lbracket + parsers.rbracket)
+ V("Space") + V("Endline")
+ (parsers.any
- - (parsers.newline + parsers.lbracket + parsers.rbracket
+ - ( parsers.newline
+ + parsers.lbracket
+ + parsers.rbracket
+ parsers.blankline^2))))^1)
/ self.parser_functions.parse_inlines)
* parsers.rbracket
@@ -30289,11 +31261,15 @@ M.extensions.citations = function(citation_nbsps)
end
end
else
- table.insert(buffer, {"\\markdownRenderer", text_cites and "TextCite" or "Cite",
- "{", #cites, "}"})
+ table.insert(buffer,
+ {"\\markdownRenderer",
+ text_cites and "TextCite" or "Cite",
+ "{", #cites, "}"})
for _,cite in ipairs(cites) do
- table.insert(buffer, {cite.suppress_author and "-" or "+", "{",
- cite.prenote or "", "}{", cite.postnote or "", "}{", cite.name, "}"})
+ table.insert(buffer,
+ {cite.suppress_author and "-" or "+", "{",
+ cite.prenote or "", "}{",
+ cite.postnote or "", "}{", cite.name, "}"})
end
end
return buffer
@@ -30309,12 +31285,16 @@ M.extensions.citations = function(citation_nbsps)
local citation_name
= Cs(parsers.dash^-1) * parsers.at
* Cs(citation_chars
- * (((citation_chars + parsers.internal_punctuation
+ * ((( citation_chars
+ + parsers.internal_punctuation
- parsers.comma - parsers.semicolon)
- * -#((parsers.internal_punctuation - parsers.comma
+ * -#(( parsers.internal_punctuation
+ - parsers.comma
- parsers.semicolon)^0
- * -(citation_chars + parsers.internal_punctuation
- - parsers.comma - parsers.semicolon)))^0
+ * -( citation_chars
+ + parsers.internal_punctuation
+ - parsers.comma
+ - parsers.semicolon)))^0
* citation_chars)^-1)
local citation_body_prenote
@@ -30323,10 +31303,14 @@ M.extensions.citations = function(citation_nbsps)
+ parsers.inticks
+ parsers.autolink
+ V("InlineHtml")
- + V("Space") + V("Endline")
+ + V("Space") + V("EndlineNoSub")
+ (parsers.anyescaped
- - (parsers.newline + parsers.rbracket + parsers.blankline^2))
- - (parsers.spnl * parsers.dash^-1 * parsers.at))^1)
+ - ( parsers.newline
+ + parsers.rbracket
+ + parsers.blankline^2))
+ - ( parsers.spnl
+ * parsers.dash^-1
+ * parsers.at))^1)
local citation_body_postnote
= Cs((parsers.alphanumeric^1
@@ -30334,9 +31318,11 @@ M.extensions.citations = function(citation_nbsps)
+ parsers.inticks
+ parsers.autolink
+ V("InlineHtml")
- + V("Space") + V("Endline")
+ + V("Space") + V("EndlineNoSub")
+ (parsers.anyescaped
- - (parsers.newline + parsers.rbracket + parsers.semicolon
+ - ( parsers.newline
+ + parsers.rbracket
+ + parsers.semicolon
+ parsers.blankline^2))
- (parsers.spnl * parsers.rbracket))^1)
@@ -30347,8 +31333,9 @@ M.extensions.citations = function(citation_nbsps)
* parsers.spnlc
)
* citation_name
- * (parsers.internal_punctuation - parsers.semicolon)^-1
- * ( parsers.spnlc
+ * ( parsers.internal_punctuation
+ - parsers.semicolon)^-1
+ * ( parsers.spnlc / function(_) return end
* citation_body_postnote
+ Cc("")
* parsers.spnlc
@@ -30369,7 +31356,9 @@ M.extensions.citations = function(citation_nbsps)
+ V("InlineHtml")
+ V("Space") + V("Endline")
+ (parsers.anyescaped
- - (parsers.newline + parsers.rbracket + parsers.at
+ - ( parsers.newline
+ + parsers.rbracket
+ + parsers.at
+ parsers.semicolon + parsers.blankline^2))
- (parsers.spnl * parsers.rbracket))^0)
@@ -30463,7 +31452,8 @@ M.extensions.content_blocks = function(language_map)
% \begin{macrocode}
local languages_json = (function()
local base, prev, curr
- for _, pathname in ipairs{kpse.lookup(language_map, { all=true })} do
+ for _, pathname in ipairs{kpse.lookup(language_map,
+ {all=true})} do
local file = io.open(pathname, "r")
if not file then goto continue end
local input = assert(file:read("*a"))
@@ -30504,20 +31494,20 @@ M.extensions.content_blocks = function(language_map)
suf = suf:lower()
if type == "onlineimage" then
return {"\\markdownRendererContentBlockOnlineImage{",suf,"}",
- "{",self.string(src),"}",
- "{",self.uri(src),"}",
- "{",self.string(tit or ""),"}"}
+ "{",self.string(src),"}",
+ "{",self.uri(src),"}",
+ "{",self.string(tit or ""),"}"}
elseif languages_json[suf] then
return {"\\markdownRendererContentBlockCode{",suf,"}",
- "{",self.string(languages_json[suf]),"}",
- "{",self.string(src),"}",
- "{",self.uri(src),"}",
- "{",self.string(tit or ""),"}"}
+ "{",self.string(languages_json[suf]),"}",
+ "{",self.string(src),"}",
+ "{",self.uri(src),"}",
+ "{",self.string(tit or ""),"}"}
else
return {"\\markdownRendererContentBlock{",suf,"}",
- "{",self.string(src),"}",
- "{",self.uri(src),"}",
- "{",self.string(tit or ""),"}"}
+ "{",self.string(src),"}",
+ "{",self.uri(src),"}",
+ "{",self.string(tit or ""),"}"}
end
end
end, extend_reader = function(self)
@@ -30552,8 +31542,8 @@ M.extensions.content_blocks = function(language_map)
return parser
end)("png", "jpg", "jpeg", "gif", "tif", "tiff")
- -- online image url for iA Writer content blocks with mandatory suffix,
- -- allowing nested brackets:
+ -- online image url for iA Writer content blocks with
+ -- mandatory suffix, allowing nested brackets:
local onlineimageurl
= (parsers.less
* Cs((parsers.anyescaped
@@ -30631,8 +31621,9 @@ M.extensions.definition_lists = function(tight_lists)
local function dlitem(term, defs)
local retVal = {"\\markdownRendererDlItem{",term,"}"}
for _, def in ipairs(defs) do
- retVal[#retVal+1] = {"\\markdownRendererDlDefinitionBegin ",def,
- "\\markdownRendererDlDefinitionEnd "}
+ retVal[#retVal+1]
+ = {"\\markdownRendererDlDefinitionBegin ",def,
+ "\\markdownRendererDlDefinitionEnd "}
end
retVal[#retVal+1] = "\\markdownRendererDlItemEnd "
return retVal
@@ -30658,17 +31649,26 @@ M.extensions.definition_lists = function(tight_lists)
local defstartchar = S("~:")
- local defstart = parsers.check_trail_length(0) * defstartchar * #parsers.spacing
- * (parsers.tab + parsers.space^-3)
- + parsers.check_trail_length(1) * defstartchar * #parsers.spacing
- * (parsers.tab + parsers.space^-2)
- + parsers.check_trail_length(2) * defstartchar * #parsers.spacing
- * (parsers.tab + parsers.space^-1)
- + parsers.check_trail_length(3) * defstartchar * #parsers.spacing
-
- local indented_line = (parsers.check_minimal_indent / "") * parsers.check_code_trail * parsers.line
-
- local blank = parsers.check_minimal_blank_indent_and_any_trail * parsers.optionalspace * parsers.newline
+ local defstart
+ = parsers.check_trail_length(0) * defstartchar
+ * #parsers.spacing
+ * (parsers.tab + parsers.space^-3)
+ + parsers.check_trail_length(1)
+ * defstartchar * #parsers.spacing
+ * (parsers.tab + parsers.space^-2)
+ + parsers.check_trail_length(2)
+ * defstartchar * #parsers.spacing
+ * (parsers.tab + parsers.space^-1)
+ + parsers.check_trail_length(3)
+ * defstartchar * #parsers.spacing
+
+ local indented_line
+ = (parsers.check_minimal_indent / "")
+ * parsers.check_code_trail * parsers.line
+
+ local blank
+ = parsers.check_minimal_blank_indent_and_any_trail
+ * parsers.optionalspace * parsers.newline
local dlchunk = Cs(parsers.line * (indented_line - blank)^0)
@@ -30685,24 +31685,24 @@ M.extensions.definition_lists = function(tight_lists)
end
local DefinitionListItemLoose
- = C(parsers.line) * blank^0
- * Ct((parsers.check_minimal_indent * (defstart
- * indented_blocks(dlchunk)
- / self.parser_functions.parse_blocks_nested))^1)
- * Cc(false) / definition_list_item
+ = C(parsers.line) * blank^0
+ * Ct((parsers.check_minimal_indent * (defstart
+ * indented_blocks(dlchunk)
+ / self.parser_functions.parse_blocks_nested))^1)
+ * Cc(false) / definition_list_item
local DefinitionListItemTight
- = C(parsers.line)
- * Ct((parsers.check_minimal_indent * (defstart * dlchunk
- / self.parser_functions.parse_blocks_nested))^1)
- * Cc(true) / definition_list_item
+ = C(parsers.line)
+ * Ct((parsers.check_minimal_indent * (defstart * dlchunk
+ / self.parser_functions.parse_blocks_nested))^1)
+ * Cc(true) / definition_list_item
local DefinitionList
- = ( Ct(DefinitionListItemLoose^1) * Cc(false)
- + Ct(DefinitionListItemTight^1)
- * (blank^0
- * -DefinitionListItemLoose * Cc(true))
- ) / writer.definitionlist
+ = ( Ct(DefinitionListItemLoose^1) * Cc(false)
+ + Ct(DefinitionListItemTight^1)
+ * (blank^0
+ * -DefinitionListItemLoose * Cc(true))
+ ) / writer.definitionlist
self.insert_pattern("Block after Heading",
DefinitionList, "DefinitionList")
@@ -30787,7 +31787,8 @@ M.extensions.fancy_lists = function()
return {"\\markdownRendererFancyOlItemWithNumber{",num,"}",s,
"\\markdownRendererFancyOlItemEnd "}
else
- return {"\\markdownRendererFancyOlItem ",s,"\\markdownRendererFancyOlItemEnd "}
+ return {"\\markdownRendererFancyOlItem ",s,
+ "\\markdownRendererFancyOlItemEnd "}
end
end
end, extend_reader = function(self)
@@ -30808,7 +31809,8 @@ M.extensions.fancy_lists = function()
continuation_marker = marker
end
for _,delim in ipairs(delims) do
- table.insert(markers_table, {start_marker, continuation_marker, delim})
+ table.insert(markers_table,
+ {start_marker, continuation_marker, delim})
end
end
return markers_table
@@ -30827,15 +31829,18 @@ M.extensions.fancy_lists = function()
local roman_marker = function(chars)
local m, d, c = P(chars[1]), P(chars[2]), P(chars[3])
- local l, x, v, i = P(chars[4]), P(chars[5]), P(chars[6]), P(chars[7])
+ local l, x, v, i
+ = P(chars[4]), P(chars[5]), P(chars[6]), P(chars[7])
return m^-3
* (c*m + c*d + d^-1 * c^-3)
* (x*c + x*l + l^-1 * x^-3)
* (i*x + i*v + v^-1 * i^-3)
end
- local lowercase_roman_marker = roman_marker({"m", "d", "c", "l", "x", "v", "i"})
- local uppercase_roman_marker = roman_marker({"M", "D", "C", "L", "X", "V", "I"})
+ local lowercase_roman_marker
+ = roman_marker({"m", "d", "c", "l", "x", "v", "i"})
+ local uppercase_roman_marker
+ = roman_marker({"M", "D", "C", "L", "X", "V", "I"})
local lowercase_opening_roman_marker = P("i")
local uppercase_opening_roman_marker = P("I")
@@ -30859,7 +31864,8 @@ M.extensions.fancy_lists = function()
local markers_table = combine_markers_and_delims(markers, delims)
- local function enumerator(start_marker, _, delimiter_type, interrupting)
+ local function enumerator(start_marker, _,
+ delimiter_type, interrupting)
local delimiter_range
local allowed_end
if interrupting then
@@ -30867,7 +31873,8 @@ M.extensions.fancy_lists = function()
allowed_end = C(parsers.spacechar^1) * #parsers.linechar
else
delimiter_range = start_marker
- allowed_end = C(parsers.spacechar^1) + #(parsers.newline + parsers.eof)
+ allowed_end = C(parsers.spacechar^1)
+ + #(parsers.newline + parsers.eof)
end
return parsers.check_trail
@@ -30889,13 +31896,15 @@ M.extensions.fancy_lists = function()
end
local function roman2number(roman)
- local romans = { ["M"] = 1000, ["D"] = 500, ["C"] = 100, ["L"] = 50, ["X"] = 10, ["V"] = 5, ["I"] = 1 }
+ local romans = { ["M"] = 1000, ["D"] = 500, ["C"] = 100,
+ ["L"] = 50, ["X"] = 10, ["V"] = 5, ["I"] = 1 }
local numeral = 0
local i = 1
local len = string.len(roman)
while i < len do
- local z1, z2 = romans[ string.sub(roman, i, i) ], romans[ string.sub(roman, i+1, i+1) ]
+ local z1, z2 = romans[ string.sub(roman, i, i) ],
+ romans[ string.sub(roman, i+1, i+1) ]
if z1 < z2 then
numeral = numeral + (z2 - z1)
i = i + 2
@@ -30904,7 +31913,9 @@ M.extensions.fancy_lists = function()
i = i + 1
end
end
- if i <= len then numeral = numeral + romans[ string.sub(roman,i,i) ] end
+ if i <= len then
+ numeral = numeral + romans[ string.sub(roman,i,i) ]
+ end
return numeral
end
@@ -30929,11 +31940,13 @@ M.extensions.fancy_lists = function()
end
num = numstr:match("^([A-Z])$")
if num then
- return string.byte(num) - string.byte("A") + 1, "UpperAlpha", numdelim
+ return string.byte(num) - string.byte("A") + 1,
+ "UpperAlpha", numdelim
end
num = numstr:match("^([a-z])$")
if num then
- return string.byte(num) - string.byte("a") + 1, "LowerAlpha", numdelim
+ return string.byte(num) - string.byte("a") + 1,
+ "LowerAlpha", numdelim
end
num = numstr:match("^([IVXLCDM]+)")
if num then
@@ -30947,30 +31960,39 @@ M.extensions.fancy_lists = function()
end
local function fancylist(items,tight,start)
- local startnum, numstyle, numdelim = sniffstyle(start[2][1], start[2][2])
+ local startnum, numstyle, numdelim
+ = sniffstyle(start[2][1], start[2][2])
return writer.fancylist(items,tight,
options.startNumber and startnum or 1,
numstyle or "Decimal",
numdelim or "Default")
end
- local FancyListOfType = function(start_marker, continuation_marker, delimiter_type)
- local enumerator_start = enumerator(start_marker, continuation_marker, delimiter_type)
- local enumerator_cont = enumerator(continuation_marker, continuation_marker, delimiter_type)
- return Cg(enumerator_start, "listtype")
- * (Ct( TightListItem(Cb("listtype"))
- * ((parsers.check_minimal_indent / "") * TightListItem(enumerator_cont))^0)
- * Cc(true)
- * -#((parsers.conditionally_indented_blankline^0 / "")
- * parsers.check_minimal_indent * enumerator_cont)
- + Ct( LooseListItem(Cb("listtype"))
- * ((parsers.conditionally_indented_blankline^0 / "")
- * (parsers.check_minimal_indent / "") * LooseListItem(enumerator_cont))^0)
- * Cc(false)
- ) * Ct(Cb("listtype")) / fancylist
- end
+ local FancyListOfType
+ = function(start_marker, continuation_marker, delimiter_type)
+ local enumerator_start
+ = enumerator(start_marker, continuation_marker,
+ delimiter_type)
+ local enumerator_cont
+ = enumerator(continuation_marker, continuation_marker,
+ delimiter_type)
+ return Cg(enumerator_start, "listtype")
+ * (Ct( TightListItem(Cb("listtype"))
+ * ((parsers.check_minimal_indent / "")
+ * TightListItem(enumerator_cont))^0)
+ * Cc(true)
+ * -#((parsers.conditionally_indented_blankline^0 / "")
+ * parsers.check_minimal_indent * enumerator_cont)
+ + Ct( LooseListItem(Cb("listtype"))
+ * ((parsers.conditionally_indented_blankline^0 / "")
+ * (parsers.check_minimal_indent / "")
+ * LooseListItem(enumerator_cont))^0)
+ * Cc(false)
+ ) * Ct(Cb("listtype")) / fancylist
+ end
- local FancyList = join_table_with_func(FancyListOfType, markers_table)
+ local FancyList
+ = join_table_with_func(FancyListOfType, markers_table)
local Endline = parsers.newline
* (parsers.check_minimal_indent
@@ -31026,14 +32048,17 @@ M.extensions.fenced_code = function(blank_before_code_fence,
s = s:gsub("\n$", "")
local buf = {}
if attr ~= nil then
- table.insert(buf, {"\\markdownRendererFencedCodeAttributeContextBegin",
- self.attributes(attr)})
+ table.insert(buf,
+ {"\\markdownRendererFencedCodeAttributeContextBegin",
+ self.attributes(attr)})
end
local name = util.cache_verbatim(options.cacheDir, s)
- table.insert(buf, {"\\markdownRendererInputFencedCode{",
- name,"}{",self.string(i),"}{",self.infostring(i),"}"})
+ table.insert(buf,
+ {"\\markdownRendererInputFencedCode{",
+ name,"}{",self.string(i),"}{",self.infostring(i),"}"})
if attr ~= nil then
- table.insert(buf, "\\markdownRendererFencedCodeAttributeContextEnd{}")
+ table.insert(buf,
+ "\\markdownRendererFencedCodeAttributeContextEnd{}")
end
return buf
end
@@ -31073,11 +32098,13 @@ M.extensions.fenced_code = function(blank_before_code_fence,
- parsers.newline)^0)
/ strip_enclosing_whitespaces)
- local backtick_infostring = Cs(Cs((V("HtmlEntity")
- + (-#(parsers.backslash * parsers.backtick) * parsers.anyescaped)
- - parsers.newline
- - parsers.backtick)^0)
- / strip_enclosing_whitespaces)
+ local backtick_infostring
+ = Cs( Cs((V("HtmlEntity")
+ + ( -#(parsers.backslash * parsers.backtick)
+ * parsers.anyescaped)
+ - parsers.newline
+ - parsers.backtick)^0)
+ / strip_enclosing_whitespaces)
local fenceindent
@@ -31099,77 +32126,93 @@ M.extensions.fenced_code = function(blank_before_code_fence,
end
end
- local function count_fenced_start_indent(_, _, indent_table, trail)
- local last_indent_name = get_last_indent_name(indent_table)
- fenceindent = 0
- if last_indent_name ~= "li" then
- fenceindent = #trail
+ local count_fenced_start_indent =
+ function(_, _, indent_table, trail)
+ local last_indent_name = get_last_indent_name(indent_table)
+ fenceindent = 0
+ if last_indent_name ~= "li" then
+ fenceindent = #trail
+ end
+ return true
end
- return true
- end
- local fencehead = function(char, infostring)
- return Cmt(Cb("indent_info") * parsers.check_trail, count_fenced_start_indent)
- * Cg(char^3, "fencelength")
- * parsers.optionalspace
- * infostring
- * (parsers.newline + parsers.eof)
+ local fencehead = function(char, infostring)
+ return Cmt( Cb("indent_info")
+ * parsers.check_trail, count_fenced_start_indent)
+ * Cg(char^3, "fencelength")
+ * parsers.optionalspace
+ * infostring
+ * (parsers.newline + parsers.eof)
end
- local fencetail = function(char)
- return parsers.check_trail_no_rem
- * Cmt(C(char^3) * Cb("fencelength"), captures_geq_length)
- * parsers.optionalspace * (parsers.newline + parsers.eof)
- + parsers.eof
+ local fencetail = function(char)
+ return parsers.check_trail_no_rem
+ * Cmt(C(char^3) * Cb("fencelength"), captures_geq_length)
+ * parsers.optionalspace * (parsers.newline + parsers.eof)
+ + parsers.eof
end
- local function process_fenced_line(s, i, indent_table, line_content, is_blank) -- luacheck: ignore s i
- local remainder = ""
- if has_trail(indent_table) then
- remainder = indent_table.trail.internal_remainder
- end
+ local process_fenced_line =
+ function(s, i, -- luacheck: ignore s i
+ indent_table, line_content, is_blank)
+ local remainder = ""
+ if has_trail(indent_table) then
+ remainder = indent_table.trail.internal_remainder
+ end
- if is_blank and get_last_indent_name(indent_table) == "li" then
- remainder = ""
- end
+ if is_blank
+ and get_last_indent_name(indent_table) == "li" then
+ remainder = ""
+ end
- local str = remainder .. line_content
- local index = 1
- local remaining = fenceindent
+ local str = remainder .. line_content
+ local index = 1
+ local remaining = fenceindent
- while true do
- local c = str:sub(index, index)
- if c == " " and remaining > 0 then
- remaining = remaining - 1
- index = index + 1
- elseif c == "\t" and remaining > 3 then
- remaining = remaining - 4
- index = index + 1
- else
- break
+ while true do
+ local c = str:sub(index, index)
+ if c == " " and remaining > 0 then
+ remaining = remaining - 1
+ index = index + 1
+ elseif c == "\t" and remaining > 3 then
+ remaining = remaining - 4
+ index = index + 1
+ else
+ break
+ end
end
- end
- return true, str:sub(index)
- end
+ return true, str:sub(index)
+ end
local fencedline = function(char)
- return Cmt(Cb("indent_info") * C(parsers.line - fencetail(char)) * Cc(false), process_fenced_line)
+ return Cmt( Cb("indent_info")
+ * C(parsers.line - fencetail(char))
+ * Cc(false), process_fenced_line)
end
- local blankfencedline = Cmt(Cb("indent_info") * C(parsers.blankline) * Cc(true), process_fenced_line)
+ local blankfencedline
+ = Cmt( Cb("indent_info")
+ * C(parsers.blankline)
+ * Cc(true), process_fenced_line)
local TildeFencedCode
- = fencehead(parsers.tilde, tilde_infostring)
- * Cs(((parsers.check_minimal_blank_indent / "") * blankfencedline
- + (parsers.check_minimal_indent / "") * fencedline(parsers.tilde))^0)
- * ((parsers.check_minimal_indent / "") * fencetail(parsers.tilde) + parsers.succeed)
+ = fencehead(parsers.tilde, tilde_infostring)
+ * Cs(( (parsers.check_minimal_blank_indent / "")
+ * blankfencedline
+ + ( parsers.check_minimal_indent / "")
+ * fencedline(parsers.tilde))^0)
+ * ( (parsers.check_minimal_indent / "")
+ * fencetail(parsers.tilde) + parsers.succeed)
local BacktickFencedCode
= fencehead(parsers.backtick, backtick_infostring)
- * Cs(((parsers.check_minimal_blank_indent / "") * blankfencedline
- + (parsers.check_minimal_indent / "") * fencedline(parsers.backtick))^0)
- * ((parsers.check_minimal_indent / "") * fencetail(parsers.backtick) + parsers.succeed)
+ * Cs(( (parsers.check_minimal_blank_indent / "")
+ * blankfencedline
+ + (parsers.check_minimal_indent / "")
+ * fencedline(parsers.backtick))^0)
+ * ( (parsers.check_minimal_indent / "")
+ * fencetail(parsers.backtick) + parsers.succeed)
local infostring_with_attributes
= Ct(C((parsers.linechar
@@ -31179,28 +32222,28 @@ M.extensions.fenced_code = function(blank_before_code_fence,
* Ct(parsers.attributes))
local FencedCode
- = ((TildeFencedCode + BacktickFencedCode)
- / function(infostring, code)
- local expanded_code = self.expandtabs(code)
-
- if allow_raw_blocks then
- local raw_attr = lpeg.match(parsers.raw_attribute,
- infostring)
- if raw_attr then
- return writer.rawBlock(expanded_code, raw_attr)
- end
- end
-
- local attr = nil
- if allow_attributes then
- local match = lpeg.match(infostring_with_attributes,
- infostring)
- if match then
- infostring, attr = table.unpack(match)
- end
- end
- return writer.fencedCode(expanded_code, infostring, attr)
- end)
+ = ((TildeFencedCode + BacktickFencedCode)
+ / function(infostring, code)
+ local expanded_code = self.expandtabs(code)
+
+ if allow_raw_blocks then
+ local raw_attr = lpeg.match(parsers.raw_attribute,
+ infostring)
+ if raw_attr then
+ return writer.rawBlock(expanded_code, raw_attr)
+ end
+ end
+
+ local attr = nil
+ if allow_attributes then
+ local match = lpeg.match(infostring_with_attributes,
+ infostring)
+ if match then
+ infostring, attr = table.unpack(match)
+ end
+ end
+ return writer.fencedCode(expanded_code, infostring, attr)
+ end)
self.insert_pattern("Block after Verbatim",
FencedCode, "FencedCode")
@@ -31252,10 +32295,13 @@ M.extensions.fenced_divs = function(blank_before_div_fence)
% \end{markdown}
% \begin{macrocode}
function self.div_begin(attributes)
- local start_output = {"\\markdownRendererFencedDivAttributeContextBegin\n",
- self.attributes(attributes)}
- local end_output = {"\\markdownRendererFencedDivAttributeContextEnd{}"}
- return self.push_attributes("div", attributes, start_output, end_output)
+ local start_output
+ = {"\\markdownRendererFencedDivAttributeContextBegin\n",
+ self.attributes(attributes)}
+ local end_output
+ = {"\\markdownRendererFencedDivAttributeContextEnd{}"}
+ return self.push_attributes(
+ "div", attributes, start_output, end_output)
end
% \end{macrocode}
% \par
@@ -31316,21 +32362,24 @@ M.extensions.fenced_divs = function(blank_before_div_fence)
self.initialize_named_group("fenced_div_num_opening_indents")
local function increment_div_level()
- local function push_indent_table(s, i, indent_table, -- luacheck: ignore s i
- fenced_div_num_opening_indents, fenced_div_level)
- fenced_div_level = tonumber(fenced_div_level) + 1
- local num_opening_indents = 0
- if indent_table.indents ~= nil then
- num_opening_indents = #indent_table.indents
+ local push_indent_table =
+ function(s, i, indent_table, -- luacheck: ignore s i
+ fenced_div_num_opening_indents, fenced_div_level)
+ fenced_div_level = tonumber(fenced_div_level) + 1
+ local num_opening_indents = 0
+ if indent_table.indents ~= nil then
+ num_opening_indents = #indent_table.indents
+ end
+ fenced_div_num_opening_indents[fenced_div_level]
+ = num_opening_indents
+ return true, fenced_div_num_opening_indents
end
- fenced_div_num_opening_indents[fenced_div_level] = num_opening_indents
- return true, fenced_div_num_opening_indents
- end
- local function increment_level(s, i, fenced_div_level) -- luacheck: ignore s i
- fenced_div_level = tonumber(fenced_div_level) + 1
- return true, tostring(fenced_div_level)
- end
+ local increment_level =
+ function(s, i, fenced_div_level) -- luacheck: ignore s i
+ fenced_div_level = tonumber(fenced_div_level) + 1
+ return true, tostring(fenced_div_level)
+ end
return Cg( Cmt( Cb("indent_info")
* Cb("fenced_div_num_opening_indents")
@@ -31341,11 +32390,13 @@ M.extensions.fenced_divs = function(blank_before_div_fence)
end
local function decrement_div_level()
- local function pop_indent_table(s, i, fenced_div_indent_table, fenced_div_level) -- luacheck: ignore s i
- fenced_div_level = tonumber(fenced_div_level)
- fenced_div_indent_table[fenced_div_level] = nil
- return true, tostring(fenced_div_level - 1)
- end
+ local pop_indent_table =
+ function(s, i, -- luacheck: ignore s i
+ fenced_div_indent_table, fenced_div_level)
+ fenced_div_level = tonumber(fenced_div_level)
+ fenced_div_indent_table[fenced_div_level] = nil
+ return true, tostring(fenced_div_level - 1)
+ end
return Cg( Cmt( Cb("fenced_div_num_opening_indents")
* Cb("fenced_div_level"), pop_indent_table)
@@ -31353,21 +32404,24 @@ M.extensions.fenced_divs = function(blank_before_div_fence)
end
- local non_fenced_div_block = parsers.check_minimal_indent * V("Block")
- - parsers.check_minimal_indent_and_trail * fenced_div_end
+ local non_fenced_div_block
+ = parsers.check_minimal_indent * V("Block")
+ - parsers.check_minimal_indent_and_trail * fenced_div_end
- local non_fenced_div_paragraph = parsers.check_minimal_indent * V("Paragraph")
- - parsers.check_minimal_indent_and_trail * fenced_div_end
+ local non_fenced_div_paragraph
+ = parsers.check_minimal_indent * V("Paragraph")
+ - parsers.check_minimal_indent_and_trail * fenced_div_end
local blank = parsers.minimally_indented_blank
- local block_separated = parsers.block_sep_group(blank)
- * non_fenced_div_block
+ local block_separated = parsers.block_sep_group(blank)
+ * non_fenced_div_block
- local loop_body_pair = parsers.create_loop_body_pair(block_separated,
- non_fenced_div_paragraph,
- parsers.block_sep_group(blank),
- parsers.par_sep_group(blank))
+ local loop_body_pair
+ = parsers.create_loop_body_pair(block_separated,
+ non_fenced_div_paragraph,
+ parsers.block_sep_group(blank),
+ parsers.par_sep_group(blank))
local content_loop = ( non_fenced_div_block
* loop_body_pair.block^0
@@ -31380,7 +32434,9 @@ M.extensions.fenced_divs = function(blank_before_div_fence)
local FencedDiv = fenced_div_begin
/ function (infostring)
- local attr = lpeg.match(Ct(parsers.attributes), infostring)
+ local attr
+ = lpeg.match(Ct(parsers.attributes),
+ infostring)
if attr == nil then
attr = {"." .. infostring}
end
@@ -31391,7 +32447,8 @@ M.extensions.fenced_divs = function(blank_before_div_fence)
* parsers.skipblanklines
* Ct(content_loop)
* parsers.minimally_indented_blank^0
- * parsers.check_minimal_indent_and_trail * fenced_div_end
+ * parsers.check_minimal_indent_and_trail
+ * fenced_div_end
* decrement_div_level()
* (Cc("") / writer.div_end)
@@ -31412,23 +32469,27 @@ M.extensions.fenced_divs = function(blank_before_div_fence)
% \end{markdown}
% \begin{macrocode}
local function is_inside_div()
- local function check_div_level(s, i, fenced_div_level) -- luacheck: ignore s i
- fenced_div_level = tonumber(fenced_div_level)
- return fenced_div_level > 0
- end
+ local check_div_level =
+ function(s, i, fenced_div_level) -- luacheck: ignore s i
+ fenced_div_level = tonumber(fenced_div_level)
+ return fenced_div_level > 0
+ end
return Cmt(Cb("fenced_div_level"), check_div_level)
end
local function check_indent()
- local function compare_indent(s, i, indent_table, -- luacheck: ignore s i
- fenced_div_num_opening_indents, fenced_div_level)
- fenced_div_level = tonumber(fenced_div_level)
- local num_current_indents = (indent_table.current_line_indents ~= nil and
- #indent_table.current_line_indents) or 0
- local num_opening_indents = fenced_div_num_opening_indents[fenced_div_level]
- return num_current_indents == num_opening_indents
- end
+ local compare_indent =
+ function(s, i, indent_table, -- luacheck: ignore s i
+ fenced_div_num_opening_indents, fenced_div_level)
+ fenced_div_level = tonumber(fenced_div_level)
+ local num_current_indents
+ = ( indent_table.current_line_indents ~= nil and
+ #indent_table.current_line_indents) or 0
+ local num_opening_indents
+ = fenced_div_num_opening_indents[fenced_div_level]
+ return num_current_indents == num_opening_indents
+ end
return Cmt( Cb("indent_info")
* Cb("fenced_div_num_opening_indents")
@@ -31500,26 +32561,31 @@ M.extensions.header_attributes = function()
* parsers.newline))^1
- parsers.thematic_break_lines
- local heading_text = heading_line
- * ((V("Endline") / "\n") * (heading_line - parsers.heading_level))^0
- * parsers.newline^-1
-
- local SetextHeading = parsers.freeze_trail * parsers.check_trail_no_rem
- * #(heading_text
- * (parsers.attributes
- * parsers.optionalspace
- * parsers.newline)^-1
- * parsers.check_minimal_indent * parsers.check_trail * parsers.heading_level)
- * Cs(heading_text) / strip_trailing_spaces
- / parsers.parse_heading_text
- * Cg(Ct((parsers.attributes
- * parsers.optionalspace
- * parsers.newline)^-1), "attributes")
- * parsers.check_minimal_indent_and_trail * parsers.heading_level
- * Cb("attributes")
- * parsers.newline
- * parsers.unfreeze_trail
- / writer.heading
+ local heading_text
+ = heading_line
+ * ( (V("Endline") / "\n")
+ * (heading_line - parsers.heading_level))^0
+ * parsers.newline^-1
+
+ local SetextHeading
+ = parsers.freeze_trail * parsers.check_trail_no_rem
+ * #(heading_text
+ * (parsers.attributes
+ * parsers.optionalspace
+ * parsers.newline)^-1
+ * parsers.check_minimal_indent
+ * parsers.check_trail
+ * parsers.heading_level)
+ * Cs(heading_text) / strip_trailing_spaces
+ / parsers.parse_heading_text
+ * Cg(Ct((parsers.attributes
+ * parsers.optionalspace
+ * parsers.newline)^-1), "attributes")
+ * parsers.check_minimal_indent_and_trail * parsers.heading_level
+ * Cb("attributes")
+ * parsers.newline
+ * parsers.unfreeze_trail
+ / writer.heading
local Heading = AtxHeading + SetextHeading
self.update_rule("Heading", Heading)
@@ -31593,18 +32659,18 @@ M.extensions.line_blocks = function()
local parsers = self.parsers
local writer = self.writer
- local LineBlock = Ct(
- (Cs(
- ( (parsers.pipe * parsers.space)/""
- * ((parsers.space)/entities.char_entity("nbsp"))^0
- * parsers.linechar^0 * (parsers.newline/""))
- * (-parsers.pipe
- * (parsers.space^1/" ")
- * parsers.linechar^1
- * (parsers.newline/"")
- )^0
- * (parsers.blankline/"")^0
- ) / self.parser_functions.parse_inlines)^1) / writer.lineblock
+ local LineBlock
+ = Ct((Cs(( (parsers.pipe * parsers.space) / ""
+ * ((parsers.space)/entities.char_entity("nbsp"))^0
+ * parsers.linechar^0 * (parsers.newline/""))
+ * (-parsers.pipe
+ * (parsers.space^1/" ")
+ * parsers.linechar^1
+ * (parsers.newline/"")
+ )^0
+ * (parsers.blankline/"")^0)
+ / self.parser_functions.parse_inlines)^1)
+ / writer.lineblock
self.insert_pattern("Block after Blockquote",
LineBlock, "LineBlock")
@@ -31644,8 +32710,9 @@ M.extensions.mark = function()
local doubleequals = P("==")
- local Mark = parsers.between(V("Inline"), doubleequals, doubleequals)
- / function (inlines) return writer.mark(inlines) end
+ local Mark
+ = parsers.between(V("Inline"), doubleequals, doubleequals)
+ / function (inlines) return writer.mark(inlines) end
self.add_special_character("=")
self.insert_pattern("Inline before LinkAndEmph",
@@ -31678,13 +32745,18 @@ M.extensions.link_attributes = function()
%
% \end{markdown}
% \begin{macrocode}
- local define_reference_parser = (parsers.check_trail / "") * parsers.link_label * parsers.colon
- * parsers.spnlc * parsers.url
- * ( parsers.spnlc_sep * parsers.title * (parsers.spnlc * Ct(parsers.attributes))
- * parsers.only_blank
- + parsers.spnlc_sep * parsers.title * parsers.only_blank
- + Cc("") * (parsers.spnlc * Ct(parsers.attributes)) * parsers.only_blank
- + Cc("") * parsers.only_blank)
+ local define_reference_parser
+ = (parsers.check_trail / "")
+ * parsers.link_label
+ * parsers.colon
+ * parsers.spnlc * parsers.url
+ * ( parsers.spnlc_sep * parsers.title
+ * (parsers.spnlc * Ct(parsers.attributes))
+ * parsers.only_blank
+ + parsers.spnlc_sep * parsers.title * parsers.only_blank
+ + Cc("") * (parsers.spnlc * Ct(parsers.attributes))
+ * parsers.only_blank
+ + Cc("") * parsers.only_blank)
local ReferenceWithAttributes = define_reference_parser
/ self.register_link
@@ -31699,8 +32771,10 @@ M.extensions.link_attributes = function()
% \end{markdown}
% \begin{macrocode}
- local LinkWithAttributesAndEmph = Ct(parsers.link_and_emph_table * Cg(Cc(true), "match_link_attributes"))
- / self.defer_link_and_emphasis_processing
+ local LinkWithAttributesAndEmph
+ = Ct(parsers.link_and_emph_table * Cg(Cc(true),
+ "match_link_attributes"))
+ / self.defer_link_and_emphasis_processing
self.update_rule("LinkAndEmph", LinkWithAttributesAndEmph)
@@ -31781,11 +32855,14 @@ M.extensions.notes = function(notes, inline_notes)
local parsers = self.parsers
local writer = self.writer
+ local rawnotes = parsers.rawnotes
+
if inline_notes then
local InlineNote
- = parsers.circumflex
- * (parsers.link_label / self.parser_functions.parse_inlines_no_inline_note)
- / writer.note
+ = parsers.circumflex
+ * ( parsers.link_label
+ / self.parser_functions.parse_inlines_no_inline_note)
+ / writer.note
self.insert_pattern("Inline after LinkAndEmph",
InlineNote, "InlineNote")
@@ -31799,8 +32876,6 @@ M.extensions.notes = function(notes, inline_notes)
= #(parsers.lbracket * parsers.circumflex)
* parsers.link_label / strip_first_char
- local rawnotes = {}
-
-- like indirect_link
local function lookup_note(ref)
return writer.defer_call(function()
@@ -31825,20 +32900,27 @@ M.extensions.notes = function(notes, inline_notes)
local NoteRef = RawNoteRef / lookup_note
- local optionally_indented_line = parsers.check_optional_indent_and_any_trail * parsers.line
+ local optionally_indented_line
+ = parsers.check_optional_indent_and_any_trail * parsers.line
- local blank = parsers.check_optional_blank_indent_and_any_trail * parsers.optionalspace * parsers.newline
+ local blank
+ = parsers.check_optional_blank_indent_and_any_trail
+ * parsers.optionalspace * parsers.newline
- local chunk = Cs(parsers.line * (optionally_indented_line - blank)^0)
+ local chunk
+ = Cs(parsers.line
+ * (optionally_indented_line - blank)^0)
local indented_blocks = function(bl)
return Cs( bl
- * (blank^1 * (parsers.check_optional_indent / "")
- * parsers.check_code_trail * -parsers.blankline * bl)^0)
+ * ( blank^1 * (parsers.check_optional_indent / "")
+ * parsers.check_code_trail
+ * -parsers.blankline * bl)^0)
end
local NoteBlock
- = parsers.check_trail_no_rem * RawNoteRef * parsers.colon
+ = parsers.check_trail_no_rem
+ * RawNoteRef * parsers.colon
* parsers.spnlc * indented_blocks(chunk)
/ register_note
@@ -31996,24 +33078,26 @@ M.extensions.pipe_tables = function(table_captions, table_attributes)
, table_hline_separator
, table_hline_column)
- local table_caption_beginning = (parsers.check_minimal_blank_indent_and_any_trail_no_rem
- * parsers.optionalspace * parsers.newline)^0
- * parsers.check_minimal_indent_and_trail
- * (P("Table")^-1 * parsers.colon)
- * parsers.optionalspace
+ local table_caption_beginning
+ = ( parsers.check_minimal_blank_indent_and_any_trail_no_rem
+ * parsers.optionalspace * parsers.newline)^0
+ * parsers.check_minimal_indent_and_trail
+ * (P("Table")^-1 * parsers.colon)
+ * parsers.optionalspace
local function strip_trailing_spaces(s)
return s:gsub("%s*$","")
end
- local table_row = pipe_table_row(true
- , (C((parsers.linechar - parsers.pipe)^1)
- / strip_trailing_spaces
- / self.parser_functions.parse_inlines)
- , parsers.pipe
- , (C((parsers.linechar - parsers.pipe)^0)
- / strip_trailing_spaces
- / self.parser_functions.parse_inlines))
+ local table_row
+ = pipe_table_row(true
+ , (C((parsers.linechar - parsers.pipe)^1)
+ / strip_trailing_spaces
+ / self.parser_functions.parse_inlines)
+ , parsers.pipe
+ , (C((parsers.linechar - parsers.pipe)^0)
+ / strip_trailing_spaces
+ / self.parser_functions.parse_inlines))
local table_caption
if table_captions then
@@ -32030,7 +33114,8 @@ M.extensions.pipe_tables = function(table_captions, table_attributes)
+ ( parsers.newline
* #( parsers.optionalspace
* parsers.linechar)
- * C(parsers.optionalspace) / writer.space))
+ * C(parsers.optionalspace)
+ / writer.space))
* (parsers.linechar
- parsers.lbrace)^0)^1)
/ self.parser_functions.parse_inlines)
@@ -32044,7 +33129,8 @@ M.extensions.pipe_tables = function(table_captions, table_attributes)
+ ( parsers.newline
* #( parsers.optionalspace
* parsers.linechar)
- * C(parsers.optionalspace) / writer.space))^1)
+ * C(parsers.optionalspace)
+ / writer.space))^1)
/ self.parser_functions.parse_inlines
* parsers.newline
end
@@ -32052,12 +33138,15 @@ M.extensions.pipe_tables = function(table_captions, table_attributes)
table_caption = parsers.fail
end
- local PipeTable = Ct(table_row * parsers.newline * (parsers.check_minimal_indent_and_trail / {})
- * table_hline * parsers.newline
- * ((parsers.check_minimal_indent / {}) * table_row * parsers.newline)^0)
- / make_pipe_table_rectangular
- * table_caption^-1
- / writer.table
+ local PipeTable
+ = Ct( table_row * parsers.newline
+ * (parsers.check_minimal_indent_and_trail / {})
+ * table_hline * parsers.newline
+ * ( (parsers.check_minimal_indent / {})
+ * table_row * parsers.newline)^0)
+ / make_pipe_table_rectangular
+ * table_caption^-1
+ / writer.table
self.insert_pattern("Block after Blockquote",
PipeTable, "PipeTable")
@@ -32225,7 +33314,8 @@ M.extensions.superscripts = function()
local writer = self.writer
local Superscript = (
- parsers.between(parsers.Str, parsers.circumflex, parsers.circumflex)
+ parsers.between(parsers.Str, parsers.circumflex,
+ parsers.circumflex)
) / writer.superscript
self.insert_pattern("Inline after LinkAndEmph",
@@ -32288,11 +33378,13 @@ M.extensions.tex_math = function(tex_math_dollars,
return str:gsub("^%s*(.-)$", "%1")
end
- local allowed_before_closing = B( parsers.backslash * parsers.any
- + parsers.any * (parsers.any - parsers.backslash))
+ local allowed_before_closing
+ = B( parsers.backslash * parsers.any
+ + parsers.any * (parsers.any - parsers.backslash))
- local allowed_before_closing_no_space = B( parsers.backslash * parsers.any
- + parsers.any * (parsers.nonspacechar - parsers.backslash))
+ local allowed_before_closing_no_space
+ = B( parsers.backslash * parsers.any
+ + parsers.any * (parsers.nonspacechar - parsers.backslash))
% \end{macrocode}
% \begin{markdown}
@@ -32301,18 +33393,20 @@ M.extensions.tex_math = function(tex_math_dollars,
%
% \end{markdown}
% \begin{macrocode}
- local dollar_math_content = (parsers.newline * (parsers.check_optional_indent / "")
- + parsers.backslash^-1
- * parsers.linechar)
- - parsers.blankline^2
- - parsers.dollar
+ local dollar_math_content
+ = (parsers.newline * (parsers.check_optional_indent / "")
+ + parsers.backslash^-1
+ * parsers.linechar)
+ - parsers.blankline^2
+ - parsers.dollar
local inline_math_opening_dollars = parsers.dollar
* #(parsers.nonspacechar)
- local inline_math_closing_dollars = allowed_before_closing_no_space
- * parsers.dollar
- * -#(parsers.digit)
+ local inline_math_closing_dollars
+ = allowed_before_closing_no_space
+ * parsers.dollar
+ * -#(parsers.digit)
local inline_math_dollars = between(Cs( dollar_math_content),
inline_math_opening_dollars,
@@ -32335,9 +33429,10 @@ M.extensions.tex_math = function(tex_math_dollars,
%
% \end{markdown}
% \begin{macrocode}
- local backslash_math_content = (parsers.newline * (parsers.check_optional_indent / "")
- + parsers.linechar)
- - parsers.blankline^2
+ local backslash_math_content
+ = (parsers.newline * (parsers.check_optional_indent / "")
+ + parsers.linechar)
+ - parsers.blankline^2
% \end{macrocode}
% \begin{markdown}
%
@@ -32457,11 +33552,15 @@ end
% \acro{yaml} metadata block syntax extension. When the
% `expect_jekyll_data` parameter is `true`, then a markdown document
% may begin directly with \acro{yaml} metadata and may contain nothing
-% but \acro{yaml} metadata.
+% but \acro{yaml} metadata. When both `expect_jekyll_data` and
+% `ensure_jekyll_data` parameters are `true`, then a a markdown document must
+% begin directly with \acro{yaml} metadata and must contain nothing but
+% \acro{yaml} metadata.
%
% \end{markdown}
% \begin{macrocode}
-M.extensions.jekyll_data = function(expect_jekyll_data)
+M.extensions.jekyll_data = function(expect_jekyll_data,
+ ensure_jekyll_data)
return {
name = "built-in jekyll_data syntax extension",
extend_writer = function(self)
@@ -32474,7 +33573,8 @@ M.extensions.jekyll_data = function(expect_jekyll_data)
% the key `p` in the parent table; if `p` is nil, then the table has no parent.
% All scalar keys and values encountered in the table will be cast to a string
% following \acro{yaml} serialization rules. String values will also be
-% transformed using the function `t`.
+% transformed using the function `t` for the typographic output format used by
+% the \mref{markdownRendererJekyllDataTypographicString} macro.
%
% \end{markdown}
% \begin{macrocode}
@@ -32519,17 +33619,18 @@ M.extensions.jekyll_data = function(expect_jekyll_data)
::not_a_sequence::
if is_sequence then
- table.insert(buf, "\\markdownRendererJekyllDataSequenceBegin{")
- table.insert(buf, self.identifier(p or "null"))
- table.insert(buf, "}{")
- table.insert(buf, #keys)
- table.insert(buf, "}")
+ table.insert(buf,
+ "\\markdownRendererJekyllDataSequenceBegin{")
+ table.insert(buf, self.identifier(p or "null"))
+ table.insert(buf, "}{")
+ table.insert(buf, #keys)
+ table.insert(buf, "}")
else
- table.insert(buf, "\\markdownRendererJekyllDataMappingBegin{")
- table.insert(buf, self.identifier(p or "null"))
- table.insert(buf, "}{")
- table.insert(buf, #keys)
- table.insert(buf, "}")
+ table.insert(buf, "\\markdownRendererJekyllDataMappingBegin{")
+ table.insert(buf, self.identifier(p or "null"))
+ table.insert(buf, "}{")
+ table.insert(buf, #keys)
+ table.insert(buf, "}")
end
for _, k in ipairs(keys) do
@@ -32557,7 +33658,14 @@ M.extensions.jekyll_data = function(expect_jekyll_data)
table.insert(buf, v)
table.insert(buf, "}")
elseif typ == "string" then
- table.insert(buf, "\\markdownRendererJekyllDataString{")
+ table.insert(buf,
+ "\\markdownRendererJekyllDataProgrammaticString{")
+ table.insert(buf, k)
+ table.insert(buf, "}{")
+ table.insert(buf, self.identifier(v))
+ table.insert(buf, "}")
+ table.insert(buf,
+ "\\markdownRendererJekyllDataTypographicString{")
table.insert(buf, k)
table.insert(buf, "}{")
table.insert(buf, t(v))
@@ -32567,8 +33675,10 @@ M.extensions.jekyll_data = function(expect_jekyll_data)
table.insert(buf, k)
table.insert(buf, "}")
else
- error(format("Unexpected type %s for value of " ..
- "YAML key %s", typ, k))
+ local error = self.error(format(
+ "Unexpected type %s for value of "
+ .. "YAML key %s", typ, k))
+ table.insert(buf, error)
end
end
end
@@ -32590,38 +33700,49 @@ M.extensions.jekyll_data = function(expect_jekyll_data)
local writer = self.writer
local JekyllData
- = Cmt( C((parsers.line - P("---") - P("..."))^0)
- , function(s, i, text) -- luacheck: ignore s i
- local data
- local ran_ok, _ = pcall(function()
- -- TODO: Replace with `require("tinyyaml")` in TeX Live 2023
- local tinyyaml = require("markdown-tinyyaml")
- data = tinyyaml.parse(text, {timestamps=false})
- end)
- if ran_ok and data ~= nil then
- return true, writer.jekyllData(data, function(s)
- return self.parser_functions.parse_blocks_nested(s)
- end, nil)
- else
- return false
- end
- end
- )
+ = Cmt( C((parsers.line - P("---") - P("..."))^0)
+ , function(s, i, text) -- luacheck: ignore s i
+ local data
+ local ran_ok, _ = pcall(function()
+ -- TODO: Use `require("tinyyaml")` in TeX Live 2023
+ local tinyyaml = require("markdown-tinyyaml")
+ data = tinyyaml.parse(text, {timestamps=false})
+ end)
+ if ran_ok and data ~= nil then
+ return true, writer.jekyllData(data, function(s)
+ return self.parser_functions.parse_blocks_nested(s)
+ end, nil)
+ else
+ return false
+ end
+ end
+ )
local UnexpectedJekyllData
- = P("---")
- * parsers.blankline / 0
- * #(-parsers.blankline) -- if followed by blank, it's thematic break
- * JekyllData
- * (P("---") + P("..."))
+ = P("---")
+ * parsers.blankline / 0
+ -- if followed by blank, it's thematic break
+ * #(-parsers.blankline)
+ * JekyllData
+ * (P("---") + P("..."))
local ExpectedJekyllData
- = ( P("---")
- * parsers.blankline / 0
- * #(-parsers.blankline) -- if followed by blank, it's thematic break
- )^-1
- * JekyllData
- * (P("---") + P("..."))^-1
+ = ( P("---")
+ * parsers.blankline / 0
+ -- if followed by blank, it's thematic break
+ * #(-parsers.blankline)
+ )^-1
+ * JekyllData
+ * (P("---") + P("..."))^-1
+
+ if ensure_jekyll_data then
+ ExpectedJekyllData = ExpectedJekyllData
+ * parsers.eof
+ else
+ ExpectedJekyllData = ( ExpectedJekyllData
+ * (V("Blank")^0 / writer.interblocksep)
+ )^-1
+ end
self.insert_pattern("Block before Blockquote",
UnexpectedJekyllData, "UnexpectedJekyllData")
@@ -32636,9 +33757,127 @@ end
%
%### Conversion from Markdown to Plain \TeX{}
%
-% The \luamref{new} function returns a conversion function that takes a
-% markdown string and turns it into a plain \TeX{} output. See Section
-% <#sec:lua-conversion>.
+% The \luamref{new} function of file `markdown.lua` loads file
+% `markdown-parser.lua` and calls its own function \luamref{new} unless option
+% \Opt{eagerCache} or \Opt{finalizeCache} has been enabled and a cached
+% conversion output exists, in which case it is returned without loading file
+% `markdown-parser.lua`.
+%
+% \end{markdown}
+% \iffalse
+%</lua>
+%<*lua-loader>
+% \fi
+% \begin{macrocode}
+local function warn(s)
+ io.stderr:write("Warning: " .. s .. "\n")
+end
+
+function M.new(options)
+% \end{macrocode}
+% \par
+% \begin{markdown}
+%
+% Make the `options` table inherit from the \luamref{defaultOptions} table.
+%
+% \end{markdown}
+% \begin{macrocode}
+ options = options or {}
+ setmetatable(options, { __index = function (_, key)
+ return defaultOptions[key] end })
+% \end{macrocode}
+% \par
+% \begin{markdown}
+%
+% Return a conversion function that tries to produce a cached conversion output
+% exists. If no cached conversion output exists, we load the file
+% `markdown-parser.lua` and use it to convert the input.
+%
+% \end{markdown}
+% \begin{macrocode}
+ local parser_convert = nil
+ return function(input)
+ local function convert(input)
+ if parser_convert == nil then
+% \end{macrocode}
+% \par
+% \begin{markdown}
+%
+% Lazy-load `markdown-parser.lua` and check that it originates from the same
+% version of the Markdown package.
+%
+% \end{markdown}
+% \begin{macrocode}
+ local parser = require("markdown-parser")
+ if metadata.version ~= parser.metadata.version then
+ warn("markdown.lua " .. metadata.version .. " used with " ..
+ "markdown-parser.lua " .. parser.metadata.version .. ".")
+ end
+ parser_convert = parser.new(options)
+ end
+ return parser_convert(input)
+ end
+% \end{macrocode}
+% \begin{markdown}
+% If we cache markdown documents, produce the cache file and transform its
+% filename to plain \TeX{} output.
+%
+% When determining the name of the cache file, create salt for the hashing
+% function out of the package version and the passed options recognized by the
+% Lua interface (see Section <#sec:lua-options>).
+% \end{markdown}
+% \begin{macrocode}
+ local output
+ if options.eagerCache or options.finalizeCache then
+ local salt = util.salt(options)
+ local name = util.cache(options.cacheDir, input, salt, convert,
+ ".md.tex")
+ output = [[\input{]] .. name .. [[}\relax]]
+% \end{macrocode}
+% \begin{markdown}
+% Otherwise, return the result of the conversion directly.
+% \end{markdown}
+% \begin{macrocode}
+ else
+ output = convert(input)
+ end
+% \end{macrocode}
+% \begin{markdown}
+% If the \Opt{finalizeCache} option is enabled, populate the frozen cache in
+% the file \Opt{frozenCacheFileName} with an entry for markdown document
+% number \Opt{frozenCacheCounter}.
+% \end{markdown}
+% \begin{macrocode}
+ if options.finalizeCache then
+ local file, mode
+ if options.frozenCacheCounter > 0 then
+ mode = "a"
+ else
+ mode = "w"
+ end
+ file = assert(io.open(options.frozenCacheFileName, mode),
+ [[Could not open file "]] .. options.frozenCacheFileName
+ .. [[" for writing]])
+ assert(file:write(
+ [[\expandafter\global\expandafter\def\csname ]]
+ .. [[markdownFrozenCache]] .. options.frozenCacheCounter
+ .. [[\endcsname{]] .. output .. [[}]] .. "\n"))
+ assert(file:close())
+ end
+ return output
+ end
+end
+% \end{macrocode}
+% \iffalse
+%</lua-loader>
+%<*lua>
+% \fi
+% \par
+% \begin{markdown}
+%
+% The \luamref{new} function from file `markdown-parser.lua` returns a
+% conversion function that takes a markdown string and turns it into a plain
+% \TeX{} output. See Section <#sec:lua-conversion>.
%
% \end{markdown}
% \begin{macrocode}
@@ -32671,7 +33910,15 @@ function M.new(options)
goto miss
end
end
- elseif singletonCache.options[k] ~= options[k] then
+% \end{macrocode}
+% \begin{markdown}
+%
+% The \Opt{cacheDir} option is disregarded.
+%
+% \end{markdown}
+% \begin{macrocode}
+ elseif k ~= "cacheDir"
+ and singletonCache.options[k] ~= options[k] then
goto miss
end
end
@@ -32732,7 +33979,7 @@ function M.new(options)
if options.jekyllData then
local jekyll_data_extension = M.extensions.jekyll_data(
- options.expectJekyllData)
+ options.expectJekyllData, options.ensureJekyllData)
table.insert(extensions, jekyll_data_extension)
end
@@ -32795,7 +34042,8 @@ function M.new(options)
end
if options.citations then
- local citations_extension = M.extensions.citations(options.citationNbsps)
+ local citations_extension
+ = M.extensions.citations(options.citationNbsps)
table.insert(extensions, citations_extension)
end
@@ -32820,7 +34068,9 @@ function M.new(options)
%
% \end{markdown}
% \begin{macrocode}
- local pathname = kpse.lookup(filename)
+ local pathname = assert(kpse.find_file(filename),
+ [[Could not locate user-defined syntax extension "]]
+ .. filename)
local input_file = assert(io.open(pathname, "r"),
[[Could not open user-defined syntax extension "]]
.. pathname .. [[" for reading]])
@@ -32850,7 +34100,8 @@ function M.new(options)
.. type(user_extension.api_version)
.. [[" but "number" was expected]])
assert(user_extension.api_version > 0
- and user_extension.api_version <= metadata.user_extension_api_version,
+ and user_extension.api_version
+ <= metadata.user_extension_api_version,
[[User-defined syntax extension "]] .. pathname
.. [[" uses syntax extension API version "]]
.. user_extension.api_version .. [[ but markdown.lua ]]
@@ -32868,7 +34119,8 @@ function M.new(options)
.. [[" but "number" was expected]])
assert(user_extension.grammar_version == metadata.grammar_version,
[[User-defined syntax extension "]] .. pathname
- .. [[" uses grammar version "]] .. user_extension.grammar_version
+ .. [[" uses grammar version "]]
+ .. user_extension.grammar_version
.. [[ but markdown.lua ]] .. metadata.version
.. [[ uses grammar version ]] .. metadata.grammar_version
.. [[, which is incompatible]])
@@ -32950,11 +34202,16 @@ function M.new(options)
% \begin{macrocode}
return convert
end
-
-return M
% \end{macrocode}
% \iffalse
%</lua>
+%<*lua,lua-loader>
+% \fi
+% \begin{macrocode}
+return M
+% \end{macrocode}
+% \iffalse
+%</lua,lua-loader>
%<*lua-cli>
% \fi
% \par
@@ -33119,7 +34376,7 @@ end
%### Themes {#themes-implementation}
%
% This section implements the theme-loading mechanism and the built-in themes
-% provided with the Markdown package. Futhermore, this section also implements
+% provided with the Markdown package. Furthermore, this section also implements
% the built-in plain \TeX{} themes provided with the Markdown package.
%
% \end{markdown}
@@ -33308,18 +34565,22 @@ end
\def\markdownRendererUlEndTightPrototype{}%
\def\markdownRendererOlBeginPrototype{}%
\def\markdownRendererOlBeginTightPrototype{}%
-\def\markdownRendererFancyOlBeginPrototype#1#2{\markdownRendererOlBegin}%
-\def\markdownRendererFancyOlBeginTightPrototype#1#2{\markdownRendererOlBeginTight}%
+\def\markdownRendererFancyOlBeginPrototype#1#2{%
+ \markdownRendererOlBegin}%
+\def\markdownRendererFancyOlBeginTightPrototype#1#2{%
+ \markdownRendererOlBeginTight}%
\def\markdownRendererOlItemPrototype{}%
\def\markdownRendererOlItemWithNumberPrototype#1{}%
\def\markdownRendererOlItemEndPrototype{}%
\def\markdownRendererFancyOlItemPrototype{\markdownRendererOlItem}%
-\def\markdownRendererFancyOlItemWithNumberPrototype{\markdownRendererOlItemWithNumber}%
+\def\markdownRendererFancyOlItemWithNumberPrototype{%
+ \markdownRendererOlItemWithNumber}%
\def\markdownRendererFancyOlItemEndPrototype{}%
\def\markdownRendererOlEndPrototype{}%
\def\markdownRendererOlEndTightPrototype{}%
\def\markdownRendererFancyOlEndPrototype{\markdownRendererOlEnd}%
-\def\markdownRendererFancyOlEndTightPrototype{\markdownRendererOlEndTight}%
+\def\markdownRendererFancyOlEndTightPrototype{%
+ \markdownRendererOlEndTight}%
\def\markdownRendererDlBeginPrototype{}%
\def\markdownRendererDlBeginTightPrototype{}%
\def\markdownRendererDlItemPrototype#1{#1}%
@@ -33393,6 +34654,8 @@ end
\ExplSyntaxOff
\def\markdownRendererSectionBeginPrototype{}%
\def\markdownRendererSectionEndPrototype{}%
+\let\markdownRendererWarningPrototype\markdownWarning
+\let\markdownRendererErrorPrototype\markdownError
% \end{macrocode}
% \par
% \begin{markdown}
@@ -33407,7 +34670,7 @@ end
% \begin{macrocode}
\ExplSyntaxOn
\cs_new:Nn
- \@@_plain_tex_default_input_raw_inline_renderer_prototype:nn
+ \@@_plain_tex_default_input_raw_inline:nn
{
\str_case:nn
{ #2 }
@@ -33417,7 +34680,7 @@ end
}
}
\cs_new:Nn
- \@@_plain_tex_default_input_raw_block_renderer_prototype:nn
+ \@@_plain_tex_default_input_raw_block:nn
{
\str_case:nn
{ #2 }
@@ -33429,14 +34692,14 @@ end
\cs_gset:Npn
\markdownRendererInputRawInlinePrototype#1#2
{
- \@@_plain_tex_default_input_raw_inline_renderer_prototype:nn
+ \@@_plain_tex_default_input_raw_inline:nn
{ #1 }
{ #2 }
}
\cs_gset:Npn
\markdownRendererInputRawBlockPrototype#1#2
{
- \@@_plain_tex_default_input_raw_block_renderer_prototype:nn
+ \@@_plain_tex_default_input_raw_block:nn
{ #1 }
{ #2 }
}
@@ -33673,7 +34936,17 @@ end
{ #1 }
{ #2 }
}
-\def\markdownRendererJekyllDataStringPrototype#1#2{
+% \end{macrocode}
+% \par
+% \begin{markdown}
+%
+% We will process all string scalar values assuming that they may contain
+% markdown markup and are intended for typesetting.
+%
+% \end{markdown}
+% \begin{macrocode}
+\def\markdownRendererJekyllDataProgrammaticStringPrototype#1#2{}
+\def\markdownRendererJekyllDataTypographicStringPrototype#1#2{
\markdown_jekyll_data_set_keyvals:nn
{ #1 }
{ #2 }
@@ -34063,6 +35336,9 @@ end
}
}
}
+ \str_gset:NV
+ \g_luabridge_output_dirname_str
+ \markdownOptionOutputDir
\luabridge_now:e
{ #1 }
}
@@ -34199,12 +35475,14 @@ end
\msg_new:nnn
{ markdown }
{ buffering-markinline }
- { Buffering~inline~markdown~input~into~the~temporary~input~file~"#1". }
+ { Buffering~inline~markdown~input~into~
+ the~temporary~input~file~"#1". }
\msg_new:nnnn
{ markdown }
{ markinline-peek-failure }
{ Use~of~\iow_char:N \\ markinline~doesn't~match~its~definition }
- { The~macro~should~be~followed~by~inline~markdown~text~in~curly~braces }
+ { The~macro~should~be~followed~by~inline~
+ markdown~text~in~curly~braces }
\ExplSyntaxOff
% \end{macrocode}
% \begin{markdown}
@@ -34223,6 +35501,13 @@ end
\markdownInput
#1
{
+ \@@_if_option:nTF
+ { frozenCache }
+ {
+ \markdownInputRaw
+ { #1 }
+ }
+ {
% \end{macrocode}
% \begin{markdown}
%
@@ -34232,19 +35517,23 @@ end
%
% \end{markdown}
% \begin{macrocode}
- \file_get_full_name:nNTF
- { #1 }
- \l_tmpa_tl
- {
- \exp_args:NV
- \markdownInputRaw
+ \tl_set:Nx
\l_tmpa_tl
- }
- {
- \msg_error:nnnV
- { markdown }
- { markdown-file-does-not-exist }
{ #1 }
+ \file_get_full_name:VNTF
+ \l_tmpa_tl
+ \l_tmpb_tl
+ {
+ \exp_args:NV
+ \markdownInputRaw
+ \l_tmpb_tl
+ }
+ {
+ \msg_error:nnV
+ { markdown }
+ { markdown-file-does-not-exist }
+ \l_tmpa_tl
+ }
}
}
\msg_new:nnn
@@ -34298,7 +35587,8 @@ end
|fi
|markdownInfo{Including markdown document number
"|the|markdownOptionFrozenCacheCounter" from frozen cache}%
- |csname markdownFrozenCache|the|markdownOptionFrozenCacheCounter|endcsname
+ |csname markdownFrozenCache%
+ |the|markdownOptionFrozenCacheCounter|endcsname
|global|advance|markdownOptionFrozenCacheCounter by 1|relax
}{%
|markdownInfo{Including markdown document "&1"}%
@@ -34358,7 +35648,7 @@ end
% \LaTeX{} Implementation {#lateximplementation}
%-------------------------
%
-% The \LaTeX{} implemenation makes use of the fact that, apart from some subtle
+% The \LaTeX{} implementation makes use of the fact that, apart from some subtle
% differences, \LaTeX{} implements the majority of the plain \TeX{}
% format~[@latex17, Section 9]. As a consequence, we can directly reuse the
% existing plain \TeX{} implementation.
@@ -34522,13 +35812,26 @@ end
% we let the \mref{markdownReadAndConvert} macro process the rest of the
% \LaTeX{} environment.
%
+% We also make provision for using the \mref{markdown} command as a part of a
+% different \LaTeX{} environment as follows:
+%
+% ``` tex
+% \newenvironment{foo}\%
+% {code before \markdown[some, options]}\%
+% {\markdownEnd code after}
+% ```
+%
% \end{markdown}
% \begin{macrocode}
- \c { markdownReadAndConvert@markdown } { }
+ \c { exp_args:NV }
+ \c { markdownReadAndConvert@ }
+ \c { @currenvir }
}
{
\group_end:
- \markdownReadAndConvert@markdown { }
+ \exp_args:NV
+ \markdownReadAndConvert@
+ \@currenvir
}
}
{ \markdownEnd }
@@ -34542,7 +35845,8 @@ end
{ #1 }
\@@_setup:n
{ #1 }
- \markdownReadAndConvert@markdown *
+ \markdownReadAndConvert@
+ { markdown* }
}
{ \markdownEnd }
\msg_new:nnn
@@ -34552,6 +35856,9 @@ end
The~markdown*~LaTeX~environment~has~been~deprecated~and~will~
be~removed~in~the~next~major~version~of~the~Markdown~package.
}
+\cs_generate_variant:Nn
+ \@@_setup:n
+ { V }
\ExplSyntaxOff
\begingroup
% \end{macrocode}
@@ -34565,9 +35872,9 @@ end
% \begin{macrocode}
\catcode`\|=0\catcode`\<=1\catcode`\>=2%
\catcode`\\=12|catcode`|{=12|catcode`|}=12%
- |gdef|markdownReadAndConvert@markdown#1<%
- |markdownReadAndConvert<\end{markdown#1}>%
- <|end<markdown#1>>>%
+ |gdef|markdownReadAndConvert@#1<%
+ |markdownReadAndConvert<\end{#1}>%
+ <|end<#1>>>%
|endgroup
% \end{macrocode}
% \par
@@ -34587,7 +35894,7 @@ end
%### Themes {#latex-themes-implementation}
%
% This section overrides the plain \TeX{} implementation of the theme-loading
-% mechanism from Section <#sec:themes-implementation>. Futhermore, this section
+% mechanism from Section <#sec:themes-implementation>. Furthermore, this section
% also implements the built-in \LaTeX{} themes provided with the Markdown package.
%
% \end{markdown}
@@ -34782,7 +36089,8 @@ end
% \end{markdown}
% \begin{macrocode}
}{%
- \markdown@witiko@dot@oldRendererInputFencedCodePrototype{#1}{#2}{#3}%
+ \markdown@witiko@dot@oldRendererInputFencedCodePrototype
+ {#1}{#2}{#3}%
}%
}%
\next#2 \relax}%
@@ -35112,21 +36420,15 @@ end
\tl_set:Nn
\l_@@_latex_fancy_list_item_label_delimiter_style_tl
{ #2 }
- \tl_set:Nn
- \l_tmpa_tl
- {
- \plpartopsep=\partopsep
- \pltopsep=\topsep
- }
\@@_if_option:nTF
{ startNumber }
{
- \tl_put_right:Nn
+ \tl_set:Nn
\l_tmpa_tl
{ \begin{compactenum} }
}
{
- \tl_put_right:Nn
+ \tl_set:Nn
\l_tmpa_tl
{ \begin{compactenum}[ }
\tl_put_right:Nx
@@ -35136,6 +36438,12 @@ end
\l_tmpa_tl
{ ] }
}
+ \tl_put_left:Nn
+ \l_tmpa_tl
+ {
+ \plpartopsep=\partopsep
+ \pltopsep=\topsep
+ }
\tl_use:N
\l_tmpa_tl
},
@@ -35598,8 +36906,9 @@ end
\advance\markdownLaTeXCitationsCounter by 1\relax
\ifx\relax#4\relax
\ifx\relax#5\relax
- \ifnum\markdownLaTeXCitationsCounter>\markdownLaTeXCitationsTotal\relax
- \cite{#1#2#6}% Without prenotes and postnotes, just accumulate cites
+ \ifnum\markdownLaTeXCitationsCounter>\markdownLaTeXCitationsTotal
+ \relax
+ \cite{#1#2#6}% No prenotes/postnotes, just accumulate cites
\expandafter\expandafter\expandafter
\expandafter\expandafter\expandafter\expandafter
\@gobblethree
@@ -35609,7 +36918,8 @@ end
\cite{#1}%
\fi
\cite[#5]{#6}%
- \ifnum\markdownLaTeXCitationsCounter>\markdownLaTeXCitationsTotal\relax
+ \ifnum\markdownLaTeXCitationsCounter>\markdownLaTeXCitationsTotal
+ \relax
\else
\expandafter\expandafter\expandafter
\expandafter\expandafter\expandafter\expandafter
@@ -35636,7 +36946,8 @@ end
\space % Insert a space before the prenote in later citations
\fi
#4~\expandafter\cite\ifx\relax#5\relax{#6}\else[#5]{#6}\fi
- \ifnum\markdownLaTeXCitationsCounter>\markdownLaTeXCitationsTotal\relax
+ \ifnum\markdownLaTeXCitationsCounter>\markdownLaTeXCitationsTotal
+ \relax
\else
\expandafter\expandafter\expandafter
\expandafter\expandafter\expandafter\expandafter
@@ -35656,8 +36967,9 @@ end
\advance\markdownLaTeXCitationsCounter by 1\relax
\ifx\relax#3\relax
\ifx\relax#4\relax
- \ifnum\markdownLaTeXCitationsCounter>\markdownLaTeXCitationsTotal\relax
- \citep{#1,#5}% Without prenotes and postnotes, just accumulate cites
+ \ifnum\markdownLaTeXCitationsCounter>\markdownLaTeXCitationsTotal
+ \relax
+ \citep{#1,#5}% No prenotes/postnotes, just accumulate cites
\expandafter\expandafter\expandafter
\expandafter\expandafter\expandafter\expandafter
\@gobbletwo
@@ -35667,7 +36979,8 @@ end
\citep{#1}%
\fi
\citep[][#4]{#5}%
- \ifnum\markdownLaTeXCitationsCounter>\markdownLaTeXCitationsTotal\relax
+ \ifnum\markdownLaTeXCitationsCounter>\markdownLaTeXCitationsTotal
+ \relax
\else
\expandafter\expandafter\expandafter
\expandafter\expandafter\expandafter\expandafter
@@ -35687,7 +37000,8 @@ end
\citep{#1}%
\fi
\citep[#3][#4]{#5}%
- \ifnum\markdownLaTeXCitationsCounter>\markdownLaTeXCitationsTotal\relax
+ \ifnum\markdownLaTeXCitationsCounter>\markdownLaTeXCitationsTotal
+ \relax
\else
\expandafter\expandafter\expandafter
\expandafter\expandafter\expandafter\expandafter
@@ -35702,8 +37016,9 @@ end
\advance\markdownLaTeXCitationsCounter by 1\relax
\ifx\relax#3\relax
\ifx\relax#4\relax
- \ifnum\markdownLaTeXCitationsCounter>\markdownLaTeXCitationsTotal\relax
- \citet{#1,#5}% Without prenotes and postnotes, just accumulate cites
+ \ifnum\markdownLaTeXCitationsCounter>\markdownLaTeXCitationsTotal
+ \relax
+ \citet{#1,#5}% No prenotes/postnotes, just accumulate cites
\expandafter\expandafter\expandafter
\expandafter\expandafter\expandafter\expandafter
\@gobbletwo
@@ -35713,10 +37028,13 @@ end
\citet{#1}%
\fi
, \citet[#3][#4]{#5}%
- \ifnum\markdownLaTeXCitationsCounter<\markdownLaTeXCitationsTotal\relax
+ \ifnum\markdownLaTeXCitationsCounter<\markdownLaTeXCitationsTotal
+ \relax
,
\else
- \ifnum\markdownLaTeXCitationsCounter=\markdownLaTeXCitationsTotal\relax
+ \ifnum
+ \markdownLaTeXCitationsCounter=\markdownLaTeXCitationsTotal
+ \relax
,
\fi
\fi
@@ -35735,10 +37053,13 @@ end
\citet{#1}%
\fi
, \citet[#3][#4]{#5}%
- \ifnum\markdownLaTeXCitationsCounter<\markdownLaTeXCitationsTotal\relax
+ \ifnum\markdownLaTeXCitationsCounter<\markdownLaTeXCitationsTotal
+ \relax
,
\else
- \ifnum\markdownLaTeXCitationsCounter=\markdownLaTeXCitationsTotal\relax
+ \ifnum
+ \markdownLaTeXCitationsCounter=\markdownLaTeXCitationsTotal
+ \relax
,
\fi
\fi
@@ -35753,13 +37074,15 @@ end
% BibLaTeX implementation
\def\markdownLaTeXBibLaTeXCitations#1#2#3#4#5{%
\advance\markdownLaTeXCitationsCounter by 1\relax
- \ifnum\markdownLaTeXCitationsCounter>\markdownLaTeXCitationsTotal\relax
+ \ifnum\markdownLaTeXCitationsCounter>\markdownLaTeXCitationsTotal
+ \relax
\autocites#1[#3][#4]{#5}%
\expandafter\@gobbletwo
\fi\markdownLaTeXBibLaTeXCitations{#1[#3][#4]{#5}}}
\def\markdownLaTeXBibLaTeXTextCitations#1#2#3#4#5{%
\advance\markdownLaTeXCitationsCounter by 1\relax
- \ifnum\markdownLaTeXCitationsCounter>\markdownLaTeXCitationsTotal\relax
+ \ifnum\markdownLaTeXCitationsCounter>\markdownLaTeXCitationsTotal
+ \relax
\textcites#1[#3][#4]{#5}%
\expandafter\@gobbletwo
\fi\markdownLaTeXBibLaTeXTextCitations{#1[#3][#4]{#5}}}
@@ -35852,7 +37175,8 @@ end
{
\markdownLaTeXRendererAutolink { #2 } { #3 }
}{
- \markdownLaTeXRendererDirectOrIndirectLink { #1 } { #2 } { #3 } { #4 }
+ \markdownLaTeXRendererDirectOrIndirectLink
+ { #1 } { #2 } { #3 } { #4 }
}
}
\def\markdownLaTeXRendererAutolink#1#2{%
@@ -36151,13 +37475,13 @@ end
{
{ latex }
{
- \@@_plain_tex_default_input_raw_inline_renderer_prototype:nn
+ \@@_plain_tex_default_input_raw_inline:nn
{ #1 }
{ tex }
}
}
{
- \@@_plain_tex_default_input_raw_inline_renderer_prototype:nn
+ \@@_plain_tex_default_input_raw_inline:nn
{ #1 }
{ #2 }
}
@@ -36170,13 +37494,13 @@ end
{
{ latex }
{
- \@@_plain_tex_default_input_raw_block_renderer_prototype:nn
+ \@@_plain_tex_default_input_raw_block:nn
{ #1 }
{ tex }
}
}
{
- \@@_plain_tex_default_input_raw_block_renderer_prototype:nn
+ \@@_plain_tex_default_input_raw_block:nn
{ #1 }
{ #2 }
}
@@ -36314,7 +37638,7 @@ end
%### Themes {#context-themes-implementation}
%
% This section overrides the plain \TeX{} implementation of the theme-loading
-% mechanism from Section <#sec:themes-implementation>. Futhermore, this section
+% mechanism from Section <#sec:themes-implementation>. Furthermore, this section
% also implements the built-in \Hologo{ConTeXt} themes provided with the
% Markdown package.
%
@@ -36359,7 +37683,7 @@ end
% \end{macrocode}
% \iffalse
%</context>
-%<*themes-witiko-markdown-defaults-context>
+%<*themes-witiko-markdown-defaults-ctx>
% \fi
% \par
% \begin{markdown}
@@ -36541,7 +37865,8 @@ end
\def\markdownRendererStrikeThroughPrototype#1{\overstrikes{#1}}
\def\markdownRendererSuperscriptPrototype#1{\high{#1}}
\def\markdownRendererSubscriptPrototype#1{\low{#1}}
-\def\markdownRendererDisplayMathPrototype#1{\startformula#1\stopformula}%
+\def\markdownRendererDisplayMathPrototype#1{%
+ \startformula#1\stopformula}%
% \end{macrocode}
% \par
% \begin{markdown}
@@ -36567,8 +37892,10 @@ end
\placetable{#1}{\the\markdownConTeXtTable}}%
\fi
\begingroup
- \setupTABLE[r][each][topframe=off, bottomframe=off, leftframe=off, rightframe=off]
- \setupTABLE[c][each][topframe=off, bottomframe=off, leftframe=off, rightframe=off]
+ \setupTABLE[r][each][topframe=off, bottomframe=off,
+ leftframe=off, rightframe=off]
+ \setupTABLE[c][each][topframe=off, bottomframe=off,
+ leftframe=off, rightframe=off]
\setupTABLE[r][1][topframe=on, bottomframe=on]
\setupTABLE[r][#1][bottomframe=on]
\markdownConTeXtRowCounter=0%
@@ -36606,14 +37933,16 @@ end
\fi\if#1r%
\setupTABLE[c][\the\markdownConTeXtColumnCounter][align=left]
\fi
- \ifnum\markdownConTeXtColumnCounter<\markdownConTeXtColumnTotal\relax\else
+ \ifnum\markdownConTeXtColumnCounter<\markdownConTeXtColumnTotal\relax
+ \else
\expandafter\gobbleoneargument
\fi\markdownConTeXtReadAlignments}
\def\markdownConTeXtRenderTableCell#1{%
\advance\markdownConTeXtColumnCounter by 1\relax
\markdownConTeXtTable=\expandafter{%
\the\markdownConTeXtTable\bTD#1\eTD}%
- \ifnum\markdownConTeXtColumnCounter<\markdownConTeXtColumnTotal\relax\else
+ \ifnum\markdownConTeXtColumnCounter<\markdownConTeXtColumnTotal\relax
+ \else
\expandafter\gobbleoneargument
\fi\markdownConTeXtRenderTableCell}
% \end{macrocode}
@@ -36636,13 +37965,13 @@ end
{
{ latex }
{
- \@@_plain_tex_default_input_raw_inline_renderer_prototype:nn
+ \@@_plain_tex_default_input_raw_inline:nn
{ #1 }
{ context }
}
}
{
- \@@_plain_tex_default_input_raw_inline_renderer_prototype:nn
+ \@@_plain_tex_default_input_raw_inline:nn
{ #1 }
{ #2 }
}
@@ -36655,13 +37984,13 @@ end
{
{ context }
{
- \@@_plain_tex_default_input_raw_block_renderer_prototype:nn
+ \@@_plain_tex_default_input_raw_block:nn
{ #1 }
{ tex }
}
}
{
- \@@_plain_tex_default_input_raw_block_renderer_prototype:nn
+ \@@_plain_tex_default_input_raw_block:nn
{ #1 }
{ #2 }
}
@@ -36675,7 +38004,7 @@ end
\protect
% \end{macrocode}
% \iffalse
-%</themes-witiko-markdown-defaults-context>
+%</themes-witiko-markdown-defaults-ctx>
%<*context>
% \fi
% \par
diff --git a/Master/texmf-dist/source/generic/markdown/markdown.ins b/Master/texmf-dist/source/generic/markdown/markdown.ins
index 8e777f4217c..152fe4832b2 100644
--- a/Master/texmf-dist/source/generic/markdown/markdown.ins
+++ b/Master/texmf-dist/source/generic/markdown/markdown.ins
@@ -2,7 +2,8 @@
\generate{
\usepreamble\luapreamble
\usepostamble\luapostamble
- \file{markdown.lua}{\from{markdown.dtx}{lua}}
+ \file{markdown.lua}{\from{markdown.dtx}{lua-loader}}
+ \file{markdown-parser.lua}{\from{markdown.dtx}{lua}}
\file{markdown-cli.lua}{\from{markdown.dtx}{lua-cli}}
\usepreamble\texpreamble
\usepostamble\texpostamble
@@ -14,7 +15,7 @@
\file{markdownthemewitiko_tilde.tex}{\from{markdown.dtx}{themes-witiko-tilde}}
\file{markdownthemewitiko_markdown_defaults.tex}{\from{markdown.dtx}{themes-witiko-markdown-defaults-tex}}
\file{markdownthemewitiko_markdown_defaults.sty}{\from{markdown.dtx}{themes-witiko-markdown-defaults-latex}}
- \file{t-markdownthemewitiko_markdown_defaults.tex}{\from{markdown.dtx}{themes-witiko-markdown-defaults-context}}
+ \file{t-markdownthemewitiko_markdown_defaults.tex}{\from{markdown.dtx}{themes-witiko-markdown-defaults-ctx}}
\file{markdownthemewitiko_markdown_techdoc.sty}{\from{markdown.dtx}{themes-witiko-markdown-techdoc}}
\usepreamble\empty
\usepostamble\empty
@@ -25,5 +26,6 @@
\file{markdown.css}{\from{markdown.dtx}{manual-css}}
\file{markdown-figure-block-diagram.tex}{\from{markdown.dtx}{techdoc-block-diagram}}
\file{markdown.bib}{\from{markdown.dtx}{techdoc-bibliography}}
+ \file{DEPENDS-raw.txt}{\from{markdown.dtx}{depends}}
}
\endbatchfile
diff --git a/Master/texmf-dist/source/generic/pst-diffraction/Makefile b/Master/texmf-dist/source/generic/pst-diffraction/Makefile
deleted file mode 100644
index 1d4650b7c1b..00000000000
--- a/Master/texmf-dist/source/generic/pst-diffraction/Makefile
+++ /dev/null
@@ -1,55 +0,0 @@
-# `Makefile' for `pst-diffraction.pdf', hv, 2007/03/17
-
-.SUFFIXES : .tex .ltx .dvi .ps .pdf .eps
-
-PACKAGE = pst-diffraction
-
-LATEX = latex
-
-ARCHNAME = $(PACKAGE)-$(shell date +%y%m%d)
-ARCHFILES = $(PACKAGE).sty *.tex $(PACKAGE).pro *.tex README Changes Makefile
-
-all : DE E FR clean
-
-DE : $(PACKAGE)-docDE.pdf
-E : $(PACKAGE)-docE.pdf
-FR : $(PACKAGE)-docFR.pdf
-
-doc : $(MAIN).pdf
-
-%.pdf : %.ps
- GS_OPTIONS=-dAutoRotatePages=/None ps2pdf $<
-
-%.ps : %.dvi
- dvips $<
-
-%.dvi : %.tex
- $(LATEX) $<
- $(LATEX) $<
- if ! test -f $(basename $<).glo ; then touch $(basename $<).glo; fi
- if ! test -f $(basename $<).idx ; then touch $(basename $<).idx; fi
- makeindex -s gglo.ist -t $(basename $<).glg -o $(basename $<).gls \
- $(basename $<).glo
- makeindex -t $(basename $<).ilg -o $(basename $<).ind \
- $(basename $<).idx
- bibtex $(basename $<)
- $(LATEX) $<
- $(LATEX) $<
-
-clean :
- $(RM) $(addprefix $(PACKAGE)-docDE, .log .aux .glg .glo .gls .ilg .idx .ind .tmp .toc .out .blg .Roessler .bbl )
- $(RM) $(addprefix $(PACKAGE)-docDE, .dvi .ps)
- $(RM) $(addprefix $(PACKAGE)-docE, .log .aux .glg .glo .gls .ilg .idx .ind .tmp .toc .out .blg .Roessler .bbl )
- $(RM) $(addprefix $(PACKAGE)-docE, .dvi .ps)
- $(RM) $(addprefix $(PACKAGE)-docFR, .log .aux .glg .glo .gls .ilg .idx .ind .tmp .toc .out .blg .Roessler .bbl )
- $(RM) $(addprefix $(PACKAGE)-docFR, .dvi .ps)
-
-veryclean : clean
- $(RM) $(addprefix $(PACKAGE)-docDE, .pdf .bbl .blg)
- $(RM) $(addprefix $(PACKAGE)-docE, .pdf .bbl .blg)
- $(RM) $(addprefix $(PACKAGE)-docFR, .pdf .bbl .blg)
-
-arch :
- zip $(ARCHNAME).zip $(ARCHFILES)
-
-# EOF
diff --git a/Master/texmf-dist/source/generic/tex4ht/ChangeLog b/Master/texmf-dist/source/generic/tex4ht/ChangeLog
index dd7c62fc27e..8b627b50551 100644
--- a/Master/texmf-dist/source/generic/tex4ht/ChangeLog
+++ b/Master/texmf-dist/source/generic/tex4ht/ChangeLog
@@ -1,8 +1,101 @@
+2024-08-27 Michal Hoftich <michal.h21@gmail.com>
+
+ * tex4ht-mathml.tex (mathml.4ht): fixed support of upper case Greek
+ letters inside pictures.
+ https://tex.stackexchange.com/q/725157/2891
+
+2024-08-19 Michal Hoftich <michal.h21@gmail.com>
+
+ * tex4ht-4ht.tex (moderncv.4ht),
+ * tex4ht-html4.tex (html4.4ht): added support for the Moderncv
+ package.
+ https://tex.stackexchange.com/q/721180/2891
+
+2024-08-13 Michal Hoftich <michal.h21@gmail.com>
+
+ * tex4ht-4ht.tex (amsfonts.4ht): fixed support for \mathbb and
+ \mathfrak.
+
+ * tex4ht-jats.tex (jats.4ht): added support for LaTeX
+ bibliographies.
+
+2024-08-11 Karl Berry <karl@freefriends.org>
+
+ * tex4ht-mathml.tex (html-mml.4ht): copyright 2024.
+
+2024-08-02 Michal Hoftich <michal.h21@gmail.com>
+
+ * tex4ht-mathml.tex (mathml.4ht): added "texsource" option. It will
+ keep the original LaTeX code as an annotation in MathML.
+ https://chat.stackexchange.com/rooms/154333/discussion-on-question-by-yannisl-alternatives-to-mathml-for-pdf-tagging
+
+ * tex4ht-4ht.tex (esvect.4ht),
+ * tex4ht-mathml.tex (mathml.4ht): added support for the Esvect
+ package.
+ https://tex.stackexchange.com/a/723587/2891
+
+2024-07-31 Michal Hoftich <michal.h21@gmail.com>
+
+ * tex4ht-fonts-noncjk.tex (
+ ./tex4ht.dir/texmf/tex4ht/ht-fonts/unicode/TeXvect10/vect10.htf
+ ): Added support for the vector font from the Esvect package.
+ https://tex.stackexchange.com/q/723560/2891
+
+2024-07-28 Michal Hoftich <michal.h21@gmail.com>
+
+ * tex4ht-mathjax.tex (mathjax-latex-4ht.4ht): don't add spaces after
+ LaTeX commands.
+
+2024-07-26 Michal Hoftich <michal.h21@gmail.com>
+
+ * tex4ht-4ht.tex (tagpdf-hooks.4ht, tagpdf-base-hooks.4ht): removed
+ \__tag_whatsits definitions, they fix is no longer necessary.
+ https://github.com/michal-h21/make4ht/issues/145#issuecomment-2085215582
+
+2024-07-07 Karl Berry <karl@freefriends.org>
+
+ * Makefile (tex4ht_env_derived),
+ * tex4ht-env.tex: no longer generate tex4ht.env, just
+ .env-unix and .env-win32, since those are the only ones we use.
+
+2024-07-06 Michal Hoftich <michal.h21@gmail.com>
+
+ * tex4ht-html4.tex (html4.4ht): added itemize+ option. It will keep
+ original characters for itemize bullets.
+ https://tex.stackexchange.com/a/722062/2891
+
+2024-07-03 Michal Hoftich <michal.h21@gmail.com>
+
+ * tex4ht-4ht.tex (fontawesome5.4ht): use icon name as the alt text.
+
+2024-06-21 Michal Hoftich <michal.h21@gmail.com>
+
+ * tex4ht-4ht.tex (arydshln.4ht): fixed clash between Colortbl and
+ Arydshln packages.
+ https://tex.stackexchange.com/a/721185/2891
+
+2024-06-23 Karl Berry <karl@freefriends.org>
+
+ * tex4ht-cpright.tex: https for urls.
+
+2024-06-21 Michal Hoftich <michal.h21@gmail.com>
+
+ * tex4ht-html4.tex (html4.4ht): don't use picture name as alt in
+ \epsfbox, it can lead to spurious characters in the resulting HTML.
+ Thanks to Rolf Brigola
+
+2024-06-20 Michal Hoftich <michal.h21@gmail.com>
+
+ * tex4ht-4ht.tex (footmisc.4ht): fixed handling of footnote counter
+ reset.
+ https://tex.stackexchange.com/a/720989/2891
+
+
2024-06-17 Michal Hoftich <michal.h21@gmail.com>
* tex4ht-4ht.tex (tabularray.4ht): updated names of token lists that
holds rowspan and colspan.
- https://tex.stackexchange.com/a/720800/2891
+ https://tex.stackexchange.com/a/720800/2891
2024-06-15 Michal Hoftich <michal.h21@gmail.com>
diff --git a/Master/texmf-dist/source/generic/tex4ht/Makefile b/Master/texmf-dist/source/generic/tex4ht/Makefile
index fd6995f4a59..5328185f784 100644
--- a/Master/texmf-dist/source/generic/tex4ht/Makefile
+++ b/Master/texmf-dist/source/generic/tex4ht/Makefile
@@ -1,4 +1,4 @@
-# $Id: Makefile 1503 2024-04-18 22:51:03Z karl $
+# $Id: Makefile 1538 2024-07-07 15:55:16Z karl $
# This file is public domain. Originally written 2010, Karl Berry.
# Assumes GNU make.
@@ -138,7 +138,7 @@ tex4ht_docbook_xtpipes_derived = docbook.4xt $(wd)/src/DbUtilities.java
endif
derived += $(tex4ht_env_derived)
-tex4ht_env_derived = tex4ht.env-unix tex4ht.env-win32 tex4ht.env
+tex4ht_env_derived = tex4ht.env-unix tex4ht.env-win32
derived += $(tex4ht_fonts_cjk_derived)
tex4ht_fonts_cjk_derived = \
diff --git a/Master/texmf-dist/source/generic/tex4ht/mktex4ht-cnf.tex b/Master/texmf-dist/source/generic/tex4ht/mktex4ht-cnf.tex
index 7bc692fff6d..ee48ba93f7f 100644
--- a/Master/texmf-dist/source/generic/tex4ht/mktex4ht-cnf.tex
+++ b/Master/texmf-dist/source/generic/tex4ht/mktex4ht-cnf.tex
@@ -1,4 +1,4 @@
-% $Id: mktex4ht-cnf.tex 1523 2024-05-27 14:16:04Z michal_h21 $
+% $Id: mktex4ht-cnf.tex 1547 2024-08-19 14:07:03Z michal_h21 $
% Manually-maintained file, listing *.4ht files created by tex4ht-4ht.tex.
% Read by tex4ht-cond4ht.
%
@@ -238,6 +238,7 @@
\AddFile{9}{europecv}
\AddFile{9}{resume}
\AddFile{9}{curve}
+\AddFile{9}{moderncv}
\AddFile{9}{vowel}
\AddFile{9}{enumitem}
\AddFile{9}{esperanto}
@@ -415,4 +416,5 @@
\AddFile{9}{fontawesome5}
\AddFile{9}{mhchem}
\AddFile{9}{chemfig}
+\AddFile{9}{esvect}
% \AddFile{9}{mktex4ht}
diff --git a/Master/texmf-dist/source/generic/tex4ht/tex4ht-4ht.tex b/Master/texmf-dist/source/generic/tex4ht/tex4ht-4ht.tex
index 0fd6e45cbaa..9882b08f734 100644
--- a/Master/texmf-dist/source/generic/tex4ht/tex4ht-4ht.tex
+++ b/Master/texmf-dist/source/generic/tex4ht/tex4ht-4ht.tex
@@ -1,4 +1,4 @@
-% $Id: tex4ht-4ht.tex 1531 2024-06-17 19:40:15Z michal_h21 $
+% $Id: tex4ht-4ht.tex 1547 2024-08-19 14:07:03Z michal_h21 $
% tex tex4ht-4ht or ht tex tex4ht-4ht
%
% Copyright 2009-2024 TeX Users Group
@@ -4265,18 +4265,19 @@ icons to pictures by TeX4ht conversion.
\<fontawesome5.4ht\><<<
% fontawesome5.4ht (|version), generated from |jobname.tex
-% Copyright 2021 TeX Users Group
+% Copyright 2021-2024 TeX Users Group
|<TeX4ht license text|>
\NewConfigure{fontawesome}{2}
\ExplSyntaxOn
\cs_new_protected:Nn\temp:nn{%
+\def\:fontawesomeicon{#2}% to be used in the alt text
\a:fontawesome%
\o:fontawesome_use_icon:nn:{#1}{#2}
\b:fontawesome}
\HLet\fontawesome_use_icon:nn\temp:nn
\ExplSyntaxOff
-\Configure{fontawesome}{\Picture+{}}{\EndPicture}
+\Configure{fontawesome}{\Picture+[icon: \:fontawesomeicon]{}}{\EndPicture}
\Hinput{fontawesome5}
\endinput
>>> \AddFile{9}{fontawesome5}
@@ -5099,13 +5100,14 @@ as it leads to a fatal error.
\Configure{PackageHooks}{tagpdf.sty}{tagpdf-hooks.4ht}
>>>
+% This is no longer useful, it was fixed in tagpdf code
+% \cs_set_protected:Npn \__tag_whatsits: {}
+
\<tagpdf-hooks.4ht\><<<
% tagpdf-hooks.4ht (|version), generated from |jobname.tex
% Copyright 2022-2024 TeX Users Group
|<TeX4ht license text|>
\ExplSyntaxOn
-% ignore tagpdf's specials
-\cs_set_protected:Npn \__tag_whatsits: {}
\ExplSyntaxOff
\:AtEndOfPackage{%
\RenewDocumentCommand \tagpdfsetup { m }{}
@@ -5117,16 +5119,17 @@ as it leads to a fatal error.
\Configure{PackageHooks}{tagpdf-base.sty}{tagpdf-base-hooks.4ht}
>>>
-This file can be used explicitly, we need to provide the whatsits command
-here as well.
+This file can be used explicitly, we used to provide the whatsits command
+here as well, but it is no longer neeeded.
+
+% ignore tagpdf's specials
+% we use csname, because \ExplSyntaxOn .. Off caused catcode issues
+% \expandafter\def\csname __tag_whatsits:\endcsname{}
\<tagpdf-base-hooks.4ht\><<<
% tagpd-base-hooks.4ht (|version), generated from |jobname.tex
% Copyright 2024 TeX Users Group
|<TeX4ht license text|>
-% ignore tagpdf's specials
-% we use csname, because \ExplSyntaxOn .. Off caused catcode issues
-\expandafter\def\csname __tag_whatsits:\endcsname{}
\endinput
>>> \AddFile{9}{tagpdf-base-hooks}
@@ -11225,12 +11228,13 @@ compilation errors
\<arydshln.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% arydshln.4ht (|version), generated from |jobname.tex
-% Copyright 2022 TeX Users Group
+% Copyright 2022-2024 TeX Users Group
|<TeX4ht license text|>
% this is a copy of code that arydshln inserts to \@array
\def\:new:array{\adl@everyvbox\everyvbox
\everyvbox{\adl@arrayinit \the\adl@everyvbox \everyvbox\adl@everyvbox}%
- \ifadl@inactive \adl@inactivate \else \adl@activate \fi
+ % this line may lead to errors if the document uses Colortbl:
+ % \ifadl@inactive \adl@inactivate \else \adl@activate \fi
\let\adl@noalign\noalign}
\ifcsname n:@array:\endcsname% if \@array was already patched by TeX4ht
\let\orig:n@array\n:@array:
@@ -22275,14 +22279,14 @@ $$
\<amsfonts sty\><<<<
\NewConfigure{mathbb}{2}
-\def\:temp#1{{\a:mathbb \o:@mathbb:{#1}\b:mathbb}}
-\HLet\@mathbb\:temp
+\def\:temp#1{{\a:mathbb \o:mathbb:{#1}\b:mathbb}}
+\HLet\mathbb\:temp
>>>
\<amsfonts sty\><<<<
\NewConfigure{mathfrak}{2}
-\def\:temp#1{{\a:mathfrak \o:@mathfrak:{#1}\b:mathfrak}}
-\HLet\@mathfrak\:temp
+\def\:temp#1{{\a:mathfrak \o:mathfrak:{#1}\b:mathfrak}}
+\HLet\mathfrak\:temp
>>>
Commands like \''\rm' need low level implemetation through
@@ -30143,6 +30147,173 @@ A style file for resumes.
>>>
%%%%%%%%%%%%%%%%%%%%%%%%%
+\Section{moderncv}
+%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\<moderncv.4ht\><<<
+% moderncv.4ht (|version), generated from |jobname.tex
+% Copyright 2024 TeX Users Group
+|<TeX4ht license text|>
+|<moderncv configs|>
+\Hinput{moderncv}
+\endinput
+>>>\AddFile{9}{moderncv}
+
+This is a bit messy. We had to redefine a bunch of commands from various
+files that Moderncv uses, mostly to prevent compilation errors and to
+insert some basic formatting.
+
+\<moderncv configs\><<<
+\NewConfigure{section}{2}
+\RenewDocumentCommand\section{sm}{\a:section #2\b:section}
+
+\NewConfigure{subsection}{2}
+\RenewDocumentCommand\subsection{sm}{\a:subsection #2\b:subsection}
+
+
+\NewConfigure{cvitem}{3}
+\renewcommand*{\cvitem}[3][.25em]{
+\a:cvitem #2\b:cvitem #3\c:cvitem
+}
+
+\NewConfigure{cvdoubleitem}{2}
+\renewcommand*{\cvdoubleitem}[5][.25em]{%
+\a:cvdoubleitem
+\cvitem{#2}{#3}
+\cvitem{#4}{#5}
+\b:cvdoubleitem
+}
+
+\NewConfigure{cvlistitem}{2}
+\renewcommand*{\cvlistitem}[2][.25em]{%
+ \a:cvlistitem\cvitem[#1]{\listitemsymbol}{#2}\b:cvlistitem
+}
+
+\NewConfigure{cvlistdoubleitem}{2}
+\renewcommand*{\cvlistdoubleitem}[3][.25em]{%
+ \a:cvlistdoubleitem%
+ \cvitem[#1]{\listitemsymbol}{#2}%
+ \cvitem[#1]{\listitemsymbol}{#3}%
+ \b:cvlistdoubleitem%
+}
+
+\NewConfigure{cvhead}{2}
+\NewConfigure{cvphoto}{2}
+
+
+\renewcommand*{\makecvhead}{%
+ \a:cvhead
+ % recompute lengths (in case we are switching from letter to resume, or vice versa)
+ \recomputecvlengths%
+ % optional detailed information (pre-rendering)
+ \@initializebox{\makecvheaddetailsbox}%
+ \if@details%
+ \def\phonesdetails{}%
+ \collectionloop{phones}{% the key holds the phone type (=symbol command prefix), the item holds the number
+ \protected@edef\phonesdetails{\phonesdetails\protect\makenewline\csname\collectionloopkey phonesymbol\endcsname\collectionloopitem}}%
+ \def\socialsdetails{}%
+ \collectionloop{socials}{% the key holds the social type (=symbol command prefix), the item holds the link
+ \protected@edef\socialsdetails{\socialsdetails\protect\makenewline\csname\collectionloopkey socialsymbol\endcsname\collectionloopitem}}%
+ \savebox{\makecvheaddetailsbox}{%
+ \addressfont\color{color2}%
+ \if@left\begin{tabular}[b]{@{}r@{}}\fi%
+ \if@right\begin{tabular}[b]{@{}l@{}}\fi%
+ \ifthenelse{\isundefined{\@addressstreet}}{}{\makenewline\addresssymbol\@addressstreet%
+ \ifthenelse{\equal{\@addresscity}{}}{}{\makenewline\@addresscity}% if \addresstreet is defined, \addresscity and addresscountry will always be defined but could be empty
+ \ifthenelse{\equal{\@addresscountry}{}}{}{\makenewline\@addresscountry}}%
+ \ifthenelse{\isundefined{\@born}}{}{\makenewline\bornsymbol\@born}%
+ \phonesdetails% needs to be pre-rendered as loops and tabulars seem to conflict
+ \ifthenelse{\isundefined{\@email}}{}{\makenewline\emailsymbol\emaillink{\@email}}%
+ \ifthenelse{\isundefined{\@homepage}}{}{\makenewline\homepagesymbol\httpslink{\@homepage}}%
+ \socialsdetails% needs to be pre-rendered as loops and tabulars seem to conflict
+ \ifthenelse{\isundefined{\@extrainfo}}{}{\makenewline\@extrainfo}%
+ \end{tabular}
+ }\fi%
+ % optional photo (pre-rendering)
+ \@initializebox{\makecvheadpicturebox}%
+ \savebox{\makecvheadpicturebox}{%
+ \ifthenelse{\isundefined{\@photo}}%
+ {}%
+ {%
+ \a:cvphoto\includegraphics[]{\@photo}\b:cvphoto}%
+ }%
+ % name and title (pre-rendering)
+ \@initializelength{\makecvheaddetailswidth}\settowidth{\makecvheaddetailswidth}{\usebox{\makecvheaddetailsbox}}%
+ \@initializelength{\makecvheadpicturewidth}\settowidth{\makecvheadpicturewidth}{\usebox{\makecvheadpicturebox}}%
+ \ifthenelse{\lengthtest{\makecvheadnamewidth=0pt}}% check for dummy value (equivalent to \ifdim\makecvheadnamewidth=0pt)
+ {\setlength{\makecvheadnamewidth}{\textwidth-\makecvheaddetailswidth-\makecvheadpicturewidth}}%
+ {}%
+ \@initializebox{\makecvheadnamebox}%
+ \savebox{\makecvheadnamebox}{%
+ \begin{minipage}[b]{\makecvheadnamewidth}%
+ \if@left\raggedright\fi%
+ \if@right\raggedleft\fi%
+ \namestyle{\@firstname\ \@lastname}%
+ \ifthenelse{\equal{\@title}{}}{}{\\[1.25em]\titlestyle{\@title}}%
+ \end{minipage}}%
+ % rendering
+ \if@left%
+ \usebox{\makecvheadnamebox}%
+ \hfill%
+ \llap{\usebox{\makecvheaddetailsbox}}% \llap is used to suppress the width of the box, allowing overlap if the value of makecvheadnamewidth is forced
+ \usebox{\makecvheadpicturebox}\fi%
+ \if@right%
+ \usebox{\makecvheadpicturebox}%
+ \rlap{\usebox{\makecvheaddetailsbox}}% \llap is used to suppress the width of the box, allowing overlap if the value of makecvheadnamewidth is forced
+ \hfill%
+ \usebox{\makecvheadnamebox}\fi%
+ \\[2.5em]%
+ % optional quote
+ \ifthenelse{\isundefined{\@quote}}%
+ {}%
+ {{\centering\begin{minipage}{\quotewidth}\centering\quotestyle{\@quote}\end{minipage}\\[2.5em]}}%
+ \b:cvhead\par}% to avoid weird spacing bug at the first section if no blank line is left after \makecvhead
+
+
+\RenewDocumentCommand\cvskilllegend{s +O{.25em} +O{\skillLegend@defaultLevelOne} +O{\skillLegend@defaultLevelTwo} +O{\skillLegend@defaultLevelThree} +O{\skillLegend@defaultLevelFour} +O{\skillLegend@defaultLevelFive} +m}{%
+\begin{tabular}{l l l l l l}
+ \raggedleft\hintstyle{#8} & \cvskill{1}\, & \,{\skillLegend@FontSize #3} & \cvskill{3}\, &\,{\skillLegend@FontSize #5 } \\%
+ %
+ & \cvskill{2}\, & \,\multirow{2}{\cvskilllegend@leftdescriptorwidth}{{\skillLegend@FontSize #4}} & \cvskill{4}\, &\,{\skillLegend@FontSize #6 } \\%
+ %
+ & & & \cvskill{5}\, &\,{\skillLegend@FontSize #7 }%
+ \end{tabular}%
+}%
+
+
+\NewConfigure{cvskill}{2}
+\def\:tempa#1{\def\:cvskillamount{#1}\a:cvskill\o:cvskill:{#1}\b:cvskill}
+\HLet\cvskill\:tempa
+
+\NewConfigure{cvskillhead}{2}
+\NewConfigure{cvskillentry}{2}
+\RenewDocumentCommand\cvskillhead{O{.25em} +O{\skillMatrix@HeaderDefaultOne} +O{\skillMatrix@HeaderDefaultTwo} +O{\skillMatrix@HeaderDefaultThree} +O{\skillMatrix@HeaderDefaultFour}}{%
+ \begingroup
+ \a:cvskillhead
+ \begin{tabular}{ p{6em} p{12em} p{4em} p{20em}}%
+ { #2} & { #3} & { #4} & { #5}
+ \end{tabular}%
+ \b:cvskillhead
+ \endgroup
+ \par\addvspace{#1}
+}
+
+\RenewDocumentCommand\cvskillentry{s +O{.25em} +m +m +m +m +m}{%
+\a:cvskillentry
+\cvitem{#3}{
+ \begin{tabular}{ p{6em} p{12em} p{4em} p{20em}}
+ \centering \cvskill{#4} &\centering {#5} & \centering {#6} &{\itshape#7}%
+ \end{tabular}}%
+ \b:cvskillentry
+ \par\addvspace{#2}
+}
+
+>>>
+
+%%%%%%%%%%%%%%%%%%%%%%%%%
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%
\Chapter{Small Ones}
%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -31406,6 +31577,20 @@ for output formats.
\ExplSyntaxOff
>>>
+%%%%%%%%%%%%%%%
+\Section{Esvect}
+%%%%%%%%%%%%%%%
+
+\<esvect.4ht\><<<
+% esvect.4ht (|version), generated from |jobname.tex
+% Copyright 2024 TeX Users Group
+|<TeX4ht license text|>
+|<esvect redefinitions|>
+
+\Hinput{esvect}
+\endinput
+>>> \AddFile{9}{esvect}
+
%%%%%%%%%%%%%
\Section{Ushort}
%%%%%%%%%%%%%
@@ -37900,9 +38085,39 @@ Use
\<footmisc.4ht\><<<
% footmisc.4ht (|version), generated from |jobname.tex
-% Copyright 2019 TeX Users Group
+% Copyright 2019-2024 TeX Users Group
|<TeX4ht license text|>
+|<footmisc footnote counter|>
+|<footmisc footnotetext|>
+|<footmisc symbols|>
+
+
+\Hinput{footmisc}
+\endinput
+>>> \AddFile{9}{footmisc}
+
+Footmisc can reset the normal footnote counter on every page. Footnote links are
+then wrong, as they point to an earlier footnote. My solution is to use a global
+counter that gives each footnote unique number and which doesn't rely on the footnote
+symbol.
+\<footmisc footnote counter\><<<
+\newcounter{:footnotes}
+
+\def\FNnum{\the\:footnotes}
+
+\HRestore\footnote
+
+\def\:tempc{%
+ \HAssign\FNnum = \csname c@:footnotes\endcsname%
+ \stepcounter{:footnotes}%
+ \HAdvance\FNnum by 1%
+ \o:footnote:%
+}
+\HLet\footnote=\:tempc
+>>>
+
+\<footmisc footnotetext\><<<
\long\def\@footnotetext#1{\leavevmode
\vbox{%\IgnorePar
\leftskip0pt {\ht:everypar{}\parindent0pt\leavevmode}%
@@ -37921,6 +38136,9 @@ Use
\color@endgroup
\ht:special{t4ht@[}}\ht:special{t4ht@]}}
+>>>
+
+\<footmisc symbols\><<<
% detect if the symbol or symbol* option were used
% we can detect that by testing of \thefootnote macro
@@ -37937,10 +38155,7 @@ Use
\newcommand\p@footmisc@footnote[1]{\p@footnote{#1}}
\fi
\fi
-
-\Hinput{footmisc}
-\endinput
->>> \AddFile{9}{footmisc}
+>>>
%%%%%%%%%%%%%%%
\Section{tablefootnote}
diff --git a/Master/texmf-dist/source/generic/tex4ht/tex4ht-cpright.tex b/Master/texmf-dist/source/generic/tex4ht/tex4ht-cpright.tex
index 35276909217..c15155fcc57 100644
--- a/Master/texmf-dist/source/generic/tex4ht/tex4ht-cpright.tex
+++ b/Master/texmf-dist/source/generic/tex4ht/tex4ht-cpright.tex
@@ -4,14 +4,14 @@
% 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
-% http://www.latex-project.org/lppl.txt
+% 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 work has the LPPL maintenance status "maintained".
%
% The Current Maintainer of this work
-% is the TeX4ht Project <http://tug.org/tex4ht>.
+% is the TeX4ht Project <https://tug.org/tex4ht>.
%
% If you modify this program, changing the
% version identification would be appreciated.>>>
diff --git a/Master/texmf-dist/source/generic/tex4ht/tex4ht-env.tex b/Master/texmf-dist/source/generic/tex4ht/tex4ht-env.tex
index 5d66aa43d02..3ac0f4443d4 100644
--- a/Master/texmf-dist/source/generic/tex4ht/tex4ht-env.tex
+++ b/Master/texmf-dist/source/generic/tex4ht/tex4ht-env.tex
@@ -1,8 +1,8 @@
-% $Id: tex4ht-env.tex 1419 2023-12-11 23:23:52Z karl $
+% $Id: tex4ht-env.tex 1538 2024-07-07 15:55:16Z karl $
% latex tex4ht-env
% or htlatex tex4ht-env "xhtml,3"
%
-% Copyright 2009-2023 TeX Users Group
+% Copyright 2009-2024 TeX Users Group
% Copyright 1997-2009 Eitan M. Gurari
% Released under LPPL 1.3c+.
% See tex4ht-cpright.tex for license text.
@@ -1650,27 +1650,30 @@ Note: the permission option `S' takes into account also trailing spaces.
\<unix copyright\><<<
% tex4ht.env-unix (@version), generated from @jobname.tex
-% (can be used as ~/.tex4ht)
-% Copyright 2009-2023 TeX Users Group
+% Copyright 2009-2024 TeX Users Group
% Copyright @CopyYear.1997. Eitan M. Gurari
@<TeX4ht copyright@>>>>
\<private copyright\><<<
% tex4ht.env (private) (@version), generated from @jobname.tex
% (can be used as ~/.tex4ht)
-% Copyright 2009-2023 TeX Users Group
+% Copyright 2009-2024 TeX Users Group
% Copyright @CopyYear.1997. Eitan M. Gurari
@<TeX4ht copyright@>>>>
\<win32 copyright\><<<
% tex4ht.env-win32 (@version), generated from @jobname.tex
-% Copyright 2009-2023 TeX Users Group
+% Copyright 2009-2024 TeX Users Group
% Copyright @CopyYear.1997. Eitan M. Gurari
@<TeX4ht copyright@>>>>
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\OutputCode\<tex4ht\>
+% Let's no longer create tex4ht.env; it's too easy to mistakenly update
+% a system version with it. Post-Eitan, we haven't tried to keep it in
+% sync with the others.
+%\OutputCode\<tex4ht\>
+
\OutputCodE\<tex4ht.env-unix\>
\OutputCodE\<tex4ht.env-win32\>
diff --git a/Master/texmf-dist/source/generic/tex4ht/tex4ht-fonts-noncjk.tex b/Master/texmf-dist/source/generic/tex4ht/tex4ht-fonts-noncjk.tex
index ae68aa34d59..0e22004638e 100644
--- a/Master/texmf-dist/source/generic/tex4ht/tex4ht-fonts-noncjk.tex
+++ b/Master/texmf-dist/source/generic/tex4ht/tex4ht-fonts-noncjk.tex
@@ -1,4 +1,4 @@
-% $Id: tex4ht-fonts-noncjk.tex 1517 2024-05-10 11:27:42Z michal_h21 $
+% $Id: tex4ht-fonts-noncjk.tex 1541 2024-07-31 10:01:14Z michal_h21 $
% tex tex4ht-fonts-noncjk
% or ht tex tex4ht-fonts-noncjk
%
@@ -24483,6 +24483,69 @@ fplmbb 49 90
+\Section{Esvect}
+
+Font file for the Esvect package.
+
+% writing vect10.htf hash: d9018d0b41b7639bd8c3bf0419c3b8a5
+\<vect10\><<<
+vect10 0 47
+'&#x60;' '' grave 0 % generated from vect10.tfm, 2024-07-31-11:51
+'&#x00B4;' '' acute 1 % Copyright 2024 TeX Users Group
+'&#x02C6;' '' circumflex 2 %
+'&#x02DC;' '' tilde 3 % This work may be distributed and/or modified under the
+'&#x00A8;' '' dieresis 4 % conditions of the LaTeX Project Public License, either
+'&#x02DD;' '' hungarumlaut 5 % version 1.3c of this license or (at your option) any
+'&#x02DA;' '' ring 6 % later version. The latest version of this license is in
+'&#x02C7;' '' caron 7 % http://www.latex-project.org/lppl.txt
+'&#x02D8;' '' breve 8 % and version 1.3c or later is part of all distributions
+'' '' % of LaTeX version 2005/12/01 or later.
+'' '' %
+'' '' % This work has the LPPL maintenance status "maintained".
+'' '' %
+'' '' % The Current Maintainer of this work
+'' '' % is the TeX4ht Project <http://tug.org/tex4ht>.
+'' '' %
+'&#x201C;' '' quotedblleft 16 % If you modify this program, changing the
+'&#x201D;' '' quotedblright 17 % version identification would be appreciated.
+'&#x201E;' '' quotedblbase 18
+'&#x00AB;' '' guillemotleft 19
+'&#x00BB;' '' guillemotright 20
+'&#x2013;' '' endash 21
+'&#x2014;' '' emdash 22
+'&#x200C;' '' cwm 23
+'&#x2030;' '' perthousand 24
+'' ''
+'' ''
+'' ''
+'' ''
+'' ''
+'' ''
+'' ''
+' ' '' space 32
+'!' '' exclam 33
+'"' '' quotedbl 34
+'#' '' numbersign 35
+'$' '' dollar 36
+'%' '' percent 37
+'&amp;' '' ampersand 38
+'&#x2019;' '' quoteright 39
+'(' '' parenleft 40
+')' '' parenright 41
+'*' '' asterisk 42
+'+' '' plus 43
+',' '' comma 44
+'-' '' hyphen 45
+'.' '' period 46
+'/' '' slash 47
+vect10 0 47
+htfcss: vect10 font-family: 'TeXvect10', serif;
+
+>>>
+\AddFont{vect10}{unicode/TeXvect10/vect10}{}
+
+
+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
diff --git a/Master/texmf-dist/source/generic/tex4ht/tex4ht-html4.tex b/Master/texmf-dist/source/generic/tex4ht/tex4ht-html4.tex
index a2f3a577811..3dfd40a6c65 100644
--- a/Master/texmf-dist/source/generic/tex4ht/tex4ht-html4.tex
+++ b/Master/texmf-dist/source/generic/tex4ht/tex4ht-html4.tex
@@ -1,4 +1,4 @@
-% $Id: tex4ht-html4.tex 1526 2024-05-28 19:03:35Z michal_h21 $
+% $Id: tex4ht-html4.tex 1547 2024-08-19 14:07:03Z michal_h21 $
% Compile 4 times: latex tex4ht-html4
% Copy html4.4ht into the work directory before all but the last compilation.
%
@@ -2950,6 +2950,22 @@ such a case, we don't have proper nestings of environments.
\EndP\HCode{</li></ul>}\ShowPar}
{\end:itm \global\def\end:itm{\EndP\Tg</li>}\DeleteMark}
{\HCode{<li class="\getClass{li}itemize">}\afterGetClass{li}|<list par|>}
+
+\:CheckOption{itemize+}\if:Option
+\ConfigureList{itemize}%
+ {\EndP\HCode{<ul \a:LRdir
+ class="\getClass{itemize}itemize\expandafter\the
+ \csname @itemdepth\endcsname">}%
+ \afterGetClass{itemize}%
+ |<save end:itm|>\global\let\end:itm=\empty}
+ {|<recall end:itm|>\ifvmode \IgnorePar\fi
+ \EndP\HCode{</li></ul>}\ShowPar}
+ {\end:itm \global\def\end:itm{\EndP\Tg</li>}\HCode{<li class="\getClass{li}itemize"><span class="itemizeHead" aria-hidden="true">}\afterGetClass{li}}
+ {\HCode{</span>}|<list par|>}
+\Css{.itemizeHead{float: left; margin-left: -1em; width: 1em;}}
+\Css{li.itemize{list-style: none;}}
+\fi
+
\NewConfigure{itemizeClass}{2}
\Configure{itemizeClass}{}{}
\NewConfigure{liClass}{2}
@@ -13824,7 +13840,7 @@ for margin pars.
\<configure html4 epsf\><<<
\Configure{epsfsetgraph}
- {\Picture+[\PicName]{}}
+ {\Picture+[]{}}
{\EndPicture}
>>>
@@ -17790,6 +17806,45 @@ Blue = 1-minimum(1,Yellow *(1-Black)+Black)
>>>
%%%%%%%%%%%%%%%%%%
+\section{moderncv}
+%%%%%%%%%%%%%%%%%%
+
+\<configure html4 moderncv\><<<
+\Configure{cvhead}{\ifvmode\IgnorePar\fi\EndP\HCode{<div class="cvhead">}}{\ifvmode\IgnorePar\fi\EndP\HCode{</div>}}
+\Configure{cvphoto}{\ifvmode\IgnorePar\fi\EndP\HCode{<div class="cvphoto">}}{\ifvmode\IgnorePar\fi\EndP\HCode{</div>}}
+
+\Configure{section}{\ifvmode\IgnorePar\fi\EndP\HCode{<h2>}}{\HCode{</h2>}}
+\Configure{subsection}{\ifvmode\IgnorePar\fi\EndP\HCode{<h3>}}{\HCode{</h3>}}
+\Configure{cvitem}{\ifvmode\IgnorePar\fi\EndP\HCode{<div class="cvitem"><span class="cvitemhead">}}{\HCode{</span><span class="cvitembody">}}{\HCode{</span></div>}}
+\Configure{cvdoubleitem}{\ifvmode\IgnorePar\fi\EndP\HCode{<div class="cvdoubleitem">}}{\HCode{</div>}}
+\Configure{cvlistitem}{\ifvmode\IgnorePar\fi\EndP\HCode{<div class="cvlistitem">}}{\HCode{</div>}}
+\Configure{cvlistdoubleitem}{\ifvmode\IgnorePar\fi\EndP\HCode{<div class="cvlistdoubleitem">}}{\HCode{</div>}}
+
+\Configure{cvskillhead}{\ifvmode\IgnorePar\fi\EndP\HCode{<div class="cvskillhead">}}{\HCode{</div>}}
+\Configure{cvskillentry}{\ifvmode\IgnorePar\fi\EndP\HCode{<div class="cvskillentry">}}{\HCode{</div>}}
+
+\Configure{cvskill}{\Picture*[skill level: \:cvskillamount]{}}{\EndPicture}
+
+\Css{.cvskillentry .tabular, .cvskillhead .tabular {margin:0pt;}}
+\Css{.cvskillentry .tabular td:nth-child(1), .cvskillhead .tabular td:nth-child(1){width: 8ch}}
+\Css{.cvskillentry .tabular td:nth-child(2), .cvskillhead .tabular td:nth-child(2){width: 12ch}}
+\Css{.cvskillentry .tabular td:nth-child(3), .cvskillhead .tabular td:nth-child(3){width: 6ch}}
+\Css{.cvskillentry .tabular td:nth-child(4), .cvskillhead .tabular td:nth-child(4){width: 54ch}}
+
+\Css{.cvitemhead{margin-right: 1em;}}
+
+\Css{
+@media (min-width:94ch) {
+.cvitemhead{
+ margin-left: -14ch;
+ width: 12ch;
+ float: left;
+ text-align: right;
+ }
+}}
+>>>
+
+%%%%%%%%%%%%%%%%%%
\section{CSS}
%%%%%%%%%%%%%%%%%%
diff --git a/Master/texmf-dist/source/generic/tex4ht/tex4ht-jats.tex b/Master/texmf-dist/source/generic/tex4ht/tex4ht-jats.tex
index e54de5ad206..16182ba8f5c 100644
--- a/Master/texmf-dist/source/generic/tex4ht/tex4ht-jats.tex
+++ b/Master/texmf-dist/source/generic/tex4ht/tex4ht-jats.tex
@@ -1,4 +1,4 @@
-% $Id: tex4ht-jats.tex 1473 2024-02-23 12:26:51Z michal_h21 $
+% $Id: tex4ht-jats.tex 1545 2024-08-13 19:02:54Z michal_h21 $
% compile 3 times: latex tex4ht-jats
% or xhlatex tex4ht-jats "html,3,sections+"
%
@@ -201,6 +201,7 @@ Configurations that are shared only for article and report
|<latex footnotes|>
|<latex quotes|>
|<latex lists|>
+|<latex bibliography|>
>>>
\<shared article,report\><<<
@@ -841,6 +842,29 @@ them separatelly.
{\EndNoFonts\HCode{</term><def>}\HtmlParOn|<list par|>}
>>>
+
+We cannot create a structured bibliographic record for plain LaTeX references, so we
+at least mark individual entries.
+
+Entry id is set on the label element. The id comes from a child xref element that is removed
+by make4ht. Ideally, it should be set on ref, but we need to use label here, to catch
+potential entry number.
+
+
+\<latex bibliography\><<<
+\ConfigureList{thebibliography}%
+ {\ifvmode\IgnorePar\fi \EndP \HCode{<ref-list>}\let\en:bib=\empty}
+ {\en:bib \ifvmode\IgnorePar\fi \EndP \HCode{</ref-list>}}
+ {\en:bib\def\en:bib{\HCode{</mixed-citation></ref>}}%
+ \HCode{<ref><label>}%
+ \Configure{HtmlPar}%
+ {\EndP}%
+ {\EndP}%
+ {} {}%
+ }
+ {\HCode{</label><mixed-citation>}}
+>>>
+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\chapter{Packages}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
diff --git a/Master/texmf-dist/source/generic/tex4ht/tex4ht-mathjax.tex b/Master/texmf-dist/source/generic/tex4ht/tex4ht-mathjax.tex
index 23ca24a586c..25f324ab7fa 100644
--- a/Master/texmf-dist/source/generic/tex4ht/tex4ht-mathjax.tex
+++ b/Master/texmf-dist/source/generic/tex4ht/tex4ht-mathjax.tex
@@ -1,4 +1,4 @@
-% $Id: tex4ht-mathjax.tex 1474 2024-02-25 16:27:19Z karl $
+% $Id: tex4ht-mathjax.tex 1540 2024-07-28 17:10:17Z michal_h21 $
% compile: latex tex4ht-mathjax
%
% Copyright 2018-2024 TeX Users Group
@@ -37,12 +37,14 @@ in LaTeX kernel now.
\<required packages\><<<
>>>
-The \verb|\alteqtoks| command saves the used command in HTML. It uses detokenize command
-to insert arguments verbatim. The side effect of this is that detokeize inserts space
+The \verb|\alteqtoks| command prints the used LaTeX math code to the output document in
+verbatim.
+
+In the past, we used \verb|\detokenize|. The side effect of this is that detokeize inserts space
after each control sequence. This is completely valid TeX code, but earlier versions of
MathJax didn't like that, rendering resulted in error.
-Fortunatelly, MathJax 3 supports these spaces, so we can remove regular expressions for space handling.
+Fortunatelly, MathJax 3 supports these spaces, so we could remove regular expressions for space handling.
The original code was this:
% % convert \ { to \:{
@@ -52,14 +54,24 @@ The original code was this:
% % replace \\:{ back to \\ { -- this can be introduced by the previous regex
% \regex_replace_all:nnN { \x{5C} \x{5C} \x{3A} \x{7B} } { \x{5C} \x{5C} \x{20} \x{7B} } \l_tmpa_tl
+Now (July 2024), when I researched another issue, I've found that it is actually possible to avoid these
+extra spaces using LaTeX 3 commands. The inspiration comes from
+\Link[https://tex.stackexchange.com/a/44444/2891]this Bruno Le Foch\EndLink.
+One ongoing issue is that newlines are not presented. But they weren't preserved with \verb|\detokenize|
+either, so it shouldn't be a problem.
+
-We still use regula expressions to escape invalid XML characters to entities, so it works only with LaTeX.
+We still use regular expressions to escape invalid XML characters to entities, so it works only with LaTeX.
\<defined commands\><<<
\ExplSyntaxOn
\cs_new_protected:Npn \alteqtoks #1
{
- \tl_set:Ne \l_tmpa_tl {\detokenize{#1}}
+ % save tokens, but preserve spaces
+ % https://tex.stackexchange.com/a/44444/2891
+ \tl_set:Nn \l_tmpa_tl {#1}
+ \regex_replace_all:nnN { . } { \c{string} \0 } \l_tmpa_tl
+ \tl_set:Nx \l_tmpa_tl { \l_tmpa_tl }
% % replace < > and & with xml entities
\regex_replace_all:nnN { \x{26} } { &amp; } \l_tmpa_tl
\regex_replace_all:nnN { \x{3C} } { &lt; } \l_tmpa_tl
diff --git a/Master/texmf-dist/source/generic/tex4ht/tex4ht-mathml.tex b/Master/texmf-dist/source/generic/tex4ht/tex4ht-mathml.tex
index e7f496d6bf0..707d65805f8 100644
--- a/Master/texmf-dist/source/generic/tex4ht/tex4ht-mathml.tex
+++ b/Master/texmf-dist/source/generic/tex4ht/tex4ht-mathml.tex
@@ -1,4 +1,4 @@
-% $Id: tex4ht-mathml.tex 1495 2024-03-21 16:39:31Z michal_h21 $$
+% $Id: tex4ht-mathml.tex 1548 2024-08-27 14:38:17Z michal_h21 $$
% compile 3 times: latex tex4ht-mathltx
% or xhlatex tex4ht-mathltx "html,3,sections+"
%
@@ -584,7 +584,7 @@ in italic and without space that would separate it from the following element.
\<html-mml\><<<
% html-mml.4ht (|version), generated from |jobname.tex
-% Copyright 2009-2022 TeX Users Group
+% Copyright 2009-2024 TeX Users Group
% Copyright |CopyYear.1999. Eitan M. Gurari
|<TeX4ht copywrite|>
>>>
@@ -1939,6 +1939,189 @@ primes.
\fi
>>>
+
+We may want to include LaTeX source as an annotation in MathML. In particular LaTeX PDF tagging code can use
+this feature. We will not use it by default, but only with texsource option, as it can potentially
+break some functionality.
+
+The code is based on the LaTeX MathJax code, but heavily modified.
+
+\<configure html-mml latex\><<<
+\:CheckOption{texsource}\if:Option
+
+\newtoks\mmleqtoks
+\ExplSyntaxOn
+\cs_new_protected:Npn \mmlalteqtoks #1
+{
+ % save tokens, but preserve spaces
+ % https://tex.stackexchange.com/a/44444/2891
+ \tl_set:Nn \l_tmpa_tl {#1}
+ \regex_replace_all:nnN { . } { \c{string} \0 } \l_tmpa_tl
+ \tl_set:Nx \l_tmpa_tl { \l_tmpa_tl }
+ % % replace < > and & with xml entities
+ \regex_replace_all:nnN { \x{26} } { &amp; } \l_tmpa_tl
+ \regex_replace_all:nnN { \x{3C} } { &lt; } \l_tmpa_tl
+ \regex_replace_all:nnN { \x{3E} } { &gt; } \l_tmpa_tl
+ % \regex_replace_all:nnN { \n } {\HCode{ \Hnewline }} \l_tmpa_tl
+ % replace \par command with blank lines
+ \regex_replace_all:nnN { \x{5C}par\b } {\x{A}\x{A}} \l_tmpa_tl
+ \tl_set:Nx \mmleqtoks{ \l_tmpa_tl }
+
+ %\HCode{\l_tmpb_tl}
+}
+\ExplSyntaxOff
+
+
+\def\AltMath#1${\mmlalteqtoks{#1}%
+ #1\HCode{</\a:mathml mrow><\a:mathml annotation encoding="application/x-tex">\mmleqtoks</\a:mathml annotation>}$}
+\Configure{$}{\Configure{@math}{display="inline"}\DviMath\HCode{<\a:mathml semantics><\a:mathml mrow>}}{\HCode{</\a:mathml semantics>}\EndDviMath}{\expandafter\AltMath}
+
+\def\AltMathParen#1\){\mmlalteqtoks{#1}%
+ #1\HCode{</\a:mathml mrow><a\a:mathml nnotation encoding="application/x-tex">\mmleqtoks</\a:mathml annotation>}$}
+
+\def\AltMathParen#1\){\mmlalteqtoks{#1}#1\HCode{</\a:mathml mrow><\a:mathml annotation encoding="application/x-tex">\mmleqtoks</\a:mathml annotation>}\)}
+%\Configure{()}{\Configure{@math}{display="inline"}\DviMath\HCode{<\a:mathml semantics><\a:mathml mrow>}\AltMathParen$}{\EndDviMath\HCode{</\a:mathml semantics>}}
+\Configure{()}
+ {\Configure{@math}{%\a:mathml
+ display="inline"
+}\csname a:mathml()\endcsname
+\DviMath\HCode{<\a:mathml semantics><\a:mathml mrow>}$\expandafter\AltMathParen}
+{$\HCode{</\a:mathml semantics>}\EndDviMath\csname b:mathml()\endcsname}
+
+
+\long\def\AltDisplay#1\]{\mmlalteqtoks{#1}#1\HCode{</\a:mathml mrow><\a:mathml annotation encoding="application/x-tex">\mmleqtoks</\a:mathml annotation></\a:mathml semantics>}\]}
+\Configure{[]}{\Configure{@math}{display="block"}\DviMath$$\DisplayMathtrue\HCode{<\a:mathml semantics><\a:mathml mrow>}\AltDisplay}{$$\EndDviMath}
+
+
+% \long\def\MMLAltlDisplayDollars#1$${\mmlalteqtoks{\[#1\]}#1\HCode{</\a:mathml mrow><\a:mathml annotation encoding="application/x-tex">\mmleqtoks</\a:mathml annotation>}$$}
+
+% configuarartion of display math doesn't work yet. need to investigate it.
+% \Configure{$$}
+% {\Configure{@math}{%\a:mathml
+% display="block"
+% }\IgnorePar
+% \ifvmode\else \HCode{<!--tex4ht:inline-->}\fi
+% \EndP\DviMath\HCode{<\a:mathml semantics><\a:mathml mrow>}}
+% {\HCode{</\a:mathml semantics>}\EndDviMath\ShowPar\par{\csname HCondtrue\endcsname\noindent}}
+% {\DisplayMathtrue\expandafter\MMLAltlDisplayDollars}
+
+
+% \renewcommand\eqannotate[1]{\mmlalteqtoks{#1}\HCode{<\a:mathml semantics><\a:mathml mrow>}#1\HCode{</\a:mathml mrow><\a:mathml annotation encoding="application/x-tex">\mmleqtoks</\a:mathml annotation></\a:mathml semantics>}}
+
+
+% environment support
+\newcommand\MMLVerbMathToks[2]{%
+ \mmlalteqtoks{\begin{#2}
+ #1
+ \end{#2}}%
+ \begingroup%
+ \ifvmode\IgnorePar\fi\EndP\Configure{@math}{display="block"}\DviMath\DisplayMathtrue\HCode{<\a:mathml semantics><\a:mathml mrow>}
+ \Configure{$$}{}{}{}
+ \begin{old#2}
+ #1
+ \end{old#2}
+ \HCode{</\a:mathml mrow><\a:mathml annotation encoding="application/x-tex">}
+ \HCode{\mmleqtoks}
+ \HCode{</\a:mathml annotation></\a:mathml semantics>}
+ \EndDviMath
+ \endgroup
+}
+
+% we must handle equations separatelly.
+% it is a bit messy
+\newcommand\MMLVerbMathToksEquation[2]{%
+ \mmlalteqtoks{\begin{#2}
+ #1
+ \end{#2}}%
+ \begingroup%
+ \def\@tempa{#2}%
+ \def\@equationname{equation}%
+ \def\mlabeledtr{mtr}
+ \ifx\@equationname\@tempa%
+ \def\mlabeledtr{mlabeledtr} % this element can be used to print the equation number, but it is supported only by MathJax
+ \fi
+ \ifvmode\IgnorePar\fi\EndP\Configure{@math}{display="block"}\DviMath\DisplayMathtrue\HCode{<\a:mathml semantics><\a:mathml mrow><\a:mathml mtable><\a:mathml \mlabeledtr><\a:mathml mtd>}%
+ \ifx\@equationname\@tempa%
+ \incr@eqnum%
+ \print@eqnum%
+ \HCode{</\a:mathml mtd><\a:mathml mtd>}%
+ \fi
+ #1%
+ \HCode{</\a:mathml mtd></\a:mathml \mlabeledtr></\a:mathml mtable></\a:mathml mrow><\a:mathml annotation encoding="application/x-tex">}%
+ \HCode{\mmleqtoks}%
+ \HCode{</\a:mathml annotation></\a:mathml semantics>}%
+ \EndDviMath%
+ \endgroup%
+}
+
+\ExplSyntaxOn
+\newcommand\MMLVerbMath[1]{%
+ \cs_if_exist:cTF{#1}{
+ \expandafter\let\csname old#1\expandafter\endcsname\csname #1\endcsname
+ \expandafter\let\csname endold#1\expandafter\endcsname\csname end#1\endcsname
+ \RenewDocumentEnvironment{#1}{+!b}{%
+ \NoFonts\expandafter\MMLVerbMathToks\expandafter{##1}{#1}\EndNoFonts%
+ }{}
+ }{}%
+}
+
+\newcommand\MMLVerbEquation[1]{%
+ \cs_if_exist:cTF{#1}{
+ \expandafter\let\csname old#1\expandafter\endcsname\csname #1\endcsname
+ \expandafter\let\csname endold#1\expandafter\endcsname\csname end#1\endcsname
+ \RenewDocumentEnvironment{#1}{+!b}{%
+ \NoFonts\expandafter\MMLVerbMathToksEquation\expandafter{##1}{#1}\EndNoFonts%
+ }{}
+ }{}%
+}
+\ExplSyntaxOff
+
+% \MMLVerbEquation{equation}
+% \MMLVerbEquation{equation*}
+
+\fi
+>>>
+
+\<configure html-mml amsmath\><<<
+\:CheckOption{texsource}\if:Option
+\MMLVerbMath{subarray}
+\MMLVerbMath{smallmatrix}
+\MMLVerbMath{matrix}
+\MMLVerbMath{pmatrix}
+\MMLVerbMath{bmatrix}
+\MMLVerbMath{Bmatrix}
+\MMLVerbMath{vmatrix}
+\MMLVerbMath{Vmatrix}
+\MMLVerbMath{cases}
+\MMLVerbMath{subequations}
+\MMLVerbMath{aligned}
+\MMLVerbMath{alignedat}
+\MMLVerbMath{gathered}
+\MMLVerbMath{gather}
+\MMLVerbMath{gather*}
+\MMLVerbMath{alignat}
+\MMLVerbMath{alignat*}
+\MMLVerbMath{xalignat}
+\MMLVerbMath{xalignat*}
+\MMLVerbMath{xxalignat}
+\MMLVerbMath{align}
+\MMLVerbMath{align*}
+\MMLVerbMath{flalign}
+\MMLVerbMath{flalign*}
+\MMLVerbMath{split}
+\MMLVerbMath{multline}
+\MMLVerbMath{multline*}
+% equations fails with errors, even though it worked in a .cfg
+% I will need to investigate it more
+% \MMLVerbEquation{equation}
+% \MMLVerbEquation{equation*}
+\MMLVerbMath{math}
+\MMLVerbMath{displaymath}
+\MMLVerbMath{eqnarray}
+\MMLVerbMath{eqnarray*}
+\fi
+>>>
+
%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{plain.sty}
%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -3584,14 +3767,19 @@ charactes.
Extra brackets are used in order to support subscripts and superscripts.
\<configure mathml latex\><<<
-\def\:temp#1#2{\def#1{\PauseMathClass{\HCode{<mi mathvariant="normal">}\ht:special{t4ht@+\string&{35}x#2{59}}\a:HChar\HCode{</mi>}}\EndPauseMathClass}}
-\:temp\Psi{03A8}
+\def\:temp#1#2{\def\:tempa{\PauseMathClass{\HCode{<mi mathvariant="normal">}\ht:special{t4ht@+\string&{35}x#2{59}}\a:HChar\HCode{</mi>}}\EndPauseMathClass}\HLet#1\:tempa}
+\:temp\Gamma{0393}
\:temp\Delta{0394}
+\:temp\Theta{0398}
+\:temp\Lambda{039B}
\:temp\Xi{039E}
\:temp\Pi{03A0}
\:temp\Sigma{03A3}
\:temp\Upsilon{03A5}
+\:temp\Phi{03A6}
+\:temp\Psi{03A8}
\:temp\Omega{03A9}
+
>>>
@@ -5703,6 +5891,25 @@ elements that are printed to support the munderover element easily.
>>>
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{esvec}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+We need to redefine these commands only for MathML. By default, Esvect produces images, which is OK.
+
+\<configure mathml esvect\><<<
+\def\:tempa#1{%
+ \bgroup\HCode{<\a:mathml mover><\a:mathml mrow>}#1\HCode{</\a:mathml mrow><\a:mathml mo>&rarr;</\a:mathml mo></\a:mathml mover>}\egroup
+}
+
+\HLet\ESV@vecteur\:tempa
+\def\:tempa#1#2{%
+ \ESV@vecteur{{#1}\sb{#2}}
+}
+\HLet\vvstar\:tempa
+
+>>>
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\chapter{Notes}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
diff --git a/Master/texmf-dist/source/latex-dev/base/alltt.dtx b/Master/texmf-dist/source/latex-dev/base/alltt.dtx
index 4718c004b40..8fd4ac2db36 100644
--- a/Master/texmf-dist/source/latex-dev/base/alltt.dtx
+++ b/Master/texmf-dist/source/latex-dev/base/alltt.dtx
@@ -40,7 +40,7 @@
%<package>\ProvidesPackage{alltt}
%<driver>\ProvidesFile{alltt.drv}
%\ProvidesFile{alltt.dtx}
- [2024/02/08 v2.0g defines alltt environment]
+ [2024/07/07 v2.0g defines alltt environment]
%
%<*driver>
\documentclass{ltxdoc}
@@ -83,7 +83,7 @@
% Here are some things you may want to do in an \Lenv{alltt}
% environment:
% \begin{itemize}
-% \item Change fonts--e.g., by typing |{\em emphasized text\/}|
+% \item Change fonts--e.g., by typing |\emph{emphasized text}|
%
% \item Insert text from a file \file{foo.tex} by typing
% |\input{foo}|. Beware that each |<return>| starts a new line, so
diff --git a/Master/texmf-dist/source/latex-dev/base/classes.dtx b/Master/texmf-dist/source/latex-dev/base/classes.dtx
index f7c53f0f719..ce3d902b21c 100644
--- a/Master/texmf-dist/source/latex-dev/base/classes.dtx
+++ b/Master/texmf-dist/source/latex-dev/base/classes.dtx
@@ -53,7 +53,7 @@
%<*driver>
\ProvidesFile{classes.drv}
%</driver>
- [2024/02/08 v1.4n
+ [2024/06/29 v1.4n
%<article|report|book> Standard LaTeX document class]
%<10pt|11pt|12pt> Standard LaTeX file (size option)]
% \end{macrocode}
@@ -257,7 +257,7 @@
%
% \begin{macro}{\@ptsize}
% This control sequence is used to store the second digit of the
-% pointsize we are typesetting in. So, normally, it's value is one
+% pointsize we are typesetting in. So, normally, its value is one
% of 0, 1 or 2.
% \begin{macrocode}
%<*article|report|book>
@@ -362,7 +362,7 @@
% with other packages that use the |\@ptsize| variable to select
% special actions. It makes the declarations of size options less
% than 10pt difficult, although one can probably use \texttt{9}
-% and \texttt{8} assuming that a class wont define both
+% and \texttt{8} assuming that a class won't define both
% \Lopt{8pt} and \Lopt{18pt} options.
%
% \begin{macrocode}
@@ -3122,7 +3122,7 @@
%
% \subsubsection{Theorem}
%
-% This document class does not define it's own theorem environments,
+% This document class does not define its own theorem environments,
% the defaults, supplied by the \LaTeX{} format are available.
%
% \subsubsection{Titlepage}
@@ -3130,12 +3130,12 @@
% \begin{environment}{titlepage}
% In the normal environments, the titlepage environment does nothing
% but start and end a page, and inhibit page numbers. When \LaTeX\ is
-% in two-column mode, the environmont temporarily switches to
+% in two-column mode, the environment temporarily switches to
% one-column mode.
% In the report class, it also resets the page number to one, and
% then, in two-column mode, sets it back to one at the end.
% For the book class the environment makes sure that the title page
-% is on a recto page by issueing a \cs{cleardouplepage}-command.
+% is on a recto page by issuing a \cs{cleardoublepage}-command.
% In compatibility mode, it sets the page number to zero. This is
% incorrect since it results in using the page parameters for a
% right-hand page but it is the way it was.
diff --git a/Master/texmf-dist/source/latex-dev/base/doc.dtx b/Master/texmf-dist/source/latex-dev/base/doc.dtx
index af4d9508e94..4cb8dd6b1cc 100644
--- a/Master/texmf-dist/source/latex-dev/base/doc.dtx
+++ b/Master/texmf-dist/source/latex-dev/base/doc.dtx
@@ -34,7 +34,7 @@
%\catcode`\<=14
%<+package|shortvrb>\NeedsTeXFormat{LaTeX2e}[1994/12/01]
%<+package>
-% Any rollback request before 2016-02-15 we try to fullfil with the 2016 version:
+% Any rollback request before 2016-02-15 we try to fulfill with the 2016 version:
%<+package>\DeclareRelease{}{1994-06-01}
%<+package> {doc-2016-02-15.sty}
%<+package>\DeclareRelease{v2.1g}{2016-02-15}
@@ -45,7 +45,7 @@
%<+package>
%<+package>\ProvidesPackage{doc}
%<+shortvrb>\ProvidesPackage{shortvrb}
-%<+package|shortvrb> [2024/06/04 v3.0q
+%<+package|shortvrb> [2024/06/29 v3.0q
%<+package|shortvrb> Standard LaTeX documentation package V3 (FMi)]
%\catcode`\<=12
%
@@ -836,7 +836,7 @@
%
% All three above declarations are local to the current group.
%
-% Production (or not) of the index (via the |\makeindex| commend) is
+% Production (or not) of the index (via the |\makeindex| command) is
% controlled by using or omitting the following declarations in the
% driver file preamble; if neither is used, no index is produced.
% \DescribeInterfaceMacro\PageIndex Using |\PageIndex| makes all index
@@ -5565,7 +5565,7 @@
% Since version 2.1g, \texttt{doc} creates a \cs{saved@indexname} command
% which in used by \cs{changes}. We now support that as well. The expansion of
% this command depends on whether the documented item is macrolike or not,
-% which we don't know here (it's only know by \cs{NewDocElement}). That's why we
+% which we don't know here (it's only known by \cs{NewDocElement}). That's why we
% need one specific command generating \cs{saved@indexname} the right way for
% every single item. These commands are
% named\cs{@Save\meta{item}IndexName};
diff --git a/Master/texmf-dist/source/latex-dev/base/fontdef.dtx b/Master/texmf-dist/source/latex-dev/base/fontdef.dtx
index 281add29efc..080cb289e53 100644
--- a/Master/texmf-dist/source/latex-dev/base/fontdef.dtx
+++ b/Master/texmf-dist/source/latex-dev/base/fontdef.dtx
@@ -40,7 +40,7 @@
%<driver, >\ProvidesFile{fontdef.drv}
% \fi
% \ProvidesFile{fontdef.dtx}
- [2024/02/09 v3.0i LaTeX Kernel
+ [2024/07/08 v3.0j LaTeX Kernel
% \iffalse
%<text, > (Text font setup)
%<math, > (Math font setup)
@@ -411,6 +411,18 @@
\endgroup
% \end{macrocode}
%
+% \changes{v3.0j}{2024/06/24}{load ts1 cmr fd file in Unicode engines}
+% Even though Unicode engines default to |lm| load |ts1cmr|
+% as this may be used for fallback for TS1 encoding.
+% \begin{macrocode}
+\ifx\Umathcode\@undefined\else
+\begingroup
+\nfss@catcodes
+\input {ts1cmr.fd}
+\endgroup
+\fi
+% \end{macrocode}
+%
% Even with all the precautions it is still possible that NFSS will
% run into problems, for example, when a |.fd| file contains
% corrupted data. To guard against such cases NFSS has a very
@@ -527,7 +539,6 @@
%<*text|latexrelease>
%<latexrelease>\IncludeInRelease{2020/02/02}%
%<latexrelease> {\updefault}{font defaults change}%
-% \begin{macrocode}
\renewcommand\updefault{up}
% \end{macrocode}
% We append \cs{@empty} to the series value so that we can detect
diff --git a/Master/texmf-dist/source/latex-dev/base/latexrelease.dtx b/Master/texmf-dist/source/latex-dev/base/latexrelease.dtx
index eeda0f8d557..5b5c3648a48 100644
--- a/Master/texmf-dist/source/latex-dev/base/latexrelease.dtx
+++ b/Master/texmf-dist/source/latex-dev/base/latexrelease.dtx
@@ -40,7 +40,7 @@
%<*latexrelease>
% \fi
% \ProvidesFile{latexrelease.dtx}
- [2022/11/14 v1.0p LaTeX release emulation and tests
+ [2024/08/11 v1.0p LaTeX release emulation and tests
(including releases up to \latexreleaseversion)]
% \iffalse
%</latexrelease>
@@ -507,7 +507,7 @@
% \end{macro}
%
% \changes{v1.0c}{2015/02/19}{Swap argument order}
-% \changes{v1.0k}{2018/05/08}{reset \cs{\requestedLaTeXdate} for current
+% \changes{v1.0k}{2018/05/08}{reset \cs{requestedLaTeXdate} for current
% and latest options, github issue 43}
% \begin{macrocode}
\DeclareOption*{%
diff --git a/Master/texmf-dist/source/latex-dev/base/letter.dtx b/Master/texmf-dist/source/latex-dev/base/letter.dtx
index 4df9e5ead62..dde59f40e4a 100644
--- a/Master/texmf-dist/source/latex-dev/base/letter.dtx
+++ b/Master/texmf-dist/source/latex-dev/base/letter.dtx
@@ -45,7 +45,7 @@
%<*driver>
\ProvidesFile{letter.drv}
%</driver>
- [2021/12/07 v1.3c
+ [2024/08/12 v1.3c
%<+letter> Standard LaTeX document class]
% \end{macrocode}
%
@@ -838,9 +838,10 @@
% $1$, with footnotes starting from $1$ as well.
% (The first page is unnumbered.) It has a single argument, which
% is the addressee and his address, as in
+% \changes{v1.3c}{2024/08/12}{Alter sample address (gh/1439)}
%\begin{verbatim}
% \begin{letter}{Sam Jones \\
-% Institute for Retarded Study\\
+% Institute for Trivial Study\\
% Princeton, N.J.}
%\end{verbatim}
% Local declarations, such as |\address|, can follow the
diff --git a/Master/texmf-dist/source/latex-dev/base/ltboxes.dtx b/Master/texmf-dist/source/latex-dev/base/ltboxes.dtx
index 9852bc59403..e3620ef1aea 100644
--- a/Master/texmf-dist/source/latex-dev/base/ltboxes.dtx
+++ b/Master/texmf-dist/source/latex-dev/base/ltboxes.dtx
@@ -33,7 +33,7 @@
%<*driver>
% \fi
\ProvidesFile{ltboxes.dtx}
- [2024/06/10 v1.4g LaTeX Kernel (Box Commands)]
+ [2024/06/23 v1.4h LaTeX Kernel (Box Commands)]
% \iffalse
\documentclass{ltxdoc}
\GetFileInfo{ltboxes.dtx}
@@ -456,9 +456,6 @@
% \begin{macro}{\color@begingroup}
% \changes{v1.0b}{1994/03/14}
% {macro added for color support}
-% \begin{macro}{\color@endgroup}
-% \changes{v1.0b}{1994/03/14}
-% {macro added for color support}
% \begin{macro}{\color@setgroup}
% \changes{v1.0f}{1994/05/11}
% {macro added for color support}
@@ -491,7 +488,6 @@
%<latexrelease>\IncludeInRelease{2021/06/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}
@@ -506,7 +502,6 @@
%<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
@@ -522,7 +517,51 @@
% \end{macro}
% \end{macro}
% \end{macro}
+
+
+
+% \begin{macro}{\color@endgroup}
+% This macro is separated out because it received an update in 2024,
+% so requires its own rollback.
+% \changes{v1.0b}{1994/03/14}
+% {macro added for color support}
+% \begin{macrocode}
+%</2ekernel>
+%<*2ekernel|latexrelease>
+%<latexrelease>\IncludeInRelease{2024/11/01}%
+%<latexrelease> {\color@endgroup}{color group settings}%
+% \end{macrocode}
+% Beside \cs{endgraf} for handling vertical boxes we also reset
+% \cs{if@endpe} as we are leaving the context.
+% \changes{v1.4h}{2024/06/23}{Adjust for new \texttt{@endpe} handling}
+% \begin{macrocode}
+\def\color@endgroup{\endgraf\@endpefalse\endgroup}
+%<latexrelease>
+%</2ekernel|latexrelease>
+%<latexrelease>\EndIncludeInRelease
+% \end{macrocode}
+%
+% \begin{macrocode}
+%<latexrelease>\IncludeInRelease{2021/06/01}%
+%<latexrelease> {\color@endgroup}{color group settings}%
+%<latexrelease>\def\color@endgroup{\endgraf\endgroup}
+%<latexrelease>
+%<latexrelease>\EndIncludeInRelease
+% \end{macrocode}
+%
+% \begin{macrocode}
+%<latexrelease>\IncludeInRelease{0000/00/00}%
+%<latexrelease> {\color@endgroup}{color group settings}%
+%<latexrelease>
+%<latexrelease>\let\color@endgroup\relax
+%<latexrelease>
+%<latexrelease>\EndIncludeInRelease
+%<*2ekernel>
+% \end{macrocode}
% \end{macro}
+
+
+
%
% \begin{macro}{\newsavebox}
% \changes{v0.1a}{1993/12/03}
diff --git a/Master/texmf-dist/source/latex-dev/base/ltcmd.dtx b/Master/texmf-dist/source/latex-dev/base/ltcmd.dtx
index 69bd162e56b..eccb104bb96 100644
--- a/Master/texmf-dist/source/latex-dev/base/ltcmd.dtx
+++ b/Master/texmf-dist/source/latex-dev/base/ltcmd.dtx
@@ -34,8 +34,8 @@
%%% From File: ltcmd.dtx
%
% \begin{macrocode}
-\def\ltcmdversion{v1.2e}
-\def\ltcmddate{2024-04-17}
+\def\ltcmdversion{v1.2f}
+\def\ltcmddate{2024-07-06}
% \end{macrocode}
%
%<*driver>
@@ -620,31 +620,51 @@
% \end{macro}
% \end{macro}
%
-% \begin{macro}{\@@_declare_env:nnnn}
+% \begin{macro}{\@@_declare_env:nnnn, \@@_declare_env:ennn}
+% \changes{v1.2f}{2024/07/06}{Use space-trimmed envname directly (gh/1399)}
% \begin{macro}{\@@_declare_env_internal:nnnn}
+% \begin{macro}{\@@_set_environment_end:n}
% 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}
+%<latexrelease>\IncludeInRelease{2024/11/01}{\@@_declare_env:nnnn}%
+%<latexrelease> {Use~space-trimmed~envname~directly}
\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 }
- {
- \msg_info:nnxx { cmd } { redefine-env }
- { \l_@@_environment_str } { \tl_to_str:n {#2} }
- }
- {
- \msg_info:nnxx { cmd } { define-env }
- { \l_@@_environment_str } { \tl_to_str:n {#2} }
- }
+ \str_set:Nn \l_@@_environment_str {#1}
+ \cs_if_exist:cTF { #1 }
+ { \msg_info:nnnn { cmd } { redefine-env } { #1 } { #2 } }
+ { \msg_info:nnnn { cmd } { define-env } { #1 } { #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}
+ \@@_declare_env_internal:nnnn {#1} {#2}
}
+\cs_generate_variant:Nn \@@_declare_env:nnnn { e }
+%<latexrelease>\EndIncludeInRelease
+%<latexrelease>\IncludeInRelease{2024/06/01}{\@@_declare_env:nnnn}%
+%<latexrelease> {Use~space-trimmed~envname~directly}
+%<latexrelease>\cs_new_protected:Npn \@@_declare_env:nnnn #1#2
+%<latexrelease> {
+%<latexrelease> \str_set:Nx \l_@@_environment_str {#1}
+%<latexrelease> \str_set:Nx \l_@@_environment_str
+%<latexrelease> { \tl_trim_spaces:o { \l_@@_environment_str } }
+%<latexrelease> \cs_if_exist:cTF { \l_@@_environment_str }
+%<latexrelease> {
+%<latexrelease> \msg_info:nnxx { cmd } { redefine-env }
+%<latexrelease> { \l_@@_environment_str } { \tl_to_str:n {#2} }
+%<latexrelease> }
+%<latexrelease> {
+%<latexrelease> \msg_info:nnxx { cmd } { define-env }
+%<latexrelease> { \l_@@_environment_str } { \tl_to_str:n {#2} }
+%<latexrelease> }
+%<latexrelease> \bool_set_false:N \l_@@_expandable_bool
+%<latexrelease> \bool_set_true:N \l_@@_environment_bool
+%<latexrelease> \exp_args:NV \@@_declare_env_internal:nnnn
+%<latexrelease> \l_@@_environment_str {#2}
+%<latexrelease> }
+%<latexrelease>
+%<latexrelease>\EndIncludeInRelease
% \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
@@ -685,6 +705,7 @@
% \end{macrocode}
% \end{macro}
% \end{macro}
+% \end{macro}
%
% \subsection{Structure of \pkg{xparse} commands}
%
@@ -5022,36 +5043,109 @@
%
% \begin{macro}{\NewDocumentEnvironment}
% \changes{v1.0h}{2021/08/27}{Check for end-of-environment command}
+% \changes{v1.2f}{2024/07/06}{Trim spaces from envname first (gh/1399)}
% \begin{macro}{\RenewDocumentEnvironment}
% \begin{macro}{\ProvideDocumentEnvironment}
% \begin{macro}{\DeclareDocumentEnvironment}
-% Very similar for environments.
-% \begin{macrocode}
+% \begin{macro}{\@@_new_env:nnnn, \@@_renew_env:nnnn, \@@_provide_env:nnnn}
+% \begin{macro}{\@@_new_env:ennn, \@@_renew_env:ennn, \@@_provide_env:ennn}
+% Very similar for environments. Trim spaces from user-specified
+% \meta{envname}, do existence check then hand off to
+% \cs{@@_declare_env:nnnn}.
+% \begin{macrocode}
+%<latexrelease>\IncludeInRelease{2024/11/01}{\NewDocumentEnvironment}%
+%<latexrelease> {Trim~spaces~from~envname~first}
\cs_new_protected:Npn \NewDocumentEnvironment #1#2#3#4
{
+ \@@_new_env:ennn { \tl_trim_spaces:e {#1} } {#2} {#3} {#4}
+ }
+\cs_new_protected:Npn \RenewDocumentEnvironment #1#2#3#4
+ {
+ \@@_renew_env:ennn { \tl_trim_spaces:e {#1} } {#2} {#3} {#4}
+ }
+\cs_new_protected:Npn \ProvideDocumentEnvironment #1#2#3#4
+ {
+ \@@_provide_env:ennn { \tl_trim_spaces:e {#1} } {#2} {#3} {#4}
+ }
+\cs_new_protected:Npn \DeclareDocumentEnvironment #1#2#3#4
+ {
+ \@@_declare_env:ennn { \tl_trim_spaces:e {#1} } {#2} {#3} {#4}
+ }
+% \end{macrocode}
+% Each of \cs[no-index]{@@_(new|renew|provide)_env:nnnn} is curried.
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_new_env:nnnn #1
+ {
\cs_if_exist:cTF {#1}
- { \msg_error:nnx { cmd } { env-already-defined } {#1} }
+ {
+ \msg_error:nnx { cmd } { env-already-defined } {#1}
+ \use_none:nnn
+ }
{
\cs_if_exist:cTF { end #1 }
- { \msg_error:nnx { cmd } { env-end-already-defined } {#1} }
- { \@@_declare_env:nnnn {#1} {#2} {#3} {#4} }
+ {
+ \msg_error:nnx { cmd } { env-end-already-defined } {#1}
+ \use_none:nnn
+ }
+ { \@@_declare_env:nnnn {#1} }
}
}
-\cs_new_protected:Npn \RenewDocumentEnvironment #1#2#3#4
+\cs_new_protected:Npn \@@_renew_env:nnnn #1
{
\cs_if_exist:cTF {#1}
- { \@@_declare_env:nnnn {#1} {#2} {#3} {#4} }
- { \msg_error:nnx { cmd } { env-undefined } {#1} }
+ { \@@_declare_env:nnnn {#1} }
+ {
+ \msg_error:nnx { cmd } { env-undefined } {#1}
+ \use_none:nnn
+ }
}
-\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} }
+\cs_new_protected:Npn \@@_provide_env:nnnn #1
+ {
+ \cs_if_exist:cTF {#1}
+ { \use_none:nnn }
+ { \@@_declare_env:nnnn {#1} }
+ }
+\cs_generate_variant:Nn \@@_new_env:nnnn { e }
+\cs_generate_variant:Nn \@@_renew_env:nnnn { e }
+\cs_generate_variant:Nn \@@_provide_env:nnnn { e }
+%<latexrelease>\EndIncludeInRelease
+%<latexrelease>\IncludeInRelease{2024/06/01}{\NewDocumentEnvironment}%
+%<latexrelease> {Trim~spaces~from~envname~first}
+%<latexrelease>\cs_new_protected:Npn \NewDocumentEnvironment #1#2#3#4
+%<latexrelease> {
+%<latexrelease> \cs_if_exist:cTF {#1}
+%<latexrelease> { \msg_error:nnx { cmd } { env-already-defined } {#1} }
+%<latexrelease> {
+%<latexrelease> \cs_if_exist:cTF { end #1 }
+%<latexrelease> { \msg_error:nnx { cmd } { env-end-already-defined } {#1} }
+%<latexrelease> { \@@_declare_env:nnnn {#1} {#2} {#3} {#4} }
+%<latexrelease> }
+%<latexrelease> }
+%<latexrelease>\cs_new_protected:Npn \RenewDocumentEnvironment #1#2#3#4
+%<latexrelease> {
+%<latexrelease> \cs_if_exist:cTF {#1}
+%<latexrelease> { \@@_declare_env:nnnn {#1} {#2} {#3} {#4} }
+%<latexrelease> { \msg_error:nnx { cmd } { env-undefined } {#1} }
+%<latexrelease> }
+%<latexrelease>\cs_new_protected:Npn \ProvideDocumentEnvironment #1#2#3#4
+%<latexrelease> { \cs_if_exist:cF {#1} { \@@_declare_env:nnnn {#1} {#2} {#3} {#4} } }
+%<latexrelease>\cs_new_protected:Npn \DeclareDocumentEnvironment #1#2#3#4
+%<latexrelease> { \@@_declare_env:nnnn {#1} {#2} {#3} {#4} }
+%<latexrelease>\cs_undefine:N \@@_new_env:nnnn
+%<latexrelease>\cs_undefine:N \@@_new_env:ennn
+%<latexrelease>\cs_undefine:N \@@_renew_env:nnnn
+%<latexrelease>\cs_undefine:N \@@_renew_env:ennn
+%<latexrelease>\cs_undefine:N \@@_provide_env:nnnn
+%<latexrelease>\cs_undefine:N \@@_provide_env:ennn
+%<latexrelease>
+%<latexrelease>\EndIncludeInRelease
% \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
+% \end{macro}
+% \end{macro}
%
% \begin{macro}{\NewExpandableDocumentCommand}
% \begin{macro}{\RenewExpandableDocumentCommand}
diff --git a/Master/texmf-dist/source/latex-dev/base/ltcmdhooks.dtx b/Master/texmf-dist/source/latex-dev/base/ltcmdhooks.dtx
index f8a8699d7ed..e8793817df3 100644
--- a/Master/texmf-dist/source/latex-dev/base/ltcmdhooks.dtx
+++ b/Master/texmf-dist/source/latex-dev/base/ltcmdhooks.dtx
@@ -20,7 +20,7 @@
%<*driver>
% \fi
\ProvidesFile{ltcmdhooks.dtx}
- [2024/04/17 v1.0j LaTeX Kernel (Command hooks)]
+ [2024/07/08 v1.0j LaTeX Kernel (Command hooks)]
% \iffalse
%
\documentclass{l3doc}
@@ -1530,6 +1530,7 @@
%<latexrelease> {cmd~hooks~with~args}
\cs_new_protected:Npn \@@_patch_retokenize:Nnnn #1 #2 #3 #4
{
+% \end{macrocode}
% Here, when patching by retokenization, we can only guess the number
% of arguments of the macro.
% \changes{v1.0h}{2023/05/21}
diff --git a/Master/texmf-dist/source/latex-dev/base/ltfinal.dtx b/Master/texmf-dist/source/latex-dev/base/ltfinal.dtx
index 648e3e1b8bd..2c6b96049be 100644
--- a/Master/texmf-dist/source/latex-dev/base/ltfinal.dtx
+++ b/Master/texmf-dist/source/latex-dev/base/ltfinal.dtx
@@ -33,7 +33,7 @@
%<*driver>
% \fi
\ProvidesFile{ltfinal.dtx}
- [2024/02/08 v2.3c LaTeX Kernel (Final Settings)]
+ [2024/07/08 v2.3c LaTeX Kernel (Final Settings)]
% \iffalse
\documentclass{ltxdoc}
\GetFileInfo{ltfinal.dtx}
@@ -930,7 +930,7 @@
%
% \begin{macrocode}
%<*2ekernel>
-% \begin{macrocode}
+% \end{macrocode}
%
% We temporarily define |\reserved@a| to apply |\reserved@c| to all the
% numbers in the range of its arguments.
diff --git a/Master/texmf-dist/source/latex-dev/base/ltfssbas.dtx b/Master/texmf-dist/source/latex-dev/base/ltfssbas.dtx
index df02a5749a7..387214e947c 100644
--- a/Master/texmf-dist/source/latex-dev/base/ltfssbas.dtx
+++ b/Master/texmf-dist/source/latex-dev/base/ltfssbas.dtx
@@ -35,7 +35,7 @@
%
%
\ProvidesFile{ltfssbas.dtx}
- [2024/02/08 v3.2l LaTeX Kernel (NFSS Basic Macros)]
+ [2024/06/17 v3.2m LaTeX Kernel (NFSS Basic Macros)]
% \iffalse
\documentclass{ltxdoc}
\begin{document}
@@ -2111,6 +2111,8 @@
% {Suppress unnecessary error when used in preamble}
% \changes{v3.2a}{2017/01/10}
% {Add version of \cs{showhyphens} that works with Xe\TeX.}
+% \changes{v3.2m}{2024/06/17}
+% {set \cs{tracinglostchars} to 0 in \cs{showhyphens}}
% The |\showhyphens| command must be redefined since the version in
% \texttt{plain.tex} uses |\tenrm|. We have also made some further
% adjustments for its use in \LaTeX.
@@ -2142,10 +2144,10 @@
% horizontal list with explicit hyphens to generate the display. Note
% that the |lmr| OpenType font is forced, this works even if the
% characters are not in the font as hyphenation is attempted due to
-% the width of the space and hyphen character. It may generate
+% the width of the space and hyphen character. It would generate
% spurious Missing Character warnings in the log, these are however
-% suppressed from the terminal output by ensuring that
-% |\tracingonline| is locally zero.
+% suppressed from the terminal and log output by ensuring that
+% |\tracinglostchars| is locally zero.
% \begin{macrocode}
\DeclareRobustCommand\showhyphens[1]{%
\setbox0\vbox{%
@@ -2154,6 +2156,7 @@
\hbadness\@M
\hfuzz\maxdimen
\tracingonline\z@
+ \tracinglostchars\z@
\everypar={}%
\leftskip\z@skip
\rightskip\z@skip
diff --git a/Master/texmf-dist/source/latex-dev/base/lthooks.dtx b/Master/texmf-dist/source/latex-dev/base/lthooks.dtx
index d282ff841c7..aed23ab16d2 100644
--- a/Master/texmf-dist/source/latex-dev/base/lthooks.dtx
+++ b/Master/texmf-dist/source/latex-dev/base/lthooks.dtx
@@ -32,7 +32,7 @@
%<*driver>
% \fi
\ProvidesFile{lthooks.dtx}
- [2024/04/22 v1.1h LaTeX Kernel (hooks)]
+ [2024/07/08 v1.1h LaTeX Kernel (hooks)]
% \iffalse
%
\documentclass{l3doc}
@@ -130,6 +130,9 @@
%
% The \meta{hook} can be specified using the dot-syntax to denote
% the current package name. See section~\ref{sec:default-label}.
+% The string \texttt{??} can't be used as a hook name because it
+% has a special significance as a placeholder in hook rules.
+%
% \end{function}
%
% \begin{function}{\NewReversedHook}
@@ -751,8 +754,6 @@
% given \meta{hook}. If \meta{hook} is \texttt{??} this defines a default
% relation for all hooks that use the two labels, i.e., that have
% chunks of code labeled with \meta{label1} and \meta{label2}.
-% Rules specific to a given hook take precedence over default
-% rules that use \texttt{??} as the \meta{hook}.
%
% Currently, the supported relations are the following:
% \begin{itemize}
@@ -793,9 +794,17 @@
%
% \end{itemize}
% There can only be a single relation between two labels for a
-% given hook,
-% i.e., a later \cs{DeclareHookRule} overwrites any previous
-% declaration.
+% given hook, i.e., a later \cs{DeclareHookRule} overwrites any
+% previous declaration. In all cases rules specific to a given
+% hook take precedence over default rules that use \texttt{??} as
+% the \meta{hook}.
+%
+% If a default rule is applied, it is done before reversing the
+% label order in a reversed hook, e.g., \texttt{before} in a
+% default rule effectively becomes \texttt{after} in such a hook.
+% In contrast, a rule for a specific hook is always applied to the
+% state after any reversal (i.e., the state you see when using
+% \cs{ShowHook} on that hook).
%
% The \meta{hook} and \meta{label} can be specified using the
% dot-syntax to denote the current package name.
@@ -826,6 +835,16 @@
% (Technically it is just a shorthand for using \cs{DeclareHookRule}
% with \texttt{??} as the hook name.)
%
+% If such a rule is applied to a reversed
+% hook it behaves as if the rule is reversed (e.g.,
+% \texttt{after} becomes \texttt{before})
+% because those rules are applied first and then the order is reversed.
+% The rationale is that in hook pairs (in which the ordering in one
+% is reversed) default rules have to be reversed too in nearly all
+% scenarios. If this is not the case, a default rule can't be used
+% or has to be overwritten with an explicit \cs{DeclareHookRule}
+% for that specific hook.
+%
% Declaring default rules is only supported in the document
% preamble.\footnotemark{}
%
@@ -1411,7 +1430,7 @@
% This is helpful if you have a pair of hooks where you expect to see
% code added that involves grouping, e.g., starting an environment
% in the first and closing that environment in the second hook.
-% To give a somewhat contrived example\footnote{there are simpler
+% To give a somewhat contrived example\footnote{There are simpler
% ways to achieve the same effect.}, suppose there is a package
% adding the following:
%\begin{verbatim}
@@ -1457,9 +1476,14 @@
% > package-too, package-1.
%\end{verbatim}
%
-% The reversal of the execution order happens before applying any
-% rules, so if you alter the order you will probably have to alter
-% it in both hooks, not just in one, but that depends on the use case.
+% If there is a matching default rule (done with
+% \cs{DeclareDefaultHookRule} or with \texttt{??} for the hook
+% name) then this default rule is applied before the reversal so that the order
+% in the reversed hook mirrors the one in the normal hook. However,
+% all rules specific to a hook happen always after the reversal of the
+% execution order, so if you alter the order you will probably have
+% to alter it in both hooks, not just in one, but that depends on
+% the use case.
%
%
%
@@ -1910,6 +1934,14 @@
% right sequence.
%
% \end{description}
+%
+% Given that these generic hook names involve \texttt{/} as part of
+% their name they would not work if one tries to define an
+% environment using a name that involves a
+% \texttt{/}.\footnote{Officially, \LaTeX{} names for environments
+% should only consist of a sequence of letters, numbers, and the
+% character \texttt{*}, i.e., this is not a new restriction.}
+%
% Generic environment hooks are never one-time hooks even with
% environments that are supposed to appear only once in a
% document.\footnote{Thus if one adds code to such hooks after the
@@ -7601,6 +7633,7 @@
% \begin{macrocode}
\NewDocumentCommand \SetDefaultHookLabel { m }
{ \@@_set_default_hook_label:n {#1} }
+% \end{macrocode}
%
% The label is only automatically updated with \cs{@onefilewithoptions}
% (\cs{usepackage} and \cs{documentclass}), but some packages, like
diff --git a/Master/texmf-dist/source/latex-dev/base/ltkeys.dtx b/Master/texmf-dist/source/latex-dev/base/ltkeys.dtx
index 34a0ab4b477..a9e430206b6 100644
--- a/Master/texmf-dist/source/latex-dev/base/ltkeys.dtx
+++ b/Master/texmf-dist/source/latex-dev/base/ltkeys.dtx
@@ -33,7 +33,7 @@
%<*driver>
% \fi
\ProvidesFile{ltkeys.dtx}
- [2024/01/13 v1.0m LaTeX Kernel (Keyval options)]
+ [2024/06/20 v1.0o LaTeX Kernel (Keyval options)]
% \iffalse
\documentclass{l3doc}
\GetFileInfo{ltkeys.dtx}
@@ -73,6 +73,9 @@
% \item \texttt{.code} --- execute arbitrary code
% \item \texttt{.if} --- sets a \TeX{} \cs{if...} switch
% \item \texttt{.ifnot} --- sets an inverted \TeX{} \cs{if...} switch
+% \item \texttt{.pass-to-packages} --- for class options, this specifies
+% whether the option should be treated \enquote{global} (read by packages
+% from the global list); for package options this property has no effect
% \item \texttt{.store} --- stores a value in a macro
% \item \texttt{.usage} -- defines whether the option can be given only
% when loading (\texttt{load}), in the preamble (\texttt{preamble}) or
@@ -182,12 +185,74 @@
% \end{macrocode}
% \end{macro}
%
+% \begin{macro}{.pass-to-packages}
+% \changes{v1.0n}{2024/06/19}{New key property}
+% \begin{macro}{\@@_scope:n}
+% \changes{v1.0n}{2024/06/19}{New function}
+% \begin{macro}{\@@_scope:N}
+% \changes{v1.0n}{2024/06/19}{New function}
+% \changes{v1.0o}{2024/06/20}{Ensure only key name is stored}
+% Used to force options to be global: as this property (uniquely) has
+% an \emph{optional} value, there is a bit of work to do.
+% \begin{macrocode}
+\cs_new_protected:cpn { \c_@@_props_root_str .pass-to-packages }
+ {
+ \bool_if:NTF \l_@@_no_value_bool
+ { \@@_scope:n { true } }
+ { \@@_scope:n }
+ }
+\cs_new_protected:Npn \@@_scope:n #1
+ {
+ \str_case:nnF {#1}
+ {
+ { true }
+ { \@@_scope:N \clist_put_right:NV }
+ { false }
+ { \@@_scope:N \clist_remove_all:NV }
+ }
+ {
+ \msg_error:nnnn { keys }
+ { choice-unknown }
+ { .pass-to-packages }
+ {#1}
+ }
+ }
+\cs_new_protected:Npn \@@_scope:N #1
+ {
+ \exp_after:wN \@@_find_key_module:wNN
+ \l_keys_path_str \s_@@_stop
+ \l_keys_key_tl \l_keys_key_str
+ #1 \l_@@_forced_global_clist \l_keys_key_str
+ }
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
% \subsection{Main mechanism}
%
% \begin{macrocode}
+\cs_generate_variant:Nn \clist_if_in:NnT { Ne }
+\cs_generate_variant:Nn \clist_if_in:NnTF { Ne }
\cs_generate_variant:Nn \clist_put_right:Nn { Nv }
% \end{macrocode}
%
+% \begin{macro}{\l_@@_class_only_clist}
+% \changes{v1.0n}{2024/06/19}{New variable}
+% Used to track class-only options.
+% \begin{macrocode}
+\clist_new:N \l_@@_class_only_clist
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\l_@@_forced_global_clist}
+% \changes{v1.0n}{2024/06/19}{New variable}
+% Used to force options to be global.
+% \begin{macrocode}
+\clist_new:N \l_@@_forced_global_clist
+% \end{macrocode}
+% \end{macro}
+%
% \begin{macro}{\l_@@_options_clist}
% A single list is used for all options, into which they are collected
% before processing.
@@ -295,33 +360,34 @@
% \changes{v1.0h}{2022/06/19}{Further work on handling of option removal}
% \changes{v1.0h}{2022/06/20}{Use raw options data}
% \changes{v1.0m}{2024/01/13}{Trim spaces off key names}
+% \changes{v1.0n}{2024/06/19}{Refactor function}
% \begin{macro}{\@@_options_class:nnn}
% \changes{v1.0h}{2022/06/20}{New function}
% \changes{v1.0i}{2022/07/05}{Correct naming of raw class options storage}
% \changes{v1.0l}{2022/10/22}{Correct handling of unused option list}
+% \changes{v1.0n}{2024/06/19}{Refactor function}
+% \changes{v1.0n}{2024/06/19}{Track options used by classes}
+% \begin{macro}{\@@_options_class:nn}
+% \changes{v1.0n}{2024/06/19}{New function}
% For classes, each option (stripped of any content after |=|)
% is checked for existence as a key. If found, the option is added to
% the combined list for processing. On the other hand, unused options
-% are stored up in \cs{@unusedoptionlist}. Before any of that, though,
-% there is a simple check to see if there is an |unknown| key. If there
-% is, then \emph{everything} will match and the mapping can be skipped.
+% are stored up in \cs{@unusedoptionlist}. An earlier version of
+% this code checked for the \texttt{unknown} key just once and
+% if found short-cutted the loop: that though makes handling more
+% complex situations harder, so we take the performance hit instead.
+% Options used by classes are tracked but the catch-all \texttt{unknown}
+% is excluded (hence not using a lazy evaluation for the key testing).
% \begin{macrocode}
\cs_new_protected:Npn \@@_options_class:n #1
{
\cs_if_free:cF { @raw@opt@ \@currname . \@currext }
{
- \keys_if_exist:nnTF {#1} { unknown }
+ \clist_map_inline:cn { @raw@opt@ \@currname . \@currext }
{
- \clist_put_right:Nv \l_@@_options_clist
- { @raw@opt@ \@currname . \@currext }
- }
- {
- \clist_map_inline:cn { @raw@opt@ \@currname . \@currext }
- {
- \exp_args:Ne \@@_options_class:nnn
- { \tl_trim_spaces:e { \@@_remove_equals:n {##1} } }
- {##1} {#1}
- }
+ \exp_args:Ne \@@_options_class:nnn
+ { \tl_trim_spaces:e { \@@_remove_equals:n {##1} } }
+ {##1} {#1}
}
}
}
@@ -329,17 +395,27 @@
{
\keys_if_exist:nnTF {#3} {#1}
{
- \clist_put_right:Nn \l_@@_options_clist {#2}
- \clist_remove_all:Nn \@unusedoptionlist {#1}
+ \@@_options_class:nn {#1} {#2}
+ \clist_put_right:Ne \l_@@_class_only_clist { \tl_to_str:n {#1} }
}
{
- \clist_if_in:NnF \@unusedoptionlist {#1}
- { \clist_put_right:Nn \@unusedoptionlist {#1} }
+ \keys_if_exist:nnTF {#3} { unknown }
+ { \@@_options_class:nn {#1} {#2} }
+ {
+ \clist_if_in:NnF \@unusedoptionlist {#1}
+ { \clist_put_right:Nn \@unusedoptionlist {#1} }
+ }
}
}
+\cs_new_protected:Npn \@@_options_class:nn #1#2
+ {
+ \clist_remove_all:Nn \@unusedoptionlist {#1}
+ \clist_put_right:Nn \l_@@_options_clist {#2}
+ }
% \end{macrocode}
% \end{macro}
% \end{macro}
+% \end{macro}
%
% \begin{macro}{\@@_options_package:n}
% \changes{v1.0g}{2022/06/16}{Better handling of option removal}
@@ -348,6 +424,9 @@
% \changes{v1.0m}{2024/01/13}{Trim spaces off key names}
% \begin{macro}{\@@_options_package:nnn}
% \changes{v1.0h}{2022/06/19}{New function}
+% \changes{v1.0n}{2024/06/19}{Skip options given to packages}
+% \begin{macro}{\@@_options_package:nn}
+% \changes{v1.0n}{2024/06/19}{New functions}
% For global options when processing a package, the tasks are slightly
% different from those for a class. The check is the same, but here
% there is nothing to do if the option is not applicable. Each valid
@@ -362,17 +441,31 @@
{##1} {#1}
}
}
+% \end{macrocode}
+% The forced-global test here needs to use \cs{tl_to_str:n} as the data come
+% from a key name, which is always a string.
+% \begin{macrocode}
\cs_new_protected:Npn \@@_options_package:nnn #1#2#3
{
\keys_if_exist:nnT {#3} {#1}
{
- \clist_put_right:Nn \l_@@_options_clist {#2}
- \clist_remove_all:Nn \@unusedoptionlist {#1}
+ \clist_if_in:NeTF \l_@@_class_only_clist { \tl_to_str:n {#1} }
+ {
+ \clist_if_in:NeT \l_@@_forced_global_clist { \tl_to_str:n {#1} }
+ { \@@_options_package:nn {#1} {#2} }
+ }
+ { \@@_options_package:nn {#1} {#2} }
}
}
+\cs_new_protected:Npn \@@_options_package:nn #1#2
+ {
+ \clist_put_right:Nn \l_@@_options_clist {#2}
+ \clist_remove_all:Nn \@unusedoptionlist {#1}
+ }
% \end{macrocode}
% \end{macro}
% \end{macro}
+% \end{macro}
%
% \begin{macro}{\@@_options_local:}
% \changes{v1.0h}{2022/06/20}{Use raw options data}
diff --git a/Master/texmf-dist/source/latex-dev/base/ltlists.dtx b/Master/texmf-dist/source/latex-dev/base/ltlists.dtx
index fce6be77544..5858cbddfb8 100644
--- a/Master/texmf-dist/source/latex-dev/base/ltlists.dtx
+++ b/Master/texmf-dist/source/latex-dev/base/ltlists.dtx
@@ -31,7 +31,7 @@
%<*driver>
% \fi
\ProvidesFile{ltlists.dtx}
- [2024/06/11 v1.0t LaTeX Kernel (List Environments)]
+ [2024/06/23 v1.0u LaTeX Kernel (List Environments)]
% \iffalse
\documentclass{ltxdoc}
\GetFileInfo{ltlists.dtx}
@@ -716,6 +716,66 @@
%
% This allows paragraph-making environments to work right when called
% by other environments. (Changed 27 Oct 86)
+%
+% In 2024 this logic was partially replaced with a new algorithm:
+% \begin{itemize}
+% \item
+% \cs{if@endpe} is now set globally to \texttt{true} or \texttt{false}.
+% \item
+% In addition \cs{@endpetrue} initiates an \cs{aftergroup} call
+% to \cs{propagate@doendpe} if it is used inside a group.
+% \item
+% \cs{propagate@doendpe} in turn checks the status of \cs{if@endpe}
+% and if that is \texttt{true} it calls \cs{@doendpe} otherwise it
+% does nothing.
+% \item
+% \cs{@doendpe} in turn calls \cs{@endpetrue} and also makes the
+% necessary changes to
+% \cs{par} and \cs{everypar} so that they handle as before any
+% empty line that follows the environment.
+% \item
+% Because of the \cs{@endpetrue} we get another \cs{aftergroup}, so the
+% mechanisnm slowly migrates out of several groups if those follow
+% immediately after the end of the environment. If, however, there is a new
+% paragraph started or an explicit \cs{par} before the next group ends then this will
+% result in a call to \cs{@endpefalse} and the migration stops
+% (note that \cs{propagate@doendpe} is still called once after the group but does nothing).
+% \item
+% Using this approach something like
+%\begin{verbatim}
+% {% some customization here
+% \begin{equation}
+% x=y
+% \end{equation}}
+% some text
+%\end{verbatim}
+% is still correctly identified as a paragraph continuation so that
+% there is no indentation before \texttt{some text}.
+% \item
+% We can get away with using global settings of \cs{if@endpe} even
+% in nested situations (without keeping track of the status in a
+% stack), because the switch change is made only at
+% the very end of such environments, basically directly before the
+% \cs{endgroup} in \cs{end}, and it is later set back to \texttt{false} by
+% the next \cs{everypar} or the next \cs{par}. Even if the
+% environment is called without using \cs{begin} \cs{end}, the
+% situation doesn't change (or rather cause a problem).
+% \item
+% However, there is one scenario where the new approach would
+% change the behavior. If a box is being built, e.g., with
+% \cs{setbox}, we have now the case that a \cs{@endpetrue}
+% inside would migrate out into a context in which it should not be
+% true (because the box might get used elsewhere, e.g., a float).
+% In the past, due to local switch changes, that didn't happen, i.e.,
+% \cs{if@endpe} would revert to \texttt{false} at the end of the box
+% definition.
+% \item
+% Thus, to avoid that one has to explicitly set it back to false at
+% the end of such constructions, just as we also need to prevent
+% colors from
+% migrating out. Thus the correct place to do this is
+% in \cs{color@endgroup} because that is always called at that point.
+% \end{itemize}
% \begin{macrocode}
\def\@endparenv{%
\addpenalty\@endparpenalty\addvspace\@topsepadd\@endpetrue}
@@ -733,9 +793,12 @@
% |\clubpenalty| back to its default.
% \changes{v1.0t}{2015/05/10}{Explicitly reset \cs{clubpenalty} before
% clearing \cs{everypar}; see also pr/0462 and pr/4065}
+% \changes{v1.0u}{2024/06/23}{Set \cs{if@endpe} to \texttt{false}
+% before calling \cs{par} (needed for tagging)}
% \begin{macrocode}
\clubpenalty\@clubpenalty
- \everypar{}\par\@endpefalse}\everypar
+ \@endpefalse
+ \everypar{}\par}%
% \end{macrocode}
%
% Use |\setbox0=\lastbox| instead of |\hskip -\parindent|
@@ -744,8 +807,9 @@
% \changes{v1.0k}{1995/11/07}{Enclosed \cs{setbox0} assignment by a
% group so that it leaves the contents of box $0$ intact.}
% \begin{macrocode}
- {{\setbox\z@\lastbox}%
- \everypar{}\@endpefalse}}
+ \everypar
+ {{\setbox\z@\lastbox}%
+ \everypar{}\@endpefalse}}
%<latexrelease>\EndIncludeInRelease
% \end{macrocode}
%
@@ -762,12 +826,60 @@
%
% \begin{macro}{\if@endpe}
% \begin{macro}{\@endpefalse}
-% \begin{macro}{\@endpeltrue}
+% \begin{macro}{\@endpetrue}
+% \begin{macro}{\propagate@doendpe}
+% As outlined above these are no longer simple switches, but we
+% keep the name because it is used all over the place.
% \begin{macrocode}
\newif\if@endpe
-\@endpefalse
% \end{macrocode}
-% \end{macro}\end{macro}\end{macro}
+%
+% \changes{v1.0u}{2024/06/23}{Set \cs{if@endpe} globally and also set
+% up migration to the outside}
+% \begin{macrocode}
+%</2ekernel>
+%<*2ekernel|latexrelease>
+%<latexrelease>\IncludeInRelease{2024/11/01}%
+%<latexrelease> {\@endpetrue}{New @endpe handling}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+\def\@endpefalse{\global\let\if@endpe\iffalse}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\def\@endpetrue {%
+ \global\let\if@endpe\iftrue
+% \end{macrocode}
+% If we are inside a group then propagate to the outside:
+% \begin{macrocode}
+ \ifnum\currentgrouplevel>\z@
+ \aftergroup\propagate@doendpe
+ \fi
+}
+% \end{macrocode}
+% If \cs{if@endpe} is still true after the group ends, we run \cs{@doendpe}
+% that in turn runs another \cs{@endpetrue} (besides other things),
+% thus propagating further if necessary.
+% However, if the endpe situation got resolved and \cs{if@endpe} is \texttt{false}
+% then nothing further happens.
+% \begin{macrocode}
+\def\propagate@doendpe{\if@endpe \@doendpe \fi}
+% \end{macrocode}
+% \begin{macrocode}
+%</2ekernel|latexrelease>
+%<latexrelease>\EndIncludeInRelease
+%<latexrelease>\IncludeInRelease{0000/00/00}%
+%<latexrelease> {\@endpetrue}{New @endpe handling}%
+%<latexrelease>
+%<latexrelease>
+%<latexrelease>\def\@endpefalse{\let\if@endpe\iffalse}
+%<latexrelease>\def\@endpetrue{\let\if@endpe\iftrue}
+%<latexrelease>
+%<latexrelease>\EndIncludeInRelease
+%<*2ekernel>
+% \end{macrocode}
+% \end{macro}\end{macro}\end{macro}\end{macro}
%
%
% \begin{macro}{\@mklab}
diff --git a/Master/texmf-dist/source/latex-dev/base/ltluatex.dtx b/Master/texmf-dist/source/latex-dev/base/ltluatex.dtx
index a15019dcd55..315b62cc9e2 100644
--- a/Master/texmf-dist/source/latex-dev/base/ltluatex.dtx
+++ b/Master/texmf-dist/source/latex-dev/base/ltluatex.dtx
@@ -30,7 +30,7 @@
%<*plain>
% \fi
% \ProvidesFile{ltluatex.dtx}
-[2024/02/11 v1.2c
+[2024/08/16 v1.2e
% LaTeX Kernel (LuaTeX support)^^A
%\iffalse
%<plain> LuaTeX support for plain TeX (core)%
@@ -330,6 +330,8 @@
% field |date| in the usual \LaTeX{} format |yyyy/mm/dd|. Optional fields
% |version| (a string) and |description| may be used if present. This
% information will be recorded in the log. Other fields are ignored.
+% If the |version| begins with a digit, a \texttt{v} will be added at the
+% start in the log.
%
% \noindent
% \DescribeMacro{module_info}
@@ -420,7 +422,7 @@
% same callback and descriptions.
%
% The callback functions do not have to be registered yet when the functions is called.
-% Ony the constraints for which both callback descriptions refer to callbacks
+% Only the constraints for which both callback descriptions refer to callbacks
% registered at the time the callback is called will have an effect.
%
% \endgroup
@@ -1004,6 +1006,8 @@ local modules = modules or { }
% \begin{macro}{provides_module}
% \changes{v1.0a}{2015/09/24}{Function added}
% \changes{v1.0f}{2015/10/03}{use luatexbase\_log}
+% \changes{v1.2d}{2024/06/04}{Add \texttt{v} to version string if required (gh/1364)}
+% \changes{v1.2e}{2024/08/16}{Support missing version string (gh/1443)}
% Local function to write to the log.
% \begin{macrocode}
local function luatexbase_log(text)
@@ -1024,7 +1028,7 @@ local function provides_module(info)
luatexbase_log(
"Lua module: " .. info.name
.. spaced(info.date)
- .. spaced(info.version)
+ .. spaced(info.version and string_gsub(info.version or "","^(%d)","v%1"))
.. spaced(info.description)
)
modules[info.name] = info
@@ -1336,7 +1340,7 @@ luatexbase.new_luafunction = new_luafunction
% Additionally |callbackrules| describes the ordering constraints: It contains two
% element tables with the descriptions of the constrained callback implementations.
% It can additionally contain a |type| entry indicating the kind of rule. A missing
-% value indicates a normal ordering contraint.
+% value indicates a normal ordering constraint.
%
% \changes{v1.2a}{2022/10/03}{Add rules for callback ordering}
% \begin{macrocode}
@@ -1398,7 +1402,7 @@ local callbacklist = setmetatable({}, {
end
list[i] = current.value
else
- -- Cycle occured. TODO: Show cycle for debugging
+ -- Cycle occurred. TODO: Show cycle for debugging
-- list[i] = ...
local remaining = {}
for name, entry in next, meta do
@@ -1432,7 +1436,7 @@ local callbacklist = setmetatable({}, {
for i=2, length//2 do
cycle[i], cycle[length + 1 - i] = cycle[length + 1 - i], cycle[i]
end
- error('Cycle occured at ' .. table.concat(cycle, ' -> ', 1, length))
+ error('Cycle occurred at ' .. table.concat(cycle, ' -> ', 1, length))
end
end
end
diff --git a/Master/texmf-dist/source/latex-dev/base/ltmarks.dtx b/Master/texmf-dist/source/latex-dev/base/ltmarks.dtx
index a9f3bb0184f..f71bfab9b63 100644
--- a/Master/texmf-dist/source/latex-dev/base/ltmarks.dtx
+++ b/Master/texmf-dist/source/latex-dev/base/ltmarks.dtx
@@ -17,7 +17,7 @@
%<*driver>
% \fi
\ProvidesFile{ltmarks.dtx}
- [2024/05/31 v1.0g LaTeX Kernel (Marks)]
+ [2024/07/08 v1.0g LaTeX Kernel (Marks)]
% \iffalse
%
\documentclass{l3doc}
@@ -211,7 +211,7 @@
% The commands are only meaningful inside the output routine, in
% other places their result is (while not random) unpredictable due
% to the way \LaTeX{} cuts text material into pages.
-%% \end{function}
+% \end{function}
%
%
%
@@ -806,7 +806,7 @@
\tl_new:c { g_@@_last-column_first_ #1 _tl }
\tl_new:c { g_@@_last-column_last_ #1 _tl }
% \end{macrocode}
-% All marks will have an identication at the beginning of the form
+% All marks will have an identification at the beginning of the form
% \cs{@@_id:n}\texttt\{\meta{number}\texttt\} and therefore the
% initial empty values should have that too, so that data extraction
% is going to be uniform.
@@ -1027,7 +1027,7 @@
%
% We disguise \cs{c_max_dim} in an odd looking csname, which then
% shows up as part of the display of an error message if that error
-% happens. This csname forms part of the error diplay so what
+% happens. This csname forms part of the error display so what
% you get is something like
%\begin{verbatim}
% ! Infinite glue shrinkage found in box being split.
diff --git a/Master/texmf-dist/source/latex-dev/base/ltmiscen.dtx b/Master/texmf-dist/source/latex-dev/base/ltmiscen.dtx
index accdac24b2f..423f51624cc 100644
--- a/Master/texmf-dist/source/latex-dev/base/ltmiscen.dtx
+++ b/Master/texmf-dist/source/latex-dev/base/ltmiscen.dtx
@@ -32,7 +32,7 @@
%<*driver>
% \fi
\ProvidesFile{ltmiscen.dtx}
- [2024/02/08 v1.2c LaTeX Kernel (Misc. Environments)]
+ [2024/07/10 v1.2e LaTeX Kernel (Misc. Environments)]
% \iffalse
\documentclass{ltxdoc}
\GetFileInfo{ltmiscen.dtx}
@@ -276,6 +276,21 @@
% \changes{v1.0w}{1994/11/30}{(DPC) Use \cs{@dofilelist}}
% \changes{v1.2a}{2022/11/06}{Repeat release info at the end (gh/944)}
% \begin{macrocode}
+% \end{macrocode}
+% If we roll back we have to drop stuff before adding chunks,
+% otherwise the code will just be appended, and thus doubled.
+% This would result in a harmless warning during the format
+% generation, because in that case the code chunk label doesn't
+% exist, and therefore can't be dropped.
+% \changes{v1.2e}{2024/07/10}{Drop code chunks before adding them to
+% avoid duplication in rollback (gh/1407)}
+% \begin{macrocode}
+%<latexrelease>\RemoveFromHook{enddocument/info}[kernel/filelist]
+%<latexrelease>\RemoveFromHook{enddocument/info}[kernel/warnings]
+%<latexrelease>\RemoveFromHook{enddocument/info}[kernel/release]
+% \end{macrocode}
+%
+% \begin{macrocode}
\AddToHook{enddocument/info}[kernel/filelist]{\@dofilelist}
\AddToHook{enddocument/info}[kernel/warnings]{\@enddocument@kernel@warnings}
\AddToHook{enddocument/info}[kernel/release]{%
@@ -389,6 +404,18 @@
%<latexrelease>\NewHook{enddocument/afteraux}
%<latexrelease>\NewHook{enddocument/info}
%<latexrelease>\NewHook{enddocument/end}
+% \end{macrocode}
+% If we roll back we have to drop stuff before adding chunks,
+% otherwise the code will just be appended, and thus doubled.
+% \changes{v1.2e}{2024/07/10}{Drop code chunks before adding them to
+% avoid duplication in rollback (gh/1407)}
+% \begin{macrocode}
+%<latexrelease>\RemoveFromHook{enddocument/info}[kernel/filelist]
+%<latexrelease>\RemoveFromHook{enddocument/info}[kernel/warnings]
+%<latexrelease>\RemoveFromHook{enddocument/info}[kernel/release]
+% \end{macrocode}
+%
+% \begin{macrocode}
%<latexrelease>\AddToHook{enddocument/info}[kernel/filelist]{\@dofilelist}
%<latexrelease>\AddToHook{enddocument/info}[kernel/warnings]{\@enddocument@kernel@warnings}
%<latexrelease>\AddToHook{enddocument/info}[kernel/release]{%
@@ -719,6 +746,8 @@
% position of non-matching \cs{begin}.}
% \changes{v1.1e}{1996/07/26}{remove \cs{global} before \cs{@ignore...}}
% \changes{v1.1p}{2019/08/27}{Make command robust}
+% \changes{v1.2d}{2024/06/23}{Separate \cs{begin} and \cs{end} definitions
+% for individual rollback}
% \begin{macrocode}
%</2ekernel>
%<*2ekernel|latexrelease>
@@ -758,54 +787,6 @@
}
% \end{macrocode}
%
-% The top level definition for \cs{end}. for an explanation see
-% below (this is the same as the 2019 version where it was
-% introduced, but for rollback we have to repeat it).
-% \begin{macrocode}
-\edef\end
- {\unexpanded{%
- \romannumeral
- \ifx\protect\@typeset@protect
- \expandafter %1
- \expandafter %2
- \expandafter %1
- \expandafter %3 expands the \csname inside \end<space>
- \expandafter %1
- \expandafter %2 expands \end<space>
- \expandafter %1 expands the \else
- \z@
- \else
- \expandafter\z@\expandafter\protect
- \fi
- }%
- \expandafter\noexpand\csname end \endcsname
- }
-% \end{macrocode}
-% Version that adds hooks (so different from the 2019 version). It
-% fixes tlb3722 but the change should perhaps be made in
-% \texttt{tabularx} instead.
-% \begin{macrocode}
-\@namedef{end }#1{%
- \romannumeral
- \IfHookEmptyTF{env/#1/end}%
- {\expandafter\z@}%
- {\z@\UseHook{env/#1/end}}%
- \csname end#1\endcsname\@checkend{#1}%
- \expandafter\endgroup\if@endpe\@doendpe\fi
- \UseHook{env/#1/after}%
- \if@ignore\@ignorefalse\ignorespaces\fi
-}
-% \end{macrocode}
-% Version without the fix for tlb3722 for the record:
-% \begin{macrocode}
-%\@namedef{end }#1{%
-% \UseHook{env/#1/end}%
-% \csname end#1\endcsname\@checkend{#1}%
-% \expandafter\endgroup\if@endpe\@doendpe\fi
-% \UseHook{env/#1/after}%
-% \if@ignore\@ignorefalse\ignorespaces\fi}%
-% \end{macrocode}
-%
% \begin{macrocode}
%</2ekernel|latexrelease>
%<latexrelease>\EndIncludeInRelease
@@ -822,6 +803,7 @@
%<latexrelease> \csname #1\endcsname}}%
%<latexrelease> \@ignorefalse
%<latexrelease> \begingroup\@endpefalse\reserved@a}
+%<latexrelease>\EndIncludeInRelease
% \end{macrocode}
% A version that doesn't start out with \cs{relax} when in
% typesetting mode would be the following, but since \cs{begin}
@@ -847,7 +829,45 @@
% \begingroup\@endpefalse\reserved@a}
% \end{macrocode}
%
+% \begin{macrocode}
+%<latexrelease>\IncludeInRelease{0000/00/00}%
+%<latexrelease> {\begin}{Making \begin/\end robust}%
+%<latexrelease>\def\begin#1{%
+%<latexrelease> \@ifundefined{#1}%
+%<latexrelease> {\def\reserved@a{\@latex@error{Environment #1 undefined}\@eha}}%
+%<latexrelease> {\def\reserved@a{\def\@currenvir{#1}%
+%<latexrelease> \edef\@currenvline{\on@line}%
+%<latexrelease> \csname #1\endcsname}}%
+%<latexrelease> \@ignorefalse
+%<latexrelease> \begingroup\@endpefalse\reserved@a}
+%<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>
+%<latexrelease>\EndIncludeInRelease
+%<*2ekernel>
+% \end{macrocode}
+% \end{macro}
+%
+
+
+
+
% \begin{macro}{\end}
+% The top level definition for \cs{end}.
+% \changes{v1.2d}{2024/06/23}{Separate \cs{begin} and \cs{end} definitions
+% for individual rollback}
+% \begin{macrocode}
+%</2ekernel>
+%<*2ekernel|latexrelease>
+%<latexrelease>\IncludeInRelease{2019/10/01}%
+%<latexrelease> {\end}{Making \begin/\end robust}%
+% \end{macrocode}
% While \cs{begin} was made robust simply by using
% \cs{DeclareRobustCommand} we need to be a bit more subtle with
% \cs{end} as there are packages out there that try to look into
@@ -895,65 +915,129 @@
% \changes{v1.1p}{2019/08/27}{Make command robust}
%
% \begin{macrocode}
-%<latexrelease>\edef\end
-%<latexrelease> {\unexpanded{%
-%<latexrelease> \romannumeral
-%<latexrelease> \ifx\protect\@typeset@protect
-%<latexrelease> \expandafter %1
-%<latexrelease> \expandafter %2
-%<latexrelease> \expandafter %1
-%<latexrelease> \expandafter %3 expands the \csname inside \end<space>
-%<latexrelease> \expandafter %1
-%<latexrelease> \expandafter %2 expands \end<space>
-%<latexrelease> \expandafter %1 expands the \else
-%<latexrelease> \z@
-%<latexrelease> \else
-%<latexrelease> \expandafter\z@\expandafter\protect
-%<latexrelease> \fi
-%<latexrelease> }%
-%<latexrelease> \expandafter\noexpand\csname end \endcsname
-%<latexrelease> }
+\edef\end
+ {\unexpanded{%
+ \romannumeral
+ \ifx\protect\@typeset@protect
+ \expandafter %1
+ \expandafter %2
+ \expandafter %1
+ \expandafter %3 expands the \csname inside \end<space>
+ \expandafter %1
+ \expandafter %2 expands \end<space>
+ \expandafter %1 expands the \else
+ \z@
+ \else
+ \expandafter\z@\expandafter\protect
+ \fi
+ }%
+ \expandafter\noexpand\csname end \endcsname
+ }
+%</2ekernel|latexrelease>
+%<latexrelease>\EndIncludeInRelease
% \end{macrocode}
% And here is the original definition of \cs{end} the way it was in
% \LaTeX{} for several decades now hidden in \verb*=\end =.
% \begin{macrocode}
-%<latexrelease>\@namedef{end }#1{%
+%<latexrelease>\IncludeInRelease{0000/00/00}%
+%<latexrelease> {\end}{Making \begin/\end robust}%
+%<latexrelease>\def\end#1{%
%<latexrelease> \csname end#1\endcsname\@checkend{#1}%
%<latexrelease> \expandafter\endgroup\if@endpe\@doendpe\fi
%<latexrelease> \if@ignore\@ignorefalse\ignorespaces\fi}
+%<latexrelease>
%<latexrelease>\EndIncludeInRelease
+%<*2ekernel>
% \end{macrocode}
-% An here the rollback in case that is ever needed.
+% \end{macro}
+
+
+
+% \begin{macro}{\end\verbvisiblespace}
+% The internal version with a space at the end.
% \begin{macrocode}
-%<latexrelease>\IncludeInRelease{0000/00/00}%
-%<latexrelease> {\begin}{Making \begin/\end robust}%
-%<latexrelease>\def\begin#1{%
-%<latexrelease> \@ifundefined{#1}%
-%<latexrelease> {\def\reserved@a{\@latex@error{Environment #1 undefined}\@eha}}%
-%<latexrelease> {\def\reserved@a{\def\@currenvir{#1}%
-%<latexrelease> \edef\@currenvline{\on@line}%
-%<latexrelease> \csname #1\endcsname}}%
-%<latexrelease> \@ignorefalse
-%<latexrelease> \begingroup\@endpefalse\reserved@a}
-%<latexrelease>\def\end#1{%
+%</2ekernel>
+%<*2ekernel|latexrelease>
+%<latexrelease>\IncludeInRelease{2024/11/01}%
+%<latexrelease> {\end!space}{New @endpe handling}%
+\@namedef{end }#1{%
+ \romannumeral
+ \IfHookEmptyTF{env/#1/end}%
+ {\expandafter\z@}%
+ {\z@\UseHook{env/#1/end}}%
+ \csname end#1\endcsname\@checkend{#1}%
+% \end{macrocode}
+% We can now close the environment group and due to the new
+% \cs{if@endpe} handling we no longer need to \cs{expandafter}
+% out of the group.
+% \changes{v1.2d}{2024/06/23}{Adjust for new \texttt{@endpe} handling}
+% \begin{macrocode}
+% \expandafter\endgroup\if@endpe\@doendpe\fi
+ \endgroup
+ \UseHook{env/#1/after}%
+ \if@ignore\@ignorefalse\ignorespaces\fi
+}
+%</2ekernel|latexrelease>
+%<latexrelease>\EndIncludeInRelease
+% \end{macrocode}
+%
+% Version that adds hooks (so different from the 2019 version). It
+% fixes tlb3722 but the change should perhaps be made in
+% \texttt{tabularx} instead.
+% \begin{macrocode}
+% \begin{macrocode}
+%<latexrelease>\IncludeInRelease{2020/10/01}%
+%<latexrelease> {\end!space}{Use hook system}%
+%<latexrelease>
+%<latexrelease>\@namedef{end }#1{%
+%<latexrelease> \romannumeral
+%<latexrelease> \IfHookEmptyTF{env/#1/end}%
+%<latexrelease> {\expandafter\z@}%
+%<latexrelease> {\z@\UseHook{env/#1/end}}%
+%<latexrelease> \csname end#1\endcsname\@checkend{#1}%
+%<latexrelease> \expandafter\endgroup\if@endpe\@doendpe\fi
+%<latexrelease> \UseHook{env/#1/after}%
+%<latexrelease> \if@ignore\@ignorefalse\ignorespaces\fi
+%<latexrelease>}
+%<latexrelease>\EndIncludeInRelease
+% \end{macrocode}
+%
+% Version without the fix for tlb3722 for the record:
+%\begin{verbatim}
+%\@namedef{end }#1{%
+% \UseHook{env/#1/end}%
+% \csname end#1\endcsname\@checkend{#1}%
+% \expandafter\endgroup\if@endpe\@doendpe\fi
+% \UseHook{env/#1/after}%
+% \if@ignore\@ignorefalse\ignorespaces\fi}%
+% \end{verbatim}
+%
+% \begin{macrocode}
+%<latexrelease>\IncludeInRelease{2019/10/01}%
+%<latexrelease> {\end!space}{Making \begin/\end robust}%
+%<latexrelease>
+%<latexrelease>\@namedef{end }#1{%
%<latexrelease> \csname end#1\endcsname\@checkend{#1}%
%<latexrelease> \expandafter\endgroup\if@endpe\@doendpe\fi
%<latexrelease> \if@ignore\@ignorefalse\ignorespaces\fi}
-%<latexrelease>
+%<latexrelease>\EndIncludeInRelease
% \end{macrocode}
-% Also undo the internal commands as some packages unfortunately test
+%
+% \begin{macrocode}
+%<latexrelease>\IncludeInRelease{0000/00/00}%
+%<latexrelease> {\end!space}{Making \begin/\end robust}%
+% \end{macrocode}
+% Undo the internal command 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}
% \end{macro}
-% \end{macro}
%
%
%
diff --git a/Master/texmf-dist/source/latex-dev/base/ltpara.dtx b/Master/texmf-dist/source/latex-dev/base/ltpara.dtx
index f102d68e0d6..b7b895350d2 100644
--- a/Master/texmf-dist/source/latex-dev/base/ltpara.dtx
+++ b/Master/texmf-dist/source/latex-dev/base/ltpara.dtx
@@ -17,7 +17,7 @@
%<*driver>
% \fi
\ProvidesFile{ltpara.dtx}
- [2024/05/16 v1.0m LaTeX Kernel (paragraph hooks)]
+ [2024/06/29 v1.0n LaTeX Kernel (paragraph hooks)]
% \iffalse
%
\documentclass{l3doc}
@@ -480,7 +480,7 @@
% ended by \cs{RawParEnd}\footnote{Technical note for those who
% know their \textit{\TeX book\/}: the \cs{RawParEnd} command
% invokes the original \TeX{} engine definition of \cs{par} that
-% (soley) triggers the paragraph builder in \TeX{} when found
+% (solely) triggers the paragraph builder in \TeX{} when found
% inside unrestricted horizontal mode and does nothing in other
% processing modes.}
% and not by \cs{par} (or a blank line), because the latter will execute
@@ -634,7 +634,7 @@
% \glue(\parskip) 0.0 plus 1.0
% \glue(\baselineskip) 5.16669
%\end{verbatim}
-% but now there is anothe \cs{parskip} glue (that is always 0pt):
+% but now there is another \cs{parskip} glue (that is always 0pt):
%\begin{verbatim}
% \glue(\parskip) 0.0 plus 1.0
% \glue(\parskip) 0.0
@@ -819,6 +819,18 @@
\@@_handle_indent:
% \the \everypar % <--- done differently below
}
+% \end{macrocode}
+% \changes{v1.0n}{2024/06/23}
+% {Append \cs{everypar} toks to \cs{g_@@_standard_everypar_tl},
+% rollback 2023/06/01 (gh/1386)}
+% \begin{macrocode}
+%<latexrelease>\cs_set:Npn \@@_tmp:w #1#2#3#4#5 { }
+%<latexrelease>\tl_gput_right:Nx \g_@@_standard_everypar_tl {
+%<latexrelease> \exp_not:N \the
+%<latexrelease> \exp_not:N \toks
+%<latexrelease> \exp_after:wN \@@_tmp:w \token_to_meaning:N \everypar
+%<latexrelease> \c_space_tl
+%<latexrelease>}
%<latexrelease>\EndIncludeInRelease
%<latexrelease>\IncludeInRelease{2021/06/01}
%<latexrelease> {\g_@@_standard_everypar_tl}{minipage~ fix}
@@ -917,10 +929,10 @@
% 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
+ \exp_not:N \the
+ \exp_not:N \toks
+ \the \allocationnumber
+ \c_space_tl
}
% \end{macrocode}
% \end{macro}
@@ -1075,7 +1087,7 @@
% it should get removed before the hook code gets added so we have
% to arrange for this removal.
%
-% As in other simular cases, it maybe best to add here
+% As in other similar cases, it may be best to add here
% a \cs{nobreak} in case the hook itself adds glue and thus
% creates a non-explicit and unwanted potential breakpoont.
% On the other hand (as has been argued) the code in the hook
diff --git a/Master/texmf-dist/source/latex-dev/base/ltpictur.dtx b/Master/texmf-dist/source/latex-dev/base/ltpictur.dtx
index ea5ac4205b5..c6fc5236a5f 100644
--- a/Master/texmf-dist/source/latex-dev/base/ltpictur.dtx
+++ b/Master/texmf-dist/source/latex-dev/base/ltpictur.dtx
@@ -32,7 +32,7 @@
%<*driver>
% \fi
\ProvidesFile{ltpictur.dtx}
- [2021/04/20 v1.2b LaTeX Kernel (Picture Mode)]
+ [2024/07/08 v1.2b LaTeX Kernel (Picture Mode)]
% \iffalse
\documentclass{ltxdoc}
\GetFileInfo{ltpictur.dtx}
@@ -1413,7 +1413,6 @@
% \begin{macrocode}
\newif\if@ovvline \@ovvlinetrue
\newif\if@ovhline \@ovhlinetrue
-% \begin{macrocode}
%</2ekernel|latexrelease>
%<latexrelease>\EndIncludeInRelease
%<latexrelease>\IncludeInRelease{0000/00/00}%
diff --git a/Master/texmf-dist/source/latex-dev/base/ltproperties.dtx b/Master/texmf-dist/source/latex-dev/base/ltproperties.dtx
index 0fd8f22e0ef..5b869437baf 100644
--- a/Master/texmf-dist/source/latex-dev/base/ltproperties.dtx
+++ b/Master/texmf-dist/source/latex-dev/base/ltproperties.dtx
@@ -30,7 +30,7 @@
%<*driver>
% \fi
\ProvidesFile{ltproperties.dtx}
- [2024/04/17 v1.0e LaTeX Kernel (Properties)]
+ [2024/06/29 v1.0e LaTeX Kernel (Properties)]
% \iffalse
%
\documentclass[full]{l3doc}
@@ -94,7 +94,7 @@
% and labels which consist of lists of these properties. The reason for the
% split is that individual labels will want to record some but not all
% properties. For examples, a label concerned with position would track
-% the $x$ and $y$ co-ordinates of the current point, but not for example
+% the $x$ and $y$ coordinates of the current point, but not for example
% the page number.
%
% In the current implementation, properties share a single namespace. This
@@ -404,7 +404,7 @@
%
% \begin{variable}{pagenum}
% (shipout) The current page as arabic number. This is suitable for integer operations and
-% comparisions.
+% comparisons.
% \end{variable}
%
% \begin{variable}{label}
diff --git a/Master/texmf-dist/source/latex-dev/base/ltsockets.dtx b/Master/texmf-dist/source/latex-dev/base/ltsockets.dtx
index 243963f7bcc..c77c74b57f2 100644
--- a/Master/texmf-dist/source/latex-dev/base/ltsockets.dtx
+++ b/Master/texmf-dist/source/latex-dev/base/ltsockets.dtx
@@ -33,7 +33,7 @@
%<*driver>
% \fi
\ProvidesFile{ltsockets.dtx}
- [2024/02/11 v0.9a LaTeX Kernel (Sockets)]
+ [2024/06/29 v0.9a LaTeX Kernel (Sockets)]
% \iffalse
%
\documentclass{l3doc}
@@ -87,7 +87,7 @@
% executing code for each command or environment in the document
% source. Through various steps this code transforms the input and
% eventually generates typeset output appearing in a \enquote{galley}
-% from which individual pages are cut off in an asyncronous way. This
+% from which individual pages are cut off in an asynchronous way. This
% page generating process is normally not directly associated with
% commands in the input\footnote{Excepts for directives such as
% \cs{newpage}.} but is triggered whenever the galley has received
@@ -208,7 +208,7 @@
% simply calls some instance that implements the logic and that instance
% is altered by selecting a different templates and/or adjusting their
% parameters. However, in many cases customization through parameters is
-% overkill in such a case (or otherwise awkward, because paramerization
+% overkill in such a case (or otherwise awkward, because parameterization
% is better done on a higher level instead of individually for small
% blocks of code) and using the template mechanism just to replace one
% block of code with a different one results in a fairly high
@@ -400,7 +400,7 @@
%
% However, there is no requirement that sockets and
% hook names have to be different. In fact, if a certain action that
-% could overwise be specified as hook code has to be executed always
+% could otherwise be specified as hook code has to be executed always
% last (or first) one could ensure this by placing a socket (single
% action) after a hook (or vice versa) and using the same name to
% indicate the relationship, e.g.,
diff --git a/Master/texmf-dist/source/latex-dev/base/lttab.dtx b/Master/texmf-dist/source/latex-dev/base/lttab.dtx
index a85b4f8cf7a..f1147578219 100644
--- a/Master/texmf-dist/source/latex-dev/base/lttab.dtx
+++ b/Master/texmf-dist/source/latex-dev/base/lttab.dtx
@@ -31,7 +31,7 @@
%%% From File: lttab.dtx
%<*driver>
% \fi
-\ProvidesFile{lttab.dtx}[2021/04/20 v1.1s LaTeX Kernel (Columns)]
+\ProvidesFile{lttab.dtx}[2024/06/23 v1.1s LaTeX Kernel (Columns)]
% \iffalse
\documentclass{ltxdoc}
\GetFileInfo{lttab.dtx}
@@ -1499,7 +1499,7 @@
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\@testpatch}
+% \begin{macro}{\@testpach}
% \begin{macrocode}
\def\@testpach#1{\@chclass \ifnum \@lastchclass=\tw@ 4 \else
\ifnum \@lastchclass=3 5 \else
diff --git a/Master/texmf-dist/source/latex-dev/base/lttagging.dtx b/Master/texmf-dist/source/latex-dev/base/lttagging.dtx
index c70e24f5908..f4d2377837c 100644
--- a/Master/texmf-dist/source/latex-dev/base/lttagging.dtx
+++ b/Master/texmf-dist/source/latex-dev/base/lttagging.dtx
@@ -33,7 +33,7 @@
%<*driver>
% \fi
\ProvidesFile{lttagging.dtx}
- [2024/06/10 v1.0b LaTeX Kernel (tagging support)]
+ [2024/08/10 v1.0g LaTeX Kernel (tagging support)]
% \iffalse
\documentclass{l3doc}
\GetFileInfo{lttagging.dtx}
@@ -56,18 +56,11 @@
% \providecommand\socket[1]{\texttt{#1\DescribeSocket[noprint]{#1}}}
% \providecommand\plug[1]{\texttt{#1\DescribePlug[noprint]{#1}}}
%
-% \let\ProvideDocElement\NewDocElement
-%
% \ProvideDocElement[printtype=\textit{socket},idxtype=socket,idxgroup=Sockets]{Socket}{socketdecl}
% \ProvideDocElement[printtype=\textit{hook},idxtype=hook,idxgroup=Hooks]{Hook}{hookdecl}
% \ProvideDocElement[printtype=\textit{plug},idxtype=plug,idxgroup=Plugs]{Plug}{plugdecl}
%
%
-% \section{}
-%
-%
-%
-% \MaybeStop{}
%
% \begin{macrocode}
%<*2ekernel|latexrelease>
@@ -125,10 +118,16 @@
% suspended with \cs{SuspendTagging} instead of changing the plugs of
% the tagging support sockets back and forth.
%
+% This means that with \cs{SuspendTagging} in force all socket
+% arguments are ignored (including the case when there is a single
+% one), i.e., all sockets used with \cs{UseTaggingSocket} behave as
+% if the \text{noop} plug is assigned.
+%
% It is possible to use the tagging support sockets with
-% \cs{UseSocket} directly, but in this case the socket remains active
-% if \cs{SuspendTagging} is in force. There my be reasons for doing
-% that but in general we expect to always use \cs{UseTaggingSocket}.
+% \cs{UseSocket} instead of \cs{UseTaggingSocket}, but in this case
+% the socket remains active if \cs{SuspendTagging} is in force. There
+% may be reasons for doing that, but in general we expect to always
+% use \cs{UseTaggingSocket}.
%
% The L3 programming layer versions \cs{tag_socket_use:n} and
% \cs{tag_socket_use:nn} are slightly more efficient than
@@ -138,6 +137,12 @@
% of the CamelCase command.
%
%
+% \MaybeStop{}
+%
+%
+% \section{Implementation}
+%
+%
%
% \begin{macro}{\SuspendTagging,\ResumeTagging}
%
@@ -149,7 +154,7 @@
\cs_new_eq:NN \ResumeTagging \use_none:n
% \end{macrocode}
%
-% A simplified version of this defnition should move to
+% A simplified version of this definition should move to
% \pkg{tagpdf} and dropped here, eventually.
% \begin{macrocode}
\AddToHook{begindocument/before}{
@@ -209,16 +214,87 @@
}
\ERRORusetaggingsocket % that should get a proper error message
}
-\ExplSyntaxOff
% \end{macrocode}
%
% \end{macro}
%
+% \subsection{Tagging sockets}
+% This collects tagging sockets that should be generally available
+% so that they can also be used even if the tagging code is not loaded.
+%
+% \subsubsection{Tagging support for paragraph setup}
+%
+% Paragraphs are tagged through the code in the para/hooks. This code is sometimes
+% adjusted, e.g. to produce a \enquote{flattened} paragraph or to use a different tag.
+% Sockets related to such code parts are collected here.
+%
+% \begin{macro}{\l__tag_block_flattened_level_int}
+% The block code needs to know if they are nested blockenvs inside
+% a flattened environment. For this it uses a counter. Inside some contexts,
+% e.g. at the begin of a minipage or a footnote this counter must be reset.
+% We therefore define the counter here so that we can use it in the following
+% socket.
+% \begin{macrocode}
+\int_new:N \l__tag_block_flattened_level_int
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{socketdecl}{tagsupport/para/restore}
+% This socket restores the para related settings to their default. It
+% should be used in places where ``normal'' paragraph tagging must be ensured, for example
+% at the begin of a footnote.
+% \begin{macrocode}
+\NewSocket{tagsupport/para/restore}{0}
+% \end{macrocode}
+% \end{socketdecl}
+%
+% \begin{plugdecl}{default}
+% \begin{macrocode}
+\NewSocketPlug{tagsupport/para/restore}{default}
+ {
+ \tl_set:Nn \l__tag_para_main_tag_tl {text-unit}
+ \tl_set_eq:NN \l__tag_para_tag_tl\l__tag_para_tag_default_tl
+ \bool_set_false:N\l__tag_para_flattened_bool
+ \int_zero:N \l__tag_block_flattened_level_int
+ }
+\AssignSocketPlug{tagsupport/para/restore}{default}
+\ExplSyntaxOff
+% \end{macrocode}
+% \end{plugdecl}
+
+% \subsubsection{Tagging sockets for toc}
+
+% \begin{socketdecl}{tagsupport/toc/contentsline/before,
+% tagsupport/toc/contentsline/after}
+% Tagging sockets at the begin and end of contentsline.
+% They receive \emph{all} contentsline arguments as one argument
+% in four brace groups. The socket code should then use the parts it needs.
+% \begin{macrocode}
+\NewSocket{tagsupport/toc/contentsline/before}{1}
+\NewSocket{tagsupport/toc/contentsline/after}{1}
+% \end{macrocode}
+% \end{socketdecl}
%
-%
-%
-%
-%
+% \begin{socketdecl}{tagsupport/toc/starttoc/before,
+% tagsupport/toc/starttoc/after}
+% Tagging sockets for the begin and end of start of \cs{@starttoc}.
+% They take one argument, the extension.
+% \begin{macrocode}
+\NewSocket{tagsupport/toc/starttoc/before}{1}
+\NewSocket{tagsupport/toc/starttoc/after}{1}
+% \end{macrocode}
+% \end{socketdecl}
+%
+% \begin{socketdecl}{tagsupport/toc/leaders/before,
+% tagsupport/toc/leaders/after}
+% Tagging sockets to make the dot leaders an artifact.
+% They do not take an argument.
+% \begin{macrocode}
+\NewSocket{tagsupport/toc/leaders/before}{0}
+\NewSocket{tagsupport/toc/leaders/after}{0}
+% \end{macrocode}
+% \end{socketdecl}
+%
% \subsection{Tagging support for table/tabular packages}
%
% The code uses a number of sockets to inject the tagging
@@ -260,6 +336,14 @@
% \end{macrocode}
% \end{socketdecl}
%
+% \begin{socketdecl}{tagsupport/tbl/init/celldata}
+% This socket is used in \cs{tbl_init_cell_data_for_table}, the command
+% that stores and initialize cell data to handle nested tables.
+% It can be used to restore similar tagging related values
+% \begin{macrocode}
+\NewSocket{tagsupport/tbl/init/celldata}{0}
+% \end{macrocode}
+% \end{socketdecl}
%
% \begin{socketdecl}{tagsupport/tbl/finalize}
% To fine tune the structure (change cells to header cells, remove
@@ -273,7 +357,14 @@
% \end{macrocode}
% \end{socketdecl}
%
-
+% \begin{socketdecl}{tagsupport/tbl/restore/celldata}
+% This socket is used in \cs{tbl_restore_outer_cell_data:}, the command
+% that restores cell data when quitting a nested table. It can be used to restore
+% similar tagging related values
+% \begin{macrocode}
+\NewSocket{tagsupport/tbl/restore/celldata}{0}
+% \end{macrocode}
+% \end{socketdecl}
% \begin{socketdecl}{tagsupport/tbl/colspan}
% This socket is used to manage spanning cells, e.g., a
@@ -331,6 +422,18 @@
% \end{socketdecl}
%
%
+% \begin{socketdecl}{tagsupport/tbl/leaders/begin,
+% tagsupport/tbl/leaders/end}
+% Sockets around leaders such as rules or dotted lines, that should
+% be tagged as artifacts, used, for example, in \cs{cline}.
+% \changes{v1.0c}{2024/07/13}{Sockets for \cs{cline} leaders added (tagging/134)}
+% \begin{macrocode}
+\NewSocket{tagsupport/tbl/leaders/begin}{0}
+\NewSocket{tagsupport/tbl/leaders/end}{0}
+% \end{macrocode}
+% \end{socketdecl}
+%
+%
%
%
%
@@ -557,6 +660,10 @@
)
}
% \end{macrocode}
+% Tagging has to initialize cell data too.
+% \begin{macrocode}
+ \UseTaggingSocket{tbl/init/celldata}
+% \end{macrocode}
% These are the initial values when starting a table:
% \begin{macrocode}
\int_gzero:N \g_@@_row_int
@@ -656,6 +763,7 @@
\int_gset:Nn \g_@@_row_int { \l_@@_saved_row_tl }
\tl_gset_eq:NN \g_@@_span_tl \l_@@_saved_span_tl
\tl_gset_eq:NN \g_@@_table_cols_tl \l_@@_saved_table_cols_tl
+ \UseTaggingSocket{tbl/restore/celldata}
\@@_trace:n { ==>~ restored~cell~data:~
\int_use:N \g_@@_row_int,
\int_use:N \g_@@_col_int,
@@ -725,7 +833,7 @@
% \end{macrocode}
% Even if we are at the start of a row we my have to do a \cs{cr},
% so we do a \cs{crcr} always at the end.
-% \changes{v1.ob}{2024/06/10}
+% \changes{v1.0b}{2024/06/10}
% {Always issue a \cs{crcr} even if we are at the start of a
% row to avoid problems with tabulary and similar code}
% \begin{macrocode}
diff --git a/Master/texmf-dist/source/latex-dev/base/ltvers.dtx b/Master/texmf-dist/source/latex-dev/base/ltvers.dtx
index 9455c56beb0..0df433450c1 100644
--- a/Master/texmf-dist/source/latex-dev/base/ltvers.dtx
+++ b/Master/texmf-dist/source/latex-dev/base/ltvers.dtx
@@ -115,7 +115,7 @@
{2024-11-01}
%</2ekernel|latexrelease>
%<*2ekernel>
-\def\patch@level{1}
+\def\patch@level{-3}
% \end{macrocode}
%
% \begin{macro}{\development@branch@name}
diff --git a/Master/texmf-dist/source/latex-dev/graphics/color.dtx b/Master/texmf-dist/source/latex-dev/graphics/color.dtx
index 130a960d099..b14c148f2f9 100644
--- a/Master/texmf-dist/source/latex-dev/graphics/color.dtx
+++ b/Master/texmf-dist/source/latex-dev/graphics/color.dtx
@@ -21,7 +21,7 @@
%<driver> \ProvidesFile{color.drv}
% \fi
% \ProvidesFile{color.dtx}
- [2024/01/14 v1.3d Standard LaTeX Color (DPC)]
+ [2024/06/23 v1.3e Standard LaTeX Color (DPC)]
%
% \iffalse
%<*driver>
@@ -877,10 +877,15 @@
% commands. The |\endgraf| in its definition is required in the case
% of groups of text in vertical `par' mode, but doesn't do any harm in
% horizontal `LR' contexts.
+% The |\@endpefalse| is required for the newer \texttt{@endpe}
+% handling, again it is harmless if an older kernel is used
+% (because there it was a local assignment).
% \changes{v0.2d}{1994/05/13}
% {New definition, was previously just \cs{endgroup}}
+% \changes{v1.3e}{2024/06/23}
+% {Support new \texttt{@endpe} mechanism}
% \begin{macrocode}
-\def\color@endgroup{\endgraf\endgroup}
+\def\color@endgroup{\endgraf\@endpefalse\endgroup}
% \end{macrocode}
% \end{macro}
%
diff --git a/Master/texmf-dist/source/latex-dev/graphics/graphics.dtx b/Master/texmf-dist/source/latex-dev/graphics/graphics.dtx
index 2392ac09d10..86556ea40ac 100644
--- a/Master/texmf-dist/source/latex-dev/graphics/graphics.dtx
+++ b/Master/texmf-dist/source/latex-dev/graphics/graphics.dtx
@@ -27,7 +27,7 @@
%<driver> \ProvidesFile{graphics.drv}
% \fi
% \ProvidesFile{graphics.dtx}
- [2024/05/23 v1.4g Standard LaTeX Graphics (DPC,SPQR)]
+ [2024/08/06 v1.4g Standard LaTeX Graphics (DPC,SPQR)]
%
% \iffalse
%<*driver>
@@ -1050,7 +1050,8 @@
%
% \begin{macrocode}
\edef\Gin@gzext{\detokenize{gz}}
-% \edef{macrocode}
+% \end{macrocode}
+% \end{macro}
% \end{macro}
%
% \begin{macro}{\Gin@set@curr@file}
diff --git a/Master/texmf-dist/source/latex-dev/l3kernel/expl3.dtx b/Master/texmf-dist/source/latex-dev/l3kernel/expl3.dtx
index 8387c0c44e6..6e4e16de964 100644
--- a/Master/texmf-dist/source/latex-dev/l3kernel/expl3.dtx
+++ b/Master/texmf-dist/source/latex-dev/l3kernel/expl3.dtx
@@ -24,7 +24,7 @@
%
%<*driver|generic|package|2ekernel>
%</driver|generic|package|2ekernel>
-\def\ExplFileDate{2024-06-19}%
+\def\ExplFileDate{2024-08-30}%
%<*driver>
\documentclass[full]{l3doc}
\usepackage{graphicx}
@@ -51,7 +51,7 @@
% }^^A
% }
%
-% \date{Released 2024-06-19}
+% \date{Released 2024-08-30}
%
% \maketitle
%
@@ -454,6 +454,15 @@
% implementation in \LaTeX3 means that |toks| are not required, and that
% all operations for storing tokens can use the |tl| variable type.
%
+% There are two more special types of constants:
+% \begin{arg-description}
+% \item[q] constants of quark type;
+% \item[s] constants of scan mark type.
+% \end{arg-description}
+% The \meta{type} part of quark and scan mark constants is omitted, and
+% the \meta{module} part of general quarks and scan marks is often
+% omitted too.
+%
% Experienced \TeX{} programmers will notice that some of the variable
% types listed are native \TeX{} registers whilst others are not. In
% general, the underlying \TeX{} implementation for a data structure may
diff --git a/Master/texmf-dist/source/latex-dev/l3kernel/l3basics.dtx b/Master/texmf-dist/source/latex-dev/l3kernel/l3basics.dtx
index 26265f5625a..fed54fa0b4c 100644
--- a/Master/texmf-dist/source/latex-dev/l3kernel/l3basics.dtx
+++ b/Master/texmf-dist/source/latex-dev/l3kernel/l3basics.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2024-06-19}
+% \date{Released 2024-08-30}
%
% \maketitle
%
@@ -1151,10 +1151,9 @@
% argument (a single token denoted by |N|) is still free for definition.
% It would be used in constructions like
% \begin{quote}
-% |\bool_if:nTF {| \\
-% \verb" \cs_if_free_p:N \l_tmpz_tl || \cs_if_free_p:N \g_tmpz_tl " \\
-% |}|
-% \Arg{true code} \Arg{false code}
+% "\bool_if:nTF" \\
+% " { \cs_if_free_p:N \l_tmpz_tl || \cs_if_free_p:N \g_tmpz_tl }" \\
+% " "\Arg{true code} \Arg{false code}
% \end{quote}
%
% For each predicate defined, a \enquote{branching conditional}
diff --git a/Master/texmf-dist/source/latex-dev/l3kernel/l3bitset.dtx b/Master/texmf-dist/source/latex-dev/l3kernel/l3bitset.dtx
index 0cc8b996e2e..db42b85824a 100644
--- a/Master/texmf-dist/source/latex-dev/l3kernel/l3bitset.dtx
+++ b/Master/texmf-dist/source/latex-dev/l3kernel/l3bitset.dtx
@@ -42,7 +42,7 @@
% }^^A
% }
%
-% \date{Released 2024-06-19}
+% \date{Released 2024-08-30}
%
% \maketitle
%
diff --git a/Master/texmf-dist/source/latex-dev/l3kernel/l3bootstrap.dtx b/Master/texmf-dist/source/latex-dev/l3kernel/l3bootstrap.dtx
index 1eaab88c971..79feb5c4c7b 100644
--- a/Master/texmf-dist/source/latex-dev/l3kernel/l3bootstrap.dtx
+++ b/Master/texmf-dist/source/latex-dev/l3kernel/l3bootstrap.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2024-06-19}
+% \date{Released 2024-08-30}
%
% \maketitle
%
diff --git a/Master/texmf-dist/source/latex-dev/l3kernel/l3box.dtx b/Master/texmf-dist/source/latex-dev/l3kernel/l3box.dtx
index 871ed5f2ce2..2cd93c67f74 100644
--- a/Master/texmf-dist/source/latex-dev/l3kernel/l3box.dtx
+++ b/Master/texmf-dist/source/latex-dev/l3kernel/l3box.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2024-06-19}
+% \date{Released 2024-08-30}
%
% \maketitle
%
@@ -906,9 +906,9 @@
% \begin{syntax}
% \cs{box_set_trim:Nnnnn} \meta{box} \Arg{left} \Arg{bottom} \Arg{right} \Arg{top}
% \end{syntax}
-% Adjusts the bounding box of the \meta{box} \meta{left} is removed from
+% Adjusts the bounding box of the \meta{box}: \meta{left} is removed from
% the left-hand edge of the bounding box, \meta{right} from the right-hand
-% edge and so fourth. All adjustments are \meta{dim exprs}.
+% edge, and so forth. All adjustments are \meta{dim exprs}.
% Material outside of the bounding box is still displayed in the output
% unless \cs{box_set_clipped:N} is subsequently applied.
% The updated \meta{box} is an
diff --git a/Master/texmf-dist/source/latex-dev/l3kernel/l3cctab.dtx b/Master/texmf-dist/source/latex-dev/l3kernel/l3cctab.dtx
index 3b756ac739a..ec8433c99ed 100644
--- a/Master/texmf-dist/source/latex-dev/l3kernel/l3cctab.dtx
+++ b/Master/texmf-dist/source/latex-dev/l3kernel/l3cctab.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2024-06-19}
+% \date{Released 2024-08-30}
%
% \maketitle
%
diff --git a/Master/texmf-dist/source/latex-dev/l3kernel/l3clist.dtx b/Master/texmf-dist/source/latex-dev/l3kernel/l3clist.dtx
index 175dba141d0..7909f36be0c 100644
--- a/Master/texmf-dist/source/latex-dev/l3kernel/l3clist.dtx
+++ b/Master/texmf-dist/source/latex-dev/l3kernel/l3clist.dtx
@@ -44,7 +44,7 @@
% }^^A
% }
%
-% \date{Released 2024-06-19}
+% \date{Released 2024-08-30}
%
% \maketitle
%
@@ -326,7 +326,7 @@
% \clist_remove_all:NV, \clist_remove_all:cV,
% \clist_remove_all:Ne, \clist_remove_all:ce,
% \clist_gremove_all:Nn, \clist_gremove_all:cn,
-% \clist_gremove_all:NV, \clist_gremove_all:cV
+% \clist_gremove_all:NV, \clist_gremove_all:cV,
% \clist_gremove_all:Ne, \clist_gremove_all:ce
% }
% \begin{syntax}
@@ -352,7 +352,7 @@
% Reverses the order of items stored in the \meta{clist~var}.
% \end{function}
%
-% \begin{function}[added = 2014-07-18]{\clist_reverse:n}
+% \begin{function}[added = 2014-07-18, EXP]{\clist_reverse:n}
% \begin{syntax}
% \cs{clist_reverse:n} \Arg{comma list}
% \end{syntax}
diff --git a/Master/texmf-dist/source/latex-dev/l3kernel/l3coffins.dtx b/Master/texmf-dist/source/latex-dev/l3kernel/l3coffins.dtx
index 76ef5c69067..1b431b97ebb 100644
--- a/Master/texmf-dist/source/latex-dev/l3kernel/l3coffins.dtx
+++ b/Master/texmf-dist/source/latex-dev/l3kernel/l3coffins.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2024-06-19}
+% \date{Released 2024-08-30}
%
% \maketitle
%
diff --git a/Master/texmf-dist/source/latex-dev/l3kernel/l3color.dtx b/Master/texmf-dist/source/latex-dev/l3kernel/l3color.dtx
index ca29c87bae2..1238f363fd2 100644
--- a/Master/texmf-dist/source/latex-dev/l3kernel/l3color.dtx
+++ b/Master/texmf-dist/source/latex-dev/l3kernel/l3color.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2024-06-19}
+% \date{Released 2024-08-30}
%
% \maketitle
%
@@ -103,7 +103,7 @@
% \begin{itemize}
% \item \texttt{Gray} Grayscale color, with a single axis running from
% $0$ (fully black) to $15$ (fully white)
-% \item \texttt{hsb} Hue-saturation-brightness color, with three axes,all
+% \item \texttt{hsb} Hue-saturation-brightness color, with three axes, all
% real values in the range $[0,1]$ for hue saturation and brightness
% \item \texttt{Hsb} Hue-saturation-brightness color, with three axes, integer
% in the range $[0,360]$ for hue, real values in the range $[0,1]$ for
@@ -325,7 +325,7 @@
% \end{function}
%
% \begin{variable}[module = color]{color.sc}
-% When using \texttt{dvips}, this PostScript variables hold the stroke color.
+% When using \texttt{dvips}, this PostScript variable holds the stroke color.
% \end{variable}
%
% \subsection{Coloring math mode material}
@@ -406,20 +406,20 @@
%
% \begin{function}{\color_export:nnN}
% \begin{syntax}
-% \cs{color_export:nnN} \Arg{color expression} \Arg{format} \Arg{tl}
+% \cs{color_export:nnN} \Arg{color expression} \Arg{format} \meta{tl var}
% \end{syntax}
% Parses the \meta{color expression} as described earlier,
% then converts to the \meta{format} specified and assigns the data to the
-% \meta{tl}.
+% \meta{tl var}.
% \end{function}
%
% \begin{function}{\color_export:nnnN}
% \begin{syntax}
-% \cs{color_export:nnnN} \Arg{model} \Arg{value(s)} \Arg{format} \Arg{tl}
+% \cs{color_export:nnnN} \Arg{model} \Arg{value(s)} \Arg{format} \meta{tl var}
% \end{syntax}
% Expresses the combination of \meta{model} and \meta{value(s)} in an
% internal representation, then converts to the \meta{format} specified and
-% assigns the data to the \meta{tl}.
+% assigns the data to the \meta{tl var}.
% \end{function}
%
% \section{Creating new color models}
@@ -495,7 +495,7 @@
%
% Color profiles are used to ensure color accuracy by linking to collaboration.
% Applying a profile can be used to standardise color which is otherwise
-% device-dependence.
+% device-dependent.
%
% \begin{function}[added = 2021-02-23]{\color_profile_apply:nn}
% \begin{syntax}
@@ -697,14 +697,14 @@
% \begin{macro}{\@@_convert:nnnN, \@@_convert:nVnN, \@@_convert:nnVN}
% \begin{macro}[EXP]
% {
-% \@@_convert_gray_gray:w
-% \@@_convert_gray_rgb:w
-% \@@_convert_gray_cmyk:w
-% \@@_convert_cmyk_gray:w
-% \@@_convert_cmyk_rgb:w
-% \@@_convert_cmyk_cmyk:w
-% \@@_convert_rgb_gray:w
-% \@@_convert_rgb_rgb:w
+% \@@_convert_gray_gray:w,
+% \@@_convert_gray_rgb:w,
+% \@@_convert_gray_cmyk:w,
+% \@@_convert_cmyk_gray:w,
+% \@@_convert_cmyk_rgb:w,
+% \@@_convert_cmyk_cmyk:w,
+% \@@_convert_rgb_gray:w,
+% \@@_convert_rgb_rgb:w,
% \@@_convert_rgb_cmyk:w
% }
% \begin{macro}[EXP]{\@@_convert_rgb_cmyk:nnn}
diff --git a/Master/texmf-dist/source/latex-dev/l3kernel/l3debug.dtx b/Master/texmf-dist/source/latex-dev/l3kernel/l3debug.dtx
index 777dce794df..600bdff79ea 100644
--- a/Master/texmf-dist/source/latex-dev/l3kernel/l3debug.dtx
+++ b/Master/texmf-dist/source/latex-dev/l3kernel/l3debug.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2024-06-19}
+% \date{Released 2024-08-30}
%
% \maketitle
%
@@ -69,7 +69,7 @@
%
% Standard file identification.
% \begin{macrocode}
-\ProvidesExplFile{l3debug.def}{2024-06-19}{}{L3 Debugging support}
+\ProvidesExplFile{l3debug.def}{2024-08-30}{}{L3 Debugging support}
% \end{macrocode}
%
% \begin{variable}{\s_@@_stop}
diff --git a/Master/texmf-dist/source/latex-dev/l3kernel/l3deprecation.dtx b/Master/texmf-dist/source/latex-dev/l3kernel/l3deprecation.dtx
index 3374bf451fd..a7dcefc362f 100644
--- a/Master/texmf-dist/source/latex-dev/l3kernel/l3deprecation.dtx
+++ b/Master/texmf-dist/source/latex-dev/l3kernel/l3deprecation.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2024-06-19}
+% \date{Released 2024-08-30}
%
% \maketitle
%
@@ -505,10 +505,10 @@
{ \text_uppercase:nn {#1} {#2} }
\__kernel_patch_deprecation:nnNNpn { 2020-01-03 } { \text_titlecase_first:n }
\cs_new:Npn \tl_mixed_case:n #1
- { \text_titlecase_first:n {#1} }
+ { \text_titlecase_first:n { \text_lowercase:n {#1} } }
\__kernel_patch_deprecation:nnNNpn { 2020-01-03 } { \text_titlecase_first:nn }
\cs_new:Npn \tl_mixed_case:nn #1#2
- { \text_titlecase_first:nn {#1} {#2} }
+ { \text_titlecase_first:nn {#1} { \text_lowercase:n {#2} } }
% \end{macrocode}
% \end{macro}
%
@@ -571,7 +571,7 @@
% \char_lower_case:N, \char_upper_case:N,
% \char_mixed_case:Nn, \char_fold_case:N,
% \char_str_lower_case:N, \char_str_upper_case:N,
-% \char_str_mixed_case:Nn, \char_str_fold_case:N,
+% \char_str_mixed_case:N, \char_str_fold_case:N,
% }
% \begin{macrocode}
\__kernel_patch_deprecation:nnNNpn { 2020-01-03 } { \text_lowercase:n }
diff --git a/Master/texmf-dist/source/latex-dev/l3kernel/l3doc.dtx b/Master/texmf-dist/source/latex-dev/l3kernel/l3doc.dtx
index 65250e78a4b..fb1781e4ba6 100644
--- a/Master/texmf-dist/source/latex-dev/l3kernel/l3doc.dtx
+++ b/Master/texmf-dist/source/latex-dev/l3kernel/l3doc.dtx
@@ -71,7 +71,7 @@ and all files in that bundle must be distributed together.
% This isn't included in the typeset documentation because it's a bit
% ugly:
%<*class>
-\ProvidesExplClass{l3doc}{2024-06-19}{}
+\ProvidesExplClass{l3doc}{2024-08-30}{}
{L3 Experimental documentation class}
%</class>
% \fi
@@ -84,7 +84,7 @@ and all files in that bundle must be distributed together.
% require you to do updates, if the class changes.}}
%
% \author{\Team}
-% \date{Released 2024-06-19}
+% \date{Released 2024-08-30}
% \maketitle
% \tableofcontents
%
@@ -1618,7 +1618,7 @@ and all files in that bundle must be distributed together.
%
% \subsection{Design}
%
-% Increase the text width slightly so that width the standard fonts
+% Increase the text width slightly so that with the standard fonts
% 72~columns of code may appear in a \env{macrocode} environment.
% Increase the marginpar width slightly, for long command names. And
% increase the left margin by a similar amount.
@@ -2160,10 +2160,18 @@ and all files in that bundle must be distributed together.
%
% \begin{macro}{\@@_names_get_seq:nN}
% The argument~|#1| (argument of a |function| or |macro| environment)
-% has catcodes $10$ (space), $12$ (other) and $13$ (active). Sanitize
-% catcodes. If the |verb| option was used, output a one-item
-% sequence. Otherwise, remove any \enquote{\%} character at the
-% beginning of a line. Remove tabs and newlines. Finally, convert
+% has catcodes $10$ (space), $12$ (other) and $13$ (active), and
+% since \LaTeX{} 2024-06-01 also macro \cs{obeyedline} in replacement
+% of active |^^M| tokens (due to the revised behavior of |+v|
+% argument type in |ltcmd|).
+% If the |verb| option was used, sanitize catcodes and output
+% a one-item sequence.
+% Otherwise, remove any \enquote{\%} character at the beginning of
+% a line using new end-of-line marker \cs{obeyedline}. Remove any
+% remaining \cs{obeyedline}. Then sanitize catcodes so we keep those
+% verbatim \cs{obeyedline} typed in by user. Remove remaining
+% \enquote{\%} character at the beginning of a line using traditional
+% |^^M| marker. Remove tabs and newlines. Finally, convert
% |_@@| and |@@| to |__|\meta{module name} (if it is non-empty). At
% this point, \cs{l_@@_tmpa_tl} contains a comma-delimited list of
% names, where |@| and~|_| have category code letter. Turn it to a
@@ -2172,17 +2180,20 @@ and all files in that bundle must be distributed together.
% \begin{macrocode}
\cs_new_protected:Npn \@@_names_get_seq:nN #1#2
{
- \__kernel_tl_set:Nx \l_@@_tmpa_tl { \tl_to_str:n {#1} }
\bool_if:NTF \l_@@_names_verb_bool
{
\seq_clear:N #2
- \seq_put_right:NV #2 \l_@@_tmpa_tl
+ \seq_put_right:No #2 { \tl_to_str:n {#1} }
}
{
+ \tl_set:Nn \l_@@_tmpa_tl {#1}
\tl_remove_all:Ne \l_@@_tmpa_tl
- { \iow_char:N \^^M \c_percent_str }
+ { \exp_not:N \obeyedline \c_percent_str }
+ \tl_remove_all:Ne \l_@@_tmpa_tl
+ { \exp_not:N \obeyedline }
+ \__kernel_tl_set:Nx \l_@@_tmpa_tl { \tl_to_str:N \l_@@_tmpa_tl }
\tl_remove_all:Ne \l_@@_tmpa_tl
- { \token_to_str:N \obeyedline \c_space_tl \c_percent_str }
+ { \iow_char:N \^^M \c_percent_str }
\tl_remove_all:Ne \l_@@_tmpa_tl { \tl_to_str:n { ^ ^ A } }
\tl_remove_all:Ne \l_@@_tmpa_tl { \iow_char:N \^^I }
\tl_remove_all:Ne \l_@@_tmpa_tl { \iow_char:N \^^M }
@@ -2695,8 +2706,7 @@ and all files in that bundle must be distributed together.
% \end{macro}
%
% ^^A TODO: collect all index targets from a given function environment in a box and stick it at the top.
-% \begin{macro}
-% {\@@_typeset_function_block:nN, \@@_typeset_function_block:eN}
+% \begin{macro}{\@@_typeset_function_block:nN}
% \begin{macro}{\@@_function_index:n, \@@_function_index:e}
% |#1| is a csname, |#2| a boolean indicating whether to add |TF| or not.
% \begin{macrocode}
@@ -2712,7 +2722,6 @@ and all files in that bundle must be distributed together.
{ \@@_typeset_variant_list:nN {#1} #2 }
\\
}
-\cs_generate_variant:Nn \@@_typeset_function_block:nN { e }
\cs_new_protected:Npn \@@_function_index:n #1
{
\seq_gput_right:Nn \g_doc_functions_seq {#1}
@@ -3213,7 +3222,7 @@ and all files in that bundle must be distributed together.
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\@@_print_macroname_aux:nn}
+% \begin{macro}{\@@_print_macroname_aux:nn, \@@_print_macroname_aux:on}
% |#1| is prefix, |#2| is optional |TF| suffix.
% \begin{macrocode}
\cs_new_protected:Npn \@@_print_macroname_aux:nn #1#2
@@ -4254,7 +4263,6 @@ and all files in that bundle must be distributed together.
{#2}
\l_@@_index_internal_bool
}
-\cs_generate_variant:Nn \@@_special_index:nn { o }
% \end{macrocode}
% \end{macro}
%
diff --git a/Master/texmf-dist/source/latex-dev/l3kernel/l3docstrip.dtx b/Master/texmf-dist/source/latex-dev/l3kernel/l3docstrip.dtx
index af953848502..7d62454279d 100644
--- a/Master/texmf-dist/source/latex-dev/l3kernel/l3docstrip.dtx
+++ b/Master/texmf-dist/source/latex-dev/l3kernel/l3docstrip.dtx
@@ -63,7 +63,7 @@
% }^^A
% }
%
-% \date{Released 2024-06-19}
+% \date{Released 2024-08-30}
%
% \maketitle
%
diff --git a/Master/texmf-dist/source/latex-dev/l3kernel/l3expan.dtx b/Master/texmf-dist/source/latex-dev/l3kernel/l3expan.dtx
index 09ef3306ac8..d88267b8c9a 100644
--- a/Master/texmf-dist/source/latex-dev/l3kernel/l3expan.dtx
+++ b/Master/texmf-dist/source/latex-dev/l3kernel/l3expan.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2024-06-19}
+% \date{Released 2024-08-30}
%
% \maketitle
%
@@ -75,8 +75,8 @@
% If \cs{seq_gpush:No} was not defined it could be coded in the following way:
% \begin{verbatim}
% \exp_args:NNo \seq_gpush:Nn
-% \g_file_name_stack
-% { \l_tmpa_tl }
+% \g_file_name_stack
+% { \l_tmpa_tl }
% \end{verbatim}
% In other words, the first argument to \cs{exp_args:NNo} is the base
% function and the other arguments are preprocessed and then passed to
diff --git a/Master/texmf-dist/source/latex-dev/l3kernel/l3file.dtx b/Master/texmf-dist/source/latex-dev/l3kernel/l3file.dtx
index 6b1f21c00c3..550556f6758 100644
--- a/Master/texmf-dist/source/latex-dev/l3kernel/l3file.dtx
+++ b/Master/texmf-dist/source/latex-dev/l3kernel/l3file.dtx
@@ -44,7 +44,7 @@
% }^^A
% }
%
-% \date{Released 2024-06-19}
+% \date{Released 2024-08-30}
%
% \maketitle
%
@@ -718,8 +718,10 @@
% \cs{file_if_exist_p:n} \Arg{file name}
% \cs{file_if_exist:nTF} \Arg{file name} \Arg{true code} \Arg{false code}
% \end{syntax}
-% Tests if \meta{file name} is found in the path as detailed for
-% \cs{file_if_exist:nTF}.
+% Expands the argument of the \meta{file name} to give a string, then
+% searches for this string using the current \TeX{} search
+% path and the additional paths controlled by
+% \cs{l_file_search_path_seq}.
% \end{function}
%
% \subsection{Information about files and file contents}
diff --git a/Master/texmf-dist/source/latex-dev/l3kernel/l3flag.dtx b/Master/texmf-dist/source/latex-dev/l3kernel/l3flag.dtx
index e9733bff57b..7f330a4aa92 100644
--- a/Master/texmf-dist/source/latex-dev/l3kernel/l3flag.dtx
+++ b/Master/texmf-dist/source/latex-dev/l3kernel/l3flag.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2024-06-19}
+% \date{Released 2024-08-30}
%
% \maketitle
%
diff --git a/Master/texmf-dist/source/latex-dev/l3kernel/l3fp-assign.dtx b/Master/texmf-dist/source/latex-dev/l3kernel/l3fp-assign.dtx
index 98b71f34aa3..3efd2034445 100644
--- a/Master/texmf-dist/source/latex-dev/l3kernel/l3fp-assign.dtx
+++ b/Master/texmf-dist/source/latex-dev/l3kernel/l3fp-assign.dtx
@@ -42,7 +42,7 @@
% {latex-team@latex-project.org}^^A
% }^^A
% }
-% \date{Released 2024-06-19}
+% \date{Released 2024-08-30}
% \maketitle
%
% \begin{documentation}
diff --git a/Master/texmf-dist/source/latex-dev/l3kernel/l3fp-aux.dtx b/Master/texmf-dist/source/latex-dev/l3kernel/l3fp-aux.dtx
index e05cc1e4395..f0f9df06cf2 100644
--- a/Master/texmf-dist/source/latex-dev/l3kernel/l3fp-aux.dtx
+++ b/Master/texmf-dist/source/latex-dev/l3kernel/l3fp-aux.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2024-06-19}
+% \date{Released 2024-08-30}
%
% \maketitle
%
diff --git a/Master/texmf-dist/source/latex-dev/l3kernel/l3fp-basics.dtx b/Master/texmf-dist/source/latex-dev/l3kernel/l3fp-basics.dtx
index d72a54eace1..faaf52210ca 100644
--- a/Master/texmf-dist/source/latex-dev/l3kernel/l3fp-basics.dtx
+++ b/Master/texmf-dist/source/latex-dev/l3kernel/l3fp-basics.dtx
@@ -42,7 +42,7 @@
% {latex-team@latex-project.org}^^A
% }^^A
% }
-% \date{Released 2024-06-19}
+% \date{Released 2024-08-30}
%
% \maketitle
%
diff --git a/Master/texmf-dist/source/latex-dev/l3kernel/l3fp-convert.dtx b/Master/texmf-dist/source/latex-dev/l3kernel/l3fp-convert.dtx
index 435c4ac38e8..d2a28eb63e3 100644
--- a/Master/texmf-dist/source/latex-dev/l3kernel/l3fp-convert.dtx
+++ b/Master/texmf-dist/source/latex-dev/l3kernel/l3fp-convert.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2024-06-19}
+% \date{Released 2024-08-30}
%
% \maketitle
%
diff --git a/Master/texmf-dist/source/latex-dev/l3kernel/l3fp-expo.dtx b/Master/texmf-dist/source/latex-dev/l3kernel/l3fp-expo.dtx
index 83af683de1f..676eff2dbe3 100644
--- a/Master/texmf-dist/source/latex-dev/l3kernel/l3fp-expo.dtx
+++ b/Master/texmf-dist/source/latex-dev/l3kernel/l3fp-expo.dtx
@@ -42,7 +42,7 @@
% {latex-team@latex-project.org}^^A
% }^^A
% }
-% \date{Released 2024-06-19}
+% \date{Released 2024-08-30}
%
% \maketitle
%
diff --git a/Master/texmf-dist/source/latex-dev/l3kernel/l3fp-extended.dtx b/Master/texmf-dist/source/latex-dev/l3kernel/l3fp-extended.dtx
index 5f5bd618f41..dcff79ec44d 100644
--- a/Master/texmf-dist/source/latex-dev/l3kernel/l3fp-extended.dtx
+++ b/Master/texmf-dist/source/latex-dev/l3kernel/l3fp-extended.dtx
@@ -42,7 +42,7 @@
% {latex-team@latex-project.org}^^A
% }^^A
% }
-% \date{Released 2024-06-19}
+% \date{Released 2024-08-30}
%
% \maketitle
%
diff --git a/Master/texmf-dist/source/latex-dev/l3kernel/l3fp-functions.dtx b/Master/texmf-dist/source/latex-dev/l3kernel/l3fp-functions.dtx
index da79f1f5562..0d712759460 100644
--- a/Master/texmf-dist/source/latex-dev/l3kernel/l3fp-functions.dtx
+++ b/Master/texmf-dist/source/latex-dev/l3kernel/l3fp-functions.dtx
@@ -42,7 +42,7 @@
% }^^A
% }
%
-% \date{Released 2024-06-19}
+% \date{Released 2024-08-30}
%
% \maketitle
%
diff --git a/Master/texmf-dist/source/latex-dev/l3kernel/l3fp-logic.dtx b/Master/texmf-dist/source/latex-dev/l3kernel/l3fp-logic.dtx
index 96efa4b7572..44b35b40b96 100644
--- a/Master/texmf-dist/source/latex-dev/l3kernel/l3fp-logic.dtx
+++ b/Master/texmf-dist/source/latex-dev/l3kernel/l3fp-logic.dtx
@@ -42,7 +42,7 @@
% {latex-team@latex-project.org}^^A
% }^^A
% }
-% \date{Released 2024-06-19}
+% \date{Released 2024-08-30}
%
% \maketitle
%
diff --git a/Master/texmf-dist/source/latex-dev/l3kernel/l3fp-parse.dtx b/Master/texmf-dist/source/latex-dev/l3kernel/l3fp-parse.dtx
index 00244bc2fb7..be648dffaba 100644
--- a/Master/texmf-dist/source/latex-dev/l3kernel/l3fp-parse.dtx
+++ b/Master/texmf-dist/source/latex-dev/l3kernel/l3fp-parse.dtx
@@ -42,7 +42,7 @@
% {latex-team@latex-project.org}^^A
% }^^A
% }
-% \date{Released 2024-06-19}
+% \date{Released 2024-08-30}
%
% \maketitle
%
diff --git a/Master/texmf-dist/source/latex-dev/l3kernel/l3fp-random.dtx b/Master/texmf-dist/source/latex-dev/l3kernel/l3fp-random.dtx
index 9722b5eea08..354681c6549 100644
--- a/Master/texmf-dist/source/latex-dev/l3kernel/l3fp-random.dtx
+++ b/Master/texmf-dist/source/latex-dev/l3kernel/l3fp-random.dtx
@@ -42,7 +42,7 @@
% {latex-team@latex-project.org}^^A
% }^^A
% }
-% \date{Released 2024-06-19}
+% \date{Released 2024-08-30}
%
% \maketitle
%
diff --git a/Master/texmf-dist/source/latex-dev/l3kernel/l3fp-round.dtx b/Master/texmf-dist/source/latex-dev/l3kernel/l3fp-round.dtx
index 1a407cfcfa8..4ed4ae87a75 100644
--- a/Master/texmf-dist/source/latex-dev/l3kernel/l3fp-round.dtx
+++ b/Master/texmf-dist/source/latex-dev/l3kernel/l3fp-round.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2024-06-19}
+% \date{Released 2024-08-30}
%
% \maketitle
%
diff --git a/Master/texmf-dist/source/latex-dev/l3kernel/l3fp-symbolic.dtx b/Master/texmf-dist/source/latex-dev/l3kernel/l3fp-symbolic.dtx
index eb8b3cc212c..52943d80e31 100644
--- a/Master/texmf-dist/source/latex-dev/l3kernel/l3fp-symbolic.dtx
+++ b/Master/texmf-dist/source/latex-dev/l3kernel/l3fp-symbolic.dtx
@@ -42,7 +42,7 @@
% }^^A
% }
%
-% \date{Released 2024-06-19}
+% \date{Released 2024-08-30}
%
% \maketitle
%
diff --git a/Master/texmf-dist/source/latex-dev/l3kernel/l3fp-traps.dtx b/Master/texmf-dist/source/latex-dev/l3kernel/l3fp-traps.dtx
index 358bbc63826..5d35f89bea5 100644
--- a/Master/texmf-dist/source/latex-dev/l3kernel/l3fp-traps.dtx
+++ b/Master/texmf-dist/source/latex-dev/l3kernel/l3fp-traps.dtx
@@ -42,7 +42,7 @@
% {latex-team@latex-project.org}^^A
% }^^A
% }
-% \date{Released 2024-06-19}
+% \date{Released 2024-08-30}
% \maketitle
%
% \begin{documentation}
diff --git a/Master/texmf-dist/source/latex-dev/l3kernel/l3fp-trig.dtx b/Master/texmf-dist/source/latex-dev/l3kernel/l3fp-trig.dtx
index 75731af7efe..3826543b532 100644
--- a/Master/texmf-dist/source/latex-dev/l3kernel/l3fp-trig.dtx
+++ b/Master/texmf-dist/source/latex-dev/l3kernel/l3fp-trig.dtx
@@ -42,7 +42,7 @@
% {latex-team@latex-project.org}^^A
% }^^A
% }
-% \date{Released 2024-06-19}
+% \date{Released 2024-08-30}
%
% \maketitle
%
diff --git a/Master/texmf-dist/source/latex-dev/l3kernel/l3fp-types.dtx b/Master/texmf-dist/source/latex-dev/l3kernel/l3fp-types.dtx
index e19c8b8fda4..5067210f35f 100644
--- a/Master/texmf-dist/source/latex-dev/l3kernel/l3fp-types.dtx
+++ b/Master/texmf-dist/source/latex-dev/l3kernel/l3fp-types.dtx
@@ -42,7 +42,7 @@
% }^^A
% }
%
-% \date{Released 2024-06-19}
+% \date{Released 2024-08-30}
%
% \maketitle
%
diff --git a/Master/texmf-dist/source/latex-dev/l3kernel/l3fp.dtx b/Master/texmf-dist/source/latex-dev/l3kernel/l3fp.dtx
index 3095b53b7ef..ac8f8323e24 100644
--- a/Master/texmf-dist/source/latex-dev/l3kernel/l3fp.dtx
+++ b/Master/texmf-dist/source/latex-dev/l3kernel/l3fp.dtx
@@ -49,7 +49,7 @@
% }^^A
% }
%
-% \date{Released 2024-06-19}
+% \date{Released 2024-08-30}
%
% \maketitle
%
@@ -773,7 +773,7 @@
% The result may contain other functions, which are
% then replaced by their results if they have any. For instance,
% \begin{quote}
-% \cs{fp_new_function:n} |{ foo }| \\
+% \cs{fp_new_function:n} |{ npow }| \\
% \cs{fp_set_function:nnn} |{ npow } { a,b } { a**b }| \\
% \cs{fp_show:n} |{ npow(16,0.25) } }|
% \end{quote}
diff --git a/Master/texmf-dist/source/latex-dev/l3kernel/l3fparray.dtx b/Master/texmf-dist/source/latex-dev/l3kernel/l3fparray.dtx
index 696bf2befac..edc59b2df53 100644
--- a/Master/texmf-dist/source/latex-dev/l3kernel/l3fparray.dtx
+++ b/Master/texmf-dist/source/latex-dev/l3kernel/l3fparray.dtx
@@ -44,7 +44,7 @@
% }^^A
% }
%
-% \date{Released 2024-06-19}
+% \date{Released 2024-08-30}
%
% \maketitle
%
diff --git a/Master/texmf-dist/source/latex-dev/l3kernel/l3int.dtx b/Master/texmf-dist/source/latex-dev/l3kernel/l3int.dtx
index 6dc750369d4..0d34fc6ef21 100644
--- a/Master/texmf-dist/source/latex-dev/l3kernel/l3int.dtx
+++ b/Master/texmf-dist/source/latex-dev/l3kernel/l3int.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2024-06-19}
+% \date{Released 2024-08-30}
%
% \maketitle
%
@@ -100,21 +100,6 @@
% restricted-expandable functions can both be used, and \cs{exp_not:n}
% and its variants have no effect while \cs{exp_not:N} may incorrectly
% interrupt the expression.
-% \begin{texnote}
-% Exactly two expansions are needed to evaluate \cs{int_eval:n}.
-% The result is \emph{not} an \meta{internal integer}, and therefore
-% should be terminated by a space if used in \cs{int_value:w} or in
-% a \TeX{}-style integer assignment.
-%
-% As all \TeX{} integers, integer operands can also be:
-% \tn{value}\Arg{\LaTeXe{} counter}; dimension or skip variables,
-% converted to integers in~\texttt{sp}; the character code of some
-% character given as \texttt{`}\meta{char} or
-% \texttt{`\textbackslash}\meta{char}; octal numbers given as
-% \texttt{'} followed by digits from \texttt{0} to \texttt{7}; or
-% hexadecimal numbers given as |"| followed by digits and upper case
-% letters from \texttt{A} to~\texttt{F}.
-% \end{texnote}
%
% \begin{function}[EXP]{\int_eval:n}
% \begin{syntax}
diff --git a/Master/texmf-dist/source/latex-dev/l3kernel/l3intarray.dtx b/Master/texmf-dist/source/latex-dev/l3kernel/l3intarray.dtx
index 2a8a5240b3d..0fd1290effd 100644
--- a/Master/texmf-dist/source/latex-dev/l3kernel/l3intarray.dtx
+++ b/Master/texmf-dist/source/latex-dev/l3kernel/l3intarray.dtx
@@ -44,7 +44,7 @@
% }^^A
% }
%
-% \date{Released 2024-06-19}
+% \date{Released 2024-08-30}
%
% \maketitle
%
diff --git a/Master/texmf-dist/source/latex-dev/l3kernel/l3kernel-functions.dtx b/Master/texmf-dist/source/latex-dev/l3kernel/l3kernel-functions.dtx
index 89abe0ae6c5..06d18e6a0a8 100644
--- a/Master/texmf-dist/source/latex-dev/l3kernel/l3kernel-functions.dtx
+++ b/Master/texmf-dist/source/latex-dev/l3kernel/l3kernel-functions.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2024-06-19}
+% \date{Released 2024-08-30}
%
% \maketitle
%
diff --git a/Master/texmf-dist/source/latex-dev/l3kernel/l3keys.dtx b/Master/texmf-dist/source/latex-dev/l3kernel/l3keys.dtx
index 3291f086e25..6e653f3044c 100644
--- a/Master/texmf-dist/source/latex-dev/l3kernel/l3keys.dtx
+++ b/Master/texmf-dist/source/latex-dev/l3kernel/l3keys.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2024-06-19}
+% \date{Released 2024-08-30}
%
% \maketitle
%
@@ -649,15 +649,13 @@
% { key } % Name of choice key
% { choice-a , choice-b , choice-c } % Valid choices
% { \exp_not:n {#1} } % Invalid choice given
-% %
-% %
% }
% \end{verbatim}
%
% Multiple choices are created in a very similar manner to mutually-exclusive
% choices, using the properties \texttt{.multichoice:} and
% \texttt{.multichoices:nn}. As with mutually exclusive choices, multiple
-% choices are define as sub-keys. Thus both
+% choices are defined as sub-keys. Thus both
% \begin{verbatim}
% \keys_define:nn { mymodule }
% {
@@ -1926,19 +1924,21 @@
% \end{macro}
%
% \begin{macro}{\@@_define_code:n}
-% \begin{macro}[EXP]{\@@_define_code:TF}
+% \begin{macro}[EXP]{\@@_define_code:nnn}
% \begin{macro}[EXP]{\@@_define_code:w}
% Two possible cases. If there is a value for the key, then just use
% the function. If not, then a check to make sure there is no need for
% a value with the property. If there should be one then complain,
-% otherwise execute it. There is no need to check for a |:| as if it
-% was missing the earlier tests would have failed.
+% otherwise execute it. For a \LaTeXe{} property like |.code| which
+% doesn't contain a |:|, treat it as having arity 1 and pass the
+% (empty) value to it.
% \begin{macrocode}
\cs_new_protected:Npn \@@_define_code:n #1
{
\bool_if:NTF \l_@@_no_value_bool
{
- \@@_define_code:TF
+ \@@_define_code:nnn
+ { \use:c { \c_@@_props_root_str \l_@@_property_str } {#1} }
{ \use:c { \c_@@_props_root_str \l_@@_property_str } }
{
\msg_error:nnee { keys } { property-requires-value }
@@ -1947,7 +1947,7 @@
}
{ \use:c { \c_@@_props_root_str \l_@@_property_str } {#1} }
}
-\cs_new:Npe \@@_define_code:TF
+\cs_new:Npe \@@_define_code:nnn
{
\exp_not:N \exp_after:wN \exp_not:N \@@_define_code:w
\exp_not:N \l_@@_property_str
@@ -1959,7 +1959,15 @@
\cs_new:Npn \exp_not:N \@@_define_code:w
#1 \c_colon_str #2 \c_colon_str #3 \exp_not:N \s_@@_stop
}
- { \tl_if_empty:nTF {#2} }
+ {
+ \tl_if_empty:nTF {#3}
+ { \use_i:nnn }
+ {
+ \tl_if_empty:nTF {#2}
+ { \use_ii:nnn }
+ { \use_iii:nnn }
+ }
+ }
% \end{macrocode}
% \end{macro}
% \end{macro}
diff --git a/Master/texmf-dist/source/latex-dev/l3kernel/l3legacy.dtx b/Master/texmf-dist/source/latex-dev/l3kernel/l3legacy.dtx
index 3ff5c60c725..aaedf2192be 100644
--- a/Master/texmf-dist/source/latex-dev/l3kernel/l3legacy.dtx
+++ b/Master/texmf-dist/source/latex-dev/l3kernel/l3legacy.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2024-06-19}
+% \date{Released 2024-08-30}
%
% \maketitle
%
diff --git a/Master/texmf-dist/source/latex-dev/l3kernel/l3luatex.dtx b/Master/texmf-dist/source/latex-dev/l3kernel/l3luatex.dtx
index 3df2c8015a1..bb63d33ec8e 100644
--- a/Master/texmf-dist/source/latex-dev/l3kernel/l3luatex.dtx
+++ b/Master/texmf-dist/source/latex-dev/l3kernel/l3luatex.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2024-06-19}
+% \date{Released 2024-08-30}
%
% \maketitle
%
diff --git a/Master/texmf-dist/source/latex-dev/l3kernel/l3msg.dtx b/Master/texmf-dist/source/latex-dev/l3kernel/l3msg.dtx
index d4ce94ea013..f31ae83ce59 100644
--- a/Master/texmf-dist/source/latex-dev/l3kernel/l3msg.dtx
+++ b/Master/texmf-dist/source/latex-dev/l3kernel/l3msg.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2024-06-19}
+% \date{Released 2024-08-30}
%
% \maketitle
%
diff --git a/Master/texmf-dist/source/latex-dev/l3kernel/l3names.dtx b/Master/texmf-dist/source/latex-dev/l3kernel/l3names.dtx
index 12e881781b3..c664a2c0c91 100644
--- a/Master/texmf-dist/source/latex-dev/l3kernel/l3names.dtx
+++ b/Master/texmf-dist/source/latex-dev/l3kernel/l3names.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2024-06-19}
+% \date{Released 2024-08-30}
%
% \maketitle
%
diff --git a/Master/texmf-dist/source/latex-dev/l3kernel/l3pdf.dtx b/Master/texmf-dist/source/latex-dev/l3kernel/l3pdf.dtx
index aed2fa02e24..b97eb20035b 100644
--- a/Master/texmf-dist/source/latex-dev/l3kernel/l3pdf.dtx
+++ b/Master/texmf-dist/source/latex-dev/l3kernel/l3pdf.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2024-06-19}
+% \date{Released 2024-08-30}
%
% \maketitle
%
@@ -70,8 +70,8 @@
% \cs{pdf_object_write:nnn} \Arg{object} \Arg{type} \Arg{content}
% \end{syntax}
% Writes the \meta{content} as content of the \meta{object}. Depending on the
-% \meta{type} declared for the object, the format required for the
-% \meta{data} will vary
+% \meta{type} declared for the object, the format required for
+% \meta{content} will vary:
% \begin{itemize}
% \item[\texttt{array}] A space-separated list of values
% \item[\texttt{dict}] Key--value pairs in the form
@@ -159,7 +159,7 @@
% \cs{pdf_object_unnamed_write:nn} \Arg{type} \Arg{content}
% \end{syntax}
% Writes the \meta{content} as content of an anonymous object. Depending on the
-% \meta{type}, the format required for the \meta{data} will vary
+% \meta{type}, the format required for \meta{content} will vary:
% \begin{itemize}
% \item[\texttt{array}] A space-separated list of values
% \item[\texttt{dict}] Key--value pairs in the form
@@ -251,9 +251,9 @@
%
% \section{Destinations}
%
-% Destinations are the places a link jumped too.
-% Unlike the name may suggest they don't described
-% an exact location in the PDF. Instead a destination contains a reference to
+% Destinations are the places a link jumped to.
+% Unlike the name may suggest, they don't describe
+% an exact location in the PDF. Instead, a destination contains a reference to
% a page along with an instruction how to display this page.
% The normally used \enquote{XYZ \textit{top left zoom}} for example instructs
% the viewer to show the page with the given \textit{zoom} and
diff --git a/Master/texmf-dist/source/latex-dev/l3kernel/l3prg.dtx b/Master/texmf-dist/source/latex-dev/l3kernel/l3prg.dtx
index 92bcf69e60b..e474d896052 100644
--- a/Master/texmf-dist/source/latex-dev/l3kernel/l3prg.dtx
+++ b/Master/texmf-dist/source/latex-dev/l3kernel/l3prg.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2024-06-19}
+% \date{Released 2024-08-30}
%
% \maketitle
%
diff --git a/Master/texmf-dist/source/latex-dev/l3kernel/l3prop.dtx b/Master/texmf-dist/source/latex-dev/l3kernel/l3prop.dtx
index 70bd8bcf1cc..4268afb573b 100644
--- a/Master/texmf-dist/source/latex-dev/l3kernel/l3prop.dtx
+++ b/Master/texmf-dist/source/latex-dev/l3kernel/l3prop.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2024-06-19}
+% \date{Released 2024-08-30}
%
% \maketitle
%
@@ -181,11 +181,11 @@
% \prop_gset_from_keyval:Nn, \prop_gset_from_keyval:cn,
% }
% \begin{syntax}
-% \cs{prop_set_from_keyval:Nn} \meta{property list}
-% \{
-% \meta{key1} |=| \meta{value1} |,|
-% \meta{key2} |=| \meta{value2} |,| \ldots{}
-% \}
+% \cs{prop_set_from_keyval:Nn} \meta{property list} \\
+% ~~\{ \\
+% ~~~~\meta{key1} |=| \meta{value1} |,| \\
+% ~~~~\meta{key2} |=| \meta{value2} |,| \ldots{} \\
+% ~~\}
% \end{syntax}
% Sets \meta{property list} to contain key--value pairs given in the second
% argument. If duplicate keys appear only the last of the values is kept.
@@ -205,11 +205,11 @@
% \begin{function}[added = 2017-11-28, updated = 2021-11-07]
% {\prop_const_from_keyval:Nn, \prop_const_from_keyval:cn}
% \begin{syntax}
-% \cs{prop_const_from_keyval:Nn} \meta{property list}
-% \{
-% \meta{key1} |=| \meta{value1} |,|
-% \meta{key2} |=| \meta{value2} |,| \ldots{}
-% \}
+% \cs{prop_const_from_keyval:Nn} \meta{property list} \\
+% ~~\{ \\
+% ~~~~\meta{key1} |=| \meta{value1} |,| \\
+% ~~~~\meta{key2} |=| \meta{value2} |,| \ldots{} \\
+% ~~\}
% \end{syntax}
% Creates a new constant \enquote{flat} \meta{property list} or raises
% an error if the
@@ -224,11 +224,11 @@
% \begin{function}[added = 2024-02-12]
% {\prop_const_linked_from_keyval:Nn, \prop_const_linked_from_keyval:cn}
% \begin{syntax}
-% \cs{prop_const_linked_from_keyval:Nn} \meta{prop~var}
-% \{
-% \meta{key1} |=| \meta{value1} |,|
-% \meta{key2} |=| \meta{value2} |,| \ldots{}
-% \}
+% \cs{prop_const_linked_from_keyval:Nn} \meta{prop~var} \\
+% ~~\{ \\
+% ~~~~\meta{key1} |=| \meta{value1} |,| \\
+% ~~~~\meta{key2} |=| \meta{value2} |,| \ldots{} \\
+% ~~\}
% \end{syntax}
% Creates a new constant \enquote{linked} \meta{prop~var} or raises an
% error if the
@@ -347,11 +347,11 @@
% \prop_gput_from_keyval:Nn, \prop_gput_from_keyval:cn,
% }
% \begin{syntax}
-% \cs{prop_put_from_keyval:Nn} \meta{property list}
-% \{
-% \meta{key1} |=| \meta{value1} |,|
-% \meta{key2} |=| \meta{value2} |,| \ldots{}
-% \}
+% \cs{prop_put_from_keyval:Nn} \meta{property list} \\
+% ~~\{ \\
+% ~~~~\meta{key1} |=| \meta{value1} |,| \\
+% ~~~~\meta{key2} |=| \meta{value2} |,| \ldots{} \\
+% ~~\}
% \end{syntax}
% Updates the \meta{property list} by adding entries for each key--value
% pair given in the second argument. The addition is done through
diff --git a/Master/texmf-dist/source/latex-dev/l3kernel/l3quark.dtx b/Master/texmf-dist/source/latex-dev/l3kernel/l3quark.dtx
index ae2e5b2ace2..e7e08b0d0cd 100644
--- a/Master/texmf-dist/source/latex-dev/l3kernel/l3quark.dtx
+++ b/Master/texmf-dist/source/latex-dev/l3kernel/l3quark.dtx
@@ -32,7 +32,7 @@
%
% \title{^^A
% The \pkg{l3quark} module\\ Quarks and scan marks^^A
-% }
+% }\ifdefined\thechapter\label{sec:l3quarks}\fi
%
% \author{^^A
% The \LaTeX{} Project\thanks
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2024-06-19}
+% \date{Released 2024-08-30}
%
% \maketitle
%
diff --git a/Master/texmf-dist/source/latex-dev/l3kernel/l3regex.dtx b/Master/texmf-dist/source/latex-dev/l3kernel/l3regex.dtx
index f5557a0bdc6..df0b3a8ced6 100644
--- a/Master/texmf-dist/source/latex-dev/l3kernel/l3regex.dtx
+++ b/Master/texmf-dist/source/latex-dev/l3kernel/l3regex.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2024-06-19}
+% \date{Released 2024-08-30}
%
% \maketitle
%
diff --git a/Master/texmf-dist/source/latex-dev/l3kernel/l3seq.dtx b/Master/texmf-dist/source/latex-dev/l3kernel/l3seq.dtx
index 8771429150b..6ae2c58ad79 100644
--- a/Master/texmf-dist/source/latex-dev/l3kernel/l3seq.dtx
+++ b/Master/texmf-dist/source/latex-dev/l3kernel/l3seq.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2024-06-19}
+% \date{Released 2024-08-30}
%
% \maketitle
%
diff --git a/Master/texmf-dist/source/latex-dev/l3kernel/l3skip.dtx b/Master/texmf-dist/source/latex-dev/l3kernel/l3skip.dtx
index c53e3c82f0f..2a4130845c5 100644
--- a/Master/texmf-dist/source/latex-dev/l3kernel/l3skip.dtx
+++ b/Master/texmf-dist/source/latex-dev/l3kernel/l3skip.dtx
@@ -44,7 +44,7 @@
% }^^A
% }
%
-% \date{Released 2024-06-19}
+% \date{Released 2024-08-30}
%
% \maketitle
%
diff --git a/Master/texmf-dist/source/latex-dev/l3kernel/l3sort.dtx b/Master/texmf-dist/source/latex-dev/l3kernel/l3sort.dtx
index aabf9137451..f3f33106216 100644
--- a/Master/texmf-dist/source/latex-dev/l3kernel/l3sort.dtx
+++ b/Master/texmf-dist/source/latex-dev/l3kernel/l3sort.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2024-06-19}
+% \date{Released 2024-08-30}
%
% \maketitle
%
diff --git a/Master/texmf-dist/source/latex-dev/l3kernel/l3str-convert.dtx b/Master/texmf-dist/source/latex-dev/l3kernel/l3str-convert.dtx
index 579deac4fc2..60129129f85 100644
--- a/Master/texmf-dist/source/latex-dev/l3kernel/l3str-convert.dtx
+++ b/Master/texmf-dist/source/latex-dev/l3kernel/l3str-convert.dtx
@@ -44,7 +44,7 @@
% }^^A
% }
%
-% \date{Released 2024-06-19}
+% \date{Released 2024-08-30}
%
% \maketitle
%
diff --git a/Master/texmf-dist/source/latex-dev/l3kernel/l3str.dtx b/Master/texmf-dist/source/latex-dev/l3kernel/l3str.dtx
index 211769877c3..0f95bcc896e 100644
--- a/Master/texmf-dist/source/latex-dev/l3kernel/l3str.dtx
+++ b/Master/texmf-dist/source/latex-dev/l3kernel/l3str.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2024-06-19}
+% \date{Released 2024-08-30}
%
% \maketitle
%
@@ -757,7 +757,7 @@
% \item Case changing text for typesetting: see the
% \cs[index=text_lowercase:n]{text_lowercase:n(n)},
% \cs[index=text_uppercase:n]{text_uppercase:n(n)} and
-% \cs[index=text_titlecase_all:n]{text_titlecase_(all|once):n(n)} functions which
+% \cs[index=text_titlecase_all:n]{text_titlecase_(all|first):n(n)} functions which
% correctly deal with context-dependence and other factors appropriate
% to text case changing.
% \end{itemize}
diff --git a/Master/texmf-dist/source/latex-dev/l3kernel/l3sys.dtx b/Master/texmf-dist/source/latex-dev/l3kernel/l3sys.dtx
index 699e3480972..39983b052d7 100644
--- a/Master/texmf-dist/source/latex-dev/l3kernel/l3sys.dtx
+++ b/Master/texmf-dist/source/latex-dev/l3kernel/l3sys.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2024-06-19}
+% \date{Released 2024-08-30}
%
% \maketitle
%
diff --git a/Master/texmf-dist/source/latex-dev/l3kernel/l3text-case.dtx b/Master/texmf-dist/source/latex-dev/l3kernel/l3text-case.dtx
index 915b8e1cd95..f8ca399d25b 100644
--- a/Master/texmf-dist/source/latex-dev/l3kernel/l3text-case.dtx
+++ b/Master/texmf-dist/source/latex-dev/l3kernel/l3text-case.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2024-06-19}
+% \date{Released 2024-08-30}
%
% \maketitle
%
diff --git a/Master/texmf-dist/source/latex-dev/l3kernel/l3text-map.dtx b/Master/texmf-dist/source/latex-dev/l3kernel/l3text-map.dtx
index b29dbbf0caa..d3cc2fdcd22 100644
--- a/Master/texmf-dist/source/latex-dev/l3kernel/l3text-map.dtx
+++ b/Master/texmf-dist/source/latex-dev/l3kernel/l3text-map.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2024-06-19}
+% \date{Released 2024-08-30}
%
% \maketitle
%
diff --git a/Master/texmf-dist/source/latex-dev/l3kernel/l3text-purify.dtx b/Master/texmf-dist/source/latex-dev/l3kernel/l3text-purify.dtx
index 2fe35a21e71..ab4dca057df 100644
--- a/Master/texmf-dist/source/latex-dev/l3kernel/l3text-purify.dtx
+++ b/Master/texmf-dist/source/latex-dev/l3kernel/l3text-purify.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2024-06-19}
+% \date{Released 2024-08-30}
%
% \maketitle
%
diff --git a/Master/texmf-dist/source/latex-dev/l3kernel/l3text.dtx b/Master/texmf-dist/source/latex-dev/l3kernel/l3text.dtx
index 472fc7d9bc0..3b23acccaee 100644
--- a/Master/texmf-dist/source/latex-dev/l3kernel/l3text.dtx
+++ b/Master/texmf-dist/source/latex-dev/l3kernel/l3text.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2024-06-19}
+% \date{Released 2024-08-30}
%
% \maketitle
%
@@ -65,11 +65,11 @@
% \end{syntax}
% Takes user input \meta{text} and expands the content.
% Protected commands (typically
-% formatting) are left in place, and no processing takes place of
+% formatting) are left in place, and no processing of
% math mode material (as delimited by pairs given in
% \cs{l_text_math_delims_tl} or as the argument to commands listed
-% in \cs{l_text_math_arg_tl}). Commands which are neither engine-
-% nor \LaTeX{} protected are expanded exhaustively.
+% in \cs{l_text_math_arg_tl}) takes place. Commands which are neither engine-
+% nor \LaTeX{}-protected are expanded exhaustively.
% Any commands listed in \cs{l_text_expand_exclude_tl} are excluded from
% expansion, as are those in \cs{l_text_case_exclude_arg_tl} and
% \cs{l_text_math_arg_tl}.
@@ -114,8 +114,8 @@
% \end{function}
%
% Upper- and lowercase have the obvious meanings. Titlecasing may be regarded
-% informally as converting the first character of the \meta{tokens} to
-% uppercase. However, the process is more complex
+% informally as converting the first \emph{non-space} character of the
+% \meta{tokens} to uppercase. However, the process is more complex
% than this as there are some situations where a single lowercase character
% maps to a special form, for example \texttt{ij} in Dutch which becomes
% \texttt{IJ}. There are two functions available for titlecasing: one which
@@ -214,8 +214,8 @@
% \text_declare_uppercase_mapping:nnn
% }
% \begin{syntax}
-% \cs{text_declare_lowercase_mapping:nn} \Arg{codeppoint} \Arg{replacement}
-% \cs{text_declare_lowercase_mapping:nnn} \Arg{BCP-47} \Arg{codeppoint} \Arg{replacement}
+% \cs{text_declare_lowercase_mapping:nn} \Arg{codepoint} \Arg{replacement}
+% \cs{text_declare_lowercase_mapping:nnn} \Arg{BCP-47} \Arg{codepoint} \Arg{replacement}
% \end{syntax}
% Declares that the \meta{replacement} tokens should be used when case mapping
% the \meta{codepoint}, rather than the standard mapping given in the
diff --git a/Master/texmf-dist/source/latex-dev/l3kernel/l3tl-analysis.dtx b/Master/texmf-dist/source/latex-dev/l3kernel/l3tl-analysis.dtx
index 53a8842b6f7..ec2f06670eb 100644
--- a/Master/texmf-dist/source/latex-dev/l3kernel/l3tl-analysis.dtx
+++ b/Master/texmf-dist/source/latex-dev/l3kernel/l3tl-analysis.dtx
@@ -44,7 +44,7 @@
% }^^A
% }
%
-% \date{Released 2024-06-19}
+% \date{Released 2024-08-30}
%
% \maketitle
%
diff --git a/Master/texmf-dist/source/latex-dev/l3kernel/l3tl-build.dtx b/Master/texmf-dist/source/latex-dev/l3kernel/l3tl-build.dtx
index abd6f971935..2456ec3b870 100644
--- a/Master/texmf-dist/source/latex-dev/l3kernel/l3tl-build.dtx
+++ b/Master/texmf-dist/source/latex-dev/l3kernel/l3tl-build.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2024-06-19}
+% \date{Released 2024-08-30}
%
% \maketitle
%
diff --git a/Master/texmf-dist/source/latex-dev/l3kernel/l3tl.dtx b/Master/texmf-dist/source/latex-dev/l3kernel/l3tl.dtx
index da498dcf9cc..777cf2318d6 100644
--- a/Master/texmf-dist/source/latex-dev/l3kernel/l3tl.dtx
+++ b/Master/texmf-dist/source/latex-dev/l3kernel/l3tl.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2024-06-19}
+% \date{Released 2024-08-30}
%
% \maketitle
%
diff --git a/Master/texmf-dist/source/latex-dev/l3kernel/l3token.dtx b/Master/texmf-dist/source/latex-dev/l3kernel/l3token.dtx
index 34387ca6b0a..f46bc9d9404 100644
--- a/Master/texmf-dist/source/latex-dev/l3kernel/l3token.dtx
+++ b/Master/texmf-dist/source/latex-dev/l3kernel/l3token.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2024-06-19}
+% \date{Released 2024-08-30}
%
% \maketitle
%
diff --git a/Master/texmf-dist/source/latex-dev/l3kernel/l3unicode.dtx b/Master/texmf-dist/source/latex-dev/l3kernel/l3unicode.dtx
index 5ca6ffbf41d..5308a8d956e 100644
--- a/Master/texmf-dist/source/latex-dev/l3kernel/l3unicode.dtx
+++ b/Master/texmf-dist/source/latex-dev/l3kernel/l3unicode.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2024-06-19}
+% \date{Released 2024-08-30}
%
% \maketitle
%
@@ -719,15 +719,22 @@
\tl_set:ce { l_@@_ #1 _block_tl }
{ \int_eval:n { \tl_use:c { l_@@_ #1 _block_tl } + 1 } }
}
- \prg_replicate:nn {#2}
+% \end{macrocode}
+% Here, we avoid \cs{prg_replicate:nn} as the number of tokens generated would be
+% high: that shows in the format dump (although \TeX{} recovers memory during
+% the subsequent runs).
+% \begin{macrocode}
+ \int_step_inline:nnn
+ { \tl_use:c { l_@@_ #1 _pos_tl } + 1 }
+ { \tl_use:c { l_@@_ #1 _pos_tl } + #2 }
{
- \tl_set:ce { l_@@_ #1 _pos_tl }
- { \int_eval:n { \tl_use:c { l_@@_ #1 _pos_tl } + 1 } }
\exp_args:Nc \__kernel_intarray_gset:Nnn
{ g_@@_ #1 _index_intarray }
- { \tl_use:c { l_@@_ #1 _pos_tl } }
+ {##1}
\l_@@_matched_block_tl
}
+ \tl_set:ce { l_@@_ #1 _pos_tl }
+ { \int_eval:n { \tl_use:c { l_@@_ #1 _pos_tl } + #2 } }
\clist_clear:c { l_@@_ #1 _block_clist }
}
% \end{macrocode}
diff --git a/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-amsmath.dtx b/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-amsmath.dtx
index 57e27067cbf..1b6302bb330 100644
--- a/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-amsmath.dtx
+++ b/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-amsmath.dtx
@@ -66,7 +66,7 @@
% \subsection{File declaration}
% \begin{macrocode}
\ProvidesFile{latex-lab-amsmath.ltx}
- [2024-02-12 v0.1b amsmath adaptions]
+ [2024-07-05 v0.1b amsmath adaptions]
% \end{macrocode}
% \subsection{Tagpdf support}
% To make the code independent from tagging being loaded and active
@@ -200,8 +200,8 @@
% \end{macrocode}
%
% \subsection{\cs{pmb}}
-% \cs{pmb} prints is argument three times. For tagging we must mark
-% two of occurences as artifact.
+% \cs{pmb} prints its argument three times. For tagging we must mark
+% two of occurrences as artifact.
% For luatex the attributes in the box must be reset, for this
% we switch to expl3-boxes.
% \begin{macrocode}
diff --git a/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-bib.dtx b/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-bib.dtx
index e8ee192a7b2..9d336aba208 100644
--- a/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-bib.dtx
+++ b/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-bib.dtx
@@ -16,7 +16,7 @@
%
% for those people who are interested or want to report an issue.
%
-\def\ltlabbibdate{2024-02-12}
+\def\ltlabbibdate{2024-07-05}
\def\ltlabbibversion{0.81b}
%<*driver>
\documentclass{l3doc}
@@ -128,7 +128,7 @@
%
% \begin{function}{\@extra@binfo,\@extra@b@citeb}
%
-% These are taken from hyperref, they are for chapterbib compability (and also
+% These are taken from hyperref, they are for chapterbib compatibility (and also
% signal to chapterbib not to change the citation commands)
% \end{function}
%
@@ -157,7 +157,7 @@
% \end{macrocode}
% \begin{macro}{\@extra@binfo,\@extra@b@citeb}
-% These are taken from hyperref, they are for chapterbib compability (and also
+% These are taken from hyperref, they are for chapterbib compatibility (and also
% signal to chapterbib not to change the citation commands)
% \begin{macrocode}
\providecommand*\@extra@binfo{}%
@@ -270,7 +270,7 @@
% \end{macrocode}
% Now we add the tagging structure.
% TODO: with the next tagpdf version it should no longer be
-% needed to exand the ref key.
+% needed to expand the ref key.
% \begin{macrocode}
\AddToHookWithArguments{bibcite/before}
{
@@ -305,7 +305,7 @@
% We need in part different code for both systems:
% with biblatex we have to take care that only the first
% structure sets a label, and if
-% hyperref is not loaded (or deactived) we will need additional code
+% hyperref is not loaded (or deactivated) we will need additional code
% but this currently doesn't exist.
% We assume that no document loads both package -- that will probably break.
% \begin{macrocode}
diff --git a/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-block.dtx b/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-block.dtx
index 7d08b270d25..23c590419e7 100644
--- a/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-block.dtx
+++ b/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-block.dtx
@@ -9,8 +9,8 @@
%
% https://www.latex-project.org/lppl.txt
%
-\def\ltlabblockdate{2024-03-23}
-\def\ltlabblockversion{0.8n}
+\def\ltlabblockdate{2024-08-11}
+\def\ltlabblockversion{0.8p}
%<*driver>
\documentclass[kernel]{l3doc}
\usepackage{amstext}
@@ -341,7 +341,7 @@
%
% The idea of a \key{heading} key needs some further
% thoughts. Maybe instead the object type should accept a second
-% argument and receive input for such a headding from the document
+% argument and receive input for such a heading from the document
% level instead.
%
% The names of the keys need further thoughts and some
@@ -474,7 +474,7 @@
% \>\>\> The paragraph text before the display element \ldots\\
% \>\> \struct{/text}\\
% \>\> \struct{display element structure}\\
-% \>\>\> Content of the display structure possiblly involving inner \struct{text-unit} tags\\
+% \>\>\> Content of the display structure possibly involving inner \struct{text-unit} tags\\
% \>\> \struct{/display element structure}\\
% \>\> \struct{text}\\
% \>\>\> \ldots{} continuing the outer paragraph text\\
@@ -722,7 +722,7 @@
blockenv implementation]
% \end{macrocode}
%
-% Generell kernel changes, also loaded by the sec and toc code.
+% General kernel changes, also loaded by the sec and toc code.
% \begin{macrocode}
\RequirePackage{latex-lab-kernel-changes}
% \end{macrocode}
@@ -795,7 +795,52 @@
% The flag itself should be set globally not locally.\fmi{verify
% that this claim is actually correct!}
% \begin{macrocode}
-\def\@endpetrue {\global\let\if@endpe\iftrue}
+\def\@endpetrue {%
+ \global\let\if@endpe\iftrue
+% if called inside a group propagate to the outside
+ \ifnum\currentgrouplevel>\z@
+ \aftergroup\propagate@doendpe
+ \fi
+}
+% \end{macrocode}
+%
+% If \cs{if@endpe} is still true run \cs{@doendpe}
+% that in turn runs another \cs{@endpetrue} (besides other things),
+% thus propagating further, if necessary
+% However, if the endpe situation got resolved nothing further happens
+% \begin{macrocode}
+\def\propagate@doendpe{%
+ \if@endpe
+ \@@_debug_typeout:n{run~ (another)~ @doendpe~ at~
+ group~ level~ \the\currentgrouplevel}%
+ \@doendpe
+ \else
+ \@@_debug_typeout:n{do~ not~ run~ (another)~ @doendpe}%
+ \fi
+}
+% \end{macrocode}
+%
+% With the above approach we do not need the propagation in
+% \cs{end...} any longer
+% (since this is now handled by
+% \cs{aftergroup}\cs{propagate@doendpe}) so
+% here a simple \cs{endgroup} is enough. This replaces the
+% definition in ...:
+% \begin{macrocode}
+\@namedef{end }#1{%
+ \romannumeral
+ \IfHookEmptyTF{env/#1/end}%
+ {\expandafter\z@}%
+ {\z@\UseHook{env/#1/end}}%
+ \csname end#1\endcsname\@checkend{#1}%
+% \expandafter\endgroup\if@endpe\@doendpe\fi
+ \endgroup
+ \UseHook{env/#1/after}%
+ \if@ignore\@ignorefalse\ignorespaces\fi
+}
+% \end{macrocode}
+%
+% \begin{macrocode}
\def\@endpefalse{\global\let\if@endpe\iffalse}
% \end{macrocode}
% \end{macro}
@@ -1569,7 +1614,7 @@
% \end{macrocode}
% We need to know later if we have nested blockenvs inside
% a flattened environment. Whenever we start a new blockenv we
-% increment \cs{\l_@@_flattened_level_int} if it is already
+% increment \cs{l__tag_block_flattened_level_int} if it is already
% different from zero. If it is zero we increment it if flattening
% is requested.
% Thus a value of \texttt{0} means no flattening requested so far
@@ -1578,14 +1623,14 @@
% is surrounded by a \texttt{text-unit} tag, while for any value above
% \texttt{1} we have to omit the \texttt{text-unit}.
% \begin{macrocode}
- \int_compare:nNnTF \l_@@_flattened_level_int > 0
+ \int_compare:nNnTF \l__tag_block_flattened_level_int > 0
{
- \int_incr:N \l_@@_flattened_level_int
+ \int_incr:N \l__tag_block_flattened_level_int
}
{
\bool_if:NT \l__tag_para_flattened_bool
{
- \int_incr:N \l_@@_flattened_level_int
+ \int_incr:N \l__tag_block_flattened_level_int
}
}
%
@@ -1681,11 +1726,15 @@
% \end{template}
%
%
-% \begin{macro}{\l_@@_flattened_level_int}
+% \begin{macro}{\l__tag_block_flattened_level_int}
% Count the levels of nested blockenvs starting with the first that
-% is \enquote{flattened}.
+% is \enquote{flattened}. The counter is defined in lttagging.dtx,
+% but until the next release 11/24 we set it up here too
% \begin{macrocode}
-\int_new:N \l_@@_flattened_level_int
+\int_if_exist:NF \l__tag_block_flattened_level_int
+ {
+ \int_new:N \l__tag_block_flattened_level_int
+ }
% \end{macrocode}
% \end{macro}
%
@@ -1814,9 +1863,13 @@
% and should not inherit the setting from the outer environment.
% \begin{macrocode}
\socket_new_plug:nnn{tagsupport/block-endpe}{on}
- { \legacy_if_gset_true:n { @endpe } }
+% \end{macrocode}
+% We can't use \cs{legacy_if_gset_true:n} because this is now doing
+% more than setting the legacy switch
+% \begin{macrocode}
+ { \@endpetrue }
\socket_new_plug:nnn{tagsupport/block-endpe}{off}
- { \legacy_if_gset_false:n { @endpe } }
+ { \@endpefalse }
% \end{macrocode}
%
% \begin{macrocode}
@@ -1981,7 +2034,7 @@
% \cs{parskip} and some other housekeeping, unless this block is inside a list and the list
% \cs{item} has not yet placed. In that case the vertical
% space and penalty us suppressed. This
-% is controled through the legacy switches \texttt{@noparitem},
+% is controlled through the legacy switches \texttt{@noparitem},
% \texttt{minipage}, and \texttt{@nobreak}.
% \begin{macrocode}
\legacy_if:nTF { @noparitem }
@@ -2520,7 +2573,7 @@
%
% \begin{macro}{\item}
% Here we already have all the building blocks. Complain in math
-% mode. Distingusih between first item (do necessary tagging) and
+% mode. Distinguish between first item (do necessary tagging) and
% later items \cs{@@_inter_item:} to
% cleanly close what's before, then call \cs{@@_item_instance:n} (which
% calls \cs{UseInstance}\{item\}\marg{instance}) to prepare the
@@ -2751,7 +2804,7 @@
\socket_assign_plug:nn{tagsupport/block-endpe}{on}
% \end{macrocode}
%
-% Handle the tag name and attribute classess using the key values
+% Handle the tag name and attribute classes using the key values
% from the current list instance.
% \begin{macrocode}
\tl_if_empty:NTF \l_@@_tag_name_tl
@@ -2994,6 +3047,7 @@
block-instance = verbatimblock ,
inner-instance = ,
final-code = \legacyverbatimsetup ,
+ para-instance = justify
}
% \end{macrocode}
% \end{instance}
@@ -3173,7 +3227,7 @@
% block quoteblock-4,
% block quoteblock-5,
% block quoteblock-6 }
-% Default layout is to indent equaly from both side.
+% Default layout is to indent equally from both sides.
% \begin{macrocode}
\DeclareInstance{block}{quoteblock-1}{display}
{ rightmargin = \KeyValue{leftmargin} }
@@ -3468,7 +3522,7 @@
% then have to avoid adding another \texttt{text-unit}.
% \begin{macrocode}
{
- \int_compare:nNnT \l_@@_flattened_level_int < 2
+ \int_compare:nNnT \l__tag_block_flattened_level_int < 2
{
\__tag_gincr_para_main_begin_int:
\tag_struct_begin:n
diff --git a/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-firstaid.dtx b/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-firstaid.dtx
index ce0d46f8155..9a94863d7a9 100644
--- a/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-firstaid.dtx
+++ b/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-firstaid.dtx
@@ -16,8 +16,8 @@
%
% for those people who are interested or want to report an issue.
%
-\def\ltlabfirstaiddate{2024-05-25}
-\def\ltlabfirstaidversion{0.85d}
+\def\ltlabfirstaiddate{2024-08-11}
+\def\ltlabfirstaidversion{0.85e}
%<*driver>
\documentclass{l3doc}
\EnableCrossrefs
@@ -92,7 +92,7 @@
% \end{macro}
% \subsection{ams classes}
-% The amsart and amsbook classes do not use \cs{@author} to store the author list
+% The amsart, amsbook and amsproc classes do not use \cs{@author} to store the author list
% but a command \cs{authors}. To be able to nevertheless use the authors in the
% xmp-metadata we map \cs{@author} to this new command.
%
@@ -101,6 +101,8 @@
{\def\@author{\authors}}
\AddToHook{class/amsbook/after}
{\def\@author{\authors}}
+\AddToHook{class/amsproc/after}
+ {\def\@author{\authors}}
% \end{macrocode}
%
%
diff --git a/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-float.dtx b/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-float.dtx
index a8171337133..25ae805cfd2 100644
--- a/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-float.dtx
+++ b/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-float.dtx
@@ -16,7 +16,7 @@
%
% for those people who are interested or want to report an issue.
%
-\def\ltlabfloatdate{2024-03-23}
+\def\ltlabfloatdate{2024-07-05}
\def\ltlabfloatversion{0.81e}
%<*driver>
\documentclass{l3doc}
@@ -64,7 +64,7 @@
%
% A special type, called a H-float, (provided by the float package)
% is always placed in the main text stream and does not
-% necessarly preserve the order with normal floats of the same type: It is basically
+% necessarily preserve the order with normal floats of the same type: It is basically
% a minipage with a caption.
%
% Floats typically contain a figure (or a table, etc.) and a caption,
diff --git a/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-footnotes.dtx b/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-footnotes.dtx
index a3d044ab87d..039d8554f42 100644
--- a/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-footnotes.dtx
+++ b/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-footnotes.dtx
@@ -17,8 +17,8 @@
%
% for those people who are interested or want to report an issue.
%
-\def\ltlabfootnotedate{2024-03-12}
-\def\ltlabfootnoteversion{0.8d}
+\def\ltlabfootnotedate{2024-07-27}
+\def\ltlabfootnoteversion{0.8e}
%<*driver>
\documentclass{l3doc}
@@ -636,7 +636,7 @@
% number to setup the reference and the link.
%
% The structure related to the \cs{footref} is added to the end of the \texttt{/Ref} array of the note and so the
-% \texttt{/Ref} array doesn't necessarly reflect the order of the marks in the document. It would probably
+% \texttt{/Ref} array doesn't necessarily reflect the order of the marks in the document. It would probably
% be possible to change this, but it is not clear if it actually matters and so it worth the additional coding
% and processing.
%
@@ -1150,6 +1150,21 @@
%
%
% \begin{macro}{\fnote_footnotetext:n}
+% We temporarily test for the tagging socket until it is in the next release:
+% \begin{macrocode}
+\str_if_exist:cF { l__socket_tagsupport/para/restore_plug_str }
+ {
+ \NewSocket{tagsupport/para/restore}{0}
+ \NewSocketPlug{tagsupport/para/restore}{default}
+ {
+ \tl_set:Nn \l__tag_para_main_tag_tl {text-unit}
+ \tl_set_eq:NN \l__tag_para_tag_tl\l__tag_para_tag_default_tl
+ \bool_set_false:N\l__tag_para_flattened_bool
+ }
+ \AssignSocketPlug{tagsupport/para/restore}{default}
+ }
+% \end{macrocode}
+%
% \begin{macrocode}
\cs_new_protected:Npn \fnote_footnotetext:n #1 {
\@@_debug_footnotetext:
@@ -1191,6 +1206,7 @@
\floatingpenalty \@MM
\hsize\columnwidth
\@parboxrestore
+ \UseTaggingSocket{para/restore}
\parindent 1em % typical default used in \@makefntext moved up here
\def\@currentcounter{footnote}
\protected@edef \@currentlabel { \p@footnote \@thefnmark }
@@ -1673,7 +1689,7 @@
%
% \subsubsection{\pkg{memoir}}
% The \pkg{memoir} class redefines various internal commands to inject its
-% hooks and addtional code. The following reinstates the kernel command and
+% hooks and additional code. The following reinstates the kernel command and
% so probably breaks various options of \pkg{memoir}, but without the
% changes it errors anyway. The \pkg{footmisc} package should be used to change
% for example to para footnotes.
@@ -2446,7 +2462,7 @@
% This can use the default interface, except that a negative value for
% \footnotemargin makes little sense, so we test for this and warn if
-% necessary. But -\maxdimen is ok again, so would need to be a litte bit more elaborate.
+% necessary. But -\maxdimen is ok again, so would need to be a little bit more elaborate.
%
%\AddToHook{fntext/para}{
@@ -2483,7 +2499,7 @@
\leavevmode
% \end{macrocode}
% Typesetting the mark twice means that one can't have any material
-% inside that gets unhappy in that case. Tha shouldn't be a
+% inside that gets unhappy in that case. That shouldn't be a
% problem, but perhaps we have to come up with a more elaborate
% solution in the end.
% \begin{macrocode}
diff --git a/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-graphic.dtx b/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-graphic.dtx
index 5ea4a2db9c7..a596366aa7a 100644
--- a/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-graphic.dtx
+++ b/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-graphic.dtx
@@ -15,7 +15,7 @@
% https://github.com/latex3/latex2e/required/latex-lab
%
% for those people who are interested or want to report an issue.
-\def\ltlabgraphicdate{2024-03-13}
+\def\ltlabgraphicdate{2024-07-05}
\def\ltlabgraphicversion{0.80d}
%
%<*driver>
@@ -78,7 +78,7 @@
% The value of a \texttt{BBox} is an array of four numbers that gives the
% coordinates of the left, bottom, right, and top edges
% of the structure element’s bounding box. That is the rectangle that completely encloses
-% its \emph{visible} content so not necessarly the TeX bounding box:
+% its \emph{visible} content so not necessarily the TeX bounding box:
% if \texttt{viewport} or \texttt{trim} is used and the
% graphic is not clipped, the visible content can be larger.
%
@@ -146,8 +146,8 @@
% \item[\texttt{artifact}] When used the graphic will be tagged as artifact. This doesn't
% require a \texttt{BBox} and so works also in some of the not yet supported cases described
% above.
-% \item[\texttt{false}] When used tagging will be stopped completly. It is then the
-% responsability of the surrounding code to add appropriate tagging commands.
+% \item[\texttt{false}] When used tagging will be stopped completely. It is then the
+% responsibility of the surrounding code to add appropriate tagging commands.
% \item[\meta{name}] Other values will be used as tag names in the structure. If the tag is not
% known as a structure tag you will get an warning from tagpdf. The default name is currently
% \texttt{Figure}
@@ -291,7 +291,7 @@
% ,\l_@@_graphic_trim_uy_fp
% }
% A bunch of fp-variables (we don't use tl-vars,
-% to avoid to have to take care about minus signs everwhere)
+% to avoid to have to take care about minus signs everywhere)
% \begin{macrocode}
\fp_new:N\l_@@_graphic_sin_fp
\fp_new:N\l_@@_graphic_cos_fp
diff --git a/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-marginpar.dtx b/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-marginpar.dtx
index ca79d8a67fa..a57ebaab80a 100644
--- a/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-marginpar.dtx
+++ b/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-marginpar.dtx
@@ -18,8 +18,8 @@
%
% for those people who are interested or want to report an issue.
%
-\def\ltlabmarginpardate{2024-02-12}
-\def\ltlabmarginparversion{0.85b}
+\def\ltlabmarginpardate{2024-08-06}
+\def\ltlabmarginparversion{0.85c}
%<*driver>
\documentclass[kernel]{l3doc}
@@ -72,7 +72,7 @@
% They can be tagged either as artifacts (if they are merely distracting decoration),
% as small headings before the paragraph, or as |Aside|. Unlike the PDF 1.7 fallback |Note|
% the structure |Aside| is not allowed inside |P|,
-% so if |Aside| is used, it must be placed before or after the current |P| in the surounding |text-unit|,
+% so if |Aside| is used, it must be placed before or after the current |P| in the surrounding |text-unit|,
% or it must split the |P|. Splitting is probably not so good as
% |\marginpar| is often used somewhere in the middle of sentence.
% The best default is probably to use |Aside|, find the parent |text-unit| and add it there.
@@ -153,13 +153,38 @@
\socket_new:nn {tagsupport/marginpar/end}{0}
% \end{macrocode}
% \end{socketdecl}
+%
+% \begin{macro}{\@@_get_marginpar_parent:N,\@@_get_marginpar_parent_aux:nn}
+% In a paragraph we must retrieve
+% the structure number of the surrounding Part structure
+% TODO: if this is needed in more places this should
+% go into tagpdf.
+% \begin{macrocode}
+\cs_new_protected:Npn\@@_get_marginpar_parent_aux:nn #1 #2
+ {
+ \str_if_eq:eeT{\use_ii:nn #1}{Part}{\seq_put_right:Nn\l_@@_tmpa_seq {#2}}
+ }
+\cs_new_protected:Npn \@@_get_marginpar_parent:N #1
+ {
+ \seq_clear:N\l_@@_tmpa_seq
+ \seq_map_pairwise_function:NNN
+ \g_@@_struct_tag_stack_seq
+ \g_@@_struct_stack_seq
+ \@@_get_marginpar_parent_aux:nn
+ \seq_put_right:Nn\l_@@_tmpa_seq {2}
+ \seq_get_left:NN \l_@@_tmpa_seq #1
+ }
+\cs_generate_variant:Nn \tag_struct_begin:n {e}
+% \end{macrocode}
+% \end{macro}
% \begin{plugdecl}{tagsupport/marginpar/begin,tagsupport/marginpar/end}
% \begin{macrocode}
\socket_new_plug:nnn {tagsupport/marginpar/begin}{default}
{
\if_mode_horizontal:
- \tag_mc_end:
- \tag_struct_begin:n{tag=Aside,parent=\g__tag_para_main_struct_tl}%
+ \tag_mc_end:
+ \@@_get_marginpar_parent:N \l_@@_tmpa_tl
+ \tag_struct_begin:e{tag=Aside,parent=\l_@@_tmpa_tl}%
\else:
\tag_struct_begin:n{tag=Aside}%
\fi:
diff --git a/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-math.dtx b/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-math.dtx
index 0dbc5911852..c6e07d4832a 100644
--- a/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-math.dtx
+++ b/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-math.dtx
@@ -19,8 +19,8 @@
% for those people who are interested or want to report an issue.
%
%
-\def\ltlabmathdate{2024-04-16}
-\def\ltlabmathversion{0.5j}
+\def\ltlabmathdate{2024-08-22}
+\def\ltlabmathversion{0.6c}
%
%<*driver>
\documentclass{l3doc}
@@ -247,8 +247,15 @@
% It can be suppressed by an option with
% \texttt{math/tex/AF=false}, see below.
%
-% The MathML is attached if a file |\jobname-mathml.html| is found and
-% if it contains a suitable MathML snippet for the current formula.
+% The MathML is attached if the files |\jobname-mathml.html| and/or
+% |\jobname-luamml-mathml.html| are found
+% and if they contains a suitable MathML snippet for the current formula.
+% If the files contain more than one suitable snippet (as identified by the hash)
+% the first one is used.
+% |\jobname-luamml-mathml.html| is automatically generated (see below section~\ref{sec:luamml})
+% and read after |\jobname-mathml.html|. This means that |\jobname-mathml.html| can contain
+% improved versions of a formula.
+%
% The MathML processing can be suppressed globally by emptying the list of
% mathml files with |math/mathml/sources=|. Locally for a formula |math/mathml/AF=false|
% can be used.
@@ -306,7 +313,7 @@
%
% As mentioned above the MathML-AF can be suppressed for the equations in a group with
% |math/mathml/AF=false|, or
-% completly by setting |math/mathml/sources=| in the preamble.
+% completely by setting |math/mathml/sources=| in the preamble.
%
% Files embedded in a PDF can be listed in the attachments panel of a PDF viewer.
% This is probably not so useful for lots of small files (but one could create
@@ -316,6 +323,27 @@
% |viewer/pane/mathsource=true| (anywhere in the document) and |viewer/pane/mathml=false| (in the
% preamble, before the external file is read).
%
+%
+% \subsection{Automatic mathml creation with luamml}\label{sec:luamml}
+%
+% If lualatex is used, if the package \texttt{unicode-math} is used
+% and if the package \texttt{luamml} is found
+% then it will automatically generate the file |\jobname-luamml-mathml.html|
+% with mathml representations of all math formulas.
+% The generation of the file can be suppressed with |math/mathml/luamml=false|.
+% If \texttt{unicode-math} is not used,
+% the generation of the file can be forced
+% with |math/mathml/luamml=true| or |math/mathml/luamml| but be aware that
+% it is then probable that various symbols are mapped to the wrong unicode code
+% points.
+% The package is still quite experimental and the output should be checked.
+% The |\jobname-luamml-mathml.html| file may be previewed in a browser although
+% you may need to add additional css or javascript declarations
+% to enable browser support for all mathml constructs.
+% The file is then used in subsequent compilations and works also with
+% pdflatex.
+%
+%
% \subsection{Options}
%
%
@@ -538,6 +566,7 @@
% \begin{macrocode}
\tl_new:N \l_@@_tmpa_tl
\skip_new:N \l_@@_tmpa_skip
+\str_new:N \l_@@_tmpa_str
% \end{macrocode}
% \end{variable}
%
@@ -592,8 +621,12 @@
% \l__tag_math_mathml_AF_bool,
% \g__tag_math_mathml_AF_bool,
% \l__tag_math_mathml_pane_bool,
-% \l__tag_math_alt_bool
+% \l__tag_math_alt_bool,
+% \g__tag_math_luamml_tl,
% }
+% The variable \cs{g__tag_math_luamml_tl} is initially 0 and
+% the user key can set it to -1 or 1. This allows to distinguish
+% the unset case from a value set by the user.
% \begin{macrocode}
\bool_new:N\l__tag_math_texsource_AF_bool
\bool_new:N\l__tag_math_texsource_pane_bool
@@ -601,6 +634,8 @@
\bool_new:N\g__tag_math_mathml_AF_bool
\bool_new:N\l__tag_math_mathml_pane_bool
\bool_new:N\l__tag_math_alt_bool
+\tl_new:N\g__tag_math_luamml_tl
+\tl_gset:Nn\g__tag_math_luamml_tl {0}
% \end{macrocode}
% \end{variable}
%
@@ -631,9 +666,11 @@
%
% \begin{variable}{\l__tag_math_mathml_files_clist}
% A sequence to store the file list for the mathml.
+% If luatex is detected with also check the luamml file.
% \begin{macrocode}
\clist_new:N\l__tag_math_mathml_files_clist
-\clist_put_right:Ne\l__tag_math_mathml_files_clist {\c_sys_jobname_str-mathml}
+\clist_put_right:Ne\l__tag_math_mathml_files_clist
+ {\c_sys_jobname_str-mathml,\c_sys_jobname_str-luamml-mathml}
% \end{macrocode}
% \end{variable}
@@ -685,8 +722,268 @@
\@@_AF_mml:nnnn{#1}{#2}{#3}{#4}
}
% \end{macrocode}
+%
+% As with luatex we write two files we define a few constants for
+% the shared texts.
+%
+% \begin{macro}
+% {\c_@@_mathml_write_init_tl,\l_@@_mathml_write_before_tl,
+% \c_@@_mathml_write_after_tl,\c_@@_mathml_write_final_tl}
+% \begin{macrocode}
+\tl_const:Nn \c_@@_mathml_write_init_tl
+ {
+ <!DOCTYPE~html>
+ \iow_newline:
+ <html>
+ \iow_newline:
+ }
+\tl_new:N \l_@@_mathml_write_before_tl
+\tl_const:Nn \c_@@_mathml_write_after_tl
+ {
+ \iow_newline:
+ </div>
+ \iow_newline:
+ }
+\tl_const:Nn \c_@@_mathml_write_final_tl
+ {
+ </html>
+ }
+% \end{macrocode}
+% \end{macro}
+% \begin{socketdecl}{tagsupport/math/mathml/write/prepare}
+% To prepare the hash and the starting command we use a socket, so
+% that both the dummy and luamml can make use of it.
+% \begin{macrocode}
+\socket_new:nn {tagsupport/math/mathml/write/prepare}{0}
+% \end{macrocode}
+% \end{socketdecl}
+%
+% \begin{plugdecl}{On}
+% \begin{macrocode}
+\socket_new_plug:nnn{tagsupport/math/mathml/write/prepare}{On}
+ {
+ \str_set:NV\l_@@_tmpa_str\l_@@_content_AF_source_tl
+ \str_replace_all:Nnn\l_@@_tmpa_str{&}{&amp;}
+ \str_replace_all:Nnn\l_@@_tmpa_str{<}{&lt;}
+ \tl_set:Nn \l_@@_mathml_write_before_tl
+ {
+ <div>
+ \iow_newline:
+ <h2>\c_backslash_str mml\c_space_tl \int_use:N \g_@@_math_total_int </h2>
+ \iow_newline:
+ <p>\l_@@_tmpa_str</p>
+ \iow_newline:
+ <p>\l_@@_content_hash_tl </p>
+ \iow_newline:
+ }
+ }
+% \end{macrocode}
+% \end{plugdecl}
+%
+% With luatex we automatically generate mathml with luamml if the package
+% can be loaded and unicode-math is detected.
+% We start the process in the begindocument/end hook
+% so that the reading from a previous compilation can happen before!
+% \begin{macrocode}
+\sys_if_engine_luatex:T
+ {
+ \file_if_exist:nT { luamml.sty }
+ {
+ \RequirePackage { luamml }
+% \end{macrocode}
+% Temporary (!) fixes for endarray
+% \begin{macrocode}
+ \AddToHook{package/array/after}
+ {
+ \cs_set:Npn \endarray
+ {
+ \tbl_crcr:n{endarray}
+ \__luamml_array_save_array:
+ \egroup
+ \UseTaggingSocket{tbl/finalize}
+ \tbl_restore_outer_cell_data:
+ \egroup
+ \mode_if_math:T { \__luamml_array_finalize_array: }
+ \@arrayright
+ \gdef \@preamble {}
+ }
+ \cs_set:Npn \@classz
+ {
+ \@classx
+ \@tempcnta \count@
+ \prepnext@tok
+ \@addtopreamble {
+ \ifcase \@chnum
+ \hfil
+ \hskip 1sp
+ \d@llarbegin
+ \cs_if_eq:NNTF \d@llarbegin \begingroup {
+ \insert@column
+ \d@llarend
+ } {
+ \__luamml_array_init_col:
+ \insert@column
+ \luamml_flag_save:nn {} {mtd}
+ \d@llarend
+ \__luamml_array_finalize_col:w 0~
+ }
+ \do@row@strut
+ \hfil
+ \or
+ \hskip 1sp
+ \d@llarbegin
+ \cs_if_eq:NNTF \d@llarbegin \begingroup {
+ \insert@column
+ \d@llarend
+ } {
+ \__luamml_array_init_col:
+ \insert@column
+ \luamml_flag_save:nn {} {mtd}
+ \d@llarend
+ \__luamml_array_finalize_col:w 1~
+ }
+ \do@row@strut
+ \hfil
+ \or
+ \hfil
+ \hskip 1sp
+ \d@llarbegin
+ \cs_if_eq:NNTF \d@llarbegin \begingroup {
+ \insert@column
+ \d@llarend
+ } {
+ \__luamml_array_init_col:
+ \insert@column
+ \luamml_flag_save:nn {} {mtd}
+ \d@llarend
+ \__luamml_array_finalize_col:w 2~
+ }
+ \do@row@strut
+ \or
+ \setbox \ar@mcellbox \vbox \@startpbox { \@nextchar }
+ \insert@pcolumn
+ \@endpbox
+ \ar@align@mcell
+ \do@row@strut
+ \or
+ \vtop \@startpbox { \@nextchar }
+ \insert@pcolumn
+ \@endpbox
+ \do@row@strut
+ \or
+ \vbox \@startpbox { \@nextchar }
+ \insert@pcolumn
+ \@endpbox
+ \do@row@strut
+ \fi
+ }
+ \prepnext@tok
+ }
+ }
+% \end{macrocode}
%
+% \begin{macrocode}
+ \AddToHook{begindocument/end}
+ {
+ \str_case:on \g__tag_math_luamml_tl
+ {
+ { 1 } {
+ \@@_luamml_activate_write:
+ \msg_note:nnnn { tag }
+ { luamml-status }{ enabled }{ create }
+ }
+ {-1 } {
+ \msg_note:nnnn { tag }
+ { luamml-status }{ disabled }{ not~create }
+ }
+ { 0 }
+ {
+ \@ifpackageloaded { unicode-math }
+ {
+ \@@_luamml_activate_write:
+ \msg_note:nnnn { tag }
+ { luamml-status }{ enabled }{ create }
+ }
+ { \msg_warning:nn { tag }{ unicode-math-missing } }
+ }
+ }
+ }
+ }
+ }
+\msg_new:nnn { tag }{ luamml-status }
+ {
+ luamml~has~been~#1~and~will~#2~an~MathML~file.
+ }
+
+\msg_new:nnn { tag }{ unicode-math-missing }
+ {
+ The~package~unicode-math~is~missing\\
+ luamml~will~not~create~an~MathML~file.\\
+ To~avoid~this~warning~load~unicode-math~\\
+ or~disable~luamml~with~\\
+ \tl_to_str:n{\tagpdfsetup{math/mathml/luamml=false}}\\
+ or~force~luamml~with~\\
+ \tl_to_str:n{\tagpdfsetup{math/mathml/luamml=true}}
+ }
+\cs_new_protected:Npn \@@_luamml_activate_write:
+ {
+% \end{macrocode}
+% to avoid that nothing is written in the first run, we must activate the sockets:
+% \begin{macrocode}
+ \bool_gset_true:N\g__tag_math_mathml_AF_bool
+ \AssignSocketPlug{tagsupport/math/struct/begin}{test-mathml}
+ \AssignSocketPlug{tagsupport/math/struct/end}{test-mathml}
+ \AssignSocketPlug{tagsupport/math/substruct/begin}{single}
+ \AssignSocketPlug{tagsupport/math/substruct/end}{single}
+ \int_set:Nn \l__luamml_pretty_int { 5 }
+ \RegisterFamilyMapping\symsymbols{oms}
+ \RegisterFamilyMapping\symletters{oml}
+ \AssignSocketPlug{tagsupport/math/mathml/write/prepare}{On}
+ \iow_new:N \g_@@_luamml_iow
+ \iow_open:Nn \g_@@_luamml_iow {\c_sys_jobname_str-luamml-mathml.html}
+ \iow_now:Ne \g_@@_luamml_iow { \c_@@_mathml_write_init_tl }
+ \cs_new:Npn \@@_luamml_output_hook:n ##1
+ {
+ \tl_if_empty:NF \l_@@_mathml_write_before_tl
+ {
+ \iow_now:Ne \g_@@_luamml_iow
+ {
+ \l_@@_mathml_write_before_tl
+ ##1
+ \c_@@_mathml_write_after_tl
+ }
+ }
+ }
+ \__luamml_register_output_hook:N \@@_luamml_output_hook:n
+% \end{macrocode}
+% this starts the process and set flag to 3,
+% not really needed, as it is the default but set here for clarity:
+% \begin{macrocode}
+ \luamml_flag_process:
+% \end{macrocode}
+% At the end of the document we must finish and close the file:
+% \begin{macrocode}
+ \AddToHook{enddocument/afterlastpage}
+ {
+ \iow_now:Ne \g_@@_luamml_iow
+ { \c_@@_mathml_write_final_tl }
+ \iow_close:N \g_@@_luamml_iow
+ }
+ }
+% \end{macrocode}
+% And now a key to deactivate luamml
+% \begin{macrocode}
+
+\keys_define:nn { __tag / setup }
+ {
+ math/mathml/luamml .choice: ,
+ math/mathml/luamml/true .code:n = {\tl_gset:Nn \g__tag_math_luamml_tl{1}},
+ math/mathml/luamml/false .code:n = {\tl_gset:Nn \g__tag_math_luamml_tl{-1}},
+ math/mathml/luamml .default:n = true,
+ math/mathml/luamml .usage:n=preamble
+ }
+% \end{macrocode}
% \begin{socketdecl}{tagsupport/math/mathml/write}
% This writes a html-dummy with the hash and the math content.
% This should be optional, so it uses a socket that can be disabled
@@ -700,24 +997,11 @@
% \begin{macrocode}
\socket_new_plug:nnn{tagsupport/math/mathml/write}{On}
{
- \str_set:NV\l_@@_tmpa_str\l_@@_content_AF_source_tl
- \str_replace_all:Nnn\l_@@_tmpa_str{&}{&amp;}
- \str_replace_all:Nnn\l_@@_tmpa_str{<}{&lt;}
\iow_now:Ne \g_@@_writedummy_iow
{
- \iow_newline:
- <div>
- \iow_newline:
- <h2>\c_backslash_str mml\c_space_tl \int_use:N \g_@@_math_total_int </h2>
- \iow_newline:
- <p>\l_@@_tmpa_str</p>
- \iow_newline:
- <p>\l_@@_content_hash_tl </p>
- \iow_newline:
+ \l_@@_mathml_write_before_tl
<math></math>
- \iow_newline:
- </div>
- \iow_newline:
+ \c_@@_mathml_write_after_tl
}
}
% \end{macrocode}
@@ -739,14 +1023,14 @@
}
\iow_now:Ne \g_@@_writedummy_iow
{
- <!DOCTYPE~html>
- \iow_newline:
- <html>
+ \c_@@_mathml_write_init_tl
}
+ \AssignSocketPlug {tagsupport/math/mathml/write/prepare}{On}
\AssignSocketPlug {tagsupport/math/mathml/write}{On}
\AddToHook{enddocument/afterlastpage}
{
- \iow_now:Nn \g_@@_writedummy_iow {</html>}
+ \iow_now:Ne \g_@@_writedummy_iow
+ { \c_@@_mathml_write_final_tl }
\iow_close:N \g_@@_writedummy_iow
}
}
@@ -900,7 +1184,7 @@
% \end{macrocode}
% \end{plugdecl}
%
-% We probably will want to test different tagging receipes.
+% We probably will want to test different tagging recipes.
% \begin{plugdecl}{default}
% \begin{macrocode}
\socket_new_plug:nnn
@@ -1184,6 +1468,7 @@
{
\typeout{WARNING:~mathml~missing~for~hash~\l_@@_content_hash_tl}
}
+ \socket_use:n {tagsupport/math/mathml/write/prepare}
\socket_use:n {tagsupport/math/mathml/write} % write hash if request
\bool_if:NTF\l__tag_math_texsource_AF_bool
{ \tl_set_eq:NN \l_@@_content_AF_source_tmpa_tl \l_@@_content_AF_source_tl }
@@ -1349,48 +1634,60 @@
% \subsection{Content grabbing}
%
% \begin{macro}{\@@_grab_dollar:w}
-% Grab up to a single |$|, for inline math mode, suppressing
-% any processing if the token is \tn{m@th} found in the content.
-%
-% \fmi{what's that test doing?}
-%
-% \car{It is some kind of fix, to avoid the remote
-% possibility that the math is empty, making the code
-% produce an unwanted \texttt{\$\$}.}
-%
-%\car{cf.~the code for this in \cs{@ensuredmath}}
-%
-%\car{It is harmless but unnecessary in the dollardollar grabbing below.}
-%
+% \begin{macro}{\@@_grab_dollar:n}
+% \changes{v0.6c}{2024-08-22}{Correct handling of empty math segments}
+% Top-level function to handle grabbing of inline math mode delimited by
+% |$| tokens. We provide two different ways to do that: a token-by-token
+% one that can be used everywhere, and a fast delimited one that does not
+% work anywhere that the end |$| token may be hidden, most obviously in
+% tabulars. The function here is therefore set up as a variable starting
+% point.
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_grab_dollar:w { \@@_grab_dollar_delim:w }
+% \end{macrocode}
+% After grabbing inline math material, there is again common processing
+% independent of mechanism of collection.
% \begin{macrocode}
-\cs_new_protected:Npn \@@_grab_dollar:w % $
- #1 $
+\cs_new_protected:Npn \@@_grab_dollar:n #1
{
% \end{macrocode}
-% \fmi{what's that test doing?}
+% We need to do processing first as this picks up \enquote{fake} math mode:
+% that information is needed below.
% \begin{macrocode}
- \tl_if_blank:nF {#1}
- {
- \@@_process:nn { math } {#1} % $
+ \@@_process:nn { math } {#1}
% \end{macrocode}
% We do not want math tagging in fakemath or when measuring,
% We also do not want math tagging if tagging has been suspended.
% \begin{macrocode}
- \bool_lazy_or:nnTF
- {\legacy_if_p:n { measuring@ }}
- { \l_@@_fakemath_bool }
- { #1 $ }
+ \bool_lazy_any:nTF
+ {
+ {\legacy_if_p:n { measuring@ }}
+ { \l_@@_fakemath_bool }
+ { \tl_if_blank_p:n {#1} }
+ }
+ {
+ #1 $ % $
+ }
{
\tag_socket_use:n {math/inline/begin} %end P-MC
\tag_socket_use:nn {math/inline/formula/begin}{#1}
- $
+ $ % $
\tag_socket_use:n {math/inline/formula/end}
\tag_socket_use:n {math/inline/end} % restart P-MC
- }
- }
+ }
}
% \end{macrocode}
% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\@@_grab_dollar_delim:w}
+% Grab up to a single |$|, for inline math mode, suppressing
+% any processing if the token is \tn{m@th} found in the content.
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_grab_dollar_delim:w #1 $ % $
+ { \@@_grab_dollar:n {#1} }
+% \end{macrocode}
+% \end{macro}
%
% \begin{macro}{\@@_grab_dollardollar:w}
% And for the classical \TeX{} display structure.
@@ -1403,8 +1700,8 @@
\@@_process:nn { equation* } {#1}
\socket_use:n {tagsupport/math/display/begin}
\socket_use:nn{tagsupport/math/display/formula/begin}{#1}
- $$
}
+ $$
}
% \end{macrocode}
%
@@ -1463,6 +1760,170 @@
% \end{macrocode}
% \end{macro}
%
+% \subsection{Token-by-token inline grabbing}
+%
+% Grabbing inline math token-by-token is more involved. The mechanism here
+% is essentially a simplified version of that originally seen in
+% \pkg{collcell} and refined in \pkg{siunitx}. We make use of the fact that
+% in math mode spaces are ignored, so we have to deal with only \texttt{N}-type
+% tokens and groups. Furthermore, there is no need to look inside groups, so
+% the only special cases are a small selection of \texttt{N}-type tokens.
+%
+% \begin{variable}{\l_@@_grabbed_tl}
+% For collection of the material piecewise.
+% \begin{macrocode}
+\tl_new:N \l_@@_grabbed_tl
+% \end{macrocode}
+% \end{variable}
+%
+% \begin{variable}{\l_@@_grab_env_int}
+% Needed to count up the number of nested environments encountered.
+% \begin{macrocode}
+\int_new:N \l_@@_grab_env_int
+% \end{macrocode}
+% \end{variable}
+%
+% \begin{macro}{\@@_grab_dollar_loop:}
+% \begin{macro}{\@@_grab_loop:}
+% The lead-off here establishes a group: we need that as we will have to
+% be careful in the way \tn{cr} is handled and ensure this is only
+% manipulated whilst grabbing. The main loop is then started.
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_grab_dollar_loop:
+ {
+ \group_begin:
+ \tl_clear:N \l_@@_grabbed_tl
+ \@@_grab_loop:
+ }
+\cs_new_protected:Npn \@@_grab_loop:
+ {
+ \peek_remove_spaces:n
+ {
+ \peek_meaning:NTF \c_group_begin_token
+ { \@@_grab_loop_group:n }
+ { \@@_grab_loop_token:N }
+ }
+ }
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\@@_grab_loop_group:n}
+% \begin{macro}{\@@_grab_loop_store:n}
+% Handling of grabbed groups is pretty easy.
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_grab_loop_group:n #1
+ { \@@_grab_loop_store:n { {#1} } }
+\cs_new_protected:Npn \@@_grab_loop_store:n #1
+ {
+ \tl_put_right:Nn \l_@@_grabbed_tl {#1}
+ \@@_grab_loop:
+ }
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\@@_grab_loop_token:N}
+% \begin{macro}
+% {
+% \@@_grab_loop_$: ,
+% \@@_grab_loop_\\: ,
+% \@@_grab_loop_\begin: ,
+% \@@_grab_loop_\begin : ,
+% \@@_grab_loop_\end: ,
+% \@@_grab_loop_\ignorespaces: ,
+% \@@_grab_loop_\unskip: ,
+% \@@_grab_loop_\textonly@unskip:
+% }
+% Filter out the special cases: for performance reasons, use a hash table
+% approach rather than a loop (\emph{cf.}~\pkg{collcell}). The need to cover
+% \verb*|begin | is that at the start of a cell, \TeX{} will expand \cs{begin}
+% but the \LaTeX{} robust mechanism will mean this yields \verb*|begin |.
+% If\cs{begin} were protected, that would not be needed.
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_grab_loop_token:N #1
+ {
+ \cs_if_exist_use:cF
+ { @@_grab_loop_ \token_to_str:N #1 : }
+ { \@@_grab_loop_store:n {#1} }
+ }
+\cs_new_protected:cpn { @@_grab_loop_ \token_to_str:N $ : }
+ { \@@_grab_loop_end: }
+\cs_new_protected:cpn { @@_grab_loop_ \token_to_str:N \\ : }
+ {
+ \int_compare:nNnTF \l_@@_grab_env_int = 0
+ { \@@_grab_loop_newline: }
+ { \@@_grab_loop_store:n { \\ } }
+ }
+% \end{macrocode}
+% In contrast to \pkg{collcell}, nesting is tracked by counting
+% \cs{begin}/\cs{end} pairs: this is needed in case there is a tabular-like
+% construct containing |\\| inside a cell. As a result, the end-of-tabular
+% can be detected without checking the name argument: if \cs{end} is
+% encountered at nesting level~0, we've hit the end of a cell. In that case,
+% end the row and leave the environment to clean up.
+% \begin{macrocode}
+\cs_new_protected:cpn { @@_grab_loop_ \token_to_str:N \begin : }
+ {
+ \int_incr:N \l_@@_grab_env_int
+ \@@_grab_loop_store:n { \begin }
+ }
+\cs_new_eq:cc { @@_grab_loop_ \token_to_str:N \begin \c_space_tl : }
+ { @@_grab_loop_ \token_to_str:N \begin : }
+\cs_new_protected:cpn { @@_grab_loop_ \token_to_str:N \end : }
+ {
+ \int_compare:nNnTF \l_@@_grab_env_int = 0
+ {
+ \@@_grab_loop_newline:
+ \end
+ }
+ {
+ \int_decr:N \l_@@_grab_env_int
+ \@@_grab_loop_store:n { \end }
+ }
+ }
+\tl_map_inline:nn { \ignorespaces \unskip \textonly@unskip }
+ {
+ \cs_new_protected:cpn { @@_grab_loop_ \token_to_str:N #1 : }
+ { \@@_grab_loop: }
+ }
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\@@_grab_loop_newline:}
+% To allow collection of tokens in the part of the \tn{halign} template after
+% |#|, we need \TeX{} to see the primitive with the loop token in the right
+% place. That is done by re-defining \tn{cr} at present. Ideally there would
+% be a socket in the definition of \texttt{tabular}, etc., to handle this:
+% there is also the need to examine in interaction with \pkg{longtable}, which
+% also redefines \tn{cr}.
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_grab_loop_newline:
+ {
+ \if_false: { \fi:
+ \cs_set_protected:Npn \cr
+ {
+ \@@_grab_loop:
+ \tex_cr:D
+ }
+ \if_false: } \fi:
+ \\
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@@_grab_loop_end:}
+% Clean up and pass on.
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_grab_loop_end:
+ {
+ \exp_args:NNV \group_end:
+ \@@_grab_dollar:n \l_@@_grabbed_tl
+ }
+% \end{macrocode}
+% \end{macro}
+%
% \subsection{Marking math environments}
%
% A general mechanism for math mode environments that do not grab their
@@ -1861,6 +2322,10 @@
\bool_set_false:N \l_@@_collected_bool
\col@sep\tabcolsep \let\d@llarbegin\begingroup
\let\d@llarend\endgroup
+% \end{macrocode}
+% A proper switching mechanism is needed: for the present, do directly.
+% \begin{macrocode}
+ \cs_set_protected:Npn \@@_grab_dollar:w { \@@_grab_dollar_loop: }
\@tabarray}
}
% \end{macrocode}
diff --git a/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-mathtools.dtx b/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-mathtools.dtx
index aa27cbf01d9..79eee7aab74 100644
--- a/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-mathtools.dtx
+++ b/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-mathtools.dtx
@@ -23,7 +23,7 @@
\EnableCrossrefs
\CodelineIndex
\begin{document}
- \DocInput{latex-lab-amsmath.dtx}
+ \DocInput{latex-lab-mathtools.dtx}
\end{document}
%</driver>
%
@@ -66,7 +66,7 @@
% \subsection{File declaration}
% \begin{macrocode}
\ProvidesFile{latex-lab-mathtools.ltx}
- [2023-01-05 v0.1a mathtools adaptions]
+ [2024-07-13 v0.1a mathtools adaptions]
% \end{macrocode}
% \subsection{Tagpdf support}
% To make the code independent from tagging being loaded and active
diff --git a/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-minipage.dtx b/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-minipage.dtx
index ffbe5357e76..f5a324fa5e8 100644
--- a/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-minipage.dtx
+++ b/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-minipage.dtx
@@ -18,8 +18,8 @@
%
% for those people who are interested or want to report an issue.
%
-\def\ltlabminipagedate{2023-10-30}
-\def\ltlabminipageversion{0.81c}
+\def\ltlabminipagedate{2024-08-08}
+\def\ltlabminipageversion{0.81d}
%<*driver>
\documentclass{l3doc}
\EnableCrossrefs
@@ -120,12 +120,18 @@
% \end{macrocode}
% insert the socket
% \begin{macrocode}
- \socket_use:n{tagsupport/minipage/before}% new
+ \UseTaggingSocket{minipage/before}% new
\setbox\@tempboxa\vbox\bgroup
\color@begingroup
\hsize\@tempdima
\textwidth\hsize \columnwidth\hsize
\@parboxrestore
+% \end{macrocode}
+% minipages are perhaps used in environments where the tagging of paragraphs
+% has been altered. So we try to restore this. TODO: this should
+% perhaps be done in \cs{@parboxrestore} directly.
+% \begin{macrocode}
+ \UseTaggingSocket{para/restore}
\def\@mpfn{mpfootnote}\def\thempfn{\thempfootnote}\c@mpfootnote\z@
\socket_assign_plug:nn{fntext/process}{mp}%
\let\@listdepth\@mplistdepth \@mplistdepth\z@
@@ -153,7 +159,7 @@
\tag_stop:n{minipage}
\expandafter\@iiiparbox\@mpargs{\unvbox\@tempboxa}%
\tag_start:n{minipage}
- \socket_use:n{tagsupport/minipage/after} %new end ...
+ \UseTaggingSocket{minipage/after} %new end ...
}
% \end{macrocode}
%
@@ -164,8 +170,15 @@
\leavevmode
\@pboxswfalse
\setlength\@tempdima{#4}%
- \socket_use:n{tagsupport/parbox/before}
- \@begin@tempboxa\vbox{\hsize\@tempdima\@parboxrestore#5\@@par}%
+ \UseTaggingSocket{parbox/before}
+ \@begin@tempboxa\vbox{\hsize\@tempdima\@parboxrestore
+% \end{macrocode}
+% parbox are perhaps used in environments where the tagging of paragraphs
+% has been altered. So we try to restore this. TODO: this should
+% perhaps be done in \cs{@parboxrestore} directly.
+% \begin{macrocode}
+ \UseTaggingSocket{para/restore}
+ #5\@@par}%
\ifx\relax#2\else
\setlength\@tempdimb{#2}%
\edef\@parboxto{to\the\@tempdimb}%
@@ -179,7 +192,7 @@
\csname bm@#3\endcsname}%
\if@pboxsw \m@th$\fi
\@end@tempboxa%
- \socket_use:n{tagsupport/parbox/after}
+ \UseTaggingSocket{parbox/after}
}
% \end{macrocode}
%
@@ -191,9 +204,11 @@
\socket_new_plug:nnn{tagsupport/minipage/before}{tag/dflt}
{
% \end{macrocode}
-% As there was a \cs{leavevmode} before that is a P/text open that we have to close.
+% As there was a \cs{leavevmode} before that is a P/text open that we have to close
+% if para tagging is active:
% \begin{macrocode}
- \tag_mc_end_push:\tag_struct_end:
+ \tag_mc_end_push:
+ \bool_if:NT \l__tag_para_bool {\tag_struct_end:}
% \end{macrocode}
% TODO: the P can be further up, we need a proper method to test and handle this.
% \begin{macrocode}
@@ -203,13 +218,25 @@
% similar for the other sockets:
% \begin{macrocode}
\socket_new_plug:nnn{tagsupport/minipage/after}{tag/dflt}
- {\tag_struct_end:\tag_struct_begin:n{tag=\l__tag_para_tag_tl}\tag_mc_begin_pop:n{}}
+ {
+ \tag_struct_end:
+ \bool_if:NT \l__tag_para_bool {\tag_struct_begin:n{tag=\l__tag_para_tag_tl}}
+ \tag_mc_begin_pop:n{}
+ }
\socket_new_plug:nnn{tagsupport/parbox/before}{tag/dflt}
- {\tag_mc_end_push:\tag_struct_end:\tag_struct_begin:n{tag=\l__ltboxes_tag_tl}}
+ {
+ \tag_mc_end_push:
+ \bool_if:NT \l__tag_para_bool {\tag_struct_end:}
+ \tag_struct_begin:n{tag=\l__ltboxes_tag_tl}
+ }
\socket_new_plug:nnn{tagsupport/parbox/after}{tag/dflt}
- {\tag_struct_end:\tag_struct_begin:n{tag=\l__tag_para_tag_tl}\tag_mc_begin_pop:n{}}
+ {
+ \tag_struct_end:
+ \bool_if:NT \l__tag_para_bool {\tag_struct_begin:n{tag=\l__tag_para_tag_tl}}
+ \tag_mc_begin_pop:n{}
+ }
% \end{macrocode}
% Activate the default tagging plug
% \begin{macrocode}
diff --git a/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-namespace.dtx b/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-namespace.dtx
index cfc06c7b093..d76dd8d4893 100644
--- a/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-namespace.dtx
+++ b/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-namespace.dtx
@@ -26,7 +26,7 @@
% \fi
% \title{Prototype reimplementation of \LaTeXe{}'s role mapping}
% \author{\LaTeX{} Project, initial implementation Ulrike Fischer}
-% \date{v0.8b 2024-03-24}
+% \date{v0.8b 2024-07-05}
%
% \maketitle
%
@@ -37,7 +37,7 @@
% \section{Introduction}
%
% This short file collects tag names from the \LaTeX{} namespace and their role mapping used
-% in the latex-lab files. The names and the roles are not necessarly the final ones!
+% in the latex-lab files. The names and the roles are not necessarily the final ones!
%
% Later settings of the same tag overwrite previous settings.
% The syntax of a line is a list of three strings ending with commas:
diff --git a/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-sec.dtx b/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-sec.dtx
index f3786c2ddb8..231ed1a8644 100644
--- a/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-sec.dtx
+++ b/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-sec.dtx
@@ -16,7 +16,7 @@
%
% for those people who are interested or want to report an issue.
%
-\def\ltlabsecdate{2024-02-12}
+\def\ltlabsecdate{2024-07-05}
\def\ltlabsecversion{0.84c}
%<*driver>
\documentclass[kernel]{l3doc}
@@ -121,7 +121,7 @@
% commands must be at the right grouping level.
% \end{itemize}
%
-% \subsection{Funktions and keys}
+% \subsection{Functions and keys}
%
% \begin{function}{\tag_tool:n,\tagtool}
%
@@ -138,7 +138,7 @@
% to allow e.g. to put an epigraph or similar in front.
%
% \item The number in \cs{part} and \cs{chapter} is currently not correctly
-% tagged as a \texttt{Lbl} as this requires to redefine the internal (class dependant)
+% tagged as a \texttt{Lbl} as this requires to redefine the internal (class dependent)
% commands too.
%
% \end{itemize}
@@ -376,7 +376,7 @@
\tag_struct_begin:n{tag=part,title=#1}
% \end{macrocode}
% We remap here the text-unit from the paragraph to NonStruct.
-% It would be better to suppress it completly as with the other
+% It would be better to suppress it completely as with the other
% sectioning commands, but this would require to redefine \cs{@spart}
% and \cs{@part}, as there is the grouping, and these commands are
% all slightly different in the standard classes. So this is delayed
diff --git a/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-table.dtx b/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-table.dtx
index 38596478aeb..be0c05a4e18 100644
--- a/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-table.dtx
+++ b/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-table.dtx
@@ -16,8 +16,8 @@
%
% for those people who are interested or want to report an issue.
%
-\def\ltlabtbldate{2024-05-25}
-\def\ltlabtblversion{0.85i}
+\def\ltlabtbldate{2024-08-10}
+\def\ltlabtblversion{0.85m}
%<*driver>
\documentclass{l3doc}
\EnableCrossrefs
@@ -100,6 +100,7 @@
% support for the tagging of tables. A list of the known limitations
% is shown below.
%
+% \subsection{Loading}
% The module is not loaded automatically (i.e., not yet integrated
% into any \texttt{phase-XX}) and by itself it doesn't activate
% tagging. For experimenting with table tagging it is therefore best
@@ -113,7 +114,26 @@
% It will then automatically tag all table environments it already supports with
% the exception of tables in the header and footer of the page (where tagging is disabled).
% Such tables can be nested.
+%
+% Inside cells the automatic tagging of paragraphs is disabled with the exception of
+% p/m/b-type cells.
%
+% Rows do not need to contain a full number of \&, missing cells are automatically
+% added with an empty TD-structure.
+%
+% You should not insert meaningful text with \verb+!{...}+ or \verb+@{...}+ or \cs{noalign}
+% between the rows or columns of the table.
+% With pdflatex such text will be unmarked, with lualatex it will be marked as artifact.
+% Either case means that it will be currently ignored in the
+% structure.\footnote{While it is theoretically possible
+% to collect such text and move it into a structure it would require manual markup
+% from the author to clarify where this text belongs too.}
+%
+% As mentioned below the \pkg{colortbl} doesn't work fully with the tagging,
+% but when it does, colors inside the table are currently ignored. If such a color
+% has a semantic meaning (like \enquote{important value}) this meaning will be lost.
+%
+% \subsection{Untagged and presentation tables}
% If a table should not be tagged as table, for example because it is merely used
% as a layout to ensure that the content is properly aligned
% or because it is a not yet (fully) supported table structure,
@@ -130,41 +150,43 @@
% The key should currently only be used in a group as there is no key (yet) to reset to the default
% tag names.
%
-% Inside cells the automatic tagging of paragraphs is disabled with the exception of
-% p/m/b-type cells.
-%
-% Rows do not need to contain a full number of \&, missing cells are automatically
-% added with an empty TD-structure.
-%
+% \subsection{Header rows and columns}
% There is some basic support\footnote{This is not meant to be the
% final interface, though.} for headers. With\footnote{The old key name \texttt{table-header-rows} still
% works but is deprecated.}
% \begin{quote}
% \verb|\tagpdfsetup{table/header-rows={|\meta{list of row numbers}\verb|}|
+% \verb|\tagpdfsetup{table/header-columns={|\meta{list of column numbers}\verb|}|
% \end{quote}
% you can
-% declare which (absolute) row numbers should be tagged as header rows.
-% It applies to all tables until it is changed to a different list of row numbers or undone by setting
-% the key to \meta{empty}.
-% A row number can be
-% negative, then the counting starts from the end of the table. There is no support
-% for header columns yet. In a \env{longtable} the code will currently use the \cs{endhead} or
+% declare which (absolute) row and column numbers should be tagged as header rows and header columns.
+% It applies to all tables until it is changed to a different list of row or
+% columns numbers or undone by setting
+% the keys to \meta{empty}.
+% A row or column number can be
+% negative, then the counting starts from the end of the table.
+% In a \env{longtable} the code will currently use the \cs{endhead} or
% \cs{endfirsthead} rows as header if one of these commands has been
% used and in that case the code
% ignores a \texttt{table/header-rows} setting.
%
-% You should not insert meaningful text with \verb+!{...}+ or \verb+@{...}+ or \cs{noalign}
-% between the rows or columns of the table.
-% With pdflatex such text will be unmarked, with lualatex it will be marked as artifact.
-% Either case means that it will be currently ignored in the
-% structure.\footnote{While it is theoretically possible
-% to collect such text and move it into a structure it would require manual markup
-% from the author to clarify where this text belongs too.}
+% \subsection{Spanning of cells}
%
-% As mentioned below the \pkg{colortbl} doesn't yet work properly with the tagging,
-% but once it does, then colors inside the table will probably be
-% simply ignored (at least initially). If such a color
-% has a semantic meaning (like \enquote{important value}) this meaning will be lost.
+% \cs{multicolumn} is supported out of the box and will create a structure with a
+% suitable \texttt{ColSpan} attribute\footnote{The code uses actually an attribute \emph{class}.
+% The validator PAC doesn't handle this correctly currently and complains about a missing attribute.}
+%
+% For cells spanning rows some preliminary support exists\footnote{The interface is bound to change!}:
+% If you add
+% \begin{quote}
+% \verb|\tagpdfsetup{table/multirow={|\meta{number of rows}\verb|}|
+% \end{quote}
+% to a cell the code will add the suitable \texttt{RowSpan} attribute and suppress the tagging of affected
+% cells in the following rows. This will also work if the current cell is a \cs{multicolumn}, then
+% the cell will span both rows and columns. It is the duty of the author to
+% ensure that all cells below and covered by a \texttt{RowSpan} are empty!
+% The code neither checks that nor does
+% it tries to suppress content.
%
% Feedback and problems with the code can be reported at
% \url{https://github.com/latex3/tagging-project} either in form of
@@ -183,19 +205,19 @@
% \item the \env{array} environment is assumed to be part of math and tagging as a table is disabled for
% it.
%
-% \item Row spans are not yet supported (and the \pkg{multirow} package is untested).
+% \item Row spans can only be added manually (the \pkg{multirow} package is untested).
%
-% \item The \pkg{colortbl} package breaks tagging if there are nested tables. It also breaks
-% the filling up of incomplete rows.
+% \item The \pkg{colortbl} package breaks tagging if there are nested tables.
%
% \item The \pkg{tabularray} package use a completed different
% method to create tables and will not be supported by this code.
%
% \item The \pkg{nicematrix} package is currently incompatible.
%
-% \item Most other packages related to tables in \LaTeX{} are not yet tested,
+% \item Most other packages related to tables in \LaTeX{} are not fully tested,
% that includes packages that change rules like \pkg{booktabs}, \pkg{hhline},
-% \pkg{arydshln}, \pkg{hvdashln}.
+% \pkg{arydshln}, \pkg{hvdashln}. Some problems have been resolved, either
+% in the packages or through a firstaid which can be loaded the \verb+testphase=firstaid+.
%
% \item \env{longtable} currently only works with lualatex.
% With other engines it breaks as its output
@@ -208,9 +230,9 @@
% the tagging of the table must be deactivated with \verb|\tagpdfsetup{table/tagging=false}|
% or \verb|\tagpdfsetup{table/tagging=presentation}|.
%
-% \item Only simple header rows are currently supported. Columns and complex headers with
+% \item Only simple header rows and columns are currently supported. Complex headers with
% subheaders will be handled later as that needs some syntax changes. Tables
-% with more than one header row are probably not pdf/UA as the headers array in
+% with more than one header row or column are probably not pdf/UA as the headers array in
% the cells is missing.
%
% \item A \pkg{longtable} \cs{caption} is currently simply formatted as a multicolumn and
@@ -259,9 +281,6 @@
%
% \item Longtable captions should be properly supported.
%
-% \item Handle p-cells better. para-tagging should probably be enabled,
-% but Part can't be a child of TD, so this should probably be changed to Div here.
-% Also there is a stray MC somewhere.
%
% \item More packages must be tested.
% \end{itemize}
@@ -292,8 +311,8 @@
% ,\l_@@_cellattribute_tl
% ,\l_@@_rowattribute_tl
% ,\l_@@_tmpa_clist
-% ,\l_@@_tmpa_seq
% ,\l_@@_tmpa_tl
+% ,\l_@@_tmpa_str
% }
% This is for the celltag, e.g. TD or TH:
% \begin{macrocode}
@@ -319,10 +338,16 @@
\tl_new:N \l_@@_rowattribute_tl
\tl_set:Nn \l_@@_rowattribute_tl {}
% \end{macrocode}
+% Variable to store cell info like which cell must be skipped when tagging multirows.
+% \begin{macrocode}
+\prop_new:N\g_@@_untagged_cells_prop
+\prop_new:N\l_@@_saved_untagged_cells_prop
+% \end{macrocode}
% Temp variables
% \begin{macrocode}
\clist_new:N \l_@@_tmpa_clist
\tl_new:N \l_@@_tmpa_tl
+\str_new:N \l_@@_tmpa_str
% \end{macrocode}
% \end{macro}
%
@@ -330,7 +355,41 @@
%
%
% This are the standard plugs for tagging of cells and rows.
-%
+%
+% The following two sockets are defined in lttagging, but we check
+% for their existence until the release 11/2024.
+% \begin{macrocode}
+\str_if_exist:cF { l__socket_tagsupport/tbl/init/celldata_plug_str }
+ {
+ \NewSocket{tagsupport/tbl/init/celldata}{0}
+ \NewSocket{tagsupport/tbl/restore/celldata}{0}
+ }
+% \end{macrocode}
+% \begin{plugdecl}{default}
+% This socket is used inside \cs{tbl_init_cell_data_for_table} for the
+% case that this a nested table in a cell.
+% \begin{macrocode}
+\NewSocketPlug{tagsupport/tbl/init/celldata}{default}
+ {
+ \prop_set_eq:NN\l_@@_saved_untagged_cells_prop \g_@@_untagged_cells_prop
+ \prop_gclear:N \g_@@_untagged_cells_prop
+ }
+\AssignSocketPlug{tagsupport/tbl/init/celldata}{default}
+% \end{macrocode}
+% \end{plugdecl}
+
+% \begin{plugdecl}{default}
+% This socket is used inside \cs{tbl_restore_outer_cell_data:} and restores
+% values when a nested table is ended.
+% \begin{macrocode}
+\NewSocketPlug{tagsupport/tbl/restore/celldata}{default}
+ {
+ \prop_gset_eq:NN\g_@@_untagged_cells_prop \l_@@_saved_untagged_cells_prop
+ }
+\AssignSocketPlug{tagsupport/tbl/restore/celldata}{default}
+% \end{macrocode}
+% \end{plugdecl}
+%
% \begin{plugdecl}{TD}
% \begin{macrocode}
\NewSocketPlug{tagsupport/tbl/cell/begin}{TD}
@@ -340,21 +399,44 @@
% always even if the noop plug is in force this needs a different solution.
% \begin{macrocode}
\@@_show_curr_cell_data:
- \tag_struct_begin:n
+% \end{macrocode}
+% We test if the cell should be tagged at all.
+% \begin{macrocode}
+ \@@_if_tag_cell:nnT {\g_@@_row_int } { \g_@@_col_int }
{
- tag =\l_@@_celltag_tl,
- attribute-class =\l_@@_cellattribute_tl
- }
- \seq_gput_right:Ne \g_@@_struct_cur_seq { \tag_get:n {struct_num} }
+% \end{macrocode}
+% this sets row headers
+% \begin{macrocode}
+ \clist_if_in:NVT \l_@@_header_columns_clist\g_@@_col_int
+ {
+ \tl_set:Nn \l_@@_celltag_tl {TH}
+ \tl_set:Ne \l_@@_cellattribute_tl {\l_@@_cellattribute_tl,TH-row}
+ }
+% \end{macrocode}
+% Here we handle negative value for row headers:
+% \begin{macrocode}
+ \tl_set:Ne \l_@@_tmpa_tl {\int_eval:n { \g_@@_col_int - 1 - \g_@@_table_cols_tl }}
+ \clist_if_in:NoT \l_@@_header_columns_clist { \l_@@_tmpa_tl }
+ {
+ \tl_set:Nn \l_@@_celltag_tl {TH}
+ \tl_set:Ne \l_@@_cellattribute_tl {\l_@@_cellattribute_tl,TH-row}
+ }
+ \tag_struct_begin:n
+ {
+ tag =\l_@@_celltag_tl,
+ attribute-class ={\l_@@_cellattribute_tl}
+ }
+ \seq_gput_right:Ne \g_@@_struct_cur_seq { \tag_get:n {struct_num} }
% \end{macrocode}
% we store the cells of multicolumns as negative number. This allow to skip them
% or to use them as needed.
% \begin{macrocode}
- \int_step_inline:nn { \g_@@_span_tl - 1 }
- {
- \seq_gput_right:Ne \g_@@_struct_cur_seq { -\tag_get:n {struct_num} }
- }
- \tag_mc_begin:n{}
+ \int_step_inline:nn { \g_@@_span_tl - 1 }
+ {
+ \seq_gput_right:Ne \g_@@_struct_cur_seq { -\tag_get:n {struct_num} }
+ }
+ \tag_mc_begin:n{}
+ }
}
% \end{macrocode}
% \end{plugdecl}
@@ -363,8 +445,11 @@
% \begin{macrocode}
\NewSocketPlug{tagsupport/tbl/cell/end}{TD}
{
- \tag_mc_end:
- \tag_struct_end:
+ \@@_if_tag_cell:nnT {\g__tbl_row_int } { \g__tbl_col_int }
+ {
+ \tag_mc_end:
+ \tag_struct_end:
+ }
}
% \end{macrocode}
% \end{plugdecl}
@@ -376,18 +461,26 @@
\NewSocketPlug{tagsupport/tbl/pcell/begin}{TDpbox}
{
\@@_show_curr_cell_data:
- \tag_struct_begin:n
+ \@@_if_tag_cell:nnT {\g__tbl_row_int } { \g__tbl_col_int }
{
- tag =\l__tbl_pcelltag_tl,
- attribute-class =\l__tbl_cellattribute_tl
- }
- \seq_gput_right:Ne \g__tbl_struct_cur_seq { \tag_get:n {struct_num} }
- \int_step_inline:nn { \g__tbl_span_tl - 1 }
- {
- \seq_gput_right:Ne \g__tbl_struct_cur_seq { -\tag_get:n {struct_num} }
- }
- \tagpdfparaOn
- \tl_set:Nn \l__tag_para_main_tag_tl {Div}
+ \clist_if_in:NVT \l_@@_header_columns_clist\g_@@_col_int
+ {
+ \tl_set:Nn \l_@@_celltag_tl {TH}
+ \tl_set:Ne \l_@@_cellattribute_tl {\l_@@_cellattribute_tl,TH-row}
+ }
+ \tag_struct_begin:n
+ {
+ tag =\l_@@_pcelltag_tl,
+ attribute-class ={\l_@@_cellattribute_tl}
+ }
+ \seq_gput_right:Ne \g_@@_struct_cur_seq { \tag_get:n {struct_num} }
+ \int_step_inline:nn { \g_@@_span_tl - 1 }
+ {
+ \seq_gput_right:Ne \g_@@_struct_cur_seq { -\tag_get:n {struct_num} }
+ }
+ \tagpdfparaOn
+ \tl_set:Nn \l__tag_para_main_tag_tl {Div}
+ }
}
% \end{macrocode}
% \end{plugdecl}
@@ -396,7 +489,12 @@
% \begin{macrocode}
\NewSocketPlug{tagsupport/tbl/pcell/end}{TDpbox}
{
- \tag_struct_end:
+ \@@_if_tag_cell:nnT {\g_@@_row_int } { \g_@@_col_int }
+ {
+ \tag_struct_end:
+ \legacy_if:nT {@endpe}{\par}
+ \mode_if_vertical:T{ \tagpdfparaOff }
+ }
}
% \end{macrocode}
% \end{plugdecl}
@@ -432,7 +530,7 @@
{
\@@_trace:n
{==>~
- stucture~stored~for~row~\int_use:N\g_@@_row_int :~
+ structure~stored~for~row~\int_use:N\g_@@_row_int :~
\seq_use:Nn \g_@@_struct_cur_seq {,}
}
}
@@ -447,21 +545,49 @@
% normal tables which can also be used inline and nested and
% \enquote{vmode} tables like longtable.
%
+% \begin{macro}{\l__tag_block_flattened_level_int}
+% Count the levels of nested blockenvs starting with the first that
+% is \enquote{flattened}. The counter is defined in lttagging.dtx,
+% but until the next release 11/24 we set it up here too so that we can
+% use it in the following socket
+% \begin{macrocode}
+\int_if_exist:NF \l__tag_block_flattened_level_int
+ {
+ \int_new:N \l__tag_block_flattened_level_int
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{plugdecl}{Table}
+% Inside a TD or TR Part is not allowed as child. For structures that restore
+% paragraph settings we therefore need a special plug that adjust the settings.
+% Currently we set the para main tag to Div. This leads to double Div-structures
+% but flattening the paragraph doesn't work, it errors if there is a list inside.
+% \begin{macrocode}
+\NewSocketPlug{tagsupport/para/restore}{Table}
+ {
+ \tl_set:Nn \l__tag_para_main_tag_tl {Div}
+ \tl_set_eq:NN \l__tag_para_tag_tl\l__tag_para_tag_default_tl
+ \bool_set_true:N \l__tag_para_bool
+ \bool_set_false:N \l__tag_para_flattened_bool
+ \int_zero:N \l__tag_block_flattened_level_int
+ }
+% \end{macrocode}
+% \end{plugdecl}
+%
% \begin{plugdecl}{Table}
% Inside a table we currently only disable paratagging. We assume
-% that these sockets are in an environment group, so there is no
+% that these sockets are called in a group, so there is no
% need to reenable paratagging.
% \begin{macrocode}
\NewSocketPlug{tagsupport/tbl/init}{Table}
{
- \tag_if_active:T
- {
- \bool_set_false:N \l__tag_para_bool
+ \bool_set_false:N \l__tag_para_bool
+ \AssignSocketPlug{tagsupport/para/restore}{Table}
% \end{macrocode}
% We also initialize the structure data variables a this point.
% \begin{macrocode}
- \@@_init_struct_data:
- }
+ \@@_init_struct_data:
}
% \end{macrocode}
% \end{plugdecl}
@@ -573,7 +699,7 @@
\prop_if_exist:cT
{ g__tag_struct_ \l_@@_tmpa_tl _prop }
{
- \exp_args:No \__tag_struct_prop_gput:nnn {\l_@@_tmpa_tl} {S}{/Artifact}
+ \__tag_struct_prop_gput:onn { \l_@@_tmpa_tl } {S}{/Artifact}
}
}
}
@@ -664,7 +790,7 @@
\prop_if_exist:cT
{ g__tag_struct_ \l_@@_tmpa_tl _prop }
{
- \exp_args:No\__tag_struct_prop_gput:nnn {\l_@@_tmpa_tl} {S}{/Artifact}
+ \__tag_struct_prop_gput:onn {\l_@@_tmpa_tl} {S}{/Artifact}
}
}
}
@@ -711,7 +837,7 @@
\tag_mc_end_push:
% \end{macrocode}
% Close the P-chunk. This assumes that para-tagging is active.
-% For nested tables that is not necessarly true, so we test for it.
+% For nested tables that is not necessarily true, so we test for it.
% \begin{macrocode}
\bool_lazy_and:nnT
{ \bool_if_exist_p:N \l__tag_para_bool } { \l__tag_para_bool }
@@ -729,7 +855,7 @@
\tag_struct_end:
% \end{macrocode}
% reopen the P-chunk. This assumes that para-tagging is active.
-% For nested tables that is not necessarly true, so we test for it.
+% For nested tables that is not necessarily true, so we test for it.
% \begin{macrocode}
\bool_lazy_and:nnT
{ \bool_if_exist_p:N \l__tag_para_bool } { \l__tag_para_bool }
@@ -778,15 +904,32 @@
{/O /Table /ColSpan~\int_eval:n{#1}}
}
\tl_set:Ne \l_@@_cellattribute_tl
- {colspan-\int_eval:n{#1}}
+ {\l_@@_cellattribute_tl,colspan-\int_eval:n{#1}}
}
}
% \end{macrocode}
-% TODO: move to tagpdf
+% \end{plugdecl}
+%
+%
+%
+%
+% \begin{plugdecl}{code}
+% The sockets will be in lttagging.dtx, but that may only happen in
+% the next main release, so for now we test if they are in the
+% format and if not define them now.
+% \begin{macrocode}
+\str_if_exist:cF { l__socket_tagsupport/tbl/leaders/end_plug_str }
+ {
+ \NewSocket{tagsupport/tbl/leaders/begin}{0}
+ \NewSocket{tagsupport/tbl/leaders/end}{0}
+ }
+% \end{macrocode}
+%
% \begin{macrocode}
-\tag_if_active:T
- { \cs_generate_variant:Nn \__tag_attr_new_entry:nn {ee} }
-
+\NewSocketPlug{tagsupport/tbl/leaders/begin}{code}
+ { \tag_mc_begin:n{artifact} }
+\NewSocketPlug{tagsupport/tbl/leaders/end}{code}
+ { \tag_mc_end: }
% \end{macrocode}
% \end{plugdecl}
%
@@ -810,8 +953,7 @@
% \subsection{Interfaces to tagging}
%
% \subsubsection{Tagging helper commands}
-%
-%
+
% \subsubsection{Disabling/enabling}
%
% For now we have only the option true/false but this will probably be extended
@@ -839,6 +981,8 @@
\AssignSocketPlug{tagsupport/tbl/vmode/begin}{noop}
\AssignSocketPlug{tagsupport/tbl/vmode/end}{noop}
\AssignSocketPlug{tagsupport/tbl/colspan}{noop}
+ \AssignSocketPlug{tagsupport/tbl/leaders/begin}{noop}
+ \AssignSocketPlug{tagsupport/tbl/leaders/end}{noop}
}
% \end{macrocode}
% \end{macro}
@@ -866,6 +1010,8 @@
\AssignSocketPlug{tagsupport/tbl/vmode/begin}{Table}
\AssignSocketPlug{tagsupport/tbl/vmode/end}{Table}
\AssignSocketPlug{tagsupport/tbl/colspan}{code}
+ \AssignSocketPlug{tagsupport/tbl/leaders/begin}{code}
+ \AssignSocketPlug{tagsupport/tbl/leaders/end}{code}
}
% \end{macrocode}
% \end{macro}
@@ -886,14 +1032,15 @@
\tl_set:Nn\l_@@_pcelltag_tl {NonStruct}
\tl_set:Nn\l_@@_celltag_tl {text}
\tl_set:Nn\l_@@_tabletag_tl {Div}
- \clist_clear:N \l_@@_header_rows_clist
+ \clist_clear:N \l_@@_header_rows_clist
+ \clist_clear:N \l_@@_header_columns_clist
},
table/tagging .default:n = true,
table/tagging .initial:n = true
}
% \end{macrocode}
% This are the old key names kept for now for
-% compability. They will got at some time.
+% compatibility. They will got at some time.
% \begin{macrocode}
\keys_define:nn { __tag / setup }
{
@@ -955,11 +1102,12 @@
% \end{macrocode}
%
-% \begin{variable}{\l_@@_header_rows_clist}
-% This holds the numbers of the header rows. Negative numbers are
+% \begin{variable}{\l_@@_header_rows_clist,\l_@@_header_columns_clist}
+% This holds the numbers of the header rows and columns. Negative numbers are
% possible and count from the last column backwards.
% \begin{macrocode}
\clist_new:N \l_@@_header_rows_clist
+\clist_new:N \l_@@_header_columns_clist
% \end{macrocode}
% \end{variable}
%
@@ -982,14 +1130,26 @@
{
\__tag_struct_prop_gput:nnn{ ####1 }{S}{/TH}
% \end{macrocode}
-% This need refinement once row headers (and perhaps other attributes)
-% are used too, but for now it should be ok.
+% This sets the scope class. If the header has already a row attribute
+% we replace by TH-both.
% \begin{macrocode}
\prop_get:cnNTF
{ g__tag_struct_####1_prop }
{ C }
\l_@@_tmpa_tl
- {\__tag_struct_prop_gput:nne{ ####1 }{C}{[/TH-col~\l_@@_tmpa_tl]} }
+ {
+ \str_set:Ne \l_@@_tmpa_str {\l_@@_tmpa_tl}
+ \str_remove_once:Nn \l_@@_tmpa_str {[}
+ \str_remove_once:Nn \l_@@_tmpa_str {]}
+ \str_if_in:NnTF\l_@@_tmpa_str{/TH-row}
+ {
+ \str_replace_once:Nnn \l_@@_tmpa_str {/TH-row}{/TH-both}
+ \__tag_struct_prop_gput:nne{ ####1 }{C}{[\l_@@_tmpa_str]}
+ }
+ {
+ \__tag_struct_prop_gput:nne{ ####1 }{C}{[/TH-col~\l_@@_tmpa_str]}
+ }
+ }
{\__tag_struct_prop_gput:nnn{ ####1 }{C}{/TH-col}}
}
}
@@ -1004,6 +1164,7 @@
\keys_define:nn { __tag / setup }
{
table/header-rows .clist_set:N = \l_@@_header_rows_clist,
+ table/header-columns .clist_set:N = \l_@@_header_columns_clist,
% \end{macrocode}
% obsolete older name:
% \begin{macrocode}
@@ -1011,8 +1172,114 @@
}
% \end{macrocode}
%
+% \subsection{Multirow support}
+%
+% \begin{macro}{\@@_multirow:n}
+% This command makes the current cell into a multirow cell:
+% it creates, if needed, an RowSpan-attribute, adds it to the attributes
+% of the cell structure, and marks all following cells spanned by the multirow
+% as cells that should not be tagged. The argument is the number of spanned row
+% (including the current row).
+% \begin{macrocode}
+\cs_if_exist:NT \__tag_struct_prop_gput:nnn
+ {
+ \cs_generate_variant:Nn \__tag_struct_prop_gput:nnn {one}
+ }
+\cs_new_protected:Npn \@@_multirow:n #1
+ {
+% \end{macrocode}
+% Create an attribute if needed:
+% \begin{macrocode}
+ \prop_get:NeNF \g__tag_attr_entries_prop
+ {rowspan-\int_eval:n{#1}}
+ \l_@@_tmpa_tl
+ {
+ \__tag_attr_new_entry:ee
+ {rowspan-\int_eval:n{#1}}
+ {/O /Table /RowSpan~\int_eval:n{#1}}
+ }
+% \end{macrocode}
+% ensure that the attribute is marked as used:
+% \begin{macrocode}
+ \seq_gput_left:Ne\g__tag_attr_class_used_seq
+ {\pdf_name_from_unicode_e:n{rowspan-\int_eval:n{#1}}}
+% \end{macrocode}
+% Get the structure number of the current cell
+% \begin{macrocode}
+ \seq_get_right:NN\g_@@_struct_cur_seq \l_@@_tmpb_tl
+% \end{macrocode}
+% If we are in a multicolumn the number can be negative and
+% this must be changed
+% \begin{macrocode}
+ \tl_set:Ne \l_@@_tmpb_tl { \int_abs:n{\l_@@_tmpb_tl} }
+% \end{macrocode}
+% no we must update an existing attribute.
+% TODO: simplify this ... (see also colspan handling).
+% \begin{macrocode}
+ \prop_get:cnNTF
+ { g__tag_struct_\l_@@_tmpb_tl _prop }
+ { C }
+ \l_@@_tmpa_tl
+ {
+ \tl_remove_once:Nn \l_@@_tmpa_tl {[}
+ \tl_remove_once:Nn \l_@@_tmpa_tl {]}
+ \__tag_struct_prop_gput:one{ \l_@@_tmpb_tl }
+ {C}
+ {[/rowspan-\int_eval:n{#1}~\l_@@_tmpa_tl]}
+ }
+ {
+ \__tag_struct_prop_gput:one{ \l_@@_tmpb_tl }
+ {C}
+ {[/rowspan-\int_eval:n{#1}]}
+ }
+% \end{macrocode}
+% Now mark the spanned cells that should be ignored.
+% \begin{macrocode}
+ \@@_gset_untagged_row_cells:nn {#1-1}{\g_@@_span_tl}
+ }
+% \end{macrocode}
+% \end{macro}
%
+% \begin{macrocode}
+\keys_define:nn{ __tag / setup }
+ { table/multirow .code:n = {\@@_multirow:n {#1} }
+ ,table/multirow .default:n = 1
+ }
+% \end{macrocode}
%
+% \begin{macro}{\@@_gset_untagged_row_cells:nn}
+% This command stores the row and column numbers of the cells in the following row(s)
+% that should not be tagged as they are a part of a rowspan.
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_gset_untagged_row_cells:nn #1 #2 % #1 number of rows, #2 number of columns
+ {
+ \int_step_inline:nn {#1}
+ {
+ \int_step_inline:nn {#2}
+ {
+ \prop_gput:Nee \g_@@_untagged_cells_prop
+ { \int_eval:n {\g_@@_row_int + ##1},\int_eval:n{\g_@@_col_int + ####1 -1 } }{}
+ }
+ }
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@@_if_tag_cell:nn}
+% We must be able to detect if a cell should be tagged. For this
+% we define a conditional --- if more options are needed it can be extended.
+% \begin{macrocode}
+\prg_new_protected_conditional:Npnn\@@_if_tag_cell:nn #1 #2 %#1 row, #2 col
+ { T,TF }
+ {
+ \prop_get:NeNTF \g_@@_untagged_cells_prop
+ {\int_eval:n{#1},\int_eval:n{#2}}\l__tbl_tmpa_tl
+ { \prg_return_false:}
+ { \prg_return_true: }
+ }
+% \end{macrocode}
+% \end{macro}
+%
% \subsection{Misc stuff}
%
% \begin{macro}{\@@_show_curr_cell_data:}
@@ -1037,13 +1304,6 @@
% cell of a row, but still inside that cell, so we use two
% commands. The one adding is used in the row/end socket.
% \begin{macrocode}
-\NewSocket{tbl/celldata/missingcount}{1}
-\NewSocketPlug{tbl/celldata/missingcount}{code}{\tbl_count_missing_cells:n{#1}}
-\AssignSocketPlug{tbl/celldata/missingcount}{code}
-
-% \end{macrocode}
-%
-% \begin{macrocode}
\cs_new:Npn \@@_add_missing_cells:
{
% \end{macrocode}
@@ -1058,6 +1318,7 @@
additional~cell(s)~into~previous~row:}
\int_step_inline:nn { \g_@@_missing_cells_int }
{
+ \int_gincr:N\g_@@_col_int
\UseTaggingSocket{tbl/cell/begin}
\UseTaggingSocket{tbl/cell/end}
}
diff --git a/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-testphase.dtx b/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-testphase.dtx
index f0a6fe65d0c..1134654cd6b 100644
--- a/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-testphase.dtx
+++ b/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-testphase.dtx
@@ -47,7 +47,7 @@
%
% Currently the values |phase-I|, |phase-II|, |phase-III| and |new-or| (bundles |new-or-1|
% and |new-or-2|) are provided.
-% |tagpdf| is an undocumented alias for |phase-II| which is kept for compability.
+% |tagpdf| is an undocumented alias for |phase-II| which is kept for compatibility.
% The value |math| combines various math related files.
%
% \StopEventually{\setlength\IndexMin{200pt} \PrintIndex }
diff --git a/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-toc-kernel-changes.dtx b/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-toc-kernel-changes.dtx
index bb88ffdcb03..bf10bf4f2f9 100644
--- a/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-toc-kernel-changes.dtx
+++ b/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-toc-kernel-changes.dtx
@@ -17,8 +17,8 @@
% for those people who are interested or want to report an issue.
%
% dates for latex-lab-kernel-changes.sty (pulled from various sources, see ins)
-\def\ltlabkerneldate{2024-02-12}
-\def\ltlabkernelversion{0.85c}
+\def\ltlabkerneldate{2024-07-11}
+\def\ltlabkernelversion{0.85d}
%<*driver>
\documentclass{l3doc}
\EnableCrossrefs
@@ -44,6 +44,11 @@
%
% \providecommand\hook[1]{\texttt{#1}}
%
+%
+% \ProvideDocElement[printtype=\textit{socket},idxtype=socket,idxgroup=Sockets]{Socket}{socketdecl}
+% \ProvideDocElement[printtype=\textit{hook},idxtype=hook,idxgroup=Hooks]{Hook}{hookdecl}
+% \ProvideDocElement[printtype=\textit{plug},idxtype=plug,idxgroup=Plugs]{Plug}{plugdecl}
+%
% \begin{abstract}
% \end{abstract}
%
@@ -187,12 +192,24 @@
% \subsection{\cs{contentsline} extension}
% [latex-lab]
% The tagging code must add code at the begin and end of \cs{contentsline}.
-% This code must have access to the arguments. We set it up as config point
-% for now.
+% This code must have access to the arguments. They are passed
+% together in tagging socket.
+% \begin{socketdecl}{tagsupport/toc/contentsline/before,
+% tagsupport/toc/contentsline/after}
+% Tagging sockets at the begin and end of contentsline.
+% They receive \emph{all} contentsline arguments as one argument
+% in four brace groups. The socket code should then use the parts it needs.
+% The sockets will be in lttagging.dtx, but that may only happen in
+% the next main release, so for now we test if they are in the
+% format and if not define them now.
% \begin{macrocode}
-\def\@contentsline@cfgpoint@before#1#2#3#4{}
-\def\@contentsline@cfgpoint@after#1#2#3#4{}
+\str_if_exist:cF { l__socket_tagsupport/toc/contentsline/before_plug_str }
+ {
+ \NewSocket{tagsupport/toc/contentsline/before}{1}
+ \NewSocket{tagsupport/toc/contentsline/after}{1}
+ }
% \end{macrocode}
+% \end{socketdecl}
% for the hooks we need that the \cs{l@XX} pass also the destination and
% that \cs{l@XX} takes three arguments.
% TODO: test that, if there are two many problems we should pass the
@@ -200,10 +217,10 @@
% \begin{macrocode}
\def\contentsline#1#2#3#4%
{%
- \@contentsline@cfgpoint@before{#1}{#2}{#3}{#4}%
+ \UseTaggingSocket{toc/contentsline/before}{{#1}{#2}{#3}{#4}}%
\gdef\@contentsline@destination{#4}%
\csname l@#1\endcsname{#2}{#3}%
- \@contentsline@cfgpoint@after{#1}{#2}{#3}{#4}%
+ \UseTaggingSocket{toc/contentsline/after}{{#1}{#2}{#3}{#4}}%
}
% \end{macrocode}
%
@@ -225,17 +242,33 @@
% \subsection{\cs{@starttoc}}
% [kernel?]
%
-% We add a configuration point before and after reading the file
+% We add a tagging socket before and after reading the file
% for the tagging.
+% \begin{socketdecl}{tagsupport/toc/starttoc/before,
+% tagsupport/toc/starttoc/after}
+% Tagging sockets for the begin and end of start of \cs{@starttoc}.
+% They take one argument, the extension.
+% The sockets will be in lttagging.dtx, but that may only happen in
+% the next main release, so for now we test if they are in the
+% format and if not define them now.
+% \begin{macrocode}
+\str_if_exist:cF { l__socket_tagsupport/toc/starttoc/before_plug_str }
+ {
+ \NewSocket{tagsupport/toc/starttoc/before}{1}
+ \NewSocket{tagsupport/toc/starttoc/after}{1}
+ }
+% \end{macrocode}
+% \begin{macrocode}
+% \end{macrocode}
+% \end{socketdecl}
+%
% \begin{macrocode}
-\def\@starttoc@cfgpoint@before#1{}
-\def\@starttoc@cfgpoint@after#1{}
\def\@starttoc#1{%
\begingroup
\makeatletter
- \@starttoc@cfgpoint@before{#1}%
+ \UseTaggingSocket{toc/starttoc/before}{#1}%
\@input{\jobname.#1}%
- \@starttoc@cfgpoint@after{#1}%
+ \UseTaggingSocket{toc/starttoc/after}{#1}%
\if@filesw
\expandafter\newwrite\csname tf@#1\endcsname
\immediate\openout \csname tf@#1\endcsname \jobname.#1\relax
@@ -269,15 +302,32 @@
\NewMirroredHookPairWithArguments{contentsline/page/before}{contentsline/page/after}{4}%
% \end{macrocode}
%
-% The dot in the leader must be set as artifact.
+% The dots in the leader must be set as artifact.
% But luatex requires that the mc are set outside the leaders.
-% So we need a config point.
+% So we need sockets.
%
% \cs{@dottedtocline} needs hooks and formatting commands.
-% We add a sixth argument so that it can grab the destination too.
+% To make the leaders into artifact we use tagging sockets.
+% The declaration should perhaps be moved into lttagging so that
+% it can be used also by external packages even if the tagging code is not
+% loaded?
+% \begin{socketdecl}{tagsupport/toc/leaders/before,
+% tagsupport/toc/leaders/after}
+% Tagging sockets to make the dot leaders an artifact.
+% They do not take an argument.
+% The sockets will be in lttagging.dtx, but that may only happen in
+% the next main release, so for now we test if they are in the
+% format and if not define them now.
+% \begin{macrocode}
+\str_if_exist:cF { l__socket_tagsupport/toc/leaders/before_plug_str }
+ {
+ \NewSocket{tagsupport/toc/leaders/before}{0}
+ \NewSocket{tagsupport/toc/leaders/after}{0}
+ }
+% \end{macrocode}
+% \end{socketdecl}
+% The destination is accessed through \cs{@contentsline@destination}.
% \begin{macrocode}
-\def\@dottedtocline@cfgpoint@leaders#1{#1}
-
\def\@dottedtocline#1#2#3#4#5{%
\ifnum #1>\c@tocdepth \else
\vskip \z@ \@plus.2\p@
@@ -291,10 +341,11 @@
\csname contentsline@text@#1@format\endcsname{#4}%
\UseHookWithArguments{contentsline/text/after}{4}{#1}{#4}{#5}{\@contentsline@destination}%
\nobreak
- \@dottedtocline@cfgpoint@leaders{%
+ \UseTaggingSocket{toc/leaders/before}\SuspendTagging{toc/leaders}%
\leaders\hbox{$\m@th
\mkern \@dotsep mu\hbox{.}\mkern \@dotsep
- mu$}\hfill}%
+ mu$}\hfill
+ \ResumeTagging{toc/leaders}\UseTaggingSocket{toc/leaders/after}%
\nobreak
\hb@xt@\@pnumwidth{\hfil\normalfont \normalcolor
\UseHookWithArguments{contentsline/page/before}{4}{#1}{#4}{#5}{\@contentsline@destination}%
diff --git a/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-toc.dtx b/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-toc.dtx
index 7235eb9ed95..5ad0d3cec14 100644
--- a/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-toc.dtx
+++ b/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-toc.dtx
@@ -16,8 +16,8 @@
%
% for those people who are interested or want to report an issue.
%
-\def\ltlabtocdate{2023-10-16}
-\def\ltlabtocversion{0.85b}
+\def\ltlabtocdate{2024-07-11}
+\def\ltlabtocversion{0.85c}
%<*driver>
\documentclass{l3doc}
\EnableCrossrefs
@@ -42,7 +42,10 @@
% \newcommand{\docclass}{document class \marginpar{\raggedright document class
% customizations}}
%
-% \providecommand\hook[1]{\texttt{#1}}
+%
+% \ProvideDocElement[printtype=\textit{socket},idxtype=socket,idxgroup=Sockets]{Socket}{socketdecl}
+% \ProvideDocElement[printtype=\textit{hook},idxtype=hook,idxgroup=Hooks]{Hook}{hookdecl}
+% \ProvideDocElement[printtype=\textit{plug},idxtype=plug,idxgroup=Plugs]{Plug}{plugdecl}
%
% \begin{abstract}
% \end{abstract}
@@ -196,14 +199,17 @@
\tag_struct_begin:n{tag=TOC,title=#1}
}
% \end{macrocode}
-% Now map it into the config point:
+% \end{macro}
+% Now define the tagging plug and assign it to the socket.
+% \begin{plugdecl}{default}
% \begin{macrocode}
-\cs_set_protected:Npn\@starttoc@cfgpoint@before#1
- {
- \@@_toc_starttoc_init:n{#1}
- }
+\NewSocketPlug{tagsupport/toc/starttoc/before}{default}
+ {
+ \@@_toc_starttoc_init:n{#1}
+ }
+\AssignSocketPlug{tagsupport/toc/starttoc/before}{default}
% \end{macrocode}
-% \end{macro}
+% \end{plugdecl}
% \begin{macro}{\@@_toc_starttoc_finalize:}
% \begin{macrocode}
\cs_new_protected:Npn \@@_toc_starttoc_finalize:
@@ -215,15 +221,18 @@
\seq_gclear:N \g_@@_toc_stack_seq
}
% \end{macrocode}
-% Now map it into the config point:
+% \end{macro}
+% Now define the tagging plug and assign it to the socket.
+% \begin{plugdecl}{default}
% \begin{macrocode}
-\cs_set_protected:Npn\@starttoc@cfgpoint@after#1
- {
- \@@_toc_starttoc_finalize:
- }
+\NewSocketPlug{tagsupport/toc/starttoc/after}{default}
+ {
+ \@@_toc_starttoc_finalize:
+ }
+\AssignSocketPlug{tagsupport/toc/starttoc/after}{default}
% \end{macrocode}
-% \end{macro}
-
+% \end{plugdecl}
+%
% \begin{macro}{\@@_toc_end:n}
% This commands ends all TOC on the stack with a level higher than the argument
% \begin{macrocode}
@@ -249,10 +258,11 @@
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\@@_toc_contentsline_begin:nnn}
+% \begin{macro}{\@@_toc_contentsline_begin:nnnn}
% This is main command executed at the begin of a |\contentsline|.
% \begin{macrocode}
-\cs_new_protected:Npn \@@_toc_contentsline_begin:nnn #1 #2 #3 %#1 level, #2 content, #3 destination
+\cs_new_protected:Npn \@@_toc_contentsline_begin:nnnn #1 #2 #3 #4
+ %#1 level, #2 content, #3 page number (unused) #4 destination
{
\tag_if_active:T
{
@@ -308,30 +318,34 @@
% \end{NOTE}
% \begin{macrocode}
\prop_gput:Nee \g_@@_struct_ref_by_dest_prop
- { \tag_get:n {struct_num} }{#3}
+ { \tag_get:n {struct_num} }{#4}
\seq_gpush:Ne \g_@@_toc_stack_seq {{TOCI}\use:c{toclevel@#1}}
\group_end:
}
}
}
% \end{macrocode}
-% Now map it into the config point:
+% \end{macro}
+% Now define the tagging plug and assign it to the socket.
+% \begin{plugdecl}{default}
% \begin{macrocode}
-\cs_set_protected:Npn\@contentsline@cfgpoint@before#1#2#3#4
+\NewSocketPlug{tagsupport/toc/contentsline/before}{default}
{
- \@@_toc_contentsline_begin:nnn {#1}{#2}{#4}
- }
+ \@@_toc_contentsline_begin:nnnn #1
+ }
+\AssignSocketPlug{tagsupport/toc/contentsline/before}{default}
% \end{macrocode}
-% \end{macro}
+% \end{plugdecl}
%
-% \begin{macro}{\@@_toc_contentsline_end:n}
+% \begin{macro}{\@@_toc_contentsline_end:nnnn}
% This is the closing code of a |\contentsline|.
% If the contentsline was actually printed, the code has to
% close the TOCI structure and to update the stack.
% \begin{macrocode}
\msg_new:nnn {tag}{toc-no-TOCI}{Missing~TOCI~structure~on~toc~stack}
-\cs_new_protected:Npn \@@_toc_contentsline_end:n #1 %#1 level name
+\cs_new_protected:Npn \@@_toc_contentsline_end:nnnn #1 #2 #3 #4
+% #1 level, #2 content (unused), #3 page number (unused) #4 destination (unused)
{
\int_compare:nNnF { \use:c{toclevel@#1} } > {\use:c{c@tocdepth}}
{
@@ -348,14 +362,17 @@
}
}
% \end{macrocode}
-% Now we map it to the config point
+% \end{macro}
+% Now define the tagging plug and assign it to the socket.
+% \begin{plugdecl}{default}
% \begin{macrocode}
-\cs_set_protected:Npn \@contentsline@cfgpoint@after #1#2#3#4
- {
- \@@_toc_contentsline_end:n {#1}
- }
+\NewSocketPlug{tagsupport/toc/contentsline/after}{default}
+ {
+ \@@_toc_contentsline_end:nnnn #1
+ }
+\AssignSocketPlug{tagsupport/toc/contentsline/after}{default}
% \end{macrocode}
-% \end{macro}
+% \end{plugdecl}
%
% \subsection{Tagging of the content}
% This need discussion.
@@ -380,12 +397,16 @@
\tag_struct_end:
\tag_mc_begin:n{tag=Reference}}
% \end{macrocode}
-%
+% \begin{plugdecl}{artifact}
% \begin{macrocode}
-\def\@dottedtocline@cfgpoint@leaders#1{%
- \tag_mc_begin:n{artifact}\tag_stop:n{leaders}\nobreak#1\nobreak\tag_start:n{leaders}\tag_mc_end:}
+\NewSocketPlug{tagsupport/toc/leaders/before}{artifact}
+ {\tag_mc_begin:n{artifact}\nobreak}
+\NewSocketPlug{tagsupport/toc/leaders/after}{artifact}
+ {\nobreak\tag_mc_end:}
+\AssignSocketPlug{tagsupport/toc/leaders/before}{artifact}
+\AssignSocketPlug{tagsupport/toc/leaders/after}{artifact}
% \end{macrocode}
-
+% \end{plugdecl}
%
% \begin{macrocode}
%</package>
diff --git a/Master/texmf-dist/source/latex-dev/tools/array.dtx b/Master/texmf-dist/source/latex-dev/tools/array.dtx
index e77ef0a3bf1..ca5e991beec 100644
--- a/Master/texmf-dist/source/latex-dev/tools/array.dtx
+++ b/Master/texmf-dist/source/latex-dev/tools/array.dtx
@@ -39,7 +39,7 @@
% \begin{macrocode}
%<+package>\NeedsTeXFormat{LaTeX2e}[2024/06/01]
%<+package>\ProvidesPackage{array}
-%<+package> [2024/05/23 v2.6c Tabular extension package (FMi)]
+%<+package> [2024/07/13 v2.6e Tabular extension package (FMi)]
%
% \fi
%
@@ -715,7 +715,7 @@
%
% A similar problem happened when "\extrarowheight" was used. For that
% reason m-cells now manually position the cell content which
-% allows to ignore this extra space request during the vertical aligment.
+% allows to ignore this extra space request during the vertical alignment.
%
%
% \subsection{Bugs and Features}
@@ -1900,7 +1900,7 @@ Bug reports can be opened (category \texttt{#1}) at\\%
% is how much do we need to move down? If there is any
% =\arraystretch= in place then the first line will have some
% unusual height and we don't want to consider that when finding
-% the middle point. So we substract from the cell height the height
+% the middle point. So we subtract from the cell height the height
% of that strut. But of course we want to include the normal height
% of the first line (which would be something like =\ht\strutbox=)
% so we need to add that. On the other hand, when centering around
@@ -2656,7 +2656,7 @@ Bug reports can be opened (category \texttt{#1}) at\\%
% \begin{macro}{\d@llarbegin}
% \begin{macro}{\d@llarend}
% =\d@llar= has to be
-% locally asigned since otherwise nested \textsf{tabular} and \textsf{array}
+% locally assigned since otherwise nested \textsf{tabular} and \textsf{array}
% environments (via =\multicolumn=) are impossible.
% For 25 years or so =\@halignto= was set globally (to save space on the
% save stack, but that was a mistake: if there is a tabular in the
@@ -2852,11 +2852,13 @@ Bug reports can be opened (category \texttt{#1}) at\\%
% \end{macrocode}
%
% \begin{macro}{\@preamerr}
+% \changes{v2.6d}{2024/06/14}{Keep message sources out of L3 code (gh/1378)}
% We also have to redefine the error routine =\@preamerr= since
% new kind of errors are possible.
% The code for this macro is not perfect yet;
% it still needs too much memory.
% \begin{macrocode}
+\ExplSyntaxOff
\def\@preamerr#1{\def\@tempd{{..} at wrong position: }%
\PackageError{array}{%
\ifcase #1 Illegal pream-token (\@nextchar): `c' used\or %0
@@ -2905,7 +2907,6 @@ Bug reports can be opened (category \texttt{#1}) at\\%
% to define letters, to be used in the same way as the primitive
% column specifiers, `c' `p' etc.
% \begin{macrocode}
-\ExplSyntaxOff % this is really oldstyle using \@tfor :=
\def\newcolumntype#1{%
% \end{macrocode}
% "\NC@char" was added in V2.01 so that active characters, like "@" in
@@ -3439,7 +3440,7 @@ Bug reports can be opened (category \texttt{#1}) at\\%
% \subsection{Implementing column types \texttt{w} and \texttt{W}}
%
% In TugBoat 38/2 an extension was presented that implemented two
-% aditional column types \texttt{w} and \texttt{W}. These have now
+% additional column types \texttt{w} and \texttt{W}. These have now
% been added to the package itself.
%
%
@@ -3516,7 +3517,46 @@ Bug reports can be opened (category \texttt{#1}) at\\%
% \end{macro}
%
%
+% \subsection{Handling \cs{cline}}
+%
+% In the past \pkg{array} did not have to concern itself with
+% \cs{cline} but simply used the definition already provided in the
+% kernel. However, for tagged PDF output this definition is
+% insufficient, because it causes incorrect row counting and the rules
+% it generates would need to be marked as artifacts.
+% We therefore update it here.
+%
%
+% \begin{macro}{\@cline}
+% Tagging support for \cs{cline}
+% \changes{v2.6e}{2024/07/13}{Support for tagging \cs{cline} (tagging/134)}
+% \begin{macrocode}
+\ExplSyntaxOn
+\def\@cline#1-#2\@nil{
+ \omit
+ \@multicnt#1
+ \advance\@multispan\m@ne
+ \ifnum\@multicnt=\@ne\@firstofone{&\omit}\fi
+ \@multicnt#2
+ \advance\@multicnt-#1
+ \advance\@multispan\@ne
+% \end{macrocode}
+% The rule needs artifact tagging in tagged PDF.
+% \begin{macrocode}
+ \UseTaggingSocket{tbl/leaders/begin}
+ \leaders\hrule\@height\arrayrulewidth\hfill
+ \UseTaggingSocket{tbl/leaders/end}
+% \end{macrocode}
+% To the row counting the above appears like an extra row, so we
+% have to correct the count.
+% \begin{macrocode}
+ \tbl_gdecr_row_count:
+ \cr
+ \noalign{\vskip-\arrayrulewidth}
+}
+\ExplSyntaxOff
+% \end{macrocode}
+% \end{macro}
%
%
% \begin{macrocode}
diff --git a/Master/texmf-dist/source/latex-dev/tools/longtable.dtx b/Master/texmf-dist/source/latex-dev/tools/longtable.dtx
index cc3a939e7ad..439542a18c9 100644
--- a/Master/texmf-dist/source/latex-dev/tools/longtable.dtx
+++ b/Master/texmf-dist/source/latex-dev/tools/longtable.dtx
@@ -28,7 +28,7 @@
%</dtx>
%<package>\NeedsTeXFormat{LaTeX2e}[1995/06/01]
%<package>
-% Try the 2020 version for any rollback before that date:
+% Try the 2020 version for any rollback before that date:
%<package>\DeclareRelease{}{1994-06-01}{longtable-2020-01-07.sty}
%<package>
%<package>\DeclareRelease{v4.13}{2020-01-02}{longtable-2020-01-07.sty}
@@ -38,7 +38,7 @@
%<driver> \ProvidesFile{longtable.drv}
% \fi
% \ProvidesFile{longtable.dtx}
- [2024-04-26 v4.20 Multi-page Table package (DPC)]
+ [2024-07-06 v4.21 Multi-page Table package (DPC)]
%
% \iffalse
%<*driver>
@@ -179,7 +179,7 @@
% \env{longtable}, which has most of the features of the \env{tabular}
% environment, but produces tables which may be broken by \TeX's
% standard page-breaking algorithm. It also shares some features with
-% the \env{table} environment. In particular it uses the same counter,
+% the \env{table} environment. In particular it uses by default the same counter,
% \texttt{table}, and has a similar "\caption" command. Also, the
% standard "\listoftables" command lists tables produced by either the
% \env{table} or \env{longtable} environments.
@@ -335,6 +335,29 @@
% \caption{A floating table}
% \end{table}
%
+% \section{Counter and Caption Types}
+%
+% As mentioned in the introduction \env{longtable} uses and updates by default
+% the \texttt{table} counter, the "\caption" command creates a table caption
+% which is added to the list of tables.
+% Packages like \pkg{ltcaption} added more flexibility here by adding the
+% command "\LTcaptype" which allowed to change the type, e.g. to a listing.
+% Starting with version 4.21 \pkg{longtable} supports this command directly.
+% \DescribeMacro{\LTcaptype}%
+% By redefining this command it is possible to change the counter and caption type.
+% After "\renewcommand\LTcaptype{"\meta{counter}"}" \env{longtable} will update
+% the counter \meta{counter}, use "\fnum@"\meta{counter} in the caption (which
+% typically will make use of "\"\meta{counter}"name" and "\the"\meta{counter}), and
+% write content line entries into the file with the extension stored in the
+% command "\ext@"\meta{counter}. When \pkg{hyperref} is loaded the name of
+% the anchor will use \meta{counter} too. Packages or documents that change
+% "\LTcaptype" to some nonstandard value must ensure that the counter
+% \meta{counter} and the commands "\fnum@"\meta{counter}
+% and "\ext@"\meta{counter} exist and do not error.
+% If "\LTcaptype" is empty no counter is advanced and "\"\meta{counter}"name" in
+% the caption is suppressed.
+%
+%
% \section{Captions and Headings}
%
% At the start of the table one may specify lines which are to appear at
@@ -907,6 +930,15 @@
% \end{macrocode}
% \end{macro}
%
+% \begin{macro}{\LTcaptype}
+% The name used as counter, in caption, "\addcontentsline" and in targets.
+% "\providecommand" is used for compability with \pkg{ltcaption}
+% \changes{v4.21}{2024/07/04}
+% {Added \cs{LTcaptype} to support other types beside table.}
+% \begin{macrocode}
+\providecommand\LTcaptype{table}
+% \end{macrocode}
+% \end{macro}
% \subsection{Internal Parameters}
%
% \begin{macro}{\LT@head}
@@ -957,8 +989,11 @@
% are preserved correctly when "\includeonly" is used. In the rest of
% the file "\LT@tables" has been replaced by "\c@LT@tables" without
% further comment.
+% \changes{v4.21}{2024/07/04}
+% {Provide a \cs{theH}-representation for targets.}
% \begin{macrocode}
\newcounter{LT@tables}
+\providecommand\theHLT@tables{\theLT@tables}
% \end{macrocode}
% \end{macro}
%
@@ -1050,12 +1085,12 @@
\LT@err{longtable not in 1-column mode}\@ehc
\fi
% \end{macrocode}
-%
+%
% \changes{v4.19}{2023/12/16}{Support for tagged PDF}
% \begin{macrocode}
\UseTaggingSocket{tbl/vmode/begin}%
% \end{macrocode}
-%
+%
% \begin{macrocode}
\begingroup
% \end{macrocode}
@@ -1080,6 +1115,9 @@
% Since Version 3.02, \package{longtable} has used the internal counter
% "\c@LT@tables". The \LaTeX\ counter "table" is still incremented
% so that "\caption" works correctly.
+% \changes{v4.21}{2024/07/04}
+% {Use \cs{LTcaptype} instead of \texttt{table} in various places
+% to support other types beside table.}
% \begin{macrocode}
\def\LT@array[#1]#2{%
% \end{macrocode}
@@ -1097,25 +1135,31 @@
% TODO: When a line is killed the structure subtree is there already
% too and must be removed. If hard to do, then maybe at first warn if the
% construction is used.
-%
+%
% \cs{LT@array} is executed in a group, so we can disable para-tagging here.
% \changes{v4.19}{2023/12/16}{Support for tagged PDF}
% \begin{macrocode}
\UseTaggingSocket{tbl/init}
- \@kernel@refstepcounter{table}\stepcounter{LT@tables}
+ \tl_if_empty:eTF { \LTcaptype }
+ {
+ \tl_gset:Ne \@currentHref {LT@tables.\theHLT@tables}
+ }
+ {
+ \@kernel@refstepcounter{\LTcaptype}\stepcounter{LT@tables}
% \end{macrocode}
-% The target is created rather late and a \cs{label} can come earlier,
+% The target is created rather late and a \cs{label} can come earlier,
% so we have to define \cs{@currentHref} explicitly. We can't currently
% assume that \cs{theHtable} is defined always.
% \begin{macrocode}
- \tl_gset:Ne \@currentHref {table.\cs_if_exist_use:N\theHtable}
+ \tl_gset:Ne \@currentHref {\LTcaptype.\cs_if_exist_use:c {theH\LTcaptype}}
+ }
% \end{macrocode}
-%
+%
% \changes{v4.19}{2023/12/16}{Managing cell indexes}
% \begin{macrocode}
\tbl_gzero_row_count:
% \end{macrocode}
-%
+%
% \changes{v4.19}{2023/12/16}{Support for tagged PDF}
% \begin{macrocode}
\UseTaggingSocket{tbl/longtable/init}
@@ -1225,7 +1269,7 @@
\begingroup
\@mkpream{#2}%
% \end{macrocode}
-%
+%
% \changes{v4.19}{2023/12/16}{Managing cell indexes}
% \begin{macrocode}
\tbl_count_table_cols:
@@ -1271,12 +1315,12 @@
\tabskip\z@ \@arstrut
% \end{macrocode}
% Insert the tagging socket to start the row and initialize the cell
-% data for the row.
+% data for the row.
% \changes{v4.19}{2023/12/16}{Support for tagged PDF}
% \begin{macrocode}
\UseTaggingSocket{tbl/row/begin}%
% \end{macrocode}
-%
+%
% \changes{v4.19}{2023/12/16}{Managing cell indexes}
% \begin{macrocode}
\tbl_init_cell_data_for_row:
@@ -1314,7 +1358,7 @@
column:~ \the\g_@@_col_int
}
% \end{macrocode}
-%
+%
% \changes{v4.19}{2023/12/16}{Support for tagged PDF}
% \begin{macrocode}
\tbl_if_row_was_started:T
@@ -1399,7 +1443,7 @@
% 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
@@ -1476,9 +1520,17 @@
\maxdepth\z@
\fi
% \end{macrocode}
-%
+% \changes{v4.21}{2024/07/04}
+% {Use \cs{LTcaptype} to support other types beside table and handle
+% the case if it is empty.}
% \begin{macrocode}
- \MakeLinkTarget{table}
+ \tl_if_empty:eTF{\LTcaptype}
+ {
+ \MakeLinkTarget{LT@tables}
+ }
+ {
+ \MakeLinkTarget{\LTcaptype}
+ }
% \end{macrocode}
% Put the table head on the page, and then switch to the new output
% routine.
@@ -1487,12 +1539,12 @@
% \begin{macrocode}
\ifvoid\LT@firsthead\copy\LT@head\else\box\LT@firsthead\fi\nobreak
% \end{macrocode}
-%
+%
% \changes{v4.19}{2023/12/16}{Support for tagged PDF}
% \begin{macrocode}
\UseTaggingSocket{tbl/longtable/head}
% \end{macrocode}
-%
+%
% \begin{macrocode}
\output{\LT@output}}
\ExplSyntaxOff
@@ -1524,18 +1576,18 @@
% \begin{macrocode}
\tbl_crcr:n {endlongtable}
% \end{macrocode}
-%
+%
% \changes{v4.01}{1996/04/11}
% {(DPC) use \cs{noalign} to sneak in \cs{LT@entry@chop}}
% \begin{macrocode}
\noalign{%
% \end{macrocode}
-%
+%
% \changes{v4.19}{2023/12/16}{Support for tagged PDF}
% \begin{macrocode}
\UseTaggingSocket{tbl/longtable/finalize}
% \end{macrocode}
-%
+%
% \begin{macrocode}
\let\LT@entry\LT@entry@chop
\xdef\LT@save@row{\LT@save@row}}%
@@ -1579,7 +1631,11 @@
\ifx\LT@save@row\LT@@@@save@row
\else
\LT@warn{Column~ widths~ have~ changed\MessageBreak
- in~ table~ \thetable}%
+ in~
+ \tl_if_empty:eTF{\LTcaptype}
+ {longtable~ \theLT@tables}
+ {\LTcaptype\c_space_tl\use:c{the\LTcaptype}}
+ }
\LT@final@warn
\fi
% \end{macrocode}
@@ -1613,7 +1669,7 @@
% \begin{macrocode}
\ifvoid\footins\else\insert\footins{}\fi
% \end{macrocode}
-%
+%
% \changes{v4.19}{2023/12/16}{Support for tagged PDF}
% \begin{macrocode}
\UseTaggingSocket{tbl/vmode/end}%
@@ -2161,7 +2217,6 @@
\tbl_gdecr_row_count:
\penalty\@M}
\@gtempa}
-\ExplSyntaxOff
%<@@=>
% \end{macrocode}
% \end{macro}
@@ -2187,14 +2242,22 @@
% {Add new control argument}
% \changes{v4.16}{2021/05/07}
% {use \cs{ext@table} gh/561}
-% \begin{macrocode}
-\def\LT@c@ption#1[#2]#3{%
- \LT@makecaption#1\fnum@table{#3}%
- \def\@tempa{#2}%
- \ifx\@tempa\@empty\else
- {\let\\\space
- \addcontentsline{\ext@table}{table}{\protect\numberline{\thetable}{#2}}}%
- \fi}
+% \changes{v4.21}{2024/07/04}
+% {Use \cs{LTcaptype} to support other types beside table.}
+% \begin{macrocode}
+\def\LT@c@ption#1[#2]#3{
+ \tl_if_empty:eTF{\LTcaptype}
+ {\LT@makecaption\@gobble{}{#3}}
+ {\LT@makecaption#1{\csname fnum@\LTcaptype\endcsname}{#3}
+ \def\@tempa{#2}
+ \ifx\@tempa\@empty\else
+ {\let\\\space
+ \addcontentsline
+ {\@nameuse{ext@\LTcaptype}}
+ {\LTcaptype}
+ {\protect\numberline{\@nameuse{the\LTcaptype}}{#2}}}
+ \fi}}
+\ExplSyntaxOff
% \end{macrocode}
% \end{macro}
%
@@ -2375,7 +2438,7 @@
\ExplSyntaxOn
\def\LT@end@hd@ft#1{%
% \end{macrocode}
-%
+%
% This command is used to store the head and foot boxes.
% We need to retrieve and store the row so that we can clean
% up the structure in the finalize code.
@@ -2388,7 +2451,7 @@
% \end{macrocode}
% TODO: This is exposing internal counters, so it should be encapsulated
% in some interface command (but I'm not sure what that should be
-% called, so not done yet.
+% called, so not done yet.
% \changes{v4.19}{2023/12/16}{Managing cell indexes}
% \begin{macrocode}
\tbl_count_missing_cells:n {head/foot}
@@ -2413,19 +2476,28 @@
% To get out of this trap we run \cs{crcr} (which would normally
% come inside \cs{LT@echunk}. That will then trigger \cs{everycr}
% and update row counter unnecessarily, but now we have a defined state, so
-% we can use \cs{noalign} to undo that.
+% we can use \cs{noalign} to undo that.
% We also change \cs{LT@rows} so that further \cs{cr}s do not do
% any harm (as explained above.
%
% The \cs{crcr} inside \cs{LT@echunk} will be bypassed in that case
% as we have just executed a \cs{crcr} and are still in scanning modus for
-% \cs{omit} or \cs{noalign}.
+% \cs{omit} or \cs{noalign}.
% \begin{macrocode}
{
\crcr
\noalign{
% \end{macrocode}
-%
+% \changes{v4.22}{2024/08/13}{Store header row numbers}
+% \begin{macrocode}
+ \int_step_inline:nn
+ { \LT@rows }
+ {
+ \seq_gput_left:ce
+ {g_@@_\cs_to_str:N #1 _rows_seq }
+ { \int_eval:n {\g_@@_row_int - ##1 } }
+ }
+% \end{macrocode}
% \changes{v4.19}{2023/12/16}{Managing cell indexes}
% \begin{macrocode}
\tbl_gdecr_row_count: % undo the increment
@@ -2442,7 +2514,7 @@
{Increase~ LTchunksize}%
\fi
\setbox#1\box\z@
- \@@_trace:n {-->>~ Saving~\noexpand#1}
+ \@@_trace:n {-->>~ Saving~\noexpand#1}
\LT@get@widths
\LT@bchunk}
% \end{macrocode}
@@ -2501,7 +2573,7 @@
\bgroup
% \end{macrocode}
% \changes{v4.12}{2019/02/06}{Color group to match array package}
-% \changes{v4.18}{2023/08/25}{Use \cs{everypar} to match array package, github 1128}%
+% \changes{v4.18}{2023/08/25}{Use \cs{everypar} to match array package, github 1128}
% \begin{macrocode}
\color@begingroup
\let\@footnotetext\LT@p@ftntext
@@ -2509,7 +2581,7 @@
\@arrayparboxrestore
\everypar{%
\vrule \@height \ht\@arstrutbox \@width \z@
- \everypar{}}%
+ \everypar{}}%
}
% \end{macrocode}
% \end{macro}
diff --git a/Master/texmf-dist/source/latex-dev/tools/multicol.dtx b/Master/texmf-dist/source/latex-dev/tools/multicol.dtx
index 4d864480029..99f513097ec 100644
--- a/Master/texmf-dist/source/latex-dev/tools/multicol.dtx
+++ b/Master/texmf-dist/source/latex-dev/tools/multicol.dtx
@@ -20,7 +20,7 @@
% \iffalse This is a METACOMMENT
%
%% Package `multicol' to use with LaTeX2e
-%% Copyright 1989-2023 Frank Mittelbach
+%% Copyright 1989-2024 Frank Mittelbach
%%
%% In addition to the terms of LPPL any distributed version
%% (unchanged or modified) of multicol has to keep the statement
@@ -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 LaTeX fund
+%% The license fee, if any, can be paid 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
%%
@@ -98,7 +98,7 @@
%<driver> \ProvidesFile{multicol.drv}
% \fi
% \ProvidesFile{multicol.dtx}
- [2024/05/23 v1.9h multicolumn formatting (FMi)]
+ [2024/07/01 v1.9h multicolumn formatting (FMi)]
%
%
%
@@ -403,12 +403,17 @@
% the most important is called |\tolerance|: this controls the
% allowed `looseness' (i.e.\ the amount of blank space between words).
% Its default value is 200 (the \LaTeX{} |\fussy|) which is too
-% small for narrow columns. On the other hand the |\sloppy|
-% declaration (which sets |\tolerance| to $10000=\infty$) is too
-% large, allowing really bad spacing.\footnote{Look at the next
-% paragraph, it was set with the \cs{sloppy} declaration.}
-%
-% \begin{sloppypar}
+% small for narrow columns.
+
+% Setting it to \texttt{10000} (a.k.a.\ $\infty$) means arbitrary bad
+% lines are possible. With that setting \LaTeX{} will make most lines
+% perfect but intermix them with really bad lines. This was the
+% setting originally used by \cs{sloppy} (nowadays it is a bit more
+% cautious and used \texttt{9999} which makes a huge
+% difference).\footnote{Look at the next paragraph, it was set with
+% the \cs{tolerance}\texttt{=10000}.}
+%
+% \begin{sloppypar}\tolerance=10000
% \DescribeMacro\multicoltolerance \DescribeMacro\multicolpretolerance
% We therefore use a |\multicoltolerance| parameter for the
% |\tolerance| value inside the \mc{} environment. Its default value
@@ -417,10 +422,10 @@
% be done outside the \mc{} environment. Since |\tolerance| is set
% to |\multicoltolerance| at the beginning of every \textsf{multicols}
% environment one can locally overwrite this default by assigning
-% \verb*+\tolerance = +\meta{desired value}. There also exists a
+% \cs{tolerance}\texttt{=}\meta{desired value}. There also exists a
% |\multicolpretolerance| parameter holding the value for
% |\pretolerance| within a \mc{} environment. Both parameters are
-% usually used only by package designers.
+% usually used only by package or class designers.
% \end{sloppypar}
%
% Generation of multicolumn output can be divided into two parts. In
@@ -679,7 +684,7 @@
% this value will additionally trace the mark handling
% algorithm. It will show what marks are found, what marks are
% considered, etc. To fully understand this information you will
-% probably have to read carefully trough the implementation.
+% probably have to read carefully through the implementation.
% \item[$\meta{number}\geq 4$.] Setting \meta{number}\pagebreak[2] to
% such a high value will additionally place an |\hrule| into your
% output, separating the part of text which had already been
@@ -1945,7 +1950,7 @@
% the balancing happened in the output routine then \TeX{} reverts
% to the |\prevdepth| that was current before the OR once the OR has
% finished. In short |\prevdepth| is something you can't set
-% globally it is alway local to the current list being built. Thus
+% globally it is always local to the current list being built. Thus
% we need to set it back to zero here to avoid incorrect spacing.
% \changes{v1.8h}{2014/09/12}{Set \cs{prevdepdth} for current vlist
% when returning from multicols environment}
@@ -2216,7 +2221,7 @@
% \begin{macro}{\multicolmindepthstring}
% The default minimum depth of each column corresponds to the depth
% of a `p' in the current font. This makes sense for Latin-based
-% languages and was hard-wired intitially, but for Asian languages
+% languages and was hard-wired initially, but for Asian languages
% it is better to use a zero depth (and alternatively one might
% want to use the depth of a strut or a parentheses). So we now
% offer a way to adjust this while maintaining backward
@@ -2462,7 +2467,7 @@
% If |\kept@firstmark| is non-empty then |\kept@botmark| must be
% non-empty too so we can use their values. Otherwise we use the
% value of |\kept@topmark| which was first initialized when we
-% gathered the |\partical@page| and later on was updated to the
+% gathered the |\partial@page| and later on was updated to the
% |\botmark| for the preceding page.
%
% \changes{v1.4a}{1992/02/14}{\cs{botmark} set to \cs{splitbotmark}}
@@ -2938,7 +2943,7 @@
% marks from this box. This has to be done \emph{before} we add a
% penalty of $-10000$ to the top of the box, otherwise only an
% empty box will be considered. But even that is not enough: the box
-% may contain \cs{columnbreak}s in which case doing some artifical
+% may contain \cs{columnbreak}s in which case doing some artificial
% splitting to get the marks out still fails to see all marks
% unless we take some special precaution in \cs{get@keptmarks}
% (which is now done).
diff --git a/Master/texmf-dist/source/latex-dev/tools/theorem.dtx b/Master/texmf-dist/source/latex-dev/tools/theorem.dtx
index a9c3ccae3ed..3fbba473ba2 100644
--- a/Master/texmf-dist/source/latex-dev/tools/theorem.dtx
+++ b/Master/texmf-dist/source/latex-dev/tools/theorem.dtx
@@ -24,7 +24,7 @@
%%
%
%
-\def\FMithmInfo{2023/07/05 v2.2c Theorem extension package (FMi)}
+\def\FMithmInfo{2024/08/06 v2.2c Theorem extension package (FMi)}
%
% \ProvidesFile{theorem.dtx}[\FMithmInfo]
%\iffalse % this is a METACOMMENT !
@@ -952,7 +952,6 @@
%
% \subsubsection{The \texttt{changebreak} style}
%
-% \begin{macrocode}
% This style option is stored in the file |thcb.sty|.
% \begin{macrocode}
%<*thcb>
diff --git a/Master/texmf-dist/source/latex/acmart/Makefile b/Master/texmf-dist/source/latex/acmart/Makefile
index 545e505ed56..c81d3554465 100644
--- a/Master/texmf-dist/source/latex/acmart/Makefile
+++ b/Master/texmf-dist/source/latex/acmart/Makefile
@@ -14,6 +14,7 @@ DEV=-dev # To switch dev on
PDF = $(PACKAGE).pdf acmguide.pdf
BIBLATEXFILES= $(wildcard *.bbx) $(wildcard *.cbx) $(wildcard *.dbx) $(wildcard *.lbx)
+
SAMPLEBIBLATEXFILES=$(patsubst %,samples/%,$(BIBLATEXFILES))
ACMCPSAMPLES= \
@@ -21,7 +22,7 @@ ACMCPSAMPLES= \
samples/sample-acmcp-Invited.pdf \
samples/sample-acmcp-Position.pdf \
samples/sample-acmcp-Research.pdf \
- samples/sample-acmcp-Review.pdf \
+ samples/sample-acmcp-Review.pdf
all: ${PDF} ALLSAMPLES
@@ -46,6 +47,9 @@ acmguide.pdf: $(PACKAGE).dtx $(PACKAGE).cls
%.cls: %.ins %.dtx
pdflatex $<
+%-tagged.cls: %.ins %.dtx
+ pdflatex $<
+
ALLSAMPLES: $(SAMPLEBIBLATEXFILES)
cd samples; pdflatex samples.ins; cd ..
@@ -59,6 +63,7 @@ samples/%: %
samples/$(PACKAGE).cls: $(PACKAGE).cls
+samples/$(PACKAGE)-tagged.cls: $(PACKAGE)-tagged.cls
samples/ACM-Reference-Format.bst: ACM-Reference-Format.bst
samples/abbrev.bib: ACM-Reference-Format.bst
@@ -116,7 +121,18 @@ samples/sample-sigconf-lualatex.pdf: samples/sample-lualatex.tex samples/$(PA
samples/sample-acmcp.pdf: samples/acm-jdslogo.png
-.PRECIOUS: $(PACKAGE).cfg $(PACKAGE).cls
+
+samples/sample-acmsmall-tagged.pdf: samples/sample-acmsmall-tagged.tex samples/$(PACKAGE)-tagged.cls samples/ACM-Reference-Format.bst
+ cd $(dir $@) && lualatex-dev $(notdir $<)
+ - cd $(dir $@) && bibtex $(notdir $(basename $<))
+ cd $(dir $@) && lualatex-dev $(notdir $<)
+ cd $(dir $@) && lualatex-dev $(notdir $<)
+ while ( grep -q '^LaTeX Warning: Label(s) may have changed' $(basename $<).log) \
+ do cd $(dir $@) && lualatex-dev $(notdir $<); done
+
+
+
+.PRECIOUS: $(PACKAGE).cfg $(PACKAGE).cls $(PACKAGE)-tagged.cls
docclean:
$(RM) *.log *.aux \
@@ -124,7 +140,9 @@ docclean:
*.ilg *.ind *.out *.lof \
*.lot *.bbl *.blg *.gls *.cut *.hd \
*.dvi *.ps *.thm *.tgz *.zip *.rpi \
- samples/$(PACKAGE).cls samples/ACM-Reference-Format.bst \
+ samples/$(PACKAGE).cls \
+ samples/$(PACKAGE)-tagged.cls \
+ samples/ACM-Reference-Format.bst \
samples/*.log samples/*.aux samples/*.out \
samples/*.bbl samples/*.blg samples/*.cut \
samples/acm-jdslogo.png \
@@ -132,7 +150,7 @@ docclean:
clean: docclean
- $(RM) $(PACKAGE).cls \
+ $(RM) $(PACKAGE).cls $(PACKAGE)-tagged.cls \
samples/*.tex
distclean: clean
diff --git a/Master/texmf-dist/source/latex/acmart/acmart.dtx b/Master/texmf-dist/source/latex/acmart/acmart.dtx
index 0ff7a902b78..26e19fdcc6d 100644
--- a/Master/texmf-dist/source/latex/acmart/acmart.dtx
+++ b/Master/texmf-dist/source/latex/acmart/acmart.dtx
@@ -998,13 +998,7 @@
% by IW3C2, when some authors are approved Google employees.\\
% \texttt{cc} & Creative Commons license. If this key is set,
% \textsl{doclicense} images are used to typeset the license. See
-% also \cs{setcctype} command. Note that at present this license
-% can be used only either for \texttt{acmengage} format, or for
-% \texttt{nonacm} publications, or for the authors that meet any
-% of the following requirements: (a)~part of the ACM Open Program;
-% (b)~publishing in a Gold Open Access publication;
-% (c)~paying the Open Access APC;
-% (d)~part of the Google publishing agreement.\\
+% also \cs{setcctype} command. \\
% \texttt{acmcopyright} & The authors transfer the copyright to the
% ACM. This choice is no longer available for the
% non-commissioned authors and will trigger a warning.\\
@@ -2239,6 +2233,24 @@
% \item |figure*|: \cs{fulltextwidth}.
% \end{enumerate}
%
+%\subsection{Experiments with tagging}
+%\label{sec:ug_tagged}
+%
+% ACM is firmly committed to produce fully tagged PDFs compliant with
+% the accessibility standards. We use the developmental version of
+% tagging code by \LaTeX3 team, see the details at
+% \url{https://www.latex-project.org/publications/indexbytopic/pdf/}
+% and \url{https://tug.org/twg/accessibility/overview.html}.
+%
+% At present this work is highly experimental. You may try the
+% experiments by (1)~using the class |acmart-tagged| in the document
+% class line, and (2)~adding the command
+% \cs{DocumentMetadata}\oarg{options} in the preamble, see the file
+% \path{sample-acmsmall-tagged.tex}. If you do this, please \emph{do
+% not ask ACM for support}. On the other hand, bug reports at
+% \url{https://github.com/borisveytsman/acmart/issues} will be
+% appreciated.
+%
%
%
% \StopEventually{
@@ -2263,8 +2275,9 @@
%<*gobble>
\ProvidesFile{acmart.dtx}
%</gobble>
-%<class>\ProvidesClass{acmart}
-[2024/05/27 v2.08 Typesetting articles for the Association for Computing Machinery]
+%<class&!tagged>\ProvidesClass{acmart}
+%<tagged>\ProvidesClass{acmart-tagged}
+[2024/08/25 v2.09 Typesetting articles for the Association for Computing Machinery]
% \end{macrocode}
%
% \changes{v1.00}{2016/04/14}{First released version}
@@ -2401,7 +2414,8 @@
\end{document}
%</gobble>
%<*class>
-\def\@classname{acmart}
+%<!tagged>\def\@classname{acmart}
+%<tagged>\def\@classname{acmart-tagged}
% \end{macrocode}
%
%
@@ -2442,13 +2456,13 @@
% \changes{1.87}{2022/08/13}{New format: acmcp}
% The possible formats
% \begin{macrocode}
-\define@choicekey*+{acmart.cls}{format}[\ACM@format\ACM@format@nr]{%
+\define@choicekey*+{\@classname.cls}{format}[\ACM@format\ACM@format@nr]{%
manuscript, acmsmall, acmlarge, acmtog, sigconf, siggraph,
sigplan, sigchi, sigchi-a, acmengage, acmcp}[manuscript]{}{%
\ClassError{\@classname}{The option format must be manuscript,
acmsmall, acmlarge, acmtog, sigconf, siggraph,
sigplan, sigchi or sigchi-a}}
-\def\@DeclareACMFormat#1{\DeclareOptionX{#1}{\setkeys{acmart.cls}{format=#1}}}
+\def\@DeclareACMFormat#1{\DeclareOptionX{#1}{\setkeys{\@classname.cls}{format=#1}}}
\@DeclareACMFormat{manuscript}
\@DeclareACMFormat{acmsmall}
\@DeclareACMFormat{acmlarge}
@@ -2468,7 +2482,7 @@
% \begin{macro}{\if@ACM@screen}
% Whether we use screen mode
% \begin{macrocode}
-\define@boolkey+{acmart.cls}[@ACM@]{screen}[true]{%
+\define@boolkey+{\@classname.cls}[@ACM@]{screen}[true]{%
\if@ACM@screen
\PackageInfo{\@classname}{Using screen mode}%
\else
@@ -2483,7 +2497,7 @@
% \begin{macro}{\if@ACM@urlbreakonhyphens}
% \changes{1.60}{2019/04/22}{introduced macro}
% \begin{macrocode}
-\define@boolkey+{acmart.cls}[@ACM@]{urlbreakonhyphens}[true]{%
+\define@boolkey+{\@classname.cls}[@ACM@]{urlbreakonhyphens}[true]{%
\if@ACM@urlbreakonhyphens
\PackageInfo{\@classname}{Using breaking urls on hyphens}%
\else
@@ -2499,7 +2513,7 @@
% \changes{v1.46}{2017/08/29}{Modified description}
% Whether we define theorem-like environments.
% \begin{macrocode}
-\define@boolkey+{acmart.cls}[@ACM@]{acmthm}[true]{%
+\define@boolkey+{\@classname.cls}[@ACM@]{acmthm}[true]{%
\if@ACM@acmthm
\PackageInfo{\@classname}{Requiring acmthm}%
\else
@@ -2516,7 +2530,7 @@
% \changes{v1.48}{2017/09/09}{Review mode now switches on folios}
% Whether we use review mode
% \begin{macrocode}
-\define@boolkey+{acmart.cls}[@ACM@]{review}[true]{%
+\define@boolkey+{\@classname.cls}[@ACM@]{review}[true]{%
\if@ACM@review
\PackageInfo{\@classname}{Using review mode}%
\AtBeginDocument{\@ACM@printfoliostrue}%
@@ -2533,7 +2547,7 @@
% \changes{v1.03}{2016/04/22}{Added macro}
% Whether we use author's-version mode
% \begin{macrocode}
-\define@boolkey+{acmart.cls}[@ACM@]{authorversion}[true]{%
+\define@boolkey+{\@classname.cls}[@ACM@]{authorversion}[true]{%
\if@ACM@authorversion
\PackageInfo{\@classname}{Using authorversion mode}%
\else
@@ -2550,7 +2564,7 @@
% Special option for non-ACM publications
% using the ACM typesetting options.
% \begin{macrocode}
-\define@boolkey+{acmart.cls}[@ACM@]{nonacm}[true]{%
+\define@boolkey+{\@classname.cls}[@ACM@]{nonacm}[true]{%
\if@ACM@nonacm
\PackageInfo{\@classname}{Using nonacm mode}%
\AtBeginDocument{\@ACM@printacmreffalse}%
@@ -2570,7 +2584,7 @@
% \changes{v1.57}{2018/12/16}{Added macro}
% Whether to balance the last page
% \begin{macrocode}
-\define@boolkey+{acmart.cls}[@ACM@]{balance}[true]{}{%
+\define@boolkey+{\@classname.cls}[@ACM@]{balance}[true]{}{%
\PackageError{\@classname}{The option balance can be either true or
false}}
\ExecuteOptionsX{balance}
@@ -2583,7 +2597,7 @@
% \changes{v1.76}{2021/03/16}{Added macro}
% Whether to balance the last page
% \begin{macrocode}
-\define@boolkey+{acmart.cls}[@ACM@]{pbalance}[true]{}{%
+\define@boolkey+{\@classname.cls}[@ACM@]{pbalance}[true]{}{%
\PackageError{\@classname}{The option pbalance can be either true or
false}}
\ExecuteOptionsX{pbalance=false}
@@ -2601,7 +2615,7 @@
% \begin{macro}{\if@ACM@natbib}
% Whether we use |natbib| mode
% \begin{macrocode}
-\define@boolkey+{acmart.cls}[@ACM@]{natbib}[true]{%
+\define@boolkey+{\@classname.cls}[@ACM@]{natbib}[true]{%
\if@ACM@natbib
\PackageInfo{\@classname}{Explicitly selecting natbib mode}%
\else
@@ -2617,7 +2631,7 @@
% \begin{macro}{\if@ACM@anonymous}
% Whether we use anonymous mode
% \begin{macrocode}
-\define@boolkey+{acmart.cls}[@ACM@]{anonymous}[true]{%
+\define@boolkey+{\@classname.cls}[@ACM@]{anonymous}[true]{%
\if@ACM@anonymous
\PackageInfo{\@classname}{Using anonymous mode}%
\else
@@ -2634,7 +2648,7 @@
% \changes{v1.33}{2017/03/10}{Added macro (Michael D.~Adams)}
% Whether we use timestamp mode
% \begin{macrocode}
-\define@boolkey+{acmart.cls}[@ACM@]{timestamp}[true]{%
+\define@boolkey+{\@classname.cls}[@ACM@]{timestamp}[true]{%
\if@ACM@timestamp
\PackageInfo{\@classname}{Using timestamp mode}%
\else
@@ -2652,7 +2666,7 @@
% \changes{v1.36}{2017/05/13}{Corrected typo, thanks to bargteil}
% Whether we use author-draft mode
% \begin{macrocode}
-\define@boolkey+{acmart.cls}[@ACM@]{authordraft}[true]{%
+\define@boolkey+{\@classname.cls}[@ACM@]{authordraft}[true]{%
\if@ACM@authordraft
\PackageInfo{\@classname}{Using authordraft mode}%
\@ACM@timestamptrue
@@ -2788,13 +2802,13 @@
\ClassWarning{\@classname}{%
The format siggraph is now obsolete.\MessageBreak
I am switching to sigconf.}
- \setkeys{acmart.cls}{format=sigconf}
+ \setkeys{\@classname.cls}{format=sigconf}
\fi
\ifnum\ACM@format@nr=7\relax % sigchi
\ClassWarning{\@classname}{%
The format sigchi is now obsolete.\MessageBreak
I am switching to sigconf.}
- \setkeys{acmart.cls}{format=sigconf}
+ \setkeys{\@classname.cls}{format=sigconf}
\fi
\ifnum\ACM@format@nr=8\relax % sigchi
\ClassWarning{\@classname}{%
@@ -2861,6 +2875,42 @@
% \changes{v1.38}{2017/05/13}{Increase default font size for SIGPLAN}
% \changes{v1.87}{2022/08/27}{Set font sizes for |acmengage| and |acmcp|}
%
+%<*tagged>
+% \changes{v2.09}{2022/08/25}{Saved the old definitions (Ulrike's
+% code}
+% Before we load the base class we want to save the original
+% definitions of sectioning commands since |acmart| redefines them,
+% and we need the vanilla versions.
+% \begin{macro}{\@startsection@kernel}
+% \changes{v2.00}{2023/11/19}{Added macro}
+% \begin{macrocode}
+\let\@startsection@kernel\@startsection
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@xsect@kernel}
+% \changes{v2.00}{2023/11/19}{Added macro}
+% \begin{macrocode}
+\let\@xsect@kernel\@xsect
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@sect@kernel}
+% \changes{v2.00}{2023/11/19}{Added macro}
+% \begin{macrocode}
+\let\@sect@kernel\@sect
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@ssect@kernel}
+% \changes{v2.00}{2023/11/19}{Added macro}
+% \begin{macrocode}
+\let\@ssect@kernel\@ssect
+% \end{macrocode}
+% \end{macro}
+%
+%</tagged>
+%
%
% At this point we either have \cs{ACM@fontsize} or use defaults
% \begin{macrocode}
@@ -3258,6 +3308,14 @@
% We need to do this early since we want |hyperref| to have a chance
% to redefine them again:
% \begin{macrocode}
+%</class>
+%<*tagged>
+\let\@startsection\@startsection@kernel
+\let\@sect\@sect@kernel
+\let\@ssect\@ssect@kernel
+\let\@xsect\@xsect@kernel
+%</tagged>
+%<*class&!tagged>
\def\@startsection#1#2#3#4#5#6{%
\if@noskipsec \leavevmode \fi
\par
@@ -3337,7 +3395,6 @@
\fi}%
\fi
\ignorespaces}
-\def\@seccntformat#1{\csname the#1\endcsname\quad}
\def\@ssect#1#2#3#4#5{%
\@tempskipa #3\relax
\ifdim \@tempskipa>\z@
@@ -3350,11 +3407,14 @@
\def\@svsechd{#4{\hskip #1\relax #5}}%
\fi
\@xsect{#3}}
+%</class&!tagged>
+%<*class>
+\def\@seccntformat#1{\csname the#1\endcsname\quad}
% \end{macrocode}
%
% \end{macro}
%
-% \begin{macro}{\@startsection}
+% \begin{macro}{\@starttoc}
% \changes{v1.31}{2017/03/04}{Redefined macro}
% \changes{v1.43}{2017/07/09}{Added \cs{makeatletter}}
% The |amsart| package redefines \cs{startsection}. Here we redefine
@@ -3365,7 +3425,9 @@
\par\removelastskip\vskip\z@skip
\@startsection{section}\@M\z@{\linespacing\@plus\linespacing}%
{.5\linespacing}{\centering\contentsnamefont}{#2}%
+%<tagged>\@starttoc@cfgpoint@before{#1}%NEW<<<<<<<<<< (name will change)
\@input{\jobname.#1}%
+%<tagged>\@starttoc@cfgpoint@after{#1}%NEW<<<<<<<<<<<< (name will change)
\if@filesw
\@xp\newwrite\csname tf@#1\endcsname
\immediate\@xp\openout\csname tf@#1\endcsname \jobname.#1\relax
@@ -5974,29 +6036,9 @@
%
% \begin{macro}{\@ACM@copyright@check@cc}
% \changes{v1.87}{2022/07/30}{Added macro}
-% At present cC licenses can be used only for acmengage format or for
-% non-acm stuff. This macro checks whether the CC license is
-% applicable and generates an error if not.
% \changes{v2.00}{2023/10/22}{Moved to warning}
-% \begin{macrocode}
-\def\@ACM@copyright@check@cc{%
- \if@ACM@nonacm
- \ClassInfo{\@classname}{Using CC license with a non-acm
- material}%
- \else
- \if@ACM@engage
- \ClassInfo{\@classname}{Using CC license with ACM Enage
- material}%
- \else
- \ClassWarning{\@classname}{%
- Sorry, Creative Commons licenses are\MessageBreak
- currently not used with ACM publications\MessageBreak
- typeset by the authors}{Please use nonacm
- option or ACM Engage class to enable CC licenses}%
- \fi
- \fi}
-% \end{macrocode}
-%
+% \changes{v2.09}{2024/08/25}{Deleted macro}
+% This macro is no longer needed due to the change in ACM policy.
% \end{macro}
%
% \begin{macro}{\@copyrightpermission}
@@ -6007,8 +6049,8 @@
% \changes{v1.85}{2022/05/08}{Added CC licenses}
% \changes{v1.87}{2022/07/30}{CC licenses now are allowed only for
% non-acm or ACM engage publications}
-% \changes{v2.00}{2023/10/24}{Rewrote wording}
-% \changes{v2.00}{2023/10/24}{Rewrote wording}
+% \changes{v2.09}{2024/08/25}{Deleted checking whether CC licenses are
+% allowed}
% The canned permission block.
% \begin{macrocode}
\def\@copyrightpermission{%
@@ -6139,7 +6181,6 @@
disseminate the work on their personal and corporate Web sites with
the appropriate attribution.
\or % CC
- \@ACM@copyright@check@cc
\IfEq{\ACM@cc@type}{zero}{%
\def\ACM@CC@Url{https://creativecommons.org/publicdomain/zero/1.0/legalcode}}{%
\edef\ACM@CC@Url{https://creativecommons.org/licenses/\ACM@cc@type/\ACM@cc@version/legalcode}}%
@@ -6471,7 +6512,7 @@
pdfsubject={\@concepts},
pdfkeywords={\@keywords},
pdfcreator={LaTeX with acmart
- \csname ver@acmart.cls\endcsname\space
+ \csname ver@\@classname.cls\endcsname\space
and hyperref
\csname ver@hyperref.sty\endcsname}}%
\andify\authors
@@ -7588,6 +7629,18 @@
%
% \end{macro}
%
+%<*tagged>
+% We stop tagging inside maketitle for now. Ulrike's code again.
+% \begin{macrocode}
+\ExplSyntaxOn
+\AddToHook{cmd/maketitle/before}
+ {\tagstructbegin{tag=Title}\tagmcbegin{} \tag_stop:}
+\AddToHook{cmd/maketitle/after}
+ {\tag_start:\tagmcend\tagstructend }
+\ExplSyntaxOff
+% \end{macrocode}
+%</tagged>
+%
%\subsection{Headers and Footers}
%\label{sec:head_foot}
%
@@ -8129,28 +8182,33 @@
% \changes{v1.69}{2020/02/02}{No dots for unindented paragraphs}
% Sectioning is different for different levels
% \begin{macrocode}
-\renewcommand\section{\@startsection{section}{1}{\z@}%
+\renewcommand\section{\def\@toclevel{1}%
+ \@startsection{section}{1}{\z@}%
{-.75\baselineskip \@plus -2\p@ \@minus -.2\p@}%
{.25\baselineskip}%
{\ACM@NRadjust\@secfont}}
-\renewcommand\subsection{\@startsection{subsection}{2}{\z@}%
+\renewcommand\subsection{\def\@toclevel{2}%
+ \@startsection{subsection}{2}{\z@}%
{-.75\baselineskip \@plus -2\p@ \@minus -.2\p@}%
{.25\baselineskip}%
{\ACM@NRadjust\@subsecfont}}
-\renewcommand\subsubsection{\@startsection{subsubsection}{3}{\z@}%
+\renewcommand\subsubsection{\def\@toclevel{3}%
+ \@startsection{subsubsection}{3}{\z@}%
{-.5\baselineskip \@plus -2\p@ \@minus -.2\p@}%
{-3.5\p@}%
{\ACM@NRadjust{\@subsubsecfont\@adddotafter}}}
-\renewcommand\paragraph{\@startsection{paragraph}{4}{\parindent}%
+\renewcommand\paragraph{\def\@toclevel{4}%
+ \@startsection{paragraph}{4}{\parindent}%
{-.5\baselineskip \@plus -2\p@ \@minus -.2\p@}%
{-3.5\p@}%
{\ACM@NRadjust{\@parfont\@adddotafter}}}
-\newcommand\noindentparagraph{\@startsection{paragraph}{4}{\z@}%
+\newcommand\noindentparagraph{\def\@toclevel{4}%
+ \@startsection{paragraph}{4}{\z@}%
{-.5\baselineskip \@plus -2\p@ \@minus -.2\p@}%
{-3.5\p@}%
{\ACM@NRadjust{\@parfont}}}
-
-\renewcommand\part{\@startsection{part}{9}{\z@}%
+\renewcommand\part{\def\@toclevel{9}%
+ \@startsection{part}{9}{\z@}%
{-10\p@ \@plus -4\p@ \@minus -2\p@}%
{4\p@}%
{\ACM@NRadjust\@parfont}}
diff --git a/Master/texmf-dist/source/latex/acmart/acmart.ins b/Master/texmf-dist/source/latex/acmart/acmart.ins
index d17dc066fd7..95c15962206 100644
--- a/Master/texmf-dist/source/latex/acmart/acmart.ins
+++ b/Master/texmf-dist/source/latex/acmart/acmart.ins
@@ -13,6 +13,7 @@
\generate{%
\file{acmart.cls}{\from{acmart.dtx}{class}}
+ \file{acmart-tagged.cls}{\from{acmart.dtx}{class,tagged}}
}
\obeyspaces
diff --git a/Master/texmf-dist/source/latex/babel/babel.dtx b/Master/texmf-dist/source/latex/babel/babel.dtx
index 6b6da6ed7cf..11cb47c561f 100644
--- a/Master/texmf-dist/source/latex/babel/babel.dtx
+++ b/Master/texmf-dist/source/latex/babel/babel.dtx
@@ -32,7 +32,7 @@
%
% \iffalse
%<*filedriver>
-\ProvidesFile{babel.dtx}[2024/06/02 v24.6 The Babel package]
+\ProvidesFile{babel.dtx}[2024/08/29 v24.9 The Babel package]
\documentclass{ltxdoc}
\GetFileInfo{babel.dtx}
\usepackage{fontspec}
@@ -50,6 +50,8 @@
{NotoSans-Regular.ttf}
\setmonofont[Scale=.86, FakeStretch=.97]{DejaVu Sans Mono}
\raggedright
+\frenchspacing
+\addtolength{\oddsidemargin}{1em}
\addtolength{\textwidth}{25pt}
\addtolength{\textheight}{3.5cm}
\addtolength{\topmargin}{-2cm}
@@ -65,7 +67,7 @@
\newcommand*\m[1]{\mbox{$\langle$\normalfont\itshape#1\/$\rangle$}}
\newcommand*\langlist{%
\meta{language}\texttt{,}\meta{language}\texttt{,}...}
-\newcommand*\langvar{\m{lang}}
+\newcommand*\langvar{\m{language}}
\newcommand*\Lopt[1]{\textsf{#1}}
\newcommand*\Lenv[1]{\texttt{#1}}
\newcommand*\menv[1]{\char`\{#1\char`\}}
@@ -75,7 +77,6 @@
\newcommand*\file[1]{\texttt{#1}}
\newcommand*\cls[1]{\texttt{#1}}
\newcommand*\pkg[1]{\texttt{#1}}
-\addtolength{\oddsidemargin}{1em}
\setlength{\leftmargini}{1.5em}
\usepackage{framed}
\usepackage{multicol}
@@ -128,6 +129,13 @@
\let\bblexv\endverbatim
\newcommand\setengine{\def\engine}
\let\engine\relax
+\begingroup
+ \catcode`\<=13
+ \catcode`\>=13
+ \catcode`\|=13
+ \AtBeginDocument{%
+ \gdef|{\verb|\def<##1>{$\langle${\rmfamily\itshape##1}$\rangle$}}}
+\endgroup
\def\verbatim{%
\begin{shaded*}%
\ifx\engine\relax\else
@@ -160,7 +168,7 @@
\def\args#1{%
\def\bbl@tempa{#1}%
\ifx\bbl@tempa\@empty\else#1\vskip1ex\fi\ignorespaces}
-\begingroup % Changes to ltxdoc
+\begingroup % Changes to ltxdoc (add <<...>> syntax)
\catcode`\<\active
\catcode`\>\active
\gdef\check@plus@etc{%
@@ -199,9 +207,7 @@
\makeatother
\begin{document}
\title{Babel, a multilingual package for use with \LaTeX's standard
- document classes\thanks{During the development ideas from Nico
- Poppelier, Piet van Oostrum and many others have been used.
- Bernd Raichle has provided many helpful suggestions.}}
+ document classes.}
\author{Johannes Braams\\
Javier Bezos}
@@ -682,7 +688,7 @@ class option:
\begin{itemize}
\item Loading directly |sty| files in \LaTeX{} (ie,
- |\usepackage|\marg{language}) is deprecated and you will get the
+ |\usepackage{<language>}|) is deprecated and you will get the
error:\footnote{In old versions the error read ``You have used an
old interface to call babel'', not very helpful.}
\trouble{You are loading directly a language style}
@@ -790,7 +796,7 @@ hardcode value.
which may break the vertical spacing in some cases (for example,
between lists or at the beginning of a table cell). \New{3.64} The
behavior can be adjusted with
- |\babeladjust{select.write=|\m{mode}|}|, where \m{mode} is |shift|
+ |\babeladjust{select.write=<mode>}|, where \m{mode} is |shift|
(which shifts the skips down and adds a |\penalty|); |keep| (the
default -- with it the |\write| and the skips are kept in the order
they are written), and |omit| (which may seem a too drastic
@@ -891,10 +897,10 @@ set -- in this case, |\foreignlanguage| emits a |\leavevmode|, while
commands above can be cumbersome. With this tool shorter names can be
defined. It adds nothing really new -- it is just syntactical sugar.
-It defines |\text|\m{tag1}\marg{text} to be
-|\foreignlanguage|\marg{language1}\marg{text}, and |\begin|\marg{tag1}
-to be |\begin{otherlanguage*}|\marg{language1}, and so on. Note
-|\|\m{tag1} is also allowed, but remember to set it locally inside a
+It defines |\text<tag1>{<text>}| to be
+|\foreignlanguage{<language1>}{<text>}|, and |\begin{<tag1>}|
+to be |\begin{otherlanguage*}{<language1>}|, and so on. Note
+|\<tag1>| is also allowed, but remember to set it locally inside a
group.
\begin{warning}
@@ -1074,9 +1080,8 @@ stop working). Therefore, a starred version
|\useshorthands*|\marg{char} is provided, which makes sure shorthands
are always activated.
-Currently, if the package option |shorthands| is used, you must include any
-character to be activated with |\useshorthands|. This restriction will
-be lifted in a future release. % <- TODO
+If the package option |shorthands| is used, you must include any
+character to be activated with |\useshorthands|.
\Describe\defineshorthand{\texttt{[}\langlist\texttt{]}%
\marg{shorthand}\marg{code}}
@@ -1087,8 +1092,8 @@ code the shorthand should expand to.
\New{3.9a} An optional argument allows to (re)define language and
system shorthands (some languages do not activate shorthands, so you
-may want to add |\languageshorthands|\marg{lang} to the corresponding
-|\extras|\m{lang}, as explained below). By default, user shorthands
+may want to add |\languageshorthands|\marg{language} to the corresponding
+|\extras<language>|, as explained below). By default, user shorthands
are (re)defined.
User shorthands override language ones, which in turn override
@@ -1207,17 +1212,17 @@ preserved for backward compatibility.}
\begin{note}
\catcode`\|=12\relax Both \textsf{ltxdoc} and \textsf{babel} use
- \verb|\AtBeginDocument| to change some catcodes, and babel reloads
+ \verb|\AtBeginDocument| to change some catcodes, and \babel{} reloads
\textsf{hhline} to make sure \verb|:| has the right one, so if you
want to change the catcode of \verb/|/ it has to be done using the
same method at the proper place, with
\begin{verbatim}
\AtBeginDocument{\DeleteShortVerb{\|}}
\end{verbatim}
- \textit{before} loading babel. This way, when the document begins
+ \textit{before} loading \babel. This way, when the document begins
the sequence is (1) make \verb/|/ active (\textsf{ltxdoc}); (2) make
- it inactive (your settings); (3) make babel shorthands active
- (\textsf{babel)}; (4) reload \textsf{hhline} (\textsf{babel}, now
+ it inactive (your settings); (3) make \babel{} shorthands active
+ (\textsf{babel}); (4) reload \textsf{hhline} (\textsf{babel}, now
with the correct catcodes for \verb/|/ and
\verb|:|).\catcode`\|=\active
\end{note}
@@ -1230,7 +1235,7 @@ that they are taken into account irrespective of its order. The first
three options have been available in previous versions.
\Describe{KeepShorthandsActive}{}
-Tells babel not to deactivate shorthands after loading a language
+Tells \babel{} not to deactivate shorthands after loading a language
file, so that they are also available in the preamble.
\Describe{activeacute}{} For some languages \babel\ supports this
@@ -1463,7 +1468,7 @@ _\babelprovide[import, main]{georgian}_
\babel).
\end{more}
-\New{3.49} Alternatively, you can tell babel to load all or some
+\New{3.49} Alternatively, you can tell \babel{} to load all or some
languages passed as options with |\babelprovide| and not from the |ldf|
file in a few few typical cases. Thus, |provide=*| means ‘load the main
language with the |\babelprovide| mechanism instead of the |ldf| file’
@@ -1503,7 +1508,7 @@ Or also:
only if the former does not work for you. Fortunately, fonts can be
loaded twice with different renderers; for example:
\begin{verbatim}
-\babelfont[spanish]{rm}{FreeSerif}
+\babelfont[spanish]{rm}{FreeSerif}
\babelfont[hindi]{rm}[Renderer=Harfbuzz]{FreeSerif}
\end{verbatim}
\begin{description}
@@ -1520,7 +1525,7 @@ work, but some others do not, the main issue being the ‘ra’. You may
need to set explicitly the script to either |deva| or |dev2|, eg:
\begin{verbatim}
\newfontscript{Devanagari}{deva}
-\end{verbatim}
+\end{verbatim}
Other Indic scripts are still under development in the default
\luatex{} renderer, but should work with |Renderer=Harfbuzz|. They
also work with \xetex{}, although unlike with \luatex{} fine tuning
@@ -1587,7 +1592,7 @@ parameters.
% \begin{example}
% Let's assume you need only the basic features of `spanish`, so that
% the |ini| file is enough, and also a variant with your own
-% hyphenation with
+% hyphenation with
% \end{example}
\subsection{List of locales available in \cs{babelprovide}}
@@ -2320,6 +2325,28 @@ to select fonts in addition to the three basic families.
\end{warning}
\begin{troubleshooting}
+ \trouble{Package fontspec Info: Language '<lang>' not explicitly
+ supported within font '<font>' with script '<script>'.}
+ \textit{Package fontspec Info: Language '<lang>' not explicitly
+ supported within font '<font>' with script '<script>'.}.
+
+ \textbf{This is \textit{not} and error.} This info is shown by
+ \textsf{fontspec}, not by \babel. If everything is okay in your
+ document (and almost always it is), the best thing you can do is just
+ to ignore it altogether.
+
+ In some forums you can find the advice to set, more or less
+ mechanically, |Language=Default|. \textit{Do not follow it}, because
+ font features for the language will not be applied, which can be
+ relevant for many languages, like Urdu and Turkish. Set the
+ |Language| explicitly only if there is a reason to do it. If you
+ really want to conceal this message, use instead:
+\begin{verbatim}
+\PassOptionsToPackage{silent}{fontspec}
+\end{verbatim}
+\end{troubleshooting}
+
+\begin{troubleshooting}
\trouble{Package babel Info: The following fonts are not babel
standard families} \textit{Package babel Info: The following fonts
are not babel standard families}.
@@ -2414,15 +2441,15 @@ value restored.
\end{note}
Macros to be run when a language is selected can be add to
- |\extras|\m{lang}:
+ |\extras<language>|:
\begin{verbatim}
\addto\extrasrussian{\mymacro}
\end{verbatim}
There is a counterpart for code to be run when a language is
-unselected: |\noextras|\m{lang}.
+unselected: |\noextras<language>|.
\begin{note}
- These macros (|\captions|\m{lang}, |\extras|\m{lang}) may be
+ These macros (|\captions<language>|, |\extras<language>|) may be
redefined, but \textit{must not} be used as such -- they just pass
information to \babel{}, which executes them in the proper context.
\end{note}
@@ -2809,50 +2836,50 @@ _\telugucounter{section}_
Languages providing native digits in all or some variants are:
\begin{multicols}{5}
Arabic\\
-Assamese\\
+Assamese\\
Bangla\\
-Bhojpuri\\
-Bodo\\
+Bhojpuri\\
+Bodo\\
Burmese\\
-Cantonese\\
-Central Kurdish\\
+Cantonese\\
+Central Kurdish\\
Chinese\\
-Dogri\\
-Dzongkha\\
-Gujarati\\
-Haryanvi\\
-Hindi\\
-Hmong Njua\\
+Dogri\\
+Dzongkha\\
+Gujarati\\
+Haryanvi\\
+Hindi\\
+Hmong Njua\\
Kannada\\
-Kashmiri\\
-Khmer\\
+Kashmiri\\
+Khmer\\
Konkani\\
-Korean\\
-Lao\\
-Maithili\\
-Malayalam\\
-Manipuri\\
+Korean\\
+Lao\\
+Maithili\\
+Malayalam\\
+Manipuri\\
Marathi\\
Mazanderani\\
Nepali\\
Northern Kurdish\\
-Northern Luri\\
-Odia\\
+Northern Luri\\
+Odia\\
Pashto\\
Persian\\
Punjabi\\
-Rajasthani\\
-Sanskrit\\
-Santali\\
+Rajasthani\\
+Sanskrit\\
+Santali\\
Sindhi\\
-Tamil\\
+Tamil\\
Telugu\\
-Thai\\
+Thai\\
Tibetan\\
-Urdu\\
+Urdu\\
Uyghur\\
-Uzbek\\
-Vai
+Uzbek\\
+Vai
\end{multicols}
\New{3.30} With \luatex{} there is an alternative approach for mapping
@@ -3256,7 +3283,7 @@ wins), but language exceptions take precedence over global ones.
It can be used only in the preamble, and exceptions are set when the
language is first selected, thus taking into account changes of
-|\lccodes|'s done in |\extras|\m{lang} as well as the language-specific
+|\lccodes|'s done in |\extras<language>| as well as the language-specific
encoding (not set in the preamble by default). Multiple
|\babelhyphenation|'s are allowed. For example:
\begin{verbatim}
@@ -3309,7 +3336,7 @@ combination already exists, it gets replaced by the new one.
It can be used only in the preamble, and patterns are added when the
language is first selected, thus taking into account changes of
-|\lccodes|'s done in |\extras|\m{lang} as well as the language-specific
+|\lccodes|'s done in |\extras<language>| as well as the language-specific
encoding (not set in the preamble by default). Multiple
|\babelpatterns|'s are allowed.
@@ -3392,8 +3419,14 @@ some fine-tuning. More to follow in future releases.)
\hspace{2mm}%
\parbox[t]{6.6cm}{\strut#3}\par}
\bigskip\hrule\nobreak\vspace{.5mm}
-% \strut\hfil Transforms
-% \medskip\hrule\nobreak
+
+\trans{}{digits.native}{\New{24.9} An alternative to |mapdigits|,
+available in the same locales. This transform is applied before the
+first prehyphenation, while |mapdigits| is applied after the last
+posthyphenation. Another difference is |mapdigits| cannot be disabled
+in the middle of a paragraph. (This transform is \textit{not} declared
+explicitly in |ini| files. Instead, it’s defined by |babel| if the key
+\texttt{numbers/digits.native} exists.)}
\trans{Arabic}{transliteration.dad}{Applies the transliteration system
devised by Yannis Haralambous for \textsf{dad} (simple and
@@ -3638,11 +3671,10 @@ Declares a new character class, which is assigned to the characters in
hyphen (eg,~|.,;a-zA-Z|). If you need the hyphen to be assigned a
class, write it at the very beginning of the list.
-There are several predefined ‘global’ classes, namely
-|default|, |cjkideogram|, |cjkleftpunctuation|, |cjkrightpunctuation|,
-|boundary|, and |ignore|, which are described in the \xetex{} manual
-(currently CJK classes are ‘empty’, but they will be assigned in a
-future release).
+There are several predefined ‘global’ classes, namely |default|,
+|cjkideogram|, |cjkleftpunctuation|, |cjkrightpunctuation|, |boundary|,
+and |ignore|, which are described in the \xetex{} manual. These classes
+are used by the |linebreak.basic|, described below.
\Describe{\babelinterchar}{\oarg{options}\marg{locale}
\marg{class-first}\marg{class-second}\marg{code}}
@@ -3908,10 +3940,14 @@ intrinsic direction of scripts and weak directionality.)
In \xetex, |bidi-r| and |bidi-l| resort to the package \textsf{bidi}
(by Vafa Khalighi). For RL documents use the former, and for LR ones
-use the latter. However, this package patches heavily lots of macros
-and packages even if the RL script is not the main one, which can lead
-to some surprising results, so for short and simple texts (letters and
-punctuation) the |default| method can be preferable.
+use the latter.
+
+\begin{warning}
+ This package patches heavily lots of macros and packages even if the
+ RL script is not the main one, which can lead to some surprising
+ results, so for short and simple texts (letters and punctuation) the
+ |default| method is more often than not much preferable.
+\end{warning}
There are samples on GitHub, under \texttt{/required/babel/samples}.
See particularly |lua-bidibasic.tex| and |lua-secenum.tex|.
@@ -4015,7 +4051,7 @@ Arabic as @1Ùصحى العصر@0 \textit{fuá¹£á¸¥Ä l-Ê»aá¹£r} (MSA) and
\texttt{contents} $\string|$
\texttt{footnotes} $\string|$
\texttt{captions} $\string|$
- \texttt{columns} $\string|$
+ \texttt{columns} $\string|$
\texttt{graphics} $\string|$
\texttt{extras}}
@@ -4225,14 +4261,14 @@ used.
\New{3.64} This is not the only way to inject code at those points. The
events listed below can be used as a hook name in |\AddToHook| in the
-form |babel/|\m{language-name}|/|\m{event-name} (with |*| it’s applied to
+form |babel/<language-name>/<event-name>| (with |*| it’s applied to
all languages), but there is a limitation, because the parameters
passed with the \babel{} mechanism are not allowed. The |\AddToHook|
mechanism does \textit{not} replace the current one in `babel`. Its
main advantage is you can reconfigure `babel` even before loading it.
See the example below.
-\Describe{\AddBabelHook}{\oarg{lang}\marg{name}\marg{event}\marg{code}}
+\Describe{\AddBabelHook}{\oarg{language}\marg{name}\marg{event}\marg{code}}
The same name can be applied to several events. Hooks with a certain
\marg{name} may be enabled and disabled for all defined events with
@@ -4265,10 +4301,10 @@ three \TeX{} parameters (|#1|, |#2|, |#3|), with the meaning given:
\item[stopcommands] Used to reset the above, if necessary.
\item[write] This event comes just after the switching commands are
written to the |aux| file.
-\item[beforeextras] Just before executing |\extras|\m{language}. This
+\item[beforeextras] Just before executing |\extras<language>|. This
event and the next one should not contain language-dependent code
- (for that, add it to |\extras|\m{language}).
-\item[afterextras] Just after executing |\extras|\m{language}. For
+ (for that, add it to |\extras<language>|).
+\item[afterextras] Just after executing |\extras<language>|. For
example, the following deactivates shorthands in all languages:
\begin{verbatim}
\AddBabelHook{noshort}{afterextras}{\languageshorthands{none}}
@@ -4287,19 +4323,22 @@ three \TeX{} parameters (|#1|, |#2|, |#3|), with the meaning given:
other (|\string|'ed) and the original one.
\item[afterreset] \New{3.9i} Executed when selecting a language just after
|\originalTeX| is run and reset to its base value, before executing
- |\captions|\m{language} and |\date|\m{language}.
+ |\captions<language>| and |\date<language>|.
\item[begindocument] \New{3.88} Executed before the code written by
|ldf| files with |\AtBeginDocument|. The optional argument with the
language in this particular case is the language that wrote the code.
The special value |/| means ‘return to the core \babel{} definitions’
(in other words, what follows hasn’t been written by any language).
-% STILL UNDER STUDY:
-% \item[beforestart] \New{3.34} Executed either at the beginning of the
-% |aux| file (when read at the start of the document), or else at begin
-% document. In other words, it makes sure the code is executed always
-% and executed once. But be aware it is a somewhat dangerous, because
-% the scope in the first case is local, while in the second case is
-% global, so be careful with assignments.
+\item[foreign] \New{24.8} Executed by |\foreignlanguage| after the
+ language has been set up and just before typesetting the text from the
+ second argument. Its main purpose it to wrap the text with some
+ code, with the help of |\BabelWrapText|. For example, with:
+\begin{verbatim}
+\AddBabelHook{one}{foreign}{\BabelWrapText{\textit{##1}}
+\AddBabelHook{two}{foreign}{\BabelWrapText{\parse{##1}}
+\end{verbatim}
+the text becomes |\textit{\parse{<text>}}|.
+
\end{description}
Four events are used in \file{hyphen.cfg}, which are handled in a
@@ -4330,7 +4369,7 @@ selected (and just before the non-localized hooks defined with
|\AddBabelHook|).
In addition, locale-specific hooks in the form
-|babel/|\m{language-name}|/|\m{event-name} are \textit{recognized}
+|babel/<language-name>/<event-name>| are \textit{recognized}
(executed just before the localized \babel{} hooks), but they are
\textit{not predefined}. You have to do it yourself. For example, to
set |\frenchspacing| only in |bengali|:
@@ -4460,7 +4499,7 @@ between paragraphs).
For example:
\begin{verbatim}
-\babelcharproperty{`¿}{mirror}{`?}
+\babelcharproperty{`¿}{mirror}{`?}
\babelcharproperty{`-}{direction}{l} % or al, r, en, an, on, et, cs
\babelcharproperty{`)}{linebreak}{cl} % or id, op, cl, ns, ex, in, hy
\end{verbatim}
@@ -4696,7 +4735,7 @@ german hyphen.ger
With the previous settings, if the encoding when the language is
selected is |T1| then the patterns in \file{hyphenT1.ger} are
used, but otherwise use those in \file{hyphen.ger} (note the encoding
-can be set in |\extras|\m{lang}).
+can be set in |\extras<language>|).
A typical error when using \babel{} is the following:
\begin{verbatim}
@@ -4746,11 +4785,13 @@ The following assumptions are made:
\item Language names must be all lowercase. If an unknown language is
selected, \babel{} will attempt setting it after lowercasing its
name.
-\item The semantics of modifiers is not defined (on purpose). In
- most cases, they will just be simple separated options (eg,
+\item The semantics of modifiers is not defined (on purpose). In most
+ cases, they will just be simple separated options (eg,
\texttt{spanish}), but a language might require, say, a set of
options organized as a tree with suboptions (in such a case, the
- recommended separator is \verb|/|).
+ recommended separator is \verb|/|). How modifiers (saved in
+ |\BabelModifiers|) are handled are left to language styles; they can
+ use |\in@|, loop them with |\@for| or load |keyval|, for example.
\end{itemize}
Some recommendations:
@@ -4758,19 +4799,19 @@ Some recommendations:
\item The preferred shorthand is |"|, which is not used in \LaTeX{}
(quotes are entered as |``| and |''|). Other good choices are
characters which are not used in a certain context (eg, |=| in an
- ancient language). Note however |=|, |<|, |>|, |:| and the like
+ ancient language). Note however |=|, \texttt{<}, |>|, |:| and the like
can be dangerous, because they may be used as part of the syntax
of some elements (numeric expressions, key/value pairs, etc.).
\item Captions should not contain shorthands or encoding-dependent
commands (the latter is not always possible, but should be clearly
documented). They should be defined using the LICR. You may
also use the new tools for encoded strings, described below.
-\item Avoid adding things to |\noextras|\m{lang} except for umlauthigh
+\item Avoid adding things to |\noextras<language>| except for umlauthigh
and friends, |\bbl@deactivate|, |\bbl@(non)frenchspacing|, and
- language-specific macros. Use always, if possible, |\babel@save| and
+ language-specific macros. Use always, wherever possible, |\babel@save| and
|\babel@savevariable| (except if you still want to have access to the
previous value). Do not reset a macro or a setting to a hardcoded
- value. Never. Instead save its value in |\extras|\m{lang}.
+ value. Never. Instead save its value in |\extras<language>|.
\item Do not switch scripts. If you want to make sure a set of glyphs
is used, switch either the font encoding (low-level) or the language
(high-level, which in turn may switch the font encoding). Usage of things
@@ -4780,19 +4821,18 @@ Some recommendations:
prefix. It is used by \babel{} and it can lead to incompatibilities.
\end{itemize}
-There are no special requirements for documenting your language
-files. Now they are not included in the base \babel{} manual, so
-provide a standalone document suited for your needs, as well as other
-files you think can be useful. A PDF and a ``readme'' are strongly
-recommended.
+There are no special requirements for documenting your language files.
+Just provide a standalone document suited to your needs, as well as
+other files you think can be useful. A PDF and a ``readme'' are
+strongly recommended.
\subsection{Guidelines for contributed languages}
\label{contribute}
Currently, the easiest way to contribute a new language is by taking
one of the 500 or so |ini| templates available on GitHub as a basis.
-Just make a pull request or download it and then, after filling the
-fields, sent it to me. Fell free to ask for help or to make feature
+Just make a pull request or download it, and then, after filling out the
+fields, sent it to me. Feel free to ask for help or to make features
requests.
As to \texttt{ldf} files, now language files are “outsourced†and are
@@ -4806,8 +4846,8 @@ but if you want to do it, here are a few guidelines.
\begin{itemize}
\item Do not hesitate stating on the file heads you are the author and the
- maintainer, if you actually are. There is no need to state the babel
- maintainer(s) as authors if they have not contributed significantly
+ maintainer, if you actually are. There is no need to state the \babel{}
+ maintainer(s) as author(s) if they have not contributed significantly
to your language files.
\item Fonts are not strictly part of a language, so they are best placed
in the corresponding TeX tree. This includes not only \texttt{tfm},
@@ -4815,19 +4855,20 @@ but if you want to do it, here are a few guidelines.
like, but also \texttt{fd} ones.
\item Font and input encodings are usually best placed in the
corresponding tree, too, but sometimes they belong more naturally to
- the babel style. Note you may also need to define a LICR.
-\item \Babel{} ldf files may just interface a framework, as it happens often
- with Oriental languages/scripts. This framework is best placed in its
- own directory.
+ the \babel{} style. Note you may also need to define a LICR
+ (\textit{TLC3}, I, 757f.).
+\item \Babel{} \texttt{ldf} files may just interface a framework, as it
+ happens often with Oriental languages/scripts. This framework is best
+ placed in its own directory.
\end{itemize}
The following page provides a starting point for \texttt{ldf} files:
\texttt{http://www.texnia.com/incubator.html}. See also
\texttt{https://latex3.github.io/babel/guides/list-of-locale-templates.html}.
-If you need further assistance and technical advice in the
-development of language styles, I am willing to help you. And of
-course, you can make any suggestion you like.
+If you need further assistance and technical advice in the development
+of language styles, I will be happy to help you. And of course, you can
+make any suggestion you like.
\subsection{Basic macros}
@@ -4860,7 +4901,7 @@ two parameters. For example:
\renewcommand\spanishhyphenmins{34}
\end{verbatim}
(Assigning |\lefthyphenmin| and |\righthyphenmin| directly in
-|\extras<lang>| has no effect.)
+|\extras<language>| has no effect.)
\DescribeMacro{\providehyphenmins}
The macro |\providehyphenmins| should be used in the language
@@ -5239,12 +5280,12 @@ A real example can be:
\EndBabelCommands
\end{verbatim}
-When used in |ldf| files, previous values of |\|\m{category}\m{language}
+When used in |ldf| files, previous values of |\<category><language>|
are overridden, which means the old way to define strings still works
and used by default (to be precise, is first set to undefined and then
strings are added). However, when used in the preamble or in a
package, new settings are added to the previous ones, if the language
-exists (in the \babel{} sense, ie, if |\date|\m{language} exists).
+exists (in the \babel{} sense, ie, if |\date<language>| exists).
\begin{note}
The package option |strings| introduced in version 3.9 (around 2013)
@@ -5340,7 +5381,7 @@ version), and it can consist of a comma-separated list. For example:
\end{verbatim}
is true with any of these two environment selectors.
-Its natural place of use is in hooks or in |\extras|\m{language}.
+Its natural place of use is in hooks or in |\extras<language>|.
\else
@@ -5350,13 +5391,14 @@ Its natural place of use is in hooks or in |\extras|\m{language}.
\section{Acknowledgements}
-I would like to thank all who volunteered as $\beta$-testers for their
-time. Michel Goossens supplied contributions for most of the other
-languages. Nico Poppelier helped polish the text of the documentation
-and supplied parts of the macros for the Dutch language. Paul Wackers
-and Werenfried Spit helped find and repair bugs. During the further
-development of the babel system I received much help from Bernd
-Raichle, for which I am grateful.
+In the initial stages of the development of \babel, Bernd Raichle
+provided many helpful suggestions and Michel Goossens supplied
+contributions for many languages. Ideas from Nico Poppelier, Piet van
+Oostrum and many others have been used. Paul Wackers and Werenfried
+Spit helped find and repair bugs.
+
+More recently, there are significant contributions by Salim Bou, Ulrike
+Fischer and Udi Fogiel.
There are also many contributors for specific languages, which are
mentioned in the respective files. Without them, \babel{} just
@@ -5401,25 +5443,11 @@ wouldn’t exist.
\end{thebibliography}
\end{document}
%</filedriver>
-%
% \fi
%
% \addtolength{\oddsidemargin}{-15pt}
% \addtolength{\textwidth}{50pt}
%
-%\begingroup
-% \catcode`<=\active%
-% \catcode`>=\active
-% \makeatletter
-% \gdef\MakePrivateLetters{%
-% \catcode`@=11\relax
-% \gdef<##1{\ifx##1@$\langle\langle$\bgroup\itshape\rmfamily
-% \expandafter\bblref
-% \else\string<##1\fi}%
-% \gdef\bblref##1@>{##1\/\egroup$\rangle\rangle$}}%
-% \global\let\check@percent\saved@check@percent
-%\endgroup
-%
% \small
%
% The \babel{} package is being developed incrementally, which means
@@ -5431,7 +5459,7 @@ wouldn’t exist.
% \section{Identification and loading of required files}
%
% \textit{Code documentation is still under revision.}
-
+%
% The \babel{} package after unpacking consists of the following files:
% \begin{description}
% \itemsep=-\parskip
@@ -5445,26 +5473,26 @@ wouldn’t exist.
% \item[hyphen.cfg] is the file to be used when generating the
% formats to load hyphenation patterns.
% \end{description}
-% There some additional |tex|, |def| and |lua| files
+% There some additional |tex|, |def| and |lua| files.
%
% The \babel{} installer extends \textsf{docstrip} with a few
% ``pseudo-guards'' to set ``variables'' used at installation time.
-% They are used with |<||@name@>| at the appropriate places in the
+% They are used with \texttt{<@name@>} at the appropriate places in the
% source code and defined with either
% $\langle\langle$\textit{name}=\textit{value}$\rangle\rangle$, or with
% a series of lines between
% $\langle\langle$|*|\textit{name}$\rangle\rangle$ and
% $\langle\langle$|/|\textit{name}$\rangle\rangle$. The latter is
% cumulative (eg, with \textit{More package options}). That brings a
-% little bit of literate programming. The guards |<-name>| and
-% |<+name>| have been redefined, too. See |babel.ins| for further
+% little bit of literate programming. The guards \texttt{<-name>} and
+% \texttt{<+name>} have been redefined, too. See |babel.ins| for further
% details.
%
% \section{\texttt{locale} directory}
%
% A required component of \babel{} is a set of |ini| files with basic
-% definitions for about 250 languages. They are distributed as a
-% separate |zip| file, not packed as |dtx|. Most of them are
+% definitions for about 300 languages. They are distributed as a
+% separate |zip| file, not packed as |dtx|. Many of them are
% essentially finished (except bugs and mistakes, of course). Some of
% them are still incomplete (but they will be usable), and there are
% some omissions (eg, there are no geographic areas in Spanish). Not
@@ -5479,15 +5507,14 @@ wouldn’t exist.
% \section{Tools}
%
% \begin{macrocode}
-%<<version=24.6>>
-%<<date=2024/06/02>>
+%<<version=24.9>>
+%<<date=2024/08/29>>
% \end{macrocode}
%
% \textbf{Do not use the following macros in \texttt{ldf} files. They
-% may change in the future}. This applies mainly to those recently
+% may change in the future.} This applies mainly to those recently
% added for replacing, trimming and looping. The older ones, like
% |\bbl@afterfi|, will not change.
-%
% We define some basic macros which just make the code cleaner.
% |\bbl@add| is now used internally instead of |\addto| because of
% the unpredictable behavior of the latter. Used in
@@ -5521,11 +5548,11 @@ wouldn’t exist.
\def\bbl@for#1#2#3{\bbl@loopx#1{#2}{\ifx#1\@empty\else#3\fi}}
% \end{macrocode}
%
-% \begin{macro}{\bbl@add@list}
-% This internal macro adds its second argument to a comma
-% separated list in its first argument. When the list is not
-% defined yet (or empty), it will be initiated. It presumes
-% expandable character strings.
+% \begin{macro}{\bbl@add@list}
+% This internal macro adds its second argument to a comma separated
+% list in its first argument. When the list is not defined yet (or
+% empty), it will be initiated. It presumes expandable character
+% strings.
%
% \begin{macrocode}
\def\bbl@add@list#1#2{%
@@ -5536,36 +5563,35 @@ wouldn’t exist.
#2}}
% \end{macrocode}
%
-% \end{macro}
+% \end{macro}
%
-% \begin{macro}{\bbl@afterelse}
-% \begin{macro}{\bbl@afterfi}
-% Because the code that is used in the handling of active
-% characters may need to look ahead, we take extra care to `throw'
-% it over the |\else| and |\fi| parts of an
-% |\if|-statement\footnote{This code is based on code presented in
-% TUGboat vol. 12, no2, June 1991 in ``An expansion Power Lemma''
-% by Sonja Maus.}. These macros will break if another |\if...\fi|
-% statement appears in one of the arguments and it is not enclosed
-% in braces.
+% \begin{macro}{\bbl@afterelse}
+% \begin{macro}{\bbl@afterfi}
+% Because the code that is used in the handling of active characters
+% may need to look ahead, we take extra care to `throw' it over the
+% |\else| and |\fi| parts of an |\if|-statement\footnote{This code is
+% based on code presented in TUGboat vol. 12, no2, June 1991 in ``An
+% expansion Power Lemma'' by Sonja Maus.}. These macros will break if
+% another |\if...\fi| statement appears in one of the arguments and it
+% is not enclosed in braces.
%
% \begin{macrocode}
\long\def\bbl@afterelse#1\else#2\fi{\fi#1}
\long\def\bbl@afterfi#1\fi{\fi#1}
% \end{macrocode}
%
-% \end{macro}
-% \end{macro}
+% \end{macro}
+% \end{macro}
%
% \begin{macro}{\bbl@exp}
%
-% Now, just syntactical sugar, but it makes partial expansion of
-% some code a lot more simple and readable. Here |\\| stands for
-% |\noexpand|, |\<..>| for |\noexpand| applied to a built macro
-% name (which does not define the macro if undefined to
-% |\relax|, because it is created locally), and |\[..]| for one-level
-% expansion (where |..| is the macro name without the backslash). The
-% result may be followed by extra arguments, if necessary.
+% Now, just syntactical sugar, but it makes partial expansion of some
+% code a lot more simple and readable. Here |\\| stands for
+% |\noexpand|, |\<..>| for |\noexpand| applied to a built macro name
+% (which does not define the macro if undefined to |\relax|, because it
+% is created locally), and |\[..]| for one-level expansion (where |..|
+% is the macro name without the backslash). The result may be followed
+% by extra arguments, if necessary.
%
% \begin{macrocode}
\def\bbl@exp#1{%
@@ -5582,13 +5608,13 @@ wouldn’t exist.
% \end{macro}
%
% \begin{macro}{\bbl@trim}
-% The following piece of code is stolen (with some changes) from
-% \textsf{keyval}, by David Carlisle. It defines two macros:
-% |\bbl@trim| and |\bbl@trim@def|. The first one strips the leading
-% and trailing spaces from the second argument and then applies the
-% first argument (a macro, |\toks@| and the like). The second one,
-% as its name suggests, defines the first argument as the stripped
-% second argument.
+% The following piece of code is stolen (with some changes) from
+% \textsf{keyval}, by David Carlisle. It defines two macros:
+% |\bbl@trim| and |\bbl@trim@def|. The first one strips the leading and
+% trailing spaces from the second argument and then applies the first
+% argument (a macro, |\toks@| and the like). The second one, as its
+% name suggests, defines the first argument as the stripped second
+% argument.
%
% \begin{macrocode}
\def\bbl@tempa#1{%
@@ -5608,11 +5634,11 @@ wouldn’t exist.
% \end{macro}
%
% \begin{macro}{\bbl@ifunset}
-% To check if a macro is defined, we create a new macro, which does
-% the same as |\@ifundefined|. However, in an $\epsilon$-tex engine,
-% it is based on |\ifcsname|, which is more efficient, and does not
-% waste memory. Defined inside a group, to avoid \cs{ifcsname} being
-% implicitly set to |\relax| by the |\csname| test.
+% To check if a macro is defined, we create a new macro, which does the
+% same as |\@ifundefined|. However, in an $\epsilon$-tex engine, it is
+% based on |\ifcsname|, which is more efficient, and does not waste
+% memory. Defined inside a group, to avoid \cs{ifcsname} being
+% implicitly set to |\relax| by the |\csname| test.
%
% \begin{macrocode}
\begingroup
@@ -5639,9 +5665,9 @@ wouldn’t exist.
% \end{macro}
%
% \begin{macro}{\bbl@ifblank}
-% A tool from \textsf{url}, by Donald Arseneau, which tests if a
-% string is empty or space. The companion macros tests if a macro is
-% defined with some `real' value, ie, not |\relax| and not empty,
+% A tool from \textsf{url}, by Donald Arseneau, which tests if a string
+% is empty or space. The companion macros tests if a macro is defined
+% with some `real' value, ie, not |\relax| and not empty,
%
% \begin{macrocode}
\def\bbl@ifblank#1{%
@@ -5716,7 +5742,7 @@ wouldn’t exist.
% because they are retokenized). It may change! (or even merged with
% |\bbl@replace|; I'm not sure checking the replacement is really
% necessary or just paranoia).
-%
+%
% \begin{macrocode}
\ifx\detokenize\@undefined\else % Unused macros if old Plain TeX
\bbl@exp{\def\\\bbl@parsedef##1\detokenize{macro:}}#2->#3\relax{%
@@ -5803,9 +5829,9 @@ wouldn’t exist.
{\expandafter\OE\expandafter}\expandafter{\oe}%
\ifin@
\bbl@afterelse\expandafter\MakeUppercase
- \else
+ \else
\bbl@afterfi\expandafter\MakeLowercase
- \fi
+ \fi
\else
\expandafter\@firstofone
\fi}
@@ -5816,7 +5842,7 @@ wouldn’t exist.
% |#|'s. Used to deal with alph, Alph and frenchspacing when there are
% already changes (with |\babel@save|).
%
-% \begin{macrocode}
+% \begin{macrocode}
\def\bbl@extras@wrap#1#2#3{% 1:in-test, 2:before, 3:after
\toks@\expandafter\expandafter\expandafter{%
\csname extras\languagename\endcsname}%
@@ -5882,23 +5908,21 @@ wouldn’t exist.
%<</Define core switching macros>>
% \end{macrocode}
%
-% \end{macro}
-% \end{macro}
-%
-% Now we make sure all required files are loaded. When the command
-% |\AtBeginDocument| doesn't exist we assume that we are dealing
-% with a plain-based format. In that case the file
-% \file{plain.def} is needed (which also defines
-% |\AtBeginDocument|, and therefore it is not loaded twice). We
-% need the first part when the format is created, and |\orig@dump|
-% is used as a flag. Otherwise, we need to use the second part, so
-% |\orig@dump| is not defined (\file{plain.def} undefines it).
+% \end{macro}
+% \end{macro}
%
-% Check if the current version of \file{switch.def} has been
-% previously loaded (mainly, \file{hyphen.cfg}). If not, load it
-% now. We cannot load |babel.def| here because we first need to
-% declare and process the package options.
+% Now we make sure all required files are loaded. When the command
+% |\AtBeginDocument| doesn't exist we assume that we are dealing with a
+% plain-based format. In that case the file \file{plain.def} is needed
+% (which also defines |\AtBeginDocument|, and therefore it is not
+% loaded twice). We need the first part when the format is created, and
+% |\orig@dump| is used as a flag. Otherwise, we need to use the second
+% part, so |\orig@dump| is not defined (\file{plain.def} undefines it).
%
+% Check if the current version of \file{switch.def} has been previously
+% loaded (mainly, \file{hyphen.cfg}). If not, load it now. We cannot
+% load |babel.def| here because we first need to declare and process
+% the package options.
%
% \subsection{The Package File (\LaTeX, \texttt{babel.sty})}
%
@@ -5907,7 +5931,7 @@ wouldn’t exist.
\NeedsTeXFormat{LaTeX2e}[2005/12/01]
\ProvidesPackage{babel}[<@date@> v<@version@> The Babel package]
% \end{macrocode}
-%
+%
% Start with some “private†debugging tool, and then define macros for
% errors.
%
@@ -5955,7 +5979,7 @@ wouldn’t exist.
% influence the behavior of language definition files.
%
% Many of the following options don’t do anything themselves, they are
-% just defined in order to make it possible for babel and language
+% just defined in order to make it possible for \babel{} and language
% definition files to check if one of them was specified by the user.
%
% But first, include here the \textit{Basic macros} defined above.
@@ -6007,7 +6031,7 @@ wouldn’t exist.
%
% Now the \texttt{base} option. With it we can define (and load, with
% \luatex) hyphenation patterns, even if we are not interested in the
-% rest of babel.
+% rest of \babel{}.
%
% \begin{macrocode}
\bbl@trace{Defining option 'base'}
@@ -6034,12 +6058,10 @@ wouldn’t exist.
%
% \subsection{\texttt{key=value} options and other general option}
%
-% The following macros extract language modifiers, and only real
-% package options are kept in the option list. Modifiers are saved
-% and assigned to |\BabelModifiers| at |\bbl@load@language|; when
-% no modifiers have been given, the former is |\relax|. How
-% modifiers are handled are left to language styles; they can use
-% |\in@|, loop them with |\@for| or load |keyval|, for example.
+% The following macros extract language modifiers, and only real
+% package options are kept in the option list. Modifiers are saved and
+% assigned to |\BabelModifiers| at |\bbl@load@language|; when no
+% modifiers have been given, the former is |\relax|.
%
% \begin{macrocode}
\bbl@trace{key=value and another general options}
@@ -6060,7 +6082,7 @@ wouldn’t exist.
\in@{$modifiers$}{$#1$}% TODO. Allow spaces.
\ifin@
\bbl@tempe#2\@@
- \else
+ \else
\in@{=}{#1}%
\ifin@
\edef\bbl@tempc{\ifx\bbl@tempc\@empty\else\bbl@tempc,\fi#1.#2}%
@@ -6090,12 +6112,11 @@ wouldn’t exist.
\DeclareOption{noconfigs}{}
\DeclareOption{showlanguages}{}
\DeclareOption{silent}{}
-% \DeclareOption{mono}{}
\DeclareOption{shorthands=off}{\bbl@tempa shorthands=\bbl@tempa}
\chardef\bbl@iniflag\z@
\DeclareOption{provide=*}{\chardef\bbl@iniflag\@ne} % main -> +1
-\DeclareOption{provide+=*}{\chardef\bbl@iniflag\tw@} % add = 2
-\DeclareOption{provide*=*}{\chardef\bbl@iniflag\thr@@} % add + main
+\DeclareOption{provide+=*}{\chardef\bbl@iniflag\tw@} % second = 2
+\DeclareOption{provide*=*}{\chardef\bbl@iniflag\thr@@} % second + main
% A separate option
\let\bbl@autoload@options\@empty
\DeclareOption{provide@=*}{\def\bbl@autoload@options{import}}
@@ -6145,7 +6166,7 @@ wouldn’t exist.
\bbl@xin@{\string=}{\CurrentOption}%
\ifin@
\expandafter\bbl@tempa\CurrentOption\bbl@tempa
- \else
+ \else
\bbl@add@list\bbl@language@opts{\CurrentOption}%
\fi}
% \end{macrocode}
@@ -6168,7 +6189,7 @@ wouldn’t exist.
\bbl@replace\bbl@opt@provide{;}{,}%
\fi}
\fi
-%
+%
% \end{macrocode}
%
% \subsection{Conditional loading of shorthands}
@@ -6199,8 +6220,7 @@ wouldn’t exist.
\else
% \end{macrocode}
%
-% The following macro tests if a shorthand is one of the allowed
-% ones.
+% The following macro tests if a shorthand is one of the allowed ones.
%
% \begin{macrocode}
\def\bbl@ifshorthand#1{%
@@ -6348,19 +6368,18 @@ wouldn’t exist.
\endgroup}
% \end{macrocode}
%
-% \end{macro}
+% \end{macro}
%
-% |\bbl@iflanguage| executes code only if the language |l@|
-% exists. Otherwise raises an error.
+% |\bbl@iflanguage| executes code only if the language |l@| exists.
+% Otherwise raises an error.
%
-% The argument of |\bbl@fixname| has to be a macro name, as it may get
-% ``fixed'' if casing (lc/uc) is wrong. It's an attempt to fix a
-% long-standing bug when |\foreignlanguage| and the like appear in
-% a |\MakeXXXcase|. However, a lowercase form is not imposed to
-% improve backward compatibility (perhaps you defined a language
-% named |MYLANG|, but unfortunately mixed case names cannot be
-% trapped). Note |l@| is encapsulated, so that its case does not
-% change.
+% The argument of |\bbl@fixname| has to be a macro name, as it may get
+% ``fixed'' if casing (lc/uc) is wrong. It's an attempt to fix a
+% long-standing bug when |\foreignlanguage| and the like appear in a
+% |\MakeXXXcase|. However, a lowercase form is not imposed to improve
+% backward compatibility (perhaps you defined a language named
+% |MYLANG|, but unfortunately mixed case names cannot be trapped). Note
+% |l@| is encapsulated, so that its case does not change.
%
% \begin{macrocode}
\def\bbl@fixname#1{%
@@ -6392,7 +6411,7 @@ wouldn’t exist.
% sr-latn-ba becomes fr-Latn-BA. Note |#4| may contain some
% |\@empty|'s, but they are eventually removed. |\bbl@bcplookup| either
% returns the found |ini| or it is |\relax|.
-%
+%
% \begin{macrocode}
\def\bbl@bcpcase#1#2#3#4\@@#5{%
\ifx\@empty#3%
@@ -6411,7 +6430,7 @@ wouldn’t exist.
\IfFileExists{babel-\bbl@tempa-\bbl@tempb.ini}%
{\edef\bbl@bcp{\bbl@tempa-\bbl@tempb}}%
{}%
- \ifx\bbl@bcp\relax
+ \ifx\bbl@bcp\relax
\IfFileExists{babel-\bbl@tempa.ini}{\let\bbl@bcp\bbl@tempa}{}%
\fi
\else
@@ -6420,17 +6439,17 @@ wouldn’t exist.
\IfFileExists{babel-\bbl@tempa-\bbl@tempb-\bbl@tempc.ini}%
{\edef\bbl@bcp{\bbl@tempa-\bbl@tempb-\bbl@tempc}}%
{}%
- \ifx\bbl@bcp\relax
+ \ifx\bbl@bcp\relax
\IfFileExists{babel-\bbl@tempa-\bbl@tempc.ini}%
{\edef\bbl@bcp{\bbl@tempa-\bbl@tempc}}%
{}%
\fi
- \ifx\bbl@bcp\relax
+ \ifx\bbl@bcp\relax
\IfFileExists{babel-\bbl@tempa-\bbl@tempc.ini}%
{\edef\bbl@bcp{\bbl@tempa-\bbl@tempc}}%
{}%
\fi
- \ifx\bbl@bcp\relax
+ \ifx\bbl@bcp\relax
\IfFileExists{babel-\bbl@tempa.ini}{\let\bbl@bcp\bbl@tempa}{}%
\fi
\fi\fi}
@@ -6442,7 +6461,7 @@ wouldn’t exist.
\fi
\let\bbl@auxname\languagename % Still necessary. TODO
\bbl@ifunset{bbl@bcp@map@\languagename}{}% Move uplevel??
- {\edef\languagename{\@nameuse{bbl@bcp@map@\languagename}}}%
+ {\edef\languagename{\@nameuse{bbl@bcp@map@\languagename}}}%
\ifbbl@bcpallowed
\expandafter\ifx\csname date\languagename\endcsname\relax
\expandafter
@@ -6467,7 +6486,7 @@ wouldn’t exist.
%<+core>
% \end{macrocode}
%
-% \begin{macro}{\iflanguage}
+% \begin{macro}{\iflanguage}
% Users might want to test (in a private package for instance)
% which language is currently active. For this we provide a test
% macro, |\iflanguage|, that has three arguments. It checks
@@ -6486,11 +6505,11 @@ wouldn’t exist.
\fi}}
% \end{macrocode}
%
-% \end{macro}
+% \end{macro}
%
% \subsection{Selecting the language}
%
-% \begin{macro}{\selectlanguage}
+% \begin{macro}{\selectlanguage}
%
% The macro |\selectlanguage| checks whether the language is
% already defined before it performs its actual task, which is to
@@ -6522,9 +6541,9 @@ wouldn’t exist.
%
% \end{macro}
%
-% Since version 3.5 \babel\ writes entries to the auxiliary files in
-% order to typeset table of contents etc. in the correct language
-% environment.
+% Since version 3.5 \babel\ writes entries to the auxiliary files in
+% order to typeset table of contents etc. in the correct language
+% environment.
%
% \begin{macro}{\bbl@pop@language}
%
@@ -6566,7 +6585,7 @@ wouldn’t exist.
\xdef\bbl@language@stack{\languagename+}%
\else
\xdef\bbl@language@stack{\languagename+\bbl@language@stack}%
- \fi
+ \fi
\fi
\fi}
% \end{macrocode}
@@ -6575,10 +6594,10 @@ wouldn’t exist.
% we need to remove the element from the stack while storing it in the
% macro |\languagename|. For this we first define a helper function.
%
-% \begin{macro}{\bbl@pop@lang}
-% This macro stores its first element (which is delimited by the
-% `+'-sign) in |\languagename| and stores the rest of the string
-% in |\bbl@language@stack|.
+% \begin{macro}{\bbl@pop@lang}
+% This macro stores its first element (which is delimited by the
+% `+'-sign) in |\languagename| and stores the rest of the string in
+% |\bbl@language@stack|.
%
% \begin{macrocode}
\def\bbl@pop@lang#1+#2\@@{%
@@ -6586,7 +6605,7 @@ wouldn’t exist.
\xdef\bbl@language@stack{#2}}
% \end{macrocode}
%
-% \end{macro}
+% \end{macro}
% The reason for the somewhat weird arrangement of arguments to the
% helper function is the fact it is called in the following way.
% This means that before |\bbl@pop@lang| is executed \TeX\ first
@@ -6608,9 +6627,9 @@ wouldn’t exist.
% Once the name of the previous language is retrieved from the stack,
% it is fed to |\bbl@set@language| to do the actual work of
% switching everything that needs switching.
-% \end{macro}
-% \end{macro}
-% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
%
% An alternative way to identify languages (in the \babel{} sense)
% with a numerical value is introduced in 3.30. This is one of the
@@ -6652,9 +6671,9 @@ wouldn’t exist.
\let\endselectlanguage\relax
% \end{macrocode}
%
-% \end{macro}
+% \end{macro}
%
-% \begin{macro}{\bbl@set@language}
+% \begin{macro}{\bbl@set@language}
%
% The macro |\bbl@set@language| takes care of switching the language
% environment \emph{and} of writing entries on the auxiliary files.
@@ -6745,7 +6764,7 @@ wouldn’t exist.
\select@language{#1}}
% \end{macrocode}
%
-% \end{macro}
+% \end{macro}
%
% First, check if the user asks for a known language. If so,
% update the value of |\language| and call |\originalTeX|
@@ -6772,7 +6791,7 @@ wouldn’t exist.
% current values, then we check if |\|\langvar|hyphenmins| is
% defined. If it is not, we set default values (2 and 3), otherwise
% the values in |\|\langvar|hyphenmins| will be used.
-%
+%
% No text is supposed to be added with switching captions and date, so
% we remove any spurious spaces with |\bbl@bsphack| and |\bbl@esphack|.
%
@@ -6803,7 +6822,7 @@ wouldn’t exist.
\csname captions#1\endcsname\relax
\fi
\bbl@xin@{,date,}{,\bbl@select@opts,}%
- \ifin@ % if \foreign... within \<lang>date
+ \ifin@ % if \foreign... within \<language>date
\csname date#1\endcsname\relax
\fi
\fi
@@ -6984,11 +7003,14 @@ wouldn’t exist.
\BabelText{#2}% Still in vertical mode!
{\par}%
\endgroup}
+\providecommand\BabelWrapText[1]{%
+ \def\bbl@tempa{\def\BabelText####1}%
+ \expandafter\bbl@tempa\expandafter{\BabelText{#1}}}
% \end{macrocode}
%
-% \end{macro}
+% \end{macro}
%
-% \begin{macro}{\foreign@language}
+% \begin{macro}{\foreign@language}
%
% This macro does the work for |\foreignlanguage| and the
% \Lenv{otherlanguage*} environment. First we need to store the name
@@ -7073,7 +7095,7 @@ wouldn’t exist.
\endgroup}}
% \end{macrocode}
%
-% \end{macro}
+% \end{macro}
%
% \begin{environment}{hyphenrules}
%
@@ -7118,11 +7140,11 @@ wouldn’t exist.
\fi}
% \end{macrocode}
%
-% \end{macro}
+% \end{macro}
%
-% \begin{macro}{\set@hyphenmins}
-% This macro sets the values of |\lefthyphenmin| and
-% |\righthyphenmin|. It expects two values as its argument.
+% \begin{macro}{\set@hyphenmins}
+% This macro sets the values of |\lefthyphenmin| and |\righthyphenmin|.
+% It expects two values as its argument.
%
% \begin{macrocode}
\def\set@hyphenmins#1#2{%
@@ -7161,26 +7183,26 @@ wouldn’t exist.
\fi
% \end{macrocode}
%
-% \end{macro}
+% \end{macro}
%
-% \begin{macro}{\originalTeX}
-% The macro|\originalTeX| should be known to \TeX\ at this moment.
-% As it has to be expandable we |\let| it to |\@empty| instead of
-% |\relax|.
+% \begin{macro}{\originalTeX}
+% The macro|\originalTeX| should be known to \TeX\ at this moment. As
+% it has to be expandable we |\let| it to |\@empty| instead of
+% |\relax|.
%
% \begin{macrocode}
\ifx\originalTeX\@undefined\let\originalTeX\@empty\fi
% \end{macrocode}
%
-% Because this part of the code can be included in a format, we
-% make sure that the macro which initializes the save mechanism,
-% |\babel@beginsave|, is not considered to be undefined.
+% Because this part of the code can be included in a format, we make
+% sure that the macro which initializes the save mechanism,
+% |\babel@beginsave|, is not considered to be undefined.
%
% \begin{macrocode}
\ifx\babel@beginsave\@undefined\let\babel@beginsave\relax\fi
% \end{macrocode}
%
-% \end{macro}
+% \end{macro}
%
% A few macro names are reserved for future releases of \babel, which
% will use the concept of `locale':
@@ -7231,7 +7253,7 @@ wouldn’t exist.
\bbl@warning{%
\@backslashchar#1 not set for '\languagename'. Please,\\%
define it after the language has been loaded\\%
- (typically in the preamble) with:\\%
+ (typically in the preamble) with:\\%
\string\setlocalecaption{\languagename}{\bbl@tempa}{..}\\%
Feel free to contribute on github.com/latex3/babel.\\%
Reported}}
@@ -7288,7 +7310,7 @@ wouldn’t exist.
\fi
% \end{macrocode}
%
-% \begin{macro}{\addto}
+% \begin{macro}{\addto}
% It takes two arguments, a \meta{control sequence} and \TeX-code to
% be added to the \meta{control sequence}.
%
@@ -7312,7 +7334,7 @@ wouldn’t exist.
\fi}
% \end{macrocode}
%
-% \end{macro}
+% \end{macro}
%
% The macro |\initiate@active@char| below takes all the necessary
% actions to make its argument a shorthand character. The real work
@@ -7326,7 +7348,7 @@ wouldn’t exist.
\lowercase{\endgroup#1~}}
% \end{macrocode}
%
-% \begin{macro}{\bbl@redefine}
+% \begin{macro}{\bbl@redefine}
%
% To redefine a command, we save the old meaning of the macro. Then
% we redefine it to call the original macro with the `sanitized'
@@ -7343,11 +7365,11 @@ wouldn’t exist.
\@onlypreamble\bbl@redefine
% \end{macrocode}
%
-% \end{macro}
+% \end{macro}
%
-% \begin{macro}{\bbl@redefine@long}
-% This version of |\babel@redefine| can be used to redefine |\long|
-% commands such as |\ifthenelse|.
+% \begin{macro}{\bbl@redefine@long}
+% This version of |\babel@redefine| can be used to redefine |\long|
+% commands such as |\ifthenelse|.
%
% \begin{macrocode}
\def\bbl@redefine@long#1{%
@@ -7357,7 +7379,7 @@ wouldn’t exist.
\@onlypreamble\bbl@redefine@long
% \end{macrocode}
%
-% \end{macro}
+% \end{macro}
%
% \begin{macro}{\bbl@redefinerobust}
% For commands that are redefined, but which \textit{might} be
@@ -7378,7 +7400,7 @@ wouldn’t exist.
\@onlypreamble\bbl@redefinerobust
% \end{macrocode}
%
-% \end{macro}
+% \end{macro}
%
% \subsection{Hooks}
%
@@ -7435,13 +7457,13 @@ wouldn’t exist.
% \begin{macro}{\babelensure}
%
% The user command just parses the optional argument and creates a
-% new macro named |\bbl@e@|\m{language}. We register a hook at the
+% new macro named |\bbl@e@<language>|. We register a hook at the
% |afterextras| event which just executes this macro in a
% ``complete'' selection (which, if undefined, is |\relax| and does
% nothing). This part is somewhat involved because we have to make
% sure things are expanded the correct number of times.
%
-% The macro |\bbl@e@|\m{language} contains
+% The macro |\bbl@e@<language>| contains
% |\bbl@ensure|\marg{include}\marg{exclude}\marg{fontenc}, which in in
% turn loops over the macros names in |\bbl@captionslist|, excluding
% (with the help of |\in@|) those in the |exclude| list. If the
@@ -7518,7 +7540,7 @@ wouldn’t exist.
\alsoname\proofname\glossaryname}
% \end{macrocode}
%
-% \end{macro}
+% \end{macro}
%
% \subsection{Setting up language files}
%
@@ -7587,10 +7609,10 @@ wouldn’t exist.
\bbl@ldfinit}
% \end{macrocode}
%
-% \end{macro}
+% \end{macro}
%
-% \begin{macro}{\ldf@quit}
-% This macro interrupts the processing of a language definition file.
+% \begin{macro}{\ldf@quit}
+% This macro interrupts the processing of a language definition file.
%
% \begin{macrocode}
\def\ldf@quit#1{%
@@ -7600,16 +7622,16 @@ wouldn’t exist.
\endinput}
% \end{macrocode}
%
-% \end{macro}
+% \end{macro}
%
-% \begin{macro}{\ldf@finish}
-% This macro takes one argument. It is the name of the language
-% that was defined in the language definition file.
+% \begin{macro}{\ldf@finish}
+% This macro takes one argument. It is the name of the language that
+% was defined in the language definition file.
%
-% We load the local configuration file if one is present, we set
-% the main language (taking into account that the argument might be
-% a control sequence that needs to be expanded) and reset the
-% category code of the @-sign.
+% We load the local configuration file if one is present, we set the
+% main language (taking into account that the argument might be a
+% control sequence that needs to be expanded) and reset the category
+% code of the @-sign.
%
% \begin{macrocode}
\def\bbl@afterldf#1{% TODO. Merge into the next macro? Unused elsewhere
@@ -7625,11 +7647,11 @@ wouldn’t exist.
\catcode`\==\eqcatcode \let\eqcatcode\relax}
% \end{macrocode}
%
-% \end{macro}
+% \end{macro}
%
-% After the preamble of the document the commands |\LdfInit|,
-% |\ldf@quit| and |\ldf@finish| are no longer needed. Therefore
-% they are turned into warning messages in \LaTeX.
+% After the preamble of the document the commands |\LdfInit|,
+% |\ldf@quit| and |\ldf@finish| are no longer needed. Therefore they
+% are turned into warning messages in \LaTeX.
%
% \begin{macrocode}
\@onlypreamble\LdfInit
@@ -7637,12 +7659,11 @@ wouldn’t exist.
\@onlypreamble\ldf@finish
% \end{macrocode}
%
-% \begin{macro}{\main@language}
-% \begin{macro}{\bbl@main@language}
-% This command should be used in the various language definition
-% files. It stores its argument in |\bbl@main@language|; to be used
-% to switch to the correct language at the beginning of the
-% document.
+% \begin{macro}{\main@language}
+% \begin{macro}{\bbl@main@language}
+% This command should be used in the various language definition files.
+% It stores its argument in |\bbl@main@language|; to be used to switch
+% to the correct language at the beginning of the document.
%
% \begin{macrocode}
\def\main@language#1{%
@@ -7653,14 +7674,19 @@ wouldn’t exist.
% \end{macrocode}
%
% We also have to make sure that some code gets executed at the
-% beginning of the document, either when the |aux| file is read or,
-% if it does not exist, when the |\AtBeginDocument| is executed.
-% Languages do not set |\pagedir|, so we set here for the whole
-% document to the main |\bodydir|.
+% beginning of the document, either when the |aux| file is read or, if
+% it does not exist, when the |\AtBeginDocument| is executed. Languages
+% do not set |\pagedir|, so we set here for the whole document to the
+% main |\bodydir|. TODO. Handle correctly the 'nil' language, to avoid
+% errors in toc files if there was a typo in a name.
+%
+% The code written to the |aux| file attempts to avoid errors if
+% \babel\ is removed from the document.
%
% \begin{macrocode}
\def\bbl@beforestart{%
\def\@nolanerr##1{%
+ \bbl@carg\chardef{l@##1}\z@
\bbl@warning{Undefined language '##1' in aux.\\Reported}}%
\bbl@usehooks{beforestart}{}%
\global\let\bbl@beforestart\relax}
@@ -7668,8 +7694,8 @@ wouldn’t exist.
{\@nameuse{bbl@beforestart}}% Group!
\if@filesw
\providecommand\babel@aux[2]{}%
- \immediate\write\@mainaux{%
- \string\providecommand\string\babel@aux[2]{}}%
+ \immediate\write\@mainaux{\unexpanded{%
+ \providecommand\babel@aux[2]{\global\let\babel@toc\@gobbletwo}}}%
\immediate\write\@mainaux{\string\@nameuse{bbl@beforestart}}%
\fi
\expandafter\selectlanguage\expandafter{\bbl@main@language}%
@@ -7699,8 +7725,8 @@ wouldn’t exist.
\fi
% \end{macrocode}
%
-% \end{macro}
-% \end{macro}
+% \end{macro}
+% \end{macro}
%
% A bit of optimization. Select in heads/foots the language only if
% necessary.
@@ -7716,18 +7742,17 @@ wouldn’t exist.
%
% \subsection{Shorthands}
%
-% \begin{macro}{\bbl@add@special}
-% The macro |\bbl@add@special| is used to add a new character (or
-% single character control sequence) to the macro |\dospecials|
-% (and |\@sanitize| if \LaTeX\ is used). It is used only at one
-% place, namely when |\initiate@active@char| is called (which is
-% ignored if the char has been made active before). Because
-% |\@sanitize| can be undefined, we put the definition inside a
-% conditional.
+% \begin{macro}{\bbl@add@special}
+% The macro |\bbl@add@special| is used to add a new character (or
+% single character control sequence) to the macro |\dospecials| (and
+% |\@sanitize| if \LaTeX\ is used). It is used only at one place,
+% namely when |\initiate@active@char| is called (which is ignored if
+% the char has been made active before). Because |\@sanitize| can be
+% undefined, we put the definition inside a conditional.
%
-% Items are added to the lists without checking its existence or
-% the original catcode. It does not hurt, but should be fixed. It's
-% already done with |\nfss@catcodes|, added in 3.10.
+% Items are added to the lists without checking its existence or the
+% original catcode. It does not hurt, but should be fixed. It's already
+% done with |\nfss@catcodes|, added in 3.10.
%
% \begin{macrocode}
\bbl@trace{Shorhands}
@@ -7747,13 +7772,13 @@ wouldn’t exist.
\fi}
% \end{macrocode}
%
-% \end{macro}
+% \end{macro}
%
-% \begin{macro}{\bbl@remove@special}
+% \begin{macro}{\bbl@remove@special}
%
-% The companion of the former macro is |\bbl@remove@special|. It
-% removes a character from the set macros |\dospecials| and
-% |\@sanitize|, but it is not used at all in the \babel{} core.
+% The companion of the former macro is |\bbl@remove@special|. It
+% removes a character from the set macros |\dospecials| and
+% |\@sanitize|, but it is not used at all in the \babel{} core.
%
% \begin{macrocode}
\def\bbl@remove@special#1{%
@@ -7770,38 +7795,36 @@ wouldn’t exist.
\x}
% \end{macrocode}
%
-% \end{macro}
-%
-% \begin{macro}{\initiate@active@char}
-% A language definition file can call this macro to make a
-% character active. This macro takes one argument, the character
-% that is to be made active. When the character was already active
-% this macro does nothing. Otherwise, this macro defines the
-% control sequence |\normal@char|\m{char} to expand to the
-% character in its `normal state' and it defines the active
-% character to expand to |\normal@char|\m{char} by default
-% (\m{char} being the character to be made active). Later its
-% definition can be changed to expand to |\active@char|\m{char}
-% by calling |\bbl@activate{|\m{char}|}|.
-%
-% For example, to make the double quote character active one could
-% have |\initiate@active@char{"}| in a language definition file.
-% This defines |"| as |\active@prefix "\active@char"| (where the
-% first |"| is the character with its original catcode, when the
-% shorthand is created, and |\active@char"| is a single token). In
-% protected contexts, it expands to |\protect "| or |\noexpand "|
-% (ie, with the original |"|); otherwise |\active@char"| is
-% executed. This macro in turn expands to |\normal@char"| in
-% ``safe'' contexts (eg, |\label|), but |\user@active"| in normal
-% ``unsafe'' ones. The latter search a definition in the user,
-% language and system levels, in this order, but if none is found,
-% |\normal@char"| is used. However, a deactivated shorthand (with
-% |\bbl@deactivate| is defined as |\active@prefix "\normal@char"|.
-%
-% The following macro is used to define shorthands in the three
-% levels. It takes 4 arguments: the (string'ed) character,
-% |\<level>@group|, |<level>@active| and |<next-level>@active|
-% (except in |system|).
+% \end{macro}
+%
+% \begin{macro}{\initiate@active@char}
+% A language definition file can call this macro to make a character
+% active. This macro takes one argument, the character that is to be
+% made active. When the character was already active this macro does
+% nothing. Otherwise, this macro defines the control sequence
+% |\normal@char<char>| to expand to the character in its `normal
+% state' and it defines the active character to expand to
+% |\normal@char<char>| by default (\m{char} being the character to be
+% made active). Later its definition can be changed to expand to
+% |\active@char<char>| by calling |\bbl@activate{<char>}|.
+%
+% For example, to make the double quote character active one could have
+% |\initiate@active@char{"}| in a language definition file. This
+% defines |"| as |\active@prefix "\active@char"| (where the first |"|
+% is the character with its original catcode, when the shorthand is
+% created, and |\active@char"| is a single token). In protected
+% contexts, it expands to |\protect "| or |\noexpand "| (ie, with the
+% original |"|); otherwise |\active@char"| is executed. This macro in
+% turn expands to |\normal@char"| in ``safe'' contexts (eg, |\label|),
+% but |\user@active"| in normal ``unsafe'' ones. The latter search a
+% definition in the user, language and system levels, in this order,
+% but if none is found, |\normal@char"| is used. However, a deactivated
+% shorthand (with |\bbl@deactivate| is defined as
+% |\active@prefix "\normal@char"|.
+%
+% The following macro is used to define shorthands in the three levels.
+% It takes 4 arguments: the (string'ed) character, |\<level>@group|,
+% |<level>@active| and |<next-level>@active| (except in |system|).
%
% \begin{macrocode}
\def\bbl@active@def#1#2#3#4{%
@@ -7813,9 +7836,9 @@ wouldn’t exist.
\fi}%
% \end{macrocode}
%
-% When there is also no current-level shorthand with an argument we
-% will check whether there is a next-level defined shorthand for
-% this active character.
+% When there is also no current-level shorthand with an argument we
+% will check whether there is a next-level defined shorthand for this
+% active character.
%
% \begin{macrocode}
\long\@namedef{#3@arg#1}##1{%
@@ -7826,10 +7849,10 @@ wouldn’t exist.
\fi}}%
% \end{macrocode}
%
-% |\initiate@active@char| calls |\@initiate@active@char| with 3
-% arguments. All of them are the same character with different
-% catcodes: active, other (|\string|'ed) and the original one.
-% This trick simplifies the code a lot.
+% |\initiate@active@char| calls |\@initiate@active@char| with 3
+% arguments. All of them are the same character with different
+% catcodes: active, other (|\string|'ed) and the original one. This
+% trick simplifies the code a lot.
%
% \begin{macrocode}
\def\initiate@active@char#1{%
@@ -7839,10 +7862,10 @@ wouldn’t exist.
{}}
% \end{macrocode}
%
-% The very first thing to do is saving the original catcode and the
-% original definition, even if not active, which is possible
-% (undefined characters require a special treatment to avoid
-% making them |\relax| and preserving some degree of protection).
+% The very first thing to do is saving the original catcode and the
+% original definition, even if not active, which is possible (undefined
+% characters require a special treatment to avoid making them |\relax|
+% and preserving some degree of protection).
%
% \begin{macrocode}
\def\@initiate@active@char#1#2#3{%
@@ -7857,14 +7880,14 @@ wouldn’t exist.
\fi
% \end{macrocode}
%
-% If the character is already active we provide the default
-% expansion under this shorthand mechanism. Otherwise we write a
-% message in the transcript file, and define |\normal@char|\m{char}
-% to expand to the character in its default state. If the character
-% is mathematically active when \babel{} is loaded (for example
-% |'|) the normal expansion is somewhat different to avoid an
-% infinite loop (but it does not prevent the loop if the mathcode
-% is set to |"8000| \textit{a posteriori}).
+% If the character is already active we provide the default expansion
+% under this shorthand mechanism. Otherwise we write a message in the
+% transcript file, and define |\normal@char<char>| to expand to the
+% character in its default state. If the character is mathematically
+% active when \babel{} is loaded (for example |'|) the normal expansion
+% is somewhat different to avoid an infinite loop (but it does not
+% prevent the loop if the mathcode is set to |"8000| \textit{a
+% posteriori}).
%
% \begin{macrocode}
\ifx#1#3\relax
@@ -7879,16 +7902,16 @@ wouldn’t exist.
\fi
% \end{macrocode}
%
-% To prevent problems with the loading of other packages after
-% \babel\ we reset the catcode of the character to the original one
-% at the end of the package and of each language file (except with
-% \textsf{KeepShorthandsActive}). It is re-activate again at
-% |\begin{document}|. We also need to make sure that the
-% shorthands are active during the processing of the \file{.aux}
-% file. Otherwise some citations may give unexpected results in
-% the printout when a shorthand was used in the optional argument
-% of |\bibitem| for example. Then we make it active (not strictly
-% necessary, but done for backward compatibility).
+% To prevent problems with the loading of other packages after \babel\
+% we reset the catcode of the character to the original one at the end
+% of the package and of each language file (except with
+% \textsf{KeepShorthandsActive}). It is re-activate again at
+% |\begin{document}|. We also need to make sure that the shorthands are
+% active during the processing of the \file{.aux} file. Otherwise some
+% citations may give unexpected results in the printout when a
+% shorthand was used in the optional argument of |\bibitem| for
+% example. Then we make it active (not strictly necessary, but done for
+% backward compatibility).
%
% \begin{macrocode}
\bbl@restoreactive{#2}%
@@ -7902,14 +7925,14 @@ wouldn’t exist.
\fi
% \end{macrocode}
%
-% Now we have set |\normal@char|\m{char}, we must define
-% |\active@char|\m{char}, to be executed when the character is
-% activated. We define the first level expansion of
-% |\active@char|\m{char} to check the status of the |@safe@actives|
-% flag. If it is set to true we expand to the `normal' version of
-% this character, otherwise we call |\user@active|\m{char} to start
-% the search of a definition in the user, language and system
-% levels (or eventually |normal@char|\m{char}).
+% Now we have set |\normal@char<char>|, we must define
+% |\active@char<char>|, to be executed when the character is
+% activated. We define the first level expansion of
+% |\active@char<char>| to check the status of the |@safe@actives|
+% flag. If it is set to true we expand to the `normal' version of this
+% character, otherwise we call |\user@active<char>| to start the
+% search of a definition in the user, language and system levels (or
+% eventually |normal@char<char>|).
%
% \begin{macrocode}
\let\bbl@tempa\@firstoftwo
@@ -7934,13 +7957,13 @@ wouldn’t exist.
\expandafter\noexpand\csname user@active#2\endcsname}%
% \end{macrocode}
%
-% We now define the default values which the shorthand is set to
-% when activated or deactivated. It is set to the deactivated form
-% (globally), so that the character expands to
-% \begin{center}
-% |\active@prefix| \m{char} |\normal@char|\m{char}
-% \end{center}
-% (where |\active@char|\m{char} is \emph{one} control sequence!).
+% We now define the default values which the shorthand is set to when
+% activated or deactivated. It is set to the deactivated form
+% (globally), so that the character expands to
+% \begin{center}
+% |\active@prefix| \m{char} |\normal@char<char>|
+% \end{center}
+% (where |\active@char<char>| is \emph{one} control sequence!).
%
% \begin{macrocode}
\bbl@csarg\edef{active@#2}{%
@@ -7952,10 +7975,10 @@ wouldn’t exist.
\bbl@ncarg\let#1{bbl@normal@#2}%
% \end{macrocode}
%
-% The next level of the code checks whether a user has defined a
-% shorthand for himself with this character. First we check for a
-% single character shorthand. If that doesn't exist we check for a
-% shorthand with an argument.
+% The next level of the code checks whether a user has defined a
+% shorthand for himself with this character. First we check for a
+% single character shorthand. If that doesn't exist we check for a
+% shorthand with an argument.
%
% \begin{macrocode}
\bbl@active@def#2\user@group{user@active}{language@active}%
@@ -7963,13 +7986,13 @@ wouldn’t exist.
\bbl@active@def#2\system@group{system@active}{normal@char}%
% \end{macrocode}
%
-% In order to do the right thing when a shorthand with an argument
-% is used by itself at the end of the line we provide a definition
-% for the case of an empty argument. For that case we let the
-% shorthand character expand to its non-active self. Also, When a
-% shorthand combination such as |''| ends up in a heading \TeX\
-% would see |\protect'\protect'|. To prevent this from happening a
-% couple of shorthand needs to be defined at user level.
+% In order to do the right thing when a shorthand with an argument
+% is used by itself at the end of the line we provide a definition
+% for the case of an empty argument. For that case we let the
+% shorthand character expand to its non-active self. Also, When a
+% shorthand combination such as |''| ends up in a heading \TeX\
+% would see |\protect'\protect'|. To prevent this from happening a
+% couple of shorthand needs to be defined at user level.
%
% \begin{macrocode}
\expandafter\edef\csname\user@group @sh@#2@@\endcsname
@@ -7978,13 +8001,13 @@ wouldn’t exist.
{\expandafter\noexpand\csname user@active#2\endcsname}%
% \end{macrocode}
%
-% Finally, a couple of special cases are taken care of. (1) If we
-% are making the right quote (|'|) active we need to change |\pr@m@s| as
-% well. Also, make sure that a single |'| in math mode `does the
-% right thing'. (2) If we are using the caret (|^|) as a shorthand
-% character special care should be taken to make sure math still
-% works. Therefore an extra level of expansion is introduced with a
-% check for math mode on the upper level.
+% Finally, a couple of special cases are taken care of. (1) If we
+% are making the right quote (|'|) active we need to change |\pr@m@s| as
+% well. Also, make sure that a single |'| in math mode `does the
+% right thing'. (2) If we are using the caret (|^|) as a shorthand
+% character special care should be taken to make sure math still
+% works. Therefore an extra level of expansion is introduced with a
+% check for math mode on the upper level.
%
% \begin{macrocode}
\if\string'#2%
@@ -7994,8 +8017,8 @@ wouldn’t exist.
\bbl@usehooks{initiateactive}{{#1}{#2}{#3}}}
% \end{macrocode}
%
-% The following package options control the behavior of shorthands
-% in math mode.
+% The following package options control the behavior of shorthands in
+% math mode.
%
% \begin{macrocode}
%<<*More package options>>
@@ -8004,10 +8027,10 @@ wouldn’t exist.
%<</More package options>>
% \end{macrocode}
%
-% Initiating a shorthand makes active the char. That is not
-% strictly necessary but it is still done for backward
-% compatibility. So we need to restore the original catcode at the
-% end of package \textit{and} and the end of the |ldf|.
+% Initiating a shorthand makes active the char. That is not strictly
+% necessary but it is still done for backward compatibility. So we need
+% to restore the original catcode at the end of package \textit{and}
+% and the end of the |ldf|.
%
% \begin{macrocode}
\@ifpackagewith{babel}{KeepShorthandsActive}%
@@ -8021,18 +8044,18 @@ wouldn’t exist.
\AtEndOfPackage{\let\bbl@restoreactive\@gobble}}
% \end{macrocode}
%
-% \end{macro}
+% \end{macro}
%
-% \begin{macro}{\bbl@sh@select}
-% This command helps the shorthand supporting macros to select how
-% to proceed. Note that this macro needs to be expandable as do all
-% the shorthand macros in order for them to work in expansion-only
-% environments such as the argument of |\hyphenation|.
+% \begin{macro}{\bbl@sh@select}
+% This command helps the shorthand supporting macros to select how to
+% proceed. Note that this macro needs to be expandable as do all the
+% shorthand macros in order for them to work in expansion-only
+% environments such as the argument of |\hyphenation|.
%
-% This macro expects the name of a group of shorthands in its first
-% argument and a shorthand character in its second argument. It
-% will expand to either |\bbl@firstcs| or |\bbl@scndcs|. Hence two
-% more arguments need to follow it.
+% This macro expects the name of a group of shorthands in its first
+% argument and a shorthand character in its second argument. It will
+% expand to either |\bbl@firstcs| or |\bbl@scndcs|. Hence two more
+% arguments need to follow it.
%
% \begin{macrocode}
\def\bbl@sh@select#1#2{%
@@ -8043,17 +8066,16 @@ wouldn’t exist.
\fi}
% \end{macrocode}
%
-% \end{macro}
+% \end{macro}
%
-% \begin{macro}{\active@prefix}
-% The command |\active@prefix| which is used in the expansion of
-% active characters has a function similar to |\OT1-cmd| in that it
-% |\protect|s the active character whenever |\protect| is
-% \emph{not} |\@typeset@protect|. The |\@gobble| is needed to remove
-% a token such as |\activechar:| (when the double colon was the
-% active character to be dealt with). There are two definitions,
-% depending of |\ifincsname| is available. If there is, the
-% expansion will be more robust.
+% \begin{macro}{\active@prefix}
+% The command |\active@prefix| which is used in the expansion of active
+% characters has a function similar to |\OT1-cmd| in that it
+% |\protect|s the active character whenever |\protect| is \emph{not}
+% |\@typeset@protect|. The |\@gobble| is needed to remove a token such
+% as |\activechar:| (when the double colon was the active character to
+% be dealt with). There are two definitions, depending of |\ifincsname|
+% is available. If there is, the expansion will be more robust.
%
% \begin{macrocode}
\begingroup
@@ -8086,29 +8108,29 @@ wouldn’t exist.
\endgroup
% \end{macrocode}
%
-% \end{macro}
+% \end{macro}
%
-% \begin{macro}{\if@safe@actives}
-% In some circumstances it is necessary to be able to reset the
-% shorthand to its ‘normal’ value (usually the character with catcode
-% ‘other’) on the fly. For this purpose the switch |@safe@actives| is
-% available. The setting of this switch should be checked in the first
-% level expansion of |\active@char|\m{char}. When this expansion mode
-% is active (with |\@safe@activestrue|), something like
-% |"|$\sb{13}$|"|$\sb{13}$ becomes |"|$\sb{12}$|"|$\sb{12}$ in an
-% |\edef| (in other words, shorthands are |\string|’ed). This
-% contrasts with |\protected@edef|, where catcodes are always left
-% unchanged. Once converted, they can be used safely even after this
-% expansion mode is deactivated (with |\@safe@activefalse|).
+% \begin{macro}{\if@safe@actives}
+% In some circumstances it is necessary to be able to reset the
+% shorthand to its ‘normal’ value (usually the character with catcode
+% ‘other’) on the fly. For this purpose the switch |@safe@actives| is
+% available. The setting of this switch should be checked in the first
+% level expansion of |\active@char<char>|. When this expansion mode
+% is active (with |\@safe@activestrue|), something like
+% |"|$\sb{13}$|"|$\sb{13}$ becomes |"|$\sb{12}$|"|$\sb{12}$ in an
+% |\edef| (in other words, shorthands are |\string|’ed). This contrasts
+% with |\protected@edef|, where catcodes are always left unchanged.
+% Once converted, they can be used safely even after this expansion
+% mode is deactivated (with |\@safe@activefalse|).
%
% \begin{macrocode}
\newif\if@safe@actives
\@safe@activesfalse
% \end{macrocode}
%
-% \end{macro}
+% \end{macro}
%
-% \begin{macro}{\bbl@restore@actives}
+% \begin{macro}{\bbl@restore@actives}
% When the output routine kicks in while the active characters were
% made ``safe'' this must be undone in the headers to prevent
% unexpected typeset results. For this situation we define a command to
@@ -8118,15 +8140,15 @@ wouldn’t exist.
\def\bbl@restore@actives{\if@safe@actives\@safe@activesfalse\fi}
% \end{macrocode}
%
-% \end{macro}
+% \end{macro}
%
-% \begin{macro}{\bbl@activate}
-% \begin{macro}{\bbl@deactivate}
+% \begin{macro}{\bbl@activate}
+% \begin{macro}{\bbl@deactivate}
%
% Both macros take one argument, like |\initiate@active@char|. The
% macro is used to change the definition of an active character to
-% expand to |\active@char|\m{char} in the case of |\bbl@activate|,
-% or |\normal@char|\m{char} in the case of |\bbl@deactivate|.
+% expand to |\active@char<char>| in the case of |\bbl@activate|,
+% or |\normal@char<char>| in the case of |\bbl@deactivate|.
%
% \begin{macrocode}
\chardef\bbl@activated\z@
@@ -8140,11 +8162,11 @@ wouldn’t exist.
\csname bbl@normal@\string#1\endcsname}
% \end{macrocode}
%
-% \end{macro}
-% \end{macro}
+% \end{macro}
+% \end{macro}
%
-% \begin{macro}{\bbl@firstcs}
-% \begin{macro}{\bbl@scndcs}
+% \begin{macro}{\bbl@firstcs}
+% \begin{macro}{\bbl@scndcs}
%
% These macros are used only as a trick when declaring shorthands.
%
@@ -8153,8 +8175,8 @@ wouldn’t exist.
\def\bbl@scndcs#1#2{\csname#2\endcsname}
% \end{macrocode}
%
-% \end{macro}
-% \end{macro}
+% \end{macro}
+% \end{macro}
%
% \begin{macro}{\declare@shorthand}
% The command |\declare@shorthand| is used to declare a shorthand
@@ -8212,12 +8234,12 @@ wouldn’t exist.
\fi}
% \end{macrocode}
%
-% \end{macro}
+% \end{macro}
%
-% \begin{macro}{\textormath}
-% Some of the shorthands that will be declared by the language
-% definition files have to be usable in both text and mathmode. To
-% achieve this the helper macro |\textormath| is provided.
+% \begin{macro}{\textormath}
+% Some of the shorthands that will be declared by the language
+% definition files have to be usable in both text and mathmode. To
+% achieve this the helper macro |\textormath| is provided.
%
% \begin{macrocode}
\def\textormath{%
@@ -8228,16 +8250,15 @@ wouldn’t exist.
\fi}
% \end{macrocode}
%
-% \end{macro}
+% \end{macro}
%
-% \begin{macro}{\user@group}
-% \begin{macro}{\language@group}
-% \begin{macro}{\system@group}
-% The current concept of `shorthands' supports three levels or
-% groups of shorthands. For each level the name of the level or
-% group is stored in a macro. The default is to have a user group;
-% use language group `english' and have a system group called
-% `system'.
+% \begin{macro}{\user@group}
+% \begin{macro}{\language@group}
+% \begin{macro}{\system@group}
+% The current concept of `shorthands' supports three levels or groups
+% of shorthands. For each level the name of the level or group is
+% stored in a macro. The default is to have a user group; use language
+% group `english' and have a system group called `system'.
%
% \begin{macrocode}
\def\user@group{user}
@@ -8245,17 +8266,17 @@ wouldn’t exist.
\def\system@group{system}
% \end{macrocode}
%
-% \end{macro}
-% \end{macro}
-% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
%
-% \begin{macro}{\useshorthands}
+% \begin{macro}{\useshorthands}
%
-% This is the user level macro. It initializes and activates the
-% character for use as a shorthand character (ie, it's active in the
-% preamble). Languages can deactivate shorthands, so a starred
-% version is also provided which activates them always after the
-% language has been switched.
+% This is the user level macro. It initializes and activates the
+% character for use as a shorthand character (ie, it's active in the
+% preamble). Languages can deactivate shorthands, so a starred version
+% is also provided which activates them always after the language has
+% been switched.
%
% \begin{macrocode}
\def\useshorthands{%
@@ -8273,12 +8294,12 @@ wouldn’t exist.
{\bbl@error{shorthand-is-off}{}{#2}{}}}
% \end{macrocode}
%
-% \end{macro}
+% \end{macro}
%
-% \begin{macro}{\defineshorthand}
+% \begin{macro}{\defineshorthand}
%
% Currently we only support two groups of user level shorthands,
-% named internally |user| and |user@<lang>| (language-dependent
+% named internally |user| and |user@<language>| (language-dependent
% user shorthands). By default, only the first one is taken into
% account, but if the former is also used (in the optional argument
% of |\defineshorthand|) a new level is inserted for it
@@ -8308,30 +8329,30 @@ wouldn’t exist.
\declare@shorthand{\bbl@tempb}{#2}{#3}}}
% \end{macrocode}
%
-% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\languageshorthands}
%
-% \begin{macro}{\languageshorthands}
+% A user level command to change the language from which shorthands are
+% used. Unfortunately, \babel{} currently does not keep track of
+% defined groups, and therefore there is no way to catch a possible
+% change in casing to fix it in the same way languages names are fixed.
+% [TODO].
%
-% A user level command to change the language from which shorthands
-% are used. Unfortunately, \babel{} currently does not keep track
-% of defined groups, and therefore there is no way to catch a
-% possible change in casing to fix it in the same way languages names
-% are fixed. [TODO].
-% %
% \begin{macrocode}
\def\languageshorthands#1{\def\language@group{#1}}
% \end{macrocode}
%
-% \end{macro}
+% \end{macro}
%
-% \begin{macro}{\aliasshorthand}
+% \begin{macro}{\aliasshorthand}
%
% \textit{Deprecated}. First the new shorthand needs to be
% initialized. Then, we define the new shorthand in terms of the
% original one, but note with |\aliasshorthands{"}{/}| is
% |\active@prefix /\active@char/|, so we still need to let the
% latter to |\active@char"|.
-%
+%
% \begin{macrocode}
\def\aliasshorthand#1#2{%
\bbl@ifshorthand{#2}%
@@ -8348,18 +8369,18 @@ wouldn’t exist.
{\bbl@error{shorthand-is-off}{}{#2}{}}}
% \end{macrocode}
%
-% \end{macro}
+% \end{macro}
%
-% \begin{macro}{\@notshorthand}
+% \begin{macro}{\@notshorthand}
%
% \begin{macrocode}
\def\@notshorthand#1{\bbl@error{not-a-shorthand}{#1}{}{}}
% \end{macrocode}
%
-% \end{macro}
+% \end{macro}
%
-% \begin{macro}{\shorthandon}
-% \begin{macro}{\shorthandoff}
+% \begin{macro}{\shorthandon}
+% \begin{macro}{\shorthandoff}
%
% The first level definition of these macros just passes the
% argument on to |\bbl@switch@sh|, adding |\@nil| at the end to
@@ -8372,7 +8393,7 @@ wouldn’t exist.
\def\bbl@shorthandoff#1#2{\bbl@switch@sh#1#2\@nnil}
% \end{macrocode}
%
-% \begin{macro}{\bbl@switch@sh}
+% \begin{macro}{\bbl@switch@sh}
%
% The macro |\bbl@switch@sh| takes the list of characters apart one
% by one and subsequently switches the category code of the
@@ -8418,9 +8439,9 @@ wouldn’t exist.
\fi}
% \end{macrocode}
%
-% \end{macro}
-% \end{macro}
-% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
%
% Note the value is that at the expansion time; eg, in the preamble
% shorthands are usually deactivated.
@@ -8461,8 +8482,8 @@ wouldn’t exist.
\newcommand\ifbabelshorthand[3]{\bbl@ifunset{bbl@active@\string#1}{#3}{#2}}
% \end{macrocode}
%
-% \begin{macro}{\bbl@prim@s}
-% \begin{macro}{\bbl@pr@m@s}
+% \begin{macro}{\bbl@prim@s}
+% \begin{macro}{\bbl@pr@m@s}
%
% One of the internal macros that are involved in substituting |\prime|
% for each right quote in mathmode is |\prim@s|. This checks if the
@@ -8492,8 +8513,8 @@ wouldn’t exist.
\endgroup
% \end{macrocode}
%
-% \end{macro}
-% \end{macro}
+% \end{macro}
+% \end{macro}
%
% Usually the |~| is active and expands to \verb*=\penalty\@M\ =.
% When it is written to the \file{.aux} file it is written
@@ -8511,20 +8532,20 @@ wouldn’t exist.
\bbl@activate{~}
% \end{macrocode}
%
-% \begin{macro}{\OT1dqpos}
-% \begin{macro}{\T1dqpos}
-% The position of the double quote character is different for the
-% OT1 and T1 encodings. It will later be selected using the
-% |\f@encoding| macro. Therefore we define two macros here to store
-% the position of the character in these encodings.
+% \begin{macro}{\OT1dqpos}
+% \begin{macro}{\T1dqpos}
+% The position of the double quote character is different for the OT1
+% and T1 encodings. It will later be selected using the |\f@encoding|
+% macro. Therefore we define two macros here to store the position of
+% the character in these encodings.
%
% \begin{macrocode}
\expandafter\def\csname OT1dqpos\endcsname{127}
\expandafter\def\csname T1dqpos\endcsname{4}
% \end{macrocode}
%
-% When the macro |\f@encoding| is undefined (as it is in plain
-% \TeX) we define it here to expand to \texttt{OT1}
+% When the macro |\f@encoding| is undefined (as it is in plain \TeX) we
+% define it here to expand to \texttt{OT1}
%
% \begin{macrocode}
\ifx\f@encoding\@undefined
@@ -8532,21 +8553,20 @@ wouldn’t exist.
\fi
% \end{macrocode}
%
-% \end{macro}
-% \end{macro}
+% \end{macro}
+% \end{macro}
%
% \subsection{Language attributes}
%
-% Language attributes provide a means to give the user control over
-% which features of the language definition files he wants to
-% enable.
+% Language attributes provide a means to give the user control over
+% which features of the language definition files he wants to enable.
%
-% \begin{macro}{\languageattribute}
+% \begin{macro}{\languageattribute}
%
-% The macro |\languageattribute| checks whether its arguments are
-% valid and then activates the selected language attribute.
-% First check whether the language is known, and then process each
-% attribute in the list.
+% The macro |\languageattribute| checks whether its arguments are valid
+% and then activates the selected language attribute. First check
+% whether the language is known, and then process each attribute in the
+% list.
%
% \begin{macrocode}
\bbl@trace{Language attributes}
@@ -8590,25 +8610,24 @@ wouldn’t exist.
\@onlypreamble\languageattribute
% \end{macrocode}
%
-% The error text to be issued when an unknown attribute is
-% selected.
+% The error text to be issued when an unknown attribute is selected.
%
% \begin{macrocode}
\newcommand*{\@attrerr}[2]{%
\bbl@error{unknown-attribute}{#1}{#2}{}}
% \end{macrocode}
%
-% \end{macro}
+% \end{macro}
%
-% \begin{macro}{\bbl@declare@ttribute}
-% This command adds the new language/attribute combination to the
-% list of known attributes.
+% \begin{macro}{\bbl@declare@ttribute}
+% This command adds the new language/attribute combination to the list
+% of known attributes.
%
-% Then it defines a control sequence to be executed when the
-% attribute is used in a document. The result of this should be
-% that the macro |\extras...| for the current language is extended,
-% otherwise the attribute will not work as its code is removed from
-% memory at |\begin{document}|.
+% Then it defines a control sequence to be executed when the attribute
+% is used in a document. The result of this should be that the macro
+% |\extras...| for the current language is extended, otherwise the
+% attribute will not work as its code is removed from memory at
+% |\begin{document}|.
%
% \begin{macrocode}
\def\bbl@declare@ttribute#1#2#3{%
@@ -8620,18 +8639,18 @@ wouldn’t exist.
\expandafter\def\csname#1@attr@#2\endcsname{#3}}
% \end{macrocode}
%
-% \end{macro}
+% \end{macro}
%
-% \begin{macro}{\bbl@ifattributeset}
-% This internal macro has 4 arguments. It can be used to interpret
-% \TeX\ code based on whether a certain attribute was set. This
-% command should appear inside the argument to |\AtBeginDocument|
-% because the attributes are set in the document preamble,
-% \emph{after} \babel\ is loaded.
+% \begin{macro}{\bbl@ifattributeset}
+% This internal macro has 4 arguments. It can be used to interpret
+% \TeX\ code based on whether a certain attribute was set. This command
+% should appear inside the argument to |\AtBeginDocument| because the
+% attributes are set in the document preamble, \emph{after} \babel\ is
+% loaded.
%
-% The first argument is the language, the second argument the
-% attribute being checked, and the third and fourth arguments are
-% the true and false clauses.
+% The first argument is the language, the second argument the attribute
+% being checked, and the third and fourth arguments are the true and
+% false clauses.
%
% \begin{macrocode}
\def\bbl@ifattributeset#1#2#3#4{%
@@ -8647,16 +8666,16 @@ wouldn’t exist.
\fi}
% \end{macrocode}
%
-% \end{macro}
+% \end{macro}
%
-% \begin{macro}{\bbl@ifknown@ttrib}
-% An internal macro to check whether a given language/attribute is
-% known. The macro takes 4 arguments, the language/attribute, the
-% attribute list, the \TeX-code to be executed when the attribute
-% is known and the \TeX-code to be executed otherwise.
+% \begin{macro}{\bbl@ifknown@ttrib}
+% An internal macro to check whether a given language/attribute is
+% known. The macro takes 4 arguments, the language/attribute, the
+% attribute list, the \TeX-code to be executed when the attribute is
+% known and the \TeX-code to be executed otherwise.
%
-% We first assume the attribute is unknown. Then we loop over the
-% list of known attributes, trying to find a match.
+% We first assume the attribute is unknown. Then we loop over the list
+% of known attributes, trying to find a match.
%
% \begin{macrocode}
\def\bbl@ifknown@ttrib#1#2{%
@@ -8670,11 +8689,11 @@ wouldn’t exist.
\bbl@tempa}
% \end{macrocode}
%
-% \end{macro}
+% \end{macro}
%
-% \begin{macro}{\bbl@clear@ttribs}
-% This macro removes all the attribute code from \LaTeX's memory at
-% |\begin{document}| time (if any is present).
+% \begin{macro}{\bbl@clear@ttribs}
+% This macro removes all the attribute code from \LaTeX's memory at
+% |\begin{document}| time (if any is present).
%
% \begin{macrocode}
\def\bbl@clear@ttribs{%
@@ -8688,43 +8707,41 @@ wouldn’t exist.
\AtBeginDocument{\bbl@clear@ttribs}
% \end{macrocode}
%
-% \end{macro}
+% \end{macro}
%
% \subsection{Support for saving macro definitions}
%
-% To save the meaning of control sequences using |\babel@save|, we
-% use temporary control sequences. To save hash table entries for
-% these control sequences, we don't use the name of the control
-% sequence to be saved to construct the temporary name. Instead we
-% simply use the value of a counter, which is reset to zero each time
-% we begin to save new values. This works well because we release
-% the saved meanings before we begin to save a new set of control
-% sequence meanings (see |\selectlanguage| and |\originalTeX|). Note
-% undefined macros are not undefined any more when saved -- they are
-% |\relax|'ed.
+% To save the meaning of control sequences using |\babel@save|, we use
+% temporary control sequences. To save hash table entries for these
+% control sequences, we don't use the name of the control sequence to
+% be saved to construct the temporary name. Instead we simply use the
+% value of a counter, which is reset to zero each time we begin to save
+% new values. This works well because we release the saved meanings
+% before we begin to save a new set of control sequence meanings (see
+% |\selectlanguage| and |\originalTeX|). Note undefined macros are not
+% undefined any more when saved -- they are |\relax|'ed.
%
-% \begin{macro}{\babel@savecnt}
-% \begin{macro}{\babel@beginsave}
-% The initialization of a new save cycle: reset the counter to
-% zero.
+% \begin{macro}{\babel@savecnt}
+% \begin{macro}{\babel@beginsave}
+% The initialization of a new save cycle: reset the counter to zero.
%
% \begin{macrocode}
\bbl@trace{Macros for saving definitions}
\def\babel@beginsave{\babel@savecnt\z@}
% \end{macrocode}
%
-% Before it's forgotten, allocate the counter and initialize all.
+% Before it's forgotten, allocate the counter and initialize all.
%
% \begin{macrocode}
\newcount\babel@savecnt
\babel@beginsave
% \end{macrocode}
%
-% \end{macro}
-% \end{macro}
+% \end{macro}
+% \end{macro}
%
-% \begin{macro}{\babel@save}
-% \begin{macro}{\babel@savevariable}
+% \begin{macro}{\babel@save}
+% \begin{macro}{\babel@savevariable}
%
% The macro |\babel@save|\meta{csname} saves the current meaning of the
% control sequence \meta{csname} to
@@ -8756,11 +8773,11 @@ wouldn’t exist.
\bbl@exp{\def\\\originalTeX{\the\toks@\the#1\relax}}}
% \end{macrocode}
%
-% \end{macro}
-% \end{macro}
+% \end{macro}
+% \end{macro}
%
-% \begin{macro}{\bbl@frenchspacing}
-% \begin{macro}{\bbl@nonfrenchspacing}
+% \begin{macro}{\bbl@frenchspacing}
+% \begin{macro}{\bbl@nonfrenchspacing}
% Some languages need to have |\frenchspacing| in effect. Others
% don't want that. The command |\bbl@frenchspacing| switches it on
% when it isn't already in effect and |\bbl@nonfrenchspacing|
@@ -8808,15 +8825,15 @@ wouldn’t exist.
\fi\fi\fi}
% \end{macrocode}
%
-% \end{macro}
-% \end{macro}
+% \end{macro}
+% \end{macro}
%
% \subsection{Short tags}
%
% \begin{macro}{\babeltags}
% This macro is straightforward. After zapping spaces, we
-% loop over the list and define the macros |\text|\m{tag} and
-% |\|\m{tag}. Definitions are first expanded so that they don't
+% loop over the list and define the macros |\text<tag>| and
+% |\<tag>|. Definitions are first expanded so that they don't
% contain |\csname| but the actual macro.
%
% \begin{macrocode}
@@ -8845,7 +8862,7 @@ wouldn’t exist.
%
% This macro saves hyphenation exceptions. Two macros are used to
% store them: |\bbl@hyphenation@| for the global ones and
-% |\bbl@hyphenation<lang>| for language ones. See |\bbl@patterns|
+% |\bbl@hyphenation<language>| for language ones. See |\bbl@patterns|
% above for further details. We make sure there is a space between
% words when multiple commands are used.
%
@@ -8878,9 +8895,9 @@ wouldn’t exist.
\fi}}
% \end{macrocode}
%
-% \end{macro}
+% \end{macro}
%
-% \begin{macro}{\bbl@allowhyphens}
+% \begin{macro}{\bbl@allowhyphens}
%
% This macro makes hyphenation possible. Basically its definition
% is nothing more than |\nobreak| |\hskip| \texttt{0pt plus
@@ -8893,7 +8910,7 @@ wouldn’t exist.
\def\allowhyphens{\ifx\cf@encoding\bbl@t@one\else\bbl@allowhyphens\fi}
% \end{macrocode}
%
-% \end{macro}
+% \end{macro}
%
% \begin{macro}{\babelhyphen}
%
@@ -8935,7 +8952,7 @@ wouldn’t exist.
\leavevmode\ifdim\lastskip>\z@\mbox{#1}\else#1\fi}
% \end{macrocode}
%
-% The following macro inserts the hyphen char.
+% The following macro inserts the hyphen char.
%
% \begin{macrocode}
\def\bbl@hyphenchar{%
@@ -8946,9 +8963,9 @@ wouldn’t exist.
\fi}
% \end{macrocode}
%
-% Finally, we define the hyphen ``types''. Their names will not
-% change, so you may use them in |ldf|'s. After a space, the
-% |\mbox| in |\bbl@hy@nobreak| is redundant.
+% Finally, we define the hyphen ``types''. Their names will not change,
+% so you may use them in |ldf|'s. After a space, the |\mbox| in
+% |\bbl@hy@nobreak| is redundant.
%
% \begin{macrocode}
\def\bbl@hy@soft{\bbl@usehyphen{\discretionary{\bbl@hyphenchar}{}{}}}
@@ -8967,18 +8984,18 @@ wouldn’t exist.
\def\bbl@hy@@empty{\discretionary{}{}{}}
% \end{macrocode}
%
-% \end{macro}
+% \end{macro}
%
-% \begin{macro}{\bbl@disc}
-% For some languages the macro |\bbl@disc| is used to ease the
-% insertion of discretionaries for letters that behave `abnormally'
-% at a breakpoint.
+% \begin{macro}{\bbl@disc}
+% For some languages the macro |\bbl@disc| is used to ease the
+% insertion of discretionaries for letters that behave `abnormally' at
+% a breakpoint.
%
% \begin{macrocode}
\def\bbl@disc#1#2{\nobreak\discretionary{#2-}{}{#1}\bbl@allowhyphens}
% \end{macrocode}
%
-% \end{macro}
+% \end{macro}
%
% \subsection{Multiencoding strings}
%
@@ -9143,14 +9160,14 @@ wouldn’t exist.
% \end{macrocode}
%
% There are two versions of |\bbl@scswitch|. The first version is used
-% when |ldf|s are read, and it makes sure |\|\m{group}\m{language} is
+% when |ldf|s are read, and it makes sure |\<group><language>| is
% reset, but only once (|\bbl@screset| is used to keep track of this).
% The second version is used in the preamble and packages loaded after
% \babel{} and does nothing.
%
% The macro |\bbl@forlang| loops |\bbl@L| but its body is executed only
% if the value is in |\BabelLanguages| (inside \babel) or
-% |\date|\m{language} is defined (after \babel{} has been loaded).
+% |\date<language>| is defined (after \babel{} has been loaded).
% There are also two version of |\bbl@forlang|. The first one skips the
% current iteration if the language is not in |\BabelLanguages| (used
% in |ldf|s), and the second one skips undefined languages (after
@@ -9285,9 +9302,9 @@ wouldn’t exist.
%<</Macros local to BabelCommands>>
% \end{macrocode}
%
-% There are 3 helper macros which do most of the work for you.
+% There are 3 helper macros which do most of the work for you.
%
-% \begin{macrocode}
+% \begin{macrocode}
\newcommand\BabelLower[2]{% one to one.
\ifnum\lccode#1=#2\else
\babel@savevariable{\lccode#1}%
@@ -9328,8 +9345,8 @@ wouldn’t exist.
%<</More package options>>
% \end{macrocode}
%
-% Initial setup to provide a default behavior if |hyphenmap|
-% is not set.
+% Initial setup to provide a default behavior if |hyphenmap| is not
+% set.
%
% \begin{macrocode}
\AtEndOfPackage{%
@@ -9360,7 +9377,7 @@ wouldn’t exist.
{\expandafter\string\csname #2name\endcsname}%
{\bbl@tempd}%
\ifin@ % Renew caption
- \bbl@xin@{\string\bbl@scset}{\bbl@tempd}%
+ \bbl@xin@{\string\bbl@scset}{\bbl@tempd}%
\ifin@
\bbl@exp{%
\\\bbl@ifsamestring{\bbl@tempa}{\languagename}%
@@ -9385,7 +9402,7 @@ wouldn’t exist.
{}}%
\else % Old way, but defined in the new way
\bbl@exp{%
- \\\bbl@add\<captions#1>{\def\<#2name>{\<#1#2name>}}%
+ \\\bbl@add\<captions#1>{\def\<#2name>{\<#1#2name>}}%
\\\bbl@ifsamestring{\bbl@tempa}{\languagename}%
{\def\<#2name>{\<#1#2name>}}%
{}}%
@@ -9404,7 +9421,7 @@ wouldn’t exist.
%
% \subsection{Macros common to a number of languages}
%
-% \begin{macro}{\set@low@box}
+% \begin{macro}{\set@low@box}
%
% The following macro is used to lower quotes to the same level as
% the comma. It prepares its argument in box register~0.
@@ -9416,11 +9433,11 @@ wouldn’t exist.
\setbox\z@\hbox{\lower\dimen\z@ \box\z@}\ht\z@\ht\tw@ \dp\z@\dp\tw@}
% \end{macrocode}
%
-% \end{macro}
+% \end{macro}
%
-% \begin{macro}{\save@sf@q}
-% The macro |\save@sf@q| is used to save and reset the current
-% space factor.
+% \begin{macro}{\save@sf@q}
+% The macro |\save@sf@q| is used to save and reset the current space
+% factor.
%
% \begin{macrocode}
\def\save@sf@q#1{\leavevmode
@@ -9429,7 +9446,7 @@ wouldn’t exist.
\endgroup}
% \end{macrocode}
%
-% \end{macro}
+% \end{macro}
%
% \subsection{Making glyphs available}
%
@@ -9439,7 +9456,7 @@ wouldn’t exist.
%
% \subsubsection{Quotation marks}
%
-% \begin{macro}{\quotedblbase}
+% \begin{macro}{\quotedblbase}
% In the \texttt{T1} encoding the opening double quote at the
% baseline is available as a separate character, accessible via
% |\quotedblbase|. In the \texttt{OT1} encoding it is not
@@ -9460,10 +9477,10 @@ wouldn’t exist.
\UseTextSymbol{OT1}{\quotedblbase}}
% \end{macrocode}
%
-% \end{macro}
+% \end{macro}
%
-% \begin{macro}{\quotesinglbase}
-% We also need the single quote character at the baseline.
+% \begin{macro}{\quotesinglbase}
+% We also need the single quote character at the baseline.
%
% \begin{macrocode}
\ProvideTextCommand{\quotesinglbase}{OT1}{%
@@ -9471,18 +9488,18 @@ wouldn’t exist.
\box\z@\kern-.04em\bbl@allowhyphens}}
% \end{macrocode}
%
-% Make sure that when an encoding other than \texttt{OT1} or
-% \texttt{T1} is used this glyph can still be typeset.
+% Make sure that when an encoding other than \texttt{OT1} or
+% \texttt{T1} is used this glyph can still be typeset.
%
% \begin{macrocode}
\ProvideTextCommandDefault{\quotesinglbase}{%
\UseTextSymbol{OT1}{\quotesinglbase}}
% \end{macrocode}
%
-% \end{macro}
+% \end{macro}
%
-% \begin{macro}{\guillemetleft}
-% \begin{macro}{\guillemetright}
+% \begin{macro}{\guillemetleft}
+% \begin{macro}{\guillemetright}
% The guillemet characters are not available in \texttt{OT1}
% encoding. They are faked. (Wrong names with o preserved for
% compatibility.)
@@ -9532,13 +9549,13 @@ wouldn’t exist.
\UseTextSymbol{OT1}{\guillemotright}}
% \end{macrocode}
%
-% \end{macro}
-% \end{macro}
+% \end{macro}
+% \end{macro}
%
-% \begin{macro}{\guilsinglleft}
-% \begin{macro}{\guilsinglright}
-% The single guillemets are not available in \texttt{OT1}
-% encoding. They are faked.
+% \begin{macro}{\guilsinglleft}
+% \begin{macro}{\guilsinglright}
+% The single guillemets are not available in \texttt{OT1} encoding.
+% They are faked.
%
% \begin{macrocode}
\ProvideTextCommand{\guilsinglleft}{OT1}{%
@@ -9567,13 +9584,13 @@ wouldn’t exist.
\UseTextSymbol{OT1}{\guilsinglright}}
% \end{macrocode}
%
-% \end{macro}
-% \end{macro}
+% \end{macro}
+% \end{macro}
%
% \subsubsection{Letters}
%
-% \begin{macro}{\ij}
-% \begin{macro}{\IJ}
+% \begin{macro}{\ij}
+% \begin{macro}{\IJ}
% The dutch language uses the letter `ij'. It is available in
% \texttt{T1} encoded fonts, but not in the \texttt{OT1} encoded
% fonts. Therefore we fake it for the \texttt{OT1} encoding.
@@ -9587,8 +9604,8 @@ wouldn’t exist.
\DeclareTextCommand{\IJ}{T1}{\char156}
% \end{macrocode}
%
-% Make sure that when an encoding other than \texttt{OT1} or
-% \texttt{T1} is used these glyphs can still be typeset.
+% Make sure that when an encoding other than \texttt{OT1} or
+% \texttt{T1} is used these glyphs can still be typeset.
%
% \begin{macrocode}
\ProvideTextCommandDefault{\ij}{%
@@ -9597,8 +9614,8 @@ wouldn’t exist.
\UseTextSymbol{OT1}{\IJ}}
% \end{macrocode}
%
-% \end{macro}
-% \end{macro}
+% \end{macro}
+% \end{macro}
%
% \begin{macro}{\dj}
% \begin{macro}{\DJ}
@@ -9632,8 +9649,8 @@ wouldn’t exist.
\DeclareTextCommand{\DJ}{OT1}{\DDJ@ D}
% \end{macrocode}
%
-% Make sure that when an encoding other than \texttt{OT1} or
-% \texttt{T1} is used these glyphs can still be typeset.
+% Make sure that when an encoding other than \texttt{OT1} or
+% \texttt{T1} is used these glyphs can still be typeset.
%
% \begin{macrocode}
\ProvideTextCommandDefault{\dj}{%
@@ -9642,41 +9659,41 @@ wouldn’t exist.
\UseTextSymbol{OT1}{\DJ}}
% \end{macrocode}
%
-% \end{macro}
-% \end{macro}
+% \end{macro}
+% \end{macro}
%
-% \begin{macro}{\SS}
-% For the \texttt{T1} encoding |\SS| is defined and selects a
-% specific glyph from the font, but for other encodings it is not
-% available. Therefore we make it available here.
+% \begin{macro}{\SS}
+% For the \texttt{T1} encoding |\SS| is defined and selects a specific
+% glyph from the font, but for other encodings it is not available.
+% Therefore we make it available here.
%
% \begin{macrocode}
\DeclareTextCommand{\SS}{OT1}{SS}
\ProvideTextCommandDefault{\SS}{\UseTextSymbol{OT1}{\SS}}
% \end{macrocode}
%
-% \end{macro}
+% \end{macro}
%
% \subsubsection{Shorthands for quotation marks}
%
-% Shorthands are provided for a number of different quotation
-% marks, which make them usable both outside and inside mathmode.
-% They are defined with |\ProvideTextCommandDefault|, but this is
-% very likely not required because their definitions are based on
-% encoding-dependent macros.
+% Shorthands are provided for a number of different quotation marks,
+% which make them usable both outside and inside mathmode. They are
+% defined with |\ProvideTextCommandDefault|, but this is very likely
+% not required because their definitions are based on
+% encoding-dependent macros.
%
-% \begin{macro}{\glq}
-% \begin{macro}{\grq}
+% \begin{macro}{\glq}
+% \begin{macro}{\grq}
%
-% The `german' single quotes.
+% The `german' single quotes.
%
% \begin{macrocode}
\ProvideTextCommandDefault{\glq}{%
\textormath{\quotesinglbase}{\mbox{\quotesinglbase}}}
% \end{macrocode}
%
-% The definition of |\grq| depends on the fontencoding. With
-% \texttt{T1} encoding no extra kerning is needed.
+% The definition of |\grq| depends on the fontencoding. With
+% \texttt{T1} encoding no extra kerning is needed.
%
% \begin{macrocode}
\ProvideTextCommand{\grq}{T1}{%
@@ -9690,21 +9707,21 @@ wouldn’t exist.
\ProvideTextCommandDefault{\grq}{\UseTextSymbol{OT1}\grq}
% \end{macrocode}
%
-% \end{macro}
-% \end{macro}
+% \end{macro}
+% \end{macro}
%
-% \begin{macro}{\glqq}
-% \begin{macro}{\grqq}
+% \begin{macro}{\glqq}
+% \begin{macro}{\grqq}
%
-% The `german' double quotes.
+% The `german' double quotes.
%
% \begin{macrocode}
\ProvideTextCommandDefault{\glqq}{%
\textormath{\quotedblbase}{\mbox{\quotedblbase}}}
% \end{macrocode}
%
-% The definition of |\grqq| depends on the fontencoding. With
-% \texttt{T1} encoding no extra kerning is needed.
+% The definition of |\grqq| depends on the fontencoding. With
+% \texttt{T1} encoding no extra kerning is needed.
%
% \begin{macrocode}
\ProvideTextCommand{\grqq}{T1}{%
@@ -9718,13 +9735,13 @@ wouldn’t exist.
\ProvideTextCommandDefault{\grqq}{\UseTextSymbol{OT1}\grqq}
% \end{macrocode}
%
-% \end{macro}
-% \end{macro}
+% \end{macro}
+% \end{macro}
%
-% \begin{macro}{\flq}
-% \begin{macro}{\frq}
+% \begin{macro}{\flq}
+% \begin{macro}{\frq}
%
-% The `french' single guillemets.
+% The `french' single guillemets.
%
% \begin{macrocode}
\ProvideTextCommandDefault{\flq}{%
@@ -9733,13 +9750,13 @@ wouldn’t exist.
\textormath{\guilsinglright}{\mbox{\guilsinglright}}}
% \end{macrocode}
%
-% \end{macro}
-% \end{macro}
+% \end{macro}
+% \end{macro}
%
-% \begin{macro}{\flqq}
-% \begin{macro}{\frqq}
+% \begin{macro}{\flqq}
+% \begin{macro}{\frqq}
%
-% The `french' double guillemets.
+% The `french' double guillemets.
%
% \begin{macrocode}
\ProvideTextCommandDefault{\flqq}{%
@@ -9748,24 +9765,24 @@ wouldn’t exist.
\textormath{\guillemetright}{\mbox{\guillemetright}}}
% \end{macrocode}
%
-% \end{macro}
-% \end{macro}
+% \end{macro}
+% \end{macro}
%
% \subsubsection{Umlauts and tremas}
%
-% The command |\"| needs to have a different effect for different
-% languages. For German for instance, the `umlaut' should be
-% positioned lower than the default position for placing it over
-% the letters a, o, u, A, O and U. When placed over an e, i, E or I
-% it can retain its normal position. For Dutch the same glyph is
-% always placed in the lower position.
+% The command |\"| needs to have a different effect for different
+% languages. For German for instance, the `umlaut' should be positioned
+% lower than the default position for placing it over the letters a, o,
+% u, A, O and U. When placed over an e, i, E or I it can retain its
+% normal position. For Dutch the same glyph is always placed in the
+% lower position.
%
-% \begin{macro}{\umlauthigh}
+% \begin{macro}{\umlauthigh}
%
-% \begin{macro}{\umlautlow}
-% To be able to provide both positions of |\"| we provide two
-% commands to switch the positioning, the default will be
-% |\umlauthigh| (the normal positioning).
+% \begin{macro}{\umlautlow}
+% To be able to provide both positions of |\"| we provide two commands
+% to switch the positioning, the default will be |\umlauthigh| (the
+% normal positioning).
%
% \begin{macrocode}
\def\umlauthigh{%
@@ -9780,15 +9797,13 @@ wouldn’t exist.
\umlauthigh
% \end{macrocode}
%
-% \end{macro}
-% \end{macro}
-%
-% \begin{macro}{\lower@umlaut}
-% The command |\lower@umlaut| is used to position the |\"| closer
-% to the letter.
+% \end{macro}
+% \end{macro}
%
-% We want the umlaut character lowered, nearer to the letter. To do
-% this we need an extra \meta{dimen} register.
+% \begin{macro}{\lower@umlaut}
+% The command |\lower@umlaut| is used to position the |\"| closer to
+% the letter. We want the umlaut character lowered, nearer to the
+% letter. To do this we need an extra \meta{dimen} register.
%
% \begin{macrocode}
\expandafter\ifx\csname U@D\endcsname\relax
@@ -9796,20 +9811,19 @@ wouldn’t exist.
\fi
% \end{macrocode}
%
-% The following code fools \TeX's \texttt{make\_accent} procedure
-% about the current x-height of the font to force another placement
-% of the umlaut character.
-% First we have to save the current x-height of the font, because
-% we'll change this font dimension and this is always done
-% globally.
+% The following code fools \TeX's \texttt{make\_accent} procedure about
+% the current x-height of the font to force another placement of the
+% umlaut character. First we have to save the current x-height of the
+% font, because we'll change this font dimension and this is always
+% done globally.
%
-% Then we compute the new x-height in such a way that the umlaut
-% character is lowered to the base character. The value of
-% \texttt{.45ex} depends on the \MF\ parameters with which the
-% fonts were built. (Just try out, which value will look best.)
-% If the new x-height is too low, it is not changed.
-% Finally we call the |\accent| primitive, reset the old x-height
-% and insert the base character in the argument.
+% Then we compute the new x-height in such a way that the umlaut
+% character is lowered to the base character. The value of
+% \texttt{.45ex} depends on the \MF\ parameters with which the fonts
+% were built. (Just try out, which value will look best.) If the new
+% x-height is too low, it is not changed. Finally we call the |\accent|
+% primitive, reset the old x-height and insert the base character in
+% the argument.
%
% \begin{macrocode}
\def\lower@umlaut#1{%
@@ -9824,7 +9838,7 @@ wouldn’t exist.
\egroup}
% \end{macrocode}
%
-% \end{macro}
+% \end{macro}
%
% For all vowels we declare |\"| to be a composite command which
% uses |\bbl@umlauta| or |\bbl@umlaute| to position the umlaut
@@ -9833,9 +9847,9 @@ wouldn’t exist.
% option \Lopt{OT1} is used. Therefore these declarations are
% postponed until the beginning of the document. Note these
% definitions only apply to some languages, but
-% babel sets them for \textit{all} languages -- you may want to
+% \babel{} sets them for \textit{all} languages -- you may want to
% redefine |\bbl@umlauta| and/or |\bbl@umlaute| for a language
-% in the corresponding |ldf| (using the babel switching mechanism,
+% in the corresponding |ldf| (using the \babel{} switching mechanism,
% of course).
%
% \begin{macrocode}
@@ -9913,7 +9927,7 @@ wouldn’t exist.
% \end{macrocode}
%
% \subsection{Load engine specific macros}
-%
+%
% Some macros are not defined in all engines, so, after loading the
% files define them if necessary to raise an error.
%
@@ -9967,7 +9981,7 @@ wouldn’t exist.
\global\let\bbl@inidata\@empty
\global\let\bbl@extend@ini\@gobble
\global\let\bbl@included@inis\@empty
- \gdef\bbl@key@list{;}%
+ \gdef\bbl@key@list{;}%
\bbl@forkv{#1}{%
\in@{/}{##1}% With /, (re)sets a value in the ini
\ifin@
@@ -10425,7 +10439,7 @@ wouldn’t exist.
\bbl@csarg\let{lname@\languagename}\relax
\fi
\fi
- \bbl@ifunset{bbl@lname@#1}%
+ \bbl@ifunset{bbl@lname@#1}%
{\def\BabelBeforeIni##1##2{%
\begingroup
\let\bbl@ini@captions@aux\@gobbletwo
@@ -10454,7 +10468,7 @@ wouldn’t exist.
\bbl@replace\bbl@KVP@hyphenrules{ }{,}%
\bbl@foreach\bbl@KVP@hyphenrules{%
\ifnum\@tempcnta=\m@ne % if not yet found
- \bbl@ifsamestring{##1}{+}%
+ \bbl@ifsamestring{##1}{+}%
{\bbl@carg\addlanguage{l@##1}}%
{}%
\bbl@ifunset{l@##1}% After a possible +
@@ -10521,7 +10535,7 @@ wouldn’t exist.
\bbl@trim\toks@{#2}%
\bbl@xin@{;\bbl@section/\bbl@tempa;}{\bbl@key@list}%
\ifin@\else
- \bbl@xin@{,identification/include.}%
+ \bbl@xin@{,identification/include.}%
{,\bbl@section/\bbl@tempa}%
\ifin@\xdef\bbl@included@inis{\the\toks@}\fi
\bbl@exp{%
@@ -10622,7 +10636,7 @@ wouldn’t exist.
\setlocalecaption{#1}{##1}{##2}}%
\def\bbl@inikv@captions##1##2{%
\bbl@ini@captions@aux{##1}{##2}}%
- \def\bbl@stringdef##1##2{\gdef##1{##2}}%
+ \def\bbl@stringdef##1##2{\gdef##1{##2}}%
\def\bbl@exportkey##1##2##3{%
\bbl@ifunset{bbl@@kv@##2}{}%
{\expandafter\ifx\csname bbl@@kv@##2\endcsname\@empty\else
@@ -10665,7 +10679,7 @@ wouldn’t exist.
\xdef\bbl@calendars{\bbl@calendars,\bbl@tempa}%
\fi
\bbl@exp{%
- \def\<bbl@inikv@#1>####1####2{%
+ \def\<bbl@inikv@#1>####1####2{%
\\\bbl@inidate####1...\relax{####2}{\bbl@tempa}}}%
\fi}
% \end{macrocode}
@@ -10676,7 +10690,7 @@ wouldn’t exist.
% file has not yet been read), and define a dummy macro. When the |ini|
% file is read, just skip the corresponding key and reset the macro (in
% |\bbl@inistore| above).
-%
+%
%
% \begin{macrocode}
\def\bbl@renewinikey#1/#2\@@#3{%
@@ -10713,7 +10727,7 @@ wouldn’t exist.
% many other sources do (as a \textit{private use extension}). For
% consistency with other single-letter subtags or ‘singletons’, here
% is considered an extension, too.
-%
+%
% \begin{macrocode}
\def\bbl@iniwarning#1{%
\bbl@ifunset{bbl@@kv@identification.warning#1}{}%
@@ -10768,7 +10782,7 @@ wouldn’t exist.
\bbl@exportkey{lnbrk}{typography.linebreaking}{h}%
\bbl@exportkey{hyphr}{typography.hyphenrules}{}%
\bbl@exportkey{lfthm}{typography.lefthyphenmin}{2}%
- \bbl@exportkey{rgthm}{typography.righthyphenmin}{3}%
+ \bbl@exportkey{rgthm}{typography.righthyphenmin}{3}%
\bbl@exportkey{prehc}{typography.prehyphenchar}{}%
\bbl@exportkey{hyotl}{typography.hyphenate.other.locale}{}%
\bbl@exportkey{hyots}{typography.hyphenate.other.script}{}%
@@ -10881,9 +10895,9 @@ wouldn’t exist.
\def\bbl@toreplace{#1{}}%
\bbl@replace\bbl@toreplace{[ ]}{\nobreakspace{}}%
\bbl@replace\bbl@toreplace{[[}{\csname}%
- \bbl@replace\bbl@toreplace{[}{\csname the}%
+ \bbl@replace\bbl@toreplace{[}{\csname the}%
\bbl@replace\bbl@toreplace{]]}{name\endcsname{}}%
- \bbl@replace\bbl@toreplace{]}{\endcsname{}}%
+ \bbl@replace\bbl@toreplace{]}{\endcsname{}}%
\bbl@xin@{,\bbl@tempa,}{,chapter,appendix,part,}%
\ifin@
\@nameuse{bbl@patch\bbl@tempa}%
@@ -10922,7 +10936,7 @@ wouldn’t exist.
%
% \textbf{Labels.} Captions must contain just strings, no
% format at all, so there is new group in ini files.
-%
+%
% \begin{macrocode}
\def\bbl@list@the{%
part,chapter,section,subsection,subsubsection,paragraph,%
@@ -10971,8 +10985,8 @@ wouldn’t exist.
\bbl@replace\bbl@tempa{enumerate.}{}%
\def\bbl@toreplace{#2}%
\bbl@replace\bbl@toreplace{[ ]}{\nobreakspace{}}%
- \bbl@replace\bbl@toreplace{[}{\csname the}%
- \bbl@replace\bbl@toreplace{]}{\endcsname{}}%
+ \bbl@replace\bbl@toreplace{[}{\csname the}%
+ \bbl@replace\bbl@toreplace{]}{\endcsname{}}%
\toks@\expandafter{\bbl@toreplace}%
% TODO. Execute only once:
\bbl@exp{%
@@ -11162,7 +11176,7 @@ wouldn’t exist.
\bbl@csarg\let{inikv@transforms.posthyphenation}\bbl@inikv
\def\bbl@transforms@aux#1#2#3#4,#5\relax{%
#1[#2]{#3}{#4}{#5}}
-\begingroup % A hack. TODO. Don't require an specific order
+\begingroup % A hack. TODO. Don't require a specific order
\catcode`\%=12
\catcode`\&=14
\gdef\bbl@transforms#1#2#3{&%
@@ -11258,7 +11272,7 @@ wouldn’t exist.
'HyphenChar' to another value, but be aware\\%
this setting is not safe (see the manual).\\%
Reported}%
- \hyphenchar\font\defaulthyphenchar
+ \hyphenchar\font\defaulthyphenchar
\fi\fi
\fi}%
{\hyphenchar\font\defaulthyphenchar}}
@@ -11412,7 +11426,7 @@ wouldn’t exist.
%
% \LaTeX{} needs to know the BCP 47 codes for some features. For that,
% it expects |\BCPdata| to be defined. While |language|, |region|,
-% |script|, and |variant| are recognized, |extension.|\m{s} for
+% |script|, and |variant| are recognized, |extension.<s>| for
% singletons may change.
%
% \begin{macrocode}
@@ -11429,7 +11443,7 @@ wouldn’t exist.
\def\bbl@bcpdata@i#1#2#3#4#5#6\@empty{%
\@nameuse{str_if_eq:nnTF}{#1#2#3#4#5}{main.}%
{\bbl@bcpdata@ii{#6}\bbl@main@language}%
- {\bbl@bcpdata@ii{#1#2#3#4#5#6}\languagename}}%
+ {\bbl@bcpdata@ii{#1#2#3#4#5#6}\languagename}}%
\def\bbl@bcpdata@ii#1#2{%
\bbl@ifunset{bbl@info@#1.tag.bcp47}%
{\bbl@error{unknown-ini-field}{#1}{}{}}%
@@ -11444,9 +11458,9 @@ wouldn’t exist.
\newcommand\BabelLowercaseMapping[3]{%
\DeclareLowercaseMapping[\@nameuse{bbl@casing@#1}]{#2}{#3}}
% \end{macrocode}
-%
+%
% The parser for |casing| and |casing.|\meta{variant}.
-%
+%
% \begin{macrocode}
\def\bbl@casemapping#1#2#3{% 1:variant
\def\bbl@tempa##1 ##2{% Loop
@@ -11486,7 +11500,7 @@ wouldn’t exist.
%
% With version 3.75 |\BabelEnsureInfo| is executed always, but there is
% an option to disable it.
-%
+%
% \begin{macrocode}
%<<*More package options>>
\DeclareOption{ensureinfo=off}{}
@@ -11511,7 +11525,7 @@ wouldn’t exist.
% |\bbl@ini@loaded| is a comma-separated list of locales, built by
% |\bbl@read@ini|.
%
-% \begin{macrocode}
+% \begin{macrocode}
\newcommand\getlocaleproperty{%
\@ifstar\bbl@getproperty@s\bbl@getproperty@x}
\def\bbl@getproperty@s#1#2#3{%
@@ -11545,7 +11559,7 @@ wouldn’t exist.
% \begin{macrocode}
\newcommand\babeladjust[1]{% TODO. Error handling.
\bbl@forkv{#1}{%
- \bbl@ifunset{bbl@ADJ@##1@##2}%
+ \bbl@ifunset{bbl@ADJ@##1@##2}%
{\bbl@cs{ADJ@##1}{##2}}%
{\bbl@cs{ADJ@##1@##2}}}}
%
@@ -11555,7 +11569,7 @@ wouldn’t exist.
\directlua{ Babel.#2 }%
\expandafter\expandafter\expandafter\@gobble
\fi
- \fi
+ \fi
{\bbl@error{adjust-only-vertical}{#1}{}{}}}% Gobbled if everything went ok.
\@namedef{bbl@ADJ@bidi.mirroring@on}{%
\bbl@adjust@lua{bidi}{mirroring_enabled=true}}
@@ -11569,6 +11583,7 @@ wouldn’t exist.
\let\bbl@noamsmath\@empty}
\@namedef{bbl@ADJ@bidi.math@off}{%
\let\bbl@noamsmath\relax}
+%
\@namedef{bbl@ADJ@bidi.mapdigits@on}{%
\bbl@adjust@lua{bidi}{digits_mapped=true}}
\@namedef{bbl@ADJ@bidi.mapdigits@off}{%
@@ -11721,9 +11736,9 @@ wouldn’t exist.
\global\@namedef{#1@#2}{#3}}}
% \end{macrocode}
%
-% \end{macro}
+% \end{macro}
%
-% \begin{macro}{\@testdef}
+% \begin{macro}{\@testdef}
%
% An internal \LaTeX\ macro used to test if the labels that have
% been written on the |.aux| file have changed. It is called by
@@ -11764,7 +11779,7 @@ wouldn’t exist.
\fi
% \end{macrocode}
%
-% \end{macro}
+% \end{macro}
%
% \begin{macro}{\ref}
% \begin{macro}{\pageref}
@@ -11801,8 +11816,8 @@ wouldn’t exist.
\fi
% \end{macrocode}
%
-% \end{macro}
-% \end{macro}
+% \end{macro}
+% \end{macro}
%
% \begin{macro}{\@citex}
%
@@ -11859,7 +11874,7 @@ wouldn’t exist.
}{}}
% \end{macrocode}
%
-% \end{macro}
+% \end{macro}
%
% \begin{macro}{\nocite}
%
@@ -11871,7 +11886,7 @@ wouldn’t exist.
\@safe@activestrue\org@nocite{#1}\@safe@activesfalse}
% \end{macrocode}
%
-% \end{macro}
+% \end{macro}
%
% \begin{macro}{\bibcite}
%
@@ -11894,7 +11909,7 @@ wouldn’t exist.
\bibcite}
% \end{macrocode}
%
-% \end{macro}
+% \end{macro}
%
% \begin{macro}{\bbl@bibcite}
%
@@ -11906,7 +11921,7 @@ wouldn’t exist.
\org@bibcite{#1}{\@safe@activesfalse#2}}
% \end{macrocode}
%
-% \end{macro}
+% \end{macro}
%
% \begin{macro}{\bbl@cite@choice}
%
@@ -11930,7 +11945,7 @@ wouldn’t exist.
\AtBeginDocument{\bbl@cite@choice}
% \end{macrocode}
%
-% \end{macro}
+% \end{macro}
%
% \begin{macro}{\@bibitem}
%
@@ -11948,7 +11963,7 @@ wouldn’t exist.
\fi
% \end{macrocode}
%
-% \end{macro}
+% \end{macro}
%
% \subsection{Marks}
%
@@ -11988,19 +12003,19 @@ wouldn’t exist.
{\\\protect\\\bbl@restore@actives\the\toks@}}}}}%
% \end{macrocode}
%
-% \end{macro}
+% \end{macro}
%
-% \begin{macro}{\markboth}
-% \begin{macro}{\@mkboth}
-% The definition of |\markboth| is equivalent to that of
-% |\markright|, except that we need two token registers. The
-% documentclasses \cls{report} and \cls{book} define and set the
-% headings for the page. While doing so they also store a copy of
-% |\markboth| in |\@mkboth|. Therefore we need to check whether
-% |\@mkboth| has already been set. If so we need to do that again
-% with the new definition of |\markboth|. (As of Oct 2019, \LaTeX{}
-% stores the definition in an intermediate macro, so it's not
-% necessary anymore, but it's preserved for older versions.)
+% \begin{macro}{\markboth}
+% \begin{macro}{\@mkboth}
+% The definition of |\markboth| is equivalent to that of |\markright|,
+% except that we need two token registers. The documentclasses
+% \cls{report} and \cls{book} define and set the headings for the page.
+% While doing so they also store a copy of |\markboth| in |\@mkboth|.
+% Therefore we need to check whether |\@mkboth| has already been set.
+% If so we need to do that again with the new definition of
+% |\markboth|. (As of Oct 2019, \LaTeX{} stores the definition in an
+% intermediate macro, so it's not necessary anymore, but it's preserved
+% for older versions.)
%
% \begin{macrocode}
\ifx\@mkboth\markboth
@@ -12024,8 +12039,8 @@ wouldn’t exist.
\fi} % end ifbbl@single, end \IfBabelLayout
% \end{macrocode}
%
-% \end{macro}
-% \end{macro}
+% \end{macro}
+% \end{macro}
%
% \subsection{Preventing clashes with other packages}
%
@@ -12037,9 +12052,9 @@ wouldn’t exist.
% depending on the page a certain fragment of text appears on. This
% can be achieved by the following piece of code:
%\begin{verbatim}
-% \ifthenelse{\isodd{\pageref{some:label}}}
-% {code for odd pages}
-% {code for even pages}
+% \ifthenelse{\isodd{\pageref{some-label}}}
+% {code for odd pages}
+% {code for even pages}
%\end{verbatim}
% In order for this to work the argument of |\isodd| needs to be
% fully expandable. With the above redefinition of |\pageref| it is
@@ -12084,7 +12099,7 @@ wouldn’t exist.
\fi
% \end{macrocode}
%
-% \end{macro}
+% \end{macro}
%
% \subsubsection{\pkg{varioref}}
%
@@ -12092,7 +12107,7 @@ wouldn’t exist.
% \begin{macro}{\vrefpagenum}
% \begin{macro}{\Ref}
%
-% When the package varioref is in use we need to modify its
+% When the package \pkg{varioref} is in use we need to modify its
% internal command |\@@vpageref| in order to prevent problems when
% an active character ends up in the argument of |\vref|. The same
% needs to happen for |\vrefpagenum|.
@@ -12127,9 +12142,9 @@ wouldn’t exist.
\fi
% \end{macrocode}
%
-% \end{macro}
-% \end{macro}
-% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
%
% \subsubsection{\pkg{hhline}}
%
@@ -12155,11 +12170,12 @@ wouldn’t exist.
{}}}
% \end{macrocode}
%
-% \end{macro}
+% \end{macro}
%
% \begin{macro}{\substitutefontfamily}
%
-% \textit{Deprecated.} Use the tools provides by \LaTeX. The command
+% \textit{Deprecated.} Use the tools provided by \LaTeX\
+% (|\DeclareFontFamilySubstitution|). The command
% |\substitutefontfamily| creates an \file{.fd} file on the fly. The
% first argument is an encoding mnemonic, the second and third
% arguments are font family names.
@@ -12186,20 +12202,20 @@ wouldn’t exist.
\@onlypreamble\substitutefontfamily
% \end{macrocode}
%
-% \end{macro}
+% \end{macro}
%
% \subsection{Encoding and fonts}
%
-% Because documents may use non-ASCII font encodings, we make sure
-% that the logos of \TeX\ and \LaTeX\ always come out in the right
-% encoding. There is a list of non-ASCII encodings. Requested
-% encodings are currently stored in |\@fontenc@load@list|. If a
-% non-ASCII has been loaded, we define versions of |\TeX| and |\LaTeX|
-% for them using |\ensureascii|. The default ASCII encoding is set,
-% too (in reverse order): the ``main'' encoding (when the document
-% begins), the last loaded, or |OT1|.
+% Because documents may use non-ASCII font encodings, we make sure
+% that the logos of \TeX\ and \LaTeX\ always come out in the right
+% encoding. There is a list of non-ASCII encodings. Requested
+% encodings are currently stored in |\@fontenc@load@list|. If a
+% non-ASCII has been loaded, we define versions of |\TeX| and |\LaTeX|
+% for them using |\ensureascii|. The default ASCII encoding is set,
+% too (in reverse order): the ``main'' encoding (when the document
+% begins), the last loaded, or |OT1|.
%
-% \begin{macro}{\ensureascii}
+% \begin{macro}{\ensureascii}
%
% \begin{macrocode}
\bbl@trace{Encoding and fonts}
@@ -12239,30 +12255,29 @@ wouldn’t exist.
\fi}
% \end{macrocode}
%
-% \end{macro}
+% \end{macro}
%
-% Now comes the old deprecated stuff (with a little change in 3.9l,
-% for \textsf{fontspec}). The first thing we need to do is to
-% determine, at |\begin{document}|, which latin fontencoding to use.
+% Now comes the old deprecated stuff (with a little change in 3.9l, for
+% \textsf{fontspec}). The first thing we need to do is to determine, at
+% |\begin{document}|, which latin fontencoding to use.
%
-% \begin{macro}{\latinencoding}
-% When text is being typeset in an encoding other than `latin'
-% (\texttt{OT1} or \texttt{T1}), it would be nice to still have
-% Roman numerals come out in the Latin encoding.
-% So we first assume that the current encoding at the end
-% of processing the package is the Latin encoding.
+% \begin{macro}{\latinencoding}
+% When text is being typeset in an encoding other than `latin'
+% (\texttt{OT1} or \texttt{T1}), it would be nice to still have Roman
+% numerals come out in the Latin encoding. So we first assume that the
+% current encoding at the end of processing the package is the Latin
+% encoding.
%
% \begin{macrocode}
\AtEndOfPackage{\edef\latinencoding{\cf@encoding}}
% \end{macrocode}
%
-% But this might be overruled with a later loading of the package
-% \pkg{fontenc}. Therefore we check at the execution of
-% |\begin{document}| whether it was loaded with the \Lopt{T1}
-% option. The normal way to do this (using |\@ifpackageloaded|) is
-% disabled for this package. Now we have to revert to parsing the
-% internal macro |\@filelist| which contains all the filenames
-% loaded.
+% But this might be overruled with a later loading of the package
+% \pkg{fontenc}. Therefore we check at the execution of
+% |\begin{document}| whether it was loaded with the \Lopt{T1} option.
+% The normal way to do this (using |\@ifpackageloaded|) is disabled for
+% this package. Now we have to revert to parsing the internal macro
+% |\@filelist| which contains all the filenames loaded.
%
% \begin{macrocode}
\AtBeginDocument{%
@@ -12287,12 +12302,11 @@ wouldn’t exist.
\fi}}
% \end{macrocode}
%
-% \end{macro}
+% \end{macro}
%
-% \begin{macro}{\latintext}
-% Then we can define the command |\latintext| which is a
-% declarative switch to a latin font-encoding. Usage of this macro
-% is deprecated.
+% \begin{macro}{\latintext}
+% Then we can define the command |\latintext| which is a declarative
+% switch to a latin font-encoding. Usage of this macro is deprecated.
%
% \begin{macrocode}
\DeclareRobustCommand{\latintext}{%
@@ -12300,12 +12314,12 @@ wouldn’t exist.
\def\encodingdefault{\latinencoding}}
% \end{macrocode}
%
-% \end{macro}
+% \end{macro}
%
-% \begin{macro}{\textlatin}
-% This command takes an argument which is then typeset using the
-% requested font encoding. In order to avoid many encoding switches
-% it operates in a local scope.
+% \begin{macro}{\textlatin}
+% This command takes an argument which is then typeset using the
+% requested font encoding. In order to avoid many encoding switches it
+% operates in a local scope.
%
% \begin{macrocode}
\ifx\@undefined\DeclareTextFontCommand
@@ -12363,8 +12377,8 @@ wouldn’t exist.
% \begin{macrocode}
\bbl@trace{Loading basic (internal) bidi support}
\ifodd\bbl@engine
-\else % TODO. Move to txtbabel
- \ifnum\bbl@bidimode>100 \ifnum\bbl@bidimode<200 % Any xe+lua bidi=
+\else % TODO. Move to txtbabel. Any xe+lua bidi
+ \ifnum\bbl@bidimode>100 \ifnum\bbl@bidimode<200
\bbl@error{bidi-only-lua}{}{}{}%
\let\bbl@beforeforeign\leavevmode
\AtEndOfPackage{%
@@ -12375,7 +12389,9 @@ wouldn’t exist.
\ifx\RTLfootnotetext\@undefined
\AtEndOfPackage{%
\EnableBabelHook{babel-bidi}%
- \bbl@loadfontspec % bidi needs fontspec
+ \ifx\fontspec\@undefined
+ \usepackage{fontspec}% bidi needs fontspec
+ \fi
\usepackage#1{bidi}%
\let\bbl@digitsdotdash\DigitsDotDashInterCharToks
\def\DigitsDotDashInterCharToks{% See the 'bidi' package
@@ -12415,24 +12431,19 @@ wouldn’t exist.
%
% \begin{macrocode}
\bbl@trace{Macros to switch the text direction}
-\def\bbl@alscripts{,Arabic,Syriac,Thaana,}
-\def\bbl@rscripts{% TODO. Base on codes ??
- ,Imperial Aramaic,Avestan,Cypriot,Hatran,Hebrew,%
- Old Hungarian,Lydian,Mandaean,Manichaean,%
- Meroitic Cursive,Meroitic,Old North Arabian,%
- Nabataean,N'Ko,Orkhon,Palmyrene,Inscriptional Pahlavi,%
- Psalter Pahlavi,Phoenician,Inscriptional Parthian,Samaritan,%
- Old South Arabian,}%
\def\bbl@provide@dirs#1{%
- \bbl@xin@{\csname bbl@sname@#1\endcsname}{\bbl@alscripts\bbl@rscripts}%
+ \bbl@xin@{\csname bbl@sbcp@#1\endcsname}{,Arab,Syrc,Thaa,}%
\ifin@
- \global\bbl@csarg\chardef{wdir@#1}\@ne
- \bbl@xin@{\csname bbl@sname@#1\endcsname}{\bbl@alscripts}%
+ \global\bbl@csarg\chardef{wdir@#1}\tw@
+ \else
+ \bbl@xin@{\csname bbl@sbcp@#1\endcsname}{%
+ ,Armi,Avst,Cprt,Hatr,Hebr,Hung,Lydi,Mand,Mani,Merc,Mero,%
+ Narb,Nbat,Nkoo,Orkh,Palm,Phli,Phlp,Phnx,Prti,Samr,Sarb,}%
\ifin@
- \global\bbl@csarg\chardef{wdir@#1}\tw@
+ \global\bbl@csarg\chardef{wdir@#1}\@ne
+ \else
+ \global\bbl@csarg\chardef{wdir@#1}\z@
\fi
- \else
- \global\bbl@csarg\chardef{wdir@#1}\z@
\fi
\ifodd\bbl@engine
\bbl@csarg\ifcase{wdir@#1}%
@@ -12453,9 +12464,10 @@ wouldn’t exist.
\bbl@pardir{#1}% <- Must precede \bbl@textdir
\fi
\bbl@textdir{#1}}
-% TODO. Only if \bbl@bidimode > 0?:
-\AddBabelHook{babel-bidi}{afterextras}{\bbl@switchdir}
-\DisableBabelHook{babel-bidi}
+\ifnum\bbl@bidimode>\z@
+ \AddBabelHook{babel-bidi}{afterextras}{\bbl@switchdir}
+ \DisableBabelHook{babel-bidi}
+\fi
% \end{macrocode}
%
% Now the engine-dependent macros. TODO. Must be moved to the engine
@@ -12525,19 +12537,15 @@ wouldn’t exist.
\else
{\setbox\z@\lastbox\beginR\box\z@}%
\fi}%
- \let\bbl@severypar\everypar
- \newtoks\everypar
- \everypar=\bbl@severypar
- \bbl@severypar{\bbl@xeeverypar\the\everypar}}
+ \AddToHook{para/begin}{\bbl@xeeverypar}}
\ifnum\bbl@bidimode>200 % Any xe bidi=
\let\bbl@textdir@i\@gobbletwo
\let\bbl@xebidipar\@empty
\AddBabelHook{bidi}{foreign}{%
- \def\bbl@tempa{\def\BabelText####1}%
\ifcase\bbl@thetextdir
- \expandafter\bbl@tempa\expandafter{\BabelText{\LR{##1}}}%
+ \BabelWrapText{\LR{##1}}%
\else
- \expandafter\bbl@tempa\expandafter{\BabelText{\RL{##1}}}%
+ \BabelWrapText{\RL{##1}}%
\fi}
\def\bbl@pardir#1{\ifcase#1\relax\setLR\else\setRL\fi}
\fi
@@ -12584,7 +12592,7 @@ wouldn’t exist.
\@empty}}
\fi
% \end{macrocode}%
-% \end{macro}
+% \end{macro}
%
% \subsection{Language options}
%
@@ -12676,7 +12684,7 @@ wouldn’t exist.
% above, the names of the option and the file are the same. We first
% pre-process the class and package options to determine the main
% language, which is processed in the third ‘main’ pass,
-% \textit{except} if all files are ldf \textit{and} there is no |main|
+% \textit{except} if all files are \texttt{ldf} \textit{and} there is no |main|
% key. In the latter case (|\bbl@opt@main| is still |\@nnil|), the
% traditional way to set the main language is kept — the last loaded is
% the main language.
@@ -12717,7 +12725,7 @@ wouldn’t exist.
% Now define the corresponding loaders. With package options, assume
% the language exists. With class options, check if the option is a
% language by checking if the corresponding file exists.
-%
+%
% \begin{macrocode}
\bbl@foreach\bbl@language@opts{%
\def\bbl@tempa{#1}%
@@ -12743,8 +12751,8 @@ wouldn’t exist.
{}}%
{}%
\else % + * (other = ini)
- \IfFileExists{babel-#1.tex}%
- {\DeclareOption{#1}{%
+ \IfFileExists{babel-#1.tex}%
+ {\DeclareOption{#1}{%
\bbl@ldfinit
\babelprovide[import]{#1}%
\bbl@afterldf{}}}%
@@ -12819,11 +12827,11 @@ wouldn’t exist.
\DeclareOption*{}
\ProcessOptions*
\fi
-\bbl@exp{%
+\bbl@exp{%
\\\AtBeginDocument{\\\bbl@usehooks@lang{/}{begindocument}{{}}}}%
\def\AfterBabelLanguage{\bbl@error{late-after-babel}{}{}{}}
% \end{macrocode}
-%
+%
% In order to catch the case where the user didn’t specify a
% language we check whether |\bbl@main@language|, has become
% defined. If not, the |nil| language is loaded.
@@ -12854,7 +12862,7 @@ wouldn’t exist.
%
% Plain formats based on etex (etex, xetex, luatex) don't load
% |hyphen.cfg| but |etex.src|, which follows a different naming
-% convention, so we need to define the babel names. It presumes
+% convention, so we need to define the \babel{} names. It presumes
% |language.def| exists and it is the same file used when formats were
% created.
%
@@ -13066,9 +13074,9 @@ wouldn’t exist.
%<*patterns>
% \end{macrocode}
%
-% \end{macro}
-% \end{macro}
-% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
%
% \section{Loading hyphenation patterns}
%
@@ -13090,13 +13098,12 @@ wouldn’t exist.
<@Define core switching macros@>
% \end{macrocode}
%
-% \begin{macro}{\process@line}
-% Each line in the file \file{language.dat} is processed by
-% |\process@line| after it is read. The first thing this macro does
-% is to check whether the line starts with \texttt{=}.
-% When the first token of a line is an \texttt{=}, the macro
-% |\process@synonym| is called; otherwise the macro
-% |\process@language| will continue.
+% \begin{macro}{\process@line}
+% Each line in the file \file{language.dat} is processed by
+% |\process@line| after it is read. The first thing this macro does is
+% to check whether the line starts with \texttt{=}. When the first
+% token of a line is an \texttt{=}, the macro |\process@synonym| is
+% called; otherwise the macro |\process@language| will continue.
%
% \begin{macrocode}
\def\process@line#1#2 #3 #4 {%
@@ -13108,9 +13115,9 @@ wouldn’t exist.
\ignorespaces}
% \end{macrocode}
%
-% \end{macro}
+% \end{macro}
%
-% \begin{macro}{\process@synonym}
+% \begin{macro}{\process@synonym}
%
% This macro takes care of the lines which start with an
% \texttt{=}. It needs an empty token register to begin with.
@@ -13145,7 +13152,7 @@ wouldn’t exist.
\fi}
% \end{macrocode}
%
-% \end{macro}
+% \end{macro}
%
% \begin{macro}{\process@language}
%
@@ -13324,15 +13331,15 @@ wouldn’t exist.
\bbl@hook@loadkernel{switch.def}
% \end{macrocode}
%
-% \begin{macro}{\readconfigfile}
-% The configuration file can now be opened for reading.
+% \begin{macro}{\readconfigfile}
+% The configuration file can now be opened for reading.
%
% \begin{macrocode}
\openin1 = language.dat
% \end{macrocode}
%
-% See if the file exists, if not, use the default hyphenation file
-% \file{hyphen.tex}. The user will be informed about this.
+% See if the file exists, if not, use the default hyphenation file
+% \file{hyphen.tex}. The user will be informed about this.
%
% \begin{macrocode}
\def\languagename{english}%
@@ -13367,11 +13374,11 @@ wouldn’t exist.
\endlinechar`\^^M
% \end{macrocode}
%
-% If the file has reached its end, exit from the loop here. If not,
-% empty lines are skipped. Add 3 space characters to the end of
-% |\bbl@line|. This is needed to be able to recognize the arguments
-% of |\process@line| later on. The default language should be the
-% very first one.
+% If the file has reached its end, exit from the loop here. If not,
+% empty lines are skipped. Add 3 space characters to the end of
+% |\bbl@line|. This is needed to be able to recognize the arguments of
+% |\process@line| later on. The default language should be the very
+% first one.
%
% \begin{macrocode}
\if T\ifeof1F\fi T\relax
@@ -13398,7 +13405,7 @@ wouldn’t exist.
\closein1
% \end{macrocode}
%
-% We add a message about the fact that babel is loaded in the
+% We add a message about the fact that \babel{} is loaded in the
% format and with which language patterns to the \cs{everyjob}
% register.
%
@@ -13409,10 +13416,9 @@ wouldn’t exist.
\fi
% \end{macrocode}
%
-% Also remove some macros from memory and raise an error
-% if |\toks@| is not empty. Finally load \file{switch.def}, but the
-% latter is not required and the line inputting it may be commented
-% out.
+% Also remove some macros from memory and raise an error if |\toks@| is
+% not empty. Finally load \file{switch.def}, but the latter is not
+% required and the line inputting it may be commented out.
%
% \begin{macrocode}
\let\bbl@line\@undefined
@@ -13429,8 +13435,8 @@ wouldn’t exist.
%</patterns>
% \end{macrocode}
%
-% Here the code for ini\TeX\ ends.
-% \end{macro}
+% Here the code for ini\TeX\ ends.
+% \end{macro}
%
% \section{Font handling with fontspec}
%
@@ -13455,28 +13461,12 @@ wouldn’t exist.
% |bbl@font| replaces hardcoded font names inside |\..family| by the
% corresponding macro |\..default|.
%
-% At the time of this writing, \textsf{fontspec} shows a warning about
-% there are languages not available, which some people think refers to
-% \babel{}, even if there is nothing wrong. Here is hack to patch
-% \textsf{fontspec} to avoid the misleading (and mostly unuseful)
-% message.
-%
% \begin{macrocode}
%<<*Font selection>>
\bbl@trace{Font handling with fontspec}
-\ifx\ExplSyntaxOn\@undefined\else
- \def\bbl@fs@warn@nx#1#2{% \bbl@tempfs is the original macro
- \in@{,#1,}{,no-script,language-not-exist,}%
- \ifin@\else\bbl@tempfs@nx{#1}{#2}\fi}
- \def\bbl@fs@warn@nxx#1#2#3{%
- \in@{,#1,}{,no-script,language-not-exist,}%
- \ifin@\else\bbl@tempfs@nxx{#1}{#2}{#3}\fi}
- \def\bbl@loadfontspec{%
- \let\bbl@loadfontspec\relax
- \ifx\fontspec\@undefined
- \usepackage{fontspec}%
- \fi}%
-\fi
+\AddBabelHook{babel-fontspec}{afterextras}{\bbl@switchfont}
+\AddBabelHook{babel-fontspec}{beforestart}{\bbl@ckeckstdfonts}
+\DisableBabelHook{babel-fontspec}
\@onlypreamble\babelfont
\newcommand\babelfont[2][]{% 1=langs/scripts 2=fam
\bbl@foreach{#1}{%
@@ -13487,8 +13477,10 @@ wouldn’t exist.
\fi}%
\edef\bbl@tempa{#1}%
\def\bbl@tempb{#2}% Used by \bbl@bblfont
- \bbl@loadfontspec
- \EnableBabelHook{babel-fontspec}% Just calls \bbl@switchfont
+ \ifx\fontspec\@undefined
+ \usepackage{fontspec}%
+ \fi
+ \EnableBabelHook{babel-fontspec}%
\bbl@bblfont}
\newcommand\bbl@bblfont[2][]{% 1=features 2=fontname, @font=rm|sf|tt
\bbl@ifunset{\bbl@tempb family}%
@@ -13653,17 +13645,10 @@ wouldn’t exist.
{\\\newfontscript{\bbl@cl{sname}}{\bbl@cl{sotf}}}%
\<keys_if_exist:nnF>{fontspec-opentype}{Language/\bbl@cl{lname}}%
{\\\newfontlanguage{\bbl@cl{lname}}{\bbl@cl{lotf}}}%
- \let\\\bbl@tempfs@nx\<__fontspec_warning:nx>%
- \let\<__fontspec_warning:nx>\\\bbl@fs@warn@nx
- \let\\\bbl@tempfs@nxx\<__fontspec_warning:nxx>%
- \let\<__fontspec_warning:nxx>\\\bbl@fs@warn@nxx
\\\renewfontfamily\\#4%
[\bbl@cl{lsys},% xetex removes unknown features :-(
\ifcase\bbl@engine\or RawFeature={family=\bbl@tempb},\fi
#2]}{#3}% ie \bbl@exp{..}{#3}
- \bbl@exp{%
- \let\<__fontspec_warning:nx>\\\bbl@tempfs@nx
- \let\<__fontspec_warning:nxx>\\\bbl@tempfs@nxx}%
\begingroup
#4%
\xdef#1{\f@family}% eg, \bbl@rmdflt@lang{FreeSerif(0)}
@@ -13823,9 +13808,6 @@ wouldn’t exist.
\fi}%
\fi}
\ifx\DisableBabelHook\@undefined\endinput\fi %%%% TODO: why
-\AddBabelHook{babel-fontspec}{afterextras}{\bbl@switchfont}
-\AddBabelHook{babel-fontspec}{beforestart}{\bbl@ckeckstdfonts}
-\DisableBabelHook{babel-fontspec}
<@Font selection@>
\def\bbl@provide@extra#1{}
% \end{macrocode}
@@ -13940,7 +13922,7 @@ wouldn’t exist.
% And finally, the command with the code to be inserted. If the language
% doesn’t define a class, then use the global one, as defined above.
% For the definition there is a intermediate macro, which can be
-% ‘disabled’ with |\bbl@ic@<label>@<lang>|.
+% ‘disabled’ with |\bbl@ic@<label>@<language>|.
%
% \begin{macrocode}
\def\bbl@ignoreinterchar{%
@@ -13956,7 +13938,7 @@ wouldn’t exist.
{\bbl@ignoreinterchar{#5}}%
\bbl@csarg\let{ic@\bbl@kv@label @#2}\@firstofone
\bbl@exp{\\\bbl@for\\\bbl@tempa{\zap@space#3 \@empty}}{%
- \bbl@exp{\\\bbl@for\\\bbl@tempb{\zap@space#4 \@empty}}{%
+ \bbl@exp{\\\bbl@for\\\bbl@tempb{\zap@space#4 \@empty}}{%
\XeTeXinterchartoks
\@nameuse{bbl@xeclass@\bbl@tempa @%
\bbl@ifunset{bbl@xeclass@\bbl@tempa @#2}{}{#2}} %
@@ -13968,11 +13950,11 @@ wouldn’t exist.
@#3@#4@#2 \@empty\endcsname}}}}
\DeclareRobustCommand\enablelocaleinterchar[1]{%
\bbl@ifunset{bbl@ic@#1@\languagename}%
- {\bbl@error{unknown-interchar}{#1}{}{}}%
+ {\bbl@error{unknown-interchar}{#1}{}{}}%
{\bbl@csarg\let{ic@#1@\languagename}\@firstofone}}
\DeclareRobustCommand\disablelocaleinterchar[1]{%
\bbl@ifunset{bbl@ic@#1@\languagename}%
- {\bbl@error{unknown-interchar-b}{#1}{}{}}%
+ {\bbl@error{unknown-interchar-b}{#1}{}{}}%
{\bbl@csarg\let{ic@#1@\languagename}\@gobble}}
%</xetex>
% \end{macrocode}
@@ -14062,9 +14044,9 @@ wouldn’t exist.
{}
% \end{macrocode}
%
-% Implicitly reverses sectioning labels in |bidi=basic|, because
-% the full stop is not in contact with L numbers any more. I
-% think there must be a better way.
+% Implicitly reverses sectioning labels in |bidi=basic|, because the
+% full stop is not in contact with L numbers any more. I think there
+% must be a better way.
%
% \begin{macrocode}
\IfBabelLayout{counters*}%
@@ -14190,7 +14172,7 @@ wouldn’t exist.
% (3) in the middle of |plain.def| and |babel.sty|, by |babel.def|,
% with the commands and other definitions for |luatex| (eg,
% |\babelpatterns|).
-%
+%
% \begin{macrocode}
%<*luatex>
\ifx\AddBabelHook\@undefined % When plain.def, babel.sty starts
@@ -14338,8 +14320,12 @@ wouldn’t exist.
{\expandafter\expandafter\expandafter\bbl@luapatterns
\csname bbl@hyphendata@\the\language\endcsname}}{}}
\endinput\fi
- % Here ends \ifx\AddBabelHook\@undefined
- % A few lines are only read by hyphen.cfg
+% \end{macrocode}
+%
+% Here ends |\ifx\AddBabelHook\@undefined|. A few lines are only read
+% by \textsc{hyphen.cfg}.
+%
+% \begin{macrocode}
\ifx\DisableBabelHook\@undefined
\AddBabelHook{luatex}{everylanguage}{%
\def\process@language##1##2##3{%
@@ -14355,9 +14341,12 @@ wouldn’t exist.
{\expandafter\expandafter\expandafter\bbl@tempb
\csname bbl@hyphendata@\the\language\endcsname}}
\endinput\fi
- % Here stops reading code for hyphen.cfg
- % The following is read the 2nd time it's loaded
- % First, global declarations for lua
+% \end{macrocode}
+%
+% Here stops reading code for \textsc{hyphen.cfg}. The following is read the 2nd
+% time it's loaded. First, global declarations for lua.
+%
+% \begin{macrocode}
\begingroup % TODO - to a lua file
\catcode`\%=12
\catcode`\'=12
@@ -14516,12 +14505,12 @@ end
{\prehyphenchar=\bbl@cl{prehc}\relax}}}}
% \end{macrocode}
%
-% \begin{macro}{\babelpatterns}
+% \begin{macro}{\babelpatterns}
%
-% This macro adds patterns. Two macros are used to store them:
-% |\bbl@patterns@| for the global ones and |\bbl@patterns@<lang>|
-% for language ones. We make sure there is a space between words
-% when multiple commands are used.
+% This macro adds patterns. Two macros are used to store them:
+% |\bbl@patterns@| for the global ones and |\bbl@patterns@<language>| for
+% language ones. We make sure there is a space between words when
+% multiple commands are used.
%
% \begin{macrocode}
\@onlypreamble\babelpatterns
@@ -14550,7 +14539,7 @@ end
#2}}}%
\fi}}
% \end{macrocode}
-% \end{macro}
+% \end{macro}
%
% \subsection{Southeast Asian scripts}
%
@@ -14563,7 +14552,7 @@ end
% not touched. See Unicode UAX 14.
%
% \begin{macrocode}
-% TODO - to a lua file
+% TODO - to a lua file -- or a logical place
\directlua{
Babel = Babel or {}
Babel.linebreaking = Babel.linebreaking or {}
@@ -14601,7 +14590,7 @@ end
}}
\begingroup
\catcode`\%=12
-\catcode`\&=14
+\catcode`\&=14
\catcode`\'=12
\catcode`\~=12
\gdef\bbl@seaintraspace{&
@@ -14638,7 +14627,7 @@ end
n = node.new(14, 0) &% penalty
n.penalty = intrapenalty
node.insert_before(head, item, n)
- end
+ end
n = node.new(12, 13) &% (glue, spaceskip)
node.setglue(n, intraspace.b * quad,
intraspace.p * quad,
@@ -14651,9 +14640,9 @@ end
end
end
}&
- \bbl@luahyphenate}
+ \bbl@luahyphenate}
% \end{macrocode}
-%
+%
% \subsection{CJK line breaking}
%
% Minimal line breaking for CJK scripts, mainly intended for simple
@@ -14697,8 +14686,10 @@ end
class = props.cjk_quotes[item.char]
end
- if class == 'cp' then class = 'cl' end % )] as CL
- if class == 'id' then class = 'I' end
+ if class == 'cp' then class = 'cl' % )] as CL
+ elseif class == 'id' then class = 'I'
+ elseif class == 'cj' then class = 'I' % loose
+ end
local br = 0
if class and last_class and Babel.cjk_breaks[last_class][class] then
@@ -14713,7 +14704,7 @@ end
local n = node.new(14, 0) % penalty
n.penalty = intrapenalty
node.insert_before(head, item, n)
- end
+ end
local intraspace = props.intraspace
local n = node.new(12, 13) % (glue, spaceskip)
node.setglue(n, intraspace.b * quad,
@@ -14745,10 +14736,10 @@ end
func(head)
end
end
+ lang.hyphenate(head)
if Babel.cjk_enabled then
Babel.cjk_linebreak(head)
end
- lang.hyphenate(head)
if Babel.linebreaking.after then
for k, func in ipairs(Babel.linebreaking.after) do
func(head)
@@ -14829,7 +14820,7 @@ end
Babel.arabic.justify, 'Babel.arabic.justify')
luatexbase.add_to_callback('hpack_filter',
Babel.arabic.justify_hbox, 'Babel.arabic.justify_hbox')
- }}%
+ }}%
% \end{macrocode}
%
% Save both node lists to make replacement. TODO. Save also widths to
@@ -14850,7 +14841,7 @@ end
end
end
Babel.arabic.#3['##1#4'] = last.char
- }}}
+ }}}
% \end{macrocode}
%
% Elongated forms. Brute force. No rules at all, yet. The ideal: look
@@ -15016,7 +15007,7 @@ function Babel.arabic.justify_hlist(head, line, gc, size, pack)
while width < goal do
subst_done = true
k_item = k_list[k_curr].node
- if k_list[k_curr].weight == Babel.kashida_wts[wt_pos] then
+ if k_list[k_curr].weight == Babel.kashida_wts[wt_pos] then
d = node.copy(k_item)
d.char = 0x0640
d.yoffset = 0 % TODO. From the prev char. But 0 seems safe.
@@ -15034,7 +15025,7 @@ function Babel.arabic.justify_hlist(head, line, gc, size, pack)
end
if k_curr == 1 then
k_curr = #k_list
- wt_pos = (wt_pos >= table.getn(Babel.kashida_wts)) and 1 or wt_pos+1
+ wt_pos = (wt_pos >= table.getn(Babel.kashida_wts)) and 1 or wt_pos+1
else
k_curr = k_curr - 1
end
@@ -15077,9 +15068,6 @@ end
% \subsection{Common stuff}
%
% \begin{macrocode}
-\AddBabelHook{babel-fontspec}{afterextras}{\bbl@switchfont}
-\AddBabelHook{babel-fontspec}{beforestart}{\bbl@ckeckstdfonts}
-\DisableBabelHook{babel-fontspec}
<@Font selection@>
% \end{macrocode}
%
@@ -15107,7 +15095,7 @@ Babel.script_blocks = {
{0xFE70, 0xFEFF}, {0xFB50, 0xFDFF}, {0x1EE00, 0x1EEFF}},
['Armn'] = {{0x0530, 0x058F}},
['Beng'] = {{0x0980, 0x09FF}},
- ['Cher'] = {{0x13A0, 0x13FF}, {0xAB70, 0xABBF}},
+ ['Cher'] = {{0x13A0, 0x13FF}, {0xAB70, 0xABBF}},
['Copt'] = {{0x03E2, 0x03EF}, {0x2C80, 0x2CFF}, {0x102E0, 0x102FF}},
['Cyrl'] = {{0x0400, 0x04FF}, {0x0500, 0x052F}, {0x1C80, 0x1C8F},
{0x2DE0, 0x2DFF}, {0xA640, 0xA69F}},
@@ -15219,7 +15207,7 @@ function Babel.locale_map(head)
elseif not inmath and item.id == 7 then % Apply recursively
item.replace = item.replace and Babel.locale_map(item.replace)
item.pre = item.pre and Babel.locale_map(item.pre)
- item.post = item.post and Babel.locale_map(item.post)
+ item.post = item.post and Babel.locale_map(item.post)
elseif item.id == node.id'math' then
inmath = (item.subtype == 0)
end
@@ -15279,7 +15267,7 @@ end
% Post-handling hyphenation patterns for non-standard rules, like |ff|
% to |ff-f|. There are still some issues with speed (not very slow, but
% still slow). The Lua code is below.
-%
+%
% \begin{macrocode}
\directlua{
Babel.nohyphenation = \the\l@nohyphenation
@@ -15299,7 +15287,7 @@ end
% this macro at the appropriate place. As |\directlua| does not take
% into account the current catcode of |@|, we just avoid this character
% in macro names (which explains the internal group, too).
-%
+%
% \begin{macrocode}
\begingroup
\catcode`\~=12
@@ -15325,7 +15313,7 @@ end
\bbl@ifsamestring{##1}{remove}&%
{\bbl@add@list\babeltempb{nil}}&%
{\directlua{
- local rep = [=[##1]=]
+ local rep = [=[##1]=]
rep = rep:gsub('^%s*(remove)%s*$', 'remove = true')
rep = rep:gsub('^%s*(insert)%s*,', 'insert = true, ')
rep = rep:gsub('^%s*(after)%s*,', 'after = true, ')
@@ -15342,27 +15330,27 @@ end
'(spacefactor)%s*=%s*([%-%d%.]+)%s+([%-%d%.]+)%s+([%-%d%.]+)',
'spacefactor = {' .. '%2, %3, %4' .. '}')
rep = rep:gsub('(kashida)%s*=%s*([^%s,]*)', Babel.capture_kashida)
- else
+ else
rep = rep:gsub( '(no)%s*=%s*([^%s,]*)', Babel.capture_func)
rep = rep:gsub( '(pre)%s*=%s*([^%s,]*)', Babel.capture_func)
- rep = rep:gsub( '(post)%s*=%s*([^%s,]*)', Babel.capture_func)
+ rep = rep:gsub( '(post)%s*=%s*([^%s,]*)', Babel.capture_func)
end
tex.print([[\string\babeltempa{{]] .. rep .. [[}}]])
}}}&%
\bbl@foreach\babeltempb{&%
\bbl@forkv{{##1}}{&%
- \in@{,####1,}{,nil,step,data,remove,insert,string,no,pre,&%
- no,post,penalty,kashida,space,spacefactor,kern,node,after,}&%
+ \in@{,####1,}{,nil,step,data,remove,insert,string,no,pre,no,&%
+ post,penalty,kashida,space,spacefactor,kern,node,after,norule,}&%
\ifin@\else
\bbl@error{bad-transform-option}{####1}{}{}&%
- \fi}}&%
+ \fi}}&%
\let\bbl@kv@attribute\relax
\let\bbl@kv@label\relax
\let\bbl@kv@fonts\@empty
\bbl@forkv{#2}{\bbl@csarg\edef{kv@##1}{##2}}&%
\ifx\bbl@kv@fonts\@empty\else\bbl@settransfont\fi
\ifx\bbl@kv@attribute\relax
- \ifx\bbl@kv@label\relax\else
+ \ifx\bbl@kv@label\relax\else
\bbl@exp{\\\bbl@trim@def\\\bbl@kv@fonts{\bbl@kv@fonts}}&%
\bbl@replace\bbl@kv@fonts{ }{,}&%
\edef\bbl@kv@attribute{bbl@ATR@\bbl@kv@label @#3@\bbl@kv@fonts}&%
@@ -15422,7 +15410,7 @@ end
patt = u.gsub(patt, '{(%x%x%x%x+)}',
function (n)
return u.gsub(u.char(tonumber(n, 16)), '(%p)', '%%%1')
- end)
+ end)
lbkr[id] = lbkr[id] or {}
table.insert(lbkr[id],
{ label=label, attr=attr, pattern=patt, replace={\babeltempb} })
@@ -15464,7 +15452,7 @@ end
{\bbl@csarg\setattribute{ATR@#1@\languagename @}\@ne}}
\DeclareRobustCommand\disablelocaletransform[1]{%
\bbl@ifunset{bbl@ATR@#1@\languagename @}%
- {\bbl@error{transform-not-available-b}{#1}{}{}}%
+ {\bbl@error{transform-not-available-b}{#1}{}{}}%
{\bbl@csarg\unsetattribute{ATR@#1@\languagename @}}}
\def\bbl@activateposthyphen{%
\let\bbl@activateposthyphen\relax
@@ -15516,7 +15504,7 @@ end
return head
end
%
- function Babel.pre_otfload_h(head, gc, sz, pt, dir)
+ function Babel.pre_otfload_h(head, gc, sz, pt, dir) %%% TODO
if Babel.numbers and Babel.digits_mapped then
head = Babel.numbers(head)
end
@@ -15543,11 +15531,12 @@ end
% The basic setup. The output is modified at a very low level to set
% the |\bodydir| to the |\pagedir|. Sadly, we have to deal with boxes
% in math with basic, so the |\bbl@mathboxdir| hack is activated every
-% math with the package option bidi=.
+% math with the package option bidi=. The hack for the PUA is no longer
+% necessary with |basic| (24.8), but it’s kept in |basic-r|.
%
% \begin{macrocode}
\breakafterdirmode=1
-\ifnum\bbl@bidimode>\@ne % Any bidi= except default=1
+\ifnum\bbl@bidimode>\@ne % Any bidi= except default (=1)
\let\bbl@beforeforeign\leavevmode
\AtEndOfPackage{\EnableBabelHook{babel-bidi}}
\RequirePackage{luatexbase}
@@ -15557,7 +15546,10 @@ end
\ifcase\expandafter\@gobbletwo\the\bbl@bidimode\or
require('babel-bidi-basic.lua')
\or
- require('babel-bidi-basic-r.lua')
+ require('babel-bidi-basic-r.lua')
+ table.insert(Babel.ranges, {0xE000, 0xF8FF, 'on'})
+ table.insert(Babel.ranges, {0xF0000, 0xFFFFD, 'on'})
+ table.insert(Babel.ranges, {0x100000, 0x10FFFD, 'on'})
\fi}
\newattribute\bbl@attr@dir
\directlua{ Babel.attr_dir = luatexbase.registernumber'bbl@attr@dir' }
@@ -15633,6 +15625,12 @@ end
end
luatexbase.add_to_callback("hpack_filter", Babel.math_box_dir,
"Babel.math_box_dir", 0)
+ if Babel.unset_atdir then
+ luatexbase.add_to_callback("pre_linebreak_filter", Babel.unset_atdir,
+ "Babel.unset_atdir")
+ luatexbase.add_to_callback("hpack_filter", Babel.unset_atdir,
+ "Babel.unset_atdir")
+ end
}}%
\fi
% \end{macrocode}
@@ -15871,10 +15869,29 @@ end
\bbl@replace\bbl@tempa{transforms.}{}%
\bbl@carg\bbl@transforms{babel\bbl@tempa}{##2}{##3}%
\fi}%
+ \bbl@exp{%
+ \\\bbl@ifblank{\bbl@cl{dgnat}}%
+ {\let\\\bbl@tempa\relax}%
+ {\def\\\bbl@tempa{%
+ \\\bbl@elt{transforms.prehyphenation}%
+ {digits.native.1.0}{([0-9])}%
+ \\\bbl@elt{transforms.prehyphenation}%
+ {digits.native.1.1}{string={1\string|0123456789\string|\bbl@cl{dgnat}}}}}}%
+ \ifx\bbl@tempa\relax\else
+ \toks@\expandafter\expandafter\expandafter{%
+ \csname bbl@inidata@\languagename\endcsname}%
+ \bbl@csarg\edef{inidata@\languagename}{%
+ \unexpanded\expandafter{\bbl@tempa}%
+ \the\toks@}%
+ \fi
\csname bbl@inidata@\languagename\endcsname
\bbl@release@transforms\relax % \relax closes the last item.
\fi}
+% \end{macrocode}
+%
% Start tabular here:
+%
+% \begin{macrocode}
\def\localerestoredirs{%
\ifcase\bbl@thetextdir
\ifnum\textdirection=\z@\else\textdir TLT\fi
@@ -15892,7 +15909,9 @@ end
{\chardef\bbl@tabular@mode\z@}%
{\chardef\bbl@tabular@mode\@ne}}% Mixed, with LTR cols
\ifnum\bbl@bidimode>\@ne % Any lua bidi= except default=1
- \ifcase\bbl@tabular@mode\or % 1
+ % Redefine: vrules mess up dirs. TODO: why?
+ \def\@arstrut{\relax\copy\@arstrutbox}%
+ \ifcase\bbl@tabular@mode\or % 1 = Mixed - default
\let\bbl@parabefore\relax
\AddToHook{para/before}{\bbl@parabefore}
\AtBeginDocument{%
@@ -15917,7 +15936,7 @@ end
{\\\do@row@strut\<fi>}{\\\do@row@strut\<fi>\egroup}}}%
{}}%
\fi}%
- \or % 2
+ \or % 2 = All RTL - tabular
\let\bbl@parabefore\relax
\AddToHook{para/before}{\bbl@parabefore}%
\AtBeginDocument{%
@@ -15957,14 +15976,14 @@ end
% removed it without an alternative. Also, |\hangindent| does not
% honour direction changes by default, so we need to redefine
% |\@hangfrom|.
-%
+%
% \begin{macrocode}
\ifnum\bbl@bidimode>\z@ % Any bidi=
\def\bbl@nextfake#1{% non-local changes, use always inside a group!
\bbl@exp{%
- \def\\\bbl@insidemath{0}%
- \mathdir\the\bodydir
+ \mathdir\the\bodydir
#1% Once entered in math, set boxes to restore values
+ \def\\\bbl@insidemath{0}%
\<ifmmode>%
\everyvbox{%
\the\everyvbox
@@ -16063,7 +16082,7 @@ end
\raise\@tempdimc\hb@xt@\z@{%
\@defaultunitsset\@tempdimc{#1}\unitlength
\kern\@tempdimc
- {\ifnum\bbl@tempc>\z@\bbl@pictresetdir\fi#3}\hss}%
+ {\ifnum\bbl@tempc>\z@\bbl@pictresetdir\fi#3}\hss}%
\ignorespaces}%
\MakeRobust\put}%
\AtBeginDocument
@@ -16094,10 +16113,10 @@ end
{}
% \end{macrocode}
%
-% Implicitly reverses sectioning labels in bidi=basic-r, because
-% the full stop is not in contact with L numbers any more. I
-% think there must be a better way. Assumes |bidi=basic|, but
-% there are some additional readjustments for |bidi=default|.
+% Implicitly reverses sectioning labels in bidi=basic-r, because the
+% full stop is not in contact with L numbers any more. I think there
+% must be a better way. Assumes |bidi=basic|, but there are some
+% additional readjustments for |bidi=default|.
%
% \begin{macrocode}
\IfBabelLayout{counters*}%
@@ -16178,9 +16197,17 @@ Babel.linebreaking.replacements = {}
Babel.linebreaking.replacements[0] = {} -- pre
Babel.linebreaking.replacements[1] = {} -- post
+function Babel.tovalue(v)
+ if type(v) == 'string' then
+ return loadstring('return ' .. v)()
+ else
+ return v
+ end
+end
+
-- Discretionaries contain strings as nodes
function Babel.str_to_nodes(fn, matches, base)
- local n, head, last
+ local n, head, last
if fn == nil then return nil end
for s in string.utfvalues(fn(matches)) do
if base.id == 7 then
@@ -16227,7 +16254,7 @@ Babel.fetch_subtext[0] = function(head)
if lang == locale or lang == nil then
lang = lang or locale
- if Babel.ignore_pre_char(item) then
+ if Babel.ignore_pre_char(item) then
word_string = word_string .. Babel.us_char
else
word_string = word_string .. unicode.utf8.char(item.char)
@@ -16243,7 +16270,7 @@ Babel.fetch_subtext[0] = function(head)
-- Ignore leading unrecognized nodes, too.
elseif word_string ~= '' then
- word_string = word_string .. Babel.us_char
+ word_string = word_string .. Babel.us_char
word_nodes[#word_nodes+1] = item -- Will be ignored
end
@@ -16291,7 +16318,7 @@ Babel.fetch_subtext[1] = function(head)
word_nodes[#word_nodes+1] = item
elseif item.id == 7 and item.subtype == 3 then
- word_string = word_string .. '|'
+ word_string = word_string .. '|'
word_nodes[#word_nodes+1] = item
-- (1) Go to next word if nothing was found, and (2) implicitly
@@ -16304,7 +16331,7 @@ Babel.fetch_subtext[1] = function(head)
break
else
- word_string = word_string .. Babel.us_char
+ word_string = word_string .. Babel.us_char
word_nodes[#word_nodes+1] = item -- Will be ignored
end
@@ -16448,7 +16475,7 @@ function Babel.hyphenate_replace(head, mode)
if crep then
step = crep.step or step
end
-
+
if crep and crep.after then
crep.insert = true
if dummy_node then
@@ -16459,7 +16486,7 @@ function Babel.hyphenate_replace(head, mode)
dummy_node = item
end
end
-
+
if crep and not crep.after and dummy_node then
node.remove(head, dummy_node)
dummy_node = nil
@@ -16480,7 +16507,7 @@ function Babel.hyphenate_replace(head, mode)
sc = sc - 1 -- Nothing has been inserted.
last_match = utf8.offset(w, sc+1+step)
goto next
-
+
elseif crep and crep.kashida then -- Experimental
node.set_attribute(item,
Babel.attr_kashida,
@@ -16558,7 +16585,7 @@ function Babel.hyphenate_replace(head, mode)
placeholder = ' '
end
head, new = node.insert_before(head, item, d)
-
+
elseif crep and crep.norule then
-- 655360 = 10 pt = 10 * 65536 sp
d = node.new(2, 3) -- (rule, empty) = \no*rule
@@ -16582,16 +16609,16 @@ function Babel.hyphenate_replace(head, mode)
elseif mode == 0 and crep and crep.space then
-- ERROR
-
+
elseif crep and crep.kern then
d = node.new(13, 1) -- (kern, user)
local quad = font.getfont(item_base.font).size or 655360
d.attr = item_base.attr
d.kern = crep.kern * quad
head, new = node.insert_before(head, item, d)
-
+
elseif crep and crep.node then
- d = node.new(crep.node[1], crep.node[2])
+ d = node.new(crep.node[1], crep.node[2])
d.attr = item_base.attr
head, new = node.insert_before(head, item, d)
@@ -16621,7 +16648,7 @@ function Babel.hyphenate_replace(head, mode)
print('.....', '/')
Babel.debug_hyph(w, w_nodes, sc, first, last, last_match)
end
-
+
if dummy_node then
node.remove(head, dummy_node)
dummy_node = nil
@@ -16732,7 +16759,7 @@ function Babel.string_prehyphenation(str, locale)
last.next = n
last = n
end
- head = Babel.hyphenate_replace(head, 0)
+ head = Babel.hyphenate_replace(head, 0)
res = ''
for n in node.traverse(head) do
if n.id == 12 then
@@ -16776,16 +16803,13 @@ Babel.ranges = {
{0x07C0, 0x085F, 'r'},
{0x0860, 0x086F, 'al'},
{0x08A0, 0x08FF, 'al'},
- {0xE000, 0xF8FF, 'on'}, -- PUA
{0xFB1D, 0xFB4F, 'r'},
{0xFB50, 0xFDFF, 'al'},
{0xFE70, 0xFEFF, 'al'},
{0x10800, 0x10C4F, 'r'},
{0x1E800, 0x1E8DF, 'r'},
{0x1E900, 0x1E95F, 'r'},
- {0x1F300, 0x1F9FF, 'on'},
- {0xF0000, 0xFFFFD, 'on'}, -- PUA
- {0x100000, 0x10FFFD, 'on'} -- PUA
+ {0x1F300, 0x1F9FF, 'on'}
}
Babel.characters = {
@@ -22970,13 +22994,13 @@ function Babel.bidi(head, ispar)
if inmath then dir = ('TRT' == tex.mathdir) and 'r' or 'l' end
% \end{macrocode}
%
-% Next is based on the assumption babel sets the language AND
-% switches the script with its dir. We treat a language block as
-% a separate Unicode sequence. The following piece of code is
-% executed at the first glyph after a `dir' node. We don't know
-% the current language until then. This is not exactly true, as
-% the math mode may insert explicit dirs in the node list, so, for
-% the moment there is a hack by brute force (just above).
+% Next is based on the assumption \babel{} sets the language
+% \textit{and} switches the script with its dir. We treat a language
+% block as a separate Unicode sequence. The following piece of code is
+% executed at the first glyph after a `dir' node. We don't know the
+% current language until then. This is not exactly true, as the math
+% mode may insert explicit dirs in the node list, so, for the moment
+% there is a hack by brute force (just above).
%
% \begin{macrocode}
if new_dir then
@@ -23085,7 +23109,7 @@ function Babel.bidi(head, ispar)
elseif first_d and dir ~= strong_lr then
dir_mark(head, first_d, last_d, outer)
first_d, last_d = nil, nil
- end
+ end
end
% \end{macrocode}
%
@@ -23094,10 +23118,8 @@ function Babel.bidi(head, ispar)
% clearly <r> and <l>, resptly, but with other combinations depends on
% outer. From all these, we select only those resolving <on> $\to$
% <r>. At the beginning (when |last_lr| is nil) of an R text, they are
-% mirrored directly.
-%
-% TODO - numbers in R mode are processed. It doesn't hurt, but should
-% not be done.
+% mirrored directly. Numbers in R mode are processed. It should not be
+% done, but it doesn't hurt.
%
% \begin{macrocode}
if dir and not last_lr and dir ~= 'l' and outer == 'r' then
@@ -23232,7 +23254,7 @@ end
-- TODO - \hbox with an explicit dir can lead to wrong results
-- <R \hbox dir TLT{<R>}> and <L \hbox dir TRT{<L>}>. A small attempt
--- was s made to improve the situation, but the problem is the 3-dir
+-- was made to improve the situation, but the problem is the 3-dir
-- model in babel/Unicode and the 2-dir model in LuaTeX don't fit
-- well.
@@ -23254,6 +23276,7 @@ function Babel.bidi(head, ispar, hdir)
local has_hyperlink = false
local ATDIR = Babel.attr_dir
+ local attr_d
local save_outer
local temp = node.get_attribute(head, ATDIR)
@@ -23288,6 +23311,8 @@ function Babel.bidi(head, ispar, hdir)
if glyph_not_symbol_font(item)
or (item.id == 7 and item.subtype == 2) then
+ if node.get_attribute(item, ATDIR) == 128 then goto nextnode end
+
local d_font = nil
local item_r
if item.id == 7 and item.subtype == 2 then
@@ -23295,6 +23320,7 @@ function Babel.bidi(head, ispar, hdir)
else
item_r = item
end
+
local chardata = characters[item_r.char]
d = chardata and chardata.d or nil
if not d or d == 'nsm' then
@@ -23365,7 +23391,7 @@ function Babel.bidi(head, ispar, hdir)
d = nil
elseif item.id == node.id'math' then
- inmath = (item.subtype == 0)
+ inmath = (item.subtype == 0)
elseif item.id == 8 and item.subtype == 19 then
has_hyperlink = true
@@ -23422,6 +23448,7 @@ function Babel.bidi(head, ispar, hdir)
-- Force mathdir in math if ON (currently works as expected only
-- with 'l')
+
if inmath and d == 'on' then
d = ('TRT' == tex.mathdir) and 'r' or 'l'
end
@@ -23437,9 +23464,12 @@ function Babel.bidi(head, ispar, hdir)
table.insert(nodes, {item, d, outer_first})
end
+ node.set_attribute(item, ATDIR, 128)
outer_first = nil
- end
+ ::nextnode::
+
+ end -- for each node
-- TODO -- repeated here in case EN/ET is the last node. Find a
-- better way of doing things:
@@ -23600,6 +23630,15 @@ function Babel.bidi(head, ispar, hdir)
return head
end
+-- Make sure anything is marked as 'bidi done' (including nodes inserted
+-- after the babel algorithm).
+function Babel.unset_atdir(head)
+ local ATDIR = Babel.attr_dir
+ for item in node.traverse(head) do
+ node.set_attribute(item, ATDIR, 128)
+ end
+ return head
+end
%</basic>
% \end{macrocode}
%
@@ -23624,10 +23663,10 @@ Babel = Babel or {}
Babel.cjk_characters = {
[0x0021]={c='ex'},
- [0x0022]={c='qu'},
+ [0x0022]={c='qu'},
[0x0024]={c='pr'},
[0x0025]={c='po'},
- [0x0027]={c='qu'},
+ [0x0027]={c='qu'},
[0x0028]={c='op'},
[0x0029]={c='cp'},
[0x002B]={c='pr'},
@@ -23648,18 +23687,18 @@ Babel.cjk_characters = {
[0x00A3]={c='pr'},
[0x00A4]={c='pr'},
[0x00A5]={c='pr'},
- [0x00AB]={c='qu'},
+ [0x00AB]={c='qu'},
[0x00B0]={c='po'},
[0x00B1]={c='pr'},
- [0x00BB]={c='qu'},
- [0x2018]={c='qu'},
- [0x2019]={c='qu'},
+ [0x00BB]={c='qu'},
+ [0x2018]={c='qu'},
+ [0x2019]={c='qu'},
[0x201A]={c='op'},
- [0x201B]={c='qu'},
- [0x201C]={c='qu'},
- [0x201D]={c='qu'},
+ [0x201B]={c='qu'},
+ [0x201C]={c='qu'},
+ [0x201D]={c='qu'},
[0x201E]={c='op'},
- [0x201F]={c='qu'},
+ [0x201F]={c='qu'},
[0x2024]={c='in'},
[0x2025]={c='in'},
[0x2026]={c='in'},
@@ -23671,8 +23710,8 @@ Babel.cjk_characters = {
[0x2035]={c='po'},
[0x2036]={c='po'},
[0x2037]={c='po'},
- [0x2039]={c='qu'},
- [0x203A]={c='qu'},
+ [0x2039]={c='qu'},
+ [0x203A]={c='qu'},
[0x203C]={c='ns'},
[0x203D]={c='ns'},
[0x2044]={c='is'},
@@ -23731,22 +23770,22 @@ Babel.cjk_characters = {
[0x29FD]={c='cl'},
[0x2CF9]={c='ex'},
[0x2CFE]={c='ex'},
- [0x2E02]={c='qu'},
- [0x2E03]={c='qu'},
- [0x2E04]={c='qu'},
- [0x2E05]={c='qu'},
- [0x2E06]={c='qu'},
- [0x2E07]={c='qu'},
- [0x2E08]={c='qu'},
- [0x2E09]={c='qu'},
- [0x2E0A]={c='qu'},
- [0x2E0B]={c='qu'},
- [0x2E0C]={c='qu'},
- [0x2E0D]={c='qu'},
+ [0x2E02]={c='qu'},
+ [0x2E03]={c='qu'},
+ [0x2E04]={c='qu'},
+ [0x2E05]={c='qu'},
+ [0x2E06]={c='qu'},
+ [0x2E07]={c='qu'},
+ [0x2E08]={c='qu'},
+ [0x2E09]={c='qu'},
+ [0x2E0A]={c='qu'},
+ [0x2E0B]={c='qu'},
+ [0x2E0C]={c='qu'},
+ [0x2E0D]={c='qu'},
[0x2E18]={c='op'},
- [0x2E1C]={c='qu'},
- [0x2E1D]={c='qu'},
- [0x2E20]={c='qu'},
+ [0x2E1C]={c='qu'},
+ [0x2E1D]={c='qu'},
+ [0x2E20]={c='qu'},
[0x2E21]={c='qu'},
[0x2E22]={c='op'},
[0x2E23]={c='cl'},
@@ -23783,14 +23822,39 @@ Babel.cjk_characters = {
[0x301D]={c='op'},
[0x301E]={c='cl'},
[0x301F]={c='cl'},
+ [0x3043]={c='cj'},
+ [0x3045]={c='cj'},
+ [0x3047]={c='cj'},
+ [0x3049]={c='cj'},
+ [0x3063]={c='cj'},
+ [0x3083]={c='cj'},
+ [0x3085]={c='cj'},
+ [0x3087]={c='cj'},
+ [0x308E]={c='cj'},
+ [0x3095]={c='cj'},
+ [0x3096]={c='cj'},
[0x303B]={c='ns'},
[0x303C]={c='ns'},
+ [0x3041]={c='cj'},
[0x309B]={c='ns'},
[0x309C]={c='ns'},
[0x309D]={c='ns'},
[0x309E]={c='ns'},
[0x30A0]={c='ns'},
+ [0x30A1]={c='cj'},
+ [0x30A3]={c='cj'},
+ [0x30A5]={c='cj'},
+ [0x30A7]={c='cj'},
+ [0x30A9]={c='cj'},
+ [0x30C3]={c='cj'},
+ [0x30E3]={c='cj'},
+ [0x30E5]={c='cj'},
+ [0x30E7]={c='cj'},
+ [0x30EE]={c='cj'},
+ [0x30F5]={c='cj'},
+ [0x30F6]={c='cj'},
[0x30FB]={c='ns'},
+ [0x30FC]={c='cj'},
[0x30FD]={c='ns'},
[0x30FE]={c='ns'},
[0xA015]={c='ns'},
@@ -23860,25 +23924,33 @@ Babel.cjk_characters = {
[0xFF61]={c='cl', w='h'},
[0xFF62]={c='op', w='h'},
[0xFF63]={c='cl', w='h'},
- [0xFF64]={c='cl', w='h'}
+ [0xFF64]={c='cl', w='h'},
+ [0xFF70]={c='cj'}
}
Babel.cjk_class = setmetatable ( Babel.cjk_characters, {
__index = function(_, k)
if (k >= 0xAC00 and k <= 0xD7A3) -- H2/H3
- or (k >= 0x2E80 and k <= 0x9FFF)
+ or (k >= 0x2E80 and k <= 0x31E9) -- Skip small
+ or (k >= 0x3200 and k <= 0x9FFF)
or (k >= 0xA000 and k <= 0xA48F) -- Yi
or (k >= 0xA490 and k <= 0xA4CF) -- Yi
or (k >= 0xF900 and k <= 0xFAFF)
or (k >= 0xFE10 and k <= 0xFE1F)
or (k >= 0xFE30 and k <= 0xFE6F)
- or (k >= 0xFF00 and k <= 0xFFEF)
+ or (k >= 0xFF00 and k <= 0xFF66) -- Skip small
+ or (k >= 0xFF70 and k <= 0xFFEF)
or (k >= 0x1F000 and k <= 0x1FFFD)
or (k >= 0x20000 and k <= 0x2FFFD)
or (k >= 0x30000 and k <= 0x3FFFD) then
return {c='I'}
elseif (k >= 0x20A0 and k <= 0x20CF) then
return {c='pr'}
+ elseif (k >= 0x31F0 and k <= 0x31FF)
+ or (k >= 0xFF67 and k <= 0xFF6F)
+ or (k >= 0x1B150 and k <= 0x1B152)
+ or (k >= 0x1B164 and k <= 0x1B167) then
+ return {c='cj'}
else
return {c='O'}
end
@@ -23911,15 +23983,13 @@ Babel.cjk_breaks = {
%
% \section{The `nil' language}
%
-% This `language' does nothing, except setting the hyphenation patterns to
-% nohyphenation.
-%
-% For this language currently no special definitions are needed or
-% available.
+% This `language' does nothing, except setting the hyphenation patterns
+% to nohyphenation. For this language currently no special definitions
+% are needed or available.
%
-% The macro |\LdfInit| takes care of preventing that this file is
-% loaded more than once, checking the category code of the
-% \texttt{@} sign, etc.
+% The macro |\LdfInit| takes care of preventing that this file is
+% loaded more than once, checking the category code of the \texttt{@}
+% sign, etc.
%
% \begin{macrocode}
%<*nil>
@@ -23927,9 +23997,9 @@ Babel.cjk_breaks = {
\LdfInit{nil}{datenil}
% \end{macrocode}
%
-% When this file is read as an option, i.e. by the |\usepackage|
-% command, \texttt{nil} could be an `unknown' language in which
-% case we have to make it known.
+% When this file is read as an option, i.e. by the |\usepackage|
+% command, \texttt{nil} could be an `unknown' language in which case we
+% have to make it known.
%
% \begin{macrocode}
\ifx\l@nil\@undefined
@@ -23941,15 +24011,15 @@ Babel.cjk_breaks = {
\fi
% \end{macrocode}
%
-% This macro is used to store the values of the hyphenation
-% parameters |\lefthyphenmin| and |\righthyphenmin|.
+% This macro is used to store the values of the hyphenation parameters
+% |\lefthyphenmin| and |\righthyphenmin|.
%
% \begin{macrocode}
\providehyphenmins{\CurrentOption}{\m@ne\m@ne}
% \end{macrocode}
%
-% The next step consists of defining commands to switch to (and
-% from) the `nil' language.
+% The next step consists of defining commands to switch to (and from)
+% the `nil' language.
% \begin{macro}{\captionnil}
% \begin{macro}{\datenil}
%
@@ -23995,10 +24065,10 @@ Babel.cjk_breaks = {
\@namedef{bbl@sotf@nil}{latn}
% \end{macrocode}
%
-% The macro |\ldf@finish| takes care of looking for a
-% configuration file, setting the main language to be switched on
-% at |\begin{document}| and resetting the category code of
-% \texttt{@} to its original value.
+% The macro |\ldf@finish| takes care of looking for a configuration
+% file, setting the main language to be switched on at
+% |\begin{document}| and resetting the category code of \texttt{@} to
+% its original value.
%
% \begin{macrocode}
\ldf@finish{nil}
@@ -24488,7 +24558,7 @@ Babel.cjk_breaks = {
%</ca-buddhist>
%
% \subsection{Chinese}
-%
+%
% Brute force, with the Julian day of first day of each month. The
% table has been computed with the help of \textsf{python-lunardate} by
% Ricky Yeung, GPLv2 (but the code itself has not been used). The range
@@ -24498,7 +24568,7 @@ Babel.cjk_breaks = {
%<*ca-chinese>
\ExplSyntaxOn
<@Compute Julian day@>
-\def\bbl@ca@chinese#1-#2-#3\@@#4#5#6{%
+\def\bbl@ca@chinese#1-#2-#3\@@#4#5#6{%
\edef\bbl@tempd{\fp_eval:n{%
\bbl@cs@jd{#1}{#2}{#3} - 2457072.5 }}%
\count@\z@
@@ -24677,7 +24747,7 @@ Babel.cjk_breaks = {
%
% \subsection{General tools}
%
-% A number of \LaTeX\ macro's that are needed later on.
+% A number of \LaTeX\ macro's that are needed later on.
%
% \begin{macrocode}
\long\def\@firstofone#1{#1}
@@ -24752,8 +24822,8 @@ Babel.cjk_breaks = {
\@onlypreamble\@onlypreamble
% \end{macrocode}
%
-% Mimic \LaTeX's |\AtBeginDocument|; for this to work the user
-% needs to add |\begindocument| to his file.
+% Mimic \LaTeX's |\AtBeginDocument|; for this to work the user needs to
+% add |\begindocument| to his file.
%
% \begin{macrocode}
\def\begindocument{%
@@ -24772,9 +24842,8 @@ Babel.cjk_breaks = {
\def\AtBeginDocument{\g@addto@macro\@begindocumenthook}
% \end{macrocode}
%
-% We also have to mimic \LaTeX's |\AtEndOfPackage|. Our
-% replacement macro is much simpler; it stores its argument in
-% |\@endofldf|.
+% We also have to mimic \LaTeX's |\AtEndOfPackage|. Our replacement
+% macro is much simpler; it stores its argument in |\@endofldf|.
%
% \begin{macrocode}
\def\AtEndOfPackage#1{\g@addto@macro\@endofldf{#1}}
@@ -24785,10 +24854,10 @@ Babel.cjk_breaks = {
\chardef\bbl@opt@hyphenmap\z@
% \end{macrocode}
%
-% \LaTeX\ needs to be able to switch off writing to its auxiliary
-% files; plain doesn't have them by default. There is a trick to
-% hide some conditional commands from the outer |\ifx|. The same
-% trick is applied below.
+% \LaTeX\ needs to be able to switch off writing to its auxiliary
+% files; plain doesn't have them by default. There is a trick to hide
+% some conditional commands from the outer |\ifx|. The same trick is
+% applied below.
%
% \begin{macrocode}
\catcode`\&=\z@
@@ -24799,7 +24868,7 @@ Babel.cjk_breaks = {
\catcode`\&=4
% \end{macrocode}
%
-% Mimic \LaTeX's commands to define control sequences.
+% Mimic \LaTeX's commands to define control sequences.
%
% \begin{macrocode}
\def\newcommand{\@star@or@long\new@command}
@@ -24867,11 +24936,11 @@ Babel.cjk_breaks = {
\def\@x@protect#1&fi#2#3{&fi\protect#1}
% \end{macrocode}
%
-% The following little macro |\in@| is taken from \file{latex.ltx};
-% it checks whether its first argument is part of its second
-% argument. It uses the boolean |\in@|; allocating a new boolean
-% inside conditionally executed code is not possible, hence the
-% construct with the temporary definition of |\bbl@tempa|.
+% The following little macro |\in@| is taken from \file{latex.ltx}; it
+% checks whether its first argument is part of its second argument. It
+% uses the boolean |\in@|; allocating a new boolean inside
+% conditionally executed code is not possible, hence the construct with
+% the temporary definition of |\bbl@tempa|.
%
% \begin{macrocode}
\def\bbl@tempa{\csname newif\endcsname&ifin@}
@@ -24887,32 +24956,31 @@ Babel.cjk_breaks = {
\bbl@tempa
% \end{macrocode}
%
-% \LaTeX\ has a macro to check whether a certain package was loaded
-% with specific options. The command has two extra arguments which
-% are code to be executed in either the true or false case.
-% This is used to detect whether the document needs one of the
-% accents to be activated (\Lopt{activegrave} and
-% \Lopt{activeacute}). For plain \TeX\ we assume that the user
-% wants them to be active by default. Therefore the only thing we
-% do is execute the third argument (the code for the true case).
+% \LaTeX\ has a macro to check whether a certain package was loaded
+% with specific options. The command has two extra arguments which are
+% code to be executed in either the true or false case. This is used to
+% detect whether the document needs one of the accents to be activated
+% (\Lopt{activegrave} and \Lopt{activeacute}). For plain \TeX\ we
+% assume that the user wants them to be active by default. Therefore
+% the only thing we do is execute the third argument (the code for the
+% true case).
%
% \begin{macrocode}
\def\@ifpackagewith#1#2#3#4{#3}
% \end{macrocode}
%
-% The \LaTeX\ macro |\@ifl@aded| checks whether a file was
-% loaded. This functionality is not needed for plain \TeX\ but we
-% need the macro to be defined as a no-op.
+% The \LaTeX\ macro |\@ifl@aded| checks whether a file was loaded. This
+% functionality is not needed for plain \TeX\ but we need the macro to
+% be defined as a no-op.
%
% \begin{macrocode}
\def\@ifl@aded#1#2#3#4{}
% \end{macrocode}
%
-% For the following code we need to make sure that the commands
-% |\newcommand| and |\providecommand| exist with some sensible
-% definition. They are not fully equivalent to their \LaTeXe\
-% versions; just enough to make things work in plain~\TeX
-% environments.
+% For the following code we need to make sure that the commands
+% |\newcommand| and |\providecommand| exist with some sensible
+% definition. They are not fully equivalent to their \LaTeXe\ versions;
+% just enough to make things work in plain~\TeX environments.
%
% \begin{macrocode}
\ifx\@tempcnta\@undefined
@@ -24923,9 +24991,9 @@ Babel.cjk_breaks = {
\fi
% \end{macrocode}
%
-% To prevent wasting two counters in \LaTeX\ (because
-% counters with the same name are allocated later by it) we reset
-% the counter that holds the next free counter (|\count10|).
+% To prevent wasting two counters in \LaTeX\ (because counters with the
+% same name are allocated later by it) we reset the counter that holds
+% the next free counter (|\count10|).
%
% \begin{macrocode}
\ifx\bye\@undefined
@@ -24966,8 +25034,8 @@ Babel.cjk_breaks = {
%
% \subsection{Encoding related macros}
%
-% Code from \file{ltoutenc.dtx}, adapted for use in the plain \TeX\
-% environment.
+% Code from \file{ltoutenc.dtx}, adapted for use in the plain \TeX\
+% environment.
%
% \begin{macrocode}
\def\DeclareTextCommand{%
@@ -25090,9 +25158,8 @@ Babel.cjk_breaks = {
\def\cf@encoding{OT1}
% \end{macrocode}
%
-% Currently we only use the \LaTeXe\ method for accents for those
-% that are known to be made active in \emph{some} language
-% definition file.
+% Currently we only use the \LaTeXe\ method for accents for those that
+% are known to be made active in \emph{some} language definition file.
%
% \begin{macrocode}
\DeclareTextAccent{\"}{OT1}{127}
@@ -25102,8 +25169,8 @@ Babel.cjk_breaks = {
\DeclareTextAccent{\~}{OT1}{126}
% \end{macrocode}
%
-% The following control sequences are used in \file{babel.def}
-% but are not defined for \textsc{plain} \TeX.
+% The following control sequences are used in \file{babel.def} but are
+% not defined for \textsc{plain} \TeX.
%
% \begin{macrocode}
\DeclareTextSymbol{\textquotedblleft}{OT1}{92}
@@ -25125,7 +25192,7 @@ Babel.cjk_breaks = {
\fi
% \end{macrocode}
%
-% And a few more “dummy†definitions.
+% And a few more “dummy†definitions.
%
% \begin{macrocode}
\def\languagename{english}%
@@ -25162,7 +25229,6 @@ Babel.cjk_breaks = {
\input babel.def
%</plain>
% \end{macrocode}
-%
% \Finale
%
\endinput
diff --git a/Master/texmf-dist/source/latex/babel/babel.ins b/Master/texmf-dist/source/latex/babel/babel.ins
index 70cf2a0be70..ed0700bf083 100644
--- a/Master/texmf-dist/source/latex/babel/babel.ins
+++ b/Master/texmf-dist/source/latex/babel/babel.ins
@@ -26,7 +26,7 @@
%% and covered by LPPL is defined by the unpacking scripts (with
%% extension .ins) which are part of the distribution.
%%
-\def\filedate{2024/06/02}
+\def\filedate{2024/08/29}
\def\batchfile{babel.ins}
\input docstrip.tex
diff --git a/Master/texmf-dist/source/latex/babel/bbcompat.dtx b/Master/texmf-dist/source/latex/babel/bbcompat.dtx
index e4d9db47084..deca42e0387 100644
--- a/Master/texmf-dist/source/latex/babel/bbcompat.dtx
+++ b/Master/texmf-dist/source/latex/babel/bbcompat.dtx
@@ -30,7 +30,7 @@
%
% \iffalse
%<*dtx>
-\ProvidesFile{bbcompat.dtx}[2024/06/02 v24.6]
+\ProvidesFile{bbcompat.dtx}[2024/08/29 v24.]
%</dtx>
%
%% File 'bbcompat.dtx'
diff --git a/Master/texmf-dist/source/latex/babel/locale.zip b/Master/texmf-dist/source/latex/babel/locale.zip
index 10907ced5ca..71688b7938b 100644
--- a/Master/texmf-dist/source/latex/babel/locale.zip
+++ b/Master/texmf-dist/source/latex/babel/locale.zip
Binary files differ
diff --git a/Master/texmf-dist/source/latex/base/ltpara.dtx b/Master/texmf-dist/source/latex/base/ltpara.dtx
index f102d68e0d6..b9158564622 100644
--- a/Master/texmf-dist/source/latex/base/ltpara.dtx
+++ b/Master/texmf-dist/source/latex/base/ltpara.dtx
@@ -17,7 +17,7 @@
%<*driver>
% \fi
\ProvidesFile{ltpara.dtx}
- [2024/05/16 v1.0m LaTeX Kernel (paragraph hooks)]
+ [2024/06/23 v1.0n LaTeX Kernel (paragraph hooks)]
% \iffalse
%
\documentclass{l3doc}
@@ -819,6 +819,18 @@
\@@_handle_indent:
% \the \everypar % <--- done differently below
}
+% \end{macrocode}
+% \changes{v1.0n}{2024/06/23}
+% {Append \cs{everypar} toks to \cs{g_@@_standard_everypar_tl},
+% rollback 2023/06/01 (gh/1386)}
+% \begin{macrocode}
+%<latexrelease>\cs_set:Npn \@@_tmp:w #1#2#3#4#5 { }
+%<latexrelease>\tl_gput_right:Nx \g_@@_standard_everypar_tl {
+%<latexrelease> \exp_not:N \the
+%<latexrelease> \exp_not:N \toks
+%<latexrelease> \exp_after:wN \@@_tmp:w \token_to_meaning:N \everypar
+%<latexrelease> \c_space_tl
+%<latexrelease>}
%<latexrelease>\EndIncludeInRelease
%<latexrelease>\IncludeInRelease{2021/06/01}
%<latexrelease> {\g_@@_standard_everypar_tl}{minipage~ fix}
@@ -917,10 +929,10 @@
% 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
+ \exp_not:N \the
+ \exp_not:N \toks
+ \the \allocationnumber
+ \c_space_tl
}
% \end{macrocode}
% \end{macro}
diff --git a/Master/texmf-dist/source/latex/base/ltvers.dtx b/Master/texmf-dist/source/latex/base/ltvers.dtx
index 557b7b4878b..15e662d843c 100644
--- a/Master/texmf-dist/source/latex/base/ltvers.dtx
+++ b/Master/texmf-dist/source/latex/base/ltvers.dtx
@@ -115,7 +115,7 @@
{2024-06-01}
%</2ekernel|latexrelease>
%<*2ekernel>
-\def\patch@level{1}
+\def\patch@level{2}
% \end{macrocode}
%
% \begin{macro}{\development@branch@name}
diff --git a/Master/texmf-dist/source/latex/bib2qr/bib2qr.dtx b/Master/texmf-dist/source/latex/bib2qr/bib2qr.dtx
new file mode 100644
index 00000000000..980c2002c22
--- /dev/null
+++ b/Master/texmf-dist/source/latex/bib2qr/bib2qr.dtx
@@ -0,0 +1,594 @@
+% \iffalse meta-comment
+%
+% Copyright (C) 2024 Christian Schreinemachers
+%
+% This work 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
+%
+% http://www.latex-project.org/lppl.txt
+%
+% and version 1.3c or later is part of all distributions of LaTeX
+% version 2008-05-04 or later.
+%
+% This work has the LPPL maintenance status `maintained'.
+%
+% The current maintainer of this work is Christian Schreinemachers.
+%
+% This work consists of the files
+% README.md
+% bib2qr.dtx
+% bib2qr.ins
+% and the derived files
+% bib2qr.sty
+% bib2qr.pdf
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% \fi
+% \iffalse
+%<package>\NeedsTeXFormat{LaTeX2e}
+%<package>\ProvidesPackage{bib2qr}
+%<package> [2024-07-31 v0.2 Cite BibTeX entries with QR codes]
+%
+%<*driver>
+\documentclass[a4paper]{ltxdoc}
+\usepackage[T1]{fontenc}
+\usepackage[toc]{multitoc}
+\usepackage{geometry}
+\usepackage{fancyvrb}
+% Declare example reference entries
+\begin{filecontents}[overwrite]{example-references.bib}
+ @software{bib2qr,
+ author = {Schreinemachers, Christian},
+ title = {bib2qr - A LaTeX package for citing BibTeX entries with QR codes},
+ url = {https://codeberg.org/Cs137/bib2qr/releases/tag/v0.2},
+ version = {v0.2},
+ date = {2024-07-31}
+ }
+ @article{Doe2024,
+ author = {Doe, Jane},
+ title = {A comprehensive study on example generation},
+ journal = {Journal of Examples},
+ year = {2024},
+ volume = {42},
+ pages = {1982--2024},
+ doi = {10.1234/example.2024.001}
+ }
+ @article{Mustermann2023,
+ author = {Mustermann, Erika},
+ title = {Limitations in including electronic references in articles},
+ journal = {Journal of Examples},
+ year = {2023},
+ volume = {23},
+ pages = {624--666}
+ }
+\end{filecontents}
+\usepackage[style=authoryear,sorting=none]{biblatex}
+\addbibresource{example-references.bib}
+\usepackage[%
+ pdfusetitle,%
+ hyperindex=false,%
+ pdfsubject={LaTeX package documentation},%
+ pdfkeywords={bib2qr, biblatex, latex, qrcode, documentation}%
+]{hyperref}
+\usepackage{scrextend}
+\usepackage{cleveref}
+\usepackage[qrwidth=1.25cm]{bib2qr}
+\EnableCrossrefs
+\CodelineIndex
+\RecordChanges
+\DoNotIndex{\begin,\DeclareBibliographyDriver,\DeclareCiteCommand,\DeclareFieldFormat,
+ \DeclareKeys,\dimexpr,\edef,\end,\equal,\fullcite,\hspace,\IfBeginWith,
+ \ifboolexpr,\iffieldundef,\ifthenelse,\linewidth,\multicitedelim,
+ \NewDocumentCommand,\newcommand,\noindent,\par,\parindent,\printfield,
+ \ProcessKeyOptions,\qrcode,\RequirePackage,\relax,\SetKeys,\space,
+ \thefield,\usebibmacro,\usedriver}
+\setcounter{IndexColumns}{2}
+\setlength{\IndexMin}{40ex}
+\setlength{\columnseprule}{.4pt}
+\addtolength{\oddsidemargin}{2cm}
+\addtolength{\textwidth}{-2cm}
+\begin{document}
+ \DocInput{bib2qr.dtx}
+\end{document}
+%</driver>
+% \fi
+%
+% \pagestyle{headings}
+%
+% \newcommand*{\package}[1]{\textsf{#1}}
+% \newcommand*{\ctanpkg}[1]{\href{https://ctan.org/pkg/#1}{\package{#1}}}
+% \newcommand*{\opt}[1]{\texttt{#1}}
+% \newcommand*{\default}[1]{(default: \opt{#1})}
+%
+%
+% ^^A -----------------------------
+%
+% \changes{v0.2}{2024-07-31}{%
+% Initial release,
+% convert into dtx,
+% add documentation,
+% rename internal macros,
+% add \opt{qrdelimiter} option
+% }
+% \changes{v0.1}{2024/06/16}{Initial version}
+%
+% \GetFileInfo{bib2qr.sty}
+%
+%
+% ^^A -----------------------------
+%
+% \title{The \package{bib2qr} package}
+% \author{Christian Schreinemachers}
+% \date{%
+% Released \filedate\thanks{%
+% \package{bib2qr}~\fileversion
+% ~(\href{https://codeberg.org/Cs137/bib2qr/releases/tag/\fileversion}{source code})}%
+% }
+% \maketitle
+%
+%
+% ^^A -----------------------------
+%
+% \begingroup
+% \hypersetup{
+% linkcolor=.,
+% citecolor=.,
+% urlcolor=.,
+% }
+% \begin{abstract}
+% The \package{bib2qr} package provides functionality to cite BibTeX entries
+% with QR codes for easy sharing and referencing. The target of the QR code
+% is the entry's digital object identifier (DOI), or URL if no DOI exists.
+% It is realised in the \cs{qrcite} macro, via the \LaTeX{} packages
+% \package{biblatex} and \package{qrcode}. In addition to the \cs{qrcite}
+% command, the package contains the \cs{qrfullcite} macro, which requires
+% only a BibTeX key as argument and allows to generate output that might
+% look as follows:\\
+% \textcolor{red}{\qrfullcite[noindent]{bib2qr}}
+% \end{abstract}
+% \endgroup
+%
+%
+% ^^A -----------------------------
+%
+% \tableofcontents
+%
+%
+% ^^A -----------------------------
+%
+% \section{Introduction}
+% ^^A
+% I like to include \href{https://en.wikipedia.org/wiki/QR_code}{quick-response (QR) codes}
+% of references on slides created with \LaTeX{} \ctanpkg{beamer}. Previously,
+% I did this by using the \ctanpkg{qrcode} package and manually declaring the
+% URL of the reference's digital object identifier (DOI). Occasionally, I also
+% add human-readable information generated via \cs{fullcite} from the
+% \ctanpkg{biblatex} package.
+%
+% To avoid manually declaring the URL and calling two separate commands for QR
+% codes and human-readable citations, I developed this \LaTeX{} package. It
+% automates the inclusion of QR codes by a \package{biblatex} bibliography
+% driver\footnote{%
+% \href{http://mirrors.ctan.org/macros/latex/contrib/biblatex/doc/biblatex.pdf\#page=166}
+% {\package{biblatex} documentation p.\,166 (v3.20)}%
+% },
+% which uses field formats to display QR codes for the entry's \opt{doi}
+% and \opt{url} fields with the \package{qrcode} package. You can cite any
+% reference from your bibliography with this driver by declaring its \meta{key}
+% to the \cs{qrcite} command. The latter is a cite command\footnote{%
+% \href{http://mirrors.ctan.org/macros/latex/contrib/biblatex/doc/biblatex.pdf\#page=186}%
+% {\package{biblatex} documentation p.\,186 (v3.20)}%
+% \label{biblatexCiteCommand}%
+% },
+% which ensures that any referenced QR code is also listed in the reference list.
+%
+% For the inclusion of both, QR codes and human-readable citation information
+% in a single step, I introduced the \cs{qrfullcite} command. It applies the
+% \cs{qrcite} command and the \cs{fullcite} command from the \package{biblatex}
+% package, ensuring clarity and ease of reference not only on \package{beamer}
+% slides, but in any \LaTeX{} document.
+%
+%
+% ^^A -----------------------------
+%
+% \section{Usage}
+% ^^A
+% Load the package in your document's preamble and specify any of the
+% options described in the next subsection as follows:
+%
+% \begin{quote}
+% \cs{usepackage}\oarg{option(s)}\{bib2qr\}
+% \end{quote}
+%
+%
+% ^^A -----------------------------
+%
+% \subsection{Options}
+% ^^A
+% In order to change the default behaviour of this package, declare one
+% or more of the options described in this subsection with your desired
+% value.
+%
+% \begin{description}
+%
+% \item[\opt{doiurlbase=\meta{string}}] \default{https://doi.org/}
+% specifies the prefix to convert a DOI string into its URL. If the DOI
+% string starts with \meta{doiurlbase}, it is used as is to generate a
+% QR code. Otherwise, the DOI string is appended to \meta{doiurlbase} to
+% form the DOI's URL, which is then used to generate the QR code.
+% In normal use cases this option does not require any adjustment.
+%
+% \item[\opt{qrdelimiter=\meta{sepcode}}] \default{\cs{space}}
+% specifies the delimiter of QR codes generated by \cs{qrcite} in multicite
+% mode. It is shown between the individual QR codes of multiple references
+% created by \cs{qrcite}\marg{key1,key2,\dots keyN} and \emph{``\dots is
+% arbitrary code to be executed after each iteration...''}\,\footref{biblatexCiteCommand}.
+% The examples shown in this document were generated considering the
+% default \opt{qrdelimiter}.
+%
+% \item[\opt{qrversion=\meta{version specification}}] \default{0}
+% sets the version of the QR code. Consult the \package{qrcode} documentation
+% for details about the \meta{version specification}\footnote{%
+% \href{http://mirrors.ctan.org/macros/latex/contrib/qrcode/qrcode.pdf\#page=3}
+% {\package{qrcode} documentation p.\,3 (v1.51)}%
+% }.
+% The examples shown in this document were generated considering the
+% default \opt{qrversion}.
+%
+% \item[\opt{qrwidth=\meta{dimen}}] \default{2cm}
+% sets the width of the QR code. The value is used to determine the
+% width for the output of the \cs{fullcite} macro and is passed to
+% \package{qrcode} as \opt{height} option. The default value is quite
+% suitable for usage in \LaTeX{} \package{beamer} slides, but in such
+% documents as this one, a smaller width might be desired. The examples
+% shown in this document were generated using \opt{qrwidth=1.25cm}.
+%
+% \end{description}
+%
+%
+% ^^A -----------------------------
+%
+% \subsection{Macros}
+% ^^A
+% \subsubsection*{\cs{qrcite}\marg{key(s)}}
+%
+% \DescribeMacro{\qrcite}
+% QR code(s) with a link to the reference's DOI or URL can be generated
+% using the \cs{qrcite} command. The target of the QR code is the entry's
+% DOI converted into a URL, or the URL iteself. In case the BibTeX entry has
+% no DOI and no URL, it does nothing besides raising a warning.
+% ^^A
+% The output for some example entries is shown underneath. If you
+% would like to replicate the examples, you can find the entries
+% sources as \cref{ssec:example_bib}. The colours are defined in the
+% examples, as this functionality is out of scope of the package
+% \package{bib2qr}. Moreover, \package{hyperlink} is configured in such
+% a way that the links in the following examples consider the font colour,
+% usually links would be presented in the colour defined as \opt{linkcolor}.
+%
+% The example displayed in blue was created via \textcolor{blue}{%
+% \cs{qrcite\{bib2qr\}}}. The QR code in red next to it was generated
+% via \textcolor{red}{\cs{qrcite\{Doe2024\}}}. The entry of the latter has a
+% DOI, while the entry of the blue example represents a BibTeX entry without
+% a DOI, but there is a value assigned to its URL field.
+% ^^A
+% The macro \cs{qrcite} is a cite command, thus it can be used to cite multiple
+% references, as shown in black (\cs{qrcite\{bib2qr,Doe2024\}}), and entries
+% cited via \cs{qrcite} are included in the document's bibliography
+% (cf. \cref{ssec:example_ref}).
+%
+% \begingroup
+% \hypersetup{
+% linkcolor=.,
+% citecolor=.,
+% urlcolor=.,
+% }
+%
+% \par\smallskip%
+% \noindent%
+% \textcolor{blue}{\qrcite{bib2qr}}
+% \textcolor{red}{\qrcite{Doe2024}}
+% \qrcite{bib2qr,Doe2024}
+% \par\medskip%
+%
+% \subsubsection*{\cs{qrfullcite}\marg{key}}
+%
+% \DescribeMacro{\qrfullcite}
+% This command displays the QR code of a BibTeX entry's DOI link or URL and
+% a full citation. The QR code is generated by \cs{qrcite} and the full
+% citation by \cs{fullcite}, provided by the package \package{biblatex}.
+% Each output is presented in individual minipages which are placed next to
+% each other, as shown in the examples underneath
+% (\textcolor{blue}{\cs{qrfullcite\{bib2qr\}}},
+% \textcolor{red}{\cs{qrfullcite[noindent]\{Doe2024\}}}).
+%
+% Please note that \cs{qrfullcite} does \textbf{not} support group
+% citations and accepts only a single \meta{key} as argument.
+%
+% \textcolor{blue}{\qrfullcite{bib2qr}}%
+% \medskip%
+% \textcolor{red}{\qrfullcite[noindent]{Doe2024}}%
+% \medskip%
+% \endgroup
+%
+% The output of \cs{qrfullcite} is considered as its own paragraph, thus it
+% may be indented, like in this document (see blue example). You can prevent
+% the latter by providing the \opt{noindent} option when calling the macro,
+% as done in the red example.
+%
+% The first minipage has the width of the package option \opt{qrwidth}
+% and displays the output of \cs{qrcite}\marg{key}. The second minipage
+% occupies the remaining width of \cs{linewidth} considering a gap of
+% \opt{0.5em} and \cs{parindent}, if the latter is not deactivated via the
+% \opt{noindent} option. It shows the output of \cs{fullcite}\marg{key}.
+%
+%
+% ^^A -----------------------------
+%
+% \subsection{Hints}
+% ^^A
+% If the \package{hyperref} package is loaded, not only the DOI/URL strings,
+% but also the QR codes are presented as links. It was modified in this
+% document to allow you to distinguish the output of the individual macro calls
+% in a better way. The previous example without any modifications of the
+% document settings and without deactivating the indentation looks as follows:\\
+%
+% \qrfullcite{Doe2024}%
+%
+%
+% ^^A -----------------------------
+%
+% \subsection{Known limitations}
+% ^^A
+% In case no QR code can be generated by \cs{qrcite} called via \cs{qrfullcite},
+% the output of \cs{fullcite} is nevertheless indented by the width assigned to
+% the \opt{qrwidth} package option and the length of the gap of \opt{0.5em}),
+% as shown in orange below (\textcolor{orange}{\cs{qrcite\{Mustermann2023\}}}).
+%
+% \textcolor{orange}{\qrfullcite{Mustermann2023}}%
+%
+%
+% ^^A -----------------------------
+%
+% \MaybeStop{
+%
+% \IndexPrologue{%
+% \section{Index}
+% Numbers written in italic refer to the page where the corresponding entry
+% is described; numbers underlined refer to the code line of the definition;
+% numbers in roman refer to the code lines where the entry is used.
+% }
+% \PrintIndex
+%
+% \GlossaryPrologue{%
+% \section{Change History}
+% The changes listed in this section aim to provide a brief overview of the
+% changes introduced into the package \package{bib2qr}. The
+% \href{https://codeberg.org/Cs137/bib2qr/}{package repository on Codeberg}
+% contains a
+% \href{https://codeberg.org/Cs137/bib2qr/src/branch/main/CHANGELOG.md}{changelog file},
+% consult it to read a detailed description of the changes introduced into
+% this package.
+% }
+% \PrintChanges
+%
+% ^^A -----------------------------
+%
+% \newpage
+% \appendix
+%
+% \section{Appendix}
+%
+% The examples presented in this document are based on the
+% BibTeX entries listed in \ref{ssec:example_bib} and result
+% in the bibliography shown as \ref{ssec:example_ref} (\package{biblatex}
+% options: \opt{style=authoryear}, \opt{sorting=none}).
+%
+% \subsection{Example BibTeX entries}
+% \label{ssec:example_bib}
+% \small{%
+% \VerbatimInput[firstline=5]{example-references.bib}
+% }
+%
+% \subsection{Example bibliography}
+% \label{ssec:example_ref}
+% \printbibliography[heading=none]
+%
+% }
+%
+%
+% ^^A -----------------------------
+%
+% \section{Implementation}
+% ^^A
+%
+% \subsection{Dependencies}
+% ^^A
+% In order to use \package{bib2qr}, the \LaTeX{} packages
+% \ctanpkg{biblatex},
+% \ctanpkg{ifthen},
+% \ctanpkg{qrcode}, and
+% \ctanpkg{xstring}
+% are required as package dependencies.
+% \iffalse
+%<*package>
+% \fi
+% \begin{macrocode}
+\RequirePackage{biblatex}
+\RequirePackage{ifthen}
+\RequirePackage{qrcode}
+\RequirePackage{xstring}
+% \end{macrocode}
+%
+%
+% \subsection{Options}
+% ^^A
+% The package options are internally available as \cs{@bibiiqr@}\meta{option}.
+% \begin{macrocode}
+\DeclareKeys[@bibiiqr]{
+ doiurlbase.store = \@bibiiqr@doiurlbase,
+ doiurlbase.usage = load,
+ qrdelimiter.store = \@bibiiqr@qrdelimiter,
+ qrdelimiter.usage = load,
+ qrversion.store = \@bibiiqr@qrversion,
+ qrversion.usage = load,
+ qrwidth.store = \@bibiiqr@qrwidth,
+ qrwidth.usage = load,
+}%
+% \end{macrocode}
+%
+% \subsubsection*{Assignement of default values}
+% \begin{macrocode}
+\SetKeys[@bibiiqr]{
+ doiurlbase=https://doi.org/,
+ qrdelimiter=\space,
+ qrversion=0,
+ qrwidth=2cm,
+}%
+% \end{macrocode}
+%
+% \subsubsection*{Processing of package options}
+% \begin{macrocode}
+\ProcessKeyOptions[@bibiiqr]\relax
+% \end{macrocode}
+%
+% \subsection{Macros}
+%
+% \begin{macro}{\@bibiiqr@showqr}
+% \marg{string}\\
+% Display a string as QR code considering the package options \opt{qrversion}
+% and \opt{qrwidth}.
+% \begin{macrocode}
+\newcommand\@bibiiqr@showqr[1]{%
+ \qrcode[height=\@bibiiqr@qrwidth,version=\@bibiiqr@qrversion]{#1}%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \subsubsection{Field formats}
+%
+% Custom field formats are defined to display a QR code of an entry's
+% \texttt{doi} and \texttt{url}.
+%
+% \begin{macro}{@bibiiqr@fldFmtDoi}
+% Field format to display a DOI field's value (converted into an URL
+% considering the option \opt{@bibiiqr@doiurlbase}) as QR code using
+% macro \cs{@bibiiqr@showqr}.
+% \begin{macrocode}
+\DeclareFieldFormat{@bibiiqr@fldFmtDoi}{%
+ \IfBeginWith{#1}{\@bibiiqr@doiurlbase}%
+ {\@bibiiqr@showqr{#1}}%
+ {\@bibiiqr@showqr{\@bibiiqr@doiurlbase#1}}%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{@bibiiqr@fldFmtUrl}
+% Field format to display an URL field's value as QR code using \cs{@bibiiqr@showqr}.
+% \begin{macrocode}
+\DeclareFieldFormat{@bibiiqr@fldFmtUrl}{\@bibiiqr@showqr{#1}}
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \subsubsection{Bibliography driver}
+%
+% \begin{macro}{@bibiiqr@bibDrvQR}
+% This bibliography driver
+% allows to display the QR code of an entry's DOI-, or URL field.
+% It applies the \cs{printfield}\oarg{format}\marg{field} macro, which is
+% provided by the \package{biblatex} package to displpay a QR code using the
+% \texttt{@bibiiqr@fldFmtDoi} or \texttt{@bibiiqr@fldFmtUrl} field format and
+% the corresponding field, respectively.
+%
+% The DOI is preferred and the URL is only used if no value is assigned to
+% the DOI field. If neither the DOI, nor the URL field contains a value, a
+% package warning is raised.
+%
+% \begin{macrocode}
+\DeclareBibliographyDriver{@bibiiqr@bibDrvQR}{%
+ \usebibmacro{begentry}%
+ \ifboolexpr{test{\iffieldundef{doi}}}
+ {%
+ \ifboolexpr{test{\iffieldundef{url}}}%
+% \end{macrocode}
+% The entry has no DOI and no URL: Raise a warning.
+% \begin{macrocode}
+ {%
+ \PackageWarning{bib2qr}%
+ {BibTeX entry without DOI or URL: \thefield{entrykey}}{}%
+ }%
+% \end{macrocode}
+% The entry has no DOI but an URL: Display the \texttt{url} field's
+% value using the \texttt{@bibiiqr@fldFmtUrl} field format.
+% \begin{macrocode}
+ {\printfield[@bibiiqr@fldFmtUrl]{url}}%
+ }%
+% \end{macrocode}
+% The entry has a DOI: Display the \texttt{doi} field's value using
+% the \texttt{@bibiiqr@fldFmtDoi} field format.
+% \begin{macrocode}
+ {\printfield[@bibiiqr@fldFmtDoi]{doi}}%
+ \usebibmacro{finentry}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Author commands}
+%
+% \begin{macro}{\qrcite}
+% \marg{key(s)}\\
+% Display the QR code of a BibTeX entry's DOI link or URL by introducing the
+% cite command \cs{qrcite}\marg{key}, which makes use of the previously
+% defined bibliography driver \texttt{@bibiiqr@bibDrvQR}. It requires at least
+% one BibTeX \marg{key} as argument.
+% \begin{macrocode}
+\DeclareCiteCommand{\qrcite}
+ {\usebibmacro{prenote}}%
+ {\usedriver{}{@bibiiqr@bibDrvQR}}%
+ {\@bibiiqr@qrdelimiter}%
+ {\usebibmacro{postnote}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\qrfullcite}
+% \changes{v0.2}{2024-07-31}{Add \opt{noindent} option}
+% \oarg{option(s)}\marg{key}\\
+% Display the QR code of a singe BibTeX entry's DOI link or URL and a full
+% citation of it. Specify \opt{noindent} as option, if the output should not
+% be indented.
+% \begin{macrocode}
+\NewDocumentCommand{\qrfullcite}{O{}m}{%
+ \par%
+ \ifthenelse{\equal{#1}{noindent}}{%
+ \noindent%
+ \edef\@bibiiqr@mpiiwidth{\dimexpr\linewidth-\@bibiiqr@qrwidth-0.5em}%
+ }{%
+ \edef\@bibiiqr@mpiiwidth{%
+ \dimexpr\linewidth-\parindent-\@bibiiqr@qrwidth-0.5em}%
+ }%
+ \begin{minipage}[t]{\@bibiiqr@qrwidth}
+ \qrcite{#2}%
+ \end{minipage}
+ \hspace{0.5em}%
+ \begin{minipage}{\@bibiiqr@mpiiwidth}
+ \fullcite{#2}%
+ \end{minipage}
+ \par%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \iffalse
+%</package>
+% \fi
+%
+%
+% ^^A -----------------------------
+%
+% \Finale
+
diff --git a/Master/texmf-dist/source/latex/bib2qr/bib2qr.ins b/Master/texmf-dist/source/latex/bib2qr/bib2qr.ins
new file mode 100644
index 00000000000..7894fdb8e38
--- /dev/null
+++ b/Master/texmf-dist/source/latex/bib2qr/bib2qr.ins
@@ -0,0 +1,85 @@
+%%
+%% Copyright (C) 2024 Christian Schreinemachers
+%%
+%% This work 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
+%%
+%% http://www.latex-project.org/lppl.txt
+%%
+%% and version 1.3c or later is part of all distributions of
+%% LaTeX version 2008-05-04 or later.
+%%
+%% This work has the LPPL maintenance status `maintained'.
+%%
+%% The current maintainer of this work is Christian Schreinemachers.
+%%
+%% This work consists of the files
+%% README.md
+%% bib2qr.dtx
+%% bib2qr.ins
+%% and the derived files
+%% bib2qr.sty
+%% bib2qr.pdf
+%%
+This work has the LPPL maintenance status `maintained'.
+
+The current maintainer of this work is Christian Schreinemachers.
+
+This work consists of the files
+ README.md
+ bib2qr.dtx
+ bib2qr.ins
+and the derived files
+ bib2qr.sty
+ bib2qr.pdf
+\input docstrip.tex
+\keepsilent
+
+\preamble
+
+Copyright (C) 2024 Christian Schreinemachers
+
+This work 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
+
+ http://www.latex-project.org/lppl.txt
+
+and version 1.3c or later is part of all distributions of LaTeX
+version 2008-05-04 or later.
+
+This work has the LPPL maintenance status `maintained'.
+
+The current maintainer of this work is
+ Christian Schreinemachers.
+
+This work consists of the files
+ bib2qr.dtx
+ bib2qr.ins
+and the derived files
+ bib2qr.sty
+ bib2qr.pdf
+
+\endpreamble
+\askforoverwritefalse
+\generate{\file{bib2qr.sty}{\from{bib2qr.dtx}{package}}}
+
+\obeyspaces
+\Msg{****************************************************}
+\Msg{* To finish the installation you have to move the *}
+\Msg{* following file into a directory searched by TeX: *}
+\Msg{* *}
+\Msg{* bib2qr.sty *}
+\Msg{* *}
+\Msg{* To produce the documentation run the file *}
+\Msg{* bib2qr.dtx through LaTeX. *}
+\Msg{* *}
+\Msg{* Happy TeXing! *}
+\Msg{****************************************************}
+\endbatchfile
+%%
+%% End of file `bib2qr.ins'.
+
diff --git a/Master/texmf-dist/source/latex/bxjscls/bxjscls.dtx b/Master/texmf-dist/source/latex/bxjscls/bxjscls.dtx
index d8708af2d9f..9b4b59c73d2 100644
--- a/Master/texmf-dist/source/latex/bxjscls/bxjscls.dtx
+++ b/Master/texmf-dist/source/latex/bxjscls/bxjscls.dtx
@@ -56,7 +56,8 @@
%<*driver>
\ProvidesFile{bxjscls.dtx}
%</driver>
- [2024/01/22 v2.9b BXJS document classes]
+ [2024/07/19 v2.9c BXJS document classes]
+% [2024/01/22 v2.9b BXJS document classes]
% [2023/08/02 v2.9a BXJS document classes]
% [2023/07/17 v2.9 BXJS document classes]
% [2023/07/01 v2.8b BXJS document classes]
@@ -5515,6 +5516,20 @@
%
% \section{文書ã®ãƒžãƒ¼ã‚¯ã‚¢ãƒƒãƒ—}
%
+% \begin{ZRnote}
+% \begin{macro}{\bxjs@phantomsection}
+% |hyperref| ãŒèª­ã¿è¾¼ã¾ã‚Œã¦ã„ã‚‹å ´åˆã« |\phantomsection| を実行ã™ã‚‹ã€‚
+% \begin{macrocode}
+\let\bxjs@phantomsection\relax
+\g@addto@macro\bxjs@begin@document@hook{%
+ \@ifpackageloaded{hyperref}{%
+ \let\bxjs@phantomsection\phantomsection
+ }{}%
+}
+% \end{macrocode}
+% \end{macro}
+% \end{ZRnote}
+%
% \subsection{表題}
%
% \begin{macro}{\title}
@@ -8288,8 +8303,15 @@
\fi
\columnseprule.4pt \columnsep 2\jsZw
\ifx\multicols\@undefined
-%<book|report> \twocolumn[\@makeschapterhead{\indexname}%
-%<book|report> \addcontentsline{toc}{chapter}{\indexname}]%
+% \end{macrocode}
+% \begin{ZRnote}
+% |hyperref| 使用時ã«ç´¢å¼•ã¸ã®ãƒªãƒ³ã‚¯ãŒæ­£å¸¸ã«ä½œã‚‰ã‚Œã‚‹ã‚ˆã†ã«ã€
+% |hyperref| ã®èª¬æ˜Žæ›¸ã®è§£èª¬ã«å¾“ã£ã¦ |\phantomsection| ã‚’é…ç½®ã—ãŸã€‚
+% \end{ZRnote}
+% \begin{macrocode}
+%<book|report> \twocolumn[\bxjs@phantomsection
+%<book|report> \addcontentsline{toc}{chapter}{\indexname}%
+%<book|report> \@makeschapterhead{\indexname}]%
%<!book&!report> \def\presectionname{}\def\postsectionname{}%
%<!book&!report> \twocolumn[\section*{\indexname}]%
\else
@@ -10847,6 +10869,56 @@
% \end{macrocode}
% \end{macro}
%
+% \paragraph{bmパッケージ対策}
+%
+% |\reDeclareMathAlphabet| ã‚’é©ç”¨ã—ãŸæ•°å¼è‹±å­—フォント命令ã¯
+% 通常ã®å ´åˆã¨ã¯å®šç¾©æ–‡ã®å½¢ãŒç•°ãªã‚‹ã€‚
+% ã“ã®ãŸã‚ |bm| パッケージを利用ã—㦠|\bm{\mathrm{A}}| ã‚’
+% 実行ã™ã‚‹ã¨ã‚¨ãƒ©ãƒ¼ãŒç™ºç”Ÿã™ã‚‹ã€‚
+% ã“れを回é¿ã™ã‚‹ãŸã‚ã€
+% 「|\bm| ã®å¼•æ•°ä¸­ã§ã¯æ•°å¼è‹±å­—フォントã®å’Œæ–‡é€£å‹•ã‚’無効ã«ã™ã‚‹ã€
+% ã“ã¨ã«ã™ã‚‹ã€‚
+%
+% |\reDeclareMathAlphabet| ã®é©ç”¨ã«ã‚ˆã‚Šä¾‹ãˆã° |\mathrm| ã¯
+% 以下ã®ã‚ˆã†ã«å¤‰æ›´ã•ã‚Œã‚‹ã€‚
+% \begin{itemize}
+% \item é©ç”¨å‰ã¯ |\mathrm| ã®ä¸€å›žå±•é–‹ã¯ %
+% |\protect\|[|mathrm|\verb*| |] ã§ã‚る。
+% \item é©ç”¨å¾Œã¯ |\mathrm| ã®ä¸€å›žå±•é–‹ãŒ %
+% |\protect\|[|mathrm|\verb*| |] ã«ãªã‚‹ã€‚
+% \item |\|[|mathrm|\verb*| |] ã®ä¸€å›žå±•é–‹ã¯ä»¥ä¸‹ã®ã‚ˆã†ã«ãªã‚‹ã€‚\\
+% |\DualLang@mathalph@bet{\RDMAorg@mathrm}{\RDMAorg@mathmc}|
+% \item |\RDMAorg@mathrm| ã®ä¸€å›žå±•é–‹ã¯ |\|[|mathrm|\verb*| |] ã«ãªã‚‹ã€‚
+% \end{itemize}
+%
+% \begin{macro}{\bxjs@patch@RDMA@for@bm}
+% |\reDeclareMathAlphabet| ã®æ©Ÿèƒ½ã«å¯¾ã—㦠|bm| パッケージ対策ã®
+% パッãƒã‚’当ã¦ã‚‹ã€‚
+% \begin{macrocode}
+\@onlypreamble\bxjs@patch@RDMA@for@bm
+\def\bxjs@patch@RDMA@for@bm{%
+% \end{macrocode}
+% 実際ã«æ”¹å¤‰ã™ã‚‹ã®ã¯ |\DualLang@mathalph@bet| ã§ã‚る。
+% \begin{macrocode}
+ \let\bxjs@org@DualLang@mathalph@bet\DualLang@mathalph@bet
+ \def\DualLang@mathalph@bet{%
+% \end{macrocode}
+% |\bm| ã®å¼•æ•°ã®ä¸­
+% (ãã“ã§ã¯ |\bm| ㌠|\@firstofone| ã«ç­‰ç½®ã•ã‚Œã¦ã„ã‚‹ã®ã§
+% ã“れを判定ã«åˆ©ç”¨ã™ã‚‹ï¼‰
+% ã§ã¯ã€|\DualLang@mathalph@bet| ã‚’ |\@firstoftwo| ã®å‹•ä½œã«å¤‰ãˆã‚‹ã€‚
+% ã“ã‚Œã«ã‚ˆã‚Šã€|\mathrm| ã®
+% (|\protect| を無視ã™ã‚‹å ´åˆã®ï¼‰
+% 先頭完全展開形ãŒã€ã€Œé©ç”¨ã€å‰ã®ã‚‚ã®ã¨ä¸€è‡´ã™ã‚‹ã€‚
+% ã“ã®ãŸã‚ |\bm| ã¯ã€Œé©ç”¨ã€ã®å½±éŸ¿ã‚’å—ã‘ãšã«æ­£å¸¸å‹•ä½œã§ãる。
+% \begin{macrocode}
+ \ifx\bm\@firstofone \expandafter\@firstoftwo
+ \else \expandafter\bxjs@org@DualLang@mathalph@bet
+ \fi}%
+}
+% \end{macrocode}
+% \end{macro}
+%
%^^A----------------
% \subsection{{\pTeX}用設定}
%
@@ -11124,19 +11196,12 @@
\g@addto@macro\bxjs@begin@document@hook{%
\ifx\reDeclareMathAlphabet\@undefined\else
% \end{macrocode}
-% |\reDeclareMathAlphabet| ã‚’é©ç”¨ã—ãŸæ•°å¼è‹±å­—フォント命令ã¯{\LaTeX}ã®
-% 通常ã®å‘½ä»¤ã¨ã¯å®šç¾©æ–‡ã®å½¢ãŒç•°ãªã‚‹ã€‚
-% ã“ã®ãŸã‚ |bm| パッケージを読ã¿è¾¼ã‚“㧠|\bm{\mathrm{A}}| ã‚’
-% 実行ã™ã‚‹ã¨ã‚¨ãƒ©ãƒ¼ãŒç™ºç”Ÿã™ã‚‹ã€‚
-% ã“れを回é¿ã™ã‚‹ãŸã‚ã®æš«å®šå¯¾å¿œã¨ã—ã¦ã€|bm| ãŒèª­ã¿è¾¼ã¾ã‚ŒãŸå ´åˆã¯
-% æ•°å¼è‹±å­—フォントã®å’Œæ–‡é€£å‹•ã‚’無効ã«ã™ã‚‹ã€‚
-% \TODO ユーザãŒæ•°å¼è‹±å­—フォントã®å’Œæ–‡é€£å‹•ã‚’制御ã§ãるよã†ã«ã™ã‚‹ã€‚
+% |bm| パッケージãŒèª­è¾¼æ¸ˆã§ã‚ã‚Œã°ãƒ‘ッãƒã‚’é©ç”¨ã™ã‚‹ã€‚
% \begin{macrocode}
- \@ifpackageloaded{bm}{}{%else
+ \@ifpackageloaded{bm}{\bxjs@patch@RDMA@for@bm}{}%
\reDeclareMathAlphabet{\mathrm}{\@mathrm}{\@mathmc}%
\reDeclareMathAlphabet{\mathbf}{\@mathbf}{\@mathgt}%
\reDeclareMathAlphabet{\mathsf}{\@mathsf}{\@mathgt}%
- }%
\fi}
\fi
% \end{macrocode}
@@ -11544,6 +11609,7 @@
\@ltj@match@familytrue
\fi
\g@addto@macro\bxjs@begin@document@hook{%
+ \@ifpackageloaded{bm}{\bxjs@patch@RDMA@for@bm}{}%
\reDeclareMathAlphabet{\mathrm}{\mathrm}{\mathmc}%
\reDeclareMathAlphabet{\mathbf}{\mathbf}{\mathgt}%
\reDeclareMathAlphabet{\mathsf}{\mathsf}{\mathgt}}%
diff --git a/Master/texmf-dist/source/latex/catppuccinpalette/catppuccinpalette.dtx b/Master/texmf-dist/source/latex/catppuccinpalette/catppuccinpalette.dtx
index f74df5dd959..16d8a60e479 100644
--- a/Master/texmf-dist/source/latex/catppuccinpalette/catppuccinpalette.dtx
+++ b/Master/texmf-dist/source/latex/catppuccinpalette/catppuccinpalette.dtx
@@ -1,21 +1,26 @@
% \iffalse meta-comment
%
-% Copyright (C) 2024 by Lukas Heindl <oss.heindl+latex@protonmail.com>
-% ---------------------------------------------------------------------------
-% This work may be distributed and/or modified under the
-% conditions of the LaTeX Project Public License, either version 1.3
-% of this license or (at your option) any later version.
-% The latest version of this license is in
-% http://www.latex-project.org/lppl.txt
-% and version 1.3 or later is part of all distributions of LaTeX
-% version 2005/12/01 or later.
-%
-% This work has the LPPL maintenance status `maintained'.
-%
-% The Current Maintainer of this work is Lukas Heindl.
-%
-% This work consists of the files catppuccinpalette.dtx and catppuccinpalette.ins
-% and the derived filebase catppuccinpalette.sty.
+% MIT License
+%
+% Copyright (c) 2024 Catppuccin
+%
+% Permission is hereby granted, free of charge, to any person obtaining a copy
+% of this software and associated documentation files (the "Software"), to deal
+% in the Software without restriction, including without limitation the rights
+% to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+% copies of the Software, and to permit persons to whom the Software is
+% furnished to do so, subject to the following conditions:
+%
+% The above copyright notice and this permission notice shall be included in all
+% copies or substantial portions of the Software.
+%
+% THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+% IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+% FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+% AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+% LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+% OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+% SOFTWARE.
%
% \fi
%
@@ -26,7 +31,7 @@
%<package>\NeedsTeXFormat{LaTeX2e}[1999/12/01]
%<package>\ProvidesPackage{catppuccinpalette}
%<*package>
- [2024/05/22 v1.0.2 catppuccin xcolor palette]
+ [2024/08/13 v1.1.0 catppuccin xcolor palette]
%</package>
%
%<*driver>
@@ -69,13 +74,15 @@
% \changes{v1.0.0}{2024/02/27}{First full release}
% \changes{v1.0.1}{2024/05/19}{Make fit for CTAN}
% \changes{v1.0.2}{2024/05/19}{Fix colors in documentation}
+% \changes{v1.1.0}{2024/08/13}{Move to / Merge with official catppuccin. Thereby deprecate colors with |Cat| prefix. Subject to removal in the future}
%
% \DoNotIndex{\newcommand,\newenvironment,\color,\colorlet,\def,\fi,\RequirePackage,\ProvidesPackage,\ProcessPgfOptions,\preparecolorset,\pgfkeys,\pagecolor,\newif,\NeedsTeXFormat}
%
+% \providecommand*\pkg{\textsf}
% \providecommand*{\url}{\texttt}
% \GetFileInfo{catppuccinpalette.dtx}
% \title{The \textsf{catppuccinPalette} package}
-% \author{Lukas Heindl \\ \url{oss.heindl+latex@protonmail.com} \\ \url{https://github.com/atticus-sullivan/catpuccinPalette}}
+% \author{Lukas Heindl \\ \url{oss.heindl+latex@protonmail.com} \\ \url{https://github.com/catppuccin/latex}}
% \date{\fileversion~from \filedate}
%
% \maketitle
@@ -95,14 +102,14 @@
%
% Load via |\usepackage{catppuccinpalette}|
%
-% Just use the new colors (prefixed with \verb|Cat<Style>|) like normal xcolors.
+% Just use the new colors (prefixed with \verb|Ctp<Style>|) like normal xcolors.
% In addition to the usual colors of the palette, this package defines some
% colors according to the
% style guide\footnote{\url{https://github.com/catppuccin/catppuccin/blob/main/docs/style-guide.md}}
% for ease of use.
%
% This package also allows you to set a specific style which sets the shortened
-% color names (prefixed only with \verb|Cat|) to the selected style (allows for
+% color names (prefixed only with \verb|Ctp|) to the selected style (allows for
% easy switching style) via the package option \verb|style|.
%
% This package loads xcolor (without options) so if you want to set some xcolor
@@ -113,16 +120,21 @@
% \emph{Option} & \emph{Description}
% \\\toprule
% \verb|style| &
-% set the style used by the shortened prefix (\verb|Cat|). Possible values:
+% set the style used by the shortened prefix (\verb|Ctp|). Possible values:
% \verb|Latte| (default+initial), \verb|latte|, \verb|Frappe|, \verb|frappe|,
-% \verb|Mocha|, \verb|mocha|
+% \verb|Mocha|, \verb|mocha|, \verb|Macchiato|, \verb|macchiato|
+% \\
+% &
+% As a shortcut, you can also just use e.\,g.\,
+% |\usepackage[latte]{catppuccinPalette}| as a shorthand for
+% |\usepackage[style=latte]{catppuccinPalette}|
% \\
% \verb|textcolor| &
-% set the default textcolor of the document to \verb|CatText|. Possible values:
+% set the default textcolor of the document to \verb|CtpText|. Possible values:
% \verb|false| (default+initial), \verb|true|
% \\
% \verb|pagecolor| &
-% set the pagecolor of the document to \verb|CatBackground|. Possible values:
+% set the pagecolor of the document to \verb|CtpBackground|. Possible values:
% \verb|false| (default+initial), \verb|true|
% \\\midrule
% \verb|styleAll| &
@@ -130,50 +142,64 @@
% \\\bottomrule
% \end{tabularx}
%
+% \subsubsection{Change settings mid-document}
+% \DescribeMacro{\CtpReinit} |\CtpReinit[opts]|
+%
+% This command allows to reinitialize this package. All previous configuration
+% options will be kept. In particular this allows to change the active
+% style/flavor mid-document. Note that if you decided this package should
+% change the background color when loading the package and only do
+% |\CptReinit[style=<another style>]|, then the background color will also be
+% adjusted on reinitialization.
+%
+% The command processes the same options like the ones you can pass when
+% loading the package (see documentation above).
+%
% \subsection{Colors}
+% \textbf{Note:} The colors with the prefix |Cat| are deprecated and will be removed in a future version!
% \newcommand{\showCol}[1]{\raisebox{0.5ex}{\fcolorbox{black}{#1}{\hspace{1em}}} #1}
% \foreach \Style in {Latte,Frappe,Macchiato,Mocha}{
% \subsubsection{Style \texttt{\Style}}
% \begin{multicols}{2}
-% \showCol{Cat\Style Blue}\par
-% \showCol{Cat\Style Rosewater}\par
-% \showCol{Cat\Style Flamingo}\par
-% \showCol{Cat\Style Pink}\par
-% \showCol{Cat\Style Mauve}\par
-% \showCol{Cat\Style Red}\par
-% \showCol{Cat\Style Maroon}\par
-% \showCol{Cat\Style Peach}\par
-% \showCol{Cat\Style Yellow}\par
-% \showCol{Cat\Style Green}\par
-% \showCol{Cat\Style Teal}\par
-% \showCol{Cat\Style Sky}\par
-% \showCol{Cat\Style Sapphire}\par
-% \showCol{Cat\Style Blue}\par
-% \showCol{Cat\Style Lavender}\par
-% \showCol{Cat\Style Text}\par
-% \showCol{Cat\Style Subtext1}\par
-% \showCol{Cat\Style Subtext0}\par
-% \showCol{Cat\Style Overlay2}\par
-% \showCol{Cat\Style Overlay1}\par
-% \showCol{Cat\Style Overlay0}\par
-% \showCol{Cat\Style Surface2}\par
-% \showCol{Cat\Style Surface1}\par
-% \showCol{Cat\Style Surface0}\par
-% \showCol{Cat\Style Base}\par
-% \showCol{Cat\Style Mantle}\par
-% \showCol{Cat\Style Crust}\par
+% \showCol{Ctp\Style Blue}\par
+% \showCol{Ctp\Style Rosewater}\par
+% \showCol{Ctp\Style Flamingo}\par
+% \showCol{Ctp\Style Pink}\par
+% \showCol{Ctp\Style Mauve}\par
+% \showCol{Ctp\Style Red}\par
+% \showCol{Ctp\Style Maroon}\par
+% \showCol{Ctp\Style Peach}\par
+% \showCol{Ctp\Style Yellow}\par
+% \showCol{Ctp\Style Green}\par
+% \showCol{Ctp\Style Teal}\par
+% \showCol{Ctp\Style Sky}\par
+% \showCol{Ctp\Style Sapphire}\par
+% \showCol{Ctp\Style Blue}\par
+% \showCol{Ctp\Style Lavender}\par
+% \showCol{Ctp\Style Text}\par
+% \showCol{Ctp\Style Subtext1}\par
+% \showCol{Ctp\Style Subtext0}\par
+% \showCol{Ctp\Style Overlay2}\par
+% \showCol{Ctp\Style Overlay1}\par
+% \showCol{Ctp\Style Overlay0}\par
+% \showCol{Ctp\Style Surface2}\par
+% \showCol{Ctp\Style Surface1}\par
+% \showCol{Ctp\Style Surface0}\par
+% \showCol{Ctp\Style Base}\par
+% \showCol{Ctp\Style Mantle}\par
+% \showCol{Ctp\Style Crust}\par
% \end{multicols}
%
% Some basic colors according to the style guide:
%
% \begin{multicols}{2}
-% \showCol{Cat\Style Background}\par
-% \showCol{Cat\Style Link}\par
+% \showCol{Ctp\Style Background}\par
+% \showCol{Ctp\Style Link}\par
% \phantom{}\par
% \columnbreak
-% \showCol{Cat\Style Success}\par
-% \showCol{Cat\Style Warning}\par
-% \showCol{Cat\Style Error}\par
+% \showCol{Ctp\Style Success}\par
+% \showCol{Ctp\Style Warning}\par
+% \showCol{Ctp\Style Error}\par
% \end{multicols}
%
% }
@@ -201,16 +227,24 @@
% \end{macrocode}
% Define the package option keys
% \begin{macrocode}
+ Latte/.style={style=Latte},
+ latte/.style={style=Latte},
+ Frappe/.style={style=Frappe},
+ frappe/.style={style=Frappe},
+ Macchiato/.style={style=Macchiato},
+ macchiato/.style={style=Macchiato},
+ Mocha/.style={style=Mocha},
+ mocha/.style={style=Mocha},
style/.is choice,
style/.value required,
style/Latte/.code = {\def\catppuccinpalette@style{Latte}},
- style/latte/.forward to = /catppuccinPalette/style/Latte,
+ style/latte/.style = {style=Latte},
style/Frappe/.code = {\def\catppuccinpalette@style{Frappe}},
- style/frappe/.forward to = /catppuccinPalette/style/frappe,
+ style/frappe/.style = {style=Frappe},
style/Macchiato/.code = {\def\catppuccinpalette@style{Macchiato}},
- style/macchiato/.forward to = /catppuccinPalette/style/Macchiato,
+ style/macchiato/.style = {style=Macchiato},
style/Mocha/.code = {\def\catppuccinpalette@style{Mocha}},
- style/mocha/.forward to = /catppuccinPalette/style/Mocha,
+ style/mocha/.style = {style=Mocha},
textcolor/.is if = catppuccinpalette@textcolor,
textcolor/.default = true,
pagecolor/.is if = catppuccinpalette@pagecolor,
@@ -223,7 +257,7 @@
pagecolor = false,
style = Latte,
}
-\ProcessPgfOptions*
+\ProcessPgfOptions{catppuccinPalette}
% \end{macrocode}
% Define the \emph{Latte} colorset
% \begin{macrocode}
@@ -255,14 +289,48 @@
Mantle,230,233,239/E6E9EF;%
Crust,220,224,232/DCE0E8%
}
-% \end{macrocode}
-% Define colors according to the catppuccin style guide
-% \begin{macrocode}
\colorlet{CatLatteBackground}{CatLatteBase}
\colorlet{CatLatteLink}{CatLatteBlue}
\colorlet{CatLatteSuccess}{CatLatteGreen}
\colorlet{CatLatteWarning}{CatLatteYellow}
\colorlet{CatLatteError}{CatLatteRed}
+
+\preparecolorset{RGB/HTML}{CtpLatte}{}{%
+ Rosewater,220,138,120/DC8A78;%
+ Flamingo,221,120,120/DD7878;%
+ Pink,234,118,203/EA76CB;%
+ Mauve,136,57,239/8839EF;%
+ Red,210,15,57/D20F39;%
+ Maroon,230,69,83/E64553;%
+ Peach,254,100,11/FE640B;%
+ Yellow,223,142,29/DF8E1D;%
+ Green,64,160,43/40A02B;%
+ Teal,23,146,153/179299;%
+ Sky,4,165,229/04A5E5;%
+ Sapphire,32,159,181/209FB5;%
+ Blue,30,102,245/1E66F5;%
+ Lavender,114,135,253/7287FD;%
+ Text,76,79,105/4C4F69;%
+ Subtext1,92,95,119/5C5F77;%
+ Subtext0,108,111,133/6C6F85;%
+ Overlay2,124,127,147/7C7F93;%
+ Overlay1,140,143,161/8C8FA1;%
+ Overlay0,156,160,176/9CA0B0;%
+ Surface2,172,176,190/ACB0BE;%
+ Surface1,188,192,204/BCC0CC;%
+ Surface0,204,208,218/CCD0DA;%
+ Base,239,241,245/EFF1F5;%
+ Mantle,230,233,239/E6E9EF;%
+ Crust,220,224,232/DCE0E8%
+}
+% \end{macrocode}
+% Define colors according to the catppuccin style guide
+% \begin{macrocode}
+\colorlet{CtpLatteBackground}{CtpLatteBase}
+\colorlet{CtpLatteLink}{CtpLatteBlue}
+\colorlet{CtpLatteSuccess}{CtpLatteGreen}
+\colorlet{CtpLatteWarning}{CtpLatteYellow}
+\colorlet{CtpLatteError}{CtpLatteRed}
% \end{macrocode}
% Define the styles \emph{Frappe}, \emph{Macchiato} and \emph{Mocha} accordingly
% \begin{macrocode}
@@ -299,6 +367,41 @@
\colorlet{CatFrappeSuccess}{CatFrappeGreen}
\colorlet{CatFrappeWarning}{CatFrappeYellow}
\colorlet{CatFrappeError}{CatFrappeRed}
+
+\preparecolorset{RGB/HTML}{CtpFrappe}{}{%
+ Rosewater,242,213,207/F2D5CF;%
+ Flamingo,238,190,190/EEBEBE;%
+ Pink,244,184,228/F4B8E4;%
+ Mauve,202,158,230/CA9EE6;%
+ Red,231,130,132/E78284;%
+ Maroon,234,153,156/EA999C;%
+ Peach,239,159,118/EF9F76;%
+ Yellow,229,200,144/E5C890;%
+ Green,166,209,137/A6D189;%
+ Teal,129,200,190/81C8BE;%
+ Sky,153,209,219/99D1DB;%
+ Sapphire,133,193,220/85C1DC;%
+ Blue,140,170,238/8CAAEE;%
+ Lavender,186,187,241/BABBF1;%
+ Text,198,208,245/C6D0F5;%
+ Subtext1,181,191,226/B5BFE2;%
+ Subtext0,165,173,206/A5ADCE;%
+ Overlay2,148,156,187/949CBB;%
+ Overlay1,131,139,167/838BA7;%
+ Overlay0,115,121,148/737994;%
+ Surface2,98,104,128/626880;%
+ Surface1,81,87,109/51576D;%
+ Surface0,65,69,89/414559;%
+ Base,48,52,70/303446;%
+ Mantle,41,44,60/292C3C;%
+ Crust,35,38,52/232634%
+}
+\colorlet{CtpFrappeBackground}{CtpFrappeBase}
+\colorlet{CtpFrappeLink}{CtpFrappeBlue}
+\colorlet{CtpFrappeSuccess}{CtpFrappeGreen}
+\colorlet{CtpFrappeWarning}{CtpFrappeYellow}
+\colorlet{CtpFrappeError}{CtpFrappeRed}
+
\preparecolorset{RGB/HTML}{CatMacchiato}{}{%
Rosewater,244,219,214/F4DBD6;%
Flamingo,240,198,198/F0C6C6;%
@@ -332,6 +435,41 @@
\colorlet{CatMacchiatoSuccess}{CatMacchiatoGreen}
\colorlet{CatMacchiatoWarning}{CatMacchiatoYellow}
\colorlet{CatMacchiatoError}{CatMacchiatoRed}
+
+\preparecolorset{RGB/HTML}{CtpMacchiato}{}{%
+ Rosewater,244,219,214/F4DBD6;%
+ Flamingo,240,198,198/F0C6C6;%
+ Pink,245,189,230/F5BDE6;%
+ Mauve,198,160,246/C6A0F6;%
+ Red,237,135,150/ED8796;%
+ Maroon,238,153,160/EE99A0;%
+ Peach,245,169,127/F5A97F;%
+ Yellow,238,212,159/EED49F;%
+ Green,166,218,149/A6DA95;%
+ Teal,139,213,202/8BD5CA;%
+ Sky,145,215,227/91D7E3;%
+ Sapphire,125,196,228/7DC4E4;%
+ Blue,138,173,244/8AADF4;%
+ Lavender,183,189,248/B7BDF8;%
+ Text,202,211,245/CAD3F5;%
+ Subtext1,184,192,224/B8C0E0;%
+ Subtext0,165,173,203/A5ADCB;%
+ Overlay2,147,154,183/939AB7;%
+ Overlay1,128,135,162/8087A2;%
+ Overlay0,110,115,141/6E738D;%
+ Surface2,91,96,120/5B6078;%
+ Surface1,73,77,100/494D64;%
+ Surface0,54,58,79/363A4F;%
+ Base,36,39,58/24273A;%
+ Mantle,30,32,48/1E2030;%
+ Crust,24,25,38/181926%
+}
+\colorlet{CtpMacchiatoBackground}{CtpMacchiatoBase}
+\colorlet{CtpMacchiatoLink}{CtpMacchiatoBlue}
+\colorlet{CtpMacchiatoSuccess}{CtpMacchiatoGreen}
+\colorlet{CtpMacchiatoWarning}{CtpMacchiatoYellow}
+\colorlet{CtpMacchiatoError}{CtpMacchiatoRed}
+
\preparecolorset{RGB/HTML}{CatMocha}{}{%
Rosewater,245,224,220/F5E0DC;%
Flamingo,242,205,205/F2CDCD;%
@@ -360,57 +498,139 @@
Mantle,24,24,37/181825;%
Crust,17,17,27/11111B%
}
-% \end{macrocode}
-% Define shortcuts for active style
-% \begin{macrocode}
\colorlet{CatMochaBackground}{CatMochaBase}
\colorlet{CatMochaLink}{CatMochaBlue}
\colorlet{CatMochaSuccess}{CatMochaGreen}
\colorlet{CatMochaWarning}{CatMochaYellow}
\colorlet{CatMochaError}{CatMochaRed}
-\colorlet{CatRosewater}{Cat\catppuccinpalette@style Rosewater}
-\colorlet{CatFlamingo}{Cat\catppuccinpalette@style Flamingo}
-\colorlet{CatPink}{Cat\catppuccinpalette@style Pink}
-\colorlet{CatMauve}{Cat\catppuccinpalette@style Mauve}
-\colorlet{CatRed}{Cat\catppuccinpalette@style Red}
-\colorlet{CatMaroon}{Cat\catppuccinpalette@style Maroon}
-\colorlet{CatPeach}{Cat\catppuccinpalette@style Peach}
-\colorlet{CatYellow}{Cat\catppuccinpalette@style Yellow}
-\colorlet{CatGreen}{Cat\catppuccinpalette@style Green}
-\colorlet{CatTeal}{Cat\catppuccinpalette@style Teal}
-\colorlet{CatSky}{Cat\catppuccinpalette@style Sky}
-\colorlet{CatSapphire}{Cat\catppuccinpalette@style Sapphire}
-\colorlet{CatBlue}{Cat\catppuccinpalette@style Blue}
-\colorlet{CatLavender}{Cat\catppuccinpalette@style Lavender}
-\colorlet{CatText}{Cat\catppuccinpalette@style Text}
-\colorlet{CatSubtext1}{Cat\catppuccinpalette@style Subtext1}
-\colorlet{CatSubtext0}{Cat\catppuccinpalette@style Subtext0}
-\colorlet{CatOverlay2}{Cat\catppuccinpalette@style Overlay2}
-\colorlet{CatOverlay1}{Cat\catppuccinpalette@style Overlay1}
-\colorlet{CatOverlay0}{Cat\catppuccinpalette@style Overlay0}
-\colorlet{CatSurface2}{Cat\catppuccinpalette@style Surface2}
-\colorlet{CatSurface1}{Cat\catppuccinpalette@style Surface1}
-\colorlet{CatSurface0}{Cat\catppuccinpalette@style Surface0}
-\colorlet{CatBase}{Cat\catppuccinpalette@style Base}
-\colorlet{CatMantle}{Cat\catppuccinpalette@style Mantle}
-\colorlet{CatCrust}{Cat\catppuccinpalette@style Crust}
-\colorlet{CatBackground}{Cat\catppuccinpalette@style Base}
-\colorlet{CatLink}{Cat\catppuccinpalette@style Blue}
-\colorlet{CatSuccess}{Cat\catppuccinpalette@style Green}
-\colorlet{CatWarning}{Cat\catppuccinpalette@style Yellow}
-\colorlet{CatError}{Cat\catppuccinpalette@style Red}
+
+\preparecolorset{RGB/HTML}{CtpMocha}{}{%
+ Rosewater,245,224,220/F5E0DC;%
+ Flamingo,242,205,205/F2CDCD;%
+ Pink,245,194,231/F5C2E7;%
+ Mauve,203,166,247/CBA6F7;%
+ Red,243,139,168/F38BA8;%
+ Maroon,235,160,172/EBA0AC;%
+ Peach,250,179,135/FAB387;%
+ Yellow,249,226,175/F9E2AF;%
+ Green,166,227,161/A6E3A1;%
+ Teal,148,226,213/94E2D5;%
+ Sky,137,220,235/89DCEB;%
+ Sapphire,116,199,236/74C7EC;%
+ Blue,137,180,250/89B4FA;%
+ Lavender,180,190,254/B4BEFE;%
+ Text,205,214,244/CDD6F4;%
+ Subtext1,186,194,222/BAC2DE;%
+ Subtext0,166,173,200/A6ADC8;%
+ Overlay2,147,153,178/9399B2;%
+ Overlay1,127,132,156/7F849C;%
+ Overlay0,108,112,134/6C7086;%
+ Surface2,88,91,112/585B70;%
+ Surface1,69,71,90/45475A;%
+ Surface0,49,50,68/313244;%
+ Base,30,30,46/1E1E2E;%
+ Mantle,24,24,37/181825;%
+ Crust,17,17,27/11111B%
+}
+\colorlet{CtpMochaBackground}{CtpMochaBase}
+\colorlet{CtpMochaLink}{CtpMochaBlue}
+\colorlet{CtpMochaSuccess}{CtpMochaGreen}
+\colorlet{CtpMochaWarning}{CtpMochaYellow}
+\colorlet{CtpMochaError}{CtpMochaRed}
+
+% \end{macrocode}
+% Define shortcuts for active style (legacy part)
+% \begin{macrocode}
+\colorlet{CatRosewater}{Ctp\catppuccinpalette@style Rosewater}
+\colorlet{CatFlamingo}{Ctp\catppuccinpalette@style Flamingo}
+\colorlet{CatPink}{Ctp\catppuccinpalette@style Pink}
+\colorlet{CatMauve}{Ctp\catppuccinpalette@style Mauve}
+\colorlet{CatRed}{Ctp\catppuccinpalette@style Red}
+\colorlet{CatMaroon}{Ctp\catppuccinpalette@style Maroon}
+\colorlet{CatPeach}{Ctp\catppuccinpalette@style Peach}
+\colorlet{CatYellow}{Ctp\catppuccinpalette@style Yellow}
+\colorlet{CatGreen}{Ctp\catppuccinpalette@style Green}
+\colorlet{CatTeal}{Ctp\catppuccinpalette@style Teal}
+\colorlet{CatSky}{Ctp\catppuccinpalette@style Sky}
+\colorlet{CatSapphire}{Ctp\catppuccinpalette@style Sapphire}
+\colorlet{CatBlue}{Ctp\catppuccinpalette@style Blue}
+\colorlet{CatLavender}{Ctp\catppuccinpalette@style Lavender}
+\colorlet{CatText}{Ctp\catppuccinpalette@style Text}
+\colorlet{CatSubtext1}{Ctp\catppuccinpalette@style Subtext1}
+\colorlet{CatSubtext0}{Ctp\catppuccinpalette@style Subtext0}
+\colorlet{CatOverlay2}{Ctp\catppuccinpalette@style Overlay2}
+\colorlet{CatOverlay1}{Ctp\catppuccinpalette@style Overlay1}
+\colorlet{CatOverlay0}{Ctp\catppuccinpalette@style Overlay0}
+\colorlet{CatSurface2}{Ctp\catppuccinpalette@style Surface2}
+\colorlet{CatSurface1}{Ctp\catppuccinpalette@style Surface1}
+\colorlet{CatSurface0}{Ctp\catppuccinpalette@style Surface0}
+\colorlet{CatBase}{Ctp\catppuccinpalette@style Base}
+\colorlet{CatMantle}{Ctp\catppuccinpalette@style Mantle}
+\colorlet{CatCrust}{Ctp\catppuccinpalette@style Crust}
+\colorlet{CatBackground}{Ctp\catppuccinpalette@style Base}
+\colorlet{CatLink}{Ctp\catppuccinpalette@style Blue}
+\colorlet{CatSuccess}{Ctp\catppuccinpalette@style Green}
+\colorlet{CatWarning}{Ctp\catppuccinpalette@style Yellow}
+\colorlet{CatError}{Ctp\catppuccinpalette@style Red}
+
% \end{macrocode}
-% Set (only initial) pagecolor according to the style guide if the user wants this
+% New command which parses the same options like the package. Can be used to e.\,g.\, reset/reinit the selected style.
% \begin{macrocode}
-\ifcatppuccinpalette@pagecolor
- \pagecolor{CatBackground}
-\fi
+\NewDocumentCommand\CtpReinit{O{}}{%
+ \pgfkeys{%
+ /catppuccinPalette/.cd,%
+ #1%
+ }%
+% \end{macrocode}
+% Define shortcuts for active style
+% \begin{macrocode}
+ \colorlet{CtpRosewater}{Ctp\catppuccinpalette@style Rosewater}%
+ \colorlet{CtpFlamingo}{Ctp\catppuccinpalette@style Flamingo}%
+ \colorlet{CtpPink}{Ctp\catppuccinpalette@style Pink}%
+ \colorlet{CtpMauve}{Ctp\catppuccinpalette@style Mauve}%
+ \colorlet{CtpRed}{Ctp\catppuccinpalette@style Red}%
+ \colorlet{CtpMaroon}{Ctp\catppuccinpalette@style Maroon}%
+ \colorlet{CtpPeach}{Ctp\catppuccinpalette@style Peach}%
+ \colorlet{CtpYellow}{Ctp\catppuccinpalette@style Yellow}%
+ \colorlet{CtpGreen}{Ctp\catppuccinpalette@style Green}%
+ \colorlet{CtpTeal}{Ctp\catppuccinpalette@style Teal}%
+ \colorlet{CtpSky}{Ctp\catppuccinpalette@style Sky}%
+ \colorlet{CtpSapphire}{Ctp\catppuccinpalette@style Sapphire}%
+ \colorlet{CtpBlue}{Ctp\catppuccinpalette@style Blue}%
+ \colorlet{CtpLavender}{Ctp\catppuccinpalette@style Lavender}%
+ \colorlet{CtpText}{Ctp\catppuccinpalette@style Text}%
+ \colorlet{CtpSubtext1}{Ctp\catppuccinpalette@style Subtext1}%
+ \colorlet{CtpSubtext0}{Ctp\catppuccinpalette@style Subtext0}%
+ \colorlet{CtpOverlay2}{Ctp\catppuccinpalette@style Overlay2}%
+ \colorlet{CtpOverlay1}{Ctp\catppuccinpalette@style Overlay1}%
+ \colorlet{CtpOverlay0}{Ctp\catppuccinpalette@style Overlay0}%
+ \colorlet{CtpSurface2}{Ctp\catppuccinpalette@style Surface2}%
+ \colorlet{CtpSurface1}{Ctp\catppuccinpalette@style Surface1}%
+ \colorlet{CtpSurface0}{Ctp\catppuccinpalette@style Surface0}%
+ \colorlet{CtpBase}{Ctp\catppuccinpalette@style Base}%
+ \colorlet{CtpMantle}{Ctp\catppuccinpalette@style Mantle}%
+ \colorlet{CtpCrust}{Ctp\catppuccinpalette@style Crust}%
+ \colorlet{CtpBackground}{Ctp\catppuccinpalette@style Base}%
+ \colorlet{CtpLink}{Ctp\catppuccinpalette@style Blue}%
+ \colorlet{CtpSuccess}{Ctp\catppuccinpalette@style Green}%
+ \colorlet{CtpWarning}{Ctp\catppuccinpalette@style Yellow}%
+ \colorlet{CtpError}{Ctp\catppuccinpalette@style Red}%
+% \end{macrocode}
+% Set pagecolor according to the style guide if the user wants this
+% \begin{macrocode}
+\ifcatppuccinpalette@pagecolor%
+ \pagecolor{CtpBackground}%
+\fi%
% \end{macrocode}
% Set textcolor according to the style guide if the user wants this
% \begin{macrocode}
-\ifcatppuccinpalette@textcolor
- \color{CatText}
-\fi
+\ifcatppuccinpalette@textcolor%
+ \color{CtpText}%
+\fi%
+% \end{macrocode}
+% \begin{macrocode}
+}
+\CtpReinit[]
% \end{macrocode}
\endinput
%
diff --git a/Master/texmf-dist/source/latex/catppuccinpalette/catppuccinpalette.ins b/Master/texmf-dist/source/latex/catppuccinpalette/catppuccinpalette.ins
index c93b929dcd9..2e44fa2b5f9 100644
--- a/Master/texmf-dist/source/latex/catppuccinpalette/catppuccinpalette.ins
+++ b/Master/texmf-dist/source/latex/catppuccinpalette/catppuccinpalette.ins
@@ -1,20 +1,24 @@
-%% Copyright (C) 2024 by Lukas Heindl <oss.heindl+latex@protonmail.com>
-%% --------------------------------------------------------------------------
-%% This work may be distributed and/or modified under the
-%% conditions of the LaTeX Project Public License, either version 1.3
-%% of this license or (at your option) any later version.
-%% The latest version of this license is in
-%% http://www.latex-project.org/lppl.txt
-%% and version 1.3 or later is part of all distributions of LaTeX
-%% version 2005/12/01 or later.
-%%
-%% This work has the LPPL maintenance status `maintained'.
-%%
-%% The Current Maintainer of this work is Lukas Heindl.
-%%
-%% This work consists of the files catppuccinpalette.dtx and catppuccinpalette.ins
-%% and the derived filebase catppuccinpalette.sty.
-%%
+%% MIT License
+%%
+%% Copyright (c) 2021 Catppuccin
+%%
+%% Permission is hereby granted, free of charge, to any person obtaining a copy
+%% of this software and associated documentation files (the "Software"), to deal
+%% in the Software without restriction, including without limitation the rights
+%% to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+%% copies of the Software, and to permit persons to whom the Software is
+%% furnished to do so, subject to the following conditions:
+%%
+%% The above copyright notice and this permission notice shall be included in all
+%% copies or substantial portions of the Software.
+%%
+%% THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+%% IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+%% FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+%% AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+%% LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+%% OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+%% SOFTWARE.
\input docstrip.tex
\keepsilent
@@ -25,15 +29,25 @@
This is a generated file.
-Copyright (C) 2024 by Lukas Heindl <oss.heindl+latex@protonmail.com>
---------------------------------------------------------------------------
-This work may be distributed and/or modified under the
-conditions of the LaTeX Project Public License, either version 1.3
-of this license or (at your option) any later version.
-The latest version of this license is in
- http://www.latex-project.org/lppl.txt
-and version 1.3 or later is part of all distributions of LaTeX
-version 2005/12/01 or later.
+Copyright (c) 2021 Catppuccin
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
\endpreamble
diff --git a/Master/texmf-dist/source/latex/changebar/changebar.dtx b/Master/texmf-dist/source/latex/changebar/changebar.dtx
index 406ccf52903..58df74102c3 100644
--- a/Master/texmf-dist/source/latex/changebar/changebar.dtx
+++ b/Master/texmf-dist/source/latex/changebar/changebar.dtx
@@ -24,7 +24,7 @@
% and covered by LPPL is defined by the unpacking scripts (with
% extension .ins) which are part of the distribution.
% \fi
-% \CheckSum{2954}
+% \CheckSum{2948}
%
%\iffalse
% This file is built for \LaTeXe, so we make sure an error is
@@ -39,7 +39,7 @@
\ProvidesFile{changebar.dtx}
%</dtx>
%<+package>\ProvidesPackage{changebar}
- [2024/01/09 v3.7d Indicate changes with marginal bars]
+ [2024/07/17 v3.7e Indicate changes with marginal bars]
% \end{macrocode}
%
% \section{A driver for this document}
@@ -137,7 +137,10 @@
% \changes{v3.6e}{2023/08/13}{Added supprt for luaTeX}
% \changes{v3.7b}{2023/12/28}{Added a few lines that were inadvertantly removed}
% \changes{v3.7b}{2023/12/30}{the cb2-file use delimiting chars may
-% change meaning when they end up in the wrong situation}
+% change meaning when they end up in the wrong situation}
+% \changes{v3.7e}{2024/07/17}{The us of the character `;´ as a string
+% separator clashes with it's active variant when babel/french has
+% been loaded}
%
% \title{The Changebar package
% \thanks{This file has version number \fileversion,
@@ -229,9 +232,7 @@
% \changes{v3.6a}{2011/04/30}{XeTeX added}
% \item Xe\TeX
% \changes{3.6e}{2023/08/13}{luaTeX added}
-% \begin{changebar}
% \item lua\TeX
-% \end{changebar}
% \end{itemize}
% The drivers are represented in the normal typewriter method of
% typing these names, or by the same entirely in lower case.
@@ -752,7 +753,7 @@
% \item V\TeX
% \item PDF\TeX
% \item Xe\TeX
-% \cbstart\item luaTeX\cbend
+% \item luaTeX
% \end{itemize}
%
% The intent is that the driver names should be case-insensitive,
@@ -799,10 +800,17 @@
% \end{macrocode}
% Redefine the |\cb@pdfxy| macro to write point coordinates to the
% \file{.cb2} file.
-% \changes{v3.7b}{2023/12/30}{use ¨;¨ instead of ¨,¨ as delimiter}
+% \changes{v3.7b}{2023/12/30}{use ";" instead of "," as delimiter}
+% \changes{v3.7e}{2024/07/17}{Use "/" instead of ";" as delimiter}
% \begin{macrocode}
\gdef\cb@pdfxy##1##2##3##4##5{%
- \immediate\write\cb@writexy{##1.##2p##3;##4;##5}%
+% \end{macrocode}
+% \begin{changebar}
+% \begin{macrocode}
+ \immediate\write\cb@writexy{##1.##2p##3/##4/##5}%
+% \end{macrocode}
+% \end{changebar}
+% \begin{macrocode}
\expandafter\gdef\csname cb@##1.##2\endcsname{##3,##4,##5}}
\else\cb@pdftexerror\fi\fi\fi}
% \end{macrocode}
@@ -837,10 +845,17 @@
% \end{macrocode}
% Redefine the |\cb@pdfxy| macro to write point coordinates to the
% \file{.cb2} file.
-% \changes{v3.7b}{2023/12/30}{use ¨;¨ instead of ¨,¨ as delimiter}
+% \changes{v3.7b}{2023/12/30}{use ";" instead of "," as delimiter}
+% \changes{v3.7e}{2024/07/17}{Use "/" instead of ";" as delimiter}
% \begin{macrocode}
\gdef\cb@pdfxy##1##2##3##4##5{%
- \immediate\write\cb@writexy{##1.##2p##3;##4;##5}%
+% \end{macrocode}
+% \begin{changebar}
+% \begin{macrocode}
+ \immediate\write\cb@writexy{##1.##2p##3/##4/##5}%
+% \end{macrocode}
+% \end{changebar}
+% \begin{macrocode}
\expandafter\gdef\csname cb@##1.##2\endcsname{##3,##4,##5}}
\gdef\sec@nd@ftw@##1 ##2{##2}
\fi}
@@ -854,7 +869,6 @@
{You are not using XeLaTeX}}
% \end{macrocode}
%
-% \begin{changebar}
% \begin{macrocode}
\DeclareOption{luaTeX}{\cb@luatexcheck}
\DeclareOption{luatex}{\cb@luatexcheck}
@@ -877,10 +891,17 @@
% \end{macrocode}
% Redefine the |\cb@pdfxy| macro to write point coordinates to the
% \file{.cb2} file.
-% \changes{v3.7b}{2023/12/30}{use ¨;¨ instead of ¨,¨ as delimiter}
+% \changes{v3.7b}{2023/12/30}{use ";" instead of ",¨ as delimiter}
+% \changes{v3.7e}{2024/07/17}{Use "/" instead of ";" as delimiter}
% \begin{macrocode}
\gdef\cb@pdfxy##1##2##3##4##5{%
- \immediate\write\cb@writexy{##1.##2p##3;##4;##5}%
+% \end{macrocode}
+% \begin{changebar}
+% \begin{macrocode}
+ \immediate\write\cb@writexy{##1.##2p##3/##4/##5}%
+% \end{macrocode}
+% \end{changebar}
+% \begin{macrocode}
\expandafter\gdef\csname cb@##1.##2\endcsname{##3,##4,##5}}
\fi}
% \end{macrocode}
@@ -892,7 +913,6 @@
{luaTeX option cannot be used}%
{You are not using luaLaTeX}}
% \end{macrocode}
-% \end{changebar}
%
% The new features of \LaTeXe\ make it possible to implement the
% \Lopt{outerbars} option.
@@ -1120,6 +1140,8 @@
% compatibility mode}
% \changes{v3.3e}{1998/02/24}{Added \cs{Textures}}
% \changes{v3.5a}{2005/05/23}{Added 'PDFtex' option}
+% \changes{v3.6a}{2011/04/30}{Added 'XeTeX' option}
+% \changes{v3.6e}{2023/08/13}{Added 'luaTeX' option}
% \begin{macrocode}
\if@compatibility
\def\driver#1{%
@@ -1132,17 +1154,9 @@
\def\Textures{TEXTURES}%
\def\VTeX{VTEX}%
\def\pdfTeX{PDFTEX}%
-% \end{macrocode}
-% \changes{v3.6a}{2011/04/30}{Added 'XeTeX' option}
-% \begin{macrocode}
\def\xeTeX{XETEX}
-% \end{macrocode}
-% \changes{v3.6e}{2023/08/13}{Added 'luaTeX' option}
-% \begin{changebar}
-% \begin{macrocode}
\def\luaTeX{LUATEX}
% \end{macrocode}
-% \end{changebar}
%
% The choice has to be communicated to the macro
% \verb=\cb@setup@specials= that will be called from within
@@ -1150,6 +1164,7 @@
% \verb=\cb@driver@setup= is used. It receives a numeric value
% using \verb=\chardef=.
% \changes{v3.6a}{2011/04/30}{Added 'XeTeX' option}
+% \changes{v3.6e}{2023/08/13}{Added 'luaTeX' option}
% \begin{macrocode}
\global\chardef\cb@driver@setup=0\relax
\ifx\tempa\LN \global\chardef\cb@driver@setup=0\fi
@@ -1160,14 +1175,7 @@
\ifx\tempa\VTeX \global\chardef\cb@driver@setup=5\fi
\ifx\tempa\pdfTeX \cb@pdftexcheck\fi
\ifx\tempa\xeTeX \cb@xetexcheck\fi
-% \end{macrocode}
-% \changes{v3.6e}{2023/08/13}{Added 'luaTeX' option}
-% \begin{changebar}
-% \begin{macrocode}
\ifx\tempa\luaTeX \cb@luatexcheck\fi
-% \end{macrocode}
-% \end{changebar}
-% \begin{macrocode}
\egroup}
% \end{macrocode}
% We add \verb+\driver+ to \verb+\@preamblecmds+, which is a
@@ -1464,11 +1472,22 @@
% When the point is found it is removed from |\cb@pdfpoints|. \#9
% contains the cumulative head of the list to construct the new list
% with the entry removed. \#3--\#8 are for pattern matching.
-% \changes{v3.7b}{2023/12/30}{use ¨;¨ instead of ¨,¨ as delimiter}
+% \changes{v3.7b}{2023/12/30}{use ";" instead of "," as delimiter}
+% \changes{v3.7e}{2024/07/17}{Use "/" instead of ";" as delimiter}
+% \begin{changebar}
+% \begin{macrocode}
+ \def\cb@pdffind##1##2##3.##4p##5/##6/##7pt##8\relax##9{%
+% \end{macrocode}
+% \end{changebar}
% \begin{macrocode}
- \def\cb@pdffind##1##2##3.##4p##5;##6;##7pt##8\relax##9{%
\def\cb@next{%
- \cb@pdffind{##1}{##2}##8\relax{##9##3.##4p##5;##6;##7pt}}%
+% \end{macrocode}
+% \begin{changebar}
+% \begin{macrocode}
+ \cb@pdffind{##1}{##2}##8\relax{##9##3.##4p##5/##6/##7pt}}%
+% \end{macrocode}
+% \end{changebar}
+% \begin{macrocode}
\ifnum ##1=##3
\ifnum ##2=##4
\def\cb@pdfx{##5sp}%
@@ -1519,8 +1538,13 @@
% \begin{macro}{\cb@pdfparsexy}
% The |\cb@pdfparsexy| macro extracts the pagecount from an entry read in
% from the \file{.cb2} file.
+% \changes{v3.7e}{2024/07/17}{Use "/" instead of ";" as delimiter}
+% \begin{changebar}
+% \begin{macrocode}
+ \def\cb@pdfparsexy##1.##2p##3/##4/##5pt{%
+% \end{macrocode}
+% \end{changebar}
% \begin{macrocode}
- \def\cb@pdfparsexy##1.##2p##3;##4;##5pt{%
\def\cb@pdfpg{##2}}%
% \end{macrocode}
% \end{macro}
@@ -1565,7 +1589,7 @@
% In order to get things in the right spot we need a little scaling
% factor. We define it here.
% \begin{macrocode}
-\def\cb@pdf@scale{0.996264009963}
+ \def\cb@pdf@scale{0.996264009963}
% \end{macrocode}
% \end{macro}
%
@@ -1636,14 +1660,12 @@
% \begin{macrocode}
\gdef\cb@checkPdfxy##1##2##3##4##5{%
\cb@@findpdfpoint{##1}{##2}%
-% \end{macrocdode}
-% \begin{changebar}
-% \begin{macrocode
+% \end{macrocode}
+% \begin{macrocode}
\ifdim##3sp=\cb@pdfx\relax
\ifdim##4sp=\cb@pdfy\relax
-% \end{macrocdode}
-% \end{changebar}
-% \begin{macrocode
+% \end{macrocode}
+% \begin{macrocode}
\ifdim##5=\cb@pdfz\relax
\else
\cb@error
@@ -1741,11 +1763,22 @@
% When the point is found it is removed from |\cb@pdfpoints|. \#9
% contains the cumulative head of the list to construct the new list
% with the entry removed. \#3--\#8 are for pattern matching.
-% \changes{v3.7b}{2023/12/30}{use ¨;¨ instead of ¨,¨ as delimiter}
+% \changes{v3.7b}{2023/12/30}{use ";" instead of "," as delimiter}
+% \changes{v3.7e}{2024/07/17}{Use "/" instead of ";" as delimiter}
+% \begin{changebar}
+% \begin{macrocode}
+ \def\cb@pdffind##1##2##3.##4p##5/##6/##7pt##8\relax##9{%
+% \end{macrocode}
+% \end{changebar}
% \begin{macrocode}
- \def\cb@pdffind##1##2##3.##4p##5;##6;##7pt##8\relax##9{%
\def\cb@next{%
- \cb@pdffind{##1}{##2}##8\relax{##9##3.##4p##5;##6;##7pt}}%
+% \end{macrocode}
+% \begin{changebar}
+% \begin{macrocode}
+ \cb@pdffind{##1}{##2}##8\relax{##9##3.##4p##5/##6/##7pt}}%
+% \end{macrocode}
+% \end{changebar}
+% \begin{macrocode}
\ifnum ##1=##3
\ifnum ##2=##4
\def\cb@pdfx{##5sp}%
@@ -1796,8 +1829,13 @@
% \begin{macro}{\cb@pdfparsexy}
% The |\cb@pdfparsexy| macro extracts the pagecount from an entry read in
% from the \file{.cb2} file.
+% \changes{v3.7e}{2024/07/17}{Use "/" instead of ";" as delimiter}
+% \begin{changebar}
+% \begin{macrocode}
+ \def\cb@pdfparsexy##1.##2p##3/##4/##5pt{%
+% \end{macrocode}
+% \end{changebar}
% \begin{macrocode}
- \def\cb@pdfparsexy##1.##2p##3;##4;##5pt{%
\def\cb@pdfpg{##2}}%
% \end{macrocode}
% \end{macro}
@@ -1842,7 +1880,7 @@
% In order to get things in the right spot we need a little scaling
% factor. We define it here.
% \begin{macrocode}
-\def\cb@pdf@scale{0.996264009963}
+ \def\cb@pdf@scale{0.996264009963}
% \end{macrocode}
% \end{macro}
%
@@ -1934,7 +1972,6 @@
\let\cb@resetpoints\relax
% \end{macrocode}
%
-% \begin{changebar}
% \changes{v3.6e}{2023/08/13}{lua\TeX{} support added}
% The code for lua\TeX{}, like for pdf\TeX\ and Xe\TeX,
% is more elaborate as the calculations have to
@@ -2012,11 +2049,22 @@
% When the point is found it is removed from |\cb@pdfpoints|. \#9
% contains the cumulative head of the list to construct the new list
% with the entry removed. \#3--\#8 are for pattern matching.
-% \changes{v3.7b}{2023/12/30}{use ¨;¨ instead of ¨,¨ as delimiter}
+% \changes{v3.7b}{2023/12/30}{use ";" instead of "," as delimiter}
+% \changes{v3.7e}{2024/07/17}{Use "/" instead of ";" as delimiter}
+% \begin{changebar}
+% \begin{macrocode}
+ \def\cb@pdffind##1##2##3.##4p##5/##6/##7pt##8\relax##9{%
+% \end{macrocode}
+% \end{changebar}
% \begin{macrocode}
- \def\cb@pdffind##1##2##3.##4p##5;##6;##7pt##8\relax##9{%
\def\cb@next{%
- \cb@pdffind{##1}{##2}##8\relax{##9##3.##4p##5;##6;##7pt}}%
+% \end{macrocode}
+% \begin{changebar}
+% \begin{macrocode}
+ \cb@pdffind{##1}{##2}##8\relax{##9##3.##4p##5/##6/##7pt}}%
+% \end{macrocode}
+% \end{changebar}
+% \begin{macrocode}
\ifnum ##1=##3
\ifnum ##2=##4
\def\cb@pdfx{##5sp}%
@@ -2067,8 +2115,13 @@
% \begin{macro}{\cb@pdfparsexy}
% The |\cb@pdfparsexy| macro extracts the pagecount from an entry read in
% from the \file{.cb2} file.
+% \changes{v3.7e}{2024/07/17}{Use "/" instead of ";" as delimiter}
+% \begin{changebar}
+% \begin{macrocode}
+ \def\cb@pdfparsexy##1.##2p##3/##4/##5pt{%
+% \end{macrocode}
+% \end{changebar}
% \begin{macrocode}
- \def\cb@pdfparsexy##1.##2p##3;##4;##5pt{%
\def\cb@pdfpg{##2}}%
% \end{macrocode}
% \end{macro}
@@ -2113,7 +2166,7 @@
% In order to get things in the right spot we need a little scaling
% factor. We define it here.
% \begin{macrocode}
-\def\cb@pdf@scale{0.996264009963}
+ \def\cb@pdf@scale{0.996264009963}
% \end{macrocode}
% \end{macro}
%
@@ -2203,7 +2256,6 @@
\def\cb@maxpoint{9999999}
\let\cb@resetpoints\relax
% \end{macrocode}
-%\end{changebar}
%
% When code for other drivers should be added it can be inserted
% here. When someone makes a mistake and somehow selects an
@@ -2296,7 +2348,7 @@
\newcommand*{\nochangebars}{%
\def\cb@start[##1]{\ignorespaces}%
\def\cb@delete[##1]{}%
- \def\cb@end{\ignorespacesafterend}
+ \def\cb@end{\ignorespacesafterend}%
}
% \end{macrocode}
% \end{macro}
diff --git a/Master/texmf-dist/source/latex/cjs-rcs-article/cjs-rcs-article.dtx b/Master/texmf-dist/source/latex/cjs-rcs-article/cjs-rcs-article.dtx
index 9376ddbbf3e..a750c136f54 100644
--- a/Master/texmf-dist/source/latex/cjs-rcs-article/cjs-rcs-article.dtx
+++ b/Master/texmf-dist/source/latex/cjs-rcs-article/cjs-rcs-article.dtx
@@ -3,7 +3,7 @@
% Article class for The Canadian Journal of Statistics | La revue
% canadienne de statistique
%
-% Copyright (C) Statistical Society of Canada | Société
+% Copyright (C) 2023-2024 Statistical Society of Canada | Société
% canadienne de statistique
%
% The class file and templates derived from this file are licenced
@@ -25,10 +25,10 @@
%<*driver>
\ProvidesFile{cjs-rcs-article.dtx}
%</driver>
-%<class>\NeedsTeXFormat{LaTeX2e}[2009/09/24]
+%<class>\NeedsTeXFormat{LaTeX2e}[2021/06/01]
%<class>\ProvidesClass{cjs-rcs-article}%
%<*class>
- [2023/11/29 v1.0 Article class for The Canadian Journal of
+[2024/07/30 v1.1a Article class for The Canadian Journal of
Statistics | La revue canadienne de statistique]
%</class>
%<*driver>
@@ -122,6 +122,10 @@
\OnlyDescription
\fi
+ %% Additional colors
+ \colorlet{codebg}{LightYellow1} % code background
+ \colorlet{prompt}{Orchid4} % command prompt
+
%% New \DescribeMacro type environments for class options and lengths
\NewDocElement[envlike,notoplevel,printtype=\emph{option}]{Option}{option}
\NewDocElement[macrolike,notoplevel,printtype=$\ell$]{Length}{length}
@@ -139,9 +143,12 @@
\newcommand*\CJSbstfr{\code{cjs-rcs-fr}}
\makeatother
+ %% URL of the project repository
+ \newcommand*\reposurl{https://gitlab.com/cjs-rcs/cjs-rcs-article}
+
%% Redefine \year using information from \filedate instead of using
%% compilation time
- \def\parsedate#1/#2/#3\relax{\def\year{#1}}
+ \def\parsedate#1/#2/#3\relax{\def\year{#1}\def\isodate{#1-#2-#3}}
%% Definition of a shorthand to either hyphenate a word or insert a
%% regular dash. Use in the long names of Creative Commons licences.
@@ -149,6 +156,26 @@
\useshorthands*{"}
\defineshorthand{"-}{\discretionary{-}{}{-}}
+ %% Source code
+ \usepackage{listings}
+ \lstset{%
+ basicstyle=\ttfamily\NoAutoSpacing,
+ moredelim=[is][\color{prompt}]{---}{-},
+ escapeinside=`',
+ showstringspaces=false,
+ backgroundcolor=\color{codebg},
+ frame=leftline,
+ framerule=2pt,
+ framesep=5pt,
+ xleftmargin=7.4pt
+ }
+
+ %% The \meta command from memoir needs an additionnel \normalfont to
+ %% use the document font in listings.
+ \makeatletter
+ \def\meta@font@select{\normalfont\itshape}
+ \makeatother
+
\begin{document}
\DocInput{cjs-rcs-article.dtx}
\end{document}
@@ -257,6 +284,22 @@
% CTAN.}
% \changes{1.0}{2023-11-29}{Fix various typos and cosmetic issues in
% the documentation.}
+% \changes{1.1}{2024-06-26}{Provide support to acknowledge usage of
+% data from the Alzheimer’s Disease Neuroimaging Initiative (ADNI) and
+% the Alzheimer’s Disease Neuroimaging Metabolomics Consortium
+% (ADMC).}
+% \changes{1.1}{2024-06-26}{Introduce new commands \cs{specialack} and
+% \cs{specialackmark} for the editors.}
+% \changes{1.1}{2024-06-23}{Improve the documentation, in particular
+% the installation instructions and access to the templates.}
+% \changes{1.1}{2024-07-02}{Add the References section to the table of
+% contents of the PDF.}
+% \changes{1.1}{2024-07-13}{Add the command \cs{matit} to typeset bold
+% italic in math in a portable way.}
+% \changes{1.1a}{2024-07-25}{Fix the command \cs{proglang} that would
+% disable hyphenation for the rest of the document. With thanks to
+% Enrico Gregorio (egreg) for the heads up in person at TUG 2024.}
+% \changes{1.1a}{2024-07-25}{Make the command \cs{proglang} robust.}
%
% \ifenglish%
% \title[Guide to the class {\CJSclass}]{%
@@ -353,11 +396,9 @@
% {\CJSclass} requiert une distribution {\TeX} récente et
% à jour. Nous recommandons les distributions %
% \fi
-% \href{https://tug.org/texlive}{{\TeX}~Live} %
-% --- %
+% \href{https://tug.org/texlive}{{\TeX}~Live}\ifenglish---\else~--- \fi%
% \ifenglish or its variant for macOS \else ou sa variante pour macOS \fi%
-% \href{https://tug.org/mactex}{Mac{\TeX}} %
-% --- %
+% \href{https://tug.org/mactex}{Mac{\TeX}}\ifenglish---\else~--- \fi%
% \ifenglish and \else et \fi%
% \href{https://miktex.org}{MiK{\TeX}}. %
% \ifenglish%
@@ -425,17 +466,28 @@
% \section{Démarrage rapide}
% \fi
% \label{sec:quick-start}
+% \changes{1.1}{2024-06-05}{Documentation: add a link to obtain the
+% templates in the \emph{Quick start} section.}
%
% \ifenglish%
% The class ships with templates for articles in English and in
% French. In {\TeX}~Live, these are located with the
-% documentation of the class. To quickly start writing your article,
-% copy the appropriate template to your working directory and follow
-% the brief instructions therein. %
+% documentation of the class. You may also obtain the templates from
+% the %
% \else%
% La classe est livrée avec des gabarits pour des articles en français
% et en anglais. Dans la distribution {\TeX}~Live, ceux-ci sont
-% classés avec la documentation. Pour débuter rapidement la rédaction
+% classés avec la documentation. Vous pouvez aussi les récupérer
+% depuis le %
+% \fi%
+% \href{\reposurl/-/releases/\fileversion}{%
+% \ifenglish project repository\else dépôt du projet\fi}. %
+% \ifenglish%
+% To quickly start writing your article, copy the appropriate template
+% to your working directory and follow the brief instructions
+% therein. %
+% \else%
+% Pour débuter rapidement la rédaction
% de votre article, copiez le gabarit approprié dans votre dossier de
% travail et suivez les directives succinctes qui s'y trouvent. %
% \fi
@@ -490,6 +542,9 @@
% \changes{0.91}{2023-10-16}{Change the name of the archive containing
% a ``local'' installation of the class from
% \texttt{-no-local-tex.zip} to \texttt{-project-install.zip}.}
+% \changes{1.1}{2024-06-05}{Documentation: provide a direct link to
+% the release corresponding to the version of the documentation in the
+% \emph{Installation} section.}
%
% \ifenglish%
% The class {\CJSclass} is distributed as the package %
@@ -507,21 +562,33 @@
% the command line: %
% \else%
% via le réseau de sites \emph{Comprehensive {\TeX} Archive Network}
-% (CTAN). Elle fait partie des distributions {\TeX} standards telles
-% que {TeX}~Live, Mac{\TeX} et MiK{\TeX}. Nous recommandons fortement
-% d'installer ou de mettre à jour le paquetage à l'aide du
+% (CTAN). Celui-ci fait partie des distributions {\TeX} standards
+% telles que {TeX}~Live, Mac{\TeX} et MiK{\TeX}. Nous recommandons
+% fortement d'installer ou de mettre à jour le paquetage à l'aide du
% gestionnaire de paquetages de votre distribution {\TeX}. Par
-% exemple, avec {\TeX}~Live, vous pouvez effectuer ces opérations dans
-% l'assistant graphique, ou encore avec l'une ou l'autre des commandes
-% ci-dessous: %
+% exemple, avec {\TeX}~Live, vous pouvez effectuer ces opérations
+% dans l'assistant graphique, ou encore avec l'une ou l'autre des
+% commandes ci-dessous: %
+% \fi
+% \iffalse
+%<*example>
+% \fi
+\begin{lstlisting}
+---$- tlmgr install cjs-rcs-article
+\end{lstlisting}
+% \iffalse
+%</example>
% \fi
-% \begin{quote}
-% \code{tlmgr install cjs-rcs-article}
-% \end{quote}
% \ifenglish or\else ou\fi
-% \begin{quote}
-% \code{tlmgr update cjs-rcs-article}
-% \end{quote}
+% \iffalse
+%<*example>
+% \fi
+\begin{lstlisting}
+---$- tlmgr update cjs-rcs-article
+\end{lstlisting}
+% \iffalse
+%</example>
+% \fi
%
% \ifenglish%
% If you are not in position to install packages or update the {\TeX}
@@ -530,23 +597,23 @@
% limited in scope to your project. Download the archive %
% \else%
% S'il vous est impossible d'installer des paquetages ou de mettre à
-% jour la distribution {\TeX} --- notamment si vous utilisez une
-% plateforme de rédaction en ligne --- vous pouvez procéder à une
+% jour la distribution {\TeX}~--- notamment si vous utilisez une
+% plateforme de rédaction en ligne~--- vous pouvez procéder à une
% installation simplifiée de la classe, mais dont la portée sera
% limitée à votre projet. Pour ce faire, téléchargez l'archive %
% \fi%
% \code{cjs-rcs-article-project-install.zip} %
% \ifenglish from the \else depuis le \fi%
-% \href{https://gitlab.com/cjs-rcs/cjs-rcs-article/-/releases}{%
-% \ifenglish project repository\else dépôt du projet\fi} %
+% \href{\reposurl/-/releases/\fileversion}{%
+% \ifenglish project repository\else dépôt du projet\fi}, %
% \ifenglish%
-% and uncompress it in the directory of your project. You will then
-% have access to all the essential files of the class within this
-% project. %
+% uncompress it and place its contents in the directory of your
+% project. You will then have access to all the essential files of the
+% class within this project. %
% \else%
-% et décompressez celle-ci dans le répertoire de votre projet. Vous
-% disposerez alors de tous les fichiers essentiels de la classe à
-% l'intérieur de ce projet. %
+% décompressez celle-ci et placez son contenu dans le répertoire de
+% votre projet. Vous disposerez alorsà l'intérieur de ce projet de
+% tous les fichiers essentiels de la classe. %
% \fi
%
% \ifenglish%
@@ -631,7 +698,7 @@
% {pdf\LaTeX} utilise les versions Type~1 des polices STIX~Two et
% Fira. Or, la technologie Type~1 PostScript étant aujourd'hui
% obsolète, ces polices ne sont plus mises à jour. Le moteur
-% {\XeLaTeX} utilise les plus modernes --- et complètes --- versions
+% {\XeLaTeX} utilise les plus modernes~--- et complètes~--- versions
% OpenType des polices.}, %
% nous recommandons de compiler votre manuscript avec le plus moderne
% moteur {\XeLaTeX}. %
@@ -643,24 +710,34 @@
% \subsection{Gabarits}
% \fi
% \label{sec:usage:templates}
+% \changes{1.1}{2024-06-05}{Documentation: add a link to the templates
+% in the \emph{Templates} sub-section.}
%
% \ifenglish%
% The class is distributed with templates for articles in English
% and in French. If you are using the version of the class included
% with your {\TeX} distribution, the templates may be located with the
-% documentation (this is the case in {\TeX}~Live). If you installed
-% the class manually by following the instructions in
-% \autoref{sec:installation}, the templates reside in your working
-% directory. %
+% documentation (this is the case in {\TeX}~Live). You may also obtain
+% them from the %
% \else
% La classe est distribuée avec des gabarits pour des articles en français
% et en anglais. Si vous utilisez la version de la classe fournie avec
% votre distribution {\TeX}, les gabarits peuvent être classés avec
-% la documentation (c'est le cas dans {\TeX}~Live). Si vous avez
+% la documentation (c'est le cas dans {\TeX}~Live). Vous pouvez aussi
+% les récupérer depuis le %
+% \fi
+% \href{\reposurl/-/releases/\fileversion}{%
+% \ifenglish project repository\else dépôt du projet\fi}. %%
+% \ifenglish
+% If you installed the class manually by following the instructions in
+% \autoref{sec:installation}, the templates reside in your working
+% directory. %
+% \else%
+% Si vous avez
% plutôt installé la classe manuellement en suivant les instructions
% de la \autoref{sec:installation}, les gabarits se trouvent dans
% votre dossier de travail. %
-% \fi
+% \fi%
%
% \ifenglish%
% We strongly encourage to start from a template to write your
@@ -705,13 +782,19 @@
% \label{sec:usage:options}
%
% \ifenglish%
-% The class is loaded with the command %
+% The class is loaded with the command: %
% \else%
-% On charge la classe avec la commande %
+% On charge la classe avec la commande: %
+% \fi
+% \iffalse
+%<*example>
+% \fi
+\begin{lstlisting}
+\documentclass`\oarg{options}\marg{cjs-rcs-article}'
+\end{lstlisting}
+% \iffalse
+%</example>
% \fi
-% \begin{quote}
-% \cmdprint{\documentclass}\oarg{options}\code{\{cjs-rcs-article\}}
-% \end{quote}
% \ifenglish%
% Some \meta{options} of the class are intended for the authors,
% whereas others are instead intended for the editors of {\TheCJS*}.
@@ -931,22 +1014,28 @@
% du titre qui sera utilisée dans les entêtes. La syntaxe de la
% commande est donc: %
% \fi
-% \begin{quote}
-% \def\OPT{\ifenglish Short title\else Titre court\fi}
-% \def\ARG{\ifenglish Full title\else Titre complet\fi}
-% \cmdprint{\title}\oarg{\OPT}\marg{\ARG}
-% \end{quote}
-% \ifenglish%
-% Write the title in sentence style, that is, with only an initial
-% capital. In English, also capitalize the first word after a colon.
-% Break a long title needing more than one line using \code{\bs\bs}
-% or \cmdprint{\newline}. %
-% \else%
-% Entrez le titre en minuscules (sauf pour la majuscule initiale).
-% En anglais, utilisez toutefois une majuscule initiale après un
-% deux-points. Vous devez couper manuellement avec \code{\bs\bs} ou
-% \cmdprint{\newline} un titre qui nécessite plus d'une ligne.
-% \fi
+% \iffalse
+%<*example>
+% \fi
+\def\OPT{\ifenglish Short title\else Titre court\fi}
+\def\ARG{\ifenglish Full title\else Titre complet\fi}
+\begin{lstlisting}
+\title`\oarg{\OPT}\marg{\ARG}'
+\end{lstlisting}
+% \iffalse
+%</example>
+% \fi
+% \ifenglish%
+% Write the title in sentence style, that is, with only an initial
+% capital. In English, also capitalize the first word after a colon.
+% Break a long title needing more than one line using \code{\bs\bs}
+% or \cmdprint{\newline}. %
+% \else%
+% Entrez le titre en minuscules (sauf pour la majuscule initiale).
+% En anglais, utilisez toutefois une majuscule initiale après un
+% deux-points. Vous devez couper manuellement avec \code{\bs\bs} ou
+% \cmdprint{\newline} un titre qui nécessite plus d'une ligne.
+% \fi
% \end{DescribeMacro}
%
% \ifenglish%
@@ -994,11 +1083,17 @@
% informations relatives à un auteur de l'article. Sa syntaxe
% générale est la suivante: %
% \fi
-% \begin{quote}
-% \def\FORENAME{\ifenglish Forename\else Prénom\fi}
-% \def\SURNAME{\ifenglish Surname\else Nom\fi}
-% \cmdprint{\author}\oarg{options}\code{\{}\meta{\FORENAME}\code{ }\cmdprint{\surname}\marg{\SURNAME}\code{\}}
-% \end{quote}
+% \iffalse
+%<*example>
+% \fi
+\def\FORENAME{\ifenglish Forename\else Prénom\fi}
+\def\SURNAME{\ifenglish Surname\else Nom\fi}
+\begin{lstlisting}
+\author`\oarg{options}'{`\meta{\FORENAME}' \surname`\marg{\SURNAME}'}
+\end{lstlisting}
+% \iffalse
+%</example>
+% \fi
% \ifenglish%
% The \meta{Surname} must be entered using the command
% \cmd{\surname}. Write the \meta{Forename} and \meta{Surname} in
@@ -1113,15 +1208,27 @@
% \def\FORENAME{\ifenglish Forename\else Prénom\fi}
% \def\SURNAME{\ifenglish Surname\else Nom\fi}
% \item \ifenglish For the corresponding author\else Pour l'auteur correspondant\fi:
-% \begin{quote}
-% \cmdprint{\author}\code{[orcid=}\meta{id}\code{, email=}\meta{\EMAIL}\code{, corresponding]} \\
-% \verb+ +\code{\{}\meta{\FORENAME}\code{ }\cmdprint{\surname}\marg{\SURNAME}\code{\}}
-% \end{quote}
+% \iffalse
+%<*example>
+% \fi
+\begin{lstlisting}
+\author[orcid=`\meta{id}', email=`\meta{\EMAIL}', corresponding]
+ {`\meta{\FORENAME}' \surname`\marg{\SURNAME}'}
+\end{lstlisting}
+% \iffalse
+%</example>
+% \fi
% \item \ifenglish For all other authors\else Pour tous les autres auteurs\fi:
-% \begin{quote}
-% \cmdprint{\author}\code{[orcid=}\meta{id}\code{, email=}\meta{\EMAIL}\code{]} \\
-% \verb+ +\code{\{}\meta{\FORENAME}\code{ }\cmdprint{\surname}\marg{\SURNAME}\code{\}}
-% \end{quote}
+% \iffalse
+%<*example>
+% \fi
+\begin{lstlisting}
+\author[orcid=`\meta{id}', email=`\meta{\EMAIL}']
+ {`\meta{\FORENAME}' \surname`\marg{\SURNAME}'}
+\end{lstlisting}
+% \iffalse
+%</example>
+% \fi
% \end{itemize}
% \end{DescribeMacro}
% \end{DescribeMacro}
@@ -1136,11 +1243,17 @@
% mentionné dans la commande \cmd{\author} qui la précède. La forme
% générale de l'affiliation est: %
% \fi
-% \begin{quote}
-% \def\AFFIL{\ifenglish Department, University, City, Country\else%
-% Département, Université, Ville, Pays\fi}
-% \cmd{\affil}\marg{\AFFIL}
-% \end{quote}
+% \iffalse
+%<*example>
+% \fi
+\def\AFFIL{\ifenglish Department, University, City, Country\else%
+ Département, Université, Ville, Pays\fi}
+\begin{lstlisting}
+\affil`\marg{\AFFIL}'
+\end{lstlisting}
+% \iffalse
+%</example>
+% \fi
% \ifenglish%
% Give the country name in the main language of the article. %
% \else%
@@ -1164,13 +1277,19 @@
% premier auteur suivi de la locution «et collab.» (en français) ou
% «et al.» (en anglais): %
% \fi
-% \begin{quote}
-% \def\SURNAME{\ifenglish Surname\else Nom\fi}
-% \def\ETAL{\ifenglish et al.\else et collab.\fi}
-% \def\ETCOLLAB{\ifenglish et collab.\else et al.\fi}
-% \cmdprint{\runningauthor}\code{\{}\meta{\SURNAME}\code{ \ETAL\}} \\
-% \cmdprint{\runningauthor}\code{\{}\meta{\SURNAME}\code{ \ETCOLLAB\}}
-% \end{quote}
+% \iffalse
+%<*example>
+% \fi
+\def\SURNAME{\ifenglish Surname\else Nom\fi}
+\def\ETAL{\ifenglish et al.\else et collab.\fi}
+\def\ETCOLLAB{\ifenglish et collab.\else et al.\fi}
+\begin{lstlisting}
+\runningauthor{`\meta{\SURNAME} \ETAL'}
+\runningauthor{`\meta{\SURNAME} \ETCOLLAB'}
+\end{lstlisting}
+% \iffalse
+%</example>
+% \fi
% \end{DescribeMacro}
%
% \ifenglish%
@@ -1224,16 +1343,22 @@
% mots-clés de l'article. Il s'utilise comme une liste
% \code{itemize} ou \code{enumerate}: %
% \fi
-% \begin{quote}
-% \def\KEYWORDC{\ifenglish Key word\else Mot-clé\fi}
-% \def\KEYWORD{\ifenglish key word\else mot-clé\fi}
-% \cmdprint{\begin}\code{\{keywords\}} \\
-% \cmdprint{\item} \emph{{\KEYWORDC} 1} \\
-% \cmdprint{\item} \emph{{\KEYWORD} 2} \\
-% \cmdprint{\item} \emph{{\KEYWORD} 3} \\
-% \code{...} \\
-% \cmdprint{\end}\code{\{keywords\}}
-% \end{quote}
+% \iffalse
+%<*example>
+% \fi
+\def\KEYWORDC{\ifenglish Key word\else Mot-clé\fi}
+\def\KEYWORD{\ifenglish key word\else mot-clé\fi}
+\begin{lstlisting}
+\begin{keywords}
+\item `\normalfont\itshape{\KEYWORDC} 1'
+\item `\normalfont\itshape{\KEYWORD} 2'
+\item `\normalfont\itshape{\KEYWORD} 3'
+...
+\end{keywords}
+\end{lstlisting}
+% \iffalse
+%</example>
+% \fi
% \ifenglish%
% As shown above, use an initial capital for the first key word
% only. Punctuation will be added automatically. %
@@ -1261,15 +1386,21 @@
% classification mathématique par matières de l'article. Son
% interface est la suivante: %
% \fi
-% \begin{quote}
-% \def\LEVEL{\ifenglish level\else niveau\fi}
-% \def\CODE{\ifenglish code\else rubrique\fi}
-% \cmdprint{\begin}\code{\{classification\}}\oarg{type} \\
-% \cmdprint{\item}\oarg{\LEVEL} \emph{{\CODE} 1}, \emph{{\CODE} 2}, \dots \\
-% \cmdprint{\item}\oarg{\LEVEL} \emph{{\CODE} 1}, \emph{{\CODE} 2}, \dots \\
-% \code{...} \\
-% \cmdprint{\end}\code{\{classification\}}
-% \end{quote}
+% \iffalse
+%<*example>
+% \fi
+\def\LEVEL{\ifenglish level\else niveau\fi}
+\def\CODE{\ifenglish code\else rubrique\fi}
+\begin{lstlisting}
+\begin{classification}`\oarg{type}'
+\item`\oarg{\LEVEL} \normalfont\itshape{\CODE} 1, {\CODE} 2, \dots'
+\item`\oarg{\LEVEL} \normalfont\itshape{\CODE} 1, {\CODE} 2, \dots'
+...
+\end{classification}
+\end{lstlisting}
+% \iffalse
+%</example>
+% \fi
% \ifenglish%
% The classification system used is %
% \else%
@@ -1331,7 +1462,53 @@
% les options \code{review}, \code{supplement} et \code{nocjs},
% l'espace est remplacé par un pied de page contenant le numéro de
% page. %
-% \fi%
+% \fi
+%
+% \ifenglish%
+% \subsubsection{ADNI data use agreement}
+% \else%
+% \subsubsection{Contrat d'utilisation des données de l'ADNI}
+% \fi
+% \label{sec:usage:titling:adni}
+%
+% \ifenglish%
+% The Alzheimer’s Disease Neuroimaging Initiative (ADNI) %
+% \else%
+% Le %
+% \fi
+% \href{https://adni.loni.usc.edu/wp-content/uploads/how_to_apply/ADNI_DSP_Policy.pdf}{\ifenglish Data Sharing and Publication Policy\else contrat d'utilisation des données\fi} %
+% \ifenglish%
+% requires authors using their data to acknowledge ADNI in the list of
+% authors and give a specific statement on the title page. %
+% \else%
+% de l'Alzheimer’s Disease Neuroimaging Initiative (ADNI) stipule que
+% les auteurs qui ont recours à leurs données doivent reconnaitre la
+% contribution de l'ADNI parmi les auteurs et inclure une déclaration
+% spécifique sur la page de titre de l'article. %
+% \fi
+%
+% \begin{DescribeMacro}{\ADNIacknowledgement}
+% \ifenglish%
+% The command \cmd{\ADNIacknowledgement} adds these two
+% requirements. The command has no arguments; simply insert it after
+% the declarations of the authors. %
+% \else%
+% La commande \cmd{\ADNIacknowledgement} ajoute ces deux exigences.
+% La commande n'a aucun argument; insérez simplement celle-ci après
+% toutes les autres définitions des auteurs. %
+% \fi
+% \end{DescribeMacro}
+%
+% \begin{DescribeMacro}{\ADMCacknowledgement}
+% \ifenglish%
+% Similarly, the command \cmd{\ADMCacknowledgement} acknowledges the
+% Alzheimer’s Disease Meta\-bo\-lomics Consortium (ADMC). %
+% \else%
+% De manière analogue, la commande \cmd{\ADMCacknowledgement}
+% reconnait la contribution du
+% Alzheimer’s Disease Metabolomics Consortium (ADMC). %
+% \fi
+% \end{DescribeMacro}
%
% \ifenglish%
% \subsection{Back matter information}
@@ -1342,17 +1519,19 @@
%
% \ifenglish%
% Articles in {\TheCJS} end with elements forming the so-called back
-% matter: supplementary material available online, acknowledgements,
-% etc. The class {\CJSclass} provides specialized environments to
-% enter this information. See \autoref{tab:titling} for a summary; the
-% detailed descriptions follow. %
+% matter: supplementary material available online, data sharing
+% statement, acknowledgements, etc. The class {\CJSclass} provides
+% specialized environments to enter this information. See
+% \autoref{tab:titling} for a summary; the detailed descriptions
+% follow. %
% \else%
% Un article de {\LaRevue} se termine par la présentation d'un
% ensemble d'informations dans des parties annexes: matériel
-% additionnel disponible en ligne, remerciements, etc. La classe
-% {\CJSclass} définit des environnements pour entrer ce type
-% d'information de manière uniforme. Le \autoref{tab:backmatter} en
-% présente un sommaire; les descriptions détaillées suivent. \fi
+% additionnel disponible en ligne, conditions de partage des données,
+% remerciements, etc. La classe {\CJSclass} définit des environnements
+% pour entrer ce type d'information de manière uniforme. Le
+% \autoref{tab:backmatter} en présente un sommaire; les descriptions
+% détaillées suivent. \fi
%
% \begin{table}[t]
% \centering
@@ -1428,18 +1607,34 @@
% \fi
% \end{DescribeEnv}
%
+% \changes{1.1}{2024-01-23}{Documentation: revise the description of
+% the \texttt{sharing} environment now that the CJS adhered to the
+% Expects Data Sharing editorial policy of Wiley.}
% \begin{DescribeEnv}{sharing}
+% \def\POLICYNAME{\ifenglish Expects Data Sharing\else \emph{Expects Data Sharing}\fi}
+% \ifenglish%
+% {\TheCJS} adheres to the %
+% \else%
+% {\LaRevue} respecte la politique éditoriale %
+% \fi%
+% \href{https://authorservices.wiley.com/author-resources/Journal-Authors/open-access/data-sharing-citation/data-sharing-policy.html}{\POLICYNAME} %
% \ifenglish%
-% If you wish to share data or the code, use the environment
-% \code{sharing} to describe how to access this material, providing
-% a persistent identifier, such as a digital object identifier (DOI)
-% or a URL. %
+% editorial policy of Wiley. Therefore, you must use the environment
+% \code{sharing} to make a statement about the availability or
+% absence of shared data. In case of ethical or legal concerns, we
+% encourage you to provide synthetic data instead if possible.
+% Provide a persistent identifier to access the data, such as a
+% digital object identifier (DOI) or a URL. You may also use the
+% environment to describe how to access shared computer code. %
% \else%
-% Si vous mettez les données ou le code de votre article à
-% disposition, utilisez l'environnement \code{sharing} pour
-% expliquer comment accéder à ce matériel et pour indiquer un lien
-% permanent, comme un identificateur d'objets numériques (DOI) ou
-% une adresse URL. %
+% de Wiley. Par conséquent, vous devez utiliser l'environnement
+% \code{sharing} pour préciser les conditions de partage des données
+% de recherche, ou encore leur absence, le cas échéant. En cas
+% d'enjeux éthiques ou légaux, veuillez utiliser si possible des
+% données de synthèse. Indiquez un lien permanent pour accéder aux
+% données, comme un identificateur d'objets numériques (DOI) ou une
+% adresse URL. Vous pouvez aussi utiliser l'environnement pour
+% indiquer comment accéder à du code informatique partagé. %
% \fi
% \end{DescribeEnv}
%
@@ -1644,10 +1839,16 @@
% la page de titre du présent document a été composée avec la commande
% suivante: %
% \fi
-% \begin{quote}
-% \cmd{\licence}\code{\{\{}\cmdprint{\ccbysa*}\code{\} {\year}, Statistical Society of Canada \{}\cmdprint{\textbar}\code{\}} \\
-% \verb+ +\code{Société canadienne de statistique\}}
-% \end{quote}
+% \iffalse
+%<*example>
+% \fi
+\begin{lstlisting}
+\licence{{\ccbysa*} `\year', Statistical Society of Canada {\textbar}
+ Société canadienne de statistique}
+\end{lstlisting}
+% \iffalse
+%</example>
+% \fi
%
% \ifenglish%
% \subsection{Mathematics}
@@ -1655,6 +1856,8 @@
% \subsection{Mathématiques}
% \fi
% \label{sec:usage:mathematics}
+% \changes{1.1}{2024-01-23}{Documentation: specify that the class is
+% not compatible with the package \textbf{amssymb}.}
%
% \ifenglish%
% The class automatically loads the packages %
@@ -1666,16 +1869,18 @@
% \ifenglish%
% and, when the document is compiled with {\XeLaTeX}, %
% \else%
-% et, lorsque le document est compilé avec {\XeLaTeX},
+% et, lorsque le document est compilé avec {\XeLaTeX}, %
% \fi%
% \href{https://ctan.org/pkg/unicode-math}{\pkg{unicode-math}}. %
% \ifenglish%
-% The class also defines a number of commands and environments to
-% standardize the typesetting of mathematical content in {\TheCJS}.
+% Note that it is not compatible with the package \pkg{amssymb}. The
+% class also defines a number of commands and environments to
+% standardize the typesetting of mathematical content in {\TheCJS}. %
% \else%
-% Elle définit également des commandes et des environnements pour
-% assurer une mise en forme standardisée des mathématiques dans
-% {\LaRevue}.
+% En revanche, elle n'est pas compatible avec le paquetage
+% \pkg{amssymb}. La classe définit également des commandes et des
+% environnements pour assurer une mise en forme standardisée des
+% mathématiques dans {\LaRevue}. %
% \fi
%
% \ifenglish%
@@ -1724,6 +1929,9 @@
% \cmd{\mat} &
% \ifenglish matrix or vector \else matrice ou vecteur \fi &
% \cmdprint{\mat}\code{\{A\}} & $\mat{A}$ \\
+% \cmd{\matit} &
+% \ifenglish matrix or vector (italic) \else matrice ou vecteur (italique) \fi &
+% \cmdprint{\matit}\code{\{x\}} & $\matit{x}$ \\
% \cmd{\trsp} &
% \ifenglish transposition \else transposée \fi &
% \cmdprint{\mat}\code{\{A\}}\cmdprint{\trsp} & $\mat{A}\trsp$ \\
@@ -1800,7 +2008,7 @@
% \begin{tabbing}
% \hspace*{2.5em}\=\cmd{\prdist}\code{\{E\}(\cmd{\lambda})}%
% \quad\=$\rightarrow$ \quad\=$\prdist{N}(0, 1)$ \quad\=\kill
-% \>\cmd{\prdist}\code{\{N\}(0, 1)}%
+% \>\cmd{\prdist}\code{\{N\}(0, 1)} %
% \>$\rightarrow$ %
% \>$\prdist{N}(0, 1)$ %
% \>(\ifenglish Normal\else normale\fi) \\
@@ -1816,26 +2024,36 @@
% \end{DescribeMacro}
%
% \begin{DescribeMacro}{\mat}
-% \begin{DescribeMacro}{\trsp}
-% \begin{DescribeMacro}{\tr}
-% \begin{DescribeMacro}{\diag}
+% \begin{DescribeMacro}{\matit}
% \ifenglish%
% The command \cmd{\mat} typesets a variable in roman bold, a style
% often used for matrices and vectors (hence the name of the
-% command). To indicate matrix transposition, use only the command
-% \cmd{\trsp}. The commands \cmd{\tr} and \cmd{\diag} define two
-% other common linear algebra operators, the trace and the
-% diagonal. %
+% command). The command \cmd{\matit} is similar, but for a variable
+% in bold italic.
% \else%
% La commande \cmd{\mat} compose une variable en romain gras, ce qui
% est souvent utilisé pour les matrices et les vecteurs (d'où le nom
-% de la commande). Pour indiquer la transposée d'une matrice,
-% utilisez uniquement la commande \cmd{\trsp}. Les commandes
-% \cmd{\tr} et \cmd{\diag} définissent deux autres opérateurs
-% courants en algèbre linéaire, la trace et la diagonale. %
+% de la commande). La commande \cmd{\matit} produit plutôt une
+% variable en gras italique.
% \fi
% \end{DescribeMacro}
% \end{DescribeMacro}
+%
+% \begin{DescribeMacro}{\trsp}
+% \begin{DescribeMacro}{\tr}
+% \begin{DescribeMacro}{\diag}
+% \ifenglish%
+% To indicate matrix transposition, use only the command
+% \cmd{\trsp}. The commands \cmd{\tr} and \cmd{\diag} define
+% two other common linear algebra operators, the trace and the
+% diagonal. %
+% \else%
+% Pour indiquer la transposée d'une matrice, utilisez uniquement la
+% commande \cmd{\trsp}. Les commandes \cmd{\tr} et \cmd{\diag}
+% définissent deux autres opérateurs courants en algèbre linéaire,
+% la trace et la diagonale. %
+% \fi
+% \end{DescribeMacro}
% \end{DescribeMacro}
% \end{DescribeMacro}
%
@@ -1999,6 +2217,23 @@
% Évitez si possible les indices doubles et n'utilisez jamais
% d'indices triples. %
% \fi
+% \changes{1.1}{2024-03-06}{Documentation: add an advice on the
+% typesetting of bold symbols in mathematics.}
+% \item %
+% \ifenglish%
+% Bold in mathematics is a tricky issue. Use the aforementioned
+% class commands \cmdprint{\mat} and \cmdprint{\matit} to generate
+% bold symbols reliably across {\TeX} engines. With {\XeLaTeX},
+% \cmdprint{\mat} also works with Greek letters (that will be
+% typeset in italic). %
+% \else%
+% La composition en gras en mathématiques est une opération
+% délicate. Utilisez les commandes de la classe \cmdprint{\mat} et
+% \cmdprint{\matit} mentionnées précédemment pour composer
+% automatiquement des symboles en gras quelque soit le moteur
+% {\TeX}. Avec {\XeLaTeX}, \cmdprint{\mat} fonctionne aussi avec les
+% lettres grecques (qui sont alors composées en italique). %
+% \fi
% \item %
% \ifenglish%
% Always use the command \cmdprint{\ell} to obtain the symbol
@@ -2094,13 +2329,19 @@
% («équation», «inégalité», «relation», etc.), ainsi que par une
% espace insécable: %
% \fi
-% \begin{quote}
-% \def\LABEL{\ifenglish label\else étiquette\fi}
-% \def\EQN{\ifenglish equation\else équation\fi}
-% \def\INEQ{\ifenglish inequalities\else inégalités\fi}
-% \code{\EQN~}\cmdprint{\eqref}\marg{\LABEL} \\
-% \code{\INEQ~}\cmdprint{\eqref}\marg{\LABEL}\code{{-}{-}}\cmdprint{\eqref}\marg{\LABEL}
-% \end{quote}
+% \iffalse
+%<*example>
+% \fi
+ \def\LABEL{\ifenglish label\else étiquette\fi}
+ \def\EQN{\ifenglish equation\else équation\fi}
+ \def\INEQ{\ifenglish inequalities\else inégalités\fi}
+\begin{lstlisting}
+`\EQN'~\eqref`\marg{\LABEL}'
+`\INEQ'~\eqref`\marg{\LABEL}'--\eqref`\marg{\LABEL}'
+\end{lstlisting}
+% \iffalse
+%</example>
+% \fi
% \end{itemize}
%
% \ifenglish%
@@ -2533,72 +2774,137 @@
% description pour un nouvel environnement \meta{env}, insérez la
% commande suivante dans le préambule de votre document: %
% \fi
-% \begin{quote}
-% \cmdprint{\addto}\cmdprint{\extras}\code{\languagename}\code{\{}\cmdprint{\def}\code{\bs}\meta{env}\code{autorefname}\marg{description}\code{\}}
-% \end{quote}
+% \iffalse
+%<*example>
+% \fi
+\begin{lstlisting}
+\addto\extras`\languagename'{\def\`\meta{env}'autorefname`\marg{description}'}
+\end{lstlisting}
+% \iffalse
+%</example>
+% \fi
% \ifenglish%
% (If the main language of the article is French, replace
% \cmdprint{\extras}\code{\languagename} by
-% \cmdprint{\extrasfrench}.)\footnote{%
+% \cmdprint{\extrasfrench}.\footnote{%
% For further details, see Section~6 of the documentation of
-% \pkg{hyperref}.} %
+% \pkg{hyperref}.}) %
% \else%
% (Si la langue principale de l'article est l'anglais, remplacez
% \cmdprint{\extras}\code{\languagename} par
-% \cmdprint{\extrasenglish}.)\footnote{%
+% \cmdprint{\extrasenglish}.\footnote{%
% Consultez au besoin la section~6 de la documentation de
-% \pkg{hyperref}.} %
+% \pkg{hyperref}.}) %
% \fi
%
% \begin{DescribeMacro}{\texorpdfstring}
% \changes{0.93}{2023-11-07}{Fix the name of a command from
% \cs{textorpdfstring} to the correct \cs{texorpdfstring} in the
-% documentation.}
+% documentation.}%
+% \changes{1.1}{2024-03-12}{Documentation: mention to also use
+% \cs{texorpdfstring} to fix \texttt{Token not allowed in a PDF
+% string} warnings.}
% \ifenglish%
-% The compilation of your manuscript may halt with the error message
+% The package \pkg{hyperref} builds the table of contents of the
+% PDF. If you use mathematical notation or symbols in a section
+% title, compilation of your manuscript may either result in
+% warnings of the form %
+% \else%
+% Le paquetage \pkg{hyperref} se charge de produire la table des
+% matières du fichier PDF. Si vous utilisez de la notation ou des
+% symboles mathématiques dans un titre de section, la compilation de
+% votre article pourrait soit résulter en des avertissements de la
+% forme %
+% \fi%
% \begin{quote}
-% \code{Improper alphabetic constant}
+% Token not allowed in a PDF string
% \end{quote}
-% The reason is most likely that you use a mathematical symbol in a
-% section title that \pkg{hyperref} is not able to properly
-% translate for the table of contents of the PDF. If you need
-% the symbol, try wrapping it in \cmd{\texorpdfstring}. This
-% command takes two arguments: the symbol that should appear in the
-% document, and the replacement text for the table of contents. For
-% example, you would replace %
+% \ifenglish%
+% or halt with the error message %
% \else%
-% Il se pourrait que la compilation de votre article échoue avec le
-% message d'erreur
+% ou échouer avec le message d'erreur %
+% \fi%
% \begin{quote}
% \code{Improper alphabetic constant}
% \end{quote}
-% La cause en est probablement un symbole mathématique placé dans un
-% titre de section que \pkg{hyperref} n'arrive pas à traduire pour
-% la table des matières du fichier PDF. Si vous ne pouvez vous
-% passer du symbole dans le titre, essayez d'utiliser la commande
-% \cmd{\texorpdfstring} dans celui-ci. Cette commande requiert deux
-% arguments: le texte qui doit apparaitre dans le document et celui
-% qui peut figurer dans la table des matières. Par exemple, vous
-% devriez remplacer %
+% \ifenglish%
+% If you need the notation or symbol in the title, wrap it in
+% \cmd{\texorpdfstring}. This command takes two arguments: the
+% notation or symbol that should appear in the document, and the
+% replacement text for the table of contents. For example, you would
+% replace %
+% \else%
+% Si vous ne pouvez vous passer de la notation ou du symbole dans le
+% titre, utilisez la commande \cmd{\texorpdfstring} dans celui-ci.
+% Cette commande requiert deux arguments: le texte qui doit
+% apparaitre dans le document et celui qui peut figurer dans la
+% table des matières. Par exemple, vous devriez remplacer %
% \fi%
-% \def\TEXT{Contribution \ifenglish of \else de \fi}
-% \begin{quote}
-% \cmdprint{\subsection}\code{\{\TEXT $}\cmdprint{\beta}\code{$\}}
-% \end{quote}
+% \iffalse
+%<*example>
+% \fi
+\def\TEXT{\ifenglish Algorithm for\else Algorithme pour\fi}
+\begin{lstlisting}
+\section{`\TEXT' $U_n$}
+\end{lstlisting}
+% \iffalse
+%</example>
+% \fi
+% \ifenglish%
+% by something along the lines of %
+% \else%
+% par quelque chose comme %
+% \fi%
+% \iffalse
+%<*example>
+% \fi
+\begin{lstlisting}
+\section{`\TEXT' \texorpdfstring{$U_n$}{U[n]}}
+\end{lstlisting}
+% \iffalse
+%</example>
+% \fi
+% \ifenglish%
+% You would also replace %
+% \else
+% De même, vous devriez remplacer %
+% \fi%
+% \iffalse
+%<*example>
+% \fi
+\def\TEXT{Contribution \ifenglish of\else de\fi}
+\begin{lstlisting}
+\subsection{`\TEXT' $\beta$}
+\end{lstlisting}
+% \iffalse
+%</example>
+% \fi
% \ifenglish by\else par\fi
-% \begin{quote}
-% \cmdprint{\subsection}\code{\{\TEXT}\cmdprint{\texorpdfstring}\code{\{$}\cmdprint{\beta}\code{$\}\{beta\}\}}
-% \end{quote}
+% \iffalse
+%<*example>
+% \fi
+\begin{lstlisting}
+\subsection{`\TEXT' \texorpdfstring{$\beta$}{beta}}
+\end{lstlisting}
+% \iffalse
+%</example>
+% \fi
+% \ifenglish or even\else ou encore\fi
+% \iffalse
+%<*example>
+% \fi
+\begin{lstlisting}
+\subsection{`\TEXT' \texorpdfstring{$\beta$}{`β'}}
+\end{lstlisting}
+% \iffalse
+%</example>
+% \fi
% \ifenglish%
-% or, even better if you can enter Unicode characters on the
-% keyboard, by %
+% if you can enter Unicode characters on the keyboard. %
% \else%
-% ou même, si vous pouvez entrer des caractères Unicode au clavier,
-% par %
+% si vous êtes en mesure d'entrer des caractères Unicode au
+% clavier. %
% \fi
-% \begin{quote}
-% \cmdprint{\subsection}\code{\{\TEXT}\cmdprint{\texorpdfstring}\code{\{$}\cmdprint{\beta}\code{$\}\{β\}\}}
-% \end{quote}
% \end{DescribeMacro}
%
% \warningbox{%
@@ -2782,12 +3088,12 @@
% \fi
% \item %
% \ifenglish%
-% (Optional) Appendices --- sections numbered A, B, \dots\ after the
-% command \cmd{\appendix} --- for proofs and longer mathematical
+% (Optional) Appendices---sections numbered A, B, \dots\ after the
+% command \cmd{\appendix}---for proofs and longer mathematical
% arguments. Each appendix must be cited in the main article. %
% \else%
-% (Optionnel) Les annexes --- des sections numérotées A, B, \dots\
-% suite à la commande \cmd{\appendix} ---- pour les démontrations de
+% (Optionnel) Les annexes~--- des sections numérotées A, B, \dots\
+% suite à la commande \cmd{\appendix}~--- pour les démontrations de
% théorèmes ou autres longs développements mathématiques. Chaque
% annexe doit être citée dans l'article. %
% \fi
@@ -2871,10 +3177,11 @@
% \end{itemize}
% Les informations de la page de titre et des parties annexes peuvent
% toujours figurer dans le code source. Autrement dit, vous pouvez
-% créer le matérial additionnel directement à partir du même préambule
-% --- ou gabarit --- que votre article principal; il suffit d'ajouter
+% créer le matérial additionnel directement à partir du même
+% préambule que votre article principal; il suffit d'ajouter
% \code{supplement} aux options de la classe. %
-% \fi \endgroup
+% \fi
+% \endgroup
%
% \ifenglish%
% The option \code{supplement} is compatible with the option
@@ -2955,7 +3262,7 @@
% at the bottom of the first page. The option has no other effect on
% the rendering of the article. %
% \else%
-% L'option \code{final} --- qui a préséance sur \code{review} ---
+% L'option \code{final}~--- qui a préséance sur \code{review}~---
% active la vérification que les informations de publication et que
% l'historique de révision sont fournis. De plus, si les
% informations d'octroi de licence sont fournies à l'aide des
@@ -3006,10 +3313,79 @@
% \else%
% AAAA-MM-JJ. Par exemple: %
% \fi
+% \iffalse
+%<*example>
+% \fi
+\begin{lstlisting}
+\received{`\isodate'}
+\end{lstlisting}
+% \iffalse
+%</example>
+% \fi
+% \end{DescribeMacro}
+% \end{DescribeMacro}
+%
+% \begin{DescribeMacro}{\specialack}
+% \ifenglish%
+% The command \cmd{\specialack} provides a generic interface to
+% give special acknowledgement on the title page, such as the one
+% required by ADNI (\autoref{sec:usage:titling:adni}). The
+% command takes two arguments: %
+% \else%
+% La commande \cmd{\specialack} permet de reconnaitre une
+% contribution spéciale sur la page de titre, telle que celle exigée
+% par l'ADNI (\autoref{sec:usage:titling:adni}). La commande requiert
+% deux arguments: %
+% \fi%
% \begin{quote}
-% \cmdprint{\received}\code{\{2023-06-20\}}
+% \cmdprint{\specialack}\marg{\ifenglish by-line\else signature\fi}\marg{\ifenglish statement\else déclaration\fi}
% \end{quote}
+% \ifenglish%
+% The \meta{by-line} is inserted in the list of authors, whereas the
+% \meta{statement} is typeset at the bottom of the title page, with
+% the licensing information. Each argument may be empty, in which
+% case the corresponding information is not printed. For example,
+% the command \cmd{\ADNIacknowledgement} is effectively defined
+% as: %
+% \else%
+% La \meta{signature} est ajoutée à la liste des auteurs, alors que
+% la \meta{déclaration} est affichée au bas de la page de titre,
+% avec la déclaration de licence. Chaque argument peut être vide,
+% auquel cas l'information correspondante n'est pas affichée. À
+% titre d'exemple, la commande \cmd{\ADNIacknowledgement} est
+% définie ainsi: %
+% \fi%
+% \begin{quote}
+% \cmdprint{\specialack}\code{\{}\cmdprint{\CJS@adnibyline}\code{\}\{}\cmdprint{\CJS@adnistatement}\code{\}}
+% \end{quote}
+% \ifenglish%
+% (The internal commands \cmd{\CJS@adnibyline} and
+% \cmd{\CJS@adnistatement} typeset the official ADNI by-line and
+% statement. The analogous commands \cmd{\CJS@admcbyline} and
+% \cmd{\CJS@admcstatement} serve the same purpose for the
+% Alzheimer’s Disease Metabolomics Consortium.) %
+% \else%
+% (Les commandes internes \cmd{\CJS@adnibyline} et
+% \cmd{\CJS@adnistatement} contiennent le texte officiel de la
+% signature et de la déclaration de l'ADNI. Les commandes analogues
+% \cmd{\CJS@admcbyline} et \cmd{\CJS@admcstatement} pour
+% l'Alzheimer’s Disease Metabolomics Consortium sont également
+% définies dans la classe.) %
+% \fi%
% \end{DescribeMacro}
+%
+% \begin{DescribeMacro}{\specialackmark}
+% \ifenglish%
+% The command \cmd{\specialackmark} sets the footnote marker used by
+% \cmd{\specialack}. The default definition of the marker is: %
+% \else%
+% La commande \cmd{\specialackmark} permet de modifier l'appel de
+% note de bas de page utilisé par \cmd{\specialack}. La définition
+% par défaut de l'appel de note est: %
+% \fi%
+% \begin{quote}
+% \cmdprint{\textsuperscript}\code{\{}\cmdprint{\ensuremath}\code{\{*\}\}}
+% \end{quote}
% \end{DescribeMacro}
%
% \ifenglish%
@@ -3118,6 +3494,7 @@
\newif\ifCJS@final \CJS@finalfalse % final version?
\newif\ifCJS@titlingfooter \CJS@titlingfooterfalse % footer on title page?
\newif\ifCJS@journalinfo \CJS@journalinfotrue % display journal info?
+\newif\ifCJS@specialack \CJS@specialackfalse % special acknowledgement?
\newif\ifCJS@fancybreak \CJS@fancybreaktrue % display fancy break?
\newif\ifCJS@history \CJS@historyfalse % history present?
\newif\ifCJS@corrauth \CJS@corrauthfalse % corresponding author?
@@ -3198,13 +3575,6 @@
% Useful packages like \pkg{iftex} and \pkg{etoolbox} are already
% loaded by \class{memoir}.
%
-% The package \pkg{iflang} provides expandable checks for the current
-% language based on the macro \cmdprint{\languagename} or hyphenation
-% patterns.
-% \begin{macrocode}
-\RequirePackage{iflang}
-% \end{macrocode}
-%
% We rely on \pkg{natbib} for author-year citations. This package must
% be loaded before \pkg{babel}. The option \code{sectionbib} ensures
% that the bibliography (or list of references) is typeset as a
@@ -3369,6 +3739,9 @@
% {\LuaTeX}, commands from \pkg{fontspec} and \pkg{unicode-math} load
% the OpenType variants of the fonts. The encoding is UTF-8 by default
% for these engines.
+% \changes{1.1}{2024-03-06}{Implementation: explicitly set the option
+% \texttt{bold-style!=TeX} when loading the math font with the modern
+% engines.}
% \begin{macrocode}
\iftutex
\RequirePackage[babel=true]{microtype}
@@ -3388,7 +3761,7 @@
[
Extension = .otf,
Scale = 1,
- Ligatures = TeX
+ bold-style = TeX
]
\setmathfont{FiraMath-Regular}
[
@@ -3436,7 +3809,8 @@
% \label{sec:implementation:layout:colours}
%
% We define some colours used by the class. First, the three main
-% colours of {\TheCJS} logo: %
+% colours of {\TheCJS} logo, hand-picked from the SVG code of the
+% latter: %
% \textcolor{CJSpink}{\rule{1.5em}{1.2ex}} %
% \textcolor{CJSred}{\rule{1.5em}{1.2ex}} %
% \textcolor{CJSyellow}{\rule{1.5em}{1.2ex}}\,.
@@ -3455,8 +3829,8 @@
\definecolor{CJSurl}{rgb}{0.6,0,0} % external links
\definecolor{CJScitation}{rgb}{0,0.5,0} % citations
% \end{macrocode}
-% Finally, the colour of the ORCID icon\footnote{%
-% See \url{https://info.orcid.org/brand-guidelines}.}: %
+% Finally, the colour of the %
+% \href{https://info.orcid.org/brand-guidelines}{ORCID icon}: %
% \textcolor{CJSorcid}{\rule{1.5em}{1.2ex}}\,.
% \begin{macrocode}
\definecolor{CJSorcid}{HTML}{A6CE39}
@@ -3497,12 +3871,12 @@
% The decorative element is created using plain {\TeX} rules. Its
% height and depth are identical to the journal information.
% \begin{macrocode}
-\setbox\z@=\vbox{\sffamily\hbox{\CJS@journalname}\hbox{\bfseries V,}}
\newsavebox\CJS@journalornament
\setbox\CJS@journalornament=\vbox{%
+ \setbox\z@=\vbox{\sffamily\hbox{\CJS@journalname}\hbox{\bfseries V,}}
\setbox\tw@\hbox{\vrule \@width4pt\@height\ht\z@\@depth\dp\z@}
- \hbox{\textcolor{CJSpink}{\copy\tw@}\kern2pt%
- \textcolor{CJSred}{\copy\tw@}\kern2pt%
+ \hbox{\textcolor{CJSpink}{\copy\tw@}\kern2pt
+ \textcolor{CJSred}{\copy\tw@}\kern2pt
\textcolor{CJSyellow}{\copy\tw@}\kern6pt}}
% \end{macrocode}
%
@@ -3535,7 +3909,7 @@
%
% First, a command to set the font.
% \begin{macrocode}
-\newcommand*\CJS@setheadfootfont{%
+\def\CJS@setheadfootfont{%
\firalining\fontsize{9}{13}\selectfont}
% \end{macrocode}
%
@@ -3545,7 +3919,7 @@
\newlength\CJS@headdivheight
\settoheight\CJS@headdivheight{\CJS@setheadfootfont 1}
\setlength\CJS@headdivheight{0.9\CJS@headdivheight}
-\newcommand*\CJS@headdivrule{%
+\def\CJS@headdivrule{%
\rule[0.05\CJS@headdivheight]{0.75\normalrulethickness}{\CJS@headdivheight}}
% \end{macrocode}
%
@@ -3614,7 +3988,7 @@
% \label{sec:implementation:layout:titles}
%
% The \class{memoir} class assumes that sectioning starts at the
-% chapter level --- even with the \code{article} option. To get around
+% chapter level---even with the \code{article} option. To get around
% this requirement, we disable the effect of \cmdprint{\chapter}. A
% desirable side effect is to make \cmd{\autoref} work correctly for
% appendices.
@@ -4160,6 +4534,11 @@
\fancybreak{\pfbreakdisplay}
\fi
% \end{macrocode}
+% \changes{1.1}{2024-06-19}{Implementation: fix the positioning of the
+% licensing information at the bottom of the title page.}
+% \changes{1.1}{2024-06-26}{Implementation: include the special
+% acknowledgement statement in the licensing information, if
+% required.}
% Finally, unless overridden by a class option, allocate space
% for the licence statement at the bottom of the title page. By
% default, a notice indicates that the licence will appear
@@ -4173,11 +4552,12 @@
\iflanguage{french}{Futur emplacement de la déclaration de licence.}%
{Licence statement to appear here.}}
\begin{figure}[!b]
- \raisebox{0pt}[0pt][\footskip]{%
+ \raisebox{0pt}[0pt][\dimexpr\CJS@licenceht-\footskip\relax]{%
\vbox{%
\CJS@setlicencefont
\rule{\textwidth}{\normalrulethickness}
\parbox[t][\CJS@licenceht][t]{\textwidth}{%
+ \ifCJS@specialack\CJS@specialackstatement\fi
\ifCJS@final\CJS@licence \else\textit\CJS@notice \fi}}}
\end{figure}
\fi
@@ -4185,6 +4565,45 @@
% \end{macrocode}
% \end{macro}
%
+% \subsubsection{ADNI data use agreement}
+% \label{sec:implementation:titling:adni}
+%
+% \changes{1.1}{2024-06-26}{Implementation: define the new commands
+% \cs{ADNIacknowledgement} and \cs{ADMCacknowledgement}.}
+% \begin{macro}{\ADNIacknowledgement}
+% \begin{macro}{\ADMCacknowledgement}
+% The commands \cmd{\ADNIacknowledgement} and
+% \cmd{\ADMCacknowledgement} automatically create special
+% acknowledgements for the Alzheimer’s Disease Neuroimaging
+% Initiative (ADNI) and the Alzheimer’s Disease Metabolomics
+% Consortium (ADMC), respectively.
+% \begin{macrocode}
+\newcommand*\CJS@adnibyline{for the Alzheimer’s Disease Neuroimaging Initiative}
+\newcommand*\CJS@adnistatement{%
+ Data used in preparation of this article were obtained
+ from the \href{https://adni.loni.usc.edu}{Alzheimer’s Disease Neuroimaging Initiative}
+ (ADNI) database. As such, the investigators within the ADNI
+ contributed to the design and implementation of ADNI and/or provided
+ data but did not participate in the analysis or writing of this
+ report. A complete listing of ADNI investigators can be found at:
+ \url{https://adni.loni.usc.edu/wp-content/uploads/how_to_apply/ADNI_Acknowledgement_List.pdf}.}
+\newcommand*\CJS@admcbyline{for the Alzheimer’s Disease Metabolomics Consortium}
+\newcommand*\CJS@admcstatement{%
+ Data used in preparation of this article were generated by the
+ Alzheimer’s Disease Metabolomics Consortium (ADMC). As such, the
+ investigators within the ADMC provided data but did not participate
+ in analysis or writing of this report. A complete listing of ADMC
+ investigators can be found at:
+ \url{https://sites.duke.edu/adnimetab/team/}.}
+\newcommand*\ADNIacknowledgement{%
+ \specialack{\CJS@adnibyline}{\CJS@adnistatement}}
+\newcommand*\ADMCacknowledgement{%
+ \renewcommand*\CJS@specialackmark{\textsuperscript{\ensuremath{**}}}
+ \specialack{\CJS@admcbyline}{\CJS@admcstatement}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
% \subsection{Back matter}
% \label{sec:implementation:backmatter}
%
@@ -4292,20 +4711,20 @@
%
% First, set the font for the licence statement.
% \begin{macrocode}
-\newcommand*\CJS@setlicencefont{%
+\def\CJS@setlicencefont{%
\firalining\fontsize{8pt}{9pt}\selectfont}
% \end{macrocode}
%
% \begin{macro}{\CJS@measurelicence}
-% We need to compute the required space for a licence statement. The
-% internal command \cmd{\CJS@measurelicence} measures the total
-% height of either the licence statement provided with
-% \cmd{\licence}, or the seemingly longest version of the license
-% statement used by the publisher. The command is used inside
-% \cmd{\maketitle}.
+% We need to compute the required space for a licence statement and,
+% possibly, the ADNI statement. The internal command
+% \cmd{\CJS@measurelicence} measures the total height required using
+% either the licence statement provided with \cmd{\licence}, or the
+% seemingly longest version of the license statement used by the
+% publisher. The command is used inside \cmd{\maketitle}.
% \begin{macrocode}
\newlength\CJS@licenceht
-\newcommand\CJS@licencesample{%
+\def\CJS@licencesample{%
{\ccbyncnd*} 2023 The Authors. The Canadian Journal of
Statistics~{\textbar}~La revue canadienne de statistique published
by Wiley Periodicals LLC on behalf of Statistical Society of
@@ -4319,7 +4738,8 @@
\newcommand\CJS@measurelicence{%
\setbox\CJS@licencebox=\vbox{%
\CJS@setlicencefont
- \ifdefempty{\CJS@licence}{\CJS@licencesample}{\CJS@licence}}
+ \ifCJS@specialack\CJS@specialackstatement\fi
+ \ifdefempty{\CJS@licence}{\CJS@licencesample}{\CJS@licence}}%
\setlength\CJS@licenceht{\dimexpr\ht\CJS@licencebox+\dp\CJS@licencebox}}
% \end{macrocode}
% \end{macro}
@@ -4343,14 +4763,17 @@
% Inspired by the package \pkg{ccicons} (not used by the class since
% \pkg{fontawesome5} contains all the Creative Commons icons).
%
+% \changes{1.1a}{2024-07-25}{Implementation: fix the generation of
+% spacing in the \cs{ccby*} commands.}
% \begin{macro}{\ccby,\ccby*}
% The command \cmd{\ccby} typesets the icons for the Attribution
% licence: {\ccby}.
% \begin{macrocode}
\newcommand*\ccby{\ccby@\@ifstar{~\faCopyright[regular]}\relax}
-\newcommand*\ccby@{\mbox{%
- \faCreativeCommons\kern0.1em%
- \faCreativeCommonsBy\kern0.1em}}
+\def\CJS@fakern{\kern0.1em}
+\def\ccby@{\mbox{%
+ \faCreativeCommons\CJS@fakern
+ \faCreativeCommonsBy\CJS@fakern}}
% \end{macrocode}
% \end{macro}
%
@@ -4359,9 +4782,9 @@
% Attribution"-ShareAlike licence: {\ccbysa}.
% \begin{macrocode}
\newcommand*\ccbysa{\ccbysa@\@ifstar{~\faCopyright[regular]}\relax}
-\newcommand*\ccbysa@{\mbox{%
- \faCreativeCommons\kern0.1em%
- \faCreativeCommonsBy\kern0.1em%
+\def\ccbysa@{\mbox{%
+ \faCreativeCommons\CJS@fakern
+ \faCreativeCommonsBy\CJS@fakern
\faCreativeCommonsSa}}
% \end{macrocode}
% \end{macro}
@@ -4371,9 +4794,9 @@
% Attribution"-NonCommercial licence: {\ccbync}.
% \begin{macrocode}
\newcommand*\ccbync{\ccbync@\@ifstar{~\faCopyright[regular]}\relax}
-\newcommand*\ccbync@{\mbox{%
- \faCreativeCommons\kern0.1em%
- \faCreativeCommonsBy\kern0.1em%
+\def\ccbync@{\mbox{%
+ \faCreativeCommons\CJS@fakern
+ \faCreativeCommonsBy\CJS@fakern
\faCreativeCommonsNc}}
% \end{macrocode}
% \end{macro}
@@ -4384,10 +4807,10 @@
% {\ccbyncsa}.
% \begin{macrocode}
\newcommand*\ccbyncsa{\ccbyncsa@\@ifstar{~\faCopyright[regular]}\relax}
-\newcommand*\ccbyncsa@{\mbox{%
- \faCreativeCommons\kern0.1em%
- \faCreativeCommonsBy\kern0.1em%
- \faCreativeCommonsNc\kern0.1em%
+\def\ccbyncsa@{\mbox{%
+ \faCreativeCommons\CJS@fakern
+ \faCreativeCommonsBy\CJS@fakern
+ \faCreativeCommonsNc\CJS@fakern
\faCreativeCommonsSa}}
% \end{macrocode}
% \end{macro}
@@ -4397,9 +4820,9 @@
% Attribution"-NoDerivatives licence: {\ccbynd}.
% \begin{macrocode}
\newcommand*\ccbynd{\ccbynd@\@ifstar{~\faCopyright[regular]}\relax}
-\newcommand*\ccbynd@{\mbox{%
- \faCreativeCommons\kern0.1em%
- \faCreativeCommonsBy\kern0.1em%
+\def\ccbynd@{\mbox{%
+ \faCreativeCommons\CJS@fakern
+ \faCreativeCommonsBy\CJS@fakern
\faCreativeCommonsNd}}
% \end{macrocode}
% \end{macro}
@@ -4409,10 +4832,10 @@
% Attribution"-NonCommercial"-NoDerivatives licence: {\ccbyncnd}.
% \begin{macrocode}
\newcommand*\ccbyncnd{\ccbyncnd@\@ifstar{~\faCopyright[regular]}\relax}
-\newcommand*\ccbyncnd@{\mbox{%
- \faCreativeCommons\kern0.1em%
- \faCreativeCommonsBy\kern0.1em%
- \faCreativeCommonsNc\kern0.1em%
+\def\ccbyncnd@{\mbox{%
+ \faCreativeCommons\CJS@fakern
+ \faCreativeCommonsBy\CJS@fakern
+ \faCreativeCommonsNc\CJS@fakern
\faCreativeCommonsNd}}
% \end{macrocode}
% \end{macro}
@@ -4447,16 +4870,20 @@
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\mat,\trsp,\tr,\diag}
+% \changes{1.1}{2024-07-13}{Implementation: simpler definition of
+% \cs{mat} and \cs{matit} using \cs{let} instead of \cs{newcommand*}.}
+% \begin{macro}{\mat,\matit,\trsp,\tr,\diag}
% The class provides special commands to typeset matrix and vector
% names, a carefully designed transpose symbol, and the most common
% linear algebra operators.
% \begin{macrocode}
\iftutex
- \newcommand*\mat[1]{\symbf{#1}}
+ \let\mat\symbf
+ \let\matit\symbfit
\newcommand*\trsp{^{\mkern-1.5mu\symsfup{T}}}
\else
- \newcommand*\mat[1]{\mathbf{#1}}
+ \let\mat\mathbf
+ \let\matit\mathbfit
\newcommand*\trsp{^{\mkern-1.5mu\mathsf{T}}}
\fi
\DeclareMathOperator{\tr}{tr}
@@ -4530,6 +4957,8 @@
% \subsection{Computer code and software}
% \label{sec:implementation:software}
%
+% \changes{1.1a}{2024-07-25}{Implementation: prevent hyphenation in
+% \cs{proglang} using a simple \cs{mbox}.}
% \begin{macro}{\proglang}
% The command \cmd{\proglang} provides a means to uniformly typeset
% the name of a software or programming language. The command also
@@ -4537,7 +4966,7 @@
% shortcuts to the most common languages. Notice that the
% \cmd{\Cpplang} case is specially crafted.
% \begin{macrocode}
-\newcommand*\proglang[1]{{\hyphenchar\font=-1 #1}}
+\newrobustcmd*\proglang[1]{\mbox{#1}}
\newcommand*\Rlang{\proglang{R}}
\newcommand*\SASlang{\proglang{SAS}}
\newcommand*\SPSSlang{\proglang{SPSS}}
@@ -4545,13 +4974,13 @@
\newcommand*\Pylang{\proglang{Python}}
\newcommand*\Julialang{\proglang{Julia}}
\newcommand*\Clang{\proglang{C}}
-\newcommand*\CJS@plus{%
+\newcommand*\Cpplang{\proglang{C\CJS@plus\CJS@plus}}
+\def\CJS@plus{%
\ifx\f@family\sfdefault%
\protect\hspace{-.04em}\protect\raisebox{-.125ex}{\larger+}%
\else%
\protect\hspace{-.03em}\protect\raisebox{.25ex}{\smaller+}%
\fi}
-\newcommand*\Cpplang{\proglang{C\CJS@plus\CJS@plus}}
% \end{macrocode}
% \end{macro}
%
@@ -4595,10 +5024,18 @@
% is handled by \pkg{natbib}. We loaded the package with the option
% \code{sectionbib} to obtain the list of references as a section, but
% \class{memoir} will use \cmd{\section} in such instances. We want an
-% unnumbered section. To achieve this efficiently, we redefine
-% the internal command of \class{memoir}.
+% unnumbered section (yet showing in the virtual table of contents of
+% the PDF). To achieve this efficiently, we redefine the internal
+% command of \class{memoir}.
+% \changes{1.1}{2024-07-02}{Implementation: add a
+% \cs{addtocontentsline} command to the redefinition of
+% \cs{@memb@bsec} to include the References section in the virtual
+% table of contents of the PDF.}
% \begin{macrocode}
-\renewcommand{\@memb@bsec}{\section*{\bibname}\prebibhook}
+\renewcommand{\@memb@bsec}{%
+ \section*{\bibname}%
+ \addcontentsline{toc}{section}{\bibname}%
+ \prebibhook}
% \end{macrocode}
%
% Furthermore, we need to redefine the title of the section, because
@@ -4706,14 +5143,14 @@
% \end{macro}
%
% \begin{macro}{\received,\accepted}
-% The article history --- dates when the article was received and
-% accepted --- is printed at the very end of the article when present.
+% The article history---dates when the article was received and
+% accepted---is printed at the very end of the article when present.
% Its treatment involves a number of steps.
%
% First, the dates themselves are input in ISO format YYYY-MM-DD and
% converted in language dependent strings using the package
% \pkg{datetime2}. In English, we want to use the British format
-% without the ordinal for the day: ``1 January 1970''. In French, we
+% without the ordinal for the day: 1 January 1970. In French, we
% can simply rely on the default format.
% \begin{macrocode}
\DTMlangsetup[en-GB]{ord=omit}
@@ -4750,36 +5187,73 @@
% \end{macrocode}
% \end{macro}
%
+% \changes{1.1a}{2024-07-25}{Implementation: replace box registers
+% \cs{@ne} and \cs{thr@@} by \cs{z@} and \cs{tw@}.}
% We also define a decorative element similar to the one used on the
% title page, only adapted for a single line content. To create a
% balanced element, we use the height of a letter with an ascender and
% the depth of the old-style number 4.
% \begin{macrocode}
-\setbox\@ne=\vbox{\hbox{\firaoldstyle\small l4}}
\newsavebox\CJS@historyornament
\setbox\CJS@historyornament=\vbox{%
- \setbox\thr@@\hbox{\vrule \@width1.5pt\@height\ht\@ne\@depth\dp\@ne}
- \hbox{\textcolor{CJSpink}{\copy\thr@@}\kern.75pt%
- \textcolor{CJSred}{\copy\thr@@}\kern.75pt%
- \textcolor{CJSyellow}{\copy\thr@@}\kern3pt}}
+ \setbox\z@=\vbox{\hbox{\firaoldstyle\small l4}}
+ \setbox\tw@\hbox{\vrule \@width1.5pt\@height\ht\z@\@depth\dp\z@}
+ \hbox{\textcolor{CJSpink}{\copy\tw@}\kern.75pt
+ \textcolor{CJSred}{\copy\tw@}\kern.75pt
+ \textcolor{CJSyellow}{\copy\tw@}\kern3pt}}
% \end{macrocode}
%
% Finally, the history information, when present, is printed at the
% end of the article.
% \begin{macrocode}
-\newcommand*\CJS@historybox{
+\def\CJS@historybox{
\par\addvspace{2\baselineskip}\noindent%
\smash{\box\CJS@historyornament \CJS@history}\par%
\vspace*{40pt}}
\AtEndDocument{\ifCJS@journalinfo\ifCJS@history\CJS@historybox\fi\fi}
% \end{macrocode}
% \end{macro}
+%
+% \changes{1.1}{2024-06-26}{Implementation: define the new command
+% \cs{specialack}.}
+% \begin{macro}{\specialack}
+% The command \cmd{\specialack} is the generic interface to give
+% special acknowledgement on the title page. The command inserts its
+% first argument in the list of authors, and its second argument at
+% the bottom of the title page, with the licensing information. Each
+% argument may be empty, in which case the corresponding information
+% is not displayed.
+% \begin{macrocode}
+\def\CJS@specialackstatement{}
+\newcommand*\specialack[2]{%
+ \ifstrempty{#1}{}{%
+ \author{#1\CJS@specialackmark}}
+ \ifstrempty{#2}{}{%
+ \CJS@specialacktrue
+ \renewcommand*\CJS@specialackstatement{\CJS@specialackmark\,#2\medskip\newline}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \changes{1.1}{2024-06-26}{Implementation: define the new command
+% \cs{specialackmark}.}
+% \begin{macro}{\specialackmark}
+% The command \cmd{\specialackmark} changes the footnote marker used
+% by \cmd{\specialack} from its default definition.
+% \begin{macrocode}
+\def\CJS@specialackmark{\textsuperscript{\ensuremath{*}}}
+\newcommand*\specialackmark[1]{%
+ \renewcommand*\CJS@specialackmark{#1}}
+% \end{macrocode}
+% \end{macro}
+%
%</class>
% ^^A <<<<< End of the code of the class
%
% ^^A Change notes for the templates must appear before \Finale
% \changes{0.93}{2023-11-07}{Templates: fix a missing closing brace in
% \cs{author} commands.}
+% \changes{1.1}{2024-01-23}{Templates: revise the description of the
+% \texttt{sharing} environment.}
% \Finale
%
% \iffalse
@@ -4893,18 +5367,18 @@
%<fr> %% la page de titre automatiquement.
\begin{englishabstract}
<Insert your English abstract here. The abstract should be concise
- --- up to 10 lines long --- and descriptive. Avoid symbols as much
- as possible. Formulas are strongly discouraged, and citations
- should be avoided.>
+ (up to 10 lines long) and descriptive. Avoid symbols as much as
+ possible. Formulas are strongly discouraged, and citations should
+ be avoided.>
%<fr> [Un résumé en anglais sera fourni pour les auteurs qui ne peuvent
%<fr> le préparer eux-mêmes.]
\end{englishabstract}
\begin{frenchabstract}
<Insérer le texte du résumé en français ici. Le résumé doit être
- concis --- une dizaine de lignes --- et descriptif. Éviter autant
- que possible les symboles. Les équations mathématiques sont
- fortement découragées et les citations sont à éviter.>
+ concis (une dizaine de lignes) et descriptif. Éviter autant que
+ possible les symboles. Les équations mathématiques sont fortement
+ déconseillées et les citations sont à éviter.>
%<en> [We will supply a French abstract for those authors who
%<en> can't prepare it themselves.]
\end{frenchabstract}
@@ -4958,13 +5432,15 @@
%<fr> <Texte libre>
\end{supplement}
-%<en> %% DATA SHARING (optional - comment out if unused). Describe how to
-%<en> %% access data that you wish to share. Provide a permanent link such
-%<en> %% as a Document Object Identifier (DOI) or an URL.
-%<fr> %% PARTAGE DES DONNÉES (optionnel - commenter si inutilisé).
-%<fr> %% Expliquer comment accéder à des données de l'article mises à
-%<fr> %% disposition. Fournir un lien permanent, comme un identificateur
-%<fr> %% d'objets numériques (DOI) ou une adresse URL.
+%<en> %% DATA SHARING (mandatory). In accordance with the Expect Data
+%<en> %% Sharing editorial policy of Wiley, make a statement about the
+%<en> %% availability or absence of shared data. Provide a permanent link
+%<en> %% such as a Document Object Identifier (DOI) or an URL.
+%<fr> %% PARTAGE DES DONNÉES (obligatoire). Conformément à la politique
+%<fr> %% éditoriale «Expect Data Sharing» de Wiley, vous devez indiquer
+%<fr> %% les conditions de partage des données de recherche, ou l'absence
+%<fr> %% de celles-ci, le cas échéant. Fournir un lien permanent, comme un
+%<fr> %% identificateur d'objets numériques (DOI) ou une adresse URL.
\begin{sharing}
%<en> <Free form text>
%<fr> <Texte libre>
diff --git a/Master/texmf-dist/source/latex/cjs-rcs-article/cjs-rcs-bst-en.dbj b/Master/texmf-dist/source/latex/cjs-rcs-article/cjs-rcs-bst-en.dbj
new file mode 100644
index 00000000000..98372dceb78
--- /dev/null
+++ b/Master/texmf-dist/source/latex/cjs-rcs-article/cjs-rcs-bst-en.dbj
@@ -0,0 +1,611 @@
+%% Driver file to produce cjs-rcs-en.bst from cjs-rcs-merlin.mbs
+%% Originally generated with makebst, version 4.1 (2003/09/08),
+%% on 2023/10/05 at 15:25, then hand edited by Vincent Goulet.
+%%
+\input docstrip
+
+\preamble
+
+Copyright (C) 2023-2024 Statistical Society of Canada | Société
+canadienne de statistique
+
+This file 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
+
+This work has the LPPL maintenance status `maintained'.
+
+The Current Maintainer of this work is Vincent Goulet
+<vincent.goulet@act.ulaval.ca>.
+
+This work consists of the master bibliographic style file
+cjs-rcs-merlin.mbs, the language definition file cjs-rcs-english.mbs,
+the driver file cjs-rcs-en.dbj, and the derived file cjs-rcs-en.bst.
+
+\endpreamble
+
+\postamble
+End of customized bst file
+\endpostamble
+
+\keepsilent
+
+\askforoverwritefalse
+\def\MBopts{\from{cjs-rcs-merlin.mbs}{%
+%EXTERNAL FILES:
+%Name of language file: \cfile=cjs-rcs-english.mbs.
+%No included files.
+ head,\MBopta}
+\from{cjs-rcs-english.mbs}{\MBopta}
+\from{cjs-rcs-merlin.mbs}{tail,\MBopta}}
+\def\MBopta{%
+%INTERNAL LANGUAGE SUPPORT (if no external language file)
+% %: (def) English
+% babel,%: Babel
+%--------------------
+ exlang,%: External language file
+%STYLE OF CITATIONS:
+% %: (def) Numerical
+ ay,%: Author-year
+% alph,%: Alpha style, Jon90 or JWB90
+% alph,alf-1,%: Alpha style, Jon90
+% alph,alf-f,%: Alpha style, Jones90
+% cite,%: Cite key
+%--------------------
+%HTML OUTPUT (if non author-year citations)
+% %: (def) Normal LaTeX
+% html,%: Hypertext
+% html,htlist,%: Hypertext list
+% html,htdes,%: Hypertext with keys
+%--------------------
+%AUTHOR--YEAR SUPPORT SYSTEM (if author-year citations)
+ nat,%: Natbib
+% %: (def) Older Natbib
+% alk,%: Apalike
+% har,%: Harvard
+% ast,%: Astronomy
+% cay,%: Chicago
+% nmd,%: Named
+% cn,%: Author-date
+%--------------------
+%HARVARD EXTENSIONS INCLUDED (if Harvard support selected)
+% harnm,%: With Harvard extensions
+% %: (def) Older Harvard
+%--------------------
+%LANGUAGE FIELD
+% %: (def) No language field
+ lang,%: Add language field
+%--------------------
+%ANNOTATIONS:
+ %: (def) No annotations
+% annote,%: Annotations
+%--------------------
+%PRESENTATIONS:
+ %: (def) Do not add presentation type
+% pres,%: Add presentation, speaker not highlighted
+% pres,pres-bf,%: Presentation, speaker bold face
+% pres,pres-it,%: Presentaion, speaker italic
+% pres,pres-sc,%: Presentaion, speaker in small caps
+%--------------------
+%ORDERING OF REFERENCES (if non-author/year and non-alph)
+% %: (def) Alphabetical
+% seq-no,%: Citation order
+% seq-yr,%: Year ordered
+% seq-yrr,%: Reverse year ordered
+%--------------------
+%ORDERING OF REFERENCES (if author-year citations)
+ %: (def) Alphabetical
+% seq-lab,%: By label
+% seq-labc,%: By label and cite order
+% seq-key,%: By label and cite key
+% seq-yr,%: Year ordered
+% seq-yrr,%: Reverse year ordered
+% seq-no,%: Citation order
+%--------------------
+%ORDER ON VON PART (if not citation order)
+ %: (def) Sort on von part
+% vonx,%: Sort without von part
+%--------------------
+%IGNORE FIRST NAMES (if author-year citations)
+ %: (def) Respect first names
+% xintls,%: Sort on surname only
+%--------------------
+%AUTHOR NAMES:
+% ed-au,%: Full, surname last
+% nm-revf,%: Full, surname first
+% nm-init,ed-au,%: Initials + surname
+ nm-rev,%: Surname + initials
+% nm-rv,%: Surname + dotless initials
+% nm-rvvc,%: Surname + comma + spaceless initials
+% nm-rvx,%: Surname + pure initials
+% nm-rvcx,%: Surname + comma + pure initials
+% nm-rvv,%: Surname + spaceless initials
+% nm-rev1,%: Only first name reversed, initials
+% nm-revv1,%: First name reversed, with full names
+%--------------------
+%EDITOR NAMES IN COLLECTIONS (if author names reversed)
+ %: (def) Editor names NOT reversed
+% ed-rev,%: Editor names reversed
+%--------------------
+%POSITION OF JUNIOR (if author names reversed)
+ jnrlst,%: Junior comes last
+% %: (def) Junior between
+%--------------------
+%JUNIOR PART IN THE CITATION (if author-year citations)
+ %: (def) No `junior' part in the citations
+% jnrlab,%: `Junior' in citations
+%--------------------
+%PUNCTUATION BETWEEN AUTHOR NAMES:
+ %: (def) Author names separated by commas
+% aunm-semi,%: Names separated by semi-colon
+% aunm-sl,%: Names separated by slash
+%--------------------
+%ADJACENT REFERENCES WITH REPEATED NAMES:
+ %: (def) Author/editor names always present
+% nmdash,%: Repeated author/editor names replaced by dash
+% nmdash,nmd-2,%: Repeated author/editor names replaced by 2 dashes
+% nmdash,nmd-3,%: Repeated author/editor names replaced by 3 dashes
+%--------------------
+%NUMBER OF AUTHORS IN BIBLIOGRAPHY:
+ %: (def) All authors
+% nmlm,%: Limited authors
+%--------------------
+%AUTHORS IN CITATIONS:
+ %: (def) One author et al
+% mcite,%: Some other truncation scheme
+%--------------------
+%MAX AUTHORS BEFORE ET AL: (if regular cite not selected)
+% mct-1,%: One et al
+% mct-2,%: One, Two et al
+% mct-3,%: One, Two, Three et al
+% mct-4,%: One, Two, Three, Four et al
+% mct-5,%: One, Two, Three, Four, Five et al
+% mct-6,%: One, Two, Three, Four, Five, Six et al
+%--------------------
+%MAX AUTHORS WITHOUT ET AL: (if regular cite not selected)
+% mct-x2,%: Two authors without truncating
+% mct-x3,%: Three authors
+% mct-x4,%: Four authors
+% mct-x5,%: Five authors
+% mct-x6,%: Six authors
+%--------------------
+%TYPEFACE FOR AUTHORS IN LIST OF REFERENCES:
+ %: (def) Normal font for author names
+% nmft,nmft-sc,%: Small caps authors
+% nmft,nmft-it,%: Italic authors
+% nmft,nmft-bf,%: Bold authors
+% nmft,nmft-def,%: User defined author font
+%--------------------
+%FONT FOR FIRST NAMES (if non-default font for authors)
+% %: (def) First names same font as surnames
+% fnm-rm,%: First names in normal font
+% fnm-def,%: First names in user defined font
+%--------------------
+%EDITOR NAMES IN INCOLLECTION ETC:
+% %: (def) Editors incollection normal font
+% nmfted,%: Editors incollection like authors
+%--------------------
+%FONT FOR `AND' IN LIST:
+% %: (def) `And' in author font
+% nmand-rm,%: `And' in normal font
+%--------------------
+%FONT OF CITATION LABELS IN TEXT (if author-year citations)
+ %: (def) Cited authors plain
+% lab,lab-it,%: Cited authors italic
+% lab,lab-sc,%: Cited authors small caps
+% lab,lab-bf,%: Cited authors bold
+% lab,lab-def,%: User defined citation font
+%--------------------
+%FONT FOR `AND' IN CITATIONS (if non-default font for citation lables)
+% %: (def) Cited `and' in author font
+% and-rm,%: Cited `and' in normal font
+%--------------------
+%FONT OF EXTRA LABEL (The extra letter on the year)
+ %: (def) Extra label plain
+% xlab-it,%: Extra label italic
+%--------------------
+%LABEL WHEN AUTHORS MISSING (if author-year citations)
+ keyxyr,%: Year blank when KEY replaces missing author
+% %: (def) Year included when KEY replaces missing author
+%--------------------
+%MISSING DATE (if author-year citations)
+% %: (def) Missing date set to ????
+ blkyear,%: Missing date left blank
+%--------------------
+%DATE POSITION:
+% %: (def) Date at end
+ dt-beg,%: Date after authors
+% dt-jnl,%: Date part of journal spec.
+% dt-end,%: Date at very end
+%--------------------
+%DATE FORMAT (if non author-year citations)
+% %: (def) Plain month and year
+% yr-par,%: Date in parentheses
+% yr-brk,%: Date in brackets
+% yr-col,%: Date preceded by colon
+% yr-per,%: Date preceded by period
+% yr-com,%: Date preceded by comma
+% yr-blk,%: Date preceded by space
+%--------------------
+%SUPPRESS MONTH:
+% %: (def) Date is month and year
+% xmth,%: Date is year only
+%--------------------
+%REVERSED DATE (if including month)
+% %: (def) Date as month year
+% dtrev,%: Date as year month
+%--------------------
+%DATE FORMAT (if author-year citations)
+% %: (def) Year plain
+ yr-par,%: Year in parentheses
+% yr-brk,%: Year in brackets
+% yr-col,%: Year preceded by colon
+% yr-per,%: Year preceded by period
+% yr-com,%: Date preceded by comma
+% yr-blk,%: Year preceded by space
+%--------------------
+%INCLUDE MONTHS:
+ %: (def) Date is year only
+% aymth,%: Include month in date
+%--------------------
+%REVERSED DATE (if including month)
+% %: (def) Date as month year
+% dtrev,%: Date as year month
+%--------------------
+%DATE PUNCTUATION (if date not at end)
+% %: (def) Date with standard block punctuation
+% yrp-col,%: Colon after date
+% yrp-semi,%: Semi-colon after date
+ yrp-per,%: Period after date
+% yrp-x,%: No punct. after date
+%--------------------
+%BLANK AFTER DATE:
+ %: (def) Space after date
+% yrpp-xsp,%: No space after date
+%--------------------
+%DATE FONT:
+ %: (def) Date in normal font
+% dtbf,%: Date in bold face
+%--------------------
+%TRUNCATE YEAR (if author-year citations)
+ note-yr,%: Year text full
+% %: (def) Year truncated
+%--------------------
+%TITLE OF ARTICLE:
+ %: (def) Title plain
+% tit-it,%: Title italic
+% tit-qq,qt-s,%: Title and punctuation in single quotes
+% tit-qq,%: Title and punctuation in double quotes
+% tit-qq,qt-g,%: Title and punctuation in guillemets
+% tit-qq,qt-s,qx,%: Title in single quotes
+% tit-qq,qx,%: Title in double quotes
+% tit-qq,qt-g,qx,%: Title in guillemets
+%--------------------
+%COLLECTION/PROCEEDINGS TITLES (if quoted title)
+% bt-qq,%: Quote collection and proceedings titles
+% %: (def) Collection and proceedings titles not in quotes
+%--------------------
+%CAPITALIZATION OF ARTICLE TITLE:
+ %: (def) Sentence style
+% atit-u,%: Title style
+%--------------------
+%ARTICLE TITLE PRESENT:
+ %: (def) Article title present
+% jtit-x,%: No article title
+%--------------------
+%JOURNAL NAMES:
+ %: (def) Periods in journal names
+% jxper,%: Dotless journal names
+%--------------------
+%JOURNAL NAME FONT:
+ %: (def) Journal name italics
+% jttl-rm,%: Journal name normal
+%--------------------
+%THESIS TITLE:
+ %: (def) Thesis titles like books
+% thtit-a,%: Thesis title like article
+% thtit-x,%: No thesis title
+%--------------------
+%TECHNICAL REPORT TITLE:
+% %: (def) Tech. report title like articles
+ trtit-b,%: Tech. report title like books
+%--------------------
+%TECHNICAL REPORT NUMBER:
+ %: (def) Tech. report and number plain
+% trnum-it,%: Tech. report and number italic
+%--------------------
+%JOURNAL VOLUME:
+ %: (def) Volume plain
+% vol-it,%: Volume italic
+% vol-bf,%: Volume bold
+% vol-2bf,%: Volume and number bold
+%--------------------
+%JOURNAL VOL AND NUMBER:
+ %: (def) Journal vol(num)
+% vnum-sp,%: Journal vol (num)
+% vnum-cm,%: Journal vol, num
+% vnum-nr,%: Journal vol, no. num
+% vnum-h,%: Journal vol, \# number
+% vnum-b,%: Journal vol number
+% vnum-x,%: Journal vol, without number
+%--------------------
+%VOLUME PUNCTUATION:
+ %: (def) Volume with colon
+% volp-sp,%: Volume with colon and space
+% volp-semi,%: Volume with semi-colon
+% volp-com,%: Volume with comma
+% volp-blk,%: Volume with blank
+%--------------------
+%YEAR IN JOURNAL SPECIFICATION:
+ %: (def) Journal year like others
+% jdt-v,%: Journal vol(year)
+% jdt-vs,%: Journal vol (year)
+% jdt-p,%: Year with pages
+% jdt-pc,%: Year, comma, pages
+%--------------------
+%PAGE NUMBERS:
+ %: (def) Start and stop page numbers
+% jpg-1,%: Only start page number
+%--------------------
+%LARGE PAGE NUMBERS:
+ %: (def) No separators for large page numbers
+% pgsep-c,%: Comma inserted over 9999
+% pgsep-s,%: Thin space inserted over 9999
+% pgsep-p,%: Period inserted over 9999
+%--------------------
+%WORD `PAGE' IN ARTICLES:
+ %: (def) Article pages numbers only
+% jwdpg,%: Include `page' in articles
+%--------------------
+%POSITION OF PAGES:
+ %: (def) Pages given mid text
+% pp-last,%: Pages at end
+%--------------------
+%WORD `VOLUME' IN ARTICLES:
+ %: (def) Article volume as number only
+% jwdvol,%: Include `volume' in articles
+%--------------------
+%NUMBER AND SERIES FOR COLLECTIONS:
+ num-xser,%: Allows number without series
+% %: (def) Standard BibTeX
+%--------------------
+%POSITION OF NUMBER AND SERIES:
+% %: (def) After chapter and pages
+ numser,%: Just before publisher
+%--------------------
+%VOLUME AND SERIES FOR BOOKS/COLLECTIONS:
+ %: (def) Vol. 23 of Series
+% ser-vol,%: Series, vol. 23
+%--------------------
+%POSITION OF VOLUME AND SERIES FOR INCOLLECTIONS:
+% %: (def) Series and volume after the editors
+ ser-ed,%: Series and volume after booktitle
+%--------------------
+%JOURNAL NAME PUNCTUATION:
+ %: (def) Comma after journal
+% jnm-x,%: Space after journal
+%--------------------
+%BOOK TITLE:
+ %: (def) Book title italic
+% btit-rm,bt-rm,%: Book title plain
+%--------------------
+%PAGES IN BOOKS:
+ %: (def) Pages in book plain
+% bkpg-par,%: Pages in book in parentheses
+% bkpg-x,%: Pages in book bare
+%--------------------
+%TOTAL PAGES OF A BOOK:
+ %: (def) Total book pages not printed
+% pg-bk,%: For book: 345 pages
+% pg-bk,pg-pre,%: Total book pages before publisher
+%--------------------
+%PUBLISHER ADDRESS:
+ %: (def) Publisher, address
+% add-pub,%: Address: Publisher
+%--------------------
+%PUBLISHER IN PARENTHESES:
+ %: (def) Publisher as normal block
+% pub-par,%: Publisher in parentheses
+% pub-date,%: Publisher and date in parentheses
+% pub-date,pub-xc,%: Publisher and date in parentheses, no comma
+% pub-date,pub-xpar,%: Publisher and date without parentheses
+% pub-date,pub-xpar,pub-xc,%: Publisher and date, no parentheses, no comma
+%--------------------
+%PUBLISHER POSITION:
+% %: (def) Publisher after chapter, pages
+% pre-pub,%: Publisher before chapter, pages
+ pre-edn,%: Publisher after edition
+%--------------------
+%ISBN NUMBER:
+ isbn,%: Include ISBN
+% %: (def) No ISBN
+%--------------------
+%ISSN NUMBER:
+% issn,%: Include ISSN
+ %: (def) No ISSN
+%--------------------
+%DOI NUMBER:
+% doi,%: Include DOI
+ url-doi,%: Format DOI as URL //dx.doi.org/doi
+% agu-doi,doi,%: Insert DOI AGU style
+% %: (def) No DOI
+%--------------------
+%`EDITOR' AFTER NAMES (EDITED BOOKS WITHOUT AUTHORS):
+ %: (def) Word `editor' after name
+% edpar,%: `Name (editor),'
+% edpar,bkedcap,%: `Name (Editor),'
+% edparc,%: `Name, (editor)'
+% edparc,bkedcap,%: `Name, (Editor)'
+% edparxc,%: `Name (editor)'
+% edparxc,bkedcap,%: `Name (Editor)'
+%--------------------
+%EDITOR IN COLLECTIONS:
+ %: (def) Same as for edited book
+% edby,%: In booktitle, edited by ..
+% edby-par,%: In booktitle (edited by ..)
+% edby-parc,%: In booktitle, (edited by ..)
+% edby,edbyx,%: In booktitle, editor ..
+% edby,edbyw,%: In booktitle, (editor) ..
+% edby-par,edbyx,%: In booktitle (editor..)
+% edby-parc,edbyx,%: In booktitle, (editor..)
+% edby,edbyy,%: In booktitle, .., editor
+% edby-par,edbyy,%: In booktitle (.., editor)
+%--------------------
+%CAPITALIZE `EDITOR' OR `EDITED BY' (if editor capitalizable)
+% %: (def) `(editor,..)' or `(edited by..)'
+% edcap,%: `(Editor,..)' or `(Edited by..)'
+%--------------------
+%PUNCTUATION BETWEEN SECTIONS (BLOCKS):
+ %: (def) \newblock after blocks
+% blk-com,%: Comma between blocks
+% blk-com,com-semi,%: Semi-colon between blocks
+% blk-com,com-blank,%: Blanks between blocks
+% blk-tit,%: Period after titles of articles, books, etc
+% blk-tit,tit-col,%: Colon after titles of articles, books, etc
+% blk-tita,%: Period after titles of articles
+% blk-tita,tit-col,%: Colon after titles of articles
+%--------------------
+%PUNCTUATION BEFORE NOTES (if not using \newblock)
+% %: (def) Notes have regular punctuation
+% blknt,%: Notes preceded by period
+%--------------------
+%PUNCTUATION AFTER AUTHORS:
+ %: (def) Author block normal
+% au-col,%: Author block with colon
+%--------------------
+%PUNCTUATION AFTER `IN':
+ %: (def) Space after `in'
+% in-col,%: Colon after `in'
+% in-it,%: Italic `in'
+% in-col,in-it,%: Italic `in' and colon
+% in-x,%: No word `in'
+%--------------------
+%`IN' WITH JOURNAL NAMES (if using 'in' with collections)
+ %: (def) No `in' before journal name
+% injnl,%: Add `in' before journal name
+%--------------------
+%FINAL PUNCTUATION:
+ %: (def) Period at very end
+% fin-bare,%: No period at end
+%--------------------
+%ABBREVIATE WORD `PAGES' (if not using external language file)
+% %: (def) `Page(s)'
+% pp,%: `Page' abbreviated
+% ppx,%: `Page' omitted
+%--------------------
+%ABBREVIATE WORD `EDITORS':
+% %: (def) `Editor(s)'
+% ed,%: `Editor' abbreviated
+%--------------------
+%OTHER ABBREVIATIONS:
+% %: (def) No abbreviations
+% abr,%: Abbreviations
+%--------------------
+%ABBREVIATION FOR `EDITION' (if abbreviating words)
+% %: (def) `Edition' abbreviated as `edn'
+% ednx,%: `Edition' abbreviated as `ed'
+%--------------------
+%MONTHS WITH DOTS:
+% %: (def) Months with dots
+% mth-bare,%: Months without dots
+%--------------------
+%EDITION NUMBERS:
+% xedn,%: Editions as in database
+% %: (def) Write out editions
+% ord,%: Numerical editions
+%--------------------
+%Reading external language file \cfile=cjs-rcs-english.mbs
+ english,%: English language
+%ABBREVIATE WORD `PAGES'
+ %: (def) `Page(s)'
+% pp,%: `Page' abbreviated
+% ppx,%: `Page' omitted
+%--------------------
+%ABBREVIATE WORD `EDITORS':
+ %: (def) `Editor(s)'
+% ed,%: `Editor' abbreviated
+%--------------------
+%OTHER ABBREVIATIONS:
+% %: (def) No abbreviations
+ abr,%: Abbreviations
+%--------------------
+%ABBREVIATION FOR `EDITION' (if abbreviating words)
+% %: (def) `Edition' abbreviated as `edn'
+ ednx,%: `Edition' abbreviated as `ed'
+%--------------------
+%MONTHS WITH DOTS:
+ %: (def) Months with dots
+% mth-bare,%: Months without dots
+%--------------------
+%EDITION NUMBERS:
+% xedn,%: Editions as in database
+% %: (def) Write out editions
+ ord,%: Numerical editions
+%--------------------
+%STORED JOURNAL NAMES:
+ %: (def) Full journal names
+% jabr,%: Abbreviated journal names
+% jabr,jaa,%: Abbreviated with astronomy shorthands
+%--------------------
+%AMPERSAND:
+ %: (def) Use word `and'
+% amper,%: Use ampersand
+% varand,%: Use \BIBand
+%--------------------
+%COMMA BEFORE `AND':
+ %: (def) Comma before `and'
+% and-xcom,%: No comma before `and'
+% and-com,%: Comma even with 2 authors
+%--------------------
+%COMMA BEFORE `AND' EVEN FOR COLLECTION EDITORS (if using comma before `and' with authors)
+% and-com-ed,%: Comma with 2 editors
+% %: (def) Two editors without comma
+%--------------------
+%NO `AND' IN REFERENCE LIST:
+ %: (def) With `and'
+% xand,%: No `and'
+%--------------------
+%COMMA BEFORE `ET AL':
+% %: (def) Comma before `et al'
+ etal-xc,%: No comma before `et al'
+%--------------------
+%FONT OF `ET AL':
+ %: (def) Plain et al
+% etal-it,%: Italic et al
+% etal-rm,%: Roman et al
+%--------------------
+%ADDITIONAL REVTeX DATA FIELDS:
+ %: (def) No additional fields
+% revdata,eprint,url,url-blk,%: Include REVTeX data fields
+%--------------------
+%E-PRINT DATA FIELD: (without REVTeX fields)
+ %: (def) Do not include eprint field
+% eprint,%: Include eprint and archive fields
+%--------------------
+%URL ADDRESS: (without REVTeX fields)
+% %: (def) No URL
+ url,url-blk,%: Include URL
+% url,url-nt,%: URL as note
+% url,url-nl,%: URL on new line
+%--------------------
+%REFERENCE COMPONENT TAGS:
+ %: (def) No reference component tags
+% bibinfo,%: Reference component tags
+%--------------------
+%EMPHASIS: (affects all so-called italics)
+ %: (def) Use emphasis
+% em-it,%: Use true italics
+% em-x,%: No italics
+% em-ul,%: Underlining
+%--------------------
+%COMPATIBILITY WITH PLAIN TEX:
+ nfss,%: Use LaTeX commands
+% plntx,%: Use only Plain TeX
+%--------------------
+,{%
+ }}
+\generate{\file{cjs-rcs-en.bst}{\MBopts}}
+\endbatchfile
diff --git a/Master/texmf-dist/source/latex/cjs-rcs-article/cjs-rcs-bst-fr.dbj b/Master/texmf-dist/source/latex/cjs-rcs-article/cjs-rcs-bst-fr.dbj
new file mode 100644
index 00000000000..13be31421c3
--- /dev/null
+++ b/Master/texmf-dist/source/latex/cjs-rcs-article/cjs-rcs-bst-fr.dbj
@@ -0,0 +1,603 @@
+%% Driver file to produce cjs-rcs-fr.bst from cjs-rcs-merlin.mbs
+%% Originally generated with makebst, version 4.1 (2003/09/08),
+%% on 2023/10/11 at 12:01, then hand edited by Vincent Goulet.
+%%
+\input docstrip
+
+\preamble
+
+Copyright (C) 2023-2024 Statistical Society of Canada | Société
+canadienne de statistique
+
+This file 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
+
+This work has the LPPL maintenance status `maintained'.
+
+The Current Maintainer of this work is Vincent Goulet
+<vincent.goulet@act.ulaval.ca>.
+
+This work consists of the master bibliographic style file
+cjs-rcs-merlin.mbs, the language definition file cjs-rcs-french.mbs,
+the driver file cjs-rcs-fr.dbj, and the derived file cjs-rcs-fr.bst.
+
+\endpreamble
+
+\postamble
+End of customized bst file
+\endpostamble
+
+\keepsilent
+
+\askforoverwritefalse
+\def\MBopts{\from{cjs-rcs-merlin.mbs}{%
+%EXTERNAL FILES:
+%Name of language file: \cfile=cjs-rcs-french.mbs.
+%No included files.
+ head,\MBopta}
+\from{cjs-rcs-french.mbs}{\MBopta}
+\from{cjs-rcs-merlin.mbs}{tail,\MBopta}}
+\def\MBopta{%
+%INTERNAL LANGUAGE SUPPORT (if no external language file)
+% %: (def) English
+% babel,%: Babel
+%--------------------
+ exlang,%: External language file
+%STYLE OF CITATIONS:
+% %: (def) Numerical
+ ay,%: Author-year
+% alph,%: Alpha style, Jon90 or JWB90
+% alph,alf-1,%: Alpha style, Jon90
+% alph,alf-f,%: Alpha style, Jones90
+% cite,%: Cite key
+%--------------------
+%HTML OUTPUT (if non author-year citations)
+% %: (def) Normal LaTeX
+% html,%: Hypertext
+% html,htlist,%: Hypertext list
+% html,htdes,%: Hypertext with keys
+%--------------------
+%AUTHOR--YEAR SUPPORT SYSTEM (if author-year citations)
+ nat,%: Natbib
+% %: (def) Older Natbib
+% alk,%: Apalike
+% har,%: Harvard
+% ast,%: Astronomy
+% cay,%: Chicago
+% nmd,%: Named
+% cn,%: Author-date
+%--------------------
+%HARVARD EXTENSIONS INCLUDED (if Harvard support selected)
+% harnm,%: With Harvard extensions
+% %: (def) Older Harvard
+%--------------------
+%LANGUAGE FIELD
+% %: (def) No language field
+ lang,%: Add language field
+%--------------------
+%ANNOTATIONS:
+ %: (def) No annotations
+% annote,%: Annotations
+%--------------------
+%PRESENTATIONS:
+ %: (def) Do not add presentation type
+% pres,%: Add presentation, speaker not highlighted
+% pres,pres-bf,%: Presentation, speaker bold face
+% pres,pres-it,%: Presentaion, speaker italic
+% pres,pres-sc,%: Presentaion, speaker in small caps
+%--------------------
+%ORDERING OF REFERENCES (if non-author/year and non-alph)
+% %: (def) Alphabetical
+% seq-no,%: Citation order
+% seq-yr,%: Year ordered
+% seq-yrr,%: Reverse year ordered
+%--------------------
+%ORDERING OF REFERENCES (if author-year citations)
+ %: (def) Alphabetical
+% seq-lab,%: By label
+% seq-labc,%: By label and cite order
+% seq-key,%: By label and cite key
+% seq-yr,%: Year ordered
+% seq-yrr,%: Reverse year ordered
+% seq-no,%: Citation order
+%--------------------
+%ORDER ON VON PART (if not citation order)
+% %: (def) Sort on von part
+ vonx,%: Sort without von part
+%--------------------
+%IGNORE FIRST NAMES (if author-year citations)
+ %: (def) Respect first names
+% xintls,%: Sort on surname only
+%--------------------
+%AUTHOR NAMES:
+% ed-au,%: Full, surname last
+% nm-revf,%: Full, surname first
+% nm-init,ed-au,%: Initials + surname
+% nm-rev,%: Surname + initials
+% nm-rv,%: Surname + dotless initials
+% nm-rvvc,%: Surname + comma + spaceless initials
+% nm-rvx,%: Surname + pure initials
+% nm-rvcx,%: Surname + comma + pure initials
+% nm-rvv,%: Surname + spaceless initials
+ nm-rev1,%: Only first name reversed, initials
+% nm-revv1,%: First name reversed, with full names
+%--------------------
+%EDITOR NAMES IN COLLECTIONS (if author names reversed)
+ %: (def) Editor names NOT reversed
+% ed-rev,%: Editor names reversed
+%--------------------
+%POSITION OF JUNIOR (if author names reversed)
+ jnrlst,%: Junior comes last
+% %: (def) Junior between
+%--------------------
+%JUNIOR PART IN THE CITATION (if author-year citations)
+ %: (def) No `junior' part in the citations
+% jnrlab,%: `Junior' in citations
+%--------------------
+%PUNCTUATION BETWEEN AUTHOR NAMES:
+ %: (def) Author names separated by commas
+% aunm-semi,%: Names separated by semi-colon
+% aunm-sl,%: Names separated by slash
+%--------------------
+%ADJACENT REFERENCES WITH REPEATED NAMES:
+ %: (def) Author/editor names always present
+% nmdash,%: Repeated author/editor names replaced by dash
+% nmdash,nmd-2,%: Repeated author/editor names replaced by 2 dashes
+% nmdash,nmd-3,%: Repeated author/editor names replaced by 3 dashes
+%--------------------
+%NUMBER OF AUTHORS IN BIBLIOGRAPHY:
+ %: (def) All authors
+% nmlm,%: Limited authors
+%--------------------
+%AUTHORS IN CITATIONS:
+ %: (def) One author et al
+% mcite,%: Some other truncation scheme
+%--------------------
+%MAX AUTHORS BEFORE ET AL: (if regular cite not selected)
+% mct-1,%: One et al
+% mct-2,%: One, Two et al
+% mct-3,%: One, Two, Three et al
+% mct-4,%: One, Two, Three, Four et al
+% mct-5,%: One, Two, Three, Four, Five et al
+% mct-6,%: One, Two, Three, Four, Five, Six et al
+%--------------------
+%MAX AUTHORS WITHOUT ET AL: (if regular cite not selected)
+% mct-x2,%: Two authors without truncating
+% mct-x3,%: Three authors
+% mct-x4,%: Four authors
+% mct-x5,%: Five authors
+% mct-x6,%: Six authors
+%--------------------
+%TYPEFACE FOR AUTHORS IN LIST OF REFERENCES:
+ %: (def) Normal font for author names
+% nmft,nmft-sc,%: Small caps authors
+% nmft,nmft-it,%: Italic authors
+% nmft,nmft-bf,%: Bold authors
+% nmft,nmft-def,%: User defined author font
+%--------------------
+%FONT FOR FIRST NAMES (if non-default font for authors)
+% %: (def) First names same font as surnames
+% fnm-rm,%: First names in normal font
+% fnm-def,%: First names in user defined font
+%--------------------
+%EDITOR NAMES IN INCOLLECTION ETC:
+% %: (def) Editors incollection normal font
+% nmfted,%: Editors incollection like authors
+%--------------------
+%FONT FOR `AND' IN LIST:
+% %: (def) `And' in author font
+% nmand-rm,%: `And' in normal font
+%--------------------
+%FONT OF CITATION LABELS IN TEXT (if author-year citations)
+ %: (def) Cited authors plain
+% lab,lab-it,%: Cited authors italic
+% lab,lab-sc,%: Cited authors small caps
+% lab,lab-bf,%: Cited authors bold
+% lab,lab-def,%: User defined citation font
+%--------------------
+%FONT FOR `AND' IN CITATIONS (if non-default font for citation lables)
+% %: (def) Cited `and' in author font
+% and-rm,%: Cited `and' in normal font
+%--------------------
+%FONT OF EXTRA LABEL (The extra letter on the year)
+ %: (def) Extra label plain
+% xlab-it,%: Extra label italic
+%--------------------
+%LABEL WHEN AUTHORS MISSING (if author-year citations)
+ keyxyr,%: Year blank when KEY replaces missing author
+% %: (def) Year included when KEY replaces missing author
+%--------------------
+%MISSING DATE (if author-year citations)
+% %: (def) Missing date set to ????
+ blkyear,%: Missing date left blank
+%--------------------
+%DATE POSITION:
+% %: (def) Date at end
+ dt-beg,%: Date after authors
+% dt-jnl,%: Date part of journal spec.
+% dt-end,%: Date at very end
+%--------------------
+%DATE FORMAT (if non author-year citations)
+% %: (def) Plain month and year
+% yr-par,%: Date in parentheses
+% yr-brk,%: Date in brackets
+% yr-col,%: Date preceded by colon
+% yr-per,%: Date preceded by period
+% yr-com,%: Date preceded by comma
+% yr-blk,%: Date preceded by space
+%--------------------
+%SUPPRESS MONTH:
+% %: (def) Date is month and year
+% xmth,%: Date is year only
+%--------------------
+%REVERSED DATE (if including month)
+% %: (def) Date as month year
+% dtrev,%: Date as year month
+%--------------------
+%DATE FORMAT (if author-year citations)
+% %: (def) Year plain
+% yr-par,%: Year in parentheses
+% yr-brk,%: Year in brackets
+% yr-col,%: Year preceded by colon
+ yr-per,%: Year preceded by period
+% yr-com,%: Date preceded by comma
+% yr-blk,%: Year preceded by space
+%--------------------
+%INCLUDE MONTHS:
+ %: (def) Date is year only
+% aymth,%: Include month in date
+%--------------------
+%REVERSED DATE (if including month)
+% %: (def) Date as month year
+% dtrev,%: Date as year month
+%--------------------
+%DATE PUNCTUATION (if date not at end)
+ %: (def) Date with standard block punctuation
+% yrp-col,%: Colon after date
+% yrp-semi,%: Semi-colon after date
+% yrp-per,%: Period after date
+% yrp-x,%: No punct. after date
+%--------------------
+%BLANK AFTER DATE:
+ %: (def) Space after date
+% yrpp-xsp,%: No space after date
+%--------------------
+%DATE FONT:
+ %: (def) Date in normal font
+% dtbf,%: Date in bold face
+%--------------------
+%TRUNCATE YEAR (if author-year citations)
+ note-yr,%: Year text full
+% %: (def) Year truncated
+%--------------------
+%TITLE OF ARTICLE:
+% %: (def) Title plain
+% tit-it,%: Title italic
+% tit-qq,qt-s,%: Title and punctuation in single quotes
+% tit-qq,%: Title and punctuation in double quotes
+% tit-qq,qt-g,%: Title and punctuation in guillemets
+% tit-qq,qt-s,qx,%: Title in single quotes
+% tit-qq,qx,%: Title in double quotes
+ tit-qq,qt-g,qx,%: Title in guillemets
+%--------------------
+%COLLECTION/PROCEEDINGS TITLES (if quoted title)
+% bt-qq,%: Quote collection and proceedings titles
+ %: (def) Collection and proceedings titles not in quotes
+%--------------------
+%CAPITALIZATION OF ARTICLE TITLE:
+ %: (def) Sentence style
+% atit-u,%: Title style
+%--------------------
+%ARTICLE TITLE PRESENT:
+ %: (def) Article title present
+% jtit-x,%: No article title
+%--------------------
+%JOURNAL NAMES:
+ %: (def) Periods in journal names
+% jxper,%: Dotless journal names
+%--------------------
+%JOURNAL NAME FONT:
+ %: (def) Journal name italics
+% jttl-rm,%: Journal name normal
+%--------------------
+%THESIS TITLE:
+ %: (def) Thesis titles like books
+% thtit-a,%: Thesis title like article
+% thtit-x,%: No thesis title
+%--------------------
+%TECHNICAL REPORT TITLE:
+% %: (def) Tech. report title like articles
+ trtit-b,%: Tech. report title like books
+%--------------------
+%TECHNICAL REPORT NUMBER:
+ %: (def) Tech. report and number plain
+% trnum-it,%: Tech. report and number italic
+%--------------------
+%JOURNAL VOLUME:
+ %: (def) Volume plain
+% vol-it,%: Volume italic
+% vol-bf,%: Volume bold
+% vol-2bf,%: Volume and number bold
+%--------------------
+%JOURNAL VOL AND NUMBER:
+% %: (def) Journal vol(num)
+% vnum-sp,%: Journal vol (num)
+% vnum-cm,%: Journal vol, num
+ vnum-nr,%: Journal vol, no. num
+% vnum-h,%: Journal vol, \# number
+% vnum-b,%: Journal vol number
+% vnum-x,%: Journal vol, without number
+%--------------------
+%VOLUME PUNCTUATION:
+% %: (def) Volume with colon
+% volp-sp,%: Volume with colon and space
+% volp-semi,%: Volume with semi-colon
+ volp-com,%: Volume with comma
+% volp-blk,%: Volume with blank
+%--------------------
+%YEAR IN JOURNAL SPECIFICATION:
+ %: (def) Journal year like others
+% jdt-v,%: Journal vol(year)
+% jdt-vs,%: Journal vol (year)
+% jdt-p,%: Year with pages
+% jdt-pc,%: Year, comma, pages
+%--------------------
+%PAGE NUMBERS:
+ %: (def) Start and stop page numbers
+% jpg-1,%: Only start page number
+%--------------------
+%LARGE PAGE NUMBERS:
+% %: (def) No separators for large page numbers
+% pgsep-c,%: Comma inserted over 9999
+ pgsep-s,%: Thin space inserted over 9999
+% pgsep-p,%: Period inserted over 9999
+%--------------------
+%WORD `PAGE' IN ARTICLES:
+% %: (def) Article pages numbers only
+ jwdpg,%: Include `page' in articles
+%--------------------
+%POSITION OF PAGES:
+ %: (def) Pages given mid text
+% pp-last,%: Pages at end
+%--------------------
+%WORD `VOLUME' IN ARTICLES:
+% %: (def) Article volume as number only
+ jwdvol,%: Include `volume' in articles
+%--------------------
+%NUMBER AND SERIES FOR COLLECTIONS:
+ num-xser,%: Allows number without series
+% %: (def) Standard BibTeX
+%--------------------
+%POSITION OF NUMBER AND SERIES:
+% %: (def) After chapter and pages
+ numser,%: Just before publisher
+%--------------------
+%VOLUME AND SERIES FOR BOOKS/COLLECTIONS:
+% %: (def) Vol. 23 of Series
+ ser-vol,%: Series, vol. 23
+%--------------------
+%POSITION OF VOLUME AND SERIES FOR INCOLLECTIONS:
+% %: (def) Series and volume after the editors
+ ser-ed,%: Series and volume after booktitle
+%--------------------
+%JOURNAL NAME PUNCTUATION:
+ %: (def) Comma after journal
+% jnm-x,%: Space after journal
+%--------------------
+%BOOK TITLE:
+ %: (def) Book title italic
+% btit-rm,bt-rm,%: Book title plain
+%--------------------
+%PAGES IN BOOKS:
+ %: (def) Pages in book plain
+% bkpg-par,%: Pages in book in parentheses
+% bkpg-x,%: Pages in book bare
+%--------------------
+%TOTAL PAGES OF A BOOK:
+% %: (def) Total book pages not printed
+ pg-bk,%: For book: 345 pages
+% pg-bk,pg-pre,%: Total book pages before publisher
+%--------------------
+%PUBLISHER ADDRESS:
+ %: (def) Publisher, address
+% add-pub,%: Address: Publisher
+%--------------------
+%PUBLISHER IN PARENTHESES:
+ %: (def) Publisher as normal block
+% pub-par,%: Publisher in parentheses
+% pub-date,%: Publisher and date in parentheses
+% pub-date,pub-xc,%: Publisher and date in parentheses, no comma
+% pub-date,pub-xpar,%: Publisher and date without parentheses
+% pub-date,pub-xpar,pub-xc,%: Publisher and date, no parentheses, no comma
+%--------------------
+%PUBLISHER POSITION:
+% %: (def) Publisher after chapter, pages
+ pre-pub,%: Publisher before chapter, pages
+ pre-edn,%: Publisher after edition
+%--------------------
+%ISBN NUMBER:
+ isbn,%: Include ISBN
+% %: (def) No ISBN
+%--------------------
+%ISSN NUMBER:
+% issn,%: Include ISSN
+ %: (def) No ISSN
+%--------------------
+%DOI NUMBER:
+% doi,%: Include DOI
+ url-doi,%: Format DOI as URL //doi.org/doi
+% agu-doi,doi,%: Insert DOI AGU style
+% %: (def) No DOI
+%--------------------
+%`EDITOR' AFTER NAMES (EDITED BOOKS WITHOUT AUTHORS):
+% %: (def) Word `editor' after name
+% edpar,%: `Name (editor),'
+% edpar,bkedcap,%: `Name (Editor),'
+% edparc,%: `Name, (editor)'
+% edparc,bkedcap,%: `Name, (Editor)'
+ edparxc,%: `Name (editor)'
+% edparxc,bkedcap,%: `Name (Editor)'
+%--------------------
+%EDITOR IN COLLECTIONS:
+% %: (def) Same as for edited book
+ edby,%: In booktitle, edited by ..
+% edby-par,%: In booktitle (edited by ..)
+% edby-parc,%: In booktitle, (edited by ..)
+% edby,edbyx,%: In booktitle, editor ..
+% edby,edbyw,%: In booktitle, (editor) ..
+% edby-par,edbyx,%: In booktitle (editor..)
+% edby-parc,edbyx,%: In booktitle, (editor..)
+% edby,edbyy,%: In booktitle, .., editor
+% edby-par,edbyy,%: In booktitle (.., editor)
+%--------------------
+%CAPITALIZE `EDITOR' OR `EDITED BY' (if editor capitalizable)
+% %: (def) `(editor,..)' or `(edited by..)'
+% edcap,%: `(Editor,..)' or `(Edited by..)'
+%--------------------
+%PUNCTUATION BETWEEN SECTIONS (BLOCKS):
+% %: (def) \newblock after blocks
+ blk-com,%: Comma between blocks
+% blk-com,com-semi,%: Semi-colon between blocks
+% blk-com,com-blank,%: Blanks between blocks
+% blk-tit,%: Period after titles of articles, books, etc
+% blk-tit,tit-col,%: Colon after titles of articles, books, etc
+% blk-tita,%: Period after titles of articles
+% blk-tita,tit-col,%: Colon after titles of articles
+%--------------------
+%PUNCTUATION BEFORE NOTES (if not using \newblock)
+% %: (def) Notes have regular punctuation
+ blknt,%: Notes preceded by period
+%--------------------
+%PUNCTUATION AFTER AUTHORS:
+ %: (def) Author block normal
+% au-col,%: Author block with colon
+%--------------------
+%PUNCTUATION AFTER `IN':
+ %: (def) Space after `in'
+% in-col,%: Colon after `in'
+% in-it,%: Italic `in'
+% in-col,in-it,%: Italic `in' and colon
+% in-x,%: No word `in'
+%--------------------
+%`IN' WITH JOURNAL NAMES (if using 'in' with collections)
+ %: (def) No `in' before journal name
+% injnl,%: Add `in' before journal name
+%--------------------
+%FINAL PUNCTUATION:
+ %: (def) Period at very end
+% fin-bare,%: No period at end
+%--------------------
+%ABBREVIATE WORD `PAGES' (if not using external language file)
+% %: (def) `Page(s)'
+% pp,%: `Page' abbreviated
+% ppx,%: `Page' omitted
+%--------------------
+%ABBREVIATE WORD `EDITORS':
+% %: (def) `Editor(s)'
+% ed,%: `Editor' abbreviated
+%--------------------
+%OTHER ABBREVIATIONS:
+% %: (def) No abbreviations
+% abr,%: Abbreviations
+%--------------------
+%ABBREVIATION FOR `EDITION' (if abbreviating words)
+% %: (def) `Edition' abbreviated as `edn'
+% ednx,%: `Edition' abbreviated as `ed'
+%--------------------
+%MONTHS WITH DOTS:
+% %: (def) Months with dots
+% mth-bare,%: Months without dots
+%--------------------
+%EDITION NUMBERS:
+% xedn,%: Editions as in database
+% %: (def) Write out editions
+% ord,%: Numerical editions
+%--------------------
+%Reading external language file \cfile=cjs-rcs-french.mbs
+ french,%: French language
+%ABBREVIATE WORD `PAGES':
+% %: (def) `Page(s)'
+ pp,%: `Page' abbreviated
+% ppx,%: `Page' omitted
+%--------------------
+%ABBREVIATE WORD `EDITEUR:
+% %: (def) `\'Editeur(s)'
+ ed,%: `\'Editeur' abbreviated
+%--------------------
+%OTHER ABBREVIATIONS:
+% %: (def) No abbreviations
+ abr,%: Abbreviations
+%--------------------
+%EDITION NUMBERS:
+% xedn,%: Editions as in database
+% %: (def) Write out editions
+ ord,%: Numerical editions
+%--------------------
+%STORED JOURNAL NAMES:
+ %: (def) Full journal names
+% jabr,%: Abbreviated journal names
+% jabr,jaa,%: Abbreviated with astronomy shorthands
+%--------------------
+%AMPERSAND:
+ %: (def) Use word `and'
+% amper,%: Use ampersand
+% varand,%: Use \BIBand
+%--------------------
+%COMMA BEFORE `AND':
+% %: (def) Comma before `and'
+ and-xcom,%: No comma before `and'
+% and-com,%: Comma even with 2 authors
+%--------------------
+%COMMA BEFORE `AND' EVEN FOR COLLECTION EDITORS (if using comma before `and' with authors)
+% and-com-ed,%: Comma with 2 editors
+% %: (def) Two editors without comma
+%--------------------
+%NO `AND' IN REFERENCE LIST:
+ %: (def) With `and'
+% xand,%: No `and'
+%--------------------
+%COMMA BEFORE `ET AL':
+% %: (def) Comma before `et al'
+ etal-xc,%: No comma before `et al'
+%--------------------
+%FONT OF `ET AL':
+ %: (def) Plain et al
+% etal-it,%: Italic et al
+% etal-rm,%: Roman et al
+%--------------------
+%ADDITIONAL REVTeX DATA FIELDS:
+ %: (def) No additional fields
+% revdata,eprint,url,url-blk,%: Include REVTeX data fields
+%--------------------
+%E-PRINT DATA FIELD: (without REVTeX fields)
+ %: (def) Do not include eprint field
+% eprint,%: Include eprint and archive fields
+%--------------------
+%URL ADDRESS: (without REVTeX fields)
+% %: (def) No URL
+ url,url-blk,%: Include URL
+% url,url-nt,%: URL as note
+% url,url-nl,%: URL on new line
+%--------------------
+%REFERENCE COMPONENT TAGS:
+ %: (def) No reference component tags
+% bibinfo,%: Reference component tags
+%--------------------
+%EMPHASIS: (affects all so-called italics)
+ %: (def) Use emphasis
+% em-it,%: Use true italics
+% em-x,%: No italics
+% em-ul,%: Underlining
+%--------------------
+%COMPATIBILITY WITH PLAIN TEX:
+ nfss,%: Use LaTeX commands
+% plntx,%: Use only Plain TeX
+%--------------------
+,{%
+ }}
+\generate{\file{cjs-rcs-fr.bst}{\MBopts}}
+\endbatchfile
diff --git a/Master/texmf-dist/source/latex/cjs-rcs-article/cjs-rcs-class.dbj b/Master/texmf-dist/source/latex/cjs-rcs-article/cjs-rcs-class.dbj
new file mode 100644
index 00000000000..3ef16366bdf
--- /dev/null
+++ b/Master/texmf-dist/source/latex/cjs-rcs-article/cjs-rcs-class.dbj
@@ -0,0 +1,39 @@
+\input docstrip.tex
+\keepsilent
+\askforoverwritefalse
+\nopostamble
+\preamble
+
+This is a generated file.
+
+Copyright (C) 2023-2024 Statistical Society of Canada | Société
+canadienne de statistique
+
+This file 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 2006/05/20 or later.
+
+This work has the LPPL maintenance status `maintained'.
+
+The Current Maintainer of this work is Vincent Goulet
+<vincent.goulet@act.ulaval.ca>.
+
+This work consists of the file cjs-rcs-article.dtx and the derived
+files cjs-rcs-article.cls, cjs-rcs-article-fr.tex, cjs-template.tex
+and rcs-gabarit.tex.
+
+\endpreamble
+
+\generate{
+ \file{cjs-rcs-article.cls}{\from{cjs-rcs-article.dtx}{class}}
+ \file{cjs-rcs-article-fr.tex}{\nopreamble\from{cjs-rcs-article.dtx}{fr-doc}}
+ \file{cjs-template.tex}{\nopreamble\from{cjs-rcs-article.dtx}{template,en}}
+ \file{rcs-gabarit.tex}{\nopreamble\from{cjs-rcs-article.dtx}{template,fr}}
+}
+\endbatchfile
diff --git a/Master/texmf-dist/source/latex/cjs-rcs-article/cjs-rcs-english.mbs b/Master/texmf-dist/source/latex/cjs-rcs-article/cjs-rcs-english.mbs
new file mode 100644
index 00000000000..18f0ccbd780
--- /dev/null
+++ b/Master/texmf-dist/source/latex/cjs-rcs-article/cjs-rcs-english.mbs
@@ -0,0 +1,420 @@
+% \iffalse meta-comment -*- mode: doctex -*-
+%
+% English language definition file of the master bibliography style
+% for The Canadian Journal of Statistics | La revue canadienne de
+% statistique
+%
+% Copyright (C) 2023-2024 Statistical Society of Canada | Société
+% canadienne de statistique
+%
+% This file 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
+%
+% This work has the LPPL maintenance status `maintained'.
+%
+% The Current Maintainer of this work is Vincent Goulet
+% <vincent.goulet@act.ulaval.ca>.
+%
+% This work derives from english.mbs, part of the custom-bib
+% collection, a contribution to the LaTeX2e system.
+% Copyright 1994-2002 Patrick W Daly
+% Max-Planck-Institut f\"ur Sonnensystemforschung
+% Max-Planck-Str. 2
+% D-37191 Katlenburg-Lindau
+% Germany
+% E-mail: daly@mps.mpg.de
+%
+ %-------------------------------------------------------------------
+ % Begin module:
+%\fi
+ % \ProvidesFile{cjs-rcs-english.mbs}[2024/07/30 v1.1a (VG, PWD)]
+%\iffalse
+%<*a&!a>
+% The following ensures that the driver part is not seen by makebst
+% The driver part must not contain any \end other than \end{document} !
+\ifx\endoptions\undefined\let\tempx=\relax\else
+ \long\def\tempx#1\end#2{}\fi\tempx
+%</a&!a>
+%<*driver>
+\NeedsTeXFormat{LaTeX2e}%
+\documentclass[nocjs,x11names,french,english]{cjs-rcs-article}
+
+ %% Loading doc.sty creates some conflicts with the class and memoir. We
+ %% need to:
+ %%
+ %% - keep a copy of the class' \maketitle command;
+ %% - undefine the 'glossary' environment created by memoir;
+ %% - restore the standard LaTeX commands for the glossary that
+ %% doc.sty relies upon.
+ \let\makeCJStitle\maketitle % keep class definition
+ \let\theglossary\relax % avoid conflict with doc.sty
+ \let\endtheglossary\relax % avoid conflict with doc.sty
+ \makeatletter
+ \def\makeglossary{%
+ \newwrite\@glossaryfile
+ \immediate\openout\@glossaryfile=\jobname.glo
+ \def\glossary{\@bsphack\begingroup
+ \@sanitize
+ \@wrglossary}\typeout
+ {Writing glossary file \jobname.glo }%
+ \let\makeglossary\@empty
+ }
+ \@onlypreamble\makeglossary
+ \def\@wrglossary#1{%
+ \protected@write\@glossaryfile{}%
+ {\string\glossaryentry{#1}{\thepage}}%
+ \endgroup
+ \@esphack}
+ \def\glossary{\@bsphack\begingroup\@sanitize\@index}
+ \@twosidefalse\@mparswitchfalse % turn off twoside option
+ \makeatother
+ \usepackage{doc}
+ \def\changes#1#2#3{\glossary{#1>#3}} % simplified
+ \DisableCrossrefs
+ \CodelineNumbered
+ \RecordChanges
+ \OnlyDescription
+ \DontCheckModules
+
+ \AtEndPreamble{%
+ \hypersetup{%
+ pdfauthor = {Statistical Society of Canada},
+ pdftitle = {French language definition file cjs-rcs-french.mbs}}}
+
+ %% Configuration of the glossary
+ \addto\extrasenglish{%
+ \def\glossaryname{History of changes}}
+ \GlossaryPrologue{\section*{\glossaryname}%
+ \addcontentsline{toc}{section}{\glossaryname}}
+ \setlength{\GlossaryMin}{5cm}
+
+ %% Additional semantic typesetting
+ \newcommand*\class[1]{\textsf{#1}}
+ \newcommand*\dtx{\textsf{docstrip}}
+
+ %% Name of the journal
+ \makeatletter
+ \newcommand*\TheCJS{\@ifstar{\emph{The Journal}}{\emph{\CJS@journalname@en}}}
+ \newcommand*\LaRevue{\@ifstar{\emph{La revue}}{\emph{\CJS@journalname@fr}}}
+ \newcommand*\CJSclass{\class{cjs-rcs-article}}
+ \newcommand*\CJSbsten{\texttt{cjs-rcs-en.bst}}
+ \newcommand*\CJSbstfr{\texttt{cjs-rcs-fr.bst}}
+ \makeatother
+
+ %% Redefine \year using information from \filedate instead of using
+ %% compilation time
+ \def\parsedate#1/#2/#3\relax{\def\year{#1}}
+
+ \MakeShortVerb{\|}
+
+\begin{document}
+ \DocInput{cjs-rcs-english.mbs}
+\end{document}
+%</driver>
+% end of meta-comment \fi
+% \GetFileInfo{cjs-rcs-english.mbs}
+% \expandafter\parsedate\filedate\relax
+%
+% \changes{0.9}{2023-10-14}{Initial version based on version 4.2 of
+% \texttt{english.mbs} from \textbf{custom-bib}.}
+% \changes{0.93}{2023-11-06}{Add a prefix v in the version number like
+% the main file.}
+% \changes{1.0}{2023-11-29}{First official release distributed through
+% CTAN.}
+%
+% \title[English language definition file \filename]{%
+% English language definition file \\
+% of the master bibliographic style file \\
+% for \TheCJS}
+% \author{Statistical Society of Canada}
+% \affil{Developed by Vincent Goulet, Université Laval}
+%
+% \begin{englishabstract}
+% The list of references in {\TheCJS} is typeset using the
+% bibliographic styles {\CJSbsten} for articles in English and
+% {\CJSbstfr} for articles in French. These styles are created using
+% the program \texttt{makebst} from the master bibliographic file
+% \texttt{cjs-rcs-merlin.mbs}, and the language definition files
+% \texttt{cjs-rcs-english.mbs} and \texttt{cjs-rcs-french.mbs}.
+% \end{englishabstract}
+% \begin{frenchabstract}
+% La liste des références dans {\LaRevue} est composée avec les
+% style de bibliographie {\CJSbstfr} pour les articles en français
+% et {\CJSbsten} pour les articles en anglais. Ceux-ci sont générés
+% par le programme \texttt{makebst} à partir du fichier maitre
+% \texttt{cjs-rcs-merlin.mbs} et des fichiers de localisation
+% \texttt{cjs-rcs-english.mbs} et \texttt{cjs-rcs-french.mbs}.
+% \end{frenchabstract}
+%
+% ^^A abusing the 'classification' environment. The final period is
+% ^^A added by the environment.
+% \begin{classification}[Version]
+% \item[] This is the documentation for the file \code{\filename}
+% {\fileversion}, dated {\filedate}
+% \end{classification}
+%
+% \licence{{\year}, Statistical Society of Canada~{\textbar}~Société
+% canadienne de statistique}
+%
+% \makeCJStitle
+%
+% \section{Introduction}
+%
+% This file is to be used as a language definition file with the
+% master bibliographic file for {\TheCJS}. The language it defines is
+% English.
+%
+% This is not a self-sufficient \texttt{.mbs} file, but rather may
+% be used together with one that contains language support via
+% external definition files.
+%
+% See the documentation for \texttt{makebst} for formatting details.
+%
+% \section{The Menu Information}
+%
+% All the menu information is nested between \dtx{} guard options
+% |%<*options>| \dots\ |%</options>|, and the last command is
+% |\endoptions|. The rest of the file is nested between |%<*!options&!driver>|
+% \dots\ |%</!options&!driver>| in order to exclude it if \dtx{} is used to
+% extract only the menu information or the documentation driver.
+%
+% \begin{macrocode}
+%<*options>
+\mes{^^JOptions for ENGLISH}
+\wr{\spsp\spsp english,\pc: English language}
+
+\beginoptiongroup{ABBREVIATE WORD `PAGES'}{}
+\optdef{*}{}{`Page(s)'}{(no abbreviation)}
+\optdef{a}{pp}{`Page' abbreviated}{as p. or pp.}
+\optdef{x}{ppx}{`Page' omitted}{}
+\getans
+\endoptiongroup
+\beginoptiongroup{ABBREVIATE WORD `EDITORS':}{}
+\optdef{*}{}{`Editor(s)'}{(no abbreviation)}
+\optdef{a}{ed}{`Editor' abbreviated}{as ed. or eds.}
+\getans
+\endoptiongroup
+\beginoptiongroup{OTHER ABBREVIATIONS:}{}
+\optdef{*}{}{No abbreviations}{of volume, edition, chapter, etc}
+\optdef{a}{abr}{Abbreviations}{of such words}
+\getans
+\endoptiongroup
+\beginoptiongroup{ABBREVIATION FOR `EDITION'
+ (if abbreviating words)}
+ {\if\ans a*\fi}%
+\optdef{*}{}{`Edition' abbreviated as `edn'}{}
+\optdef{a}{ednx}{`Edition' abbreviated as `ed'}{}
+\getans
+\beginoptiongroup{MONTHS WITH DOTS:}{}
+\optdef{*}{}{Months with dots}{as Jan.}
+\optdef{x}{mth-bare}{Months without dots}{as Feb Mar}
+\getans
+\endoptiongroup
+\endoptiongroup
+\beginoptiongroup{EDITION NUMBERS:}{}
+\optdef{*}{xedn}{Editions as in database}{saving much processing memory}
+\optdef{w}{}{Write out editions}{as first, second, third, etc}
+\optdef{n}{ord}{Numerical editions}{as 1st, 2nd, 3rd, etc}
+\getans
+\endoptiongroup
+\endoptions
+%</options>
+% \end{macrocode}
+%
+% \StopEventually{\PrintChanges}
+%
+% \section{The Coding}
+% \begin{macrocode}
+%<*!options&!driver>
+
+ % The language selected here is ENGLISH
+FUNCTION {bbl.and}
+{ "and"}
+
+FUNCTION {bbl.etal}
+{ "et~al." }
+
+FUNCTION {bbl.editors}
+%<!ed>{ "editors" }
+%<ed>{ "eds." }
+
+FUNCTION {bbl.editor}
+%<!ed>{ "editor" }
+%<ed>{ "ed." }
+
+FUNCTION {bbl.edby}
+{ "edited by" }
+
+FUNCTION {bbl.edition}
+%<!abr>{ "edition" }
+%<abr&!ednx>{ "edn." }
+%<abr&ednx>{ "ed." }
+
+FUNCTION {bbl.volume}
+%<!abr>{ "volume" }
+%<abr>{ "vol." }
+
+FUNCTION {bbl.of}
+{ "of" }
+
+FUNCTION {bbl.number}
+%<!abr>{ "number" }
+%<abr>{ "no." }
+
+FUNCTION {bbl.nr}
+{ "no." }
+
+FUNCTION {bbl.in}
+{ "in" }
+
+FUNCTION {bbl.pages}
+%<!pp&!ppx>{ "pages" }
+%<pp>{ "pp." }
+%<!pp&ppx>{ "" }
+
+FUNCTION {bbl.page}
+%<!pp&!ppx>{ "page" }
+%<pp>{ "p." }
+%<!pp&ppx>{ "" }
+
+%<*revdata>
+FUNCTION {bbl.eidpp}
+{ "pages" }
+
+%</revdata>
+FUNCTION {bbl.chapter}
+%<!abr>{ "chapter" }
+%<abr>{ "chap." }
+
+FUNCTION {bbl.techrep}
+%<!abr>{ "Technical Report" }
+%<abr>{ "Tech. Rep." }
+
+FUNCTION {bbl.mthesis}
+{ "Master's thesis" }
+
+FUNCTION {bbl.phdthesis}
+{ "Ph.D. thesis" }
+
+%<*!xedn>
+FUNCTION {bbl.first}
+%<!ord>{ "First" }
+%<ord>{ "1st" }
+
+FUNCTION {bbl.second}
+%<!ord>{ "Second" }
+%<ord>{ "2nd" }
+
+FUNCTION {bbl.third}
+%<!ord>{ "Third" }
+%<ord>{ "3rd" }
+
+FUNCTION {bbl.fourth}
+%<!ord>{ "Fourth" }
+%<ord>{ "4th" }
+
+FUNCTION {bbl.fifth}
+%<!ord>{ "Fifth" }
+%<ord>{ "5th" }
+
+FUNCTION {bbl.st}
+{ "st" }
+
+FUNCTION {bbl.nd}
+{ "nd" }
+
+FUNCTION {bbl.rd}
+{ "rd" }
+
+FUNCTION {bbl.th}
+{ "th" }
+% \end{macrocode}
+% This function adds English endings for ordinals 1, 2, 3. However, if
+% the second last digit is 1, then the ending is `th' for all last digits.
+% So far, all other languages included do not have this problem, and it is
+% sufficient to add the \textsl{th} equivalent. This might change with further
+% languages.
+%
+% \begin{macrocode}
+FUNCTION {eng.ord}
+{ duplicate$ "1" swap$ *
+ #-2 #1 substring$ "1" =
+ { bbl.th * }
+ { duplicate$ #-1 #1 substring$
+ duplicate$ "1" =
+ { pop$ bbl.st * }
+ { duplicate$ "2" =
+ { pop$ bbl.nd * }
+ { "3" =
+ { bbl.rd * }
+ { bbl.th * }
+ if$
+ }
+ if$
+ }
+ if$
+ }
+ if$
+}
+
+%</!xedn>
+%<*!abr>
+MACRO {jan} {"January"}
+
+MACRO {feb} {"February"}
+
+MACRO {mar} {"March"}
+
+MACRO {apr} {"April"}
+
+MACRO {may} {"May"}
+
+MACRO {jun} {"June"}
+
+MACRO {jul} {"July"}
+
+MACRO {aug} {"August"}
+
+MACRO {sep} {"September"}
+
+MACRO {oct} {"October"}
+
+MACRO {nov} {"November"}
+
+MACRO {dec} {"December"}
+
+%</!abr>
+%<*abr>
+MACRO {jan} {"Jan."}
+
+MACRO {feb} {"Feb."}
+
+MACRO {mar} {"Mar."}
+
+MACRO {apr} {"Apr."}
+
+MACRO {may} {"May"}
+
+MACRO {jun} {"Jun."}
+
+MACRO {jul} {"Jul."}
+
+MACRO {aug} {"Aug."}
+
+MACRO {sep} {"Sep."}
+
+MACRO {oct} {"Oct."}
+
+MACRO {nov} {"Nov."}
+
+MACRO {dec} {"Dec."}
+
+%</abr>
+%</!options&!driver>
+ % End module: cjs-rcs-english.mbs
+% \end{macrocode}
+% \Finale
diff --git a/Master/texmf-dist/source/latex/cjs-rcs-article/cjs-rcs-french.mbs b/Master/texmf-dist/source/latex/cjs-rcs-article/cjs-rcs-french.mbs
new file mode 100644
index 00000000000..4d3a76021c9
--- /dev/null
+++ b/Master/texmf-dist/source/latex/cjs-rcs-article/cjs-rcs-french.mbs
@@ -0,0 +1,370 @@
+% \iffalse meta-comment -*- mode: doctex -*-
+%
+% French language definition file of the master bibliography style for
+% The Canadian Journal of Statistics | La revue canadienne de
+% statistique
+%
+% Copyright (C) 2023-2024 Statistical Society of Canada | Société
+% canadienne de statistique
+%
+% This file 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
+%
+% This work has the LPPL maintenance status `maintained'.
+%
+% The Current Maintainer of this work is Vincent Goulet
+% <vincent.goulet@act.ulaval.ca>.
+%
+% This work derives from french.mbs, part of the custom-bib
+% collection, a contribution to the LaTeX2e system.
+% Copyright 1994-2002 Patrick W Daly
+% Max-Planck-Institut f\"ur Sonnensystemforschung
+% Max-Planck-Str. 2
+% D-37191 Katlenburg-Lindau
+% Germany
+% E-mail: daly@mps.mpg.de
+%
+ %-------------------------------------------------------------------
+ % Begin module:
+%\fi
+ % \ProvidesFile{cjs-rcs-french.mbs}[2024/07/30 v1.1a (VG, PWD)]
+%\iffalse
+%<*a&!a>
+% The following ensures that the driver part is not seen by makebst
+% The driver part must not contain any \end other than \end{document} !
+\ifx\endoptions\undefined\let\tempx=\relax\else
+ \long\def\tempx#1\end#2{}\fi\tempx
+%</a&!a>
+%<*driver>
+\NeedsTeXFormat{LaTeX2e}%
+\documentclass[nocjs,x11names,french,english]{cjs-rcs-article}
+
+ %% Loading doc.sty creates some conflicts with the class and memoir. We
+ %% need to:
+ %%
+ %% - keep a copy of the class' \maketitle command;
+ %% - undefine the 'glossary' environment created by memoir;
+ %% - restore the standard LaTeX commands for the glossary that
+ %% doc.sty relies upon.
+ \let\makeCJStitle\maketitle % keep class definition
+ \let\theglossary\relax % avoid conflict with doc.sty
+ \let\endtheglossary\relax % avoid conflict with doc.sty
+ \makeatletter
+ \def\makeglossary{%
+ \newwrite\@glossaryfile
+ \immediate\openout\@glossaryfile=\jobname.glo
+ \def\glossary{\@bsphack\begingroup
+ \@sanitize
+ \@wrglossary}\typeout
+ {Writing glossary file \jobname.glo }%
+ \let\makeglossary\@empty
+ }
+ \@onlypreamble\makeglossary
+ \def\@wrglossary#1{%
+ \protected@write\@glossaryfile{}%
+ {\string\glossaryentry{#1}{\thepage}}%
+ \endgroup
+ \@esphack}
+ \def\glossary{\@bsphack\begingroup\@sanitize\@index}
+ \@twosidefalse\@mparswitchfalse % turn off twoside option
+ \makeatother
+ \usepackage{doc}
+ \def\changes#1#2#3{\glossary{#1>#3}} % simplified
+ \DisableCrossrefs
+ \CodelineNumbered
+ \RecordChanges
+ \OnlyDescription
+ \DontCheckModules
+
+ \AtEndPreamble{%
+ \hypersetup{%
+ pdfauthor = {Statistical Society of Canada},
+ pdftitle = {French language definition file cjs-rcs-french.mbs}}}
+
+ %% Configuration of the glossary
+ \addto\extrasenglish{%
+ \def\glossaryname{History of changes}}
+ \GlossaryPrologue{\section*{\glossaryname}%
+ \addcontentsline{toc}{section}{\glossaryname}}
+ \setlength{\GlossaryMin}{5cm}
+
+ %% Additional semantic typesetting
+ \newcommand*\class[1]{\textsf{#1}}
+ \newcommand*\dtx{\textsf{docstrip}}
+
+ %% Name of the journal
+ \makeatletter
+ \newcommand*\TheCJS{\@ifstar{\emph{The Journal}}{\emph{\CJS@journalname@en}}}
+ \newcommand*\LaRevue{\@ifstar{\emph{La revue}}{\emph{\CJS@journalname@fr}}}
+ \newcommand*\CJSclass{\class{cjs-rcs-article}}
+ \newcommand*\CJSbsten{\texttt{cjs-rcs-en.bst}}
+ \newcommand*\CJSbstfr{\texttt{cjs-rcs-fr.bst}}
+ \makeatother
+
+ %% Redefine \year using information from \filedate instead of using
+ %% compilation time
+ \def\parsedate#1/#2/#3\relax{\def\year{#1}}
+
+ \MakeShortVerb{\|}
+
+\begin{document}
+ \DocInput{cjs-rcs-french.mbs}
+\end{document}
+%</driver>
+% end of meta-comment \fi
+% \GetFileInfo{cjs-rcs-french.mbs}
+% \expandafter\parsedate\filedate\relax
+%
+% \changes{0.9}{2023-10-14}{Initial version based on version 4.2 of
+% \texttt{french.mbs} from \textbf{custom-bib}.}
+% \changes{0.93}{2023-11-06}{Add a prefix v in the version number like
+% the main file.}
+% \changes{1.0}{2023-11-29}{First official release distributed through
+% CTAN.}
+%
+% \title[French language definition file \filename]{%
+% French language definition file \\
+% of the master bibliographic style file \\
+% for \TheCJS}
+% \author{Statistical Society of Canada}
+% \affil{Developed by Vincent Goulet, Université Laval}
+%
+% \begin{englishabstract}
+% The list of references in {\TheCJS} is typeset using the
+% bibliographic styles {\CJSbsten} for articles in English and
+% {\CJSbstfr} for articles in French. These styles are created using
+% the program \texttt{makebst} from the master bibliographic file
+% \texttt{cjs-rcs-merlin.mbs}, and the language definition files
+% \texttt{cjs-rcs-english.mbs} and \texttt{cjs-rcs-french.mbs}.
+% \end{englishabstract}
+% \begin{frenchabstract}
+% La liste des références dans {\LaRevue} est composée avec les
+% style de bibliographie {\CJSbstfr} pour les articles en français
+% et {\CJSbsten} pour les articles en anglais. Ceux-ci sont générés
+% par le programme \texttt{makebst} à partir du fichier maitre
+% \texttt{cjs-rcs-merlin.mbs} et des fichiers de localisation
+% \texttt{cjs-rcs-english.mbs} et \texttt{cjs-rcs-french.mbs}.
+% \end{frenchabstract}
+%
+% ^^A abusing the 'classification' environment. The final period is
+% ^^A added by the environment.
+% \begin{classification}[Version]
+% \item[] This is the documentation for the file \code{\filename}
+% {\fileversion}, dated {\filedate}
+% \end{classification}
+%
+% \licence{{\year}, Statistical Society of Canada~{\textbar}~Société
+% canadienne de statistique}
+%
+% \makeCJStitle
+%
+% \section{Introduction}
+%
+% This file is to be used as a language definition file with the
+% master bibliographic file for {\TheCJS}. The language it defines is
+% French.
+%
+% This is not a self-sufficient \texttt{.mbs} file, but rather may
+% be used together with one that contains language support via
+% external definition files.
+%
+% See the documentation for \texttt{makebst} for formatting details.
+%
+% \section{The Menu Information}
+%
+% All the menu information is nested between \dtx{} guard options
+% |%<*options>| \dots\ |%</options>|, and the last command is
+% |\endoptions|. The rest of the file is nested between |%<*!options&!driver>|
+% \dots\ |%</!options&!driver>| in order to exclude it if \dtx{} is used to
+% extract only the menu information or the documentation driver.
+%
+% \begin{macrocode}
+%<*options>
+\mes{^^JOptions for FRENCH}
+\wr{\spsp\spsp french,\pc: French language}
+
+\beginoptiongroup{ABBREVIATE WORD `PAGES':}{}
+\optdef{*}{}{`Page(s)'}{(no abbreviation)}
+\optdef{a}{pp}{`Page' abbreviated}{as p. or pp.}
+\optdef{x}{ppx}{`Page' omitted}{}
+\getans
+\endoptiongroup
+\beginoptiongroup{ABBREVIATE WORD `EDITEUR:}{}
+\optdef{*}{}{`\string\'Editeur(s)'}{(no abbreviation)}
+\optdef{a}{ed}{`\string\'Editeur' abbreviated}{as \string\'Ed.}
+\getans
+\endoptiongroup
+\beginoptiongroup{OTHER ABBREVIATIONS:}{}
+\optdef{*}{}{No abbreviations}{of Tome, \string\'edition, chapitre}
+\optdef{a}{abr}{Abbreviations}{of such words}
+\getans
+\endoptiongroup
+\beginoptiongroup{EDITION NUMBERS:}{}
+\optdef{*}{xedn}{Editions as in database}{saving much processing memory}
+\optdef{w}{}{Write out editions}{as premi\string\`ere, deuxi\string\`eme,...}
+\optdef{n}{ord}{Numerical editions}{as 1re, 2e, 3e, etc}
+\getans
+\endoptiongroup
+\endoptions
+%</options>
+% \end{macrocode}
+%
+% \StopEventually{\PrintChanges}
+%
+% \section{The Coding}
+% \begin{macrocode}
+%<*!options&!driver>
+
+ % The language selected here is FRENCH
+FUNCTION {bbl.and}
+{ "et"}
+
+FUNCTION {bbl.etal}
+{ "et~collab." }
+
+FUNCTION {bbl.editors}
+%<!ed>{ "directeurs" }
+%<ed>{ "dir." }
+
+FUNCTION {bbl.editor}
+%<!ed>{ "directeur" }
+%<ed>{ "dir." }
+
+FUNCTION {bbl.edby}
+{ "sous la direction de" }
+
+FUNCTION {bbl.edition}
+%<!abr>{ "\'edition" }
+%<abr>{ "\'ed." }
+
+FUNCTION {bbl.volume}
+%<!abr>{ "volume" }
+%<abr>{ "vol." }
+
+FUNCTION {bbl.of}
+{ "de" }
+
+FUNCTION {bbl.number}
+%<!abr>{ "num\'ero" }
+%<abr>{ "{\no}" }
+
+FUNCTION {bbl.nr}
+{ "{\no}" }
+
+FUNCTION {bbl.in}
+{ "dans" }
+
+FUNCTION {bbl.pages}
+%<!pp&!ppx>{ "pages" }
+%<pp>{ "p." }
+%<!pp&ppx>{ "" }
+
+FUNCTION {bbl.page}
+%<!pp&!ppx>{ "page" }
+%<pp>{ "p." }
+%<!pp&ppx>{ "" }
+
+%<*revdata>
+FUNCTION {bbl.eidpp}
+{ "pages" }
+
+%</revdata>
+FUNCTION {bbl.chapter}
+%<!abr>{ "chapitre" }
+%<abr>{ "chap." }
+
+FUNCTION {bbl.techrep}
+%<!abr>{ "rapport technique" }
+%<abr>{ "rapport technique" }
+
+FUNCTION {bbl.mthesis}
+{ "m\'emoire de ma\^itrise" }
+
+FUNCTION {bbl.phdthesis}
+{ "th\`ese de doctorat" }
+
+%<*!xedn>
+FUNCTION {bbl.first}
+%<!ord>{ "Premi\`ere" }
+%<ord>{ "1{\iere}" }
+
+FUNCTION {bbl.second}
+%<!ord>{ "Deuxi\`eme" }
+%<ord>{ "2{\ieme}" }
+
+FUNCTION {bbl.third}
+%<!ord>{ "Troisi\`eme" }
+%<ord>{ "3{\ieme}" }
+
+FUNCTION {bbl.fourth}
+%<!ord>{ "Quatri\`eme" }
+%<ord>{ "4{\ieme}" }
+
+FUNCTION {bbl.fifth}
+%<!ord>{ "Cinqui\`eme" }
+%<ord>{ "5{\ieme}" }
+
+FUNCTION {bbl.th}
+{ "{\ieme}" }
+
+%</!xedn>
+%<*!abr>
+MACRO {jan} {"janvier"}
+
+MACRO {feb} {"f\'evrier"}
+
+MACRO {mar} {"mars"}
+
+MACRO {apr} {"avril"}
+
+MACRO {may} {"mai"}
+
+MACRO {jun} {"juin"}
+
+MACRO {jul} {"juillet"}
+
+MACRO {aug} {"ao\^ut"}
+
+MACRO {sep} {"septembre"}
+
+MACRO {oct} {"octobre"}
+
+MACRO {nov} {"novembre"}
+
+MACRO {dec} {"d\'ecembre"}
+
+%</!abr>
+%<*abr>
+MACRO {jan} {"jan."}
+
+MACRO {feb} {"f\'ev."}
+
+MACRO {mar} {"mars"}
+
+MACRO {apr} {"avr."}
+
+MACRO {may} {"mai"}
+
+MACRO {jun} {"juin"}
+
+MACRO {jul} {"juil."}
+
+MACRO {aug} {"ao\^ut"}
+
+MACRO {sep} {"sept."}
+
+MACRO {oct} {"oct."}
+
+MACRO {nov} {"nov."}
+
+MACRO {dec} {"d\'ec."}
+
+%</abr>
+%</!options&!driver>
+ % End module: cjs-rcs-french.mbs
+% \end{macrocode}
+% \Finale
diff --git a/Master/texmf-dist/source/latex/cjs-rcs-article/cjs-rcs-merlin.mbs b/Master/texmf-dist/source/latex/cjs-rcs-article/cjs-rcs-merlin.mbs
new file mode 100644
index 00000000000..cf79365ffd2
--- /dev/null
+++ b/Master/texmf-dist/source/latex/cjs-rcs-article/cjs-rcs-merlin.mbs
@@ -0,0 +1,8009 @@
+% \iffalse meta-comment -*- mode: doctex -*-
+%
+% Master bibliography style for The Canadian Journal of Statistics |
+% La revue canadienne de statistique
+%
+% Copyright (C) 2023-2024 Statistical Society of Canada | Société
+% canadienne de statistique
+%
+% This file 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
+%
+% This work has the LPPL maintenance status `maintained'.
+%
+% The Current Maintainer of this work is Vincent Goulet
+% <vincent.goulet@act.ulaval.ca>.
+%
+% This work derives from merlin.mbs, part of the custom-bib
+% collection, a contribution to the LaTeX2e system.
+% Copyright 1994-2011 Patrick W Daly
+% Max-Planck-Institut f\"ur Sonnensystemforschung
+% Max-Planck-Str. 2
+% D-37191 Katlenburg-Lindau
+% Germany
+% E-mail: daly@mps.mpg.de
+%
+%<*!tail>
+% (The following notice appears in bst files generated from this file)
+ % -------------------------------------------------------------------
+ % Name and version information of the main mbs file:
+%\fi
+ % \ProvidesFile{cjs-rcs-merlin.mbs}[2024/07/30 v1.1a (VG, PWD, AO, DPC)]
+%\iffalse
+%</!tail>
+%<*a&!a>
+% The following ensures that the driver part is not seen by makebst
+% The driver part must not contain any \end other than \end{document} !
+\ifx\endoptions\undefined\let\tempx=\relax\else
+ \long\def\tempx#1\end#2{}\fi\tempx
+%</a&!a>
+%<*driver>
+\NeedsTeXFormat{LaTeX2e}%
+\documentclass[nocjs,x11names,french,english]{cjs-rcs-article}
+ \usepackage{metalogo}
+ \setlrmarginsandblock{40mm}{30mm}{*} % increase left margin
+ \checkandfixthelayout
+
+ %% Loading doc.sty creates some conflicts with the class and memoir. We
+ %% need to:
+ %%
+ %% - keep a copy of the class' \maketitle command;
+ %% - undefine the 'glossary' environment created by memoir;
+ %% - restore the standard LaTeX commands for the glossary that
+ %% doc.sty relies upon.
+ \let\makeCJStitle\maketitle % keep class definition
+ \let\theglossary\relax % avoid conflict with doc.sty
+ \let\endtheglossary\relax % avoid conflict with doc.sty
+ \makeatletter
+ \def\makeglossary{%
+ \newwrite\@glossaryfile
+ \immediate\openout\@glossaryfile=\jobname.glo
+ \def\glossary{\@bsphack\begingroup
+ \@sanitize
+ \@wrglossary}\typeout
+ {Writing glossary file \jobname.glo }%
+ \let\makeglossary\@empty
+ }
+ \@onlypreamble\makeglossary
+ \def\@wrglossary#1{%
+ \protected@write\@glossaryfile{}%
+ {\string\glossaryentry{#1}{\thepage}}%
+ \endgroup
+ \@esphack}
+ \def\glossary{\@bsphack\begingroup\@sanitize\@index}
+ \@twosidefalse\@mparswitchfalse % turn off twoside option
+ \makeatother
+ \usepackage{doc}
+ \def\changes#1#2#3{\glossary{#1>#3}} % simplified
+ \DisableCrossrefs
+ \CodelineNumbered
+ \RecordChanges
+ \OnlyDescription
+ \DontCheckModules
+
+ \AtEndPreamble{%
+ \hypersetup{%
+ pdfauthor = {Statistical Society of Canada},
+ pdftitle = {Master bibliographic style cjs-rcs-merlin.mbs}}}
+
+ %% Configuration of the glossary
+ \addto\extrasenglish{%
+ \def\glossaryname{History of changes}}
+ \GlossaryPrologue{\section*{\glossaryname}%
+ \addcontentsline{toc}{section}{\glossaryname}}
+ \setlength{\GlossaryMin}{5cm}
+
+ %% Additional semantic typesetting
+ \newcommand*\class[1]{\textsf{#1}}
+ \newcommand*\btx{\textsc{Bib}\TeX}
+ \newcommand*\dtx{\textsf{docstrip}}
+
+ %% Name of the journal
+ \makeatletter
+ \newcommand*\TheCJS{\@ifstar{\emph{The Journal}}{\emph{\CJS@journalname@en}}}
+ \newcommand*\LaRevue{\@ifstar{\emph{La revue}}{\emph{\CJS@journalname@fr}}}
+ \newcommand*\CJSclass{\class{cjs-rcs-article}}
+ \newcommand*\CJSbsten{\texttt{cjs-rcs-en.bst}}
+ \newcommand*\CJSbstfr{\texttt{cjs-rcs-fr.bst}}
+ \makeatother
+
+ %% Redefine \year using information from \filedate instead of using
+ %% compilation time
+ \def\parsedate#1/#2/#3\relax{\def\year{#1}}
+
+ \MakeShortVerb{\|}
+
+\begin{document}
+ \DocInput{cjs-rcs-merlin.mbs}
+\end{document}
+%</driver>
+% end of meta-comment \fi
+% \GetFileInfo{cjs-rcs-merlin.mbs}
+% \expandafter\parsedate\filedate\relax
+%
+% \changes{0.9}{2023-10-14}{Initial version based on version 4.33 of
+% \texttt{merlin.mbs}.}
+% \changes{0.92}{2023-10-27}{Relegate the \texttt{makebst} menu
+% information to the complete documentation.}
+% \changes{0.93}{2023-11-06}{Add a prefix v in the version number like
+% the main file.}
+% \changes{1.0}{2023-11-29}{First official release distributed through
+% CTAN.}
+%
+% \title[Master bibliographic style file \filename]{%
+% Master bibliographic style file \\
+% of \TheCJS}
+% \author{Statistical Society of Canada}
+% \affil{Developed by Vincent Goulet, Université Laval}
+%
+% \begin{englishabstract}
+% The list of references in {\TheCJS} is typeset using the
+% bibliographic styles {\CJSbsten} for articles in English and
+% {\CJSbstfr} for articles in French. These styles are created using
+% the program \texttt{makebst} from the master bibliographic file
+% \texttt{cjs-rcs-merlin.mbs}, and the language definition files
+% \texttt{cjs-rcs-english.mbs} and \texttt{cjs-rcs-french.mbs}.
+% \end{englishabstract}
+% \begin{frenchabstract}
+% La liste des références dans {\LaRevue} est composée avec les
+% style de bibliographie {\CJSbstfr} pour les articles en français
+% et {\CJSbsten} pour les articles en anglais. Ceux-ci sont générés
+% par le programme \texttt{makebst} à partir du fichier maitre
+% \texttt{cjs-rcs-merlin.mbs} et des fichiers de localisation
+% \texttt{cjs-rcs-english.mbs} et \texttt{cjs-rcs-french.mbs}.
+% \end{frenchabstract}
+%
+% ^^A abusing the 'classification' environment. The final period is
+% ^^A added by the environment.
+% \begin{classification}[Version]
+% \item[] This is the documentation for the file \code{\filename}
+% {\fileversion}, dated {\filedate}
+% \end{classification}
+%
+% \licence{{\year}, Statistical Society of Canada~{\textbar}~Société
+% canadienne de statistique}
+%
+% \makeCJStitle
+%
+% \section{Introduction}
+%
+% The class {\CJSclass} typesets manuscripts immediately in accordance
+% with the presentation rules of {\TheCJS}. The class uses its own
+% bibliographic styles: {\CJSbsten} for articles in English, and
+% {\CJSbstfr} for articles in French. The style {\CJSbsten} could best
+% be described as ``not unlike \code{apalike}'', whereas {\CJSbstfr}
+% is closely derived from the style \code{francais} provided by the
+% package %
+% \href{https://ctan.org/pkg/francais-bst}{\pkg{francais-bst}}.
+%
+% The styles were originally generated using the program
+% \code{makebst} by Patrick W.~Daly. The master bibliographic style
+% and the language definition files are heavily based on their
+% counterparts of the package %
+% \href{https://ctan.org/pkg/custom-bib}{\pkg{custom-bib}}, %
+% namely \code{merlin.mbs}, \code{english.mbs}, and \code{french.mbs}.
+%
+% \section{Generation of the bibliographic styles}
+% \label{sec:generation}
+%
+% The English style {\CJSbsten} is produced from this master
+% bibliographic style file and the language definition file
+% \code{cjs-rcs-english.mbs} by running the driver
+% \code{cjs-rcs-bst-en.dbj} through {\LaTeX}:
+% \begin{quote}
+% \code{latex cjs-rcs-bst-en.dbj}
+% \end{quote}
+% The French style {\CJSbstfr} is produced similarly using the driver
+% \code{cjs-rcs-bst-fr.dbj}:
+% \begin{quote}
+% \code{latex cjs-rcs-bst-fr.dbj}
+% \end{quote}
+%
+% \section{Changes compared to \texorpdfstring{\code{merlin.mbs}}{merlin.mbs}}
+% \label{sec:changes}
+%
+% The master bibliographic style \code{\filename} introduces the following
+% changes compared to \code{merlin.mbs}.
+%
+% \begin{enumerate}
+% \item The function \code{format.url} is reworked to provide a
+% cleaner URL for digital object identifiers (DOIs). The
+% \code{merlin.mbs} definition would generate a DOI of the form
+% \begin{quote}
+% URL \texttt{http://dx.doi.org/\meta{doi}}
+% \end{quote}
+% The revised definition instead generates the simpler string
+% \begin{quote}
+% doi: \meta{doi}
+% \end{quote}
+% When the package \pkg{hyperref} is loaded, \meta{doi} is a
+% hyperlink to the now recommended URL
+% \code{https://doi.org/\meta{doi}}. This behaviour relies on a
+% command \cmd{\urldoi} provided in the \texttt{.bbl} file. If
+% needed, this command may be redefined by the user.
+% \item The command \cmd{\urlprefix} is empty. Again, this may be
+% redefined by the user.
+% \item The quotes «~» are typeset by the macro \cmd{\frquote} of
+% \pkg{babel-french} (version $\geq$ 3.1), rather than by the custom
+% commands \cmd{\guillemotleft} and \cmd{\guillemotright}.
+% \item The \code{makebst} menu information is only included in the
+% complete documentation. The latter is obtained by commenting out
+% the command \cmd{\OnlyDescription} in \code{\filename} and
+% compiling the file with {pdf\LaTeX} or {\XeLaTeX}.
+% \end{enumerate}
+%
+% \StopEventually{\PrintChanges}
+%
+% \begin{quote}
+% \itshape From this point on, the documentation is taken without
+% modification from \code{merlin.mbs} by Patrick W.~Daly, but for
+% minute details such as filenames.
+% \end{quote}
+%
+% \section{The Menu Information}\label{sec:menu}
+%
+% Here I describe the options and menu information for this particular
+% master file \texttt{\filename}. To construct a \dtx{} driver file
+% to generate a desired \texttt{.bst} file, simply process \texttt{makebst.tex}
+% with \TeX\ or \LaTeX, and give
+% \begin{quote}\code{\filename}\end{quote}
+% when prompted for the name of the master file. Then answer the questions
+% in the menus that follow. The menu information is extracted from here.
+%
+% All the menu information is nested between \dtx{} guard options
+% |%<*options>| \dots\ |%</options>|, and the last command is
+% |\endoptions|. The rest of the file is nested between
+% \begin{quote}
+% |%<*!options&!driver&!bblbst>| \dots\ |</!options&!driver&!bblbst>|
+% \end{quote}
+% in order to exclude it if \dtx{} is used to
+% extract the menu information, the documentation driver, or the
+% \texttt{babelbst.tex} file.
+%
+% The main coding is divided into two sections, the \emph{head} and
+% \emph{tail}; in between come any external language or journal name
+% support files. The head part is marked with the \dtx{} guard option
+% |<!tail>| and the tail with |<!head>|. This roundabout means of
+% doing things makes it possible to process \texttt{\filename} with
+% \texttt{.dbj} files that were generated for the older
+% \texttt{genbst.mbs} file by simply changing the name of the source
+% file. If both \texttt{head} and \texttt{tail} (and \texttt{exlang})
+% options are omitted, as they are in the older \texttt{.dbj} files,
+% \texttt{\filename} is processed completely in one pass. To include
+% external files, two passes are needed, one for each part, with the
+% external file(s) coming in between.
+%
+% Note too that if the internal language commands are taken (i.e., if
+% \texttt{exlang} option is not given) then the default language is
+% English, which is tested for as |<!babel>|. This too permits the simple
+% update of older \texttt{.dbj}, at least for English.
+%
+% \subsection*{Selecting Language}
+% Explicit words in the bibliography style, such as \textsl{and},
+% \textsl{editor}, etc.,
+% are represented by functions \texttt{bbl.and}, \texttt{bbl.editor}, and so on.
+% By default these functions translate to the normal English text, but
+% other languages are also possible.
+%
+% The definitions of these functions for other languages are contained in
+% external files. At this point, we can make use of features in
+% \texttt{makebst} (version~3.0 or later) to ask for the name of such a
+% definition file, and store it in |\cfile|. If no external file is
+% specified, then the internal definitions are taken, for which there are
+% two possibilities: English or \LaTeX{} commands (Babel).
+%
+% The commands |\MBswitch|, |\mes|, |\MBaskfile|, |\wr|, |\pc|, |\spsp| are
+% defined in \texttt{makebst.tex}.
+%
+% If |\MBswitch| does not exist, then the version of \texttt{makebst}
+% cannot support external files.
+%
+% \begin{macrocode}
+%<*options>
+\expandafter\ifx\csname beginoptiongroup\endcsname\relax
+ \mes{^^J******************^^J%
+ !!!!!! VERSION CLASH !!!!!!!!!^^J%
+ This mbs file requires makebst version 4.0 or more^^J%
+ You must update makebst to run it with this mbs file^^J%
+ No docstrip batch file can be produced on this run^^J%
+ ******************}
+ \let\temp\endinput\else\let\temp\relax\fi\temp
+
+\newif\ifnumerical
+\newif\ifmytemp
+\mes{<<< For more information about the meanings of^^J%
+ <<< the various options, see the section on ^^J%
+ <<< Menu Information in the .mbs file documentation.}
+
+\umes{EXTERNAL FILES:}
+\expandafter\ifx\csname MBswitch\endcsname\relax
+ \mes{^^J**************^^J%
+ Makebst version is less than 3.0^^J%
+ Cannot add external file for language definition^^J%
+ **************}
+ \umes{No included files.}%
+ \def\cfile{}\def\jfile{}%
+\else
+ \MBaskfile{^^JName of language definition file}(\mroot.\mext)i\cfile
+ \edef\ctemp{\mroot.\mext}
+ \ifx\ctemp\cfile\def\cfile{}\fi
+ \umes{Name of language file: \string\cfile=\cfile.}%
+% \end{macrocode}
+%
+% A second type of external file that can be added is one containing names
+% of journals that are to be prestored into the \texttt{.bst} file.
+% Several file names are allowed here, with the root names separated by
+% commas, and with the common extension added at the end. To assist later
+% parsing of the names, an additional comma is added before the extension.
+%
+% Note that in this case |\MBaskfile| treats the file(s) as output, i.e.,
+% it does not check if the file(s) actually exist.
+%
+% The macro |\Mgetnext| allows the root names to be extracted from the
+% list of file names.
+% \begin{macrocode}
+ \def\jfile{}
+ \ask{\yn}{^^JInclude file(s) for extra journal names? (NO)}
+ \mytempfalse
+ \if!\yn!\else\if\yn n\else\if\yn N\else\mytemptrue\fi\fi\fi
+ \ifmytemp
+ \MBaskfile{^^JFile to include}(physjour,geojour,photjour.mbs)o\jfile
+ \edef\jfile{\froot,.\fext}
+ \umes{Name of included files: \string\jfile=\jfile.}%
+ \else
+ \umes{No included files.}%
+ \fi
+\fi%MBswitch
+\def\Mgetnext#1,#2.#3??{\def\froot{#1}\def\Mrest{#2}\def\fext{#3}}
+% \end{macrocode}
+%
+% If no external files are specified, then both |\cfile| and |\jfile| are
+% empty. In this case, do \emph{not} set the options \texttt{head} and
+% \texttt{tail}, which control the \dtx{} passes through
+% \texttt{filename}. Now only one pass is made.
+%
+% If there is an external definition file, or an external list of
+% journal names, then some extra text must be
+% written to fit in with that already written by \texttt{makebst}. This is
+% explained in that documentation. The |\MBswitch| command turns the curly
+% braces |{..}| into normal characters, and the parentheses |(..)| take on
+% their grouping functionality. This permits unbalanced braces to be
+% written to the output file.
+%
+% \begin{macrocode}
+\if!\cfile\jfile!\else
+ \begingroup\MBswitch
+ \wr(\spsp head,\string\MBopta})
+ \if!\cfile!\else
+ \wr(\string\from{\cfile}{\string\MBopta})
+ \fi
+ \if!\jfile!\else
+ \let\jxfile\jfile
+ \loop
+% \end{macrocode}
+%
+% Parse the list of journal name files, adding a new |\from| for each one.
+%
+% \begin{macrocode}
+ \expandafter\Mgetnext\jxfile??
+ \wr(\string\from{\froot.\fext}{\string\MBopta})
+ \edef\jxfile(\Mrest.\fext)
+ \if!\Mrest!\def\Mtst(1)\else\def\Mtst()\fi
+ \if!\Mtst!
+ \repeat
+ \fi
+ \wr(\string\from{\mroot.\mext}{tail,\string\MBopta}})
+ \wr(\string\def\string\MBopta{\pc)
+ \endgroup
+\fi
+% \end{macrocode}
+%
+% Ask whether there is a need for
+% explicit English words or \LaTeX{} commands whose definitions are
+% to be found in the file \texttt{babelbst.tex}.
+%
+% \begin{macrocode}
+\beginoptiongroup{INTERNAL LANGUAGE SUPPORT
+ (if no external language file)}%
+ {\if!\cfile!\relax*\fi}%
+\optdef{*}{}{English}{words used explicitly}
+\optdef{b}{babel}{Babel}
+ {(words replaced by commands defined in babelbst.tex)}
+\getans
+\endoptiongroup
+\if!\cfile!\relax\else
+\wr{\spsp\spsp exlang,\pc: External language file}
+\fi
+% \end{macrocode}
+%
+% \subsection*{Author--year or numerical}
+% The first question is whether a numerical or author--year citation
+% style is to be used. If the latter, the supporting system is my
+% \code{natbib.sty}, which expects |\bibitem| to have an optional
+% argument containing the short form of the authors, plus year in
+% parentheses. E.g.,
+% \begin{quote}
+% |\bibitem[Daly et al.(1990)]{key}...|
+% \end{quote}
+% There is now a newer version of \texttt{natbib.sty} (v5.3) that
+% supports an optional full author list too, as
+% \begin{quote}
+% |\bibitem[Daly et al.(1990)Daly, Keppler, and Williams]{key}...|
+% \end{quote}
+% Other systems are also supported, such as the Harvard family of
+% bibliography styles (with \texttt{harvard.sty}), which have entries in the
+% form
+% \begin{quote}
+% |\harvarditem[Daly et al.]{Daly, Keppler,|\\
+% | and Williams}{1990}{key}...|
+% \end{quote}
+% or the astronomy family (with \texttt{astron.sty}) with entries like
+% \begin{quote}
+% |\bibitem[\protect\astroncite{Daly et al.}{1990}]{key}...|
+% \end{quote}
+% or the Chicago family (with \texttt{chicago.sty}) with entries like
+% \begin{quote}
+% |\bibitem[\protect\citeautheryear{Daly, Keppler, and|\\
+% | Williams}{Daly et al.}{1990}]{key}...|
+% \end{quote}
+% or the `named' variant of Chicago (with \texttt{named.sty}) with entries like
+% \begin{quote}
+% |\bibitem[\protect\citeauthoryear{Daly et al.}{1990}]{key}...|
+% \end{quote}
+% or the so-called ``author--date'' group (with \texttt{authordate1-4.sty})
+% with entries of the form
+% \begin{quote}
+% |\bibitem[\protect\citename{Daly et al.}1990]{key}...|
+% \end{quote}
+% Finally, there is the \texttt{apalike} format of Oren Patashnik, for use
+% with \texttt{apalike.sty} that has entries of the form
+% \begin{quote}
+% |\bibitem[Daly et al., 1990]{key}...|
+% \end{quote}
+%
+% In addition to numerical or author--year citation styles, there is also a
+% \texttt{cite} style available in which the label is the same as the cite
+% key. This is for listing entire contents of databases with the cite key
+% visible.
+%
+% A flag |\ifnumerical| is established because some of the following menu
+% features depend on which system is to be used.
+%
+% The \texttt{alph} option produces labels as in \texttt{alpha.bst}; options
+% \texttt{alf-1} and \texttt{alf-f} modify these. Standard is: first three
+% letters of the single author (Dal90 for Daly, 1990) and first letters of
+% first three authors (DK90 for Daly and Kopka, 1990). Alternatives are first
+% three letters of the first author, no matter how many authors there are, and
+% full name of first author.
+% \begin{macrocode}
+\beginoptiongroup{STYLE OF CITATIONS:}{}
+\optdef{*}{}{Numerical}{as in standard LaTeX}
+\optdef{a}{ay}{Author-year}{with some non-standard interface}
+\optdef{b}{alph}{Alpha style, Jon90 or JWB90}{for single or multiple authors}
+\optdef{o}{alph,alf-1}{Alpha style, Jon90}{even for multiple authors}
+\optdef{f}{alph,alf-f}{Alpha style, Jones90}{(full name of first author)}
+\optdef{c}{cite}{Cite key}{(special for listing contents of bib file)}
+\getans
+\endoptiongroup
+\if\ans a\numericalfalse\else\numericaltrue\fi
+\if\ans b\mytempfalse \else\mytemptrue \fi
+\beginoptiongroup{HTML OUTPUT
+ (if non author-year citations)}
+ {\ifnumerical*\fi}
+\optdef{*}{}{Normal LaTeX}{output}
+\optdef{h}{html}{Hypertext}{output, in HTML code, in paragraphs}
+\optdef{n}{html,htlist}{Hypertext list}{with sequence numbers}
+\optdef{k}{html,htdes}{Hypertext with keys}{for viewing databases}
+\getans
+\endoptiongroup
+\beginoptiongroup{AUTHOR--YEAR SUPPORT SYSTEM
+ (if author-year citations)}
+ {\ifnumerical\else*\fi}
+\optdef{*}{nat}{Natbib}{for use with natbib v5.3 or later}
+\optdef{o}{}{Older Natbib}{without full authors citations}
+\optdef{l}{alk}{Apalike}{for use with apalike.sty}
+\optdef{h}{har}{Harvard}{system with harvard.sty}
+\optdef{a}{ast}{Astronomy}{system with astron.sty}
+\optdef{c}{cay}{Chicago}{system with chicago.sty}
+\optdef{n}{nmd}{Named}{system with named.sty}
+\optdef{d}{cn}{Author-date}{system with authordate1-4.sty}
+\getans
+% \end{macrocode}
+% The \texttt{harvard} family has been extended for \LaTeXe, and the new
+% \texttt{.bst} files allow the word \textsl{and} and the brackets around years
+% to be variable with commands. These features may be added too.
+% The URL field used to be exclusively part of Harvard, but now exists
+% independently of it too.
+%
+% \begin{macrocode}
+\beginoptiongroup{HARVARD EXTENSIONS INCLUDED
+ (if Harvard support selected)}
+ {\if\ans h*\fi}%
+\optdef{*}{harnm}{With Harvard extensions}{for LaTeX2e version of harvard.sty}
+\optdef{n}{}{Older Harvard}{style, for LaTeX 2.09}
+\getans
+\endoptiongroup
+\endoptiongroup
+% \end{macrocode}
+%
+% \subsection*{Language switching}
+% A \texttt{language} field can be present to specify the original language of
+% the reference; with \verb!\setlanguage!, the hyphenation patterns are set for
+% setting the title in that language.
+% \begin{macrocode}
+\beginoptiongroup{LANGUAGE FIELD}{}
+\optdef{*}{}{No language field}{}
+\optdef{l}{lang}{Add language field}{to switch hyphenation patterns temporarily}
+\getans
+\endoptiongroup
+% \end{macrocode}
+%
+% \subsection*{Annotations}
+% Annotations to a reference are additional information not normally printed
+% out in the list of references. They are used for listing databases.
+% The coding here was offered by Soren Dayton.
+% \begin{macrocode}
+\beginoptiongroup{ANNOTATIONS:}{}
+\optdef{*}{}{No annotations}{will be recognized}
+\optdef{a}{annote}{Annotations}{in annote field or in .tex file of citekey name}
+\getans
+\endoptiongroup
+% \end{macrocode}
+%
+% \subsection*{Presentations}
+% Presentations are talks at meetings, oral or poster, that are not otherwise
+% published. The author making the presentation is indicated with the \texttt{key}
+% entry, which is the speaker's number within the author list. The font used
+% to highlight the speaker is either bold or italics, depending on the secondary
+% option, otherwise not highlighted.
+% \begin{macrocode}
+\beginoptiongroup{PRESENTATIONS:}{}
+\optdef{*}{}{Do not add presentation type}{for conference talks}
+\optdef{p}{pres}{Add presentation, speaker not highlighted}{}
+\optdef{b}{pres,pres-bf}{Presentation, speaker bold face}{}
+\optdef{i}{pres,pres-it}{Presentaion, speaker italic}{}
+\optdef{c}{pres,pres-sc}{Presentaion, speaker in small caps}{}
+\getans
+\endoptiongroup
+% \end{macrocode}
+%
+% \subsection*{Ordering of the listed references}
+% Choices here depend on citation style. The default in both cases is
+% alphabetical order of all authors. For numerical style, one may also
+% choose an unsorted order, which means the order is the same as the original
+% citations. This corresponds to \texttt{unsrt.bst}. Order of citation is
+% also offered for author--year for \texttt{natbib}-type styles that can
+% also be used for numerical listings.
+%
+% Another possibility is to order first by year, then authors. This too only
+% makes sense for numerical citations. However, it is offered for author--year
+% in the event that a \texttt{natbib}-type style is used for numerical
+% listings.
+%
+% For the alpha style, the ordering is by label only, so no option is
+% offered here (|\ifnumerical| is \meta{true} and |\ifmytemp| is \meta{false}).
+%
+% For author--year, the second choice is by label. (The label is the
+% optional |\bibitem| argument, and is what is printed in place of the
+% |\cite| command.) With this option, all the papers with the same first
+% author are ordered so that the one-author papers come first, followed by
+% the two-author papers, followed by the multiple-author papers. This is a
+% more sensible system for author--year citations, and is demanded by some
+% journals (like JGR).
+%
+% One problem that can arise here is when two or more references have the
+% same set of authors and year; normally they are then ordered by the
+% title, ignoring initial words like \textsl{the} and \textsl{a}, with the
+% letters a, b,
+% c, \dots, added to the year. This can mean that a set of references with
+% a natural sequence will be put into a different order. An alternative is
+% to order them by the citation keyword instead of by title. This of course
+% assumes that the keywords in this case reflect that natural sequence.
+% \begin{macrocode}
+\let\ans\relax
+\beginoptiongroup{ORDERING OF REFERENCES
+ (if non-author/year and non-alph)}
+ {\ifnumerical\ifmytemp*\fi\fi}%
+\optdef{*}{}{Alphabetical}{by all authors}
+\optdef{c}{seq-no}{Citation order}{(unsorted, like unsrt.bst)}
+\optdef{d}{seq-yr}{Year ordered}{and then by authors}
+\optdef{r}{seq-yrr}{Reverse year ordered}{and then by authors}
+\getans
+\endoptiongroup
+%
+\beginoptiongroup{ORDERING OF REFERENCES
+ (if author-year citations)}
+ {\ifnumerical\else*\fi}%
+\optdef{*}{}{Alphabetical}{by all authors}
+\optdef{l}{seq-lab}{By label}%
+ {(Jones before Jones and James before Jones et al)}
+\optdef{m}{seq-labc}{By label and cite order}%
+ {(like above but all Jones et al ordered as cited)}
+\optdef{k}{seq-key}{By label and cite key}{instead of label and title, as above}
+\optdef{d}{seq-yr}{Year ordered}{and then by authors (for publication lists)}
+\optdef{r}{seq-yrr}{Reverse year ordered}{and then by authors (most recent first)}
+\optdef{c}{seq-no}{Citation order}{(unsorted, only meaningful for numericals)}
+\getans
+\endoptiongroup
+% \end{macrocode}
+% The standard \btx\ styles consider the \emph{von} part of the name to be a
+% fixed part of the surname. European usage tends to alphabetize ignoring these
+% honorifics.
+% \begin{macrocode}
+\beginoptiongroup{ORDER ON VON PART
+ (if not citation order)}
+ {\if\ans c\else*\fi}%
+\optdef{*}{}{Sort on von part}{(de la Maire before Defoe)}
+\optdef{x}{vonx}{Sort without von part}{(de la Maire after Mahone)}
+\getans
+\endoptiongroup
+% \end{macrocode}
+%
+% Sorting normally treats authors with the same surname but different initials
+% or first name separately; but a strict ordering by cite label would lump all
+% Smiths together.
+% \begin{macrocode}
+\beginoptiongroup{IGNORE FIRST NAMES (if author-year citations)}
+ {\ifnumerical\else*\fi}%
+\optdef{*}{}{Respect first names}{or initials, treat as different authors}
+\optdef{x}{xintls}{Sort on surname only}{and treat all Smiths as one}
+\getans
+\endoptiongroup
+% \end{macrocode}
+%
+% \subsection*{Formatting author names}
+% The default is that the full names of the authors are listed, given names
+% first, unabbreviated. Of course, if only the initials have been given in
+% the \texttt{.bib} file, then that is all that can appear in the list. Other
+% possibilities are to use initials (even if full names in the \texttt{.bib}
+% file) either before or after the surnames. A specialty of the journals of
+% the American Geophysical Union is to have only the first name with
+% reversed initials.
+%
+% If the reference is part of a larger work with editors, then the editor
+% names appear later in the reference text, usually as ``edited by \dots''
+% or as ``\emph{names} (editors)''. In these cases, the editor names are
+% not usually reversed (surname first) even if the authors' names are.
+% An option is provided to format such editor names exactly as the authors'.
+% \begin{macrocode}
+\beginoptiongroup{AUTHOR NAMES:}{}
+\optdef{*}{ed-au}{Full, surname last}{(John Frederick Smith)}
+\optdef{f}{nm-revf}{Full, surname first}{(Smith, John Frederick)}
+\optdef{i}{nm-init,ed-au}{Initials + surname}{(J. F. Smith)}
+\optdef{r}{nm-rev}{Surname + initials}{(Smith, J. F.)}
+\optdef{s}{nm-rv}{Surname + dotless initials}{(Smith J F)}
+\optdef{w}{nm-rvvc}{Surname + comma + spaceless initials}{(Smith, J.F.)}
+\optdef{x}{nm-rvx}{Surname + pure initials}{(Smith JF)}
+\optdef{y}{nm-rvcx}{Surname + comma + pure initials}{(Smith, JF)}
+\optdef{z}{nm-rvv}{Surname + spaceless initials}{(Smith J.F.)}
+\optdef{a}{nm-rev1}{Only first name reversed, initials}%
+ {(AGU style: Smith, J. F., H. K. Jones)}
+\optdef{b}{nm-revv1}{First name reversed, with full names}%
+ {(Smith, John Fred, Harry Kab Jones)}
+\getans
+\endoptiongroup
+\mytempfalse
+\if\ans f\mytemptrue\fi
+\if\ans r\mytemptrue\fi
+\if\ans s\mytemptrue\fi
+\if\ans x\mytemptrue\fi
+\if\ans y\mytemptrue\fi
+\if\ans a\mytemptrue\fi
+\if\ans b\mytemptrue\fi
+\beginoptiongroup{EDITOR NAMES IN COLLECTIONS
+ (if author names reversed)}
+ {\ifmytemp*\fi}
+\if\ans r
+\optdef{*}{}{Editor names NOT reversed}{as edited by J. J. Smith}
+\fi
+\if\ans s
+\optdef{*}{}{Editor names NOT reversed}{as edited by J J Smith}
+\fi
+\if\ans a
+\optdef{*}{}{Editor names NOT reversed}{as edited by J. J. Smith}
+\fi
+\if\ans x
+\optdef{*}{}{Editor names NOT reversed}{as edited by JJ Smith}
+\fi
+\if\ans f
+\optdef{*}{}{Editor names NOT reversed}{as edited by John James Smith}
+\fi
+\if\ans y
+\optdef{*}{}{Editor names NOT reversed}{as edited by J.J. Smith}
+\fi
+\if\ans b
+\optdef{*}{}{Editor names NOT reversed}{as edited by John James Smith}
+\fi
+\optdef{r}{ed-rev}{Editor names reversed}{just like authors'}
+\getans
+\beginoptiongroup{POSITION OF JUNIOR
+ (if author names reversed)}
+ {}
+\optdef{*}{jnrlst}{Junior comes last}{as Smith, John, Jr.}
+\optdef{m}{}{Junior between}{as Smith, Jr., John}
+\getans
+\endoptiongroup
+\endoptiongroup
+
+\beginoptiongroup{JUNIOR PART IN THE CITATION
+ (if author-year citations)}
+ {\ifnumerical\else*\fi}%
+\optdef{*}{}{No `junior' part in the citations}{but in the ref listing}
+\optdef{j}{jnrlab}{`Junior' in citations}{as well as in ref listing}
+\getans
+\endoptiongroup
+
+\beginoptiongroup{PUNCTUATION BETWEEN AUTHOR NAMES:}{}
+\optdef{*}{}{Author names separated by commas}{}
+\optdef{s}{aunm-semi}{Names separated by semi-colon}{}
+\optdef{h}{aunm-sl}{Names separated by slash}{/}
+\getans
+\endoptiongroup
+
+\beginoptiongroup{ADJACENT REFERENCES WITH REPEATED NAMES:}{}
+\optdef{*}{}{Author/editor names always present}{}
+\optdef{d}{nmdash}{Repeated author/editor names replaced by dash}{}
+\optdef{2}{nmdash,nmd-2}{Repeated author/editor names replaced by 2 dashes}{}
+\optdef{3}{nmdash,nmd-3}{Repeated author/editor names replaced by 3 dashes}{}
+\getans
+\endoptiongroup
+% \end{macrocode}
+%
+% \subsection*{Number of authors}
+% Normally the complete list of authors as given in the \texttt{.bib} file is
+% presented in the reference list. However, some journals prefer to limit
+% them to a maximum. If there are more than this maximum number of author
+% names, then a minimum number plus \textsl{et al.} are listed.
+%
+% Because no test for consistency of the numbers is carried out in the
+% \texttt{.bst} file itself (it might be possible, but I found it too complex),
+% this is done here.
+% \begin{macrocode}
+\beginoptiongroup{NUMBER OF AUTHORS IN BIBLIOGRAPHY:}{}
+\optdef{*}{}{All authors}{included in listing}
+\optdef{l}{nmlm}{Limited authors}{(et al replaces missing names)}
+\getans
+\endoptiongroup
+\if\ans l
+\loop
+ \ask{\num}{Maximum number of authors (1-99)}
+ \ifnum\num>99\relax
+ \mes{*** Must be between 1 and 99}
+\repeat
+\def\parsenum#1#2{\if#2\relax\wr{\spsp\spsp x#1,\pc: Maximum of #1\space authors}
+ \else\wr{\spsp\spsp x#10,x#2,\pc: Maximum of #1#2\space authors}\fi}
+\expandafter\parsenum\num\relax
+\mes{\spsp You have selected maximum \num\space authors}
+\edef\numx{\num}
+\loop
+ \ask{\num}{Minimum number (before et al given) (1-\numx)}
+ \ifnum\num>\numx
+ \mes{*** Must be between 1 and \numx}
+\repeat
+\def\parsenum#1#2{\if#2\relax\wr{\spsp\spsp m#1,\pc: Minimum of #1\space authors}
+ \else\wr{\spsp\spsp m#10,m#2,\pc: Minimum of #1#2\space authors}\fi}
+\expandafter\parsenum\num\relax
+\mes{\spsp You have selected minimum \num\space authors}
+\fi
+
+% \end{macrocode}
+%
+% Something that I finally added after being asked many times, is to allow for
+% more than one name in the citation before inserting \textsl{et~al.}
+% to allow more than 2 authors before truncating
+% \begin{macrocode}
+\beginoptiongroup{AUTHORS IN CITATIONS:}{}
+\optdef{*}{}{One author et al}{for three or more authors}
+\optdef{m}{mcite}{Some other truncation scheme}{}
+\getans
+\endoptiongroup
+\mytempfalse
+\if\ans m\mytemptrue\fi
+\beginoptiongroup{MAX AUTHORS BEFORE ET AL:
+ (if regular cite not selected)}
+ {\ifmytemp*\fi}%
+\optdef{*}{mct-1}{One et al}{}
+\optdef{2}{mct-2}{One, Two et al}{}
+\optdef{3}{mct-3}{One, Two, Three et al}{}
+\optdef{4}{mct-4}{One, Two, Three, Four et al}{}
+\optdef{5}{mct-5}{One, Two, Three, Four, Five et al}{}
+\optdef{6}{mct-6}{One, Two, Three, Four, Five, Six et al}{}
+\getans
+\endoptiongroup
+\beginoptiongroup{MAX AUTHORS WITHOUT ET AL:
+ (if regular cite not selected)}
+ {\ifmytemp*\fi}%
+\optdef{*}{mct-x2}{Two authors without truncating}{}
+\optdef{3}{mct-x3}{Three authors}{without truncating}
+\optdef{4}{mct-x4}{Four authors}{without truncating}
+\optdef{5}{mct-x5}{Five authors}{without truncating}
+\optdef{6}{mct-x6}{Six authors}{without truncating}
+\getans
+\endoptiongroup
+% \end{macrocode}
+%
+% \subsection*{Typeface of names}
+% The author names in the list of references normally appear in the current
+% typeface. This may be changed to small caps, bold, or italics.
+%
+% Alternatively, the surnames only can be formatted, with the first names in the
+% regular font. One can also specify that the words `and' and `et~al.'\ should be
+% in the regular font, or that `et~al.'\ be italic.
+%
+% Another possibility is that the names be put into a command |\bibnamefont{..}|,
+% which must be defined in the \LaTeX\ document. By default, this command does
+% not format its argument. There is also a |\bibfnamefont| command for the first
+% names, to be user-defined.
+%
+% Editor names in a collection or in a book will not normally have these
+% fonts applied to them; this may be additionally selected.
+%
+% \begin{macrocode}
+\beginoptiongroup{TYPEFACE FOR AUTHORS IN LIST OF REFERENCES:}{}
+\optdef{*}{}{Normal font for author names}{}
+\optdef{s}{nmft,nmft-sc}{Small caps authors}{(\string\sc)}
+\optdef{i}{nmft,nmft-it}{Italic authors}{(\string\it\space or \string\em)}
+\optdef{b}{nmft,nmft-bf}{Bold authors}{(\string\bf)}
+\optdef{u}{nmft,nmft-def}{User defined author font}{(\string\bibnamefont)}
+\getans
+\endoptiongroup
+\mytempfalse
+\if\ans i\mytemptrue\fi
+\if\ans s\mytemptrue\fi
+\if\ans b\mytemptrue\fi
+\if\ans u\mytemptrue\fi
+\beginoptiongroup{FONT FOR FIRST NAMES
+ (if non-default font for authors)}
+ {\ifmytemp*\fi}%
+\optdef{*}{}{First names same font as surnames}{}
+\optdef{r}{fnm-rm}{First names in normal font}{}
+\optdef{u}{fnm-def}{First names in user defined font}{(\string\bibfnamefont)}
+\getans
+\beginoptiongroup{EDITOR NAMES IN INCOLLECTION ETC:}{}
+\optdef{*}{}{Editors incollection normal font}{}
+\optdef{a}{nmfted}{Editors incollection like authors}{font}
+\getans
+\endoptiongroup
+
+\beginoptiongroup{FONT FOR `AND' IN LIST:}{}
+\optdef{*}{}{`And' in author font}{(JONES AND JAMES)}
+\optdef{r}{nmand-rm}{`And' in normal font}{(JONES and JAMES)}
+\getans
+\endoptiongroup
+\endoptiongroup
+% \end{macrocode}
+%
+% \subsection*{Names in Citation label}
+% This applies to author--year style only. The label is the text written
+% by the |\cite| command, and for author--year style, this is something like
+% `Daly et al.\ (1990b)'. One may select italics for the authors and for the
+% extra label attached to the year. The year always remains plain.
+%
+% This parallels the font selection for the names in the list of references
+% except that there no choice for the first names, since only surnames
+% are used in the labels. A user-defined |\citefontname| may also
+% be selected, but this \emph{must} be defined by the user since there
+% will be no default definition for it.
+%
+% If a font is selected for the cited authors, then the word `and' may be
+% optionally put in the normal font.
+%
+% It is not possible to select the type of brackets for the year, since
+% this is determined by the \LaTeX{} style option that manages the
+% author--year citations. This is not standard \LaTeX, so that there are a
+% number of private style files for achieving this.
+% \begin{macrocode}
+\beginoptiongroup{FONT OF CITATION LABELS IN TEXT
+ (if author-year citations)}
+ {\ifnumerical\else*\fi}%
+\optdef{*}{}{Cited authors plain}{as result of \string\cite\space command}
+\optdef{i}{lab,lab-it}{Cited authors italic}{}
+\optdef{s}{lab,lab-sc}{Cited authors small caps}{}
+\optdef{b}{lab,lab-bf}{Cited authors bold}{}
+\optdef{u}{lab,lab-def}{User defined citation font}{(\string\citenamefont)}
+\getans
+
+\mytempfalse
+\if\ans i\mytemptrue\fi
+\if\ans s\mytemptrue\fi
+\if\ans b\mytemptrue\fi
+\if\ans u\mytemptrue\fi
+\beginoptiongroup{FONT FOR `AND' IN CITATIONS
+ (if non-default font for citation lables)}
+ {\ifmytemp*\fi}%
+\optdef{*}{}{Cited `and' in author font}{}
+\optdef{r}{and-rm}{Cited `and' in normal font}{}
+\getans
+\endoptiongroup
+\beginoptiongroup{FONT OF EXTRA LABEL
+ (The extra letter on the year)}{}
+\optdef{*}{}{Extra label plain}{}
+\optdef{i}{xlab-it}{Extra label italic}{}
+\getans
+\endoptiongroup
+\endoptiongroup
+% \end{macrocode}
+%
+% \subsection*{Label for missing author names}
+%
+% If the author and/or editor is missing, the standard \texttt{.bst} files
+% use the \texttt{key} field in place of the names for purposes of ordering the
+% entries.
+%
+% For author--year styles, the \texttt{key} field is even inserted in the
+% reference list and in the label in place of the authors. Optionally, one can
+% suppress the year in this case, which causes \texttt{natbib} (version~7)
+% to print only that key text as a code designation for the work. Thus if
+% \texttt{KEY = "CS1-345"} and there are no authors, then |\citep| produces
+% (CS1-345) and |\citet| simply CS1-345. That is, they behave like
+% |\citeauthor|. If \texttt{natbib} did not recognize the blank year, one would
+% get (CS1-345, ) and CS1-345 (). (Earlier versions of \texttt{natbib} crash on
+% a blank year.)
+% \begin{macrocode}
+\beginoptiongroup{LABEL WHEN AUTHORS MISSING
+ (if author-year citations)}
+ {\ifnumerical\else*\fi}%
+\optdef{*}{keyxyr}{Year blank when KEY replaces missing author}{(for natbib 7.0)}
+\optdef{y}{}{Year included when KEY replaces missing author}{}
+\getans
+\endoptiongroup
+% \end{macrocode}
+%
+% \subsection*{Missing date}
+% A missing date can be set to ???? or simply left blank. In the latter case,
+% \texttt{natbib} version~7 will print only the authors without any year
+% punctuation or brackets.
+%
+% \begin{macrocode}
+\beginoptiongroup{MISSING DATE
+ (if author-year citations)}
+ {\ifnumerical\else*\fi}%
+\optdef{*}{}{Missing date set to ????}{in label and text}
+\optdef{b}{blkyear}{Missing date left blank}{}
+\getans
+\endoptiongroup
+% \end{macrocode}
+%
+% \subsection*{Position of date}
+% This applies to author--year style only. It makes sense to put the date
+% immediately after the author list, since the two items (author and year)
+% are the identifiers of the reference. Default position is at the
+% end of the references, before any notes. It is also possible to place
+% it even after the notes.
+%
+% Medical journals have a system where the date is part of the journal
+% specification, as Lancet 1994;45(2):34--40. Otherwise the date appears at
+% the end.
+% \begin{macrocode}
+\beginoptiongroup{DATE POSITION:}{}
+\optdef{*}{}{Date at end}{}
+\optdef{b}{dt-beg}{Date after authors}{}
+\optdef{j}{dt-jnl}{Date part of journal spec.}{(as 1994;45:34-40) else at end}
+\optdef{e}{dt-end}{Date at very end}{after any notes}
+\getans
+\endoptiongroup
+\if\ans b\mytemptrue\else\if\ans j\mytemptrue\else\mytempfalse\fi\fi
+% \end{macrocode}
+%
+% \subsection*{Format of date}
+% The year may be enclosed in parentheses, brackets, or preceded by a
+% colon. If none of these are selected, the date (month plus year) appears.
+% For author--year, the date normally consists only of the year, no month,
+% but this may be overridden.
+%
+% If the date comes just after the authors, then one might want special
+% punctuation following it, like a colon, or space only. The latter is
+% probably desirable if the date is brackets or parentheses.
+%
+% The date can even be put into bold face.
+% \begin{macrocode}
+\beginoptiongroup{DATE FORMAT
+ (if non author-year citations)}
+ {\ifnumerical*\fi}%
+\optdef{*}{}{Plain month and year}{without any brackets}
+\optdef{p}{yr-par}{Date in parentheses}{as (May 1993)}
+\optdef{b}{yr-brk}{Date in brackets}{as [May 1993]}
+\optdef{c}{yr-col}{Date preceded by colon}{as `: May 1993'}
+\optdef{d}{yr-per}{Date preceded by period}{as `. May 1993'}
+\optdef{m}{yr-com}{Date preceded by comma}{as `, May 1993'}
+\optdef{s}{yr-blk}{Date preceded by space}{only, as ` May 1993'}
+\getans
+\beginoptiongroup{SUPPRESS MONTH:}{}
+\optdef{*}{}{Date is month and year}{}
+\optdef{x}{xmth}{Date is year only}{}
+\getans
+\endoptiongroup
+\beginoptiongroup{REVERSED DATE
+ (if including month)}
+ {\if\ans x\else*\fi}%
+\optdef{*}{}{Date as month year}{}
+\optdef{r}{dtrev}{Date as year month}{}
+\getans
+\endoptiongroup
+\endoptiongroup
+
+\beginoptiongroup{DATE FORMAT
+ (if author-year citations)}
+ {\ifnumerical\else*\fi}%
+\optdef{*}{}{Year plain}{without any brackets}
+\optdef{p}{yr-par}{Year in parentheses}{as (1993)}
+\optdef{b}{yr-brk}{Year in brackets}{as [1993]}
+\optdef{c}{yr-col}{Year preceded by colon}{as `: 1993'}
+\optdef{d}{yr-per}{Year preceded by period}{as `. 1993'}
+\optdef{m}{yr-com}{Date preceded by comma}{as `, 1993'}
+\optdef{s}{yr-blk}{Year preceded by space}{only, as ` 1993'}
+\getans
+\beginoptiongroup{INCLUDE MONTHS:}{}
+\optdef{*}{}{Date is year only}{without the month}
+\optdef{m}{aymth}{Include month in date}{}
+\getans
+\endoptiongroup
+\beginoptiongroup{REVERSED DATE
+ (if including month)}
+ {\if\ans m*\fi}%
+\optdef{*}{}{Date as month year}{}
+\optdef{r}{dtrev}{Date as year month}{}
+\getans
+\endoptiongroup
+\endoptiongroup
+
+\beginoptiongroup{DATE PUNCTUATION
+ (if date not at end)}
+ {\ifmytemp*\fi}%
+\optdef{*}{}{Date with standard block punctuation}{(comma or period)}
+\optdef{c}{yrp-col}{Colon after date}{as 1994:}
+\optdef{s}{yrp-semi}{Semi-colon after date}{as 1994;}
+\optdef{p}{yrp-per}{Period after date}{even when blocks use commas}
+\optdef{x}{yrp-x}{No punct. after date}{}
+\getans
+\beginoptiongroup{BLANK AFTER DATE:}{}
+\optdef{*}{}{Space after date}{and punctuation}
+\optdef{x}{yrpp-xsp}{No space after date}{as 1994:45}
+\getans
+\endoptiongroup
+\endoptiongroup
+\beginoptiongroup{DATE FONT:}{}
+\optdef{*}{}{Date in normal font}{}
+\optdef{b}{dtbf}{Date in bold face}{}
+\getans
+\endoptiongroup
+% \end{macrocode}
+%
+% Normally in author--year citations, the \texttt{year} entry is truncated
+% to the last 4 characters, which should be the 4 digits of the year. Some
+% users have requested the possibility of suppressing this truncation so
+% that they may put text in the \texttt{year} field, such as ``in press.''
+% Another use for it is when years are given as ``1968--72''. Actually,
+% I have no idea why the year should be truncated at all.
+% \begin{macrocode}
+\beginoptiongroup{TRUNCATE YEAR
+ (if author-year citations)}
+ {\ifnumerical\else*\fi}%
+\optdef{*}{note-yr}{Year text full}{as 1990--1993 or `in press'}
+\optdef{t}{}{Year truncated}{to last 4 digits}
+\getans
+\endoptiongroup
+% \end{macrocode}
+%
+% \subsection*{Article title in journal}
+% The title of an article in a journal or in a collection (a book, or
+% conference proceedings) may appear plain, in italics, within single
+% or double quotes or even in guillemets. The last is best with T1 coding; a
+% poor man's version for OT1 is provided; \LaTeXe\ is required in both cases.
+%
+% Furthermore, it may have sentence capitalization (first
+% word and word following colon) or be capitalized as in the \texttt{.bib} file
+% entry. That is why it is recommended to capitalize the entry text as it
+% should appear when fully capitalized, putting words that are always
+% capitalized in braces. Example:
+% \begin{quote}
+% |TITLE="The Results of the {Giotto} Mission"|
+% \end{quote}
+% which produces either ``The results of the Giotto mission'' or ``The
+% Results of the Giotto Mission'', depending on option.
+%
+% Additionally, the article titles may be fully suppressed.
+% \begin{macrocode}
+\beginoptiongroup{TITLE OF ARTICLE:}{}
+\optdef{*}{}{Title plain}{with no special font}
+\optdef{i}{tit-it}{Title italic}{(\string\em)}
+\optdef{q}{tit-qq,qt-s}{Title and punctuation in single quotes}{(`Title,' ..)}
+\optdef{d}{tit-qq}{Title and punctuation in double quotes}{(``Title,'' ..)}
+\optdef{g}{tit-qq,qt-g}{Title and punctuation in guillemets}{(<<Title,>> ..)}
+\optdef{x}{tit-qq,qt-s,qx}{Title in single quotes}{(`Title', ..)}
+\optdef{y}{tit-qq,qx}{Title in double quotes}{(``Title'', ..)}
+\optdef{z}{tit-qq,qt-g,qx}{Title in guillemets}{(<<Title>>, ..)}
+\getans
+\endoptiongroup
+\mytempfalse
+\if\ans q\mytemptrue\fi
+\if\ans d\mytemptrue\fi
+\if\ans g\mytemptrue\fi
+\if\ans x\mytemptrue\fi
+\if\ans y\mytemptrue\fi
+\if\ans z\mytemptrue\fi
+\beginoptiongroup{COLLECTION/PROCEEDINGS TITLES
+ (if quoted title)}
+ {\ifmytemp*\fi}%
+\optdef{*}{bt-qq}{Quote collection and proceedings titles}{too}
+\optdef{x}{}{Collection and proceedings titles not in quotes}{}
+\getans
+\endoptiongroup
+\beginoptiongroup{CAPITALIZATION OF ARTICLE TITLE:}{}
+\optdef{*}{}{Sentence style}{(capitalize first word and those in braces)}
+\optdef{t}{atit-u}{Title style}{(just as in bib entry)}
+\getans
+\endoptiongroup
+
+\beginoptiongroup{ARTICLE TITLE PRESENT:}{}
+\optdef{*}{}{Article title present}{in journals and proceedings}
+\optdef{x}{jtit-x}{No article title}{}
+\getans
+\endoptiongroup
+% \end{macrocode}
+%
+% \subsection*{Journal names}
+% Abbreviated journal names normally contain periods; the periods may be
+% removed with this option. In fact, only letters, numbers, and spacing are
+% retained.
+% \begin{macrocode}
+\beginoptiongroup{JOURNAL NAMES:}{}
+\optdef{*}{}{Periods in journal names}{are retained, as `Phys. Rev.'}
+\optdef{x}{jxper}{Dotless journal names}{as `Phys Rev'}
+\getans
+\endoptiongroup
+% \end{macrocode}
+% Journal name is normally printed in italics; can be left in normal font.
+% \begin{macrocode}
+\beginoptiongroup{JOURNAL NAME FONT:}{}
+\optdef{*}{}{Journal name italics}{}
+\optdef{r}{jttl-rm}{Journal name normal}{font}
+\getans
+\endoptiongroup
+% \end{macrocode}
+%
+% \subsection*{Title of Theses and Technical Reports}
+% The title of a these (PhD or Master's) is normally treated the same
+% as that of a book. Optionally, it may be formatted like that of
+% an article.
+%
+% The title of a technical report is normally treated the same as that
+% of an article. Optionally, it may be formatted like that of a book.
+%
+% \begin{macrocode}
+\beginoptiongroup{THESIS TITLE:}{}
+\optdef{*}{}{Thesis titles like books}{}
+\optdef{a}{thtit-a}{Thesis title like article}{}
+\optdef{x}{thtit-x}{No thesis title}{}
+\getans
+\endoptiongroup
+
+\beginoptiongroup{TECHNICAL REPORT TITLE:}{}
+\optdef{*}{}{Tech. report title like articles}{}
+\optdef{b}{trtit-b}{Tech. report title like books}{}
+\getans
+\endoptiongroup
+
+\beginoptiongroup{TECHNICAL REPORT NUMBER:}{}
+\optdef{*}{}{Tech. report and number plain}{as `Tech. Rep. 123'}
+\optdef{i}{trnum-it}{Tech. report and number italic}%
+ {as `{\string\it\space Tech. Rep. 123'}}
+\getans
+\endoptiongroup
+% \end{macrocode}
+%
+% \subsection*{Journal reference}
+% Great diversity of opinion exists as to how a journal reference is to be
+% formatted. It consists of a volume, possibly a number, and page limits.
+% The number is really only necessary if the page numbers within one volume
+% start at 1 for each physical `number'. Since journals are often bound
+% together in one volume later, it makes more sense to number the pages
+% continuously through the whole volume.
+%
+% I am only aware of one journal that used to reset the pagination for each
+% `number', in which case the number was part of the page designation.
+% I had erroneously provided an option \texttt{vnum-pg} to achieve this, but I
+% now realize that instead, for this one journal, the database entries must
+% contain \texttt{pages="(2)33--2(55)"}. This option has been removed at
+% version 3.84.
+%
+% A number of styles for journal specifications are
+% \begin{quote}
+% \begin{tabular}{l@{\qquad}l}
+% 21(2):33--55 & 21, no.\ 2: 33--55\\
+% \textbf{21}(2):33--55 & \textbf{21}, \#2, 33--55\\
+% \textit{21}(2), 33--55 & \textit{21} (2); 33--55 \\
+% 21(2) (1995) 33--55 & 21(1995), 33-55\\
+% 21(2) 33--55 & vol.~21 (2), pp.~33--55
+% \end{tabular}
+% \end{quote}
+%
+% Here both start and stop page numbers have been given; often only the
+% start page is wanted.
+%
+% It is also possible to include the year as part of the journal specification,
+% in which case the year is always in parentheses, attached snugly or with space
+% to the volume, or preceding the pages.
+%
+% \begin{macrocode}
+\beginoptiongroup{JOURNAL VOLUME:}{}
+\optdef{*}{}{Volume plain}{as vol(num)}
+\optdef{i}{vol-it}{Volume italic}{as {\string\em\space vol}(num)}
+\optdef{b}{vol-bf}{Volume bold}{as {\string\bf\space vol}(num)}
+\optdef{d}{vol-2bf}{Volume and number bold}{as {\string\bf\space vol(num)}}
+\getans
+\endoptiongroup
+% \end{macrocode}
+%
+% The form of the `number' is also given: in parentheses, with `no.',
+% with \#, or omitted. The \texttt{vnum-b} option is meant to be used
+% with \texttt{jdt-v} and \texttt{jdt-vs} but could be used alone.
+% \begin{macrocode}
+\beginoptiongroup{JOURNAL VOL AND NUMBER:}{}
+\optdef{*}{}{Journal vol(num)}{as 34(2)}
+\optdef{s}{vnum-sp}{Journal vol (num)}{as 34 (2)}
+\optdef{c}{vnum-cm}{Journal vol, num}{as 34, 2}
+\optdef{n}{vnum-nr}{Journal vol, no. num}{as 34, no. 2}
+\optdef{h}{vnum-h}{Journal vol, \string\# number}{as 34, \string\#2}
+\optdef{b}{vnum-b}{Journal vol number}{as 34 2}
+\optdef{x}{vnum-x}{Journal vol, without number}{as 34}
+\getans
+\endoptiongroup
+
+\beginoptiongroup{VOLUME PUNCTUATION:}{}
+\optdef{*}{}{Volume with colon}{as vol(num):ppp}
+\optdef{s}{volp-sp}{Volume with colon and space}{as vol(num): ppp}
+\optdef{h}{volp-semi}{Volume with semi-colon}{as vol(num); ppp}
+\optdef{c}{volp-com}{Volume with comma}{as vol(num), ppp}
+\optdef{b}{volp-blk}{Volume with blank}{as vol(num) ppp}
+\getans
+\endoptiongroup
+
+\beginoptiongroup{YEAR IN JOURNAL SPECIFICATION:}{}
+\optdef{*}{}{Journal year like others}{as given by date position}
+\optdef{v}{jdt-v}{Journal vol(year)}{as 34(1995)}
+\optdef{s}{jdt-vs}{Journal vol (year)}{as 34 (1995)}
+\optdef{p}{jdt-p}{Year with pages}{as 34(2), (1995) 1345--1387}
+\optdef{c}{jdt-pc}{Year, comma, pages}{as 34(2), (1995), 1345--1387}
+\getans
+\endoptiongroup
+
+\beginoptiongroup{PAGE NUMBERS:}{}
+\optdef{*}{}{Start and stop page numbers}{given}
+\optdef{f}{jpg-1}{Only start page number}{}
+\getans
+\endoptiongroup
+
+\beginoptiongroup{LARGE PAGE NUMBERS:}{}
+\optdef{*}{}{No separators for large page numbers}{}
+\optdef{c}{pgsep-c}{Comma inserted over 9999}{as 11,234}
+\optdef{s}{pgsep-s}{Thin space inserted over 9999}{as 11 234}
+\optdef{p}{pgsep-p}{Period inserted over 9999}{as 11.234}
+\getans
+\endoptiongroup
+
+\beginoptiongroup{WORD `PAGE' IN ARTICLES:}{}
+\optdef{*}{}{Article pages numbers only}{as 234-256}
+\optdef{p}{jwdpg}{Include `page' in articles}{as pp. 234--256}
+\getans
+\endoptiongroup
+% \end{macrocode}
+%
+% Some journals want page numbers at the end, even for books, proceedings, as
+% well as for journals.
+% \begin{macrocode}
+\beginoptiongroup{POSITION OF PAGES:}{}
+\optdef{*}{}{Pages given mid text}{as is normal}
+\optdef{e}{pp-last}{Pages at end}{but before any notes}
+\getans
+\endoptiongroup
+
+\beginoptiongroup{WORD `VOLUME' IN ARTICLES:}{}
+\optdef{*}{}{Article volume as number only}{as 21}
+\optdef{p}{jwdvol}{Include `volume' in articles}{as vol. 21}
+\getans
+\endoptiongroup
+% \end{macrocode}
+%
+% Fiddle with the format and location of the number/series for collections and
+% inproceedings.
+% \begin{macrocode}
+\beginoptiongroup{NUMBER AND SERIES FOR COLLECTIONS:}{}
+\optdef{*}{num-xser}{Allows number without series}{and suppresses word "number"}
+\optdef{s}{}{Standard BibTeX}{as: "number 123 in Total Works"; error if number and no series}
+\getans
+\endoptiongroup
+
+\beginoptiongroup{POSITION OF NUMBER AND SERIES:}{}
+\optdef{*}{}{After chapter and pages}{as in standard BibTeX}
+\optdef{t}{numser}{Just before publisher}{or organization}
+\getans
+\endoptiongroup
+% \end{macrocode}
+%
+% Fiddle with the format and location of series and volume with books and collections.
+% \begin{macrocode}
+\beginoptiongroup{VOLUME AND SERIES FOR BOOKS/COLLECTIONS:}{}
+\optdef{*}{}{Vol. 23 of Series}{as in standard BibTeX}
+\optdef{s}{ser-vol}{Series, vol. 23}{}
+\getans
+\endoptiongroup
+
+\beginoptiongroup{POSITION OF VOLUME AND SERIES FOR INCOLLECTIONS:}{}
+\optdef{*}{}{Series and volume after the editors}{}
+\optdef{e}{ser-ed}{Series and volume after booktitle}{and before editors}
+\getans
+\endoptiongroup
+% \end{macrocode}
+%
+% It is possible to decide whether the journal name should be
+% separated from the following specifications with a blank or comma.
+% \begin{macrocode}
+\beginoptiongroup{JOURNAL NAME PUNCTUATION:}{}
+\optdef{*}{}{Comma after journal}{name}
+\optdef{x}{jnm-x}{Space after journal}{name}
+\getans
+\endoptiongroup
+% \end{macrocode}
+%
+% \subsection*{Books}
+% The title of a book (as opposed to an article in a book or journal) is
+% normally italicized. This may be set to the regular font.
+%
+% The page numbers in books may be set in parentheses, as (pp.\ 345--350).
+% \begin{macrocode}
+\beginoptiongroup{BOOK TITLE:}{}
+\optdef{*}{}{Book title italic}{(\string\em)}
+\optdef{p}{btit-rm,bt-rm}{Book title plain}{(no font command)}
+\getans
+\endoptiongroup
+
+\beginoptiongroup{PAGES IN BOOKS:}{}
+\optdef{*}{}{Pages in book plain}{as pp. 50-55}
+\optdef{p}{bkpg-par}{Pages in book in parentheses}{as (pp. 50-55)}
+\optdef{x}{bkpg-x}{Pages in book bare}{as 50-55}
+\getans
+\endoptiongroup
+\beginoptiongroup{TOTAL PAGES OF A BOOK:}{}
+\optdef{*}{}{Total book pages not printed}{}
+\optdef{p}{pg-bk}{For book: 345 pages}{or pp.}
+\optdef{a}{pg-bk,pg-pre}{Total book pages before publisher}{}
+\getans
+\endoptiongroup
+% \end{macrocode}
+% Some psychology journals wish to have the publisher's address preceding
+% the name, separated by colon, as
+% \begin{quote}New York: Wiley and Sons\end{quote}
+%
+% Some journals (e.g.\ Nature) put publisher in parentheses with date,
+% as (Wiley and Sons, New York, 1983). These normally put the date in
+% parentheses at the end anyway, so this is a merging of the two sets of
+% parentheses.
+% \begin{macrocode}
+\beginoptiongroup{PUBLISHER ADDRESS:}{}
+\optdef{*}{}{Publisher, address}{as Harcourt, New York}
+\optdef{a}{add-pub}{Address: Publisher}{as New York: Harcourt}
+\getans
+\endoptiongroup
+
+\beginoptiongroup{PUBLISHER IN PARENTHESES:}{}
+\optdef{*}{}{Publisher as normal block}{without parentheses}
+\optdef{p}{pub-par}{Publisher in parentheses}{}
+\optdef{d}{pub-date}{Publisher and date in parentheses}{(Oxford, 1994)}
+\optdef{c}{pub-date,pub-xc}{Publisher and date in parentheses, no comma}{(Oxford 1994)}
+\optdef{f}{pub-date,pub-xpar}{Publisher and date without parentheses}{Oxford, 1994}
+\optdef{k}{pub-date,pub-xpar,pub-xc}{Publisher and date, no parentheses, no comma}{Oxford 1994}
+\getans
+\endoptiongroup
+
+\beginoptiongroup{PUBLISHER POSITION:}{}
+\optdef{*}{}{Publisher after chapter, pages}{}
+\optdef{p}{pre-pub}{Publisher before chapter, pages}{}
+\optdef{e}{pre-edn}{Publisher after edition}{}
+\getans
+\endoptiongroup
+% \end{macrocode}
+%
+% \subsection*{ISBN, ISSN, DOI numbers}
+% Books normally possess an ISBN number. This may be included as an
+% optional entry for \texttt{book}, \texttt{inbook}, \texttt{booklet},
+% \texttt{incollection}, \texttt{proceedings}, \texttt{inproceedings}.
+% However, it should be suppressed for \texttt{inbook} etc.\ when
+% there is a crossref to another book with the ISBN number.
+%
+% Periodicals contain an ISSN number. Add this to \texttt{article}, or
+% course, but also to \texttt{inproceedings} and \texttt{proceedings}, since
+% they are sometimes printed in a periodical.
+%
+% Journal articles that appear online are given a DOI number, something more
+% robust than a URL that can change as machines are upgraded.
+% The American Geophysical Union (AGU) uses the DOI as part of the
+% page number substitution for electronic journals, placing the number
+% where the pages would normally appear.
+% \begin{macrocode}
+\beginoptiongroup{ISBN NUMBER:}{}
+\optdef{*}{isbn}{Include ISBN}{for books, booklets, etc.}
+\optdef{x}{}{No ISBN}{}
+\getans
+\endoptiongroup
+
+\beginoptiongroup{ISSN NUMBER:}{}
+\optdef{*}{issn}{Include ISSN}{for periodicals}
+\optdef{x}{}{No ISSN}{}
+\getans
+\endoptiongroup
+
+\beginoptiongroup{DOI NUMBER:}{}
+\optdef{*}{doi}{Include DOI}{as "doi: number"}
+\optdef{u}{url-doi}{Format DOI as URL //doi.org/doi}{(must give url options!)}
+\optdef{a}{agu-doi,doi}{Insert DOI AGU style}{as part of page number}
+\optdef{x}{}{No DOI}{}
+\getans
+\endoptiongroup
+% \end{macrocode}
+%
+% \subsection*{Editor of book without author}
+%
+% This is normally
+% \begin{quote}
+% J. K. James, editor
+% \end{quote}
+% but may also be
+% \begin{quote}
+% J. K. James, (editor)\\
+% J. K. James (editor),
+% \end{quote}
+% Alternatively, the word \textsl{editor} may be capitalized and/or
+% abbreviated.
+%
+% \begin{macrocode}
+\beginoptiongroup{`EDITOR' AFTER NAMES (EDITED BOOKS WITHOUT AUTHORS):}{}
+\optdef{*}{}{Word `editor' after name}{}
+\optdef{a}{edpar}{`Name (editor),'}{in parentheses, after name, comma after}
+\optdef{b}{edpar,bkedcap}{`Name (Editor),'}{as above, editor upper case}
+\optdef{c}{edparc}{`Name, (editor)'}{in parentheses, after name, comma between}
+\optdef{d}{edparc,bkedcap}{`Name, (Editor)'}{as above, editor upper case}
+\optdef{e}{edparxc}{`Name (editor)'}{in parentheses, after name, no commas}
+\optdef{f}{edparxc,bkedcap}{`Name (Editor)'}{as above, editor upper case}
+\getans
+\endoptiongroup
+% \end{macrocode}
+%
+% \subsection*{Edited by}
+% For an article within an edited collection, the normal form is
+% \begin{quote}
+% In J. K. James, editor, \emph{Title of Collection} \dots
+% \end{quote}
+% Alternative forms are
+% \begin{quote}
+% In J. K. James (editor), \emph{Title} \dots\\
+% In \emph{Title}, edited by J. K. James \dots\\
+% In \emph{Title} (Edited by J. K. James) \dots
+% \end{quote}
+% If none of the \texttt{edby} variations is used, then the same system is
+% used as for edited books, i.e. \texttt{edpar} applies.
+% \begin{macrocode}
+\beginoptiongroup{EDITOR IN COLLECTIONS:}{}
+\optdef{*}{}{Same as for edited book}{(names before booktitle)}
+\optdef{b}{edby}{In booktitle, edited by .. }{(where .. is names)}
+\optdef{p}{edby-par}{In booktitle (edited by ..)}{}
+\optdef{c}{edby-parc}{In booktitle, (edited by ..)}{}
+\optdef{e}{edby,edbyx}{In booktitle, editor ..}{}
+\optdef{f}{edby,edbyw}{In booktitle, (editor) ..}{}
+\optdef{k}{edby-par,edbyx}{In booktitle (editor..)}{}
+\optdef{g}{edby-parc,edbyx}{In booktitle, (editor..)}{}
+\optdef{j}{edby,edbyy}{In booktitle, .., editor}{}
+\optdef{m}{edby-par,edbyy}{In booktitle (.., editor)}{}
+\getans
+\endoptiongroup
+\mytempfalse
+\if\ans p\mytemptrue\fi
+\if\ans k\mytemptrue\fi
+\if\ans c\mytemptrue\fi
+\if\ans f\mytemptrue\fi
+\beginoptiongroup{CAPITALIZE `EDITOR' OR `EDITED BY'
+ (if editor capitalizable)}
+ {\ifmytemp*\fi}%
+\optdef{*}{}{`(editor,..)' or `(edited by..)'}{in lower case}
+\optdef{c}{edcap}{`(Editor,..)' or `(Edited by..)'}{in upper case}
+\getans
+\endoptiongroup
+% \end{macrocode}
+%
+% \subsection*{Block punctuation}
+% Blocks are logical sections of the reference specification, such as the
+% author block, the journal block, editor block, etc. These are normally
+% separated by periods, but alternatively a comma may be used. Another
+% choice is to use commas except after titles where a period is given.
+%
+% \LaTeX\ offers an \texttt{openbib} option, which means that the blocks
+% are not only new sentences, but new lines as well. This can only
+% function when the default option here is taken, for then the command
+% |\newblock| is placed between the blocks. This command is normally
+% defined to do nothing, but \LaTeX\ redefines it to issue a new line
+% when open bibliographies are wanted.
+% \begin{macrocode}
+\beginoptiongroup{PUNCTUATION BETWEEN SECTIONS (BLOCKS):}{}
+\optdef{*}{}{\string\newblock\space after blocks}
+ {(periods or new lines with openbib option)}
+\optdef{c}{blk-com}{Comma between blocks}{}
+\optdef{s}{blk-com,com-semi}{Semi-colon between blocks}{}
+\optdef{b}{blk-com,com-blank}{Blanks between blocks}{}
+\optdef{t}{blk-tit}{Period after titles of articles, books, etc}{else commas}
+\optdef{u}{blk-tit,tit-col}{Colon after titles of articles, books, etc}{else commas}
+\optdef{a}{blk-tita}{Period after titles of articles}{else commas}
+\optdef{d}{blk-tita,tit-col}{Colon after titles of articles}{else commas}
+\getans
+\endoptiongroup
+\mytempfalse
+\if\ans c\mytemptrue\fi
+\if\ans s\mytemptrue\fi
+\if\ans b\mytemptrue\fi
+\if\ans t\mytemptrue\fi
+\if\ans a\mytemptrue\fi
+\beginoptiongroup{PUNCTUATION BEFORE NOTES
+ (if not using \string\newblock)}
+ {\ifmytemp*\fi}%
+\optdef{*}{}{Notes have regular punctuation}{like all other blocks}
+\optdef{p}{blknt}{Notes preceded by period}{}
+\getans
+\endoptiongroup
+\beginoptiongroup{PUNCTUATION AFTER AUTHORS:}{}
+\optdef{*}{}{Author block normal}{with regular block punctuation}
+\optdef{c}{au-col}{Author block with colon}{}
+\getans
+\endoptiongroup
+% \end{macrocode}
+%
+% \subsection*{\textsl{In} with colon}
+% When referring to works in a collection, one begins the block describing
+% that collection with \textsl{In}. Optionally, one may add a colon.
+% \begin{macrocode}
+\beginoptiongroup{PUNCTUATION AFTER `IN':}{}
+\optdef{*}{}{Space after `in'}{for incollection or inproceedings}
+\optdef{c}{in-col}{Colon after `in'}{(as `In: ...')}
+\optdef{i}{in-it}{Italic `in'}{and space}
+\optdef{d}{in-col,in-it}{Italic `in' and colon}{}
+\optdef{x}{in-x}{No word `in'}{for edited works}
+\getans
+\endoptiongroup
+\beginoptiongroup{`IN' WITH JOURNAL NAMES
+ (if using 'in' with collections)}
+ {\if\ans x\else*\fi}
+\optdef{*}{}{No `in' before journal name}{}
+\optdef{i}{injnl}{Add `in' before journal name}{in style for incollection}
+\getans
+\endoptiongroup
+% \end{macrocode}
+%
+% \subsection*{Final punctuation}
+% The punctuation at the end of the reference is normally a period. This
+% may be suppressed.
+% \begin{macrocode}
+\beginoptiongroup{FINAL PUNCTUATION:}{}
+\optdef{*}{}{Period at very end}{of the listed reference}
+\optdef{x}{fin-bare}{No period at end}{}
+\getans
+\endoptiongroup
+% \end{macrocode}
+%
+% \subsection*{Abbreviations}
+% A number of words may be abbreviated: pages, editors, volume, chapter,
+% and so on. The first two may be independently set to abbreviation, the
+% rest with a single option.
+%
+% Additionally, the edition numbers may be
+% output as words (first, second, etc.) or as numbers (1st, 2nd, etc.).
+% (Recall that the input in the \texttt{.bib} file is always as English
+% words.)
+% \begin{macrocode}
+\beginoptiongroup{ABBREVIATE WORD `PAGES'
+ (if not using external language file)}
+ {\if!\cfile!\relax*\fi}%
+\optdef{*}{}{`Page(s)'}{(no abbreviation)}
+\optdef{a}{pp}{`Page' abbreviated}{as p. or pp.}
+\optdef{x}{ppx}{`Page' omitted}{}
+\getans
+\beginoptiongroup{ABBREVIATE WORD `EDITORS':}{}
+\optdef{*}{}{`Editor(s)'}{(no abbreviation)}
+\optdef{a}{ed}{`Editor' abbreviated}{as ed. or eds.}
+\getans
+\endoptiongroup
+
+\beginoptiongroup{OTHER ABBREVIATIONS:}{}
+\optdef{*}{}{No abbreviations}{of volume, edition, chapter, etc}
+\optdef{a}{abr}{Abbreviations}{of such words}
+\getans
+\endoptiongroup
+\beginoptiongroup{ABBREVIATION FOR `EDITION'
+ (if abbreviating words)}
+ {\if\ans a*\fi}%
+\optdef{*}{}{`Edition' abbreviated as `edn'}{}
+\optdef{a}{ednx}{`Edition' abbreviated as `ed'}{}
+\getans
+\beginoptiongroup{MONTHS WITH DOTS:}{}
+\optdef{*}{}{Months with dots}{as Jan.}
+\optdef{x}{mth-bare}{Months without dots}{as Feb Mar}
+\getans
+\endoptiongroup
+\endoptiongroup
+\beginoptiongroup{EDITION NUMBERS:}{}
+\optdef{*}{xedn}{Editions as in database}{saving much processing memory}
+\optdef{w}{}{Write out editions}{as first, second, third, etc}
+\optdef{n}{ord}{Numerical editions}{as 1st, 2nd, 3rd, etc}
+\getans
+\endoptiongroup
+\endoptiongroup
+% \end{macrocode}
+%
+% The above choices about abbreviations are made only if the internal
+% languages are taken (English or \texttt{babel}). For an external language
+% definition file, these choices, along with possible other ones, are made
+% in the external file, which is read in at this point.
+% \begin{macrocode}
+\umes{Reading external language file \string\cfile=\cfile}%
+\if!\cfile!\relax\else
+ \input\cfile
+\fi
+% \end{macrocode}
+%
+% This file contains the standard set of stored journal names present in
+% the basic bibliography style files. If other files containing journal
+% names are to be included, they may only contain the options \texttt{jabr}
+% or \texttt{jaa} since these options are selected here. No option
+% menus from the journal-name files will be read in.
+% \begin{macrocode}
+\beginoptiongroup{STORED JOURNAL NAMES:}{}
+\optdef{*}{}{Full journal names}{for prestored journals}
+\optdef{a}{jabr}{Abbreviated journal names}{}
+\optdef{s}{jabr,jaa}{Abbreviated with astronomy shorthands}{like ApJ and AJ}
+\getans
+\endoptiongroup
+% \end{macrocode}
+%
+% \subsection*{Variations on \textsl{and}}
+% It is possible to replace the word \textsl{and} with an ampersand \&, and to
+% specify whether a comma is to precede \textsl{and} in a list of more than two
+% names.
+%
+% A variable \textsl{and} may be provided for with the command |\BIBand|
+% in place of the word. In this case, the command must be defined in the
+% document file or some other package called. (This is intended for situations
+% where an ampersand is wanted in parenthetical citations, but the word in
+% textual ones.)
+%
+% \begin{macrocode}
+\beginoptiongroup{AMPERSAND:}{}
+\optdef{*}{}{Use word `and'}{in author lists}
+\optdef{a}{amper}{Use ampersand}{in place of `and'}
+\optdef{v}{varand}{Use \string\BIBand}{in place of `and'}
+\getans
+\endoptiongroup
+
+\beginoptiongroup{COMMA BEFORE `AND':}{}
+\optdef{*}{}{Comma before `and'}{as `Tom, Dick, and Harry'}
+\optdef{n}{and-xcom}{No comma before `and'}{as `Tom, Dick and Harry'}
+\optdef{c}{and-com}{Comma even with 2 authors}{as `Tom, and Harry'}
+\getans
+\endoptiongroup
+\beginoptiongroup{COMMA BEFORE `AND' EVEN FOR COLLECTION EDITORS
+ (if using comma before `and' with authors)}
+ {\if\ans c*\fi}%
+\optdef{*}{and-com-ed}{Comma with 2 editors}{in collections}
+\optdef{x}{}{Two editors without comma}{as `Tom and Harry'}
+\getans
+\endoptiongroup
+\beginoptiongroup{NO `AND' IN REFERENCE LIST:}{}
+\optdef{*}{}{With `and'}{before last author in reference list}
+\optdef{x}{xand}{No `and'}{as `Tom, Dick, Harry'}
+\getans
+\endoptiongroup
+
+\beginoptiongroup{COMMA BEFORE `ET AL':}{}
+\optdef{*}{}{Comma before `et al'}{in reference list}
+\optdef{x}{etal-xc}{No comma before `et al'}{}
+\getans
+\endoptiongroup
+% \end{macrocode}
+%
+% \subsection*{Font of \textsl{et al}}
+% One can chose that \textsl{et~al.}\ be put into italics.
+% Or, if the authors are in a different font from the regular one, the
+% \textsl{et~al.}\ can still be Roman.
+% \begin{macrocode}
+\beginoptiongroup{FONT OF `ET AL':}{}
+\optdef{*}{}{Plain et al}{}
+\optdef{i}{etal-it}{Italic et al}{}
+\optdef{r}{etal-rm}{Roman et al}{even when authors something else}
+\getans
+\endoptiongroup
+% \end{macrocode}
+%
+% \subsection*{Additional Data Fields}\label{sec:revtex}
+% The American Physical Society's REV\TeX\ package contains \btx\ support
+% with a \texttt{bst} file generated from a variant of
+% \texttt{\filename}. The extra fields are also available here.
+% \begin{itemize}
+% \item \textbf{collaboration}: A collaboration name associated with a
+% reference.
+% \item \textbf{eprint}: The e-print citation for the reference (Los Alamos
+% or otherwise). E-print numbers can be turned into hyperlinks to the
+% online article. The output is\\
+% \hspace*{2em}|\eprint{|\textit{eprint-spec}|}|
+% \item \textbf{archive}: is an optional argument for |\eprint|, as\\
+% \hspace*{2em}|\eprint[|\textit{archive-des}|]{|\textit{eprint-spec}|}|\\
+% The \textit{archive-des} is some code such as \texttt{arXiv} that is
+% translated to a base URL by a class or package file. The default definition
+% of |\eprint| ignores \textit{archive-des} and prints \textit{eprint-spec}
+% as a URL.
+% \item \textbf{url}: A URL associated with the reference. Can be turned
+% into a hyperlink.
+% \end{itemize}
+%
+% A collaboration appears as part of the author list and the other two
+% appear at the end of the citaton. The URL field can be selected
+% independently of this option.
+%
+% In addition there are new fields for journals like Phys.\ Rev.~D that
+% no longer use page numbers.
+% \begin{itemize}
+% \item \textbf{eid}: Electronic article identifier.
+% \item \textbf{numpages}: Number of pages in an article. For use in
+% conjunction with the \textbf{eid} field when page counts are
+% desired. Deprecated when submitting to Phys.\ Rev.
+%
+% The \texttt{eprint} (with \texttt{archive}) and \texttt{url} fields may be
+% included independently of the other REV\TeX\ fields.
+%
+% The \texttt{eid} field is now always included, although it is optional for
+% the bibliography entries. This electronic identifier is a replacement for the
+% page number in electronic journals: it is the sequence number in the printed
+% volume. If present, it will be used in place of the page number.
+%
+% \end{itemize}
+%
+% \begin{macrocode}
+\beginoptiongroup{ADDITIONAL REVTeX DATA FIELDS:}{}
+\optdef{*}{}{No additional fields}{for REVTeX}
+\optdef{r}{revdata,eprint,url,url-blk}{Include REVTeX data fields}
+ {collaboration, eid, eprint, archive, numpages, url}
+\getans
+\mytemptrue
+\if\ans r\mytempfalse\fi
+\beginoptiongroup{E-PRINT DATA FIELD:
+(without REVTeX fields)}
+{\ifmytemp*\fi}
+\optdef{*}{}{Do not include eprint field}{}
+\optdef{e}{eprint}{Include eprint and archive fields}{for electronic publications}
+\getans
+\endoptiongroup
+% \end{macrocode}
+%
+% \subsection*{URL address}
+% For electronic documents with an Internet address, add a URL entry.
+% Harvard already has this, but here it is done for all styles.
+% The URL text will be set with the \verb!\url! command in the \texttt{url}
+% package by Donald Arseneau. This package must be loaded for the command
+% to work right. It allows line breaks at punctuations. Otherwise,
+% \verb!\texttt! is used instead, with no line breaks. The URL text is preceded
+% by \verb!\urlprefix! which defaults to ``URL '' but may be redefined by the
+% user to be whatever s/he wants. The final space must be included.
+%
+% Note: selecting the REV\TeX\ fields automatically includes this, so the
+% offer only is made if REV\TeX\ has been rejected.
+%
+% \begin{macrocode}
+\beginoptiongroup{URL ADDRESS:
+(without REVTeX fields)}{\ifmytemp*\fi}
+\optdef{*}{}{No URL}{for electronic (Internet) documents}
+\optdef{u}{url,url-blk}{Include URL}{as regular item block}
+\optdef{n}{url,url-nt}{URL as note}{}
+\optdef{l}{url,url-nl}{URL on new line}{after rest of reference}
+\getans
+\endoptiongroup
+\endoptiongroup
+% \end{macrocode}
+%
+% \subsection*{Reference Component Tagging}
+% If reference component tagging is enabled, we
+% apply tags like |\bibinfo| and |\eprint| to the fields of data
+% in the content of the |\bibitem| statement. We also ensure that
+% these commands have a default meaning within the scope of the |thebibliography|
+% environment. The default definitions simply print the field and ignore the
+% tag. However, other programs or packages might make use of the tag
+% information to separate authors from title, for example.
+%
+% \begin{macrocode}
+\beginoptiongroup{REFERENCE COMPONENT TAGS:}{}
+\optdef{*}{}{No reference component tags}
+ {in the \string\bibitem\space entries}
+\optdef{b}{bibinfo}{Reference component tags}
+ {like \string\bibinfo\space in the content of \string\bibitem}
+\getans
+\endoptiongroup
+% \end{macrocode}
+%
+% \subsection*{Define emphasis}
+% In everything that been mentioned so far, italicization should be
+% understood to mean `emphasize' in the \LaTeX{} sense. This means that the
+% command |\em| is used. This is not the same as |\it|, which is always
+% italics. Rather, with |\em|, the font style switches between |\rm| and
+% |\it| depending on the context. Here one may choose to true italics, or
+% to switch off italics altogether.
+% \begin{macrocode}
+\beginoptiongroup{EMPHASIS:
+ (affects all so-called italics)}{}
+\optdef{*}{}{Use emphasis}{ie, \string\em, allows font switching}
+\optdef{i}{em-it}{Use true italics}{ie, \string\it, absolute italics}
+\optdef{x}{em-x}{No italics}{at all}
+\optdef{u}{em-ul}{Underlining}{in place of italics, best with ulem package}
+\getans
+\endoptiongroup
+% \end{macrocode}
+%
+% \subsection*{Plain \TeX\ compatibility}
+% Bold face, italics, and emphasis are made with the \LaTeXe\ commands,
+% which makes them incompatible with the obsolete \LaTeX2.09, and with
+% Plain \TeX. There are also some extra testing for existing commands
+% that best work with \LaTeXe\ syntax.
+%
+% If the bibliography style file is to be fully compatible with Plain \TeX,
+% do not select the option \texttt{nfss} but do take \texttt{plntx}.
+% \begin{macrocode}
+\beginoptiongroup{COMPATIBILITY WITH PLAIN TEX:}{}
+\optdef{*}{nfss}{Use LaTeX commands}{which may not work with Plain TeX}
+\optdef{t}{plntx}{Use only Plain TeX}{commands for fonts and testing}
+\getans
+\endoptiongroup
+% \end{macrocode}
+%
+% Terminate the options list. If a language definition file has been called,
+% then we have a closing brace too many, so add another dummy opening brace.
+% \begin{macrocode}
+\if!\cfile\jfile!\else
+\begingroup\MBswitch
+\wr(,{\pc)
+\endgroup
+\fi
+
+\endoptions
+%</options>
+% \end{macrocode}
+%
+% \section{The Bibliographic Coding}
+%
+% \begin{macrocode}
+%<*!options&!driver&!bblbst>
+%<*!tail>
+ % For use with BibTeX version 0.99a or later
+ % -------------------------------------------------------------------
+%<*(!nmft&(nmft-it|nmft-sc|nmft-bf|nmft-def))|(!lab&(lab-it|lab-bf|lab-sc|lab-def))>
+ % WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
+ % The input dbj file contains one of the options
+%<nmft-it|nmft-sc|nmft-bf|nmft-def> % nmft-it, nmft-bf, nmft-sc, or nmft-def
+%<lab-it|lab-sc|lab-bf|lab-def> % lab-it, lab-bf, lab-sc, or lab-def
+ % without the corresponding general option(s):
+%<nmft-it|nmft-sc|nmft-bf|nmft-def> % nmft
+%<lab-it|lab-sc|lab-bf|lab-def> % lab
+ % (You may be using an older dbj with a newer version of merlin.mbs)
+ % Please edit your dbj file to add the general option(s) and reprocess.
+ %
+%</(!nmft&(nmft-it|nmft-sc|nmft-bf|nmft-def))|(!lab&(lab-it|lab-bf|lab-sc|lab-def))>
+%<*!exlang>
+%<!babel> % This bibliography style file is intended for texts in ENGLISH
+%<*babel>
+ % This bibliography style file requires a file named babelbst.tex
+ % containing the definitions of word commands like \bbleditor, etc.
+%</babel>
+%</!exlang>
+%<*exlang>
+ % This bibliography style file is intended for texts in
+%<bahasa> % BAHASA
+%<brazilian> % BRAZILIAN
+%<catalan> % CATALAN
+%<croatian> % CROATIAN
+%<czech> % CZECH
+%<danish> % DANISH
+%<dansk> % DANSK
+%<dutch> % DUTCH
+%<english> % ENGLISH
+%<esperanto> % ESPERANTO
+%<finnish> % FINNISH
+%<french> % FRENCH
+%<galacian> % GALACIAN
+%<german> % GERMAN
+%<hungarian> % HUNGARIAN
+%<italian> % ITALIAN
+%<norwegian> % NORWEGIAN
+%<norsk> % NORWEGIAN
+%<polski> % POLISH
+%<polish> % POLISH
+%<portuguese> % PORTUGUESE
+%<romanian> % ROMANIAN
+%<russian> % RUSSIAN
+%<slovak> % SLOVAK
+%<slovenian> % SLOVENIAN
+%<slovene> % SLOVENIAN
+%<spanish> % SPANISH
+%<swedish> % SWEDISH
+%<turkish> % TURKISH
+%</exlang>
+%<*!html>
+%<*ay>
+ % This is an author-year citation style bibliography. As such, it is
+ % non-standard LaTeX, and requires a special package file to function properly.
+ % Such a package is natbib.sty by Patrick W. Daly
+%<*alk>
+ % or: apalike.sty by Oren Patashnik
+ % The form of the \bibitem entries is
+ % \bibitem[Jones et al., 1990]{key}...
+%</alk>
+%<*!(har|ast|alk|cay|nmd|cn)>
+ % The form of the \bibitem entries is
+ % \bibitem[Jones et al.(1990)]{key}...
+%<nat> % \bibitem[Jones et al.(1990)Jones, Baker, and Smith]{key}...
+ % The essential feature is that the label (the part in brackets) consists
+ % of the author names, as they should appear in the citation, with the year
+ % in parentheses following. There must be no space before the opening
+ % parenthesis!
+%<nat> % With natbib v5.3, a full list of authors may also follow the year.
+ % In natbib.sty, it is possible to define the type of enclosures that is
+ % really wanted (brackets or parentheses), but in either case, there must
+ % be parentheses in the label.
+ % The \cite command functions as follows:
+ % \citet{key} ==>> Jones et al. (1990)
+%<nat> % \citet*{key} ==>> Jones, Baker, and Smith (1990)
+ % \citep{key} ==>> (Jones et al., 1990)
+%<nat> % \citep*{key} ==>> (Jones, Baker, and Smith, 1990)
+ % \citep[chap. 2]{key} ==>> (Jones et al., 1990, chap. 2)
+ % \citep[e.g.][]{key} ==>> (e.g. Jones et al., 1990)
+ % \citep[e.g.][p. 32]{key} ==>> (e.g. Jones et al., 1990, p. 32)
+ % \citeauthor{key} ==>> Jones et al.
+%<nat> % \citeauthor*{key} ==>> Jones, Baker, and Smith
+ % \citeyear{key} ==>> 1990
+%</!(har|ast|alk|cay|nmd|cn)>
+%<*har>
+ % or: harvard.sty by Peter Williams and Thorsten Schnier
+%<harnm> % (needs natbib v5.3 or harvard v2.0.3)
+ % The form of the bibitem entries is
+ % \harvarditem[Jones et al.]{Jones, Baker, and Smith}{1990}{key}...
+%</har>
+%<*cay>
+ % or: chicago.sty
+ % The form of the bibitem entries is
+ % \bibitem[\protect\citeauthoryear{Jones, Baker, and Smith}
+ % {Jones et al.}{1990}{key}...
+%</cay>
+%<*nmd>
+ % or: named.sty
+ % The form of the bibitem entries is
+ % \bibitem[\protect\citeauthoryear{Jones et al.}{1990}]{key}...
+%</nmd>
+%<*ast>
+ % or: astron.sty
+ % The form of the bibitem entries is
+ % \bibitem[\protect\astroncite{Jones et al.}{1990}]{key}...
+%</ast>
+%<*cn>
+ % or: authordate1-4.sty
+ % The form of the bibitem entries is
+ % \bibitem[\protect\citename{Jones et al.}1990]{key}...
+%</cn>
+%</ay>
+%<*!ay>
+%<*!alph&!cite>
+ % This is a numerical citation style, and as such is standard LaTeX.
+%</!alph&!cite>
+%<*alph>
+ % This is a labelled citation style similar to the standard alpha.bst,
+ % where labels are of the form Dal90 or DBK89.
+%</alph>
+%<*cite&!alph>
+ % This is a special pseudo-numerical bibliography style, intended to be
+ % used to list all the entries in a bib database
+%</cite&!alph>
+ % It requires no extra package to interface to the main text.
+ % The form of the \bibitem entries is
+%<!alph&!cite> % \bibitem{key}...
+%<alph> % \bibitem[label]{key}...
+%<!alph&cite> % \bibitem[key]{key}...
+%<*!cite|alph>
+ % Usage of \cite is as follows:
+%<*!alph&!cite>
+ % \cite{key} ==>> [#]
+ % \cite[chap. 2]{key} ==>> [#, chap. 2]
+ % where # is a number determined by the ordering in the reference list.
+%</!alph&!cite>
+%<*alph>
+ % \cite{key} ==>> [label]
+ % \cite[chap. 2]{key} ==>> [label, chap. 2]
+ % The order in the reference list is by label.
+%</alph>
+%<*seq-no&!alph>
+ % The order in the reference list is that by which the works were originally
+ % cited in the text, or that in the database.
+%</seq-no&!alph>
+%<*!seq-no&!alph>
+ % The order in the reference list is alphabetical by authors.
+%</!seq-no&!alph>
+%</!cite|alph>
+%</!ay>
+%</!html>
+%<*html>
+ % This bibliographic style file produces HTML output instead of LaTeX.
+ % The LaTeX special characters are not translated, so that the output
+ % (which has the .bbl ending still) will have to be further massaged,
+ % and renamed with .html or .htm. The title and heading may also need
+ % to be revised.
+ %
+%<htlist&!htdes> % The output is a numbered list.
+%<htdes> % The output is an unnumbered list with the keys printed
+%<htdes> % before each entry.
+%<!htlist&!htdes> % The output is lists each entry as one paragraph.
+%</html>
+ % -------------------------------------------------------------------
+
+% \end{macrocode}
+%
+% \begin{macro}{`ENTRY'}
+% The new \texttt{harvard.sty} of \LaTeXe{} includes an entry URL, or
+% rather it is included in the new \texttt{.bst} files for it. Add it
+% here too, but only for option \texttt{harnm}.
+%
+% Books normally have an ISBN number.
+% This entry is (optionally) included, modelled after that in
+% \texttt{xbtxbst.doc}.
+% \begin{macrocode}
+ENTRY
+ { address
+%<annote> annote
+%<eprint> archive
+ author
+ booktitle
+ chapter
+%<revdata> collaboration
+%<doi|url-doi> doi
+ edition
+ editor
+ eid
+%<eprint> eprint
+ howpublished
+ institution
+%<isbn> isbn
+%<issn> issn
+ journal
+ key
+%<lang> language
+ month
+ note
+ number
+%<revdata> numpages
+ organization
+ pages
+ publisher
+ school
+ series
+ title
+ type
+%<url|harnm|revdata> url
+ volume
+ year
+ }
+ {}
+%<!ay&!alph> { label }
+%<!ay&alph> { label extra.label sort.label }
+%<ay> { label extra.label sort.label short.list }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+INTEGERS { output.state before.all mid.sentence after.sentence after.block }
+% \end{macrocode}
+%
+% \begin{macro}{`init.state.consts'}
+% \begin{macrocode}
+FUNCTION {init.state.consts}
+{ #0 'before.all :=
+ #1 'mid.sentence :=
+ #2 'after.sentence :=
+ #3 'after.block :=
+}
+% \end{macrocode}
+% \end{macro}
+%
+% |s| and |t| are general-purpose scratch registers whose value does not persist
+% past the end of a function. They also do not appear to be used to communicate
+% between functions or to be clobbered within a sub-function call. Hopefully.
+% \begin{macrocode}
+STRINGS { s t}
+% \end{macrocode}
+%
+% \begin{macro}{`output.nonnull'}
+% \begin{macrocode}
+FUNCTION {output.nonnull}
+{ 's :=
+ output.state mid.sentence =
+%<!blk-com|(!com-semi&!com-blank)> { ", " * write$ }
+%<blk-com&com-semi> { "; " * write$ }
+%<blk-com&!com-semi&com-blank> { " " * write$ }
+ { output.state after.block =
+ { add.period$ write$
+ newline$
+%<!html> "\newblock " write$
+ }
+ { output.state before.all =
+ 'write$
+ { add.period$ " " * write$ }
+ if$
+ }
+ if$
+ mid.sentence 'output.state :=
+ }
+ if$
+ s
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{`output'}
+% \begin{macrocode}
+FUNCTION {output}
+{ duplicate$ empty$
+ 'pop$
+ 'output.nonnull
+ if$
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{`output.check'}
+% \begin{macrocode}
+FUNCTION {output.check}
+{ 't :=
+ duplicate$ empty$
+ { pop$ "empty " t * " in " * cite$ * warning$ }
+ 'output.nonnull
+ if$
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{`fin.entry'}
+% I have often been asked to add an annotation function. This suggestion is
+% from Soren Dayton; it inputs a file with the same name as the cite key, or
+% uses the text in the \texttt{annote} field. It will only work with \LaTeXe.
+% \begin{macrocode}
+FUNCTION {fin.entry}
+%<*!fin-bare>
+{ add.period$
+ write$
+%</!fin-bare>
+%<*fin-bare>
+{ duplicate$ empty$
+ 'pop$
+ 'write$
+ if$
+%</fin-bare>
+%<html&htdes> "</dd>" write$
+%<html&!htdes&htlist> "</li>" write$
+%<html&!htdes&!htlist> "</p>" write$
+ newline$
+%<*annote>
+%<*!html>
+ annote missing$
+ { "\bibAnnoteFile{" cite$ * "}" * write$ newline$ }
+ { "\bibAnnote{" cite$ * "}{" * annote * "}" * write$ newline$
+ }
+ if$
+%</!html>
+%<*html>
+ "<blockquote><strong>Key:</strong> "
+ cite$ * write$
+ annote missing$
+ { newline$ }
+ { "<br><strong>Annotation:</strong>" write$ newline$
+ annote write$ newline$
+ }
+ if$
+ "</blockquote>" write$ newline$
+%</html>
+%</annote>
+}
+
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{`new.block'}
+% \begin{macrocode}
+FUNCTION {new.block}
+{ output.state before.all =
+ 'skip$
+ { after.block 'output.state := }
+ if$
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{`new.sentence'}
+% \begin{macrocode}
+FUNCTION {new.sentence}
+{ output.state after.block =
+ 'skip$
+ { output.state before.all =
+ 'skip$
+ { after.sentence 'output.state := }
+ if$
+ }
+ if$
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{`add.blank'}
+% When text is printed with \texttt{output} or
+% \texttt{output.check}, the \texttt{output.state} is set such that
+% a comma will precede the next output text. For special effects, we want to
+% suppress this comma, inserting a blank instead. Hence the
+% \texttt{output.state} is changed to \texttt{before.all}, meaning no
+% punctuation is to be inserted.
+% \begin{macrocode}
+FUNCTION {add.blank}
+{ " " * before.all 'output.state :=
+}
+
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{`add.colon'}
+% \begin{macrocode}
+%<*au-col|tit-col>
+FUNCTION {add.colon}
+{ duplicate$ empty$
+ 'skip$
+ { ":" * add.blank }
+ if$
+}
+
+%</au-col|tit-col>
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{`no.blank.or.punct'}
+% Another frill is to suppresss both blanks and punctuation. The |\hspace|
+% permits a line break at this point.
+% \begin{macrocode}
+%<*yrpp-xsp>
+FUNCTION {no.blank.or.punct}
+%<*!html>
+{ "\hspace{0pt}" * before.all 'output.state :=
+}
+%</!html>
+%<html>{ before.all 'output.state := }
+
+%</yrpp-xsp>
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{`date.block'}
+% The \texttt{date.block} function is used for special punctuating effects
+% after the date.
+% \begin{macrocode}
+FUNCTION {date.block}
+{
+%<*!yrp-x>
+%<yrp-col> ":" *
+%<*!yrp-col>
+%<yrp-semi> ";" *
+%<*!yrp-semi>
+%<!blk-com&!blk-tit&!blk-tita> new.block
+%<(blk-com|blk-tit|blk-tita)&!yrp-per> skip$
+%<(blk-com|blk-tit|blk-tita)&yrp-per> new.sentence
+%</!yrp-semi>
+%</!yrp-col>
+%</!yrp-x>
+%<*yrp-x|yrp-col|yrp-semi>
+%<!yrpp-xsp> add.blank
+%<yrpp-xsp> no.blank.or.punct
+%</yrp-x|yrp-col|yrp-semi>
+}
+
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{`not'}
+% \begin{macrocode}
+FUNCTION {not}
+{ { #0 }
+ { #1 }
+ if$
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{`and'}
+% \begin{macrocode}
+FUNCTION {and}
+{ 'skip$
+ { pop$ #0 }
+ if$
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{`or'}
+% \begin{macrocode}
+FUNCTION {or}
+{ { pop$ #1 }
+ 'skip$
+ if$
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{`non.stop'}
+% This function (my invention) tests if the last character in the string
+% on the stack is \texttt{. ! ?} by using \texttt{add.period\$}. It is to
+% be used for conditional italic correction or adding commas.
+% \begin{macrocode}
+%<*!tit-it&tit-qq>
+FUNCTION {non.stop}
+{ duplicate$
+ "}" * add.period$
+ #-1 #1 substring$ "." =
+}
+
+%</!tit-it&tit-qq>
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{`remove.dots'}
+% This macro removes any periods from the string on the stack. To be used
+% for undotting journal names, months, and juniors. Previously
+% \texttt{purify\$} was used for this, but that removes more than just
+% dots.
+%
+% May 2007, Joseph A. Wright (Morning Star, UK) contributed a revision to allow
+% the dot accent |\.| to be retained.
+% \begin{macrocode}
+%<*nm-rv|nm-rvx|nm-rvcx|mth-bare|jxper>
+STRINGS {z}
+
+FUNCTION {remove.dots}
+{ 'z :=
+ ""
+ { z empty$ not }
+ { z #1 #2 substring$
+ duplicate$ "\." =
+ { z #3 global.max$ substring$ 'z := * }
+ { pop$
+ z #1 #1 substring$
+ z #2 global.max$ substring$ 'z :=
+ duplicate$ "." = 'pop$
+ { * }
+ if$
+ }
+ if$
+ }
+ while$
+}
+%</nm-rv|nm-rvx|nm-rvcx|mth-bare|jxper>
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{`new.block.checka'}
+% \begin{macrocode}
+%<*!ay>
+FUNCTION {new.block.checka}
+{ empty$
+ 'skip$
+ 'new.block
+ if$
+}
+%</!ay>
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{`new.block.checkb'}
+% \begin{macrocode}
+FUNCTION {new.block.checkb}
+{ empty$
+ swap$ empty$
+ and
+ 'skip$
+ 'new.block
+ if$
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{`new.sentence.checka'}
+% \begin{macrocode}
+%<*!ay>
+FUNCTION {new.sentence.checka}
+{ empty$
+ 'skip$
+ 'new.sentence
+ if$
+}
+%</!ay>
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{`new.sentence.checkb'}
+% \begin{macrocode}
+%<*!ay>
+FUNCTION {new.sentence.checkb}
+{ empty$
+ swap$ empty$
+ and
+ 'skip$
+ 'new.sentence
+ if$
+}
+%</!ay>
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{`field.or.null'}
+% \begin{macrocode}
+FUNCTION {field.or.null}
+{ duplicate$ empty$
+ { pop$ "" }
+ 'skip$
+ if$
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{`emphasize'}
+% Emphasis can be either italic or the alternating font. The font command
+% may be NFSS or regular \LaTeX~2.09 declarations.
+% \begin{macrocode}
+FUNCTION {emphasize}
+%<*!em-x>
+{ duplicate$ empty$
+ { pop$ "" }
+%<html> { "<i>" swap$ * "</i>" * }
+%<*!html>
+%<em-ul> { "\uline{" swap$ * "}" * }
+%<*!em-ul>
+%<*!nfss>
+%<!em-it> { "{\em " swap$ * "\/}" * }
+%<em-it> { "{\it " swap$ * "\/}" * }
+%</!nfss>
+%<*nfss>
+%<!em-it> { "\emph{" swap$ * "}" * }
+%<em-it> { "\textit{" swap$ * "}" * }
+%</nfss>
+%</!em-ul>
+%</!html>
+ if$
+}
+%</!em-x>
+%<em-x>{ skip$ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{`bolden'}
+% The bold font command may be NFSS or the regular \LaTeX~2.09 declaration.
+% \begin{macrocode}
+%<*nmft-bf|vol-bf|vol-2bf|lab-bf|dtbf|pres-bf>
+FUNCTION {bolden}
+{ duplicate$ empty$
+ { pop$ "" }
+%<html> { "<b>" swap$ * "</b>" * }
+%<*!html>
+%<!nfss> { "{\bf " swap$ * "}" * }
+%<nfss> { "\textbf{" swap$ * "}" * }
+%</!html>
+ if$
+}
+%</nmft-bf|vol-bf|vol-2bf|lab-bf|dtbf|pres-bf>
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{`scaps'}
+% To put text into small caps.
+% \begin{macrocode}
+%<*lab-sc|nmft-sc|pres-sc>
+FUNCTION {scaps}
+{ duplicate$ empty$
+ { pop$ "" }
+%<html> { skip$ }
+%<*!html>
+%<!nfss> { "{\sc " swap$ * "}" * }
+%<nfss> { "\textsc{" swap$ * "}" * }
+%</!html>
+ if$
+}
+%</lab-sc|nmft-sc|pres-sc>
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{`bib.name.font'}
+% \begin{macro}{`bib.fname.font'}
+% \begin{macro}{`cite.name.font'}
+% Define functions for formatting the author/editor names, one for the
+% surnames (\texttt{bib.name.font}) and one for the first names
+% (\texttt{bib.fname.font}). These could be identical, or the latter is
+% deactivated if first names are not to be formatted, only the last names.
+%
+% For citations, we have \texttt{cite.name.font}. Here only surnames appear.
+%
+% It is also possible to have a user-defined font command for each, which the
+% user must define in his work. These are |\bibnamefont{}| and |\bibfnamefont{}|,
+% and some defaults are provided that simply repeat the arguments. Two commands
+% are needed if \texttt{nmft-def} and \texttt{fnm-def} are both given.
+%
+% If neither \texttt{fnm-def} nor \texttt{fnm-rm} are given, then the first names
+% are formatted the same as the surnames.
+% \begin{macrocode}
+%<*nmft>
+FUNCTION {bib.name.font}
+%<nmft-it>{ emphasize }
+%<!nmft-it&nmft-bf>{ bolden }
+%<!nmft-it&!nmft-bf&nmft-sc>{ scaps }
+%<*!nmft-it&!nmft-bf&!nmft-sc&nmft-def>
+{ duplicate$ empty$
+ { pop$ "" }
+%<!html> { "\bibnamefont{" swap$ * "}" * }
+%<html> { skip$ }
+ if$
+}
+%</!nmft-it&!nmft-bf&!nmft-sc&nmft-def>
+FUNCTION {bib.fname.font}
+%<!fnm-rm&!fnm-def>{ bib.name.font }
+%<fnm-rm>{ skip$ }
+%<*!fnm-rm&fnm-def>
+{ duplicate$ empty$
+ { pop$ "" }
+%<!html> { "\bibfnamefont{" swap$ * "}" * }
+%<html> { skip$ }
+ if$
+}
+%</!fnm-rm&fnm-def>
+%</nmft>
+% \end{macrocode}
+%
+% \begin{macrocode}
+%<*lab>
+FUNCTION {cite.name.font}
+%<lab-it>{ emphasize }
+%<!lab-it&lab-bf>{ bolden }
+%<!lab-it&!lab-bf&lab-sc>{ scaps }
+%<*!lab-it&!lab-bf&!lab-sc&lab-def>
+{ duplicate$ empty$
+ { pop$ "" }
+%<!html> { "\citenamefont{" swap$ * "}" * }
+%<html> { skip$ }
+ if$
+}
+%</!lab-it&!lab-bf&!lab-sc&lab-def>
+%</lab>
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{`tie.or.space.prefix'}
+% The function \texttt{tie.or.space.prefix} determines whether
+% the top item on the stack requires a tie character and
+% slips that (or a space character if not) ahead of it.
+% At this point a font switch or other function can be applied to
+% the top item on the stack, and the appropriate space found
+% just ahead of it on the stack.
+%
+% The sequence \texttt{tie.or.space.prefix} \texttt{*} \texttt{*} is a common idiom
+% for joining the top two stack objects with a tie or space
+% depending on the length of the top object.
+%
+% Another idiom is to apply \texttt{tie.or.space.prefix}, apply a font switch,
+% and then swap and join. In this case the tie or space follows the object.
+% \begin{macrocode}
+FUNCTION {tie.or.space.prefix}
+{ duplicate$ text.length$ #3 <
+ { "~" }
+ { " " }
+ if$
+ swap$
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{`capitalize'}
+% Capitalizing is easy for regular languages, but for \texttt{babel},
+% some trickery stuff is needed; definitions of |\capitalize| and
+% |\Capitalize| are written to the \texttt{.bbl} file.
+% \begin{macrocode}
+
+FUNCTION {capitalize}
+%<!babel>{ "u" change.case$ "t" change.case$ }
+%<babel>{ "\capitalize" swap$ * }
+
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{`space.word'}
+% The function \texttt{space.word} adds a space before and after the word or
+% words currently on the stack. This was added for the \texttt{bbl.}$nnn$
+% functions, that contain only a word without spacing, but replace explicit
+% text in the originals that were spaced out. Its seems more flexible to
+% define the word functions to be without spacing.
+% \begin{macrocode}
+FUNCTION {space.word}
+{ " " swap$ * " " * }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+ % Here are the language-specific definitions for explicit words.
+ % Each function has a name bbl.xxx where xxx is the English word.
+% \end{macrocode}
+%
+% \begin{macrocode}
+%<*!exlang>
+% \end{macrocode}
+%
+% \begin{macro}{`bbl.xxx'}
+% These are the default English words. There is no default language
+% option: one of \texttt{english} or \texttt{babel} must be given.
+% \begin{macrocode}
+%<*!babel>
+ % The language selected here is ENGLISH
+FUNCTION {bbl.and}
+%<!varand|html>{ "and"}
+%<varand&!html>{ "\protect\BIBand{}"}
+
+FUNCTION {bbl.etal}
+{ "et~al." }
+
+FUNCTION {bbl.editors}
+%<!ed>{ "editors" }
+%<ed>{ "eds." }
+
+FUNCTION {bbl.editor}
+%<!ed>{ "editor" }
+%<ed>{ "ed." }
+
+FUNCTION {bbl.edby}
+{ "edited by" }
+
+FUNCTION {bbl.edition}
+%<!abr>{ "edition" }
+%<abr&!ednx>{ "edn." }
+%<abr&ednx>{ "ed." }
+
+FUNCTION {bbl.volume}
+%<!abr>{ "volume" }
+%<abr>{ "vol." }
+
+FUNCTION {bbl.of}
+{ "of" }
+
+FUNCTION {bbl.number}
+%<!abr>{ "number" }
+%<abr>{ "no." }
+
+FUNCTION {bbl.nr}
+{ "no." }
+
+FUNCTION {bbl.in}
+{ "in" }
+
+FUNCTION {bbl.pages}
+%<!pp&!ppx>{ "pages" }
+%<pp>{ "pp." }
+%<!pp&ppx>{ "" }
+
+FUNCTION {bbl.page}
+%<!pp&!ppx>{ "page" }
+%<pp>{ "p." }
+%<!pp&ppx>{ "" }
+
+%<*revdata>
+FUNCTION {bbl.eidpp}
+{ "pages" }
+
+%</revdata>
+FUNCTION {bbl.chapter}
+%<!abr>{ "chapter" }
+%<abr>{ "chap." }
+
+FUNCTION {bbl.techrep}
+%<!abr>{ "Technical Report" }
+%<abr>{ "Tech. Rep." }
+
+FUNCTION {bbl.mthesis}
+{ "Master's thesis" }
+
+FUNCTION {bbl.phdthesis}
+{ "Ph.D. thesis" }
+
+%<*!xedn>
+FUNCTION {bbl.first}
+%<!ord>{ "First" }
+%<ord>{ "1st" }
+
+FUNCTION {bbl.second}
+%<!ord>{ "Second" }
+%<ord>{ "2nd" }
+
+FUNCTION {bbl.third}
+%<!ord>{ "Third" }
+%<ord>{ "3rd" }
+
+FUNCTION {bbl.fourth}
+%<!ord>{ "Fourth" }
+%<ord>{ "4th" }
+
+FUNCTION {bbl.fifth}
+%<!ord>{ "Fifth" }
+%<ord>{ "5th" }
+
+FUNCTION {bbl.st}
+{ "st" }
+
+FUNCTION {bbl.nd}
+{ "nd" }
+
+FUNCTION {bbl.rd}
+{ "rd" }
+
+FUNCTION {bbl.th}
+{ "th" }
+
+%</!xedn>
+%<*!abr>
+MACRO {jan} {"January"}
+
+MACRO {feb} {"February"}
+
+MACRO {mar} {"March"}
+
+MACRO {apr} {"April"}
+
+MACRO {may} {"May"}
+
+MACRO {jun} {"June"}
+
+MACRO {jul} {"July"}
+
+MACRO {aug} {"August"}
+
+MACRO {sep} {"September"}
+
+MACRO {oct} {"October"}
+
+MACRO {nov} {"November"}
+
+MACRO {dec} {"December"}
+
+%</!abr>
+%<*abr>
+MACRO {jan} {"Jan."}
+
+MACRO {feb} {"Feb."}
+
+MACRO {mar} {"Mar."}
+
+MACRO {apr} {"Apr."}
+
+MACRO {may} {"May"}
+
+MACRO {jun} {"Jun."}
+
+MACRO {jul} {"Jul."}
+
+MACRO {aug} {"Aug."}
+
+MACRO {sep} {"Sep."}
+
+MACRO {oct} {"Oct."}
+
+MACRO {nov} {"Nov."}
+
+MACRO {dec} {"Dec."}
+
+%</abr>
+%</!babel>
+% \end{macrocode}
+%
+% Here are the definitions for \texttt{babel} option, i.e., explicit
+% translations are not used, but rather only \LaTeX{} macros that must be
+% defined in the file \texttt{babelbst.tex}. This could allow automatic
+% language selection.
+% \begin{macrocode}
+%<*babel>
+ % The BABEL language selection is made here; definitions in babelbst.tex.
+FUNCTION {bbl.and}
+{ "\bbland{}"}
+
+FUNCTION {bbl.etal}
+{ "\bbletal{}"}
+
+FUNCTION {bbl.editors}
+%<!ed>{ "\bbleditors{}" }
+%<ed>{ "\bbleds{}" }
+
+FUNCTION {bbl.editor}
+%<!ed>{ "\bbleditor{}" }
+%<ed>{ "\bbled{}" }
+
+FUNCTION {bbl.edby}
+{ "\bbledby{}" }
+
+FUNCTION {bbl.edition}
+%<!abr>{ "\bbledition{}" }
+%<abr>{ "\bbledn{}" }
+
+FUNCTION {bbl.volume}
+%<!abr>{ "\bblvolume{}" }
+%<abr>{ "\bblvol{}" }
+
+FUNCTION {bbl.of}
+{ "\bblof{}" }
+
+FUNCTION {bbl.number}
+%<!abr>{ "\bblnumber{}" }
+%<abr>{ "\bblno{}" }
+
+FUNCTION {bbl.nr}
+{ "\bblno{}" }
+
+FUNCTION {bbl.in}
+{ "\bblin{}" }
+
+FUNCTION {bbl.pages}
+%<!pp&!ppx>{ "\bblpages{}" }
+%<pp>{ "\bblpp{}" }
+%<!pp&ppx>{ "" }
+
+FUNCTION {bbl.page}
+%<!pp&!ppx>{ "\bblpage{}" }
+%<pp>{ "\bblp{}" }
+%<!pp&ppx>{ "" }
+
+FUNCTION {bbl.chapter}
+%<!abr>{ "\bblchapter{}" }
+%<abr>{ "\bblchap{}" }
+
+FUNCTION {bbl.techrep}
+%<!abr>{ "\bbltechreport{}" }
+%<abr>{ "\bbltechrep{}" }
+
+FUNCTION {bbl.mthesis}
+{ "\bblmthesis{}" }
+
+FUNCTION {bbl.phdthesis}
+{ "\bblphdthesis{}" }
+
+%<*revdata>
+FUNCTION {bbl.eidpp}
+{ "\bbleidpp{}" }
+
+%</revdata>
+%<*!xedn>
+FUNCTION {bbl.first}
+%<!ord>{ "\bblfirst{}" }
+%<ord>{ "\bblfirsto{}" }
+
+FUNCTION {bbl.second}
+%<!ord>{ "\bblsecond{}" }
+%<ord>{ "\bblsecondo{}" }
+
+FUNCTION {bbl.third}
+%<!ord>{ "\bblthird{}" }
+%<ord>{ "\bblthirdo{}" }
+
+FUNCTION {bbl.fourth}
+%<!ord>{ "\bblfourth{}" }
+%<ord>{ "\bblfourtho{}" }
+
+FUNCTION {bbl.fifth}
+%<!ord>{ "\bblfifth{}" }
+%<ord>{ "\bblfiftho{}" }
+
+FUNCTION {bbl.st}
+{ "\bblst{}" }
+
+FUNCTION {bbl.nd}
+{ "\bblnd{}" }
+
+FUNCTION {bbl.rd}
+{ "\bblrd{}" }
+
+FUNCTION {bbl.th}
+{ "\bblth{}" }
+
+%</!xedn>
+MACRO {jan} {"\bbljan{}"}
+
+MACRO {feb} {"\bblfeb{}"}
+
+MACRO {mar} {"\bblmar{}"}
+
+MACRO {apr} {"\bblapr{}"}
+
+MACRO {may} {"\bblmay{}"}
+
+MACRO {jun} {"\bbljun{}"}
+
+MACRO {jul} {"\bbljul{}"}
+
+MACRO {aug} {"\bblaug{}"}
+
+MACRO {sep} {"\bblsep{}"}
+
+MACRO {oct} {"\bbloct{}"}
+
+MACRO {nov} {"\bblnov{}"}
+
+MACRO {dec} {"\bbldec{}"}
+
+%</babel>
+% \end{macrocode}
+%
+% \begin{macro}{`eng.ord'}
+% This function adds English endings for ordinals 1, 2, 3. However, if
+% the second last digit is 1, then the ending is `th' for all last digits.
+% So far, all other languages included do not have this problem, and it is
+% sufficient to add the \textsl{th} equivalent. This might change with further
+% languages.
+%
+% This function must be included with \texttt{babel} too, since that includes
+% English. This means that the language definition files must also provide
+% for |\bblst|, |\bblnd|, and |\bblrd|, setting them all equal to |\bblth|.
+%
+% \begin{macrocode}
+%<*(english|!exlang)&!xedn>
+FUNCTION {eng.ord}
+{ duplicate$ "1" swap$ *
+ #-2 #1 substring$ "1" =
+ { bbl.th * }
+ { duplicate$ #-1 #1 substring$
+ duplicate$ "1" =
+ { pop$ bbl.st * }
+ { duplicate$ "2" =
+ { pop$ bbl.nd * }
+ { "3" =
+ { bbl.rd * }
+ { bbl.th * }
+ if$
+ }
+ if$
+ }
+ if$
+ }
+ if$
+}
+
+%</(english|!exlang)&!xedn>
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+%</!exlang>
+% \end{macrocode}
+%
+% \begin{macrocode}
+%</!tail>
+% \end{macrocode}
+%
+% \begin{macrocode}
+%<*!head>
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+%<*!jabr>
+MACRO {acmcs} {"ACM Computing Surveys"}
+
+MACRO {acta} {"Acta Informatica"}
+
+MACRO {cacm} {"Communications of the ACM"}
+
+MACRO {ibmjrd} {"IBM Journal of Research and Development"}
+
+MACRO {ibmsj} {"IBM Systems Journal"}
+
+MACRO {ieeese} {"IEEE Transactions on Software Engineering"}
+
+MACRO {ieeetc} {"IEEE Transactions on Computers"}
+
+MACRO {ieeetcad}
+ {"IEEE Transactions on Computer-Aided Design of Integrated Circuits"}
+
+MACRO {ipl} {"Information Processing Letters"}
+
+MACRO {jacm} {"Journal of the ACM"}
+
+MACRO {jcss} {"Journal of Computer and System Sciences"}
+
+MACRO {scp} {"Science of Computer Programming"}
+
+MACRO {sicomp} {"SIAM Journal on Computing"}
+
+MACRO {tocs} {"ACM Transactions on Computer Systems"}
+
+MACRO {tods} {"ACM Transactions on Database Systems"}
+
+MACRO {tog} {"ACM Transactions on Graphics"}
+
+MACRO {toms} {"ACM Transactions on Mathematical Software"}
+
+MACRO {toois} {"ACM Transactions on Office Information Systems"}
+
+MACRO {toplas} {"ACM Transactions on Programming Languages and Systems"}
+
+MACRO {tcs} {"Theoretical Computer Science"}
+%</!jabr>
+% \end{macrocode}
+%
+% Journal abbreviations have been revised from the original Patashnik
+% ones with help of Conrado Badenas and the IUA recommendations.
+% \begin{macrocode}
+%<*jabr>
+MACRO {acmcs} {"ACM Comput. Surv."}
+
+MACRO {acta} {"Acta Inf."}
+
+MACRO {cacm} {"Commun. ACM"}
+
+MACRO {ibmjrd} {"IBM J. Res. Dev."}
+
+MACRO {ibmsj} {"IBM Syst.~J."}
+
+MACRO {ieeese} {"IEEE Trans. Software Eng."}
+
+MACRO {ieeetc} {"IEEE Trans. Comput."}
+
+MACRO {ieeetcad}
+ {"IEEE Trans. Comput. Aid. Des."}
+
+MACRO {ipl} {"Inf. Process. Lett."}
+
+MACRO {jacm} {"J.~ACM"}
+
+MACRO {jcss} {"J.~Comput. Syst. Sci."}
+
+MACRO {scp} {"Sci. Comput. Program."}
+
+MACRO {sicomp} {"SIAM J. Comput."}
+
+MACRO {tocs} {"ACM Trans. Comput. Syst."}
+
+MACRO {tods} {"ACM Trans. Database Syst."}
+
+MACRO {tog} {"ACM Trans. Graphic."}
+
+MACRO {toms} {"ACM Trans. Math. Software"}
+
+MACRO {toois} {"ACM Trans. Office Inf. Syst."}
+
+MACRO {toplas} {"ACM Trans. Progr. Lang. Syst."}
+
+MACRO {tcs} {"Theor. Comput. Sci."}
+
+%</jabr>
+% \end{macrocode}
+%
+% \begin{macro}{`bibinfo.check'}
+% Define functions that encapsulate the argument
+% in a \TeX\ macro that allows for further processing when the
+% bibliography is processed, or allows for a separate computer
+% program to parse the |\bibitem| contents.
+%
+% The following table summarizes how each of the \btx{} entries
+% is accessed for output; these are the points where
+% the \texttt{format.bibinfo} or \texttt{bibinfo.check} functions
+% are called.
+% \subsubsection*{Trapped via \texttt{format.bibinfo}}
+% \begin{description}
+% \item[ \texttt{author} ]\texttt{format.names}
+% \item[ \texttt{collaboration} ]\texttt{format.authors}
+% \item[ \texttt{editor} ]\texttt{format.editors} (\texttt{book}, \texttt{inbook}, \texttt{proceedings}), \texttt{format.names.ed} (\texttt{format.in.ed.booktitle})
+% \item[ \texttt{eid} ]\texttt{format.journal.eid} (\texttt{format.vol.num.pages}, article) checks the output from \texttt{format.journal.pages}
+% \item[ \texttt{isbn} ]\texttt{format.isbn}
+% \item[ \texttt{issn} ]\texttt{format.issn}
+% \item[ \texttt{journal} ]\texttt{format.article.crossref}, article
+% \item[ \texttt{numpages} ]\texttt{format.journal.eid}
+% \item[ \texttt{organization} ]\texttt{format.organization.address} (\texttt{inproceedings}, \texttt{proceedings}), \texttt{manual}
+% \item[ \texttt{pages} ]\texttt{format.book}.pages (\texttt{book}, \texttt{booklet}), \texttt{format.pages} (\texttt{format.journal.pages}, \texttt{format.chapter.pages}, \texttt{article}, \texttt{inbook}, \texttt{incollection}, \texttt{inproceedings})
+% \item[ \texttt{publisher} ]\texttt{format.publisher.address} (like \texttt{output.check}, \texttt{inproceedings}, \texttt{proceedings})
+% \item[ \texttt{title} ]\texttt{format.title}, \texttt{format.btitle}, \texttt{misc}, \texttt{presort}, \texttt{bib.sort.order}
+% \item[ \texttt{volume} ]\texttt{format.bvolume}, \texttt{format.vol.num.pages}, \texttt{format.book.crossref}
+% \item[ \texttt{year} ]in optional argument of \texttt{\char`\\bibitem}, \texttt{format.date} (as part of date), \texttt{format.year}, \texttt{format.org.or.pub}
+% \item[ \texttt{booktitle} ]\texttt{format.in.ed.booktitle} (\texttt{incollection}, \texttt{inproceedings}), \texttt{format.incoll.inproc.crossref}
+% \item[ \texttt{howpublished} ]\texttt{booklet}, \texttt{misc}
+% \item[ \texttt{edition} ]\texttt{convert.edition.format.edition}
+% \item[ \texttt{institution} ]\texttt{techreport}
+% \item[ \texttt{school} ]\texttt{mastersthesis}, \texttt{phdthesis}
+% \item[ \texttt{address} ]\texttt{format.org.or.pub}, \texttt{booklet}, \texttt{manual}, \texttt{mastersthesis}, \texttt{phdthesis}, \texttt{techreport}
+% \item[ \texttt{chapter} ]\texttt{format.chapter.pages}
+% \item[ \texttt{number} ]\texttt{format.number.series}, \texttt{format.vol.num.pages}, \texttt{format.tr.number}
+% \item[ \texttt{series} ]\texttt{format.bvolume}, \texttt{format.number.series}, \texttt{format.book.crossref}
+% \item[ \texttt{type} ]\texttt{format.chapter.pages}, \texttt{format.thesis.type}, \texttt{format.tr.number}
+% \item[ \texttt{month} ]\texttt{format.date}
+% \item[ \texttt{note} ]\texttt{format.note}
+% \item[ \texttt{annote} ]\texttt{fin.entry}
+% \end{description}
+%
+% \subsubsection*{Encapsulated via \texttt{\char`\\url}}
+% \begin{description}
+% \item[ \texttt{url} ]\texttt{format.url} (\texttt{\char`\\harvardurl}, \texttt{\char`\\url}), \texttt{format.url} (\texttt{\char`\\url}), \texttt{format.note} (\texttt{\char`\\url})
+% \end{description}
+%
+% \subsubsection*{Encapsulated via \texttt{\char`\\doi}}
+% \begin{description}
+% \item[ \texttt{doi} ]\texttt{format.doi} (\texttt{\char`\\doi})
+% \end{description}
+%
+% \subsubsection*{Encapsulated via \texttt{\char`\\eprint}}
+% \begin{description}
+% \item[ \texttt{eprint} ]\texttt{format.eprint}
+% \item[ \texttt{archive} ]\texttt{format.eprint}
+% \end{description}
+%
+% \subsubsection*{Not encapsulated:}
+% \begin{description}
+% \item[ \texttt{key} ]cite key
+% \item[ \texttt{language} ]operand of \texttt{\char`\\selectlanguage}
+% \end{description}
+%
+% \subsubsection*{\texttt{bibinfo} tag, but not a \btx{} field}
+% \begin{description}
+% \item[ \texttt{date} ]\texttt{format.date}
+% \end{description}
+%
+% Provides robust access to fields, checking against \texttt{missing\$}
+% and \texttt{empty\$}. A \dtx{} option allows giving
+% a warning if either is the case.
+%
+% If not, it encapsulates the argument in a \TeX\ macro |\bibinfo|.
+% The encapsulation is enabled by the \texttt{bibinfo} \dtx{} option:
+% if turned off, it simply pops the unneeded object.
+%
+% \texttt{field} \texttt{string} \texttt{->} \texttt{encapsulated-field}
+%
+% \texttt{empty} \texttt{string} \texttt{->} \texttt{empty}
+% Side effect: warning.
+% \begin{macrocode}
+FUNCTION {bibinfo.check}
+{ swap$
+ duplicate$ missing$
+ {
+%<bibinfo.warning> swap$ "missing " swap$ * " in " * cite$ * warning$ pop$
+%<!bibinfo.warning> pop$ pop$
+ ""
+ }
+ { duplicate$ empty$
+ {
+%<bibinfo.warning> swap$ "empty " swap$ * " in " * cite$ * warning$
+%<!bibinfo.warning> swap$ pop$
+ }
+ { swap$
+%<bibinfo> "\bibinfo{" swap$ * "}{" * swap$ * "}" *
+%<!bibinfo> pop$
+ }
+ if$
+ }
+ if$
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{`bibinfo.warn'}
+% Replaces \texttt{output.check}
+% with \texttt{bibinfo.warn} followed by \texttt{output}.
+%
+% \texttt{field} \texttt{string} \texttt{->} \texttt{encapsulated-field}
+%
+% \texttt{empty} \texttt{string} \texttt{->} \texttt{empty}
+%
+% Side effect: warning if the field is empty.
+% Note: if the \dtx{} option \texttt{bibinfo} is not in effect,
+% then no encapsulation is done.
+% \begin{macrocode}
+FUNCTION {bibinfo.warn}
+{ swap$
+ duplicate$ missing$
+ {
+ swap$ "missing " swap$ * " in " * cite$ * warning$ pop$
+ ""
+ }
+ { duplicate$ empty$
+ {
+ swap$ "empty " swap$ * " in " * cite$ * warning$
+ }
+ { swap$
+%<bibinfo> "\bibinfo{" swap$ * "}{" * swap$ * "}" *
+%<!bibinfo> pop$
+ }
+ if$
+ }
+ if$
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{`format.eprint'}
+% The access function for the \texttt{eprint} field.
+%
+% If the \texttt{bibinfo} \dtx{} option is selected, then this function
+% encapsulates the argument in a \TeX\ macro |\eprint|.
+%
+% \texttt{->} \texttt{encapsulated-URL}
+% \begin{macrocode}
+%<*eprint>
+FUNCTION {format.eprint}
+{ eprint duplicate$ empty$
+ 'skip$
+ { "\eprint"
+ archive empty$
+ 'skip$
+ { "[" * archive * "]" * }
+ if$
+ "{" * swap$ * "}" *
+ }
+ if$
+}
+%</eprint>
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{`write.url'}
+% This function taken over from \texttt{agsm.sty}, the main \texttt{harvard}
+% bib style. For non-Harvard styles that want to add the URL on a new line
+% after the reference, use this function too, but defined slightly
+% differently.
+% \begin{macrocode}
+%<*(harnm|url-nl)&!revdata>
+FUNCTION {write.url}
+%<*!html>
+{
+%<*url-doi&url>
+ doi empty$
+ { url }
+ { "http://dx.doi.org/" doi * }
+ if$
+%</url-doi&url>
+%<!url-doi|!url> url
+ duplicate$ empty$
+ { pop$ }
+%<harnm> { "\newline\harvardurl{" swap$ * "}" * write$ newline$ }
+%<!harnm&url-nl> { "\newline\urlprefix\url{" swap$ * "}" * write$ newline$ }
+ if$
+}
+%</!html>
+%<*html>
+{
+%<*url-doi&url>
+ doi empty$
+ { url }
+ { "http://dx.doi.org/" doi * }
+ if$
+%</url-doi&url>
+%<!url-doi|!url> url
+ duplicate$ empty$
+ { pop$ }
+ { duplicate$ "<br><a href=" quote$ * swap$ * quote$
+ * ">" * swap$ * "</a>" * write$ newline$ }
+ if$
+}
+%</html>
+
+%</(harnm|url-nl)&!revdata>
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{`format.url'}
+% This function is reworked for \texttt{\filename} to provide a
+% cleaner URL for DOIs. The definition of \cmd{\urldoi} is written in
+% the \texttt{.bbl} file by the function \texttt{begin.bib}. When the
+% package \pkg{hyperref} is loaded, the \meta{doi} is a hyperlink to
+% \texttt{https://doi.org/\meta{doi}}.
+% \begin{macrocode}
+%<*(url-blk&!harnm)|revdata>
+FUNCTION {format.url}
+{
+%<url-doi&url> doi empty$
+%<url-doi&url> {
+ url
+ duplicate$ empty$
+ { pop$ "" }
+%<!html> { "\urlprefix\url{" swap$ * "}" * }
+%<html> {
+%<html> duplicate$ "<a href=" quote$ * swap$ * quote$ *
+%<html> ">" * swap$ * "</a>" *
+%<html> }
+ if$
+%<*url-doi&url>
+ }
+ {
+ doi
+%<!html> "\doiprefix\urldoi{" swap$ * "}" *
+%<html> duplicate$ "doi:<a href=" quote$ * "https://doi.org/" *
+%<html> swap$ * quote$ * ">" * swap$ * "</a>" *
+ }
+ if$
+%</url-doi&url>
+}
+
+%</(url-blk&!harnm)|revdata>
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{`check.speaker'}
+% The \texttt{presentation} type uses the \texttt{key} entry to indicate which
+% author is the speaker, as the sequence number in the author list. The speaker's
+% name is put into a different font, depending on the extra option. If no font
+% is specified, all names are the same.
+% \begin{macrocode}
+INTEGERS { nameptr namesleft numnames }
+
+%<*pres-bf|pres-it|pres-sc>
+FUNCTION {check.speaker}
+{ key empty$ 'skip$
+ { key nameptr int.to.str$ =
+ {
+%<pres-bf> bolden
+%<pres-it&!pres-bf> emphasize
+%<pres-sc&!pres-it&!pres-bf> scaps
+ }
+ 'skip$
+ if$
+ }
+ if$
+}
+
+%</pres-bf|pres-it|pres-sc>
+% \end{macrocode}
+% \end{macro}
+
+% \begin{macro}{`format.names'}
+% The \texttt{harvard} package now (version 2.0.3, for \LaTeXe) uses
+% |\harvardand| in place of the word \textsl{and} so that it can be changed
+% at run time. This is allowed for with the option \texttt{harnm}, which
+% need not be used only with the \texttt{har} option.
+% This seems like a useless feature for \texttt{.bst} files made from
+% this multilanguage source. However, it is included anyway, which means
+% if \texttt{harnm} option selected, one must redefine |\harvardand|
+% in the document for the language being used.
+%
+% The location of the junior part for reversed name is not obvious. Prior
+% to version 4.0, I always had it attached to the last name, as
+% Smith, Jr, John, put it probably is better as Smith, John, Jr. For the
+% AGU \texttt{nm-rev1} I always did it this way, probably because I had a
+% good AGU example to follow. Dilemma: do I just change them all or add an
+% option to do it? The option will maintain consistency with older
+% versions, but this could also be considered a bug fix rather than a new
+% feature. Solution: use the option, since I have found other \texttt{.bst}
+% files from Beebe and Harvard that put junior between surname and first
+% name.
+%
+% |bibinfo| is a variable used to store a string telling it whether the
+% names being formatted are authors or editors, since this function is called
+% for both purposes. Every call to this function must push the string onto the stack
+% just before the call.
+% \begin{macrocode}
+STRINGS { bibinfo}
+
+% \end{macrocode}
+%
+% Stack note: if the names argument is a non-nil list, this function returns
+% one object on the stack, the formatted list of names.
+%
+% \texttt{names`string} \texttt{bibinfo`string} \texttt{->} \texttt{author-list`string}
+% \begin{macrocode}
+FUNCTION {format.names}
+{ 'bibinfo :=
+ duplicate$ empty$ 'skip$ {
+ 's :=
+ "" 't :=
+ #1 'nameptr :=
+ s num.names$ 'numnames :=
+ numnames 'namesleft :=
+ { namesleft #0 > }
+ { s nameptr
+% \end{macrocode}
+% Here is the author formatting when the names are not set in any special
+% font, or when the entire name set in a single special font.
+% \begin{macrocode}
+%<*!(nmft&(fnm-rm|fnm-def))>
+%<*!nm-rev1&!nm-revv1>
+%<nm-init> "{f.~}{vv~}{ll}{, jj}"
+%<*!nm-init>
+%<nm-rev&!jnrlst> "{vv~}{ll}{, jj}{, f.}"
+%<nm-rev&jnrlst> "{vv~}{ll}{, f.}{, jj}"
+%<*!nm-rev>
+%<nm-rv&!jnrlst> "{vv~}{ll}{ jj}{ f{~}}"
+%<nm-rv&jnrlst> "{vv~}{ll}{ f{~}}{ jj}"
+%<*!nm-rv>
+%<nm-rvx&!jnrlst> "{vv~}{ll}{ jj}{ f{}}"
+%<nm-rvx&jnrlst> "{vv~}{ll}{ f{}}{ jj}"
+%<*!nm-rvx>
+%<nm-rvcx&!jnrlst> "{vv~}{ll}{, jj}{, f{}}"
+%<nm-rvcx&jnrlst> "{vv~}{ll}{, f{}}{, jj}"
+%<*!nm-rvcx>
+%<nm-rvv&!jnrlst> "{vv~}{ll}{ jj}{ f{.}.}"
+%<nm-rvv&jnrlst> "{vv~}{ll}{ f{.}.}{ jj}"
+%<*!nm-rvv>
+%<nm-rvvc&!jnrlst> "{vv~}{ll}{, jj}{, f{.}.}"
+%<nm-rvvc&jnrlst> "{vv~}{ll}{, f{.}.}{, jj}"
+%<*!nm-rvvc>
+%<nm-revf&!jnrlst> "{vv~}{ll}{, jj}{, ff}"
+%<nm-revf&jnrlst> "{vv~}{ll}{, ff}{, jj}"
+%<*!nm-revf>
+ "{ff~}{vv~}{ll}{, jj}"
+%</!nm-revf>
+%</!nm-rvvc>
+%</!nm-rvv>
+%</!nm-rvcx>
+%</!nm-rvx>
+%</!nm-rv>
+%</!nm-rev>
+%</!nm-init>
+%</!nm-rev1&!nm-revv1>
+%<*nm-rev1>
+ duplicate$ #1 >
+ { "{f.~}{vv~}{ll}{, jj}" }
+%<!jnrlst> { "{vv~}{ll}{, jj}{, f.}" }
+%<jnrlst> { "{vv~}{ll}{, f.}{, jj}" }
+ if$
+%</nm-rev1>
+%<*!nm-rev1&nm-revv1>
+ duplicate$ #1 >
+ { "{ff~}{vv~}{ll}{, jj}" }
+%<!jnrlst> { "{vv~}{ll}{, jj}{, ff}" }
+%<jnrlst> { "{vv~}{ll}{, ff}{, jj}" }
+ if$
+%</!nm-rev1&nm-revv1>
+ format.name$
+%<nm-rv|nm-rvx> remove.dots
+%<nmft&nmand-rm> bib.name.font
+%</!(nmft&(fnm-rm|fnm-def))>
+% \end{macrocode}
+% Here is the author formatting when the first and last names are
+% set in (possibly different) special fonts.
+%
+% The junior part is optionally between the reversed names, or after them.
+% \begin{macrocode}
+%<*nmft&(fnm-rm|fnm-def)>
+%<*!nm-rev1&!nm-revv1>
+%<*nm-init>
+ "{f.}" format.name$ duplicate$ empty$ 'skip$
+ { tie.or.space.prefix bib.fname.font swap$ * }
+ if$
+ s nameptr
+ "{vv~}{ll}" format.name$ bib.name.font *
+ s nameptr
+ "{jj}" format.name$ duplicate$ empty$ 'skip$
+ { bib.fname.font ", " swap$ * }
+ if$
+%</nm-init>
+%<*!nm-init>
+%<*nm-rev>
+ "{vv~}{ll}" format.name$ bib.name.font
+ s nameptr
+%<!jnrlst> "{jj, }{f.}"
+%<jnrlst> "{f.}{, jj}"
+ format.name$ duplicate$ empty$ 'skip$
+ { bib.fname.font ", " swap$ * }
+ if$
+%</nm-rev>
+%<*!nm-rev>
+%<*nm-rv>
+ "{vv~}{ll}" format.name$ bib.name.font
+ s nameptr
+%<!jnrlst> "{jj }{f{~}}"
+%<jnrlst> "{f{~}}{ jj}"
+ format.name$ duplicate$ empty$ 'skip$
+ { remove.dots bib.fname.font " " swap$ * }
+ if$
+%</nm-rv>
+%<*!nm-rv>
+%<*nm-rvx>
+ "{vv~}{ll}" format.name$ bib.name.font
+ s nameptr
+%<!jnrlst> "{jj }{f{}}"
+%<jnrlst> "{f{}}{ jj}"
+ format.name$ duplicate$ empty$ 'skip$
+ { remove.dots bib.fname.font " " swap$ * }
+ if$
+%</nm-rvx>
+%<*!nm-rvx>
+%<*nm-rvcx>
+ "{vv~}{ll}" format.name$ bib.name.font
+ s nameptr
+%<!jnrlst> "{jj, }{f{}}"
+%<jnrlst> "{f{}}{, jj}"
+ format.name$ duplicate$ empty$ 'skip$
+ { remove.dots bib.fname.font ", " swap$ * }
+ if$
+%</nm-rvcx>
+%<*!nm-rvcx>
+%<*nm-rvv>
+ "{vv~}{ll}" format.name$ bib.name.font
+ s nameptr
+%<!jnrlst> "{jj }{f{.}.}"
+%<jnrlst> "{f{.}.}{ jj}"
+ format.name$ duplicate$ empty$ 'skip$
+ { bib.fname.font " " swap$ * }
+ if$
+%</nm-rvv>
+%<*!nm-rvv>
+%<*nm-rvvc>
+ "{vv~}{ll}" format.name$ bib.name.font
+ s nameptr
+%<!jnrlst> "{jj, }{f{.}.}"
+%<jnrlst> "{f{.}.}{, jj}"
+ format.name$ duplicate$ empty$ 'skip$
+ { bib.fname.font ", " swap$ * }
+ if$
+%</nm-rvvc>
+%<*!nm-rvvc>
+%<*nm-revf>
+ "{vv~}{ll}" format.name$ bib.name.font
+ s nameptr
+%<!jnrlst> "{jj, }{ff}"
+%<jnrlst> "{ff}{, jj}"
+ format.name$ duplicate$ empty$ 'skip$
+ { bib.fname.font ", " swap$ * }
+ if$
+%</nm-revf>
+%<*!nm-revf>
+ "{ff}" format.name$ duplicate$ empty$ 'skip$
+ { tie.or.space.prefix bib.fname.font swap$ * }
+ if$
+ s nameptr
+ "{vv~}{ll}" format.name$ bib.name.font *
+ s nameptr
+ "{jj}" format.name$ duplicate$ empty$ 'skip$
+ { bib.fname.font ", " swap$ * }
+ if$
+%</!nm-revf>
+%</!nm-rvvc>
+%</!nm-rvv>
+%</!nm-rvcx>
+%</!nm-rvx>
+%</!nm-rv>
+%</!nm-rev>
+%</!nm-init>
+%</!nm-rev1&!nm-revv1>
+%<*nm-rev1>
+ nameptr #1 >
+ { "{f.}" format.name$ duplicate$ empty$ 'skip$
+ { tie.or.space.prefix bib.fname.font swap$ * }
+ if$
+ s nameptr
+ "{vv~}{ll}" format.name$ bib.name.font *
+ s nameptr
+ "{jj}" format.name$ duplicate$ empty$ 'skip$
+ { bib.fname.font ", " swap$ * }
+ if$
+ }
+ { "{vv~}{ll}" format.name$ bib.name.font
+ s nameptr
+%<!jnrlst> "{jj, }{f.}"
+%<jnrlst> "{f.}{, jj}"
+ format.name$ duplicate$ empty$ 'skip$
+ { bib.fname.font ", " swap$ * }
+ if$
+ }
+ if$
+%</nm-rev1>
+%<*!nm-rev1&nm-revv1>
+ nameptr #1 >
+ { "{ff}" format.name$ duplicate$ empty$ 'skip$
+ { tie.or.space.prefix bib.fname.font swap$ * }
+ if$
+ s nameptr
+ "{vv~}{ll}" format.name$ bib.name.font *
+ s nameptr
+ "{jj}" format.name$ duplicate$ empty$ 'skip$
+ { bib.fname.font ", " swap$ * }
+ if$
+ }
+ { "{vv~}{ll}" format.name$ bib.name.font
+ s nameptr
+%<!jnrlst> "{jj, }{ff}"
+%<jnrlst> "{ff}{, jj}"
+ format.name$ duplicate$ empty$ 'skip$
+ { bib.fname.font ", " swap$ * }
+ if$
+ }
+ if$
+%</!nm-rev1&nm-revv1>
+ *
+%</nmft&(fnm-rm|fnm-def)>
+ bibinfo bibinfo.check
+%<*pres-bf|pres-it|pres-sc>
+ type$ "presentation" =
+ { check.speaker }
+ 'skip$
+ if$
+%</pres-bf|pres-it|pres-sc>
+ 't :=
+ nameptr #1 >
+ {
+%<*nmlm>
+%<m1> nameptr #1
+%<m2> nameptr #2
+%<m3> nameptr #3
+%<m4> nameptr #4
+%<m5> nameptr #5
+%<m6> nameptr #6
+%<m7> nameptr #7
+%<m8> nameptr #8
+%<m9> nameptr #9
+%<m0> nameptr #0
+%<m10> #10 +
+%<m20> #20 +
+%<m30> #30 +
+%<m40> #40 +
+%<m50> #50 +
+%<m60> #60 +
+%<m70> #70 +
+%<m80> #80 +
+%<m90> #90 +
+ #1 + =
+%<x1> numnames #1
+%<x2> numnames #2
+%<x3> numnames #3
+%<x4> numnames #4
+%<x5> numnames #5
+%<x6> numnames #6
+%<x7> numnames #7
+%<x8> numnames #8
+%<x9> numnames #9
+%<x0> numnames #0
+%<x10> #10 +
+%<x20> #20 +
+%<x30> #30 +
+%<x40> #40 +
+%<x50> #50 +
+%<x60> #60 +
+%<x70> #70 +
+%<x80> #80 +
+%<x90> #90 +
+ > and
+ { "others" 't :=
+ #1 'namesleft := }
+ 'skip$
+ if$
+%</nmlm>
+ namesleft #1 >
+%<!aunm-semi&!aunm-sl> { ", " * t * }
+%<aunm-semi> { "; " * t * }
+%<aunm-sl&!aunm-semi> { "/ " * t * }
+ {
+ s nameptr "{ll}" format.name$ duplicate$ "others" =
+ { 't := }
+ { pop$ }
+ if$
+%<(and-com|xand)&!aunm-semi&!aunm-sl> "," *
+%<(and-com|xand)&aunm-semi> ";" *
+%<(and-com|xand)&aunm-sl&!aunm-semi> "/" *
+%<*!and-xcom&!and-com&!xand>
+ numnames #2 >
+%<etal-xc> t "others" = not and
+%<!aunm-semi&!aunm-sl> { "," * }
+%<aunm-semi> { ";" * }
+%<aunm-sl&!aunm-semi> { "/" * }
+ 'skip$
+ if$
+%</!and-xcom&!and-com&!xand>
+ t "others" =
+ {
+%<nmft&!nmand-rm&!(fnm-rm|fnm-def)&(etal-it|etal-rm)> bib.name.font
+%<*!etal-it>
+%<nmft&(nmand-rm|(fnm-rm|fnm-def))&!etal-rm> " " * bbl.etal bib.name.font *
+%<!(nmft&(nmand-rm|(fnm-rm|fnm-def)))|etal-rm> " " * bbl.etal *
+%</!etal-it>
+%<etal-it> " " * bbl.etal emphasize *
+%<nmft&!nmand-rm&!(fnm-rm|fnm-def)&!(etal-it|etal-rm)> bib.name.font
+ }
+%<*!xand>
+ {
+%<*!harnm>
+%<!amper> bbl.and
+%<amper> "\&"
+%</!harnm>
+%<harnm> "\harvardand{}"
+%<nmft&!nmand-rm&(fnm-rm|fnm-def)> bib.name.font
+ space.word * t *
+ }
+%</!xand>
+%<xand> { " " * t * }
+ if$
+ }
+ if$
+ }
+ 't
+ if$
+ nameptr #1 + 'nameptr :=
+ namesleft #1 - 'namesleft :=
+ }
+ while$
+%<*nmft&!nmand-rm&!(fnm-rm|fnm-def)>
+ t "others" =
+ 'skip$
+ { bib.name.font }
+ if$
+%</nmft&!nmand-rm&!(fnm-rm|fnm-def)>
+ } if$
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{`format.names.ed'}
+% When editors are used in place of authors to identify the work, the
+% names are always formatted just like authors'. However, in collections,
+% where ``edited by'' or ``\emph{names} (editors)'' are given, it is
+% normal not to reverse the names, even if the authors' are. The option
+% \texttt{ed-rev} sees to it that editor names are always formatted exactly
+% like those of authors, being reversed if necessary.
+%
+% The option \texttt{ed-au} is identical to \texttt{ed-rev}, but is more
+% logical. It means editors (in incollections) are formatted exactly like
+% authors, with all the font, reversing, and number limitations. This is
+% selected automatically with \texttt{nm-init} and \texttt{nm-} default to save
+% programming memory.
+%
+% The option \texttt{nm-revf} in this case acts the same as the default
+% when no \texttt{nm-} option given: full names with surname last. Therefore
+% it is not necessary to test for it at all, since it, like the default,
+% has the lowest priority: any other \texttt{nm-} option clobbers it.
+%
+% The options \texttt{aunm-semi} and \texttt{aunm-sl} will put a semi-colon or
+% slash between editor names, just as for authors, when \texttt{ed-rev} not
+% selected, in keeping with the idea that in this case both authors and editors
+% are to be formatted the same.
+%
+% This function either dispatches to \texttt{format.names} or executes code
+% which is similar. In the latter case, names are always presented first
+% followed by surname (``last name''); name limit processing (\texttt{nmlm}) is not executed;
+% and endgame processing differs in being qualified by \texttt{nmfted}.
+%
+% Stack note: if the names (second) argument is a non-nil list, this function returns
+% with one object on the stack, the formatted list of names.
+%
+% \texttt{names`string} \texttt{bibinfo`string} \texttt{->} \texttt{author-list`string}
+% \begin{macrocode}
+FUNCTION {format.names.ed}
+{
+%<ed-rev|ed-au> format.names
+%<*!ed-rev&!ed-au>
+ 'bibinfo :=
+ duplicate$ empty$ 'skip$ {
+ 's :=
+ "" 't :=
+ #1 'nameptr :=
+ s num.names$ 'numnames :=
+ numnames 'namesleft :=
+ { namesleft #0 > }
+ { s nameptr
+% \end{macrocode}
+% Editor name is handled as a single object, with no separation of first and last name.
+% \begin{macrocode}
+%<*!(nmft&nmfted&(fnm-rm|fnm-def))>
+%<nm-init|nm-rev|nm-rev1> "{f.~}{vv~}{ll}{, jj}"
+%<*!nm-init&!nm-rev&!nm-rev1>
+%<nm-revv1> "{ff~}{vv~}{ll}{, jj}"
+%<*!nm-revv1>
+%<nm-rv> "{f{~}~}{vv~}{ll}{ jj}"
+%<*!nm-rv>
+%<nm-rvx> "{f{}~}{vv~}{ll}{ jj}"
+%<*!nm-rvx>
+%<nm-rvcx> "{f{}~}{vv~}{ll}{ jj}"
+%<*!nm-rvcx>
+%<nm-rvv|nm-rvvc> "{f{.}.~}{vv~}{ll}{ jj}"
+%<*!nm-rvv&!nm-rvvc>
+ "{ff~}{vv~}{ll}{, jj}"
+%</!nm-rvv&!nm-rvvc>
+%</!nm-rvcx>
+%</!nm-rvx>
+%</!nm-rv>
+%</!nm-revv1>
+%</!nm-init&!nm-rev&!nm-rev1>
+ format.name$
+%<nm-rv|nm-rvx|nm-rvcx> remove.dots
+%<nmft&nmfted&nmand-rm> bib.name.font
+%</!(nmft&nmfted&(fnm-rm|fnm-def))>
+% \end{macrocode}
+% Editor first and last name handled separately.
+% \begin{macrocode}
+%<*(nmft&nmfted&(fnm-rm|fnm-def))>
+%<*nm-init|nm-rev|nm-rev1>
+ "{f.}" format.name$ duplicate$ empty$ 'skip$
+ { tie.or.space.prefix bib.fname.font swap$ * }
+ if$
+ s nameptr
+ "{vv~}{ll}" format.name$ bib.name.font *
+ s nameptr
+ "{jj}" format.name$ duplicate$ empty$ 'skip$
+ { bib.fname.font ", " swap$ * }
+ if$
+%</nm-init|nm-rev|nm-rev1>
+%<*!nm-init&!nm-rev&!nm-rev1>
+%<*nm-revv1>
+ "{ff}" format.name$ duplicate$ empty$ 'skip$
+ { tie.or.space.prefix bib.fname.font swap$ * }
+ if$
+ s nameptr
+ "{vv~}{ll}" format.name$ bib.name.font *
+ s nameptr
+ "{jj}" format.name$ duplicate$ empty$ 'skip$
+ { bib.fname.font ", " swap$ * }
+ if$
+%</nm-revv1>
+%<*!nm-revv1>
+%<*nm-rv>
+ "{f{~}}" format.name$ duplicate$ empty$ 'skip$
+ { tie.or.space.prefix bib.fname.font swap$ * }
+ if$
+ s nameptr
+ "{vv~}{ll}" format.name$ bib.name.font *
+ s nameptr
+ "{jj}" format.name$ duplicate$ empty$ 'skip$
+ { remove.dots bib.fname.font " " swap$ * }
+ if$
+%</nm-rv>
+%<*!nm-rv>
+%<*nm-rvx|nm-rvcx>
+ "{f{}}" format.name$ duplicate$ empty$ 'skip$
+ { tie.or.space.prefix bib.fname.font swap$ * }
+ if$
+ s nameptr
+ "{vv~}{ll}" format.name$ bib.name.font *
+ s nameptr
+ "{jj}" format.name$ duplicate$ empty$ 'skip$
+ { remove.dots bib.fname.font " " swap$ * }
+ if$
+%</nm-rvx|nm-rvcx>
+%<*!nm-rvx&!nm-rvcx>
+%<*nm-rvv|nm-rvvc>
+ "{f{.}.}" format.name$ duplicate$ empty$ 'skip$
+ { tie.or.space.prefix bib.fname.font swap$ * }
+ if$
+ s nameptr
+ "{vv~}{ll}" format.name$ bib.name.font *
+ s nameptr
+ "{jj}" format.name$ duplicate$ empty$ 'skip$
+ { bib.fname.font " " swap$ * }
+ if$
+%</nm-rvv|nm-rvvc>
+%<*!nm-rvv&!nm-rvvc>
+ "{ff}" format.name$ duplicate$ empty$ 'skip$
+ { tie.or.space.prefix bib.fname.font swap$ * }
+ if$
+ s nameptr
+ "{vv~}{ll}" format.name$ bib.name.font *
+ s nameptr
+ "{jj}" format.name$ duplicate$ empty$ 'skip$
+ { bib.fname.font ", " swap$ * }
+ if$
+%</!nm-rvv&!nm-rvvc>
+%</!nm-rvx&!nm-rvcx>
+%</!nm-rv>
+%</!nm-revv1>
+%</!nm-init&!nm-rev&!nm-rev1>
+ *
+%</(nmft&nmfted&(fnm-rm|fnm-def))>
+ bibinfo bibinfo.check
+ 't :=
+ nameptr #1 >
+ {
+ namesleft #1 >
+%<!aunm-semi&!aunm-sl> { ", " * t * }
+%<aunm-semi> { "; " * t * }
+%<aunm-sl&!aunm-semi> { "/ " * t * }
+ {
+ s nameptr "{ll}" format.name$ duplicate$ "others" =
+ { 't := }
+ { pop$ }
+ if$
+%<(and-com-ed|xand)&!aunm-semi&!aunm-sl> "," *
+%<(and-com-ed|xand)&aunm-semi> ";" *
+%<(and-com-ed|xand)&aunm-sl&!aunm-semi> "/" *
+%<*!and-xcom&!and-com-ed&!xand>
+ numnames #2 >
+%<etal-xc> t "others" = not and
+%<!aunm-semi&!aunm-sl> { "," * }
+%<aunm-semi> { ";" * }
+%<aunm-sl&!aunm-semi> { "/" * }
+ 'skip$
+ if$
+%</!and-xcom&!and-com-ed&!xand>
+ t "others" =
+ {
+
+%<nmft&nmfted&!nmand-rm&!(fnm-rm|fnm-def)&(etal-it|etal-rm)> bib.name.font
+%<*!etal-it>
+%<nmft&nmfted&(nmand-rm|(fnm-rm|fnm-def))&!etal-rm> " " * bbl.etal bib.name.font *
+%<!(nmft&nmfted&(nmand-rm|(fnm-rm|fnm-def)))|etal-rm> " " * bbl.etal *
+%</!etal-it>
+%<etal-it> " " * bbl.etal emphasize *
+%<nmft&nmfted&!nmand-rm&!(fnm-rm|fnm-def)&!(etal-it|etal-rm)> bib.name.font
+ }
+%<*!xand>
+ {
+%<*!harnm>
+%<!amper> bbl.and
+%<amper> "\&"
+%</!harnm>
+%<harnm> "\harvardand{}"
+%<nmft&nmfted&!nmand-rm&(fnm-rm|fnm-def)> bib.name.font
+ space.word * t *
+ }
+%</!xand>
+%<xand> { " " * t * }
+ if$
+ }
+ if$
+ }
+ 't
+ if$
+ nameptr #1 + 'nameptr :=
+ namesleft #1 - 'namesleft :=
+ }
+ while$
+%<*nmft&nmfted&!nmand-rm&!(fnm-rm|fnm-def)>
+ t "others" =
+ 'skip$
+ { bib.name.font }
+ if$
+%</nmft&nmfted&!nmand-rm&!(fnm-rm|fnm-def)>
+ } if$
+%</!ed-rev&!ed-au>
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{`format.key'}
+% \begin{macrocode}
+%<*ay>
+FUNCTION {format.key}
+{ empty$
+ { key field.or.null }
+ { "" }
+ if$
+}
+
+%</ay>
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{`format.authors'}
+%
+% \begin{macrocode}
+FUNCTION {format.authors}
+{ author "author" format.names
+%<*revdata>
+ duplicate$ empty$ 'skip$
+ { collaboration "collaboration" bibinfo.check
+ duplicate$ empty$ 'skip$
+ { " (" swap$ * ")" * }
+ if$
+ *
+ }
+ if$
+%</revdata>
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{`get.bbl.editor'}
+% Use this function universally when accessing the ``editor'' text entity.
+% \begin{macrocode}
+FUNCTION {get.bbl.editor}
+{ editor num.names$ #1 > 'bbl.editors 'bbl.editor if$ }
+
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{`format.editors'}
+% The option \texttt{edpar} puts the word `editor' in parentheses.
+% In \texttt{genbst.mbs}, this occurred automatically with the option
+% \texttt{ed}, to abbreviate `editor' to `ed'. In \texttt{babel.mbs},
+% this was not the case, because of complications with the word functions.
+% Now this possibility is added as a special option, which means there is
+% some inconsistency with older \texttt{.dbj} files that called \texttt{ed}:
+% the abbreviated `ed' is not put in parentheses unless \texttt{edpar} is
+% also called.
+%
+% Note that the code here is very similar to code in \texttt{format.in.ed.booktitle};
+% the two should be kept coordinated.
+% \begin{macrocode}
+FUNCTION {format.editors}
+{ editor "editor" format.names duplicate$ empty$ 'skip$
+ {
+%<!edpar&!edparxc> "," *
+ " " *
+ get.bbl.editor
+%<bkedcap> capitalize
+%<edpar|edparc|edparxc> "(" swap$ * ")" *
+ *
+ }
+ if$
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{`format.in.editors'}
+% See the note about the option \texttt{edpar} above.
+%
+% \end{macro}
+%
+% \begin{macro}{`format.book.pages'}
+% \begin{macrocode}
+%<*pg-bk>
+FUNCTION {format.book.pages}
+{ pages "pages" bibinfo.check
+ duplicate$ empty$ 'skip$
+ { " " * bbl.pages * }
+ if$
+}
+%</pg-bk>
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{`format.isbn'}
+% \begin{macrocode}
+%<*isbn>
+FUNCTION {format.isbn}
+{ isbn "isbn" bibinfo.check
+ duplicate$ empty$ 'skip$
+ {
+%<!blk-com&!blk-tit&!blk-tita> new.block
+ "ISBN " swap$ *
+ }
+ if$
+}
+
+%</isbn>
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{`format.issn'}
+% \begin{macrocode}
+%<*issn>
+FUNCTION {format.issn}
+{ issn "issn" bibinfo.check
+ duplicate$ empty$ 'skip$
+ {
+%<!blk-com&!blk-tit&!blk-tita> new.block
+ "ISSN " swap$ *
+ }
+ if$
+}
+
+%</issn>
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{`format.doi'}
+% DOIs like URLs are encapsulated by their own commands, so need no \texttt{bibinfo.check}.
+% \begin{macrocode}
+%<*doi|(url-doi&!url)>
+FUNCTION {format.doi}
+{ doi empty$
+ { "" }
+ {
+%<!blk-com&!blk-tit&!blk-tita> new.block
+%<!html> "\doi{" doi * "}" *
+%<html> "doi:" doi *
+ }
+ if$
+}
+%</doi|(url-doi&!url)>
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{`select.language'}
+% The \texttt{language} field code has been provided by Bernd Feige, of the
+% University of Freiburg.
+% \begin{macrocode}
+%<*lang>
+FUNCTION {select.language}
+{ duplicate$ empty$
+ 'pop$
+ { language empty$
+ 'skip$
+ { "{\selectlanguage{" language * "}" * swap$ * "}" * }
+ if$
+ }
+ if$
+}
+
+%</lang>
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{`format.note'}
+% Notes should be entered as though they were a sentence on their own.
+% However, if they appear mid-sentence rather than after a block or sentence,
+% the first letter must be lowercase. Thus if a note begins with a proper
+% noun, it must be in braces. To avoid a warning about unmatched braces
+% with the \texttt{change.case\$} function, check first if the leading
+% character is an opening brace.
+%
+% With options \texttt{url,url-nt}, the URL text is treated as a note, and
+% added here. It is output directly, not prepended to the note text. This
+% means, if the note is to be a new sentence, the URL text starts that
+% sentence, and the regular note is added to that sentence, comma between.
+%
+% \begin{macrocode}
+FUNCTION {format.note}
+{
+%<*url-nt&!revdata>
+ url empty$
+ 'skip$
+%<!html> { "\urlprefix\url{" url * "}" * output }
+%<html> { "<a href=" quote$ * url * quote$
+%<html> * ">" * url * "</a>" * output }
+ if$
+%</url-nt&!revdata>
+ note empty$
+ { "" }
+ { note #1 #1 substring$
+ duplicate$ "{" =
+ 'skip$
+ { output.state mid.sentence =
+ { "l" }
+ { "u" }
+ if$
+ change.case$
+ }
+ if$
+ note #2 global.max$ substring$ * "note" bibinfo.check
+ }
+ if$
+}
+
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{`format.title'}
+% For a quoted title, any punctuation in the title goes inside the quote.
+% Otherwise, the comma or period following the title also goes inside.
+% Exception is with \texttt{qx} option, in which case the comma goes
+% outside, even when punctuation present; for period (\texttt{!blk-com})
+% is added outside only when punctuation is absent.
+% \begin{macrocode}
+FUNCTION {format.title}
+{ title
+%<*!atit-u>
+ duplicate$ empty$ 'skip$
+ { "t" change.case$ }
+ if$
+%</!atit-u>
+ "title" bibinfo.check
+%<*tit-it|tit-qq|lang>
+ duplicate$ empty$ 'skip$
+ {
+%<tit-it> emphasize
+%<*!tit-it&tit-qq>
+ "\enquote{" swap$ *
+%<*!qx>
+%<*blk-com>
+ non.stop
+%<!com-semi&!com-blank> { ",} " * }
+%<com-semi> { ";} " * }
+%<!com-semi&com-blank> { "} " * }
+ { "} " * }
+ if$
+%</blk-com>
+%<!blk-com> add.period$ "}" *
+%</!qx>
+%<*qx>
+%<*blk-com>
+%<!com-semi&!com-blank> "}, " *
+%<com-semi> "}; " *
+%<!com-semi&com-blank> "} " *
+%</blk-com>
+%<!blk-com> "}" *
+%</qx>
+%</!tit-it&tit-qq>
+%<lang> select.language
+ }
+ if$
+%</tit-it|tit-qq|lang>
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{`end.quote.title'}
+% For a quoted title, the punctuation appears in the quotes. For commas
+% between block, this means the inter-block punctuation is already present,
+% so it must be suppressed after every \texttt{format.title output}. This
+% is done by setting the \texttt{output.state} to \texttt{before.all}, but
+% only if there really was a title. Call this macro every time after
+% titles are output.
+% \begin{macrocode}
+%<*blk-com&tit-qq>
+FUNCTION {end.quote.title}
+{ title empty$
+ 'skip$
+ { before.all 'output.state := }
+ if$
+}
+%</blk-com&tit-qq>
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{`end.quote.btitle'}
+% Similar to |end.quote.title| except that it is only applied if titles of
+% proceedings and collections are quoted, and if
+% neither \texttt{edby}, \texttt{edby-par}, nor \texttt{edby-par} are selected
+% (this is the default case in the relevant menu of the \texttt{makebst.tex} run).
+% These options add text after the booktitle,
+% so additional punctuation need not be suppressed. Unless there is no editor!
+%
+% Note: this function is called after the result of \texttt{format.in.ed.booktitle}
+% has been output, and attempts to predict what that output had been.
+% Would it not be better to call this function while that result is still
+% on the stack?
+% \begin{macrocode}
+%<*bt-qq>
+FUNCTION {end.quote.btitle}
+{ booktitle empty$
+ 'skip$
+%<!edby&!edby-par&!edby-parc> { before.all 'output.state := }
+%<*edby|edby-par|edby-parc>
+ { editor empty$
+ { before.all 'output.state := }
+ 'skip$
+ if$
+ }
+%</edby|edby-par|edby-parc>
+ if$
+}
+%</bt-qq>
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{`make.full.names'}
+% In versions before 2.2, there were two functions \texttt{calc.long.label}
+% and \texttt{format.long.lab.names} that made up the string
+% \texttt{long.label} for each entry. This contains the full author list.
+% However, there was a bug in the one routine, entered by mistake when an
+% earlier bug was removed, and more seriously, the string
+% \texttt{long.label} was limited to \texttt{entry.max\$} characters, 100 on
+% my system. Author lists were truncated. Thus, \texttt{make.full.names}
+% is used instead to enter the full list of names directly in the
+% \texttt{output.bibitem} function, without an intermediate string. This
+% involves changing the order of some function definitions, especially
+% \texttt{output.bibitem} must come later.
+% \begin{macrocode}
+%<*har|cay|nat>
+FUNCTION {format.full.names}
+{'s :=
+ "" 't :=
+ #1 'nameptr :=
+ s num.names$ 'numnames :=
+ numnames 'namesleft :=
+ { namesleft #0 > }
+ { s nameptr
+%<!jnrlab> "{vv~}{ll}" format.name$
+%<*jnrlab>
+%<!nm-rv&!nm-rvv&!nm-rvx&!nm-rvcx> "{vv~}{ll}{, jj}" format.name$
+%<nm-rv|nm-rvv|nm-rvx|nm-rvcx> "{vv~}{ll}{ jj}" format.name$
+%</jnrlab>
+%<lab&and-rm> cite.name.font
+ 't :=
+ nameptr #1 >
+ {
+%<*nmlm>
+%<m1> nameptr #1
+%<m2> nameptr #2
+%<m3> nameptr #3
+%<m4> nameptr #4
+%<m5> nameptr #5
+%<m6> nameptr #6
+%<m7> nameptr #7
+%<m8> nameptr #8
+%<m9> nameptr #9
+%<m0> nameptr #0
+%<m10> #10 +
+%<m20> #20 +
+%<m30> #30 +
+%<m40> #40 +
+%<m50> #50 +
+%<m60> #60 +
+%<m70> #70 +
+%<m80> #80 +
+%<m90> #90 +
+ #1 + =
+%<x1> numnames #1
+%<x2> numnames #2
+%<x3> numnames #3
+%<x4> numnames #4
+%<x5> numnames #5
+%<x6> numnames #6
+%<x7> numnames #7
+%<x8> numnames #8
+%<x9> numnames #9
+%<x0> numnames #0
+%<x10> #10 +
+%<x20> #20 +
+%<x30> #30 +
+%<x40> #40 +
+%<x50> #50 +
+%<x60> #60 +
+%<x70> #70 +
+%<x80> #80 +
+%<x90> #90 +
+ > and
+ { "others" 't :=
+ #1 'namesleft := }
+ 'skip$
+ if$
+%</nmlm>
+ namesleft #1 >
+ { ", " * t * }
+ {
+ s nameptr "{ll}" format.name$ duplicate$ "others" =
+ { 't := }
+ { pop$ }
+ if$
+ t "others" =
+ {
+%<lab&!and-rm&(etal-it|etal-rm)> cite.name.font
+%<*!etal-it>
+%<lab&and-rm&!etal-rm> " " * bbl.etal cite.name.font *
+%<!lab|!and-rm|etal-rm> " " * bbl.etal *
+%</!etal-it>
+%<etal-it> " " * bbl.etal emphasize *
+%<lab&!and-rm&!(etal-it|etal-rm)> cite.name.font
+ }
+ {
+%<*!harnm>
+%<*!and-xcom>
+ numnames #2 >
+ { "," * }
+ 'skip$
+ if$
+%</!and-xcom>
+%<!amper> bbl.and
+%<amper> "\&"
+%</!harnm>
+%<harnm> "\harvardand{}"
+ space.word * t *
+ }
+ if$
+ }
+ if$
+ }
+ 't
+ if$
+ nameptr #1 + 'nameptr :=
+ namesleft #1 - 'namesleft :=
+ }
+ while$
+%<*lab&!and-rm>
+ t "others" =
+ 'skip$
+ { cite.name.font }
+ if$
+%</lab&!and-rm>
+}
+
+FUNCTION {author.editor.key.full}
+{ author empty$
+ { editor empty$
+ { key empty$
+ { cite$ #1 #3 substring$ }
+ 'key
+ if$
+ }
+ { editor format.full.names }
+ if$
+ }
+ { author format.full.names }
+ if$
+}
+
+FUNCTION {author.key.full}
+{ author empty$
+ { key empty$
+ { cite$ #1 #3 substring$ }
+ 'key
+ if$
+ }
+ { author format.full.names }
+ if$
+}
+
+FUNCTION {editor.key.full}
+{ editor empty$
+ { key empty$
+ { cite$ #1 #3 substring$ }
+ 'key
+ if$
+ }
+ { editor format.full.names }
+ if$
+}
+
+FUNCTION {make.full.names}
+{ type$ "book" =
+ type$ "inbook" =
+ or
+ 'author.editor.key.full
+ { type$ "proceedings" =
+ 'editor.key.full
+ 'author.key.full
+ if$
+ }
+ if$
+}
+
+%</har|cay|nat>
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{`output.bibitem'}
+% A user has pointed out to me that if the label argument in square brackets
+% are put into braces (within the squares) it is then resistent to any
+% problems if square braces should appear within the label. Do this, but
+% only for the \texttt{nat} option.
+% \begin{macrocode}
+FUNCTION {output.bibitem}
+{ newline$
+%<*!html>
+%<*ay>
+%<!har&!nat> "\bibitem[" write$
+%<!har&nat> "\bibitem[{" write$
+%<har> "\harvarditem" write$
+%<nmd> "\protect\citeauthoryear{" write$
+%<ast> "\protect\astroncite{" write$
+%<cay> "\protect\citeauthoryear{" make.full.names * "}{" * write$
+%<cn> "\protect\citename{" write$
+%<!har> label write$
+%<har> make.full.names duplicate$ label =
+%<har> 'skip$
+%<har> { "[" label * "]" * write$ }
+%<har> if$
+%<har> "{" swap$ * "}{" * write$
+%<har> year duplicate$ empty$
+%<cn> ", }" year duplicate$ empty$
+%<cay|nmd|ast> "}{" year duplicate$ empty$
+%<(har|cn|cay|nmd|ast)&blkyear> { pop$ "" }
+%<(har|cn|cay|nmd|ast)&!blkyear> { pop$ "????" }
+%<har|cn|cay|nmd|ast> 'skip$
+%<har|cn|cay|nmd|ast> if$
+%<har> extra.label * "}{" * write$
+%<cn> * extra.label * "]{" * write$
+%<cay|nmd|ast> * extra.label * "}]{" * write$
+%<alk> "]{" write$
+%<!(har|cay|nmd|ast|alk|cn|nat)> ")]{" write$
+%<nat> ")" make.full.names duplicate$ short.list =
+%<nat> { pop$ }
+%<nat> { * }
+%<nat> if$
+%<nat> "}]{" * write$
+%</ay>
+%<!ay&!(cite|alph)> "\bibitem{" write$
+%<!ay&(cite|alph)> "\bibitem[" label * "]{" * write$
+ cite$ write$
+ "}" write$
+ newline$
+ ""
+%</!html>
+%<*html>
+%<*htdes>
+ "<dt><strong><tt>" write$
+ cite$ write$
+ "</tt></strong></dt>" write$ newline$
+ "<dd>"
+%</htdes>
+%<htlist&!htdes> "<li>"
+%<!htlist&!htdes> "<p>"
+%</html>
+ before.all 'output.state :=
+}
+
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{`if.digit'}
+% Add \texttt{if.digit} and \texttt{n.separate} to convert large page numbers
+% to a separated number.
+% \begin{macrocode}
+%<*pgsep-c|pgsep-s|pgsep-p>
+FUNCTION {if.digit}
+{ duplicate$ "0" =
+ swap$ duplicate$ "1" =
+ swap$ duplicate$ "2" =
+ swap$ duplicate$ "3" =
+ swap$ duplicate$ "4" =
+ swap$ duplicate$ "5" =
+ swap$ duplicate$ "6" =
+ swap$ duplicate$ "7" =
+ swap$ duplicate$ "8" =
+ swap$ "9" = or or or or or or or or or
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{`n.separate'}
+% \texttt{pgsep-s}, \texttt{pgsep-p}
+% Large page numbers are to be separated in threes, with thin space, comma
+% or period. The number must be 5 digits before the separation occurs.
+% No provision is made for numbers of 7 or more digits.
+% \begin{macrocode}
+FUNCTION {n.separate}
+{ 't :=
+ ""
+ #0 'numnames :=
+ { t empty$ not }
+ { t #-1 #1 substring$ if.digit
+ { numnames #1 + 'numnames := }
+ { #0 'numnames := }
+ if$
+ t #-1 #1 substring$ swap$ *
+ t #-2 global.max$ substring$ 't :=
+ numnames #5 =
+ { duplicate$ #1 #2 substring$ swap$
+ #3 global.max$ substring$
+%<pgsep-c> "," swap$ * *
+%<pgsep-p> "." swap$ * *
+%<pgsep-s&!html> "\," swap$ * *
+%<pgsep-s&html> " " swap$ * *
+ }
+ 'skip$
+ if$
+ }
+ while$
+}
+%</pgsep-c|pgsep-s|pgsep-p>
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{`n.dashify'}
+% \begin{macrocode}
+FUNCTION {n.dashify}
+{
+%<pgsep-c|pgsep-s|pgsep-p> n.separate
+ 't :=
+ ""
+ { t empty$ not }
+ { t #1 #1 substring$ "-" =
+ { t #1 #2 substring$ "--" = not
+ { "--" *
+ t #2 global.max$ substring$ 't :=
+ }
+ { { t #1 #1 substring$ "-" = }
+ { "-" *
+ t #2 global.max$ substring$ 't :=
+ }
+ while$
+ }
+ if$
+ }
+ { t #1 #1 substring$ *
+ t #2 global.max$ substring$ 't :=
+ }
+ if$
+ }
+ while$
+}
+
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{`word.in'}
+% The function \texttt{word.in} prints the word \textsl{in} for references
+% that are
+% contained in a larger work, or in conference proceedings. One may have a
+% colon after the word with the option \texttt{in-col}. If blocks of text are
+% to be separated with commas (option \texttt{blk-com}) then the word remains
+% in lower case, as it is defined in \texttt{bbl.in}; but if blocks act as
+% sentences, then it must be capitalized.
+% \begin{macrocode}
+FUNCTION {word.in}
+%<in-x>{ "" }
+%<*!in-x>
+%<blk-com|blk-tita>{ bbl.in
+%<!blk-com&!blk-tita>{ bbl.in capitalize
+%<in-col> ":" *
+%<in-it> emphasize
+ " " * }
+%</!in-x>
+
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{`format.date'}
+% The new \texttt{harvard.sty} allows variable brackets around the date
+% in the reference list. It uses |\harvardyearleft| and |\harvardyearright|
+% in the \texttt{.bst} files. Allow this with the option \texttt{harnm},
+% which could actually be used without the \texttt{har} option. Note that
+% this overrides the other year formatting options, except for the preceding punctuation.
+% \begin{macrocode}
+%<*ay>
+FUNCTION {format.date}
+{ year "year" bibinfo.check duplicate$ empty$
+ {
+%<*!blkyear>
+ "empty year in " cite$ * "; set to ????" * warning$
+ pop$ "????"
+%</!blkyear>
+ }
+ 'skip$
+ if$
+%<*aymth>
+ month "month" bibinfo.check duplicate$ empty$
+ 'skip$
+ {
+%<dtrev> swap$
+ " " * swap$
+ }
+ if$
+ *
+%<mth-bare> remove.dots
+%</aymth>
+%<dtbf> bolden
+ extra.label *
+%<*!harnm>
+%<*yr-par|yr-brk|yr-col|yr-blk|yr-com|yr-per>
+ before.all 'output.state :=
+%<yr-par> " (" swap$ * ")" *
+%<!yr-par&yr-brk> " [" swap$ * "]" *
+%<!yr-par&!yr-brk&yr-col> ": " swap$ *
+%<!yr-par&!yr-brk&!yr-col&yr-com> ", " swap$ *
+%<!yr-par&!yr-brk&!yr-col&!yr-com&yr-per> after.sentence 'output.state :=
+%<!yr-par&!yr-brk&!yr-col&!yr-com&!yr-per&yr-blk> " " swap$ *
+%</yr-par|yr-brk|yr-col|yr-blk|yr-com|yr-per>
+%</!harnm>
+%<*harnm>
+ before.all 'output.state :=
+ " \harvardyearleft " swap$ * "\harvardyearright{}" *
+%<yr-col> ":" swap$ *
+%<!yr-col&yr-com> "," swap$ *
+%<!yr-col&!yr-com&yr-per> after.sentence 'output.state :=
+%<!yr-col&!yr-com&!yr-per&yr-blk> " " swap$ *
+%</harnm>
+}
+%</ay>
+%<*!ay>
+FUNCTION {format.date}
+{
+%<!xmth> month "month" bibinfo.check
+%<xmth> ""
+ duplicate$ empty$
+ year "year" bibinfo.check duplicate$ empty$
+ { swap$ 'skip$
+ { "there's a month but no year in " cite$ * warning$ }
+ if$
+ *
+ }
+ { swap$ 'skip$
+ {
+%<showstack> month year
+%<!dtrev> swap$
+ " " * swap$
+ }
+ if$
+ *
+%<mth-bare> remove.dots
+ }
+ if$
+%<dtbf> bolden
+%<*yr-par|yr-brk|yr-col|yr-com|yr-per|yr-blk>
+ duplicate$ empty$
+ 'skip$
+ {
+ before.all 'output.state :=
+%<yr-par> " (" swap$ * ")" *
+%<!yr-par&yr-brk> " [" swap$ * "]" *
+%<!yr-par&!yr-brk&yr-col> ": " swap$ *
+%<!yr-par&!yr-brk&!yr-col&yr-com> ", " swap$ *
+%<!yr-par&!yr-brk&!yr-col&!yr-com&yr-per> after.sentence 'output.state :=
+%<!yr-par&!yr-brk&!yr-col&!yr-com&!yr-per&yr-blk> " " swap$ *
+ }
+ if$
+%</yr-par|yr-brk|yr-col|yr-com|yr-per|yr-blk>
+}
+%</!ay>
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{`format.year'}
+% For the options that put the year into the journal specifications, use a
+% special formatter separate from the regular date formatter.
+% The year is always in parentheses (except for appended to journal name).
+% \begin{macrocode}
+%<*jdt-p|jdt-pc|jdt-v|jdt-vs>
+FUNCTION{format.year}
+{ year "year" bibinfo.check duplicate$ empty$
+ { "empty year in " cite$ *
+%<ay&!blkyear> "; set to ????" *
+ warning$
+%<ay&!blkyear> pop$ "????"
+ }
+ {
+%<!ay&jdt-vs> " (" swap$ * ")" *
+%<!ay&!jdt-vs> "(" swap$ * ")" *
+ }
+ if$
+%<*ay>
+ extra.label *
+%<jdt-vs> " (" swap$ * ")" *
+%<!jdt-vs> "(" swap$ * ")" *
+%</ay>
+}
+%</jdt-p|jdt-pc|jdt-v|jdt-vs>
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{`format.btitle'}
+% \begin{macrocode}
+FUNCTION {format.btitle}
+{ title "title" bibinfo.check
+ duplicate$ empty$ 'skip$
+ {
+%<!btit-rm> emphasize
+%<lang> select.language
+ }
+ if$
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{`either.or.check'}
+% \begin{macrocode}
+FUNCTION {either.or.check}
+{ empty$
+ 'pop$
+ { "can't use both " swap$ * " fields in " * cite$ * warning$ }
+ if$
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{`format.bvolume'}
+% \begin{macrocode}
+FUNCTION {format.bvolume}
+{ volume empty$
+ { "" }
+ { bbl.volume volume tie.or.space.prefix
+ "volume" bibinfo.check * *
+ series "series" bibinfo.check
+ duplicate$ empty$ 'pop$
+%<*!ser-vol>
+ { swap$ bbl.of space.word * swap$
+ emphasize * }
+%</!ser-vol>
+%<ser-vol> { emphasize ", " * swap$ * }
+ if$
+ "volume and number" number either.or.check
+ }
+ if$
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{`format.number.series'}
+% \begin{macrocode}
+FUNCTION {format.number.series}
+{ volume empty$
+ { number empty$
+ { series field.or.null }
+%<*num-xser>
+ { series empty$
+ { number "number" bibinfo.check }
+ { output.state mid.sentence =
+ { bbl.number }
+ { bbl.number capitalize }
+ if$
+ number tie.or.space.prefix "number" bibinfo.check * *
+ bbl.in space.word *
+ series "series" bibinfo.check *
+ }
+ if$
+ }
+%</num-xser>
+%<*!num-xser>
+ { output.state mid.sentence =
+ { bbl.number }
+ { bbl.number capitalize }
+ if$
+ number tie.or.space.prefix "number" bibinfo.check * *
+ series empty$
+ { "there's a number but no series in " cite$ * warning$ }
+ { bbl.in space.word *
+ series "series" bibinfo.check *
+ }
+ if$
+ }
+%</!num-xser>
+ if$
+ }
+ { "" }
+ if$
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{`is.num'}
+% This function takes the single-character string on the stack and returns
+% 1 if it is a digit, else 0.
+% \begin{macrocode}
+%<*!xedn>
+FUNCTION {is.num}
+{ chr.to.int$
+ duplicate$ "0" chr.to.int$ < not
+ swap$ "9" chr.to.int$ > not and
+}
+
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{`extract.num'}
+% This function tests the string on the stack to see if it begins with a
+% number. If so, that number is left on the stack; if the string contains
+% no numbers at the start, it is left unchanged. The idea is to convert
+% \textsl{1st} to \textsl{1} and leave \textsl{first} as is.
+% This is used by \code{convert.edition}.
+% \begin{macrocode}
+FUNCTION {extract.num}
+{ duplicate$ 't :=
+ "" 's :=
+ { t empty$ not }
+ { t #1 #1 substring$
+ t #2 global.max$ substring$ 't :=
+ duplicate$ is.num
+ { s swap$ * 's := }
+ { pop$ "" 't := }
+ if$
+ }
+ while$
+ s empty$
+ 'skip$
+ { pop$ s }
+ if$
+}
+
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{`convert.edition'}
+% The function \texttt{convert.edition} takes the text in the field
+% \texttt{edition} and changes it to the language-specific equivalent. As
+% originally planned for \btx, this field should contain the words
+% \textsl{First}, \textsl{Second}, etc. Being so explicit,
+% it is not so easy to translate, nor to
+% convert to \textsl{1st}, \textsl{2nd}, etc., if one wanted.
+% This function carries out the translation, by changing
+% \textsl{first} or \textsl{1} to \texttt{bbl.first}, and so
+% on. The field is reduced to lower case to make it case insensitive. If no
+% translation is found, then the original text in \texttt{edition} is used
+% instead, as it stands. However, if the original is a number greater than
+% the maximum for which text is provided, then \texttt{bbl.th} is added to
+% it.
+% \begin{macrocode}
+FUNCTION {convert.edition}
+{ extract.num "l" change.case$ 's :=
+ s "first" = s "1" = or
+ { bbl.first 't := }
+ { s "second" = s "2" = or
+ { bbl.second 't := }
+ { s "third" = s "3" = or
+ { bbl.third 't := }
+ { s "fourth" = s "4" = or
+ { bbl.fourth 't := }
+ { s "fifth" = s "5" = or
+ { bbl.fifth 't := }
+ { s #1 #1 substring$ is.num
+%<!english&exlang> { s bbl.th * 't := }
+%<english|!exlang> { s eng.ord 't := }
+ { edition 't := }
+ if$
+ }
+ if$
+ }
+ if$
+ }
+ if$
+ }
+ if$
+ }
+ if$
+ t
+}
+%</!xedn>
+
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{`format.edition'}
+% This function formats the text for the edition specification, such as
+% ``Second edition''. It combines the edition number with the word
+% \textsl{edition}.
+% \begin{macrocode}
+FUNCTION {format.edition}
+{ edition duplicate$ empty$ 'skip$
+ {
+%<!xedn> convert.edition
+ output.state mid.sentence =
+ { "l" }
+ { "t" }
+ if$ change.case$
+ "edition" bibinfo.check
+ " " * bbl.edition *
+ }
+ if$
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+INTEGERS { multiresult }
+% \end{macrocode}
+%
+% \begin{macro}{`multi.page.check'}
+% \begin{macrocode}
+FUNCTION {multi.page.check}
+{ 't :=
+ #0 'multiresult :=
+ { multiresult not
+ t empty$ not
+ and
+ }
+ { t #1 #1 substring$
+ duplicate$ "-" =
+ swap$ duplicate$ "," =
+ swap$ "+" =
+ or or
+ { #1 'multiresult := }
+ { t #2 global.max$ substring$ 't := }
+ if$
+ }
+ while$
+ multiresult
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{`format.pages'}
+% \begin{macrocode}
+FUNCTION {format.pages}
+{ pages duplicate$ empty$ 'skip$
+ { duplicate$ multi.page.check
+ {
+%<!bkpg-x&!ppx> bbl.pages swap$
+ n.dashify
+ }
+ {
+%<!bkpg-x&!ppx> bbl.page swap$
+ }
+ if$
+%<!bkpg-x&!ppx> tie.or.space.prefix
+ "pages" bibinfo.check
+%<!bkpg-x&!ppx> * *
+%<bkpg-par> "(" swap$ * ")" *
+ }
+ if$
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{`first.page'}
+% \begin{macrocode}
+%<*jpg-1>
+FUNCTION {first.page}
+{ 't :=
+ ""
+ { t empty$ not t #1 #1 substring$ "-" = not and }
+ { t #1 #1 substring$ *
+ t #2 global.max$ substring$ 't :=
+ }
+ while$
+}
+
+%</jpg-1>
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{`format.journal.pages'}
+% Note: this function gets called with something on the stack.
+% It may be the volume and number.
+% \begin{macrocode}
+FUNCTION {format.journal.pages}
+{ pages duplicate$ empty$ 'pop$
+ { swap$ duplicate$ empty$
+ { pop$ pop$ format.pages }
+ {
+%<volp-sp> ": " *
+%<*!volp-sp>
+%<volp-blk> " " *
+%<*!volp-blk>
+%<volp-com> ", " *
+%<*!volp-com>
+%<volp-semi> "; " *
+%<!volp-semi> ":" *
+%</!volp-com>
+%</!volp-blk>
+%</!volp-sp>
+%<!jdt-v&!jdt-vs&jdt-p> format.year * " " *
+%<!jdt-v&!jdt-vs&!jdt-p&jdt-pc> format.year * ", " *
+ swap$
+%<jpg-1> first.page
+%<!jpg-1> n.dashify
+%<*jwdpg>
+ pages multi.page.check
+ 'bbl.pages
+ 'bbl.page
+ if$
+ swap$ tie.or.space.prefix
+%</jwdpg>
+ "pages" bibinfo.check
+%<jwdpg> * *
+ *
+ }
+ if$
+ }
+ if$
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{`format.journal.eid'}
+%
+% This function is called with something on the stack (journal vol, number)
+% and appends \texttt{eid} and \texttt{numpages} if those field are non-empty.
+% Very similar to \texttt{format.journal.pages}.
+%
+% For the AGU style of including the DOI as part of the EID, the DOI number
+% is appended too.
+% \begin{macrocode}
+FUNCTION {format.journal.eid}
+{ eid "eid" bibinfo.check
+ duplicate$ empty$ 'pop$
+ { swap$ duplicate$ empty$ 'skip$
+ {
+%<volp-sp> ": " *
+%<*!volp-sp>
+%<volp-blk> " " *
+%<*!volp-blk>
+%<volp-com> ", " *
+%<*!volp-com>
+%<volp-semi> "; " *
+%<!volp-semi> ":" *
+%</!volp-com>
+%</!volp-blk>
+%</!volp-sp>
+ }
+ if$
+ swap$ *
+%<*revdata>
+ numpages empty$ 'skip$
+ { bbl.eidpp numpages tie.or.space.prefix
+ "numpages" bibinfo.check * *
+ " (" swap$ * ")" * *
+ }
+ if$
+%</revdata>
+ }
+ if$
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{`format.vol.num.pages'}
+% Version 3.84, I have rationalized several options that placed the date in the
+% journal specifications. It was rather chaotic before, but now it should be
+% more systematic. This means some options have been removed, something that I
+% do not like to do.
+%
+% The option \texttt{pp-last} suppresses the pages in the formatting macros, and
+% sees to it that the pages are added just before any notes in those entries
+% that take pages. This applies to more than just \texttt{article}, but to
+% \texttt{inbook}, \texttt{incollection} as well.
+%
+% \begin{macrocode}
+FUNCTION {format.vol.num.pages}
+{ volume field.or.null
+ duplicate$ empty$ 'skip$
+ {
+%<jwdvol> bbl.volume swap$ tie.or.space.prefix
+ "volume" bibinfo.check
+%<jwdvol> * *
+ }
+ if$
+%<vol-bf&!vol-2bf> bolden
+%<!vol-bf&!vol-2bf&vol-it> emphasize
+%<jdt-v|jdt-vs> format.year *
+%<*!vnum-x>
+ number "number" bibinfo.check duplicate$ empty$ 'skip$
+ {
+ swap$ duplicate$ empty$
+ { "there's a number but no volume in " cite$ * warning$ }
+ 'skip$
+ if$
+ swap$
+%<vnum-sp> "~(" swap$ * ")" *
+%<!vnum-sp&vnum-cm> ", " swap$ *
+%<!vnum-sp&!vnum-cm&vnum-nr> ", " bbl.nr * number tie.or.space.prefix pop$ * swap$ *
+%<!vnum-sp&!vnum-cm&!vnum-nr&vnum-h> ", \#" swap$ *
+%<!vnum-sp&!vnum-cm&!vnum-nr&!vnum-h&vnum-b> " " swap$ *
+%<!vnum-sp&!vnum-cm&!vnum-nr&!vnum-h&!vnum-b> "(" swap$ * ")" *
+ }
+ if$ *
+%<!vol-bf&vol-2bf> bolden
+%</!vnum-x>
+%<*!pp-last>
+ eid empty$
+ { format.journal.pages }
+ { format.journal.eid }
+ if$
+%</!pp-last>
+}
+
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{`format.chapter.pages'}
+% \begin{macrocode}
+FUNCTION {format.chapter.pages}
+{ chapter empty$
+%<!pp-last> 'format.pages
+%<pp-last> { "" }
+ { type empty$
+ { bbl.chapter }
+ { type "l" change.case$
+ "type" bibinfo.check
+ }
+ if$
+ chapter tie.or.space.prefix
+ "chapter" bibinfo.check
+ * *
+%<*!pp-last>
+ pages empty$
+ 'skip$
+ { ", " * format.pages * }
+ if$
+%</!pp-last>
+ }
+ if$
+}
+
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{`bt.enquote'}
+% This is to place the booktitle for proceedings and collections into quotes.
+% If punctuation is to be included, then add a comma unless a stop already
+% exists, or add a period under the only circumstances that
+% |format.in.ed.booktitle| is followed by |new.sentence|.
+% \begin{macrocode}
+%<*bt-qq>
+FUNCTION {bt.enquote}
+{ duplicate$ empty$ 'skip$
+ { "\enquote{" swap$ *
+%<*!qx>
+ non.stop
+ { ",} " * }
+ { "}, " * }
+ if$
+%</!qx>
+%<*qx>
+ "}, " *
+%</qx>
+ }
+ if$
+}
+%</bt-qq>
+% \end{macrocode}
+%
+% \end{macro}
+%
+% \begin{macro}{`format.booktitle'}
+% The function \texttt{format.booktitle} pushes one object
+% (the book title, suitably encapsulated) onto the stack.
+% It is currently used in \texttt{format.incoll.inproc.crossref}
+% and in \texttt{format.in.ed.booktitle}, and should be used whenever accessing
+% the \texttt{booktitle} field for eventual output.
+%
+% If the book title is empty or missing, the function pushes an empty string.
+% \begin{macrocode}
+FUNCTION {format.booktitle}
+{
+ booktitle "booktitle" bibinfo.check
+%<!bt-qq&!bt-rm> emphasize
+%<bt-qq> bt.enquote
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{`format.in.ed.booktitle'}
+% Prior to version 3.81, the \textsl{Editor} or \textsl{Edited by} in
+% parentheses was meant to be capitalized, but this did not work properly.
+% Now the option \texttt{edcap} produces this, and default is not capitalized.
+%
+% Notes on \dtx{} options:
+% \begin{itemize}
+% \item
+% The following combinations are available through the \texttt{makebst.tex} interface:
+% \begin{quote}
+% \verb+(+ \\
+% \verb+ <default>+ \\
+% \verb+ |edby ( |edbyx |edbyy|edbyw[edcap])+ \\
+% \verb+ |edby-par (|edcap|edbyx[edcap]|edbyy )+ \\
+% \verb+ |edby-parc(|edcap|edbyx )+ \\
+% \verb+)+
+% \end{quote}
+% \item
+% \texttt{edby}, \texttt{edby-par}, and \texttt{edby-parc} are mutually exclusive
+% and, except for the default, exhaustive.
+% \item
+% \texttt{edbyx}, \texttt{edbyw}, and \texttt{edbyy} are mutually exclusive
+% and, except for the default, exhaustive.
+% \item
+% \texttt{edcap} is independent of the above two groups of options.
+% \item
+% When parentheses need to be applied, we make sure that the respective
+% \dtx{} guard expressions are mutually exclusive.
+% It makes no sense for \texttt{edbyw} to be in effect if either of
+% \texttt{edby-par} or \texttt{edby-parc} is in effect.
+% \item
+% \texttt{makebst.tex} only activates \texttt{edcap} in certain cases,
+% but we do no checking here, applying it consistently to the
+% ``editor'' text entity.
+% \item
+% The code between \texttt{<!edpar>} and \verb+<edpar\|edparc>+
+% \emph{must} match the corresponding code in \texttt{format.editors}.
+% This means that in the default case, formatting is controlled by
+% a \dtx{} mechanism entirely different from the other cases.
+% \item \texttt{ser-ed} has been added to suit AGU. Result of series plus
+% volume to go between booktitle and editors; must remove \texttt{format.bvolume}
+% from \texttt{incollection} and \texttt{inproceedings}.
+% \end{itemize}
+%
+% \begin{macrocode}
+FUNCTION {format.in.ed.booktitle}
+{ format.booktitle duplicate$ empty$ 'skip$
+ {
+%<showstack>% btitle
+%<*ser-ed>
+ format.bvolume duplicate$ empty$ 'pop$
+ { ", " swap$ * * }
+ if$
+%</ser-ed>
+ editor "editor" format.names.ed duplicate$ empty$ 'pop$
+ {
+%<*!(edby|edby-par|edby-parc)>
+%<showstack>% btitle ednms
+%<!edpar&!edparxc> "," *
+ " " *
+ get.bbl.editor
+%<bkedcap> capitalize
+%<edpar> "(" swap$ * "), " *
+%<!edpar&(edparc|edparxc)> "(" swap$ * ") " *
+%<!edpar&!(edparc|edparxc)> ", " *
+ * swap$
+%<showstack>% eds btitle
+%</!(edby|edby-par|edby-parc)>
+%<*edby|edby-par|edby-parc>
+%<showstack>% btitle ednms
+%<edbyx|edbyy|edbyw> get.bbl.editor
+%<!(edbyx|edbyy|edbyw)> bbl.edby
+%<edcap> capitalize
+%<!(edby-par|edby-parc)&edbyw> "(" swap$ * ")" *
+%<showstack>% btitle ednms ed
+%<(edby-par|edby)&edbyy> swap$ "," *
+ " " * swap$ *
+%<showstack>% btitle ednms-ed
+%<(edby-par|edby-parc)&!edbyw> "(" swap$ * ")" *
+ swap$
+%<edby|edby-parc> "," *
+ " " * swap$
+%</edby|edby-par|edby-parc>
+%<showstack>% btitle ednms-ed (or ednms-ed btitle)
+ * }
+ if$
+%<showstack>% btitle-ednms-ed (or ednms-ed-btitle) (or btitle)
+ word.in swap$ *
+ }
+ if$
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{`empty.misc.check'}
+% \begin{macrocode}
+%<*!ay>
+FUNCTION {empty.misc.check}
+{ author empty$ title empty$ howpublished empty$
+ month empty$ year empty$ note empty$
+ and and and and and
+%<!seq-no|alph> key empty$ not and
+ { "all relevant fields are empty in " cite$ * warning$ }
+ 'skip$
+ if$
+}
+%</!ay>
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{`format.thesis.type'}
+% \begin{macrocode}
+FUNCTION {format.thesis.type}
+{ type duplicate$ empty$
+ 'pop$
+ { swap$ pop$
+ "t" change.case$ "type" bibinfo.check
+ }
+ if$
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{`format.tr.number'}
+% \begin{macrocode}
+FUNCTION {format.tr.number}
+{ number "number" bibinfo.check
+ type duplicate$ empty$
+ { pop$ bbl.techrep }
+ 'skip$
+ if$
+ "type" bibinfo.check
+ swap$ duplicate$ empty$
+ { pop$ "t" change.case$ }
+ { tie.or.space.prefix * * }
+ if$
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{`format.article.crossref'}
+% The \texttt{journal} field was emphasized emplicitly, but it should be
+% done by command.
+% \begin{macrocode}
+FUNCTION {format.article.crossref}
+{
+%<*!ay>
+ key duplicate$ empty$
+ { pop$
+ journal duplicate$ empty$
+ { "need key or journal for " cite$ * " to crossref " * crossref * warning$ }
+ { "journal" bibinfo.check emphasize word.in swap$ * }
+ if$
+ }
+ { word.in swap$ * " " *}
+ if$
+%</!ay>
+%<ay> word.in
+%<!html> " \cite{" * crossref * "}" *
+%<html> " <tt>" * crossref * "</tt>" *
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{`format.crossref.editor'}
+% \begin{macrocode}
+%<*!ay>
+FUNCTION {format.crossref.editor}
+{ editor #1 "{vv~}{ll}" format.name$
+%<nmft&nmfted&nmand-rm> bib.name.font
+ "editor" bibinfo.check
+ editor num.names$ duplicate$
+ #2 >
+ { pop$
+%<nmft&nmfted&!nmand-rm&(etal-it|etal-rm)> bib.name.font
+ "editor" bibinfo.check
+ " " * bbl.etal
+%<etal-it> emphasize
+ *
+%<nmft&nmfted&!nmand-rm&!(etal-it|etal-rm)> bib.name.font
+%<nmft&nmfted&!nmand-rm&!(etal-it|etal-rm)> "others" 't :=
+ }
+ { #2 <
+ 'skip$
+ { editor #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" =
+ {
+%<nmft&nmfted&!nmand-rm&(etal-it|etal-rm)> bib.name.font
+ "editor" bibinfo.check
+ " " * bbl.etal
+%<etal-it> emphasize
+ *
+%<nmft&nmfted&!nmand-rm&!(etal-it|etal-rm)> bib.name.font
+%<nmft&nmfted&!nmand-rm&!(etal-it|etal-rm)> "others" 't :=
+ }
+ {
+%<*!harnm>
+%<!amper> bbl.and space.word
+%<amper> " \& "
+%</!harnm>
+%<harnm> " \harvardand\ "
+ * editor #2 "{vv~}{ll}" format.name$
+%<nmft&nmfted&nmand-rm> bib.name.font
+ "editor" bibinfo.check
+ *
+ }
+ if$
+ }
+ if$
+ }
+ if$
+%<*nmft&nmfted&!nmand-rm>
+ t "others" =
+ 'skip$
+ { bib.name.font "editor" bibinfo.check }
+ if$
+%</nmft&nmfted&!nmand-rm>
+}
+%</!ay>
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{`format.book.crossref'}
+% The \texttt{series} field was emphasized emplicitly, but it should be
+% done by command.
+% \begin{macrocode}
+FUNCTION {format.book.crossref}
+{ volume duplicate$ empty$
+ { "empty volume in " cite$ * "'s crossref of " * crossref * warning$
+ pop$ word.in
+ }
+ { bbl.volume
+%<!(blk-com|blk-tita)> capitalize
+ swap$ tie.or.space.prefix "volume" bibinfo.check * * bbl.of space.word *
+ }
+ if$
+%<*!ay>
+ editor empty$
+ editor field.or.null author field.or.null =
+ or
+ { key empty$
+ { series empty$
+ { "need editor, key, or series for " cite$ * " to crossref " *
+ crossref * warning$
+ "" *
+ }
+ { series emphasize * }
+ if$
+ }
+ { key * }
+ if$
+ }
+ { format.crossref.editor * }
+ if$
+%</!ay>
+%<!html> " \cite{" * crossref * "}" *
+%<html> " <tt>" * crossref * "</tt>" *
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{`format.incoll.inproc.crossref'}
+% The \texttt{booktitle} field was emphasized emplicitly, but it should be
+% done by command.
+% \begin{macrocode}
+FUNCTION {format.incoll.inproc.crossref}
+{
+%<*!ay>
+ editor empty$
+ editor field.or.null author field.or.null =
+ or
+ { key empty$
+ { format.booktitle duplicate$ empty$
+ { "need editor, key, or booktitle for " cite$ * " to crossref " *
+ crossref * warning$
+ }
+ { word.in swap$ * }
+ if$
+ }
+ { word.in key * " " *}
+ if$
+ }
+ { word.in format.crossref.editor * " " *}
+ if$
+%</!ay>
+%<ay> word.in
+%<!html> " \cite{" * crossref * "}" *
+%<html> " <tt>" * crossref * "</tt>" *
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{`format.org.or.pub'}
+% Psychology journals often want \textit{address}: \textit{publisher}.
+%
+% \textsl{Nature} wants publisher and date in parentheses, and when both
+% are there, they are merged into one set.
+%
+% Call function \texttt{add.blank} before parentheses so suppress preceding
+% punctuation, which looks strange when publisher in parentheses.
+%
+% MPG Jahrbuch wants publisher and year, but without parentheses. Add
+% \texttt{pub-nopar} to be used with \texttt{pub-date}.
+%
+% Have now (3.87.h) extended this function to include the organization, if
+% present. This is for \texttt{inproceedings} and \texttt{proceedings} where
+% the publisher is optional, and organization too. If the publisher is missing,
+% but the organization present, it is formatted like the publisher. This
+% complication comes from styles that want the publisher/organization to have
+% the date included, all in parentheses.
+%
+% This function is called by \texttt{format.publisher.address} and
+% \texttt{format.organization.address}, each putting the appropriate text
+% into the stack first.
+%
+% \begin{macrocode}
+FUNCTION {format.org.or.pub}
+{ 't :=
+ ""
+%<*pub-date&!ay>
+ year empty$
+ { "empty year in " cite$ * warning$ }
+ 'skip$
+ if$
+%</pub-date&!ay>
+%<*!(pub-date&ay)>
+ address empty$ t empty$ and
+%<pub-date> year empty$ and
+ 'skip$
+ {
+%</!(pub-date&ay)>
+%<pub-par|(pub-date&!pub-xpar)> add.blank "(" *
+%<*add-pub>
+ address "address" bibinfo.check *
+ t empty$
+ 'skip$
+%</add-pub>
+%<*!add-pub>
+ t empty$
+ { address "address" bibinfo.check *
+ }
+ { t *
+ address empty$
+ 'skip$
+ { ", " * address "address" bibinfo.check * }
+ if$
+ }
+%</!add-pub>
+%<*add-pub>
+ { address empty$
+ 'skip$
+ { ": " * }
+ if$
+ t *
+ }
+%</add-pub>
+ if$
+%<*pub-date&!ay>
+ year empty$
+ 'skip$
+ { t empty$ address empty$ and
+ 'skip$
+%<!pub-xc> { ", " swap$ * * }
+%<pub-xc> { " " swap$ * * }
+ if$
+ year "year" bibinfo.check
+%<dtbf> bolden
+ *
+ }
+ if$
+%</pub-date&!ay>
+%<*pub-date&ay>
+ year duplicate$ empty$
+%<*!blkyear>
+ { "empty year in " cite$ * "; set to ????" * warning$
+ pop$ "????" }
+%</!blkyear>
+%<*blkyear>
+ { "empty year in " cite$ * warning$
+ pop$ "" }
+%</blkyear>
+%<!dtbf> { "year" bibinfo.check extra.label * }
+%<dtbf> { "year" bibinfo.check bolden extra.label * }
+ if$
+ t empty$ address empty$ and
+ { * }
+%<!pub-xc> { ", " swap$ * * }
+%<pub-xc> { " " swap$ * * }
+ if$
+%</pub-date&ay>
+%<pub-par|(pub-date&!pub-xpar)> ")" *
+%<*!(pub-date&ay)>
+ }
+ if$
+%</!(pub-date&ay)>
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{`format.publisher.address'}
+% \begin{macrocode}
+FUNCTION {format.publisher.address}
+{ publisher "publisher" bibinfo.warn format.org.or.pub
+}
+
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{`format.organization.address'}
+% \begin{macrocode}
+FUNCTION {format.organization.address}
+{ organization "organization" bibinfo.check format.org.or.pub
+}
+
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{`name.or.dash'}
+% This function stores what is on the stack, compares it with previous value,
+% and replaces it with a long dash if they are equal. What is on the stack
+% should be author or editor names for the current entry.
+% \begin{macrocode}
+%<*nmdash>
+STRINGS {oldname}
+
+FUNCTION {name.or.dash}
+{ 's :=
+ oldname empty$
+ { s 'oldname := s }
+ { s oldname =
+%<*!au-col>
+%<!nmd-2&!nmd-3> { "---" }
+%<nmd-2&!nmd-3> { "---{}---" }
+%<nmd-3> { "---{}---{}---" }
+%</!au-col>
+%<*au-col>
+%<!nmd-2&!nmd-3> { "---" add.blank }
+%<nmd-2&!nmd-3> { "---{}---" add.blank }
+%<nmd-3> { "---{}---{}---" add.blank }
+%</au-col>
+ { s 'oldname := s }
+ if$
+ }
+ if$
+}
+
+%</nmdash>
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{`article'}
+% \begin{macrocode}
+FUNCTION {article}
+{ output.bibitem
+ format.authors "author" output.check
+%<ay> author format.key output
+%<au-col> add.colon
+%<nmdash> name.or.dash
+%<*dt-beg&!jdt-p&!jdt-pc&!jdt-vs&!jdt-v>
+ format.date "year" output.check
+ date.block
+%</dt-beg&!jdt-p&!jdt-pc&!jdt-vs&!jdt-v>
+%<!dt-beg&!blk-com&!blk-tit&!blk-tita> new.block
+%<*!jtit-x>
+ format.title "title" output.check
+%<blk-com&tit-qq> end.quote.title
+%<!blk-com&!blk-tit&!blk-tita> new.block
+%<*blk-tit|blk-tita>
+%<!tit-col> new.sentence
+%<tit-col> add.colon
+%</blk-tit|blk-tita>
+%</!jtit-x>
+ crossref missing$
+ {
+ journal
+%<jxper> remove.dots
+ "journal" bibinfo.check
+%<!jttl-rm> emphasize
+%<injnl> word.in swap$ *
+ "journal" output.check
+%<jnm-x> add.blank
+%<*!dt-beg&!dt-end&dt-jnl&!jdt-p&!jdt-pc&!jdt-vs&!jdt-v>
+ format.date "year" output.check
+ date.block
+%</!dt-beg&!dt-end&dt-jnl&!jdt-p&!jdt-pc&!jdt-vs&!jdt-v>
+ format.vol.num.pages output
+%<doi&agu-doi> format.doi output
+%<*!dt-beg&!dt-end&!dt-jnl&!jdt-p&!jdt-pc&!jdt-vs&!jdt-v>
+ format.date "year" output.check
+%</!dt-beg&!dt-end&!dt-jnl&!jdt-p&!jdt-pc&!jdt-vs&!jdt-v>
+ }
+ { format.article.crossref output.nonnull
+%<!pp-last> format.pages output
+ }
+ if$
+%<*pp-last>
+ eid empty$
+ { format.journal.pages }
+ { format.journal.eid }
+ if$
+%</pp-last>
+%<issn> format.issn output
+%<(doi|(url-doi&!url))&!agu-doi> format.doi output
+%<*url-blk&!harnm&!revdata>
+%<!blk-com&!blk-tit&!blk-tita> new.block
+ format.url output
+%</url-blk&!harnm&!revdata>
+%<!blk-com&!blk-tit&!blk-tita> new.block
+%<(blk-com|blk-tit|blk-tita)&blknt> new.sentence
+ format.note output
+%<*!dt-beg&dt-end&!jdt-p&!jdt-pc&!jdt-vs&!jdt-v>
+%<!blk-com&!blk-tit&!blk-tita> new.block
+ format.date "year" output.check
+%</!dt-beg&dt-end&!jdt-p&!jdt-pc&!jdt-vs&!jdt-v>
+%<eprint> format.eprint output
+%<*revdata>
+ format.url output
+%</revdata>
+ fin.entry
+%<harnm|url-nl> write.url
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{`book'}
+% \begin{macrocode}
+FUNCTION {book}
+{ output.bibitem
+ author empty$
+ { format.editors "author and editor" output.check
+%<ay> editor format.key output
+%<!edpar&(edparc|edparxc)&!au-col> add.blank
+%<au-col> add.colon
+%<nmdash> name.or.dash
+ }
+ { format.authors output.nonnull
+%<au-col> add.colon
+%<nmdash> name.or.dash
+ crossref missing$
+ { "author and editor" editor either.or.check }
+ 'skip$
+ if$
+ }
+ if$
+%<dt-beg&!pub-date> format.date "year" output.check
+%<dt-beg&!pub-date> date.block
+%<!dt-beg&!blk-com&!blk-tit&!blk-tita> new.block
+ format.btitle "title" output.check
+ crossref missing$
+ { format.bvolume output
+%<!blk-com&!blk-tit&!blk-tita> new.block
+%<blk-tit&!tit-col> new.sentence
+%<blk-tit&tit-col> add.colon
+%<!numser> format.number.series output
+%<pre-edn> format.edition output
+%<!blk-com&!blk-tit&!blk-tita> new.sentence
+%<numser> format.number.series output
+%<pg-bk&pg-pre> format.book.pages output
+ format.publisher.address output
+ }
+ {
+%<!blk-com&!blk-tit&!blk-tita> new.block
+%<blk-tit&!tit-col> new.sentence
+%<blk-tit&tit-col> add.colon
+ format.book.crossref output.nonnull
+%<!dt-beg&!dt-end&pub-date> format.date "year" output.check
+ }
+ if$
+%<!pre-edn> format.edition output
+%<!dt-beg&!dt-end&!pub-date> format.date "year" output.check
+%<isbn> format.isbn output
+%<pg-bk&!pg-pre> format.book.pages output
+%<doi|(url-doi&!url)> format.doi output
+%<*url-blk&!harnm&!revdata>
+%<!blk-com&!blk-tit&!blk-tita> new.block
+ format.url output
+%</url-blk&!harnm&!revdata>
+%<!blk-com&!blk-tit&!blk-tita> new.block
+%<(blk-com|blk-tit|blk-tita)&blknt> new.sentence
+ format.note output
+%<*!dt-beg&dt-end&!pub-date>
+%<!blk-com&!blk-tit&!blk-tita> new.block
+ format.date "year" output.check
+%</!dt-beg&dt-end&!pub-date>
+%<eprint> format.eprint output
+%<revdata> format.url output
+ fin.entry
+%<(harnm|url-nl)&!revdata> write.url
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{`booklet'}
+% \begin{macrocode}
+FUNCTION {booklet}
+{ output.bibitem
+ format.authors output
+%<ay> author format.key output
+%<au-col> add.colon
+%<nmdash> name.or.dash
+%<ay&dt-beg> format.date "year" output.check
+%<!ay&dt-beg> format.date output
+%<dt-beg> date.block
+%<!dt-beg&!blk-com&!blk-tit&!blk-tita> new.block
+ format.title "title" output.check
+%<blk-com&tit-qq> end.quote.title
+%<!blk-com&!blk-tit&!blk-tita> new.block
+%<blk-tit&!tit-col> new.sentence
+%<blk-tit&tit-col> add.colon
+ howpublished "howpublished" bibinfo.check output
+ address "address" bibinfo.check output
+%<ay&!dt-beg&!dt-end> format.date "year" output.check
+%<!ay&!dt-beg&!dt-end> format.date output
+%<isbn> format.isbn output
+%<pg-bk> format.book.pages output
+%<doi|(url-doi&!url)> format.doi output
+%<*url-blk&!harnm&!revdata>
+%<!blk-com&!blk-tit&!blk-tita> new.block
+ format.url output
+%</url-blk&!harnm&!revdata>
+%<!blk-com&!blk-tit&!blk-tita> new.block
+%<(blk-com|blk-tit|blk-tita)&blknt> new.sentence
+ format.note output
+%<*ay&!dt-beg&dt-end>
+%<!blk-com&!blk-tit&!blk-tita> new.block
+ format.date "year" output.check
+%</ay&!dt-beg&dt-end>
+%<*!ay&!dt-beg&dt-end>
+%<!blk-com&!blk-tit&!blk-tita> new.block
+ format.date output
+%</!ay&!dt-beg&dt-end>
+%<eprint> format.eprint output
+%<revdata> format.url output
+ fin.entry
+%<(harnm|url-nl)&!revdata> write.url
+}
+
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{`inbook'}
+% The medical journals, with option \texttt{dt-jnl}, have the date as part of
+% the journal specification. For chapters in books, they want date and pages
+% to appear at the end, with a space between them. (For journals, there is to be
+% no space.) Suppress the chapter specification (for now).
+%
+% The \texttt{dt-jnl} option usually behaves as the default, except for some
+% special entries, like this one.
+%
+% Restore the chapter specification (2004 Feb 9) after someone complained.
+% There are still some bugs here. If some date punctuation is specified, say
+% with \texttt{yrp-semi} for a semi-colon after the year, this appears always,
+% even if there is no text following. But then this to be an unlikely wish anyway,
+% since such punctuation options are best suited for \texttt{dt-beg}.
+% \begin{macrocode}
+FUNCTION {inbook}
+{ output.bibitem
+ author empty$
+ { format.editors "author and editor" output.check
+%<ay> editor format.key output
+%<au-col> add.colon
+%<nmdash> name.or.dash
+ }
+ { format.authors output.nonnull
+%<au-col> add.colon
+%<nmdash> name.or.dash
+ crossref missing$
+ { "author and editor" editor either.or.check }
+ 'skip$
+ if$
+ }
+ if$
+%<dt-beg&!pub-date> format.date "year" output.check
+%<dt-beg&!pub-date> date.block
+%<!dt-beg&!blk-com&!blk-tit&!blk-tita> new.block
+ format.btitle "title" output.check
+ crossref missing$
+ {
+%<pre-pub&numser> format.number.series output
+%<pre-pub> format.publisher.address output
+ format.bvolume output
+%<*dt-beg|dt-end|!dt-jnl|a|!a>
+ format.chapter.pages "chapter and pages" output.check
+%</dt-beg|dt-end|!dt-jnl|a|!a>
+%<!blk-com&!blk-tit&!blk-tita> new.block
+%<blk-tit&!tit-col> new.sentence
+%<blk-tit&tit-col> add.colon
+%<!numser> format.number.series output
+%<pre-edn> format.edition output
+%<!blk-com&!blk-tit&!blk-tita> new.sentence
+%<!pre-pub&numser> format.number.series output
+%<!pre-pub> format.publisher.address output
+ }
+ {
+%<*dt-beg|dt-end|!dt-jnl|a|!a>
+ format.chapter.pages "chapter and pages" output.check
+%</dt-beg|dt-end|!dt-jnl|a|!a>
+%<!blk-com&!blk-tit&!blk-tita> new.block
+%<blk-tit&!tit-col> new.sentence
+%<blk-tit&tit-col> add.colon
+ format.book.crossref output.nonnull
+%<!dt-beg&!dt-end&!dt-jnl&pub-date> format.date "year" output.check
+ }
+ if$
+%<!pre-edn> format.edition output
+%<!dt-beg&!dt-end&!dt-jnl&!pub-date> format.date "year" output.check
+%<*isbn>
+ crossref missing$
+ { format.isbn output }
+ 'skip$
+ if$
+%</isbn>
+%<*(!dt-beg&!dt-end&dt-jnl)&!pub-date>
+ format.date "year" output.check
+ date.block
+%</(!dt-beg&!dt-end&dt-jnl)&!pub-date>
+%<pp-last> format.pages "pages" output.check
+%<doi|(url-doi&!url)> format.doi output
+%<*url-blk&!harnm&!revdata>
+%<!blk-com&!blk-tit&!blk-tita> new.block
+ format.url output
+%</url-blk&!harnm&!revdata>
+%<!blk-com&!blk-tit&!blk-tita> new.block
+%<(blk-com|blk-tit|blk-tita)&blknt> new.sentence
+ format.note output
+%<*!dt-beg&dt-end&!pub-date>
+%<!blk-com&!blk-tit&!blk-tita> new.block
+ format.date "year" output.check
+%</!dt-beg&dt-end&!pub-date>
+%<eprint> format.eprint output
+%<revdata> format.url output
+ fin.entry
+%<(harnm|url-nl)&!revdata> write.url
+}
+
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{`incollection'}
+% \begin{macrocode}
+FUNCTION {incollection}
+{ output.bibitem
+ format.authors "author" output.check
+%<ay> author format.key output
+%<au-col> add.colon
+%<nmdash> name.or.dash
+%<dt-beg&!pub-date> format.date "year" output.check
+%<dt-beg&!pub-date> date.block
+%<!dt-beg&!blk-com&!blk-tit&!blk-tita> new.block
+%<*!jtit-x>
+ format.title "title" output.check
+%<blk-com&tit-qq> end.quote.title
+%<!blk-com&!blk-tit&!blk-tita> new.block
+%<blk-tit&!tit-col> new.sentence
+%<blk-tit&tit-col> add.colon
+%</!jtit-x>
+ crossref missing$
+ { format.in.ed.booktitle "booktitle" output.check
+%<bt-qq> end.quote.btitle
+%<pre-pub&numser> format.number.series output
+%<pre-pub> format.publisher.address output
+%<!ser-ed> format.bvolume output
+%<!numser> format.number.series output
+%<pre-edn> format.edition output
+ format.chapter.pages output
+%<!blk-com&!blk-tit&!blk-tita> new.sentence
+%<!pre-pub&numser> format.number.series output
+%<!pre-pub> format.publisher.address output
+%<!pre-edn> format.edition output
+%<!dt-beg&!dt-end&!dt-jnl&!pub-date> format.date "year" output.check
+%<isbn> format.isbn output
+ }
+ { format.incoll.inproc.crossref output.nonnull
+ format.chapter.pages output
+ }
+ if$
+%<*(!dt-beg&!dt-end&dt-jnl)&!pub-date>
+ format.date "year" output.check
+ date.block
+%</(!dt-beg&!dt-end&dt-jnl)&!pub-date>
+%<pp-last> format.pages "pages" output.check
+%<doi|(url-doi&!url)> format.doi output
+%<*url-blk&!harnm&!revdata>
+%<!blk-com&!blk-tit&!blk-tita> new.block
+ format.url output
+%</url-blk&!harnm&!revdata>
+%<!blk-com&!blk-tit&!blk-tita> new.block
+%<(blk-com|blk-tit|blk-tita)&blknt> new.sentence
+ format.note output
+%<*!dt-beg&dt-end&!pub-date>
+%<!blk-com&!blk-tit&!blk-tita> new.block
+ format.date "year" output.check
+%</!dt-beg&dt-end&!pub-date>
+%<eprint> format.eprint output
+%<revdata> format.url output
+ fin.entry
+%<(harnm|url-nl)&!revdata> write.url
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{`inproceedings'}
+% \begin{macrocode}
+FUNCTION {inproceedings}
+{ output.bibitem
+ format.authors "author" output.check
+%<ay> author format.key output
+%<au-col> add.colon
+%<nmdash> name.or.dash
+%<dt-beg&!pub-date> format.date "year" output.check
+%<dt-beg&!pub-date> date.block
+%<!dt-beg&!blk-com&!blk-tit&!blk-tita> new.block
+%<*!jtit-x>
+ format.title "title" output.check
+%<blk-com&tit-qq> end.quote.title
+%<!blk-com&!blk-tit&!blk-tita> new.block
+%<blk-tit&!tit-col> new.sentence
+%<blk-tit&tit-col> add.colon
+%</!jtit-x>
+ crossref missing$
+ { format.in.ed.booktitle "booktitle" output.check
+%<bt-qq> end.quote.btitle
+%<*!pre-pub>
+%<!ser-ed> format.bvolume output
+%<!numser> format.number.series output
+%<(dt-beg|dt-end|!dt-jnl)&!pp-last> format.pages output
+%</!pre-pub>
+%<!blk-com&!blk-tit&!blk-tita> new.sentence
+%<numser> format.number.series output
+ publisher empty$
+ { format.organization.address output }
+ { organization "organization" bibinfo.check output
+ format.publisher.address output
+ }
+ if$
+%<!dt-beg&!dt-end&!dt-jnl&!pub-date> format.date "year" output.check
+%<*pre-pub>
+ format.bvolume output
+%<!numser> format.number.series output
+%<(dt-beg|dt-end|!dt-jnl)&!pp-last> format.pages output
+%</pre-pub>
+%<isbn> format.isbn output
+%<issn> format.issn output
+ }
+ { format.incoll.inproc.crossref output.nonnull
+%<(dt-beg|dt-end|!dt-jnl)&!pp-last> format.pages output
+ }
+ if$
+%<*!dt-beg&!dt-end&dt-jnl&!pp-last>
+%<!pub-date> format.date "year" output.check
+%<!pub-date> date.block
+%<jdt-v|jdt-vs|jdt-p|!jdt-pc> add.blank
+ format.pages "pages" output.check
+%</!dt-beg&!dt-end&dt-jnl&!pp-last>
+%<pp-last> format.pages "pages" output.check
+%<doi|(url-doi&!url)> format.doi output
+%<*url-blk&!harnm&!revdata>
+%<!blk-com&!blk-tit&!blk-tita> new.block
+ format.url output
+%</url-blk&!harnm&!revdata>
+%<!blk-com&!blk-tit&!blk-tita> new.block
+%<(blk-com|blk-tit|blk-tita)&blknt> new.sentence
+ format.note output
+%<*!dt-beg&dt-end&!pub-date>
+%<!blk-com&!blk-tit&!blk-tita> new.block
+ format.date "year" output.check
+%</!dt-beg&dt-end&!pub-date>
+%<eprint> format.eprint output
+%<revdata> format.url output
+ fin.entry
+%<(harnm|url-nl)&!revdata> write.url
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{`conference'}
+% \begin{macrocode}
+FUNCTION {conference} { inproceedings }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{`manual'}
+% \begin{macrocode}
+%<*ay>
+FUNCTION {manual}
+{ output.bibitem
+ format.authors output
+ author format.key output
+%<au-col> add.colon
+%<nmdash> name.or.dash
+%<dt-beg> format.date "year" output.check
+%<dt-beg> date.block
+%<!dt-beg&!blk-com&!blk-tit&!blk-tita> new.block
+ format.btitle "title" output.check
+%<blk-tit&!tit-col> new.sentence
+%<blk-tit&tit-col> add.colon
+%<!blk-com&!blk-tit&!blk-tita> organization address new.block.checkb
+ organization "organization" bibinfo.check output
+ address "address" bibinfo.check output
+ format.edition output
+%<!dt-beg&!dt-end> format.date "year" output.check
+%<doi|(url-doi&!url)> format.doi output
+%<*url-blk&!harnm&!revdata>
+%<!blk-com&!blk-tit&!blk-tita> new.block
+ format.url output
+%</url-blk&!harnm&!revdata>
+%<!blk-com&!blk-tit&!blk-tita> new.block
+%<(blk-com|blk-tit|blk-tita)&blknt> new.sentence
+ format.note output
+%<*!dt-beg&dt-end>
+%<!blk-com&!blk-tit&!blk-tita> new.block
+ format.date "year" output.check
+%</!dt-beg&dt-end>
+%<eprint> format.eprint output
+%<revdata> format.url output
+ fin.entry
+%<(harnm|url-nl)&!revdata> write.url
+}
+
+%</ay>
+%<*!ay>
+FUNCTION {manual}
+{ output.bibitem
+ author empty$
+ { organization "organization" bibinfo.check
+ duplicate$ empty$ 'pop$
+ { output
+ address "address" bibinfo.check output
+ }
+ if$
+ }
+ { format.authors output.nonnull }
+ if$
+%<au-col> add.colon
+%<nmdash> name.or.dash
+%<ay&dt-beg> format.date "year" output.check
+%<!ay&dt-beg> format.date output
+%<dt-beg> date.block
+%<!dt-beg&!blk-com&!blk-tit&!blk-tita> new.block
+ format.btitle "title" output.check
+%<blk-tit&!tit-col> new.sentence
+%<blk-tit&tit-col> add.colon
+ author empty$
+ { organization empty$
+ {
+%<!blk-com&!blk-tit&!blk-tita> address new.block.checka
+ address "address" bibinfo.check output
+ }
+ 'skip$
+ if$
+ }
+ {
+%<!blk-com&!blk-tit&!blk-tita> organization address new.block.checkb
+ organization "organization" bibinfo.check output
+ address "address" bibinfo.check output
+ }
+ if$
+ format.edition output
+%<ay&!dt-beg&!dt-end> format.date "year" output.check
+%<!ay&!dt-beg&!dt-end> format.date output
+%<doi|(url-doi&!url)> format.doi output
+%<*url-blk&!harnm&!revdata>
+%<!blk-com&!blk-tit&!blk-tita> new.block
+ format.url output
+%</url-blk&!harnm&!revdata>
+%<!blk-com&!blk-tit&!blk-tita> new.block
+%<(blk-com|blk-tit|blk-tita)&blknt> new.sentence
+ format.note output
+%<*ay&!dt-beg&dt-end>
+%<!blk-com&!blk-tit&!blk-tita> new.block
+ format.date "year" output.check
+%</ay&!dt-beg&dt-end>
+%<*!ay&!dt-beg&dt-end>
+%<!blk-com&!blk-tit&!blk-tita> new.block
+ format.date output
+%</!ay&!dt-beg&dt-end>
+%<eprint> format.eprint output
+%<revdata> format.url output
+ fin.entry
+%<(harnm|url-nl)&!revdata> write.url
+}
+
+%</!ay>
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{`mastersthesis'}
+% To format a master's thesis.
+% \begin{macrocode}
+FUNCTION {mastersthesis}
+{ output.bibitem
+ format.authors "author" output.check
+%<ay> author format.key output
+%<au-col> add.colon
+%<nmdash> name.or.dash
+%<dt-beg> format.date "year" output.check
+%<dt-beg> date.block
+%<!dt-beg&!blk-com&!blk-tit&!blk-tita> new.block
+%<*!thtit-x>
+%<!thtit-a> format.btitle
+%<thtit-a> format.title
+ "title" output.check
+%<thtit-a&blk-com&tit-qq> end.quote.title
+%<!blk-com&!blk-tit&!blk-tita> new.block
+%<blk-tit&!tit-col> new.sentence
+%<blk-tit&tit-col> add.colon
+%</!thtit-x>
+ bbl.mthesis format.thesis.type output.nonnull
+ school "school" bibinfo.warn output
+ address "address" bibinfo.check output
+%<!dt-beg&!dt-end> format.date "year" output.check
+%<doi|(url-doi&!url)> format.doi output
+%<*url-blk&!harnm&!revdata>
+%<!blk-com&!blk-tit&!blk-tita> new.block
+ format.url output
+%</url-blk&!harnm&!revdata>
+%<!blk-com&!blk-tit&!blk-tita> new.block
+%<(blk-com|blk-tit|blk-tita)&blknt> new.sentence
+ format.note output
+%<*!dt-beg&dt-end>
+%<!blk-com&!blk-tit&!blk-tita> new.block
+ format.date "year" output.check
+%</!dt-beg&dt-end>
+%<eprint> format.eprint output
+%<revdata> format.url output
+ fin.entry
+%<(harnm|url-nl)&!revdata> write.url
+}
+
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{`misc'}
+% \begin{macrocode}
+FUNCTION {misc}
+{ output.bibitem
+ format.authors output
+%<ay> author format.key output
+%<au-col> add.colon
+%<nmdash> name.or.dash
+%<ay&dt-beg> format.date "year" output.check
+%<!ay&dt-beg> format.date output
+%<*ay>
+%<dt-beg> date.block
+%<!dt-beg&!blk-com&!blk-tit&!blk-tita> new.block
+ format.title output
+%<blk-com&tit-qq> end.quote.title
+%<!blk-com&!blk-tit&!blk-tita> new.block
+%<blk-tit&!tit-col> new.sentence
+%<blk-tit&tit-col> add.colon
+%</ay>
+%<*!ay>
+%<!blk-com&!blk-tit&!blk-tita> title howpublished new.block.checkb
+ format.title output
+%<blk-com&tit-qq> end.quote.title
+%<blk-tit&!tit-col> new.sentence
+%<blk-tit&tit-col> add.colon
+%<!blk-com&!blk-tit&!blk-tita> howpublished new.block.checka
+%</!ay>
+ howpublished "howpublished" bibinfo.check output
+%<ay&!dt-beg&!dt-end> format.date "year" output.check
+%<!ay&!dt-beg&!dt-end> format.date output
+%<doi|(url-doi&!url)> format.doi output
+%<*url-blk&!harnm&!revdata>
+%<!blk-com&!blk-tit&!blk-tita> new.block
+ format.url output
+%</url-blk&!harnm&!revdata>
+%<!blk-com&!blk-tit&!blk-tita> new.block
+%<(blk-com|blk-tit|blk-tita)&blknt> new.sentence
+ format.note output
+%<*ay&!dt-beg&dt-end>
+%<!blk-com&!blk-tit&!blk-tita> new.block
+ format.date "year" output.check
+%</ay&!dt-beg&dt-end>
+%<*!ay&!dt-beg&dt-end>
+%<!blk-com&!blk-tit&!blk-tita> new.block
+ format.date output
+%</!ay&!dt-beg&dt-end>
+%<eprint> format.eprint output
+%<revdata> format.url output
+ fin.entry
+%<(harnm|url-nl)&!revdata> write.url
+%<!ay> empty.misc.check
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{`phdthesis'}
+% To format a doctoral thesis.
+% \begin{macrocode}
+FUNCTION {phdthesis}
+{ output.bibitem
+ format.authors "author" output.check
+%<ay> author format.key output
+%<au-col> add.colon
+%<nmdash> name.or.dash
+%<dt-beg> format.date "year" output.check
+%<dt-beg> date.block
+%<!dt-beg&!blk-com&!blk-tit&!blk-tita> new.block
+%<*!thtit-x>
+%<!thtit-a> format.btitle
+%<thtit-a> format.title
+ "title" output.check
+%<thtit-a&blk-com&tit-qq> end.quote.title
+%<!blk-com&!blk-tit&!blk-tita> new.block
+%<blk-tit&!tit-col> new.sentence
+%<blk-tit&tit-col> add.colon
+%</!thtit-x>
+ bbl.phdthesis format.thesis.type output.nonnull
+ school "school" bibinfo.warn output
+ address "address" bibinfo.check output
+%<!dt-beg&!dt-end> format.date "year" output.check
+%<doi|(url-doi&!url)> format.doi output
+%<*url-blk&!harnm&!revdata>
+%<!blk-com&!blk-tit&!blk-tita> new.block
+ format.url output
+%</url-blk&!harnm&!revdata>
+%<!blk-com&!blk-tit&!blk-tita> new.block
+%<(blk-com|blk-tit|blk-tita)&blknt> new.sentence
+ format.note output
+%<*!dt-beg&dt-end>
+%<!blk-com&!blk-tit&!blk-tita> new.block
+ format.date "year" output.check
+%</!dt-beg&dt-end>
+%<eprint> format.eprint output
+%<revdata> format.url output
+ fin.entry
+%<(harnm|url-nl)&!revdata> write.url
+}
+
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{`presentation'}
+% \begin{macrocode}
+%<*pres>
+FUNCTION {presentation}
+{ output.bibitem
+ format.authors output
+%<ay> author format.key output
+%<au-col> add.colon
+%<nmdash> name.or.dash
+%<!blk-com&!blk-tit&!blk-tita> new.block
+ format.title output
+%<blk-com&tit-qq> end.quote.title
+%<!blk-com&!blk-tit&!blk-tita> new.block
+%<blk-tit&!tit-col> new.sentence
+%<blk-tit&tit-col> add.colon
+ format.organization.address "organization and address" output.check
+ month "month" output.check
+ year "year" output.check
+%<!blk-com&!blk-tit&!blk-tita> new.block
+%<(blk-com|blk-tit|blk-tita)&blknt> new.sentence
+ format.note output
+ new.sentence
+ type missing$ 'skip$
+ {"(" type capitalize * ")" * output}
+ if$
+%<*url-blk&!harnm>
+%<!blk-com&!blk-tit&!blk-tita> new.block
+ format.url output
+%</url-blk&!harnm>
+ fin.entry
+%<(harnm|url-nl)&!revdata> write.url
+}
+
+%</pres>
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{`proceedings'}
+% \begin{macrocode}
+%<*ay>
+FUNCTION {proceedings}
+{ output.bibitem
+ format.editors output
+ editor format.key output
+%<au-col> add.colon
+%<nmdash> name.or.dash
+%<dt-beg> format.date "year" output.check
+%<dt-beg> date.block
+%<!dt-beg&!blk-com&!blk-tit&!blk-tita> new.block
+ format.btitle "title" output.check
+ format.bvolume output
+%<!numser> format.number.series output
+%<!blk-com&!blk-tit&!blk-tita> new.sentence
+%<numser> format.number.series output
+ publisher empty$
+ { format.organization.address output }
+ { organization "organization" bibinfo.check output
+ format.publisher.address output
+ }
+ if$
+%<!dt-beg&!dt-end&!pub-date> format.date "year" output.check
+%<isbn> format.isbn output
+%<issn> format.issn output
+%<doi|(url-doi&!url)> format.doi output
+%<*url-blk&!harnm&!revdata>
+%<!blk-com&!blk-tit&!blk-tita> new.block
+ format.url output
+%</url-blk&!harnm&!revdata>
+%<!blk-com&!blk-tit&!blk-tita> new.block
+%<(blk-com|blk-tit|blk-tita)&blknt> new.sentence
+ format.note output
+%<*!dt-beg&dt-end&!pub-date>
+%<!blk-com&!blk-tit&!blk-tita> new.block
+ format.date "year" output.check
+%</!dt-beg&dt-end&!pub-date>
+%<eprint> format.eprint output
+%<revdata> format.url output
+ fin.entry
+%<(harnm|url-nl)&!revdata> write.url
+}
+
+%</ay>
+% \end{macrocode}
+% \begin{macrocode}
+%<*!ay>
+FUNCTION {proceedings}
+{ output.bibitem
+ editor empty$
+ { organization "organization" bibinfo.check output
+ }
+ { format.editors output.nonnull }
+ if$
+%<au-col> add.colon
+%<nmdash> name.or.dash
+%<dt-beg> format.date "year" output.check
+%<dt-beg> date.block
+%<!dt-beg&!blk-com&!blk-tit&!blk-tita> new.block
+ format.btitle "title" output.check
+ format.bvolume output
+%<!numser> format.number.series output
+ editor empty$
+ { publisher empty$
+%<!numser> 'skip$
+%<numser> { format.number.series output }
+ {
+%<!blk-com&!blk-tit&!blk-tita> new.sentence
+%<numser> format.number.series output
+ format.publisher.address output
+ }
+ if$
+ }
+ { publisher empty$
+ {
+%<!blk-com&!blk-tit&!blk-tita> new.sentence
+%<numser> format.number.series output
+ format.organization.address output }
+ {
+%<!blk-com&!blk-tit&!blk-tita> new.sentence
+%<numser> format.number.series output
+ organization "organization" bibinfo.check output
+ format.publisher.address output
+ }
+ if$
+ }
+ if$
+%<!dt-beg&!dt-end&!pub-date> format.date "year" output.check
+%<isbn> format.isbn output
+%<issn> format.issn output
+%<doi|(url-doi&!url)> format.doi output
+%<*url-blk&!harnm&!revdata>
+%<!blk-com&!blk-tit&!blk-tita> new.block
+ format.url output
+%</url-blk&!harnm&!revdata>
+%<!blk-com&!blk-tit&!blk-tita> new.block
+%<(blk-com|blk-tit|blk-tita)&blknt> new.sentence
+ format.note output
+%<*!dt-beg&dt-end>
+%<!blk-com&!blk-tit&!blk-tita> new.block
+ format.date "year" output.check
+%</!dt-beg&dt-end>
+%<eprint> format.eprint output
+%<revdata> format.url output
+ fin.entry
+%<(harnm|url-nl)&!revdata> write.url
+}
+
+%</!ay>
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{`techreport'}
+% \begin{macrocode}
+FUNCTION {techreport}
+{ output.bibitem
+ format.authors "author" output.check
+%<ay> author format.key output
+%<au-col> add.colon
+%<nmdash> name.or.dash
+%<dt-beg> format.date "year" output.check
+%<dt-beg> date.block
+%<!dt-beg&!blk-com&!blk-tit&!blk-tita> new.block
+%<trtit-b> format.btitle
+%<!trtit-b> format.title
+ "title" output.check
+%<!trtit-b&blk-com&tit-qq> end.quote.title
+%<!blk-com&!blk-tit&!blk-tita> new.block
+%<blk-tit&!tit-col> new.sentence
+%<blk-tit&tit-col> add.colon
+%<!trnum-it> format.tr.number output.nonnull
+%<trnum-it> format.tr.number emphasize output.nonnull
+ institution "institution" bibinfo.warn output
+ address "address" bibinfo.check output
+%<!dt-beg&!dt-end> format.date "year" output.check
+%<doi|(url-doi&!url)> format.doi output
+%<*url-blk&!harnm&!revdata>
+%<!blk-com&!blk-tit&!blk-tita> new.block
+ format.url output
+%</url-blk&!harnm&!revdata>
+%<!blk-com&!blk-tit&!blk-tita> new.block
+%<(blk-com|blk-tit|blk-tita)&blknt> new.sentence
+ format.note output
+%<*!dt-beg&dt-end>
+%<!blk-com&!blk-tit&!blk-tita> new.block
+ format.date "year" output.check
+%</!dt-beg&dt-end>
+%<eprint> format.eprint output
+%<revdata> format.url output
+ fin.entry
+%<(harnm|url-nl)&!revdata> write.url
+}
+
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{`unpublished'}
+% \begin{macrocode}
+FUNCTION {unpublished}
+{ output.bibitem
+ format.authors "author" output.check
+%<ay> author format.key output
+%<au-col> add.colon
+%<nmdash> name.or.dash
+%<ay&dt-beg> format.date "year" output.check
+%<!ay&dt-beg> format.date output
+%<dt-beg> date.block
+%<!dt-beg&!blk-com&!blk-tit&!blk-tita> new.block
+ format.title "title" output.check
+%<blk-com&tit-qq> end.quote.title
+%<ay&!dt-beg&!dt-end> format.date "year" output.check
+%<!ay&!dt-beg&!dt-end> format.date output
+%<doi|(url-doi&!url)> format.doi output
+%<*url-blk&!harnm&!revdata>
+%<!blk-com&!blk-tit&!blk-tita> new.block
+ format.url output
+%</url-blk&!harnm&!revdata>
+%<!blk-com&!blk-tit&!blk-tita> new.block
+%<(blk-com|blk-tit|blk-tita)&blknt> new.sentence
+ format.note "note" output.check
+%<*ay&!dt-beg&dt-end>
+%<!blk-com&!blk-tit&!blk-tita> new.block
+ format.date output
+%</ay&!dt-beg&dt-end>
+%<*!ay&!dt-beg&dt-end>
+%<!blk-com&!blk-tit&!blk-tita> new.block
+ format.date output
+%</!ay&!dt-beg&dt-end>
+%<eprint> format.eprint output
+%<revdata> format.url output
+ fin.entry
+%<(harnm|url-nl)&!revdata> write.url
+}
+
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{`default.type'}
+% \begin{macrocode}
+FUNCTION {default.type} { misc }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+READ
+% \end{macrocode}
+%
+% \begin{macrocode}
+%<*ay|alph|!seq-no>
+% \end{macrocode}
+%
+% \begin{macro}{`sortify'}
+% In \texttt{btxbst.doc}/\texttt{.mbs}, the \texttt{sortify} function is
+% left out for unsorted alpha-style citations. This leads to an error,
+% because it is still used. So leave it in here too. \emph{In fact, do away
+% with unsorted alpha style, since it is as useless as unsorted author--year
+% listings.}
+% \begin{macrocode}
+FUNCTION {sortify}
+{ purify$
+ "l" change.case$
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+INTEGERS { len }
+% \end{macrocode}
+%
+% \begin{macro}{`chop.word'}
+% \begin{macrocode}
+FUNCTION {chop.word}
+{ 's :=
+ 'len :=
+ s #1 len substring$ =
+ { s len #1 + global.max$ substring$ }
+ 's
+ if$
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+%<*!ay&alph>
+% \end{macrocode}
+%
+% \begin{macro}{`format.lab.names'}
+% The function \texttt{format.lab.names} formats by author--year or the
+% \texttt{alpha} style as in the original \texttt{alpha.bst}.
+% Only major difference is that there should be no unsorted (\texttt{seq-no})
+% versions of this. Patashnik was clearly very unhappy about accommodating
+% such an animal, and in fact, his unsorted alpha style crashes \btx.
+% I also provide the \texttt{vonx} option here to ignore the \textsl{von}
+% part of the name.
+%
+% \begin{macrocode}
+INTEGERS { et.al.char.used }
+% \end{macrocode}
+%
+% \begin{macrocode}
+FUNCTION {initialize.et.al.char.used}
+{ #0 'et.al.char.used :=
+}
+% \end{macrocode}
+%
+% \begin{macrocode}
+EXECUTE {initialize.et.al.char.used}
+% \end{macrocode}
+%
+% \begin{macrocode}
+FUNCTION {format.lab.names}
+{ 's :=
+%<*alf-1>
+%<!vonx> s #1 "{v{}}{l{}}" format.name$
+%<vonx> s #1 "{l{}}" format.name$
+ duplicate$ text.length$ #2 <
+ { pop$ s #1 "{ll}" format.name$ #3 text.prefix$ }
+ 'skip$
+ if$
+%</alf-1>
+%<*!alf-1&alf-f>
+%<!vonx> s #1 "{vv{}}{ll}" format.name$
+%<vonx> s #1 "{ll}" format.name$
+%</!alf-1&alf-f>
+%<*!alf-1&!alf-f>
+ s num.names$ 'numnames :=
+ numnames #1 >
+ { numnames #4 >
+ { #3 'namesleft := }
+ { numnames 'namesleft := }
+ if$
+ #1 'nameptr :=
+ ""
+ { namesleft #0 > }
+ { nameptr numnames =
+ { s nameptr "{ff }{vv }{ll}{ jj}" format.name$ "others" =
+ { "{\etalchar{+}}" *
+ #1 'et.al.char.used :=
+ }
+%<!vonx> { s nameptr "{v{}}{l{}}" format.name$ * }
+%<vonx> { s nameptr "{l{}}" format.name$ * }
+ if$
+ }
+%<!vonx> { s nameptr "{v{}}{l{}}" format.name$ * }
+%<vonx> { s nameptr "{l{}}" format.name$ * }
+ if$
+ nameptr #1 + 'nameptr :=
+ namesleft #1 - 'namesleft :=
+ }
+ while$
+ numnames #4 >
+ { "{\etalchar{+}}" *
+ #1 'et.al.char.used :=
+ }
+ 'skip$
+ if$
+ }
+%<!vonx> { s #1 "{v{}}{l{}}" format.name$
+%<vonx> { s #1 "{l{}}" format.name$
+ duplicate$ text.length$ #2 <
+ { pop$ s #1 "{ll}" format.name$ #3 text.prefix$ }
+ 'skip$
+ if$
+ }
+ if$
+%</!alf-1&!alf-f>
+}
+% \end{macrocode}
+%
+% \begin{macrocode}
+%</!ay&alph>
+% \end{macrocode}
+% The function for the standard citation: one or two authors cited full, but for
+% more than two, only the first with \emph{et~al.} given.
+% \begin{macrocode}
+%<*ay&!mcite>
+FUNCTION {format.lab.names}
+{ 's :=
+ "" 't :=
+%<!jnrlab> s #1 "{vv~}{ll}" format.name$
+%<*jnrlab>
+%<!nm-rv&!nm-rvv&!nm-rvx&!nm-rvcx> s #1 "{vv~}{ll}{, jj}" format.name$
+%<nm-rv|nm-rvv|nm-rvx|nm-rvcx> s #1 "{vv~}{ll}{ jj}" format.name$
+%</jnrlab>
+%<lab&and-rm> cite.name.font
+ s num.names$ duplicate$
+ #2 >
+ { pop$
+%<lab&!and-rm&(etal-it|etal-rm)> cite.name.font
+%<*!etal-it>
+%<lab&and-rm&!etal-rm> " " * bbl.etal cite.name.font *
+%<!lab|!and-rm|etal-rm> " " * bbl.etal *
+%</!etal-it>
+%<etal-it> " " * bbl.etal emphasize *
+%<lab&!and-rm&!(etal-it|etal-rm)> cite.name.font
+%<lab&!and-rm> "others" 't :=
+ }
+ { #2 <
+ 'skip$
+ { s #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" =
+ {
+% %<lab&!and-rm&(etal-it|etal-rm)> cite.name.font
+%<*!etal-it>
+%<lab&and-rm&!etal-rm> " " * bbl.etal cite.name.font *
+%<!lab|!and-rm|etal-rm> " " * bbl.etal *
+%</!etal-it>
+%<etal-it> " " * bbl.etal emphasize *
+%<lab&!and-rm&!(etal-it|etal-rm)> cite.name.font
+%<lab&!and-rm> "others" 't :=
+ }
+%<*!harnm>
+%<*!amper>
+ { bbl.and space.word * s #2 "{vv~}{ll}" format.name$
+%<lab&and-rm> cite.name.font
+ * }
+%</!amper>
+%<*amper>
+ { " \& " * s #2 "{vv~}{ll}" format.name$
+%<lab&and-rm> cite.name.font
+ * }
+%</amper>
+%</!harnm>
+%<*harnm>
+ { " \harvardand{} " * s #2 "{vv~}{ll}" format.name$
+%<lab&and-rm> cite.name.font
+ * }
+%</harnm>
+ if$
+ }
+ if$
+ }
+ if$
+%<*lab&!and-rm>
+ t "others" =
+ 'skip$
+ { cite.name.font }
+ if$
+%</lab&!and-rm>
+}
+
+%</ay&!mcite>
+% \end{macrocode}
+%
+% The code for formating author--year citations with more than one author
+% before \emph{et al.} or selecting a number other than two for truncating,
+% is much the same as the \texttt{format.full.names} function.
+% \begin{macrocode}
+%<*ay&mcite>
+FUNCTION {format.lab.names}
+{'s :=
+ "" 't :=
+ #1 'nameptr :=
+ s num.names$ 'numnames :=
+ numnames 'namesleft :=
+ { namesleft #0 > }
+ { s nameptr
+%<!jnrlab> "{vv~}{ll}" format.name$
+%<*jnrlab>
+%<!nm-rv&!nm-rvv&!nm-rvx&!nm-rvcx> "{vv~}{ll}{, jj}" format.name$
+%<nm-rv|nm-rvv|nm-rvx|nm-rvcx> "{vv~}{ll}{ jj}" format.name$
+%</jnrlab>
+%<lab&and-rm> cite.name.font
+ 't :=
+ nameptr #1 >
+ {
+%<mct-1> nameptr #2 =
+%<mct-2> nameptr #3 =
+%<mct-3> nameptr #4 =
+%<mct-4> nameptr #5 =
+%<mct-5> nameptr #6 =
+%<mct-6> nameptr #7 =
+%<mct-x2> numnames #2 > and
+%<mct-x3> numnames #3 > and
+%<mct-x4> numnames #4 > and
+%<mct-x5> numnames #5 > and
+%<mct-x6> numnames #6 > and
+ { "others" 't :=
+ #1 'namesleft := }
+ 'skip$
+ if$
+ namesleft #1 >
+ { ", " * t * }
+ {
+ s nameptr "{ll}" format.name$ duplicate$ "others" =
+ { 't := }
+ { pop$ }
+ if$
+ t "others" =
+ {
+%<lab&!and-rm&(etal-it|etal-rm)> cite.name.font
+%<*!etal-it>
+%<lab&and-rm&!etal-rm> " " * bbl.etal cite.name.font *
+%<!lab|!and-rm|etal-rm> " " * bbl.etal *
+%</!etal-it>
+%<etal-it> " " * bbl.etal emphasize *
+%<lab&!and-rm&!(etal-it|etal-rm)> cite.name.font
+ }
+ {
+%<*!harnm>
+%<*!and-xcom>
+ numnames #2 >
+ { "," * }
+ 'skip$
+ if$
+%</!and-xcom>
+%<!amper> bbl.and
+%<amper> "\&"
+%</!harnm>
+%<harnm> "\harvardand{}"
+ space.word * t *
+ }
+ if$
+ }
+ if$
+ }
+ 't
+ if$
+ nameptr #1 + 'nameptr :=
+ namesleft #1 - 'namesleft :=
+ }
+ while$
+%<*lab&!and-rm>
+ t "others" =
+ 'skip$
+ { cite.name.font }
+ if$
+%</lab&!and-rm>
+}
+
+%</ay&mcite>
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{`author.key.label'}
+% \begin{macro}{`author.editor.key.label'}
+% \begin{macro}{`author.key.organization.label'}
+% \begin{macro}{`editor.key.organization.label'}
+% \begin{macro}{`editor.key.label'}
+% Have to be very careful with the options \texttt{ay}, \texttt{alph}, and
+% \texttt{seq-no} here. The first two are actually mutually exclusive, and
+% \texttt{ay} should dominate. The \texttt{seq-no} option only applies for
+% numerical (\texttt{!ay}) but not alphabetic (\texttt{alph}) selections.
+% This whole block of coding dealing with labels is only included for
+% author--year or alphabetic or ordered numerical.
+% That is, \texttt{ay} or \texttt{alph} or \texttt{!seq-no} is true.
+% \begin{macrocode}
+%<*ay|alph>
+FUNCTION {author.key.label}
+{ author empty$
+ { key empty$
+ { cite$ #1 #3 substring$ }
+%<ay> 'key
+%<!ay> { key #3 text.prefix$ }
+ if$
+ }
+ { author format.lab.names }
+ if$
+}
+
+FUNCTION {author.editor.key.label}
+{ author empty$
+ { editor empty$
+ { key empty$
+ { cite$ #1 #3 substring$ }
+%<ay> 'key
+%<!ay> { key #3 text.prefix$ }
+ if$
+ }
+ { editor format.lab.names }
+ if$
+ }
+ { author format.lab.names }
+ if$
+}
+
+%</ay|alph>
+%<*!ay&alph>
+FUNCTION {author.key.organization.label}
+{ author empty$
+ { key empty$
+ { organization empty$
+ { cite$ #1 #3 substring$ }
+ { "The " #4 organization chop.word #3 text.prefix$ }
+ if$
+ }
+ { key #3 text.prefix$ }
+ if$
+ }
+ { author format.lab.names }
+ if$
+}
+
+FUNCTION {editor.key.organization.label}
+{ editor empty$
+ { key empty$
+ { organization empty$
+ { cite$ #1 #3 substring$ }
+ { "The " #4 organization chop.word #3 text.prefix$ }
+ if$
+ }
+ { key #3 text.prefix$ }
+ if$
+ }
+ { editor format.lab.names }
+ if$
+}
+
+%</!ay&alph>
+%<*ay>
+FUNCTION {editor.key.label}
+{ editor empty$
+ { key empty$
+ { cite$ #1 #3 substring$ }
+ 'key
+ if$
+ }
+ { editor format.lab.names }
+ if$
+}
+
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{`calc.short.authors'}
+% \begin{macrocode}
+FUNCTION {calc.short.authors}
+{ type$ "book" =
+ type$ "inbook" =
+ or
+ 'author.editor.key.label
+ { type$ "proceedings" =
+ 'editor.key.label
+ 'author.key.label
+ if$
+ }
+ if$
+ 'short.list :=
+}
+
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{`calc.label'}
+% \begin{macrocode}
+FUNCTION {calc.label}
+{ calc.short.authors
+ short.list
+%<!(har|ast|cay|nmd|alk|cn)> "("
+%<har|ast|cay|nmd|alk|cn> ", "
+ *
+ year duplicate$ empty$
+%<keyxyr> short.list key field.or.null = or
+%<(blkyear|keyxyr)> { pop$ "" }
+%<!(blkyear|keyxyr)> { pop$ "????" }
+%<!note-yr> { purify$ #-1 #4 substring$ }
+%<note-yr> 'skip$
+ if$
+ *
+ 'label :=
+}
+
+%</ay>
+%<*!ay&alph>
+FUNCTION {calc.label}
+{ type$ "book" =
+ type$ "inbook" =
+ or
+ 'author.editor.key.label
+ { type$ "proceedings" =
+ 'editor.key.organization.label
+ { type$ "manual" =
+ 'author.key.organization.label
+ 'author.key.label
+ if$
+ }
+ if$
+ }
+ if$
+ duplicate$
+ year field.or.null purify$ #-1 #2 substring$
+ *
+ 'label :=
+ year field.or.null purify$ #-1 #4 substring$
+ *
+ sortify 'sort.label :=
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+%</!ay&alph>
+% \end{macrocode}
+%
+% \begin{macrocode}
+%<*ay>
+% \end{macrocode}
+%
+% \begin{macrocode}
+%<*har|cay|nmd|ast|cn>
+% \end{macrocode}
+%
+% \begin{macro}{`calc.short.label'}
+% \begin{macrocode}
+FUNCTION {calc.short.label}
+{ calc.short.authors short.list
+ 'label :=
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+%</har|cay|nmd|ast|cn>
+% \end{macrocode}
+%
+% \begin{macrocode}
+%</ay>
+% \end{macrocode}
+%
+% \begin{macro}{`sort.format.names'}
+% \begin{macrocode}
+FUNCTION {sort.format.names}
+{ 's :=
+ #1 'nameptr :=
+ ""
+ s num.names$ 'numnames :=
+ numnames 'namesleft :=
+ { namesleft #0 > }
+ { s nameptr
+%<*xintls>
+%<!vonx> "{vv{ } }{ll{ }}"
+%<vonx> "{ll{ }}"
+%</xintls>
+%<*!xintls>
+%<*!nm-init&!nm-rev&!nm-rev1&!nm-rv&!nm-rvx&!nm-rvcx&!nm-rvv&!nm-rvvc>
+%<!vonx> "{vv{ } }{ll{ }}{ ff{ }}{ jj{ }}"
+%<vonx> "{ll{ }}{ ff{ }}{ jj{ }}"
+%</!nm-init&!nm-rev&!nm-rev1&!nm-rv&!nm-rvx&!nm-rvcx&!nm-rvv&!nm-rvvc>
+%<*nm-init|nm-rev|nm-rev1|nm-rv|nm-rvx|nm-rvcx|nm-rvv|nm-rvvc>
+%<!vonx> "{vv{ } }{ll{ }}{ f{ }}{ jj{ }}"
+%<vonx> "{ll{ }}{ f{ }}{ jj{ }}"
+%</nm-init|nm-rev|nm-rev1|nm-rv|nm-rvx|nm-rvcx|nm-rvv|nm-rvvc>
+%</!xintls>
+ format.name$ 't :=
+ nameptr #1 >
+ {
+%<*nmlm>
+%<m1> nameptr #1
+%<m2> nameptr #2
+%<m3> nameptr #3
+%<m4> nameptr #4
+%<m5> nameptr #5
+%<m6> nameptr #6
+%<m7> nameptr #7
+%<m8> nameptr #8
+%<m9> nameptr #9
+%<m0> nameptr #0
+%<m10> #10 +
+%<m20> #20 +
+%<m30> #30 +
+%<m40> #40 +
+%<m50> #50 +
+%<m60> #60 +
+%<m70> #70 +
+%<m80> #80 +
+%<m90> #90 +
+ #1 + =
+%<x1> numnames #1
+%<x2> numnames #2
+%<x3> numnames #3
+%<x4> numnames #4
+%<x5> numnames #5
+%<x6> numnames #6
+%<x7> numnames #7
+%<x8> numnames #8
+%<x9> numnames #9
+%<x0> numnames #0
+%<x10> #10 +
+%<x20> #20 +
+%<x30> #30 +
+%<x40> #40 +
+%<x50> #50 +
+%<x60> #60 +
+%<x70> #70 +
+%<x80> #80 +
+%<x90> #90 +
+ > and
+ { "others" 't :=
+ #1 'namesleft := }
+ 'skip$
+ if$
+%</nmlm>
+ " " *
+ namesleft #1 = t "others" = and
+ { "zzzzz" 't := }
+ 'skip$
+ if$
+%<*seq-lab|seq-key|seq-labc>
+ numnames #2 > nameptr #2 = and
+ { "zz" * year field.or.null * " " *
+%<seq-labc> #1 'namesleft :=
+ }
+%<seq-labc> { t sortify * }
+%<!seq-labc> 'skip$
+ if$
+%</seq-lab|seq-key|seq-labc>
+%<!seq-labc> t sortify *
+ }
+ { t sortify * }
+ if$
+ nameptr #1 + 'nameptr :=
+ namesleft #1 - 'namesleft :=
+ }
+ while$
+}
+
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{`sort.format.title'}
+% \begin{macrocode}
+FUNCTION {sort.format.title}
+{ 't :=
+ "A " #2
+ "An " #3
+ "The " #4 t chop.word
+ chop.word
+ chop.word
+ sortify
+ #1 global.max$ substring$
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{`author.sort'}
+% \begin{macrocode}
+FUNCTION {author.sort}
+{ author empty$
+ { key empty$
+ { "to sort, need author or key in " cite$ * warning$
+ ""
+ }
+ { key sortify }
+ if$
+ }
+ { author sort.format.names }
+ if$
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{`author.editor.sort'}
+% \begin{macrocode}
+FUNCTION {author.editor.sort}
+{ author empty$
+ { editor empty$
+ { key empty$
+ { "to sort, need author, editor, or key in " cite$ * warning$
+ ""
+ }
+ { key sortify }
+ if$
+ }
+ { editor sort.format.names }
+ if$
+ }
+ { author sort.format.names }
+ if$
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{`negate.year'}
+% This function negates the year by substituting each digit by its
+% complement. That is, 0 $\rightarrow$ 9, 1 $\rightarrow$ 8, etc. This is used
+% to provide ordering by descending year (latest year first).
+% \begin{macrocode}
+%<*seq-yrr&!seq-yr>
+FUNCTION {negate.year}
+{ year empty$
+ { "99999" }
+ { year #1 #1 substring$ chr.to.int$ #105 swap$ - int.to.chr$
+ year #2 #1 substring$ chr.to.int$ #105 swap$ - int.to.chr$ *
+ year #3 #1 substring$ chr.to.int$ #105 swap$ - int.to.chr$ *
+ year #4 #1 substring$ chr.to.int$ #105 swap$ - int.to.chr$ *
+ }
+ if$
+}
+%</seq-yrr&!seq-yr>
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+%<*ay>
+% \end{macrocode}
+%
+% \begin{macro}{`editor.sort'}
+% \begin{macrocode}
+FUNCTION {editor.sort}
+{ editor empty$
+ { key empty$
+ { "to sort, need editor or key in " cite$ * warning$
+ ""
+ }
+ { key sortify }
+ if$
+ }
+ { editor sort.format.names }
+ if$
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+%<*seq-no>
+% \end{macrocode}
+%
+% \begin{macrocode}
+INTEGERS { seq.num }
+% \end{macrocode}
+%
+% \begin{macro}{`init.seq'}
+% \begin{macrocode}
+FUNCTION {init.seq}
+{ #0 'seq.num :=}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+EXECUTE {init.seq}
+% \end{macrocode}
+%
+% \begin{macro}{`int.to.fix'}
+% \begin{macrocode}
+FUNCTION {int.to.fix}
+{ "000000000" swap$ int.to.str$ *
+ #-1 #10 substring$
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+%</seq-no>
+% \end{macrocode}
+%
+% \begin{macro}{`presort'}
+% For unsorted author--year, make up the final sorting order in
+% \texttt{sort.label} with the original sequence number, for unsorting later.
+% \begin{macrocode}
+FUNCTION {presort}
+{ calc.label
+ label sortify
+ " "
+ *
+%<*!seq-no>
+ type$ "book" =
+ type$ "inbook" =
+ or
+ 'author.editor.sort
+ { type$ "proceedings" =
+ 'editor.sort
+ 'author.sort
+ if$
+ }
+ if$
+ #1 entry.max$ substring$
+%</!seq-no>
+%<*seq-no>
+ seq.num #1 + 'seq.num :=
+ seq.num int.to.fix
+%</seq-no>
+ 'sort.label :=
+ sort.label
+ *
+%<seq-yr> " " * year field.or.null *
+%<seq-yrr&!seq-yr> " " * negate.year field.or.null *
+%<*!seq-key&!seq-labc&!seq-yr&!seq-yrr>
+ " "
+ *
+ title field.or.null
+ sort.format.title
+ *
+%</!seq-key&!seq-labc&!seq-yr&!seq-yrr>
+%<seq-key|seq-yr|seq-yrr> " " * cite$ *
+ #1 entry.max$ substring$
+ 'sort.key$ :=
+% "For " cite$ * ", sort.key=" * sort.key$ * warning$
+}
+
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+%</ay>
+% \end{macrocode}
+%
+% \begin{macrocode}
+%<*!ay>
+% \end{macrocode}
+%
+% \begin{macro}{`author.organization.sort'}
+% \begin{macrocode}
+FUNCTION {author.organization.sort}
+{ author empty$
+ { organization empty$
+ { key empty$
+ { "to sort, need author, organization, or key in " cite$ * warning$
+ ""
+ }
+ { key sortify }
+ if$
+ }
+ { "The " #4 organization chop.word sortify }
+ if$
+ }
+ { author sort.format.names }
+ if$
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{`editor.organization.sort'}
+% \begin{macrocode}
+FUNCTION {editor.organization.sort}
+{ editor empty$
+ { organization empty$
+ { key empty$
+ { "to sort, need editor, organization, or key in " cite$ * warning$
+ ""
+ }
+ { key sortify }
+ if$
+ }
+ { "The " #4 organization chop.word sortify }
+ if$
+ }
+ { editor sort.format.names }
+ if$
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{`presort'}
+% \begin{macrocode}
+FUNCTION {presort}
+%<*alph>
+{ calc.label
+ sort.label
+ " "
+ *
+ type$ "book" =
+%</alph>
+%<!alph>{ type$ "book" =
+ type$ "inbook" =
+ or
+ 'author.editor.sort
+ { type$ "proceedings" =
+ 'editor.organization.sort
+ { type$ "manual" =
+ 'author.organization.sort
+ 'author.sort
+ if$
+ }
+ if$
+ }
+ if$
+%<alph> *
+ " "
+ *
+%<seq-yrr> negate.year field.or.null sortify
+%<!seq-yrr> year field.or.null sortify
+%<!(seq-yr|seq-yrr)|alph> *
+ " "
+ *
+%<(seq-yr|seq-yrr)&!alph> swap$ *
+ title field.or.null
+ sort.format.title
+ *
+ #1 entry.max$ substring$
+ 'sort.key$ :=
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+%</!ay>
+% \end{macrocode}
+%
+% \begin{macrocode}
+ITERATE {presort}
+% \end{macrocode}
+%
+% \begin{macrocode}
+SORT
+% \end{macrocode}
+%
+% \begin{macrocode}
+%</ay|alph|!seq-no>
+% \end{macrocode}
+%
+% With version~6.0 of \texttt{natbib}, the author-year styles can also be
+% used for numerical citations; then the \texttt{thebibliography} environment
+% must have an argument indicating the length of the longest label.
+% Simply count the references and add this number as the argument.
+% \begin{macrocode}
+%<*ay>
+% \end{macrocode}
+%
+% \begin{macrocode}
+STRINGS { last.label next.extra }
+% \end{macrocode}
+%
+% With computer-generated articles, it is possible to have more than 26 articles
+% in one year. It has finally occurred that the extra labels go beyond `z'.
+% The current code now allows for `aa', \dots `az', 'ba', \dots `zz'. This
+% code was provided by Joseph Wright (2007 Oct 10).
+% \begin{macrocode}
+INTEGERS { last.extra.num last.extra.num.extended last.extra.num.blank number.label }
+% \end{macrocode}
+%
+% \begin{macro}{`initialize.extra.label.stuff'}
+% \begin{macrocode}
+FUNCTION {initialize.extra.label.stuff}
+{ #0 int.to.chr$ 'last.label :=
+ "" 'next.extra :=
+ #0 'last.extra.num :=
+ "a" chr.to.int$ #1 - 'last.extra.num.blank :=
+ last.extra.num.blank 'last.extra.num.extended :=
+ #0 'number.label :=
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{`forward.pass'}
+% \begin{macrocode}
+FUNCTION {forward.pass}
+{ last.label label =
+ { last.extra.num #1 + 'last.extra.num :=
+ last.extra.num "z" chr.to.int$ >
+ { "a" chr.to.int$ 'last.extra.num :=
+ last.extra.num.extended #1 + 'last.extra.num.extended :=
+ }
+ 'skip$
+ if$
+ last.extra.num.extended last.extra.num.blank >
+ { last.extra.num.extended int.to.chr$
+ last.extra.num int.to.chr$
+ * 'extra.label := }
+ { last.extra.num int.to.chr$ 'extra.label := }
+ if$
+ }
+ { "a" chr.to.int$ 'last.extra.num :=
+ "" 'extra.label :=
+ label 'last.label :=
+ }
+ if$
+ number.label #1 + 'number.label :=
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+%</ay>
+% \end{macrocode}
+%
+% \begin{macrocode}
+%<*!ay&alph>
+% \end{macrocode}
+%
+% \begin{macrocode}
+STRINGS { longest.label last.sort.label next.extra }
+% \end{macrocode}
+%
+% \begin{macrocode}
+INTEGERS { longest.label.width last.extra.num }
+% \end{macrocode}
+%
+% \begin{macro}{`initialize.longest.label'}
+% \begin{macrocode}
+FUNCTION {initialize.longest.label}
+{ "" 'longest.label :=
+ #0 int.to.chr$ 'last.sort.label :=
+ "" 'next.extra :=
+ #0 'longest.label.width :=
+ #0 'last.extra.num :=
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{`forward.pass'}
+% \begin{macrocode}
+FUNCTION {forward.pass}
+{ last.sort.label sort.label =
+ { last.extra.num #1 + 'last.extra.num :=
+ last.extra.num int.to.chr$ 'extra.label :=
+ }
+ { "a" chr.to.int$ 'last.extra.num :=
+ "" 'extra.label :=
+ sort.label 'last.sort.label :=
+ }
+ if$
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+%</!ay&alph>
+% \end{macrocode}
+%
+% \begin{macro}{`reverse.pass'}
+% The extra label is added in braces so that natbib can treat it as one unit.
+% This allows extra labels to be more than one letter long. For non-NFSS
+% emphasizing, this is no problem, since labels go in |{\em a}|, but for
+% non-emphasizing and for NFSS, it caused troubles without the braces.
+% The trouble arises with multiple citations in one |\cite| in which
+% authors and years are the same, and only the extra label is given for
+% the next one. Note: |\emph{a}| is more than one letter long in this sense,
+% so it is not just a problem for more than 26 papers with same authors and
+% year.
+%
+% The command |\natexlab| now encloses the extra label for \texttt{natbib}
+% styles. This command normally just prints its argument, but for numerical
+% citation mode, it swallows its argument. This allows the extra labels to
+% be suppressed for numerical citations where they are superfluous.
+% The enclosing braces mentioned above must be included here to make the
+% entire extra label text a single token for \texttt{natbib}.
+% \begin{macrocode}
+%<*ay>
+% \end{macrocode}
+%
+% \begin{macrocode}
+FUNCTION {reverse.pass}
+{ next.extra "b" =
+ { "a" 'extra.label := }
+ 'skip$
+ if$
+ extra.label 'next.extra :=
+ extra.label
+%<xlab-it> emphasize
+%<*!html>
+ duplicate$ empty$
+ 'skip$
+ { "{\natexlab{" swap$ * "}}" * }
+ if$
+%</!html>
+ 'extra.label :=
+%<!(har|ast|cay|nmd|cn)> label extra.label * 'label :=
+}
+% \end{macrocode}
+%
+% \begin{macrocode}
+%</ay>
+% \end{macrocode}
+%
+% \begin{macrocode}
+%<*!ay&alph>
+% \end{macrocode}
+%
+% \begin{macrocode}
+FUNCTION {reverse.pass}
+{ next.extra "b" =
+ { "a" 'extra.label := }
+ 'skip$
+ if$
+ label extra.label * 'label :=
+ label width$ longest.label.width >
+ { label 'longest.label :=
+ label width$ 'longest.label.width :=
+ }
+ 'skip$
+ if$
+ extra.label 'next.extra :=
+}
+% \end{macrocode}
+%
+% \begin{macrocode}
+%</!ay&alph>
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+%<ay>EXECUTE {initialize.extra.label.stuff}
+%<!ay&alph>EXECUTE {initialize.longest.label}
+% \end{macrocode}
+%
+% \begin{macrocode}
+%<*ay|alph>
+ITERATE {forward.pass}
+% \end{macrocode}
+%
+% \begin{macrocode}
+REVERSE {reverse.pass}
+% \end{macrocode}
+%
+% \begin{macrocode}
+%</ay|alph>
+% \end{macrocode}
+%
+% \begin{macrocode}
+%<*ay>
+FUNCTION {bib.sort.order}
+{ sort.label
+ " "
+ *
+%<seq-yrr> negate.year field.or.null sortify
+%<!seq-yrr> year field.or.null sortify
+%<(seq-yr|seq-yrr)&!(seq-lab|seq-key|seq-labc)> swap$
+ *
+%<*!seq-key&!seq-labc&!seq-yr&!seq-yrr>
+ " "
+ *
+ title field.or.null
+ sort.format.title
+ *
+%</!seq-key&!seq-labc&!seq-yr&!seq-yrr>
+%<seq-key|seq-yr|seq-yrr> " " * cite$ *
+ #1 entry.max$ substring$
+ 'sort.key$ :=
+% "For " cite$ * ", bib.sort.key=" * sort.key$ * warning$
+%<har|cay|nmd|cn|ast> calc.short.label
+}
+% \end{macrocode}
+%
+% \begin{macrocode}
+ITERATE {bib.sort.order}
+% \end{macrocode}
+%
+% \begin{macrocode}
+SORT
+% \end{macrocode}
+%
+% \begin{macrocode}
+%</ay>
+% \end{macrocode}
+%
+% \begin{macrocode}
+%<*!ay&!alph>
+% \end{macrocode}
+%
+% \begin{macrocode}
+STRINGS { longest.label }
+% \end{macrocode}
+%
+% \begin{macrocode}
+INTEGERS { number.label longest.label.width }
+% \end{macrocode}
+%
+% \begin{macrocode}
+FUNCTION {initialize.longest.label}
+{ "" 'longest.label :=
+ #1 'number.label :=
+ #0 'longest.label.width :=
+}
+% \end{macrocode}
+%
+% \begin{macrocode}
+FUNCTION {longest.label.pass}
+%<*!cite>
+{ number.label int.to.str$ 'label :=
+ number.label #1 + 'number.label :=
+%</!cite>
+%<cite>{ cite$ 'label :=
+ label width$ longest.label.width >
+ { label 'longest.label :=
+ label width$ 'longest.label.width :=
+ }
+ 'skip$
+ if$
+}
+% \end{macrocode}
+%
+% \begin{macrocode}
+EXECUTE {initialize.longest.label}
+% \end{macrocode}
+%
+% \begin{macrocode}
+ITERATE {longest.label.pass}
+% \end{macrocode}
+%
+% \begin{macrocode}
+%</!ay&!alph>
+% \end{macrocode}
+%
+% \begin{macro}{`begin.bib'}
+% The function \texttt{begin.bib} writes the initial text to the \texttt{.bbl}
+% file. The most important matter here is that the \texttt{thebibliography}
+% environment is invoked.
+%
+% Note: the French quotation marks are called `guillimets'; Adobe erroneously
+% named the symbols `guillimot', which is an arctic bird. The error has so
+% propagated, that it can no longer be corrected. \LaTeX\ took it over.
+% \begin{macrocode}
+FUNCTION {begin.bib}
+%<*!html>
+%<*!ay&alph>
+{ et.al.char.used
+ { "\newcommand{\etalchar}[1]{$^{#1}$}" write$ newline$ }
+ 'skip$
+ if$
+ preamble$ empty$
+%</!ay&alph>
+%<ay|!alph>{ preamble$ empty$
+ 'skip$
+ { preamble$ write$ newline$ }
+ if$
+%<ay> "\begin{thebibliography}{" number.label int.to.str$ * "}" *
+%<!ay> "\begin{thebibliography}{" longest.label * "}" *
+ write$ newline$
+%<*(!nmft&(nmft-it|nmft-sc|nmft-bf|nmft-def))|(!lab&(lab-it|lab-bf|lab-sc|lab-def))>
+ "\typeout{**********************************}" write$ newline$
+ "\typeout{WARNING WARNING WARNING WARNING WARNING}" write$ newline$
+ "\typeout{The bst file has been generated with inconsistent options}"
+ write$ newline$
+ "\typeout{Read the warning message at the start of the bst file}"
+ write$ newline$
+ "\typeout{**********************************}" write$ newline$
+%</(!nmft&(nmft-it|nmft-sc|nmft-bf|nmft-def))|(!lab&(lab-it|lab-bf|lab-sc|lab-def))>
+%<*!plntx>
+%<!tit-it&tit-qq&qt-s> "\newcommand{\enquote}[1]{`#1'}"
+%<!tit-it&tit-qq&!qt-s&!qt-g> "\newcommand{\enquote}[1]{``#1''}"
+%</!plntx>
+%<*plntx>
+%<!tit-it&tit-qq&qt-s> "\def\enquote#1{`#1'}"
+%<!tit-it&tit-qq&!qt-s&!qt-g> "\def\enquote#1{``#1''}"
+%</plntx>
+%<*!tit-it&tit-qq&!qt-s&qt-g>
+%<!plntx> "\let\enquote\frquote"
+%<*plntx>
+ "\def\guillemotleft{%"
+ write$ newline$
+ " \leavevmode\raise .27ex\hbox{$\scriptscriptstyle\ll$}}"
+ write$ newline$
+ "\def\guillemotright{%"
+ write$ newline$
+ " \leavevmode\raise .27ex\hbox{$\scriptscriptstyle\gg$}}"
+ write$ newline$
+ "\def\enquote#1{\guillemotleft#1\guillemotright}"
+%</plntx>
+%</!tit-it&tit-qq&!qt-s&qt-g>
+%<!tit-it&tit-qq> write$ newline$
+%<umlaut> "\let\qq=\" quote$ * write$ newline$
+%<em-ul> "\expandafter\ifx\csname uline\endcsname\relax\let\uline\underline\fi"
+%<em-ul> write$ newline$
+%<*ay>
+%<!plntx> "\providecommand{\natexlab}[1]{#1}"
+%<plntx> "\expandafter\ifx\csname natexlab\endcsname\relax\def\natexlab#1{#1}\fi"
+ write$ newline$
+%<*har>
+ "{\catcode`\|=0\catcode`\#=12\catcode`\@=11\catcode`\\=12" write$ newline$
+ "|immediate|write|@auxout{\expandafter\ifx\csname natexlab\endcsname\relax\gdef\natexlab#1{#1}\fi}}"
+ write$ newline$
+%</har>
+%</ay>
+%<*nmft&nmft-def>
+%<!plntx> "\providecommand{\bibnamefont}[1]{#1}"
+%<plntx> "\expandafter\ifx\csname bibnamefont\endcsname\relax"
+%<plntx> write$ newline$
+%<plntx> " \def\bibnamefont#1{#1}\fi"
+ write$ newline$
+%</nmft&nmft-def>
+%<*nmft&fnm-def>
+%<!plntx> "\providecommand{\bibfnamefont}[1]{#1}"
+%<plntx> "\expandafter\ifx\csname bibfnamefont\endcsname\relax"
+%<plntx> write$ newline$
+%<plntx> " \def\bibfnamefont#1{#1}\fi"
+ write$ newline$
+%</nmft&fnm-def>
+%<*lab&lab-def>
+%<!plntx> "\providecommand{\citenamefont}[1]{#1}"
+%<plntx> "\expandafter\ifx\csname citenamefont\endcsname\relax"
+%<plntx> write$ newline$
+%<plntx> " \def\citenamefont#1{#1}\fi"
+ write$ newline$
+%</lab&lab-def>
+%<*(url&!harnm)|eprint>
+%<*!plntx>
+%<nfss> "\providecommand{\url}[1]{\texttt{#1}}"
+%<!nfss> "\providecommand{\url}[1]{{\tt #1}}"
+ write$ newline$
+ "\providecommand{\urlprefix}{}"
+ write$ newline$
+%</!plntx>
+%<*plntx>
+ "\expandafter\ifx\csname url\endcsname\relax"
+ write$ newline$
+%<nfss> " \def\url#1{\texttt{#1}}\fi"
+%<!nfss> " \def\url#1{{\tt #1}}\fi"
+ write$ newline$
+ "\expandafter\ifx\csname urlprefix\endcsname\relax\def\urlprefix{}\fi"
+ write$ newline$
+%</plntx>
+%</(url&!harnm)|eprint>
+%<*doi>
+ "\expandafter\ifx\csname urlstyle\endcsname\relax"
+ write$ newline$
+%<*!plntx>
+ " \providecommand{\doi}[1]{doi:\discretionary{}{}{}#1}\else"
+ write$ newline$
+ " \providecommand{\doi}{doi:\discretionary{}{}{}\begingroup \urlstyle{rm}\Url}\fi"
+ write$ newline$
+%</!plntx>
+%<*plntx>
+ " \expandafter\ifx\csname doi\endcsname\relax"
+ write$ newline$
+ " \def\doi#1{doi:\discretionary{}{}{}#1}\fi \else"
+ write$ newline$
+ " \expandafter\ifx\csname doi\endcsname\relax"
+ write$ newline$
+ " \def\doi{doi:\discretionary{}{}{}\begingroup \urlstyle{rm}\Url}\fi \fi"
+ write$ newline$
+%</plntx>
+%</doi>
+%<*url-doi&url>
+ "\providecommand{\doiprefix}{doi: }"
+ write$ newline$
+ "\expandafter\ifx\csname href\endcsname\relax"
+ write$ newline$
+ " \providecommand{\urldoi}[1]{#1}\else"
+ write$ newline$
+ " \providecommand{\urldoi}[1]{\href{https://doi.org/#1}{#1}}\fi"
+ write$ newline$
+%</url-doi&url>
+%<*lang>
+%<!plntx> "\providecommand{\selectlanguage}[1]{\relax}"
+%<*plntx>
+ "\expandafter\ifx\csname selectlanguage\endcsname\relax"
+ write$ newline$
+ " \def\selectlanguage#1{}\fi"
+%</plntx>
+ write$ newline$
+%</lang>
+%<*!plntx>
+%<*babel>
+ "\input{babelbst.tex}" write$ newline$
+ "\newcommand{\Capitalize}[1]{\uppercase{#1}}" write$ newline$
+ "\newcommand{\capitalize}[1]{\expandafter\Capitalize#1}" write$ newline$
+%</babel>
+%<*annote>
+ "\providecommand{\bibAnnoteFile}[1]{%"
+ write$ newline$
+ " \IfFileExists{#1}{\begin{quotation}\noindent\textsc{Key:} #1\\"
+ write$ newline$
+ " \textsc{Annotation:}\ \input{#1}\end{quotation}}{}}"
+ write$ newline$
+ "\providecommand{\bibAnnote}[2]{%"
+ write$ newline$
+ " \begin{quotation}\noindent\textsc{Key:} #1\\"
+ write$ newline$
+ " \textsc{Annotation:}\ #2\end{quotation}}"
+ write$ newline$
+%</annote>
+%</!plntx>
+%<*bibinfo>
+%<!plntx> "\providecommand{\bibinfo}[2]{#2}"
+%<plntx> "\expandafter\ifx\csname bibinfo\endcsname\relax\def\bibinfo#1#2{#2}\fi"
+ write$ newline$
+%</bibinfo>
+%<*eprint>
+%<!plntx> "\providecommand{\eprint}[2][]{\url{#2}}"
+%<plntx> "\expandafter\ifx\csname eprint\endcsname\relax\def\eprint#1{\url{#1}}\fi"
+ write$ newline$
+%</eprint>
+}
+%</!html>
+%<*html>
+{
+"<html><head><title>Bibliography Listing</title></head>" write$ newline$
+"<body>" write$ newline$
+"<h2>Bibliography</h2>" write$ newline$
+%<htdes>"<dl>" write$ newline$
+%<!htdes&htlist>"<ol>" write$ newline$
+}
+%</html>
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+EXECUTE {begin.bib}
+% \end{macrocode}
+%
+% \begin{macrocode}
+EXECUTE {init.state.consts}
+% \end{macrocode}
+%
+% \begin{macrocode}
+ITERATE {call.type$}
+% \end{macrocode}
+%
+% \begin{macro}{`end.bib'}
+% \begin{macrocode}
+FUNCTION {end.bib}
+{ newline$
+%<!html> "\end{thebibliography}" write$ newline$
+%<html> "</dl></body></html>" write$ newline$
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+EXECUTE {end.bib}
+% \end{macrocode}
+%
+% \begin{macrocode}
+%</!head>
+% \end{macrocode}
+%
+% \begin{macrocode}
+%</!options&!driver&!bblbst>
+% \end{macrocode}
+%
+% \section{The File \texttt{babelbst.tex} for English}
+% The following contains the definitions for the \texttt{babel} language
+% selection as they apply to English. This file may be extracted with
+% \dtx{} and the option \texttt{bblbst}.
+% \begin{macrocode}
+%<*bblbst>
+ % This is babelbst.tex for English.
+ % It should serve as a model for other languages.
+ % Alternatively, store it under a different name (e.g. englbst.tex)
+ % and then \input it with a command in babelbst.tex.
+\def\bbland{and} \def\bbletal{et~al.}
+\def\bbleditors{editors} \def\bbleds{eds.}
+\def\bbleditor{editor} \def\bbled{ed.}
+\def\bbledby{edited by}
+\def\bbledition{edition} \def\bbledn{edn.}
+\def\bblvolume{volume} \def\bblvol{vol.}
+\def\bblof{of}
+\def\bblnumber{number} \def\bblno{no.}
+\def\bblin{in}
+\def\bblpages{pages} \def\bblpp{pp.}
+\def\bblpage{page} \def\bblp{p.}
+\def\bbleidpp{pages}
+\def\bblchapter{chapter} \def\bblchap{chap.}
+\def\bbltechreport{Technical Report}
+\def\bbltechrep{Tech. Rep.}
+\def\bblmthesis{Master's thesis}
+\def\bblphdthesis{Ph.D. thesis}
+\def\bblfirst{First} \def\bblfirsto{1st}
+\def\bblsecond{Second} \def\bblsecondo{2nd}
+\def\bblthird{Third} \def\bblthirdo{3rd}
+\def\bblfourth{Fourth} \def\bblfourtho{4th}
+\def\bblfifth{Fifth} \def\bblfiftho{5th}
+\def\bblst{st} \def\bblnd{nd} \def\bblrd{rd}
+\def\bblth{th}
+\def\bbljan{January} \def\bblfeb{February} \def\bblmar{March}
+\def\bblapr{April} \def\bblmay{May} \def\bbljun{June}
+\def\bbljul{July} \def\bblaug{August} \def\bblsep{September}
+\def\bbloct{October} \def\bblnov{November} \def\bbldec{December}
+%</bblbst>
+% \end{macrocode}
+%
+% \Finale
diff --git a/Master/texmf-dist/source/latex/colortbl/colortbl.dtx b/Master/texmf-dist/source/latex/colortbl/colortbl.dtx
index 076c69643a1..8e5f1e8be18 100644
--- a/Master/texmf-dist/source/latex/colortbl/colortbl.dtx
+++ b/Master/texmf-dist/source/latex/colortbl/colortbl.dtx
@@ -15,7 +15,7 @@
%<driver>\ProvidesFile{colortbl.drv}
% \fi
% \ProvidesFile{colortbl.dtx}
- [2024/05/26 v1.0h Color table columns (DPC)]
+ [2024/07/06 v1.0i Color table columns (DPC)]
%
% \iffalse
%<*driver>
@@ -1505,9 +1505,21 @@
%
%
% longtable support.
+% \changes{v1.0i}{2024/07/06}{tagging code adjusments for longtable hline}
+% \begin{macrocode}
+\ExplSyntaxOn
+% \end{macrocode}
+%
+% Stub tag support if tagging has not been enabled.
+% \begin{macrocode}
+\cs_if_exist:NF\tag_mc_begin:n{
+ \cs_new:Npn\tag_mc_begin:n#1{}
+ \cs_new:Npn\tag_mc_end:{}
+}
+% \end{macrocode}
+%
% \begin{macrocode}
\AtBeginDocument{
- \ifx\longtable\@undefined\else
\def\LT@@hline{%
\ifx\LT@next\hline
\global\let\LT@next\@gobble
@@ -1517,7 +1529,10 @@
\else
\gdef\CT@LT@sep{%
\multispan\LT@cols{%
- \CT@drsc@\leaders\hrule\@height\doublerulesep\hfill}\cr}%
+ \tag_mc_begin:n{artifact}
+ \CT@drsc@\leaders\hrule\@height\doublerulesep\hfill
+ \tag_mc_end: \int_gdecr:N \g__tbl_row_int
+ }\cr}%
\fi
\else
\global\let\LT@next\empty
@@ -1526,13 +1541,20 @@
\fi
\ifnum0=`{\fi}%
\multispan\LT@cols
- {\CT@arc@\leaders\hrule\@height\arrayrulewidth\hfill}\cr
+ {\tag_mc_begin:n{artifact}
+ \CT@arc@\leaders\hrule\@height\arrayrulewidth\hfill
+ \tag_mc_end: \int_gdecr:N \g__tbl_row_int
+ }\cr
\CT@LT@sep
\multispan\LT@cols
- {\CT@arc@\leaders\hrule\@height\arrayrulewidth\hfill}\cr
+ {\tag_mc_begin:n{artifact}
+ \CT@arc@\leaders\hrule\@height\arrayrulewidth\hfill
+ \tag_mc_end: \int_gdecr:N \g__tbl_row_int
+ }\cr
\noalign{\penalty\@M}%
\LT@next}
- \fi}
+ }
+\ExplSyntaxOff
% \end{macrocode}
%
%
diff --git a/Master/texmf-dist/source/latex/dccpaper/dccpaper.dtx b/Master/texmf-dist/source/latex/dccpaper/dccpaper.dtx
index de8e3b88cc4..7218660813c 100644
--- a/Master/texmf-dist/source/latex/dccpaper/dccpaper.dtx
+++ b/Master/texmf-dist/source/latex/dccpaper/dccpaper.dtx
@@ -1,6 +1,6 @@
% \iffalse meta-comment
%<*internal|ijdc9|ijdc14|idcc|base>
-\def\Version{2023/08/11 v2.4}
+\def\Version{2024/08/23 v2.5}
%</internal|ijdc9|ijdc14|idcc|base>
%<*internal>
\iffalse
@@ -246,7 +246,7 @@ See: http://www.latex-project.org/lppl.txt
\endpreamble
\postamble
-Copyright (C) 2023 Digital Curation Centre, University of Edinburgh
+Copyright (C) 2024 Digital Curation Centre, University of Edinburgh
<info@dcc.ac.uk>
\endpostamble
@@ -546,16 +546,16 @@ Use this for a conference preprint.
\subsection{International Digital Curation Conference}
\begin{framed}\noindent
-To emulate a 2024 conference paper/extended abstract, use the \textsf{ijdc-v14}
-class with the \key{conference} option.
+To emulate a conference paper/extended abstract from 2024 onwards, use the
+\textsf{ijdc-v14} class with the \key{conference} option.
\end{framed}
The class is loaded in the usual way with
\lstinline|\documentclass[$\meta{options}$]{idcc}|.
Two types of option are available. The first relates to the conference to which the submission will be made:
\begin{description}[font=\normalfont]
- \item[\key{15}, \key{16}, .~.~.~, \key{22}, \key{24}]
- Use this to select the year of the conference, e.g.\@ \key{24} for 2024.
+ \item[\key{15}, \key{16}, .~.~.~, \key{24}, \key{25}]
+ Use this to select the year of the conference, e.g.\@ \key{25} for 2025.
\end{description}
The second relates to the type of submission:
@@ -871,6 +871,8 @@ Any acknowledgements should be placed in a section immediately before the refere
\section{Appendix A: Change History}
\begin{description}
+\item[v2.5] 2024-08-23\\
+Added details of IDCC 2025.
\item[v2.4] 2023-08-11\\
Added details of and update documentation for IDCC 2024.
\item[v2.3] 2022-01-27\\
@@ -1097,7 +1099,7 @@ Fully funded, part funded (subsidised) or delegate fee.
%<readme>## Licence
%<readme>
%<*driver|readme>
-Copyright 2023 Digital Curation Centre, University of Edinburgh.
+Copyright 2024 Digital Curation Centre, University of Edinburgh.
This work consists of the image files dccpaper-by.eps and
dccpaper-by.pdf, the documented LaTeX file dccpaper.dtx and a Makefile.
@@ -1520,9 +1522,15 @@ the University of Edinburgh on behalf of the Digital Curation Centre. ISSN:
\DeclareOption{24}{%
\def\dccp@publ@short{IDCC}
\def\dccp@publ@msg{The 18th \dccp@publ@long\ takes place on 19--21 February
- 2024 in Edinburgh, Scotland.\par\bigskip URL: \url{https://www.dcc.ac.uk/events/18th-international-digital-curation-conference}}
+ 2024 in Edinburgh, Scotland.\par\bigskip URL: \url{https://www.dcc.ac.uk/events/idcc24}}
\def\dccp@subject{18th \dccp@publ@long, 2024}
}
+\DeclareOption{25}{%
+ \def\dccp@publ@short{IDCC25}
+ \def\dccp@publ@msg{The 19th \dccp@publ@long\ takes place on 17--19 February
+ 2025 in The Hague, Netherlands.\par\bigskip URL: \url{https://www.dcc.ac.uk/events/idcc25}}
+ \def\dccp@subject{19th \dccp@publ@long, 2025}
+}
\ProcessOptions\relax
% \end{macrocode}
diff --git a/Master/texmf-dist/source/latex/delimset/delimset.dtx b/Master/texmf-dist/source/latex/delimset/delimset.dtx
index 9bd070b5ea1..337f1a4271e 100644
--- a/Master/texmf-dist/source/latex/delimset/delimset.dtx
+++ b/Master/texmf-dist/source/latex/delimset/delimset.dtx
@@ -1,6 +1,6 @@
% \iffalse
%
-% delimset.dtx Copyright (C) 2016-2018 Niklas Beisert
+% delimset.dtx Copyright (C) 2016-2024 Niklas Beisert
%
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
@@ -18,15 +18,15 @@
% and the derived files delimset.sty and dlmssamp.tex
%
%<package|sample>\NeedsTeXFormat{LaTeX2e}[1996/12/01]
-%<package>\ProvidesPackage{delimset}[2018/12/30 v1.1 convenient size control for delimiter sets]
-%<sample>\ProvidesFile{dlmssamp.tex}[2018/12/30 v1.1 sample for delimset]
+%<package>\ProvidesPackage{delimset}[2024/07/17 v2.0 convenient size control for delimiter sets]
+%<sample>\ProvidesFile{dlmssamp.tex}[2024/07/17 v2.0 sample for delimset]
%<*driver>
-%\ProvidesFile{delimset.drv}[2018/12/30 v1.1 delimset Reference Manual file]
+%\ProvidesFile{delimset.drv}[2024/07/17 v2.0 delimset Reference Manual file]
\PassOptionsToClass{10pt,a4paper}{article}
\documentclass{ltxdoc}
\usepackage[margin=35mm]{geometry}
-\usepackage{hyperref}
+\usepackage[hyperindex=false]{hyperref}
\usepackage{hyperxmp}
\usepackage[usenames]{color}
\usepackage{amsmath,amsfonts}
@@ -36,7 +36,7 @@
\hypersetup{pdfpagemode=UseNone}
\hypersetup{pdfsource={}}
\hypersetup{pdflang={en-UK}}
-\hypersetup{pdfcopyright={Copyright 2016-2018 Niklas Beisert.
+\hypersetup{pdfcopyright={Copyright 2016-2024 Niklas Beisert.
This work may be distributed and/or modified under the
conditions of the LaTeX Project Public License, either version 1.3
of this license or (at your option) any later version.}}
@@ -50,6 +50,8 @@
\newcommand{\secref}[1]{\hyperref[#1]{section \ref*{#1}}}
+\def\textvert{\texttt{\char"7C}}
+
\parskip1ex
\parindent0pt
\let\olditemize\itemize
@@ -67,7 +69,7 @@
{\texttt{nbeisert@itp.phys.ethz.ch}}}
\hypersetup{pdfauthor={Niklas Beisert}}
\hypersetup{pdfsubject={Manual for the LaTeX2e Package delimset}}
-\date{30 December 2018, \textsf{v1.1}}
+\date{17 July 2024, \textsf{v2.0}}
\maketitle
\begin{abstract}\noindent
@@ -99,9 +101,10 @@ For example:
\\
|(v,w)| &\to (v,w)
\\
-|\langle\psi\vert M\vert\psi\rangle| &\to \langle\psi\vert M\vert\psi\rangle
+|\langle\psi|\textvert|M|\textvert|\psi\rangle|
+&\to \langle\psi\vert M\vert\psi\rangle
\\
-|(x^2+px+q)\vert_{-p/2}| &\to (x^2+px+q)\vert_{-p/2}
+|(x^2+px+q)|\textvert|_{-p/2}| &\to (x^2+px+q)\vert_{-p/2}
\\&\ldots
\end{aligned}
\]
@@ -109,8 +112,9 @@ For example:
In order to adjust the size of delimiters, the modifiers
|\big|, |\Big|, |\bigg|, |\Bigg| are used.
More importantly the construct
-{|\left*| \ldots [|\middle*|] \ldots |\right*|}
+{|\left*| \ldots [|\middle*|] \ldots |\right*|}
adjusts the size of delimiters to the contents:
+%
\[
\Bigg[\bigg[\Big[\big[[*]\big]\Big]\bigg]\Bigg],
\qquad
@@ -150,16 +154,17 @@ the size |\big(...\big)|:
\]
The package \textsf{delimset} provides mechanisms to declare sets of delimiters
-whose size can be adjusted conveniently by simple optional parameters.
+whose size can be adjusted conveniently by adding simple flag parameters.
For example, it provides a general purpose bracket |\brk|
which can be used as follows:
+%
\[
\begin{aligned}
|\brk{A\hat{X}+B}|&\to(A\hat{X}+B)
\\
|\brk*{A\hat{X}+B}|&\to\mathopen{}\mathclose{\left(A\hat{X}+B\right)}
\\
-|\brk2{A\hat{X}+B}|&\to\Bigl(A\hat{X}+B\Bigr)
+|\brk^2{A\hat{X}+B}|&\to\Bigl(A\hat{X}+B\Bigr)
\\
|\brk!{A\hat{X}+B}|&\to\bigl(A\hat{X}+B\bigr)
\end{aligned}
@@ -198,16 +203,18 @@ the more difficult it will be to adjust them
to obtain a visually acceptable result.
The main functionality of the package is based on a
-versatile mechanism to specify sets of delimiters, e.g.:
+versatile mechanism to specify sets of delimiters,
+e.g.:
+%
\[
\begin{aligned}
|\delim<>{ax+b}|
&\to\langle ax+b\rangle
\\
-|\delimpair{[}{[.],}{[}!{a}{b}|
+|\delimpair[{*,}[!{a}{b}|
&\to \bigl[a, b\bigr[
\\
-|\delimtriple<\vert\vert>*{\psi}{A^\dagger}{\psi}|
+|\delimtriple<|\textvert\textvert|>*{\psi}{A^\dagger}{\psi}|
&\to\left\langle\psi\middle\vert A^\dagger\middle\vert \psi\right\rangle
\end{aligned}
\]
@@ -216,14 +223,14 @@ The command |\delim| can be used on the fly, but also
in definitions of custom delimiter sets such as:
%
\[
-|\newcommand{\comm}{\delimpair{[}{[.],}{]}}|
+|\newcommand{\comm}{\delimpair{[}{*,}{]}}|
\]
%
Note that the definition of |\comm| does not specify any arguments.
They are nevertheless read by the incomplete definition of |\delimpair|
-from the what follows |\comm|.
+from what follows |\comm|.
In particular, this incomplete definition
-enables the correct parsing of the optional size specifier,
+enables the correct parsing of the optional size specifier flag,
e.g.:
%
\[
@@ -238,7 +245,7 @@ The above definition could be written as follows:
\begin{aligned}
&|\DeclareMathDelimiterSet{\comm}[2]|
\\
-&\qquad |{\selectdelim[l]{[}{#1},{#2}\selectdelim[r]{]}}|
+&\qquad |{\selectdeliml{[}{#1},{#2}\selectdelimr{]}}|
\end{aligned}
\]
@@ -260,9 +267,9 @@ of the currently selected math font
Unfortunately, it does not account for
the currently selected math style.
Therefore, the size of delimiters in sub/superscripts
-cannot be adjusted appropriately,
-\unskip\footnote{Arguably, it is bad typesetting practice
-to have too complicated expressions in sub/superscripts.}
+cannot be adjusted appropriately
+(an arguably better typesetting practice is
+to avoid complicated expressions in sub/superscripts in the first place),
they come out way too big:
%
\[
@@ -272,7 +279,7 @@ they come out way too big:
This package modifies the definitions of
the size modifiers (of \textsf{amsmath})
to automatically adjust to sub/superscripts
-(subject to availability):
+(subject to availability in the font):
%
\[
\makeatletter
@@ -282,6 +289,7 @@ to automatically adjust to sub/superscripts
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{Spacing and Math Classes}
+\label{sec:spacing}
Another shortcoming of the variable-size delimiters is that
the spacing is noticeably different from their fixed-size counterparts:
@@ -291,12 +299,12 @@ the spacing is noticeably different from their fixed-size counterparts:
|\square(ax+b)\square|
&\to \square(ax+b)\square
\\
-|\square\left(ax+b\right)\square|
-&\to \square\left(ax+b\right)\square
-\\
|\square\bigl(ax+b\bigr)\square|
&\to \square\bigl(ax+b\bigr)\square
\\
+|\square\left(ax+b\right)\square|
+&\to \square\left(ax+b\right)\square
+\\
|\square\left(ax+\big.b\right)\square|
&\to \square\left(ax+\big.b\right)\square
\end{aligned}
@@ -328,8 +336,9 @@ For practical purposes, consistent spacing can only be achieved
by a more convenient mechanism.
On a related note, it is important to correctly specify
-the math class (|\mathopen|\hspace{0pt}/\hspace{0pt}|\mathclose|)
+the math class (such as |\mathopen| or |\mathclose|)
for the delimiters, for example:
+%
\[
\begin{aligned}
|\big(-1\big)| &\to \big(-1\big)
@@ -340,19 +349,23 @@ for the delimiters, for example:
%
The math class can also make a major difference for intermediate delimiters,
e.g.:
+%
\[
\begin{aligned}
-|\bigl\langle\psi\big\vert\psi\bigr\rangle|
-&\to \bigl\langle\psi\big\vert\psi\bigr\rangle
+|\bigl<\psi\big|\textvert|\psi\bigr>|
+&\to \bigl<\psi\big\vert\psi\bigr>
\\
-|\bigl\langle\psi\bigm\vert\psi\bigr\rangle|
-&\to \bigl\langle\psi\bigm\vert\psi\bigr\rangle
+|\bigl<\psi\mathpunct\big|\textvert|\psi\bigr>|
+&\to \bigl\langle\psi\mathpunct\big\vert\psi\bigr>
\\
-|\bigl\langle\psi\mathbin\big\vert\psi\bigr\rangle|
-&\to \bigl\langle\psi\mathbin\big\vert\psi\bigr\rangle
+|\bigl<\psi\mathinner\big|\textvert|\psi\bigr>|
+&\to \bigl\langle\psi\mathinner\big\vert\psi\bigr>
\\
-|\bigl\langle\psi\mathpunct\big\vert\psi\bigr\rangle|
-&\to \bigl\langle\psi\mathpunct\big\vert\psi\bigr\rangle
+|\bigl<\psi\mathbin\big|\textvert|\psi\bigr>|
+&\to \bigl\langle\psi\mathbin\big\vert\psi\bigr>
+\\
+|\bigl<\psi\bigm|\textvert|\psi\bigr>|
+&\to \bigl\langle\psi\bigm\vert\psi\bigr>
\end{aligned}
\]
%
@@ -364,6 +377,67 @@ of the left and right delimiters. It also offers several choices for
intermediate delimiters to take the context into account.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\subsection{Compounds and Broken Lines}
+
+The mechanism provided by the package requires the delimited expression
+to appear as an uninterrupted compound. In particular, the expression cannot
+span several lines in a multi-line equation or several columns in a matrix.
+The same restriction applies to the elementary |\left| and |\right| construct.
+In cases where delimited expressions are torn apart across several blocks,
+the delimiters have to be typeset individually.
+The package offers a mechanism to display individual delimiters
+of a given delimiter set. It also assists in maintaining
+the same type and size across blocks.
+Being able to display individual delimiters of defined delimiter sets
+offers a broad range of (ab)use.
+
+Individual delimiters of a set can be selected and displayed
+by specifying appropriate flags,
+for example:
+%
+\[
+|\brk(|\to{(},\qquad
+|\brk)|\to{)}
+\]
+%
+These flags can be combined with the size specifier
+or other bracket modifiers,
+e.g.:
+%
+\[
+|\brk^3(|\to{\biggl(},\qquad
+|\brk[s]^2)|\to{\Bigr]}
+\]
+%
+This enables to conveniently split delimited expressions over blocks of code,
+e.g.:
+%
+\[
+|\brk[s]^3(\frac{A}{B}|\ldots\Big/\mkern-9mu\Big/\ldots|\frac{C}{D}\brk[s]^3)|
+\to
+\biggl[\frac{A}{B}\cdots\bigg/\mkern-12mu\bigg/\cdots\frac{C}{D}\biggr]
+\]
+%
+Here, the type and modifiers specifying the delimiter set
+are repeated for all individual delimiters.
+To simplify such expressions and their maintenance,
+the package provides global registers which store
+the type and size of delimiters.
+With those, the above expression can be abbreviated as:
+%
+\[
+|\brk[s]^3[|\ldots\big/\mkern-6mu\big/\ldots|\usedelim]|
+\quad\text{or}\quad
+|\brk[s]^3[|\ldots\big/\mkern-6mu\big/\ldots|\brk]|
+\]
+%
+Here, |\usedelim]|, alternatively |\brk]|,
+closes the delimiter set with
+the type and options previously specified by |\brk...[|.
+For nesting purposes, there also exists a more elaborate
+solution using registers, see below.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{Philosophy}
Semantic typesetting is one of the philosophies behind \LaTeX{}:
@@ -435,17 +509,17 @@ Modifier letters can be prepended and appended to adjust their size.
%
A functionality of the present package
not offered by any of the above packages is
-to typeset delimiters on the fly, e.g.:
+to typeset delimiters on the fly,
+e.g.:
%
\[
-|\delim<\vert>!{\psi}{\psi}|
-\to\bigl\langle\psi\big\vert\psi\bigr\rangle
+|\delim<|\textvert|>!{\psi}{\psi}|
+\to\bigl<\psi\big\vert\psi\bigr>
\]
%
The mechanism to specify the size is leaner in the sense that it uses
only a single character and a single command.
-
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Usage}
@@ -457,139 +531,377 @@ If not yet present,
the package \textsf{amsmath} will be loaded automatically.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\subsection{Inline Usage}
-\label{sec:delimcommands}
+\subsection{Delimiter Sets and Presentation Flags}
+\label{sec:flags}
+
+The package provides commands to represent various delimiter sets,
+see \secref{sec:inline} and \secref{sec:declare} below.
+Their display can be modified systematically by specifying flags.
+A delimiter set |\|\emph{name}, e.g.\ |\brk|, is typically invoked by
+a sequence like:
+%
+\[
+|\|\emph{name}\ \emph{flags}\ |{|\emph{expr1}|}||{|\emph{expr2}|}|\ldots
+\]
+%
+where \emph{expr(n)} are the terms to be enclosed by the delimiters
+and the optional \emph{flags} adjust the presentation of delimiters.
+The \emph{flags} are described as follows:
+
+First, a size modifier flag controls the size of the delimiters
+to be displayed. It can take one of the following values:
+%
+\[
+\begin{aligned}
+|0|&\qquad \text{default size}
+\text{ (0.96 times default line height)}
+\\
+|!|, |+|, |^1|&\qquad \text{size }|\big|
+\text{ (1.2 times default line height)}
+\\
+|^2|&\qquad \text{size }|\Big|
+\text{ (1.8 times default line height)}
+\\
+|^3|&\qquad \text{size }|\bigg|
+\text{ (2.4 times default line height)}
+\\
+|^4|&\qquad \text{size }|\Bigg|
+\text{ (3.0 times default line height)}
+\\
+|^|\emph{n}, |^{|\emph{x}|}|&\qquad \text{flexible size adjustment
+(\emph{n}=|0|\ldots|9|; \emph{x}: decimal number)}
+\\
+|_{|\emph{h}|}|&\qquad \text{adjustment to absolute height \emph{h} (centred)}
+\\
+|*|&\qquad \text{variable size }|\left...\right|
+\end{aligned}
+\]
+%
+The intended delimiter size is stored as the dimension register:
+%
+\[
+|\delimsize|
+\]
+%
+It may be used to adjust spacing within the delimiter set
+proportional to the size of the delimiters.
+Note that the actual size of delimiters may deviate
+depending on availability within the given font.
+Note further that the size cannot be determined for variable-size delimiters
+(`|*|') and thus size |\Big| is assumed for this case.
+Note finally that the sub/superscript styles are not taken into
+account and |\delimsize| applies to the default case |\textstyle|.
+The package also supplies a macro to add horizontal glue
+proportional to the intended delimiter size:
+%
+\[
+|\kerndelim{|\emph{width}|}|
+\]
+%
+Here, \emph{width} is the amount of horizontal glue
+in units of mu scaled by the ratio of |\delimsize|
+and the current math font height.
+The macro does adjust for the selected script style.
+
+Second, a delimiter selection flag is used to pick out
+and display just one individual delimiter within the set.
+It can take one of the following values:
+%
+\[
+\begin{aligned}
+|(|&\qquad \text{left delimiter}
+\\
+\textvert, |,|&\qquad \text{first intermediate delimiter}
+\\
+|)|&\qquad \text{right delimiter}
+\\
+|?|\emph{n}&\qquad \text{\emph{n}-th delimiter (starting with |0|: left)}
+\end{aligned}
+\]
+
+Third, register flags store are retrieve delimiter
+for splitting the across blocks or lines:
+%
+\[
+\begin{aligned}
+|[|&\qquad \text{store delimiter type to register `|.|',
+display left delimiter (same as `|>.(|')}
+\\
+|]|&\qquad \text{display right delimiter stored in default register `|.|'
+(same as `|<.)|')}
+\\
+|>|\emph{r}, |>{|\emph{reg}|}|&\qquad \text{store delimiter type
+in register \emph{r} or \emph{reg}}
+\\
+|<|\emph{r}, |<{|\emph{reg}|}|&\qquad \text{retrieve delimiter type
+from register \emph{r} or \emph{reg}}
+\end{aligned}
+\]
+%
+A register stores the type of delimiter set (|\|\emph{name}),
+the desired size (except for variable size `|*|')
+as well as the math class of the compound (`|'|' vs. `|"|', see below).
+A stored register can be retrieved and displayed by the macro:
+%
+\[
+|\usedelim|\,\emph{r}\ \emph{sel}
+\quad\text{or}\quad
+|\usedelim|\{\emph{reg}\}\emph{sel}
+\]
+%
+Here, \emph{sel} is a flag to select an individual delimiter, see above.
+
+In addition, there are some general purpose flags:
+%
+\[
+\begin{aligned}
+|.|&\qquad \text{terminates flag processing}
+\\
+|:|&\qquad \text{enclose delimiter set in block
+(for using total box dimensions)}
+\\
+|'|&\qquad \text{render delimiter set as }|\mathopen|\text{ and }|\mathclose|
+\\
+|"|&\qquad \text{render delimiter set as }|\mathinner|
+\\
+|-|&\qquad \text{display phantom delimiters (for individual delimiters)}
+\end{aligned}
+\]
+
+Please note the following:
+%
+\begin{itemize}
+\item
+A delimiter selector (including the combined flags `|[|' and `|]|')
+terminates flag processing,
+therefore all relevant flags must be specified before it.
+\item
+Parsing also stops with the opening of the first term argument
+by means of the opening brace `|{|'.
+\item
+Parsing can also be terminated manually by specifying the flag `|.|'
+(in case the opening brace `|{|' for arguments is missing for whatever reason).
+\item
+Any other letter or token at the location of \emph{flags}
+is interpreted as an unrecognised flag and triggers a compiler error.
+For instance, |\brk{x}| must not be abbreviated as |\brk x|
+because `|x|' would be interpreted as a flag
+(it might be abbreviated as |\brk.x|).
+\item
+The legacy size modifier flags `|1|' \ldots `|4|'
+provided for backward compatibility have the same effect as `|^1|'\ldots`|^4|'.
+\item
+The phantom delimiter flag `|-|' does not work for variable size.
+It is intended for reserving space for individual delimiters
+when they are composed manually into sets (e.g.\ across lines).
+\item
+Technically, individual delimiters can be produced in the variable size version
+(even though it may defeat the purpose of the delimiter selection mechanism).
+One has to pay attention when using
+only the opening or only the closing delimiters from the package
+and counterbalancing it by direct code for the opposite side.
+This is because `|*(|' and `|*)|' do not directly translate to
+|\left|\emph{delim} and |\right|\emph{delim}
+due to proper spacing, see \secref{sec:spacing}.
+Instead, they translate to:
+%
+\[
+\begin{aligned}
+|*(|&\to|\mathopen{}\mathclose\bgroup\left|\emph{delim}
+\\
+|*)|&\to|\right|\emph{delim}|\egroup|
+\end{aligned}
+\]
+%
+One should use analogous code to complete the manual variable size block.
+
+Note that similar restrictions apply to using the flag `|:|'
+for block enclosure which uses |\bgroup| and |\egroup| as well.
+
+As it does not make much sense to use variable-size (`|*|')
+and block (`|:|') compounds for individual delimiter selection,
+the state of these flags is not stored in the global registers.
+\end{itemize}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\subsection{Inline Declarations}
+\label{sec:inline}
The package provides three general purpose commands
to compose delimiter sets with one, two or three encapsulated expressions:
%
\[
\begin{aligned}
-&|\delim{|\emph{l}|}{|\emph{r}|}|\emph{size}|{|\emph{expr}|}|
+&|\delim{|\emph{l}|}{|\emph{r}|}|\emph{flags}|{|\emph{expr}|}|
\\
&|\delimpair{|\emph{l}|}{|\emph{m}|}{|\emph{r}|}|
-\emph{size}|{|\emph{expr1}|}{|\emph{expr2}|}|
+\emph{flags}|{|\emph{expr1}|}{|\emph{expr2}|}|
\\
-&|\delimtriple{|\emph{l}|}{|\emph{m1}|}{|\emph{m2}|}{|\emph{r}|}|
-\emph{size}|{|\emph{expr1}|}{|\emph{expr2}|}{|\emph{expr3}|}|
+&|\delimtriple{|\emph{l}|}{|\emph{m}|}{|\emph{n}|}{|\emph{r}|}|
+\emph{flags}|{|\emph{expr1}|}{|\emph{expr2}|}{|\emph{expr3}|}|
\end{aligned}
\]
%
The expression(s) \emph{expr(n)} will be surrounded by the
delimiters \emph{l} and \emph{r}
and, in the case of more than one expression,
-they will be separated by the delimiters \emph{m(n)}:
+they will be separated by the delimiters \emph{m}, \emph{n}:
+%
\[
\emph{l}\ \emph{expr}\ \emph{r},
\qquad
\emph{l}\ \emph{expr1}\ \emph{m}\ \emph{expr2}\ \emph{r},
\qquad
-\emph{l}\ \emph{expr1}\ \emph{m1}\ \emph{expr2}\
-\emph{m2}\ \emph{expr3}\ \emph{r}
+\emph{l}\ \emph{expr1}\ \emph{m}\ \emph{expr2}\
+\emph{n}\ \emph{expr3}\ \emph{r}
\]
-Here, \emph{l} and \emph{r} have to be
-math delimiters (symbols which can be used for |\left| and |\right|) or
-the dot `.' for the null delimiter.
-The separators \emph{m(n)} can be plain math delimiters as well, but they can
-also be compound expression of the form |[|\emph{class}|]|\emph{delim}
-where \emph{class} specifies
-the intended math class of the delimiter \emph{delim}:
+Here, \emph{l}, \emph{r}, \emph{m}, \emph{n}
+should be math delimiters \emph{delim}
+(elementary symbols which can be used for |\left| and |\right|)
+or the dot `|.|' for the null delimiter.
+The delimiter set expression can be adjusted in two ways:
+
+First, size adjustment
+for the delimiters \emph{l}, \emph{r}, \emph{m}, \emph{n}
+can be suppressed by a starred variant:
+%
+\[
+|{*|\emph{token}|}|
+\qquad\text{or}\qquad
+|{*{|\emph{expr}|}}|
+\]
+%
+This allows to use an arbitrary \emph{token}
+or a compound expression \emph{expr} in place of a delimiter \emph{delim}.
+This is useful when a delimiter character should not adjust in size
+(e.g.\ commas), or if a flexible-size version of the character
+is not available. One might also use a compound expression
+to create a null delimiter with non-zero width
+(the width may be specified by |\kerndelim|
+to make it proportional to the delimiter size).
+
+Second, the intended math class
+of the intermediate delimiters \emph{m}, \emph{n}
+may be adjusted in order to achieve a more appropriate automatic spacing
+by using |{[|\emph{class}|]|\emph{delim}|}|.
+Here, \emph{class} specifies
+the intended math class of the delimiter \emph{delim}
+according to:
%
\[
-\begin{aligned}{}
+\begin{aligned}
\left.\begin{array}{r}
-\emph{delim}\\|{|\emph{delim}|}|\\|{[]|\emph{delim}|}|
+\emph{delim}\\|{|\emph{delim}|}|
\end{array}\right\}
-&\qquad\text{class }|\mathord|\text{ (similar to }|\big|)
-\\
-|{[l]|\emph{delim}|}|&\qquad
-\text{class }|\mathopen|\text{ (similar to }|\bigl|
-\text{, not for use in }|\delim...|)
-\\
-|{[r]|\emph{delim}|}|&\qquad
-\text{class }|\mathclose|\text{ (similar to }|\bigr|
-\text{, not for use in }|\delim...|)
+&\qquad
+\left\{\begin{array}{l}
+\text{no glue for size-adjusted delimiters (same as }|[o]|\text{)}
\\
-|{[o]|\emph{delim}|}|&\qquad
-\text{class }|\mathopen|\text{ (similar to }|\bigl|)
+\text{determined by expression for unadjusted size (}|*|\text{ variant)}
+\end{array}\right.
\\
-|{[c]|\emph{delim}|}|&\qquad
-\text{class }|\mathclose|\text{ (similar to }|\bigr|)
-\\
-|{[m]|\emph{delim}|}|&\qquad
-\text{class }|\mathrel|\text{ (similar to }|\bigm|)
+|{[o]|\emph{delim}|}|
+&\qquad
+\text{no glue, similar to }|\big|, |\mathord|, |\mathopen|, |\mathclose|
\\
|{[p]|\emph{delim}|}|&\qquad
-\text{class }|\mathpunct|\text{ (similar to }|\bigp|)
+\text{followed by }|\thinmuskip|\text{, similar to }|\bigp|, |\mathpunct|
+\\
+|{[i]|\emph{delim}|}|&\qquad
+\text{surrounded by }|\thinmuskip|\text{, similar to }|\bigi|, |\mathinner|
\\
|{[b]|\emph{delim}|}|&\qquad
-\text{class }|\mathbin|\text{ (similar to }|\bigb|)
+\text{surrounded by }|\medmuskip|\text{, similar to }|\bigb|, |\mathbin|
\\
-|{[.]|\emph{expr}|}|&\qquad
-\text{no size adjustment, \emph{expr} can be any expression}
+|{[m]|\emph{delim}|}|&\qquad
+\text{surrounded by }|\thickmuskip|\text{, similar to }|\bigm|, |\mathrel|
\end{aligned}
\]
-%
-Note that the left and right delimiters \emph{l} and \emph{r} effectively
-have |[l]| and |[r]| prepended, respectively,
-and therefore they must be a plain math delimiter.
-Conversely, the immediate delimiters \emph{m(n)} must not
-have the |[l]| and |[r]| classes
-because the latter must appear precisely once
-and they are already taken by \emph{l} and \emph{r};
-use classes |[o]| and |[c]| instead.
-The optional size modifier \emph{size} should take one of the following values:
+Please note the following:
+%
+\begin{itemize}
+\item
+The left and right delimiters \emph{l} and \emph{r}
+are assigned to special classes:
+They leave no initial and final glue on the enclosed expressions
+(same as |\mathopen| and |\mathclose|).
+From the outside, the delimiter set appears
+either as a combination of |\mathopen|+|\mathclose| (flag `|'|')
+or as |\mathinner| (flag `|"|').
+\item
+The legacy class |[.]| provided for backward compatibility
+specifies delimiters with unadjusted size:
+the compound |{[.]|\emph{expr}|}| has the same effect as |{*{|\emph{expr}|}}|.
+\item
+The legacy class |[c]| provided for backward compatibility
+has the same effect as |[o]|.
+\item
+Unadjusted-size delimiters can be combined with math classes as:
+%
\[
-\begin{aligned}{}
-\emph{empty}, \emph{anything else}, |0|&\qquad \text{default size}
-\\
-|!|, |+|, |1|&\qquad \text{size }|\big|\text{ (|!| is preferred)}
-\\
-|2|&\qquad \text{size }|\Big|
-\\
-|3|&\qquad \text{size }|\bigg|
-\\
-|4|&\qquad \text{size }|\Bigg|
-\\
-|*|&\qquad \text{variable size }|\left...\right|
-\end{aligned}
+|{[|\emph{class}|]*|\emph{token}|}|
+\qquad\text{or}\qquad
+|{[|\emph{class}|]*{|\emph{expr}|}}|
\]
+%
+\item
+The opening square bracket `|[|'
+takes the dual role of indicating the optional |[|\emph{class}|]| argument.
+To avoid conflicts on intermediate delimiters,
+opening square bracket delimiters should be encoded as
+`|{{[}}|' (for |\delim...|) or `|{[}|' (for |\selectdelim|)
+rather than `|[|'.
+\end{itemize}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{Declarations}
+\label{sec:declare}
The above constructs can be used to define new delimiter commands via:
%
\[
-|\newcommand{\|\emph{name}|}{\delim...{|\emph{l}|}...{|\emph{r}|}}|
+\begin{aligned}
+&|\newcommand{\|\emph{name}|}{\delim{|\emph{l}|}{|\emph{r}|}|
+\emph{flags}|}|
+\\
+&|\newcommand{\|\emph{name}|}{\delimpair{|\emph{l}|}{|\emph{m}|}{|\emph{r}|}|
+\emph{flags}|}|
+\\
+&|\newcommand{\|\emph{name}|}{\delimtriple{|\emph{l}|}{|\emph{m}|}|
+|{|\emph{n}|}{|\emph{r}|}|\emph{flags}|}|
+\end{aligned}
\]
%
-Here it makes sense to drop all arguments starting
-with the size modifier \emph{size} from the definition.
+Here it makes sense to drop all arguments
+starting at the optional \emph{flags} argument from the definition.
The \TeX{} parsing mechanism will then automatically
use the tokens following |\|\emph{name} including the optional size modifier.
-If the encapsulated expression(s) are to be passed as explicit arguments
-to |\|\emph{name}, one will have to find an alternative way to pass the
-optional size argument.
+If any of the encapsulated expression(s) are to be passed as
+explicit arguments to |\|\emph{name},
+one will have to find an alternative way to pass \emph{flags}.
+However, it is possible to predefine \emph{flags}
+which can be overridden by further \emph{flags} specified by the user.
The above declarations via |\delim...|
-should be sufficient for almost all situations.
+should be sufficient for most situations.
However, there is an even more flexible way to declare delimiter sets:
+%
\[
-|\DeclareMathDelimiterSet{\|\emph{name}|}[|\emph{narg}|]{|\emph{expr}|}|
+|\DeclareMathDelimiterSet{\|\emph{name}|}[|\emph{narg}|]{|\emph{compositor}|}|
\]
%
The syntax of this command is equivalent to the one of |\newcommand|.
The difference is that the command |\|\emph{name} first looks
-for the optional size modifier \emph{size} as
-described above in \secref{sec:delimcommands}.
-It remembers the desired size for evaluating the macro \emph{expr}.
+for the \emph{flags} argument as
+described above in \secref{sec:inline}.
+It remembers the desired size for evaluating
+the macro expression \emph{compositor}.
Then it parses the arguments as if the command
was declared by |\newcommand|.
-As usual, the macro \emph{expr} contains the command arguments
+As usual, the macro expression \emph{compositor} contains the command arguments
specified by |#1|, |#2|, \ldots. Note that these should
be encapsulated in groups |{#1}|, |{#2}|, \ldots,
in order to prevent them from overwriting definitions
@@ -598,16 +910,108 @@ It should also contain the desired math delimiters
specified by:
%
\[
-|\selectdelim[|\emph{class}|]{|\emph{delim}|}|
+\begin{aligned}
+&|\selectdeliml|[|*|]|{|\emph{delim}|}|
+\\
+&|\selectdelim[|\emph{class}|]|[|*|]|{|\emph{delim}|}|
+\\
+&|\selectdelimr|[|*|]|{|\emph{delim}|}|
+\end{aligned}
\]
%
+The three commands must be in proper sequence
+starting with |\selectdeliml| followed by arbitrarily many
+|\selectdelim| and terminated by |\selectdelimr|.
+The math classes \emph{class} and starred variants
+are defined analogously to \secref{sec:inline}.
Here, the sizes are adjusted automatically
-according to the previously specified modifier \emph{size}.
-The math classes must be in proper sequence,
-i.e.\ the first and last ones must be |l| and |r|, respectively,
-while the intermediate ones can be anything by |l| and |r|,
-see \secref{sec:delimcommands}.
+according to the previously specified modifier.
+
+Picking out individual delimiters from a set
+declared by |\DeclareMathDelimiterSet|
+cannot be achieved automatically.
+Instead, a selector method may be specified manually (where needed) by:
+%
+\[
+\begin{aligned}
+&|\DeclareMathDelimiterSel{\|\emph{name}|}|
+\\
+&| {\selectdeliml{|\emph{l}|}|[|\||or\selectdelim{|\emph{m}|}|\ldots]|}|
+\\
+&| {\selectdelimr{|\emph{r}|}}|
+\end{aligned}
+\]
+%
+As many intermediate delimiters as needed can be specified
+at the end of the first argument; each one must start with `|\||or|'.
+
+\makeatletter
+For example, one might declare a set of double square brackets
+$[\kern-0.06\big@size[*]\kern-0.06\big@size]$ using:
+\makeatother
+%
+\[
+\begin{aligned}
+&|\DeclareMathDelimiterSet{\dsb}[1]|
+\\
+&| {\selectdeliml{[}\kerndelim{-1.75}\selectdelim[o]{[}{#1}|
+\\
+&| \selectdelim[o]{]}\kerndelim{-1.75}\selectdelimr{]}}|
+\end{aligned}
+\]
+%
+Here, the command |\kerndelim{-1.75}| reduces the spacing
+between the two square brackets by approximately 1.75\,mu in default size.
+This could be used for:
+%
+\[
+\makeatletter
+|\dsb^4{\dsb^3{\dsb^2{\dsb^1{\dsb{*}}}}}|
+\to
+\Biggl[\kern-0.20\big@size\Biggl[
+\biggl[\kern-0.16\big@size\biggl[
+\Bigl[\kern-0.12\big@size\Bigl[
+\bigl[\kern-0.08\big@size\bigl[
+[\kern-0.06\big@size[*
+]\kern-0.06\big@size]
+\bigr]\kern-0.08\big@size\bigr]
+\Bigr]\kern-0.12\big@size\Bigr]
+\biggr]\kern-0.16\big@size\biggr]
+\Biggr]\kern-0.20\big@size\Biggr],
+\quad
+|\dsb*|\ldots\to
+\left[\kern-0.12\big@size\middle[\frac{x}{y}
+\middle]\kern-0.12\big@size\right]
+\makeatother
+\]
+%
+An appropriate selector method for displaying individual
+delimiters reads:
+%
+\[
+\begin{aligned}
+&|\DeclareMathDelimiterSel{\dsb}|
+\\
+&| {\selectdeliml{[}\kerndelim{-1.75}\selectdelim[o]{[}}|
+\\
+&| {\selectdelim[o]]\kerndelim{-1.75}\selectdelimr{]}}|
+\end{aligned}
+\]
+Finally, towards a very flexible manual composition
+of delimiter sets, there is the macro:
+%
+\[
+|\parsedelimflags{|\emph{compositor}|}{|\emph{selector}|}|\emph{flags}
+\]
+%
+It parses the modifier flags as described in \secref{sec:flags}.
+The argument \emph{compositor} is code that displays the
+composited delimiter set whereas \emph{selector} is a macro
+that displays the delimiter number |\selecteddelim| of the set.
+The \emph{flags} follow immediately and should be terminated by
+an opening brace `|{|', the terminating flag `|.|'
+or a delimiter selection flag.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{Default Declarations}
@@ -617,30 +1021,34 @@ The package predefines four commonly used sets of delimiters:
%
\begin{itemize}
\item
-|\brk[|\emph{type}|]|\emph{size}|{|\emph{expr}|}| represents
+|\brk[|\emph{type}|]|\emph{flags}|{|\emph{expr}|}| represents
a standard bracket around a single expression \emph{expr}.
The type of bracket can be specified by the optional
argument \emph{type}:
+%
\[
\text{\emph{empty} or |[r]|: round }(x),\quad
\text{|[s]|: square }[x],\quad
\text{|[c]|: curly }\{x\},\quad
\text{|[a]|: angle }\langle x\rangle
\]
+%
\item
-|\eval[|\emph{type}|]|\emph{size}|{|\emph{expr}|}| represents
+|\eval[|\emph{type}|]|\emph{flags}|{|\emph{expr}|}| represents
evaluation of a functional expression \emph{expr}.
The type of bracket can be specified by the optional
argument \emph{type}:
+%
\[
\text{\emph{empty} or |[v]|: }f(x)\vert_{a},\qquad
\text{|[s]|: }[f(x)]_{a}^{b}
\]
+%
\item
-|\abs|\emph{size}|{|\emph{expr}|}| represents
+|\abs|\emph{flags}|{|\emph{expr}|}| represents
the absolute value $\lvert\emph{expr}\rvert$.
\item
-|\norm|\emph{size}|{|\emph{expr}|}| represents
+|\norm|\emph{flags}|{|\emph{expr}|}| represents
the norm $\lVert\emph{expr}\rVert$.
\end{itemize}
%
@@ -651,19 +1059,20 @@ The package also defines some extended sets of delimiters as follows:
%
\begin{itemize}
\item
-|\pair|\emph{size}|{|\emph{expr1}|}{|\emph{expr2}|}| represents
+|\pair|\emph{flags}|{|\emph{expr1}|}{|\emph{expr2}|}| represents
a pair(ing) $(\emph{expr1},\emph{expr2})$.
\item
-|\set|\emph{size}|{|\emph{expr}|}| represents
+|\set|\emph{flags}|{|\emph{expr}|}| represents
the set $\{\emph{expr}\}$.
\item
-|\setcond|\emph{size}|{|\emph{expr}|}{|\emph{cond}|}| represents
+|\setcond|\emph{flags}|{|\emph{expr}|}{|\emph{cond}|}| represents
a set with condition $\{\emph{expr}\vert\emph{cond}\}$.
\item
-|\intv[|\emph{type}|]|\emph{size}|{|\emph{expr1}|}{|\emph{expr2}|}| represents
+|\intv[|\emph{type}|]|\emph{flags}|{|\emph{expr1}|}{|\emph{expr2}|}| represents
an interval from \emph{expr1} to \emph{expr2}.
The in/\hspace{0pt}exclusion of the bounds can be specified by the optional
argument \emph{type}:
+%
\[
\text{\emph{empty} or |[c]|: closed }[a,b],\qquad
\text{|[o]|: open }]a,b[,\qquad
@@ -673,28 +1082,35 @@ argument \emph{type}:
\text{|[r]|: right-open }[a,b[
\end{array}
\]
+%
\item
-|\avg|\emph{size}|{|\emph{expr}|}| represents
+|\avg|\emph{flags}|{|\emph{expr}|}| represents
some average $\langle\emph{expr}\rangle$.
\item
-|\corr|\emph{size}|{|\emph{expr}|}| represents
+|\corr|\emph{flags}|{|\emph{expr}|}| represents
some correlator $\langle\emph{expr}\rangle$.
\item
-|\comm|\emph{size}|{|\emph{expr1}|}{|\emph{expr2}|}| represents
+|\comm|\emph{flags}|{|\emph{expr1}|}{|\emph{expr2}|}| represents
the commutator $[\emph{expr1},\emph{expr2}]$.
\item
-|\acomm|\emph{size}|{|\emph{expr1}|}{|\emph{expr2}|}| represents
+|\acomm|\emph{flags}|{|\emph{expr1}|}{|\emph{expr2}|}| represents
the anti-commutator $\{\emph{expr1},\emph{expr2}\}$.
\item
-|\bra|\emph{size}|{|\emph{expr}|}| represents
+|\bra|\emph{flags}|{|\emph{expr}|}| represents
a bra-vector $\langle\emph{expr}\rvert$ in quantum mechanics.
\item
-|\ket|\emph{size}|{|\emph{expr}|}| represents
+|\ket|\emph{flags}|{|\emph{expr}|}| represents
a ket-vector $\lvert\emph{expr}\rangle$ in quantum mechanics.
\item
-|\setcond|\emph{size}|{|\emph{expr1}|}{|\emph{expr2}|}| represents
+|\braket|\emph{flags}|{|\emph{expr1}|}{|\emph{expr2}|}| represents
a bra-ket contraction $\langle\emph{expr1}\vert\emph{expr2}\rangle$.
+\item
+|\lfrac[|\emph{type}|]|\emph{flags}|{|\emph{expr1}|}{|\emph{expr2}|}| describes
+the linear representation $\emph{expr1}/\emph{expr2}$ of a fraction.
+An optional argument \emph{type} taking values |[r]|, |[s]|, |[c]|, |[a]| encloses the
+fraction in round, square, curly or angle brackets as for |\brk|.
\end{itemize}
+%
The extended definitions need to be activated by
the package option |extdef|, see \secref{sec:packageoptions}.
@@ -707,10 +1123,10 @@ or taste of the user, they can be redefined with |\renewcommand|.
In addition to the |\bigl|, |\bigr| and |\bigm| commands
(as well as their |\Big.|, |\bigg.| and |\Bigg.| counterparts),
-the package defines two additional sets |\bigp| and |\bigb|
+the package defines three additional sets |\bigp|, |\bigb| and |\bigi|
(and counterparts).
-Here |\bigp| implies the math class |\mathpunct|
-and |\bigb| the class |\mathbin|.
+Here |\bigp| implies the math class |\mathpunct|,
+|\bigb| the class |\mathbin| and |\bigi| the class |\mathinner|.
Furthermore, the package overloads the size calculation in the |\big...|
commands to properly account for the math styles in sub/superscripts
@@ -722,7 +1138,8 @@ the package option |scriptstyle|, see \secref{sec:packageoptions}.
\subsection{Package Options}
\label{sec:packageoptions}
-Options can be passed to the package by
+Options can be passed to the package by:
+%
\[
|\usepackage[|\emph{opts}|]{delimset}|
\qquad
@@ -735,17 +1152,17 @@ Here \emph{opts} is a comma-separated list of the available options:
%
\begin{itemize}
\item
-|stddef|[|=true|$\vert$|false|]
+|stddef|[|=true|\textbar|false|]
controls the activation of standard delimiter definitions specified in
\secref{sec:defaultcommands}.
If no value is given |true| is assumed; initially set to |true|.
\item
-|extdef|[|=true|$\vert$|false|]
+|extdef|[|=true|\textbar|false|]
controls the activation of extended delimiter definitions specified in
\secref{sec:defaultcommands}.
If no value is given |true| is assumed; initially set to |false|.
\item
-|scriptstyle|[|=true|$\vert$|false|]
+|scriptstyle|[|=true|\textbar|false|]
controls the overwriting of size modifiers explained
in \secref{sec:auxcommands}.
If no value is given |true| is assumed; initially set to |true|.
@@ -758,7 +1175,7 @@ If no value is given |true| is assumed; initially set to |true|.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{Copyright}
-Copyright \copyright{} 2016--2018 Niklas Beisert
+Copyright \copyright{} 2016--2024 Niklas Beisert
This work may be distributed and/or modified under the
conditions of the \LaTeX{} Project Public License, either version 1.3
@@ -808,7 +1225,7 @@ distribution, e.g.\ \textit{texmf-root}|/tex/latex/delimset|.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{Interaction with CTAN Packages}
-The package relies on other packages:
+The package is related to other packages available at CTAN:
\begin{itemize}
\item
This package relies on some functionality of the package \textsf{amsmath}
@@ -820,24 +1237,63 @@ This package uses the package \textsf{keyval} from the \textsf{graphics} bundle
to process optional arguments to the package options.
Compatibility with the \textsf{keyval} package
has been tested with v1.15 (2014/10/28).
+\item
+The package \textsf{icomma} modifies the spacing behaviour
+of the comma character in math mode
+which leads to inadequate spacing when it is used as a middle delimiter.
+To achieve proper spacing in sample code,
+use |{[p]*,}| rather than |{*,}|.
+The extended commands |\intv|, |\comm|, |\acomm| and |\pair|
+are compatible with the \textsf{icomma} package
+has been tested with v2.0 (2002/03/10).
\end{itemize}
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%\subsection{Feature Suggestions}
-% specify width of null delimiter?
-% automatic nesting of bracket types?
% make optional arguments work for DeclareMathDelimiterSet?
-% add pfrac for fraction a/b in text mode
+% (must go before parsing, but how to process and react?)
+% make unadjusted size have right height
+% automatic nesting of bracket types? -> depth stack?
% handle cramped style properly (perhaps impossible)
-% outer decorations for delimiters e.g. _y<a,b>_x
-% freestyle delimiter with size adjustment replacement \size{\rangle}_x
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{Revision History}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\paragraph{v2.0:} 2024/07/17
+
+\begin{itemize}
+\item
+option to display individual delimiters
+and to store them in global registers across blocks
+(columns, lines, etc.)
+\item
+more general handling of unadjusted-size delimiters
+\item
+more general size adjustments
+\item
+added inner math class for intermediate delimiters
+\item
+added flag to enclose by open/close and inner math class
+\item
+added flag to display phantom delimiters
+\item
+selected size accessible by |\delimsize|
+and add proportional kerning by |\kerndelim|.
+\item
+added extended definition |\lfrac| for plain inline fractions
+\item
+null delimiter now properly has zero width for variable size
+\item
+internal mechanisms revised
+\item
+compatibility with \textsf{icomma} package
+(thanks to Olivier Godin for pointing out the issue)
+\end{itemize}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\paragraph{v1.1:} 2018/12/30
\begin{itemize}
@@ -914,11 +1370,11 @@ standard definitions
sizes for default brackets:
% \begin{macrocode}
\[
-\brk0{x},\quad
-\brk1{x},\quad
-\brk2{x},\quad
-\brk3{x},\quad
-\brk4{x}
+\brk^0{x},\quad
+\brk^1{x},\quad
+\brk^2{x},\quad
+\brk^3{x},\quad
+\brk^4{x}
\]
% \end{macrocode}
@@ -935,7 +1391,7 @@ styles for default brackets:
nested brackets:
% \begin{macrocode}
\[
-\brk[c]2{\brk[s]!{\brk{ax+b}x+c}x+d}
+\brk[c]^2{\brk[s]!{\brk{ax+b}x+c}x+d}
\]
% \end{macrocode}
@@ -952,7 +1408,7 @@ default absolute value, norm and default evaluations:
outer delimiter spacing:
% \begin{macrocode}
\begin{align*}
-&\square\brk0{x}\square,&&\square\brk1{A^k}\square,
+&\square\brk^0{x}\square,&&\square\brk^1{A^k}\square,
\\
&\square\brk*{x}\square,&&\square\brk*{A^k}\square
\end{align*}
@@ -969,7 +1425,7 @@ e^{\brk!{ax+b}}
delimiter declaration:
% \begin{macrocode}
\DeclareMathDelimiterSet{\braket}[2]
- {\selectdelim[l]<#1\selectdelim|#2\selectdelim[r]>}
+ {\selectdeliml<#1\selectdelim|#2\selectdelimr>}
\[
\braket!{\psi}{\psi},
\quad
@@ -988,32 +1444,36 @@ conditional set, alternative layouts:
% \begin{macrocode}
\[
\delimpair\{{[m]|}\}!{2n}{n\in\mathbb{Z}},
-\qquad
+\quad
\delimpair\{{[b]|}\}!{2n}{n\in\mathbb{Z}},
-\qquad
+\quad
+\delimpair\{{[i]|}\}!{2n}{n\in\mathbb{Z}},
+\quad
\delimpair\{{[p]|}\}!{2n}{n\in\mathbb{Z}},
-\qquad
+\quad
\delimpair\{|\}!{2n}{n\in\mathbb{Z}},
-\qquad
-\delimpair\{{[.];}\}!{2n}{n\in\mathbb{Z}}
+\quad
+\delimpair\{{*;}\}!{2n}{n\in\mathbb{Z}}
\]
conditional set, alternative layouts with variable size:
\[
\delimpair\{{[m]|}\}*{2n}{n\in\mathbb{Z}\big.},
-\qquad
+\quad
\delimpair\{{[b]|}\}*{2n}{n\in\mathbb{Z}\big.},
-\qquad
+\quad
+\delimpair\{{[i]|}\}*{2n}{n\in\mathbb{Z}\big.},
+\quad
\delimpair\{{[p]|}\}*{2n}{n\in\mathbb{Z}\big.},
-\qquad
+\quad
\delimpair\{|\}*{2n}{n\in\mathbb{Z}\big.},
-\qquad
-\delimpair\{{[.];}\}*{2n}{n\in\mathbb{Z}\big.}
+\quad
+\delimpair\{{*;}\}*{2n}{n\in\mathbb{Z}\big.}
\]
% \end{macrocode}
delimiter definition:
% \begin{macrocode}
-\newcommand{\comm}{\delimpair[{[.],}]}
+\newcommand{\comm}{\delimpair[{*,}]}
\[
\comm!{\comm{A}{B}}{C}
+\comm!{\comm{B}{C}}{A}
@@ -1024,7 +1484,7 @@ delimiter definition:
alternative representation:
% \begin{macrocode}
-\renewcommand{\comm}{\delimpair[{[.];}]}
+\renewcommand{\comm}{\delimpair[{*;}]}
\[
\comm!{\comm{A}{B}}{C}
+\comm!{\comm{B}{C}}{A}
@@ -1033,6 +1493,31 @@ alternative representation:
\]
% \end{macrocode}
+display individual delimiters of a set:
+% \begin{macrocode}
+\renewcommand{\braket}{\delimpair<|>}
+\[
+\braket{A}{B}
+\to \braket( A \braket| B \braket),
+\quad
+\braket*( A\big. \braket*| B_{} \braket*),
+\quad
+\braket^1( A \braket^3| B \braket^2)
+\]
+% \end{macrocode}
+
+placing indices before a bracket
+(does not work in variable-size mode because
+the final size is not available for the enclosed expressions):
+% \begin{macrocode}
+\DeclareMathDelimiterSet{\quadindex}[5]
+ {\selectdeliml.^{#2}_{#3}\mathord{}\selectdelim[o][
+ {#1}\selectdelim[o]]^{#4}_{#5}\selectdelimr.}
+\[
+\quadindex^2{\frac{x}{y}}{1}{2}{3}{4}
+\]
+% \end{macrocode}
+
% end of document body:
% \begin{macrocode}
\end{document}
@@ -1057,6 +1542,7 @@ alternative representation:
% if not yet present.
% \textsf{amsmath} is used for basic delimiter size functionality.
% \textsf{keyval} is used for extended options processing.
+%
% \begin{macrocode}
\RequirePackage{amsmath}
\RequirePackage{keyval}
@@ -1067,6 +1553,7 @@ alternative representation:
%
% The package has some boolean \textsf{keyval} options
% which can be set to |true| or |false|.
+%
% \begin{macrocode}
\newif\ifdlm@std\dlm@stdtrue
\newif\ifdlm@ext\dlm@extfalse
@@ -1083,7 +1570,7 @@ alternative representation:
% \end{macrocode}
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-% \paragraph{Internal Definitions.}
+% \paragraph{Improved Size Adjustments.}
%
% Overwrite the \textsf{amsmath} command |\bBigg@|
% to select the size according to the present math style
@@ -1105,102 +1592,269 @@ alternative representation:
\fi
% \end{macrocode}
-% Define punctuation marks (|\bigp|, etc.)
-% and binary operators (|\bigb|, etc.).
+% Define punctuation marks (|\bigp|, etc.),
+% binary operators (|\bigb|, etc.)
+% and inner class (|\bigi|, etc.).
%
% \begin{macrocode}
-\newcommand{\bigp}{\mathpunct\big}
-\newcommand{\Bigp}{\mathpunct\Big}
-\newcommand{\biggp}{\mathpunct\bigg}
-\newcommand{\Biggp}{\mathpunct\Bigg}
-\newcommand{\bigb}{\mathbin\big}
-\newcommand{\Bigb}{\mathbin\Big}
-\newcommand{\biggb}{\mathbin\bigg}
-\newcommand{\Biggb}{\mathbin\Bigg}
+\providecommand{\bigp}{\mathpunct\big}
+\providecommand{\Bigp}{\mathpunct\Big}
+\providecommand{\biggp}{\mathpunct\bigg}
+\providecommand{\Biggp}{\mathpunct\Bigg}
+\providecommand{\bigb}{\mathbin\big}
+\providecommand{\Bigb}{\mathbin\Big}
+\providecommand{\biggb}{\mathbin\bigg}
+\providecommand{\Biggb}{\mathbin\Bigg}
+\providecommand{\bigi}{\mathinner\big}
+\providecommand{\Bigi}{\mathinner\Big}
+\providecommand{\biggi}{\mathinner\bigg}
+\providecommand{\Biggi}{\mathinner\Bigg}
% \end{macrocode}
-% Define size selectors for standard size (|dlm@norm|),
-% variable size (|dlm@var|).
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% \paragraph{Size Adjustment Definitions.}
+%
+% The macro |\dlm@setvar| enables variable size,
+% the macro |\dlm@setsize| sets a fixed size.
+% Delimiter sizes are implented by |\dlm@big@|.
+% The macro |\kerndelim| adds some kerning proportional
+% to the chosen fixed size of the delimiters
+% (the spacing is merely an approximation,
+% and it does not actually scale for flexible size).
+%
+% \begin{macrocode}
+\newlength\delimsize
+\newcommand{\dlm@setvar}{\let\dlm@ifvar\@firstoftwo\delimsize1.5\big@size}
+\newcommand{\dlm@setsize}[1]{\let\dlm@ifvar\@secondoftwo%
+ \delimsize#1\big@size\advance\delimsize by\big@size\delimsize0.5\delimsize}
+\newcommand{\dlm@setabssize}[1]{\let\dlm@ifvar\@secondoftwo\delimsize#1\relax}
+\newcommand{\dlm@big@}[1]{{\mathchoice%
+ {\dlm@big@choice{\displaystyle}{1}{#1}}%
+ {\dlm@big@choice{\textstyle}{1}{#1}}%
+ {\dlm@big@choice{\scriptstyle}{0.7}{#1}}%
+ {\dlm@big@choice{\scriptscriptstyle}{0.5}{#1}}}}
+\newcommand{\dlm@big@choice}[3]{\@mathmeasure\z@{\nulldelimiterspace\z@}%
+ {#1\left#3\vcenter to#2\delimsize{}\right.}\box\z@}
+\newcommand{\kerndelim}[1]{{\delimsize#1\delimsize%
+ \mkern\muexpr1.2mu*\delimsize/\big@size\relax}}
+% \end{macrocode}
+
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% \paragraph{Math Classes Processing.}
+%
+% Define class selectors for fixed and unadjusted sizes.
%
% \begin{macrocode}
+\newcommand{\dlm@big}[2]{\dlm@plain{#1}{\dlm@big@#2}}
+\newcommand{\dlm@plain}[2]{\dlm@class{#1}{\dlm@phantom{#2}}}
\newcommand{\dlm@class}[1]{\csname dlm@class@#1\endcsname}
-\newcommand{\dlm@class@}{}
-\newcommand{\dlm@class@l}{\mathopen}
-\newcommand{\dlm@class@r}{\mathclose}
-\newcommand{\dlm@class@o}{\mathopen}
-\newcommand{\dlm@class@c}{\mathclose}
-\newcommand{\dlm@class@m}{\mathrel}
-\newcommand{\dlm@class@p}{\mathpunct}
-\newcommand{\dlm@class@b}{\mathbin}
-\newcommand{\dlm@norm}[1]{\dlm@class{#1}\bBigg@{0.0}}
-\newcommand{\dlm@big}[1]{\dlm@class{#1}\big}
-\newcommand{\dlm@Big}[1]{\dlm@class{#1}\Big}
-\newcommand{\dlm@bigg}[1]{\dlm@class{#1}\bigg}
-\newcommand{\dlm@Bigg}[1]{\dlm@class{#1}\Bigg}
+\let\dlm@class@\@firstofone
+\let\dlm@class@o\mathord
+\let\dlm@class@c\mathord
+\let\dlm@class@p\mathpunct
+\let\dlm@class@i\mathinner
+\let\dlm@class@b\mathbin
+\let\dlm@class@m\mathrel
+% \end{macrocode}
+
+% Define class selector for variable size.
+% The macro |\dlm@var@null| removes the extra space from
+% variable-size null delimiters
+% (|\left.|, |\middle.| and |\right.| apply the value
+% of |\nulldelimiterspace| only at the end of math processing,
+% even across blocks).
+% The macro |\dlm@var@kern| applies kerning unless in the script styles.
+%
+% \begin{macrocode}
+\newcommand{\dlm@var@null}[1]{\if.#1\kern-\nulldelimiterspace\fi}
+\newcommand{\dlm@var@kern}[1]{\nonscript\mkern#1}
\newcommand{\dlm@var}[1]{\csname dlm@var@#1\endcsname}
-\newcommand{\dlm@var@}[1]{\middle#1}
-\newcommand{\dlm@var@l}[1]{\mathopen{}\mathclose\bgroup\left#1}
-\newcommand{\dlm@var@r}[1]{\right#1\egroup}
-\newcommand{\dlm@var@o}[1]{\mathopen{}\middle#1\mathopen{}}
-\newcommand{\dlm@var@c}[1]{\mathclose{}\middle#1\mathclose{}}
-\newcommand{\dlm@var@m}[1]{\mathrel{}\middle#1\mathrel{}}
-\newcommand{\dlm@var@p}[1]{\middle#1\mathpunct{}}
-\newcommand{\dlm@var@b}[1]{\mathbin{}{}\mkern-\medmuskip%
- \middle#1\mkern-\medmuskip{}\mathbin{}}
+\newcommand{\dlm@var@}[1]{\dlm@var@null#1\middle#1}
+\let\dlm@var@o\dlm@var@
+\let\dlm@var@c\dlm@var@
+\newcommand{\dlm@var@p}[1]{\dlm@var@#1\dlm@var@kern\thinmuskip}
+\newcommand{\dlm@var@i}[1]{\dlm@var@kern\thinmuskip%
+ \dlm@var@#1\dlm@var@kern\thinmuskip}
+\newcommand{\dlm@var@b}[1]{\dlm@var@kern\medmuskip%
+ \dlm@var@#1\dlm@var@kern\medmuskip}
+\newcommand{\dlm@var@m}[1]{\dlm@var@kern\thickmuskip%
+ \dlm@var@#1\dlm@var@kern\thickmuskip}
+% \end{macrocode}
+
+% Definitions for selecting outer math class
+% |\mathopen|+|\mathclose| vs. |\mathinner|.
+%
+% \begin{macrocode}
+\newcommand{\dlm@open@i}{\mathinner{}\mathclose{}\mathopen}
+\newcommand{\dlm@close@i}{\mathclose{}\mathopen{}\mathinner}
+\newcommand{\dlm@inner@oc}{\mathopen{}\mathclose}
+\newcommand{\dlm@enclose@openclose}{%
+ \let\dlm@open\mathopen\let\dlm@close\mathclose\let\dlm@inner\dlm@inner@oc}
+\newcommand{\dlm@enclose@inner}{%
+ \let\dlm@open\dlm@open@i\let\dlm@close\dlm@close@i\let\dlm@inner\mathinner}
+% \end{macrocode}
+
+% Definitions for selecting inline vs. block insertion.
+%
+% \begin{macrocode}
+\newcommand{\dlm@inline@l}[1]{\dlm@open{#1}}
+\newcommand{\dlm@inline@r}[1]{\dlm@close{#1}}
+\newcommand{\dlm@block@l}[1]{\dlm@inner\bgroup\mathopen{#1}}
+\newcommand{\dlm@block@r}[1]{\mathclose{#1}\egroup}
+\newcommand{\dlm@enclose@inline}{%
+ \let\dlm@class@l\dlm@inline@l\let\dlm@class@r\dlm@inline@r}
+\newcommand{\dlm@enclose@block}{%
+ \let\dlm@class@l\dlm@block@l\let\dlm@class@r\dlm@block@r}
+% \end{macrocode}
+
+% Opening and closing definitions.
+%
+% \begin{macrocode}
+\newcommand{\dlm@plain@l}[1]{\dlm@class@l{\dlm@phantom{#1}}}
+\newcommand{\dlm@plain@r}[1]{\dlm@class@r{\dlm@phantom{#1}}}
+\newcommand{\dlm@big@l}[1]{\dlm@plain@l{\dlm@big@#1}}
+\newcommand{\dlm@big@r}[1]{\dlm@plain@r{\dlm@big@#1}}
+\newcommand{\dlm@var@l}[1]{\dlm@inner\bgroup\dlm@var@null#1\left#1}
+\newcommand{\dlm@var@r}[1]{\right#1\dlm@var@null#1\egroup}
+\newcommand{\dlm@var@pl}[1]{\dlm@var@l.\mathopen{#1}}
+\newcommand{\dlm@var@pr}[1]{\mathclose{#1}\dlm@var@r.}
+% \end{macrocode}
+
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% \paragraph{Delimiter Storage.}
+%
+% Macros for storing and retrieving delimiter types using global registers.
+%
+% \begin{macrocode}
+\newcommand{\dlm@reg@save@init}[1]{%
+ \xdef#1{\delimsize\the\delimsize}\ifx\dlm@inner\mathinner%
+ \expandafter\gdef\expandafter#1\expandafter{#1\dlm@enclose@inner}\fi}
+\newcommand{\dlm@reg@save}[2]{%
+ \expandafter\dlm@reg@save@init\csname dlm@reg@init@#1\endcsname%
+ \expandafter\gdef\csname dlm@reg@sel@#1\endcsname{#2}}
+\newcommand{\dlm@reg@init}[1]{\csname dlm@reg@init@#1\endcsname}
+\newcommand{\dlm@reg@sel}[1]{\csname dlm@reg@sel@#1\endcsname}
% \end{macrocode}
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-% \paragraph{Optional Size Argument Processing.}
+% \paragraph{Flags Processing.}
%
-% Parse the optional argument following |\delim|\ldots\
-% commands to specify the size of delimiters.
-% If the next character in line begins a group (`|{|') it is assumed that
-% there is no optional argument.
-% Otherwise the selected size is written to |\dlm@arg|.
-% Unspecified or unknown sizes default to normal size.
-% Finally, execute the code passed as an explicit argument to |\dlm@parsesize|.
+% The macro |\parsedelimflags| parses the optional argument(s)
+% following |\delim|\ldots\ commands to adjust the presentation.
+% Parsing is terminated if the next character in line begins a group (`|{|')
+% and the delimiter set is composed by executing argument |#1|.
+% A size flag is stored and parsing continues.
+% A delimiter selector flag immediately displays the desired delimiter
+% by executing argument |#2|.
+% Unknown flags produce an error message.
%
% \begin{macrocode}
-\newcommand{\dlm@parsesize}[1]{\@ifnextchar\bgroup%
- {\dlm@parsesize@{#1}{0}}{\dlm@parsesize@{#1}}}
-\newcommand{\dlm@parsesize@}[2]{\let\dlm@arg\dlm@norm%
- \if0#2\let\dlm@arg\dlm@norm\fi%
- \if1#2\let\dlm@arg\dlm@big\fi%
- \if+#2\let\dlm@arg\dlm@big\fi%
- \if!#2\let\dlm@arg\dlm@big\fi%
- \if2#2\let\dlm@arg\dlm@Big\fi%
- \if3#2\let\dlm@arg\dlm@bigg\fi%
- \if4#2\let\dlm@arg\dlm@Bigg\fi%
- \if*#2\let\dlm@arg\dlm@var\fi%
- #1}
+\newcommand{\parsedelimflags}{\dlm@setsize{0.6}\let\dlm@phantom\@firstofone%
+ \dlm@enclose@openclose\dlm@enclose@inline\dlm@parseflags}
+\newcommand{\dlm@parseflags}[2]{%
+ \@ifnextchar\bgroup{#1}{\dlm@parseflag{#1}{#2}}}
+\newcommand{\dlm@parseflag}[3]{\begingroup%
+ \ifcsname dlm@parseflag@\string#3\endcsname%
+ \def\dlm@do{\csname dlm@parseflag@\string#3\endcsname{#1}{#2}}\else%
+ \def\dlm@do{\PackageError{delimset}%
+ {unknown delimiter set flag `\string#3'}{}#1}%
+ \fi\expandafter\endgroup\dlm@do}
+\newcommand{\dlm@parsedef}[3]{%
+ \expandafter\def\csname dlm@parseflag@\string#1\endcsname ##1##2#2{#3}}
% \end{macrocode}
+%
% Note that the delimited expression should be contained within a group
% such that nested delimiters will not overwrite the outer size definition.
+% Flags to adjust size.
+% Note that sizes 0 and 1 amount to 0.96 and 1.2 times
+% the current empty math box height.
+%
+% \begin{macrocode}
+\dlm@parsedef{!}{}{\dlm@setsize{1}\dlm@parseflags{#1}{#2}}
+\dlm@parsedef{+}{}{\dlm@setsize{1}\dlm@parseflags{#1}{#2}}
+\dlm@parsedef{0}{}{\dlm@setsize{0.6}\dlm@parseflags{#1}{#2}}
+\dlm@parsedef{1}{}{\dlm@setsize{1}\dlm@parseflags{#1}{#2}}
+\dlm@parsedef{2}{}{\dlm@setsize{2}\dlm@parseflags{#1}{#2}}
+\dlm@parsedef{3}{}{\dlm@setsize{3}\dlm@parseflags{#1}{#2}}
+\dlm@parsedef{4}{}{\dlm@setsize{4}\dlm@parseflags{#1}{#2}}
+\dlm@parsedef{^}{#3}{\dlm@setsize{#3}\dlm@parseflags{#1}{#2}}
+\dlm@parsedef{_}{#3}{\dlm@setabssize{#3}\dlm@parseflags{#1}{#2}}
+\dlm@parsedef{*}{}{\dlm@setvar\dlm@parseflags{#1}{#2}}
+% \end{macrocode}
+
+% Flags to select individual delimiters.
+%
+% \begin{macrocode}
+\dlm@parsedef{(}{}{\def\selecteddelim{0}#2}
+\dlm@parsedef{|}{}{\def\selecteddelim{1}#2}
+\dlm@parsedef{,}{}{\def\selecteddelim{1}#2}
+\dlm@parsedef{)}{}{\def\selecteddelim{9}#2}
+\dlm@parsedef{?}{#3}{\def\selecteddelim{#3}#2}
+% \end{macrocode}
+
+% Flags to access registers.
+%
+% \begin{macrocode}
+\dlm@parsedef{[}{}{\dlm@reg@save{.}{#2}\def\selecteddelim{0}#2}
+\dlm@parsedef{]}{}{\dlm@reg@init{.}\def\selecteddelim{9}\dlm@reg@sel{.}}
+\dlm@parsedef{>}{#3}{\dlm@reg@save{#3}{#2}}
+\dlm@parsedef{<}{#3}{\dlm@reg@init{#3}\dlm@parseflags%
+ {\PackageError{delimset}{must select delimiter}{}}{\dlm@reg@sel{#3}}}
+% \end{macrocode}
+
+% Further flags.
+%
+% \begin{macrocode}
+\dlm@parsedef{.}{}{#1}
+\dlm@parsedef{:}{}{\dlm@enclose@block\dlm@parseflags{#1}{#2}}
+\dlm@parsedef{'}{}{\dlm@enclose@openclose\dlm@parseflags{#1}{#2}}
+\dlm@parsedef{"}{}{\dlm@enclose@inner\dlm@parseflags{#1}{#2}}
+\dlm@parsedef{-}{}{\let\dlm@phantom\phantom\dlm@parseflags{#1}{#2}}
+% \end{macrocode}
+
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-% \paragraph{Size Selection.}
+% \paragraph{Delimiter Display.}
%
-% The command |\selectdelim| reproduces the delimiter in the second argument
-% using the math class given in the first argument
-% using the previously selected size stored in |\dlm@arg|.
-% It appends the class identifier to the command stored in |\dlm@arg|
-% and calls the latter with the delimiter as the argument.
+% The command |\selectdelim| reproduces the delimiter in argument |#2|
+% using the math class given in argument |#1| and the previously stored size.
% If the class identifier is `|.|', just return the delimiter argument as is.
+% The commands |\selectdeliml| and |\selectdelimr|
+% implement the left and right delimiter classes, respectively.
+%
% \begin{macrocode}
-\newcommand{\selectdelim}[2][]{\if.#1#2\else\dlm@arg{#1}#2\fi}
+\newcommand{\selectdelim}[1][]{\begingroup\def\dlm@do{\@ifstar{\dlm@plain{#1}}%
+ {\dlm@ifvar{\dlm@var{#1}}{\dlm@big{#1}}}}%
+ \if.#1\let\dlm@do\@empty\fi\expandafter\endgroup\dlm@do}
+\newcommand{\selectdeliml}{\@ifstar%
+ {\dlm@ifvar\dlm@var@pl\dlm@plain@l}{\dlm@ifvar\dlm@var@l\dlm@big@l}}
+\newcommand{\selectdelimr}{\@ifstar%
+ {\dlm@ifvar\dlm@var@pr\dlm@plain@r}{\dlm@ifvar\dlm@var@r\dlm@big@r}}
% \end{macrocode}
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% \paragraph{Declaration of New Delimiter Commands.}
%
-% Declares a new set of delimiters as the macro `|\|\emph{name}'.
-% This macro checks for an optional size argument and stores it in |\dlm@arg|.
+% The macro |\DeclareMathDelimiterSet| declares a new set of delimiters
+% as the macro `|\|\emph{name}'.
+% This macro checks for optional flags and stores the desired size.
% It then passes on to a second macro `|\dlm@dcl@|\emph{name}',
% which takes the actual code.
+% If the flags select an individual delimiter,
+% the macro `|\dlm@sel@|\emph{name}' is called instead.
+% The latter macro should be defined via |\DeclareMathDelimiterSel|
+% such that it produces the desired delimiter number |\selecteddelim|.
+%
% \begin{macrocode}
\newcommand{\DeclareMathDelimiterSet}[1]{\expandafter\dlm@declare%
\csname dlm@dcl@\expandafter\@gobble\string#1\endcsname{#1}}
-\def\dlm@declare#1#2{\newcommand{#2}{\dlm@parsesize{#1}}\newcommand{#1}}
+\def\dlm@declare#1#2{\expandafter\dlm@declare@%
+ \csname dlm@sel@\expandafter\@gobble\string#2\endcsname{#1}{#2}}
+\def\dlm@declare@#1#2#3{\newcommand{#3}{\parsedelimflags{#2}{#1}}%
+ \providecommand{#1}{}\newcommand{#2}}
+\newcommand{\DeclareMathDelimiterSel}[3]{\expandafter\def%
+ \csname dlm@sel@\expandafter\@gobble\string#1\endcsname%
+ {\ifcase\selecteddelim#2\else#3\fi}}
% \end{macrocode}
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -1212,29 +1866,51 @@ alternative representation:
% are processed \emph{before} the optional size modifier.
%
% |\delim| is used for a single delimited expression.
+%
% \begin{macrocode}
-\newcommand{\delim}[2]
- {\dlm@parsesize{\dlm@dcl@delim{#1}{#2}}}
-\newcommand{\dlm@dcl@delim}[3]
- {\selectdelim[l]#1{#3}\selectdelim[r]#2}
+\newcommand{\delim}[2]{%
+ \parsedelimflags{\dlm@dcl@delim{#1}{#2}}{\dlm@sel@delim{#1}{#2}}}
+\newcommand{\dlm@dcl@delim}[3]{%
+ \selectdeliml#1{#3}\selectdelimr#2}
+\newcommand{\dlm@sel@delim}[2]{\ifcase\selecteddelim\selectdeliml#1%
+ \else\selectdelimr#2\fi}
% \end{macrocode}
% |\delimpair| is used for two delimited expressions separated
% by an intermediate delimiter.
+%
% \begin{macrocode}
-\newcommand{\delimpair}[3]
- {\dlm@parsesize{\dlm@dcl@delimpair{#1}{#2}{#3}}}
-\newcommand{\dlm@dcl@delimpair}[5]
- {\selectdelim[l]#1{#4}\selectdelim#2{#5}\selectdelim[r]#3}
+\newcommand{\delimpair}[3]{%
+ \parsedelimflags{\dlm@dcl@delimpair{#1}{#2}{#3}}%
+ {\dlm@sel@delimpair{#1}{#2}{#3}}}
+\newcommand{\dlm@dcl@delimpair}[5]{%
+ \selectdeliml#1{#4}\selectdelim#2{#5}\selectdelimr#3}
+\newcommand{\dlm@sel@delimpair}[3]{\ifcase\selecteddelim\selectdeliml#1%
+ \or\selectdelim#2\else\selectdelimr#3\fi}
% \end{macrocode}
% |\delimtriple| is used for three delimited expressions separated
% by two intermediate delimiters.
+%
% \begin{macrocode}
-\newcommand{\delimtriple}[4]
- {\dlm@parsesize{\dlm@dcl@delimtriple{#1}{#2}{#3}{#4}}}
-\newcommand{\dlm@dcl@delimtriple}[7]
- {\selectdelim[l]#1{#5}\selectdelim#2{#6}\selectdelim#3{#7}\selectdelim[r]#4}
+\newcommand{\delimtriple}[4]{%
+ \parsedelimflags{\dlm@dcl@delimtriple{#1}{#2}{#3}{#4}}%
+ {\dlm@sel@delimtriple{#1}{#2}{#3}{#4}}}
+\newcommand{\dlm@dcl@delimtriple}[7]{%
+ \selectdeliml#1{#5}\selectdelim#2{#6}\selectdelim#3{#7}\selectdelimr#4}
+\newcommand{\dlm@sel@delimtriple}[4]{\ifcase\selecteddelim\selectdeliml#1%
+ \or\selectdelim#2\or\selectdelim#3\else\selectdelimr#4\fi}
+% \end{macrocode}
+
+% |\usedelim| retrieves a stored delimiter type.
+% The argument `|]|' immediately closes the delimiter set
+% using the default register.
+% Otherwise the desired register must be followed
+% by the delimiter selection flag.
+%
+% \begin{macrocode}
+\newcommand{\usedelim}{\@ifnextchar]{\parsedelimflags{}{}}{\parsedelimflags%
+ {\PackageError{delimset}{must select delimiter}{}}{}<}}
% \end{macrocode}
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -1243,17 +1919,18 @@ alternative representation:
% Define some common delimiters (by |providecommand| so as not to
% overwrite previously existing commands).
% This code is activated only if the package option |stddef| is set to |true|.
+%
% \begin{macrocode}
\ifdlm@std
\providecommand{\brk}[1][r]{\begingroup\def\dlm@use{\delim()}%
- \if r#1 \def\dlm@use{\delim()}\fi%
- \if s#1 \def\dlm@use{\delim[]}\fi%
- \if c#1 \def\dlm@use{\delim\{\}}\fi%
- \if a#1 \def\dlm@use{\delim<>}\fi%
+ \if r#1\def\dlm@use{\delim()}\fi%
+ \if s#1\def\dlm@use{\delim[]}\fi%
+ \if c#1\def\dlm@use{\delim\{\}}\fi%
+ \if a#1\def\dlm@use{\delim<>}\fi%
\expandafter\endgroup\dlm@use}
\providecommand{\eval}[1][v]{\begingroup\def\dlm@use{\delim.\rvert}%
- \if v#1 \def\dlm@use{\delim.\rvert}\fi%
- \if s#1 \def\dlm@use{\delim[]}\fi%
+ \if v#1\def\dlm@use{\delim.\rvert}\fi%
+ \if s#1\def\dlm@use{\delim[]}\fi%
\expandafter\endgroup\dlm@use}
\providecommand{\abs}{\delim\lvert\rvert}
\providecommand{\norm}{\delim\lVert\rVert}
@@ -1265,24 +1942,33 @@ alternative representation:
%
% Define some extended delimiters.
% This code is activated only if the package option |extdef| is set to |true|.
+%
% \begin{macrocode}
\ifdlm@ext
-\providecommand{\pair}{\delimpair({[.],})}
+\providecommand{\pair}{\delimpair({[p]*,})}
\providecommand{\set}{\delim\{\}}
\providecommand{\setcond}{\delimpair\{|\}}
-\providecommand{\intv}[1][c]{\begingroup\def\dlm@use{\delimpair[{[.],}]}%
- \if c#1 \def\dlm@use{\delimpair[{[.],}]}\fi%
- \if l#1 \def\dlm@use{\delimpair]{[.],}]}\fi%
- \if r#1 \def\dlm@use{\delimpair[{[.],}[}\fi%
- \if o#1 \def\dlm@use{\delimpair]{[.],}[}\fi%
+\providecommand{\intv}[1][c]{\begingroup%
+ \def\dlm@use{\delimpair[{[p]*,}]}%
+ \if c#1\def\dlm@use{\delimpair[{[p]*,}]}\fi%
+ \if l#1\def\dlm@use{\delimpair]{[p]*,}]}\fi%
+ \if r#1\def\dlm@use{\delimpair[{[p]*,}[}\fi%
+ \if o#1\def\dlm@use{\delimpair]{[p]*,}[}\fi%
\expandafter\endgroup\dlm@use}
\providecommand{\avg}{\delim<>}
\providecommand{\corr}{\delim<>}
-\providecommand{\comm}{\delimpair[{[.],}]}
-\providecommand{\acomm}{\delimpair\{{[.],}\}}
+\providecommand{\comm}{\delimpair[{[p]*,}]}
+\providecommand{\acomm}{\delimpair\{{[p]*,}\}}
\providecommand{\bra}{\delim<|}
\providecommand{\ket}{\delim|>}
\providecommand{\braket}{\delimpair<|>}
+\providecommand{\lfrac}[1][]{\begingroup%
+ \def\dlm@use{\delimpair./.}%
+ \if r#1\def\dlm@use{\delimpair(/)}\fi%
+ \if s#1\def\dlm@use{\delimpair[/]}\fi%
+ \if c#1\def\dlm@use{\delimpair\{/\}}\fi%
+ \if a#1\def\dlm@use{\delimpair</>}\fi%
+ \expandafter\endgroup\dlm@use}
\fi
% \end{macrocode}
diff --git a/Master/texmf-dist/source/latex/delimset/delimset.ins b/Master/texmf-dist/source/latex/delimset/delimset.ins
index daf870b5ff8..68e41a72428 100644
--- a/Master/texmf-dist/source/latex/delimset/delimset.ins
+++ b/Master/texmf-dist/source/latex/delimset/delimset.ins
@@ -2,7 +2,7 @@
\input docstrip.tex
\keepsilent
-% delimset.ins Copyright (C) 2016-2018 Niklas Beisert
+% delimset.ins Copyright (C) 2016-2024 Niklas Beisert
%
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
@@ -14,7 +14,7 @@
\preamble
-Copyright (C) 2016-2018 Niklas Beisert
+Copyright (C) 2016-2024 Niklas Beisert
This work may be distributed and/or modified under the
conditions of the LaTeX Project Public License, either version 1.3
diff --git a/Master/texmf-dist/source/latex/doibanner/doibanner.dtx b/Master/texmf-dist/source/latex/doibanner/doibanner.dtx
new file mode 100644
index 00000000000..e004b53e313
--- /dev/null
+++ b/Master/texmf-dist/source/latex/doibanner/doibanner.dtx
@@ -0,0 +1,412 @@
+% \iffalse meta-comment
+%
+% Copyright (C) 2024 Christian Schreinemachers
+%
+% This work 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
+%
+% http://www.latex-project.org/lppl.txt
+%
+% and version 1.3c or later is part of all distributions of LaTeX
+% version 2008-05-04 or later.
+%
+% This work has the LPPL maintenance status `maintained'.
+%
+% The current maintainer of this work is Christian Schreinemachers.
+%
+% This work consists of the files
+% doibanner.dtx
+% doibanner.ins
+% README.md
+% and the derived files
+% doibanner.sty
+% doibanner.pdf
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% \fi
+% \iffalse
+%<package>\NeedsTeXFormat{LaTeX2e}
+%<package>\ProvidesPackage{doibanner}
+%<package> [2024-07-28 v0.3 Generate DOI banners and links]
+%
+%<*driver>
+\documentclass[a4paper]{ltxdoc}
+\usepackage[%
+ pdfusetitle,%
+ hyperindex=false,%
+ pdfsubject={LaTeX package documentation},%
+ pdfkeywords={doibanner, latex, documentation}%
+]{hyperref}
+\usepackage{doibanner}
+\usepackage[toc]{multitoc}
+\usepackage{geometry}
+\usepackage{fancyvrb}
+\EnableCrossrefs
+\CodelineIndex
+\RecordChanges
+\DoNotIndex{\adjustbox,\begin,\bfseries,\DeclareKeys,\definecolor,\end,\fill,
+ \fontfamily,\href,\IfBooleanTF,\Large,\NewDocumentCommand,\node,
+ \ProcessKeyOptions,\RequirePackage,\relax,\selectfont,\SetKeys,
+ \sfdefault,\tikzstyle}
+\setcounter{IndexColumns}{2}
+\setlength{\IndexMin}{40ex}
+\setlength{\columnseprule}{.4pt}
+\addtolength{\oddsidemargin}{2cm}
+\addtolength{\textwidth}{-2cm}
+\begin{document}
+ \DocInput{doibanner.dtx}
+\end{document}
+%</driver>
+% \fi
+%
+% \pagestyle{headings}
+%
+% \newcommand*{\package}[1]{\textsf{#1}}
+% \newcommand*{\opt}[1]{\texttt{#1}}
+% \newcommand*{\default}[1]{(default: \opt{#1})}
+%
+%
+% ^^A -----------------------------
+%
+% \changes{v0.3}{2024-07-28}{%
+% Add package options \opt{width} and \opt{label},
+% fix mistakes,
+% improve documentation,
+% remove unnecessary dependencies}
+% \changes{v0.2}{2024-07-23}{%
+% Initial release,
+% convert into dtx,
+% add documentation,
+% add \opt{urlbase} package option}
+% \changes{v0.1}{2021/05/09}{Initial version}
+%
+% \GetFileInfo{doibanner.sty}
+%
+%
+% ^^A -----------------------------
+%
+% \title{The \package{doibanner} package}
+% \author{Christian Schreinemachers}
+% \date{%
+% Released \filedate\thanks{%
+% \package{doibanner}~\fileversion
+% ~(\href{https://codeberg.org/Cs137/doibanner/releases/tag/\fileversion}{source code})}%
+% }
+% \maketitle
+%
+%
+% ^^A -----------------------------
+%
+% \begin{abstract}
+% The \package{doibanner} package allows to generate a banner for a declared
+% \href{https://www.doi.org/the-identifier/what-is-a-doi/}{digital object identifier}
+% (DOI). It provides the \cs{doibanner} macro, which draws the banner using
+% \package{TikZ} and adds a link via \package{hyperref}, if desired. Its
+% output can be scaled by \package{adjustbox} and it might look as follows:
+% \par\medskip\centering{\doibanner*[width=5cm]{xx.xxxx/yyyyyy.zzzzzzzz}}
+% \end{abstract}
+%
+%
+% ^^A -----------------------------
+%
+% \tableofcontents
+%
+%
+% ^^A -----------------------------
+%
+% \section{Introduction}
+% ^^A
+% I published several documents on \href{https://zenodo.org/}{\emph{Zenodo}},
+% a general-purpose open repository. They offer to register a
+% \href{https://www.doi.org/the-identifier/what-is-a-doi/}{digital object identifier}
+% (DOI) for an entry and download a banner of it. The latter can be added to
+% contents foreseen for the entry, or e.g. when referring to the entry in a
+% slide deck.
+%
+% Since I frequently use such banners in \LaTeX{} documents, I decided to
+% create a package that generates a similar banner and includes a link to the
+% corresponding URL. Additionally, this package eliminates the need to
+% manually download the banner and manage a file that might be used across
+% multiple documents.
+%
+% Due to the motivation, the resulting banner is heavily inspired by the
+% design applied in the banner offered by \emph{Zenodo}. It is drawn using
+% the \package{tikz} package, a link to its URL can be included with
+% \package{hyperref}, and it can be scaled using \package{adjustbox}.
+%
+% The application of this package is not limited to \emph{Zenodo}
+% depositions, it can be used to create a banner for a DOI that can
+% be included in any \LaTeX{} document.
+%
+%
+% ^^A -----------------------------
+%
+% \section{Usage}
+% ^^A
+% Load the package in your document's preamble and specify any of the
+% options described in the next subsection as follows:
+%
+% \begin{quote}
+% \cs{usepackage}\oarg{option(s)}\{doibanner\}
+% \end{quote}
+%
+%
+% ^^A -----------------------------
+%
+% \subsection{Options}
+% ^^A
+% In order to change the default behaviour of this package, declare one
+% or more of the options described in this subsection with your desired
+% value.
+%
+% \DescribeMacro{label=\meta{string}}
+% \default{DOI} specifies the label (left part) of the DOI banner generated
+% by \cs{doibanner}. The widths of the left and right part of the banner
+% are fixed and do currently not take the length of the text displayed on
+% top into account. Consequently, only a short expression should be declared
+% as value for the option \opt{label}.
+%
+% \DescribeMacro{urlbase=\meta{string}}
+% \default{https://doi.org/} specifies the base URL to convert a DOI string
+% into its URL, for normal use cases this does not require any adjustment.
+%
+% \DescribeMacro{width=\meta{dimen}}
+% \default{3.6cm} specifies the total width of the DOI banner generated by
+% \cs{doibanner}. The widths of the individual parts of the banner are
+% fixed and can currently not be changed.
+%
+%
+% ^^A -----------------------------
+%
+% \subsection{Macros}
+% ^^A
+% \subsubsection*{\cs{doibanner}\oarg{dimen}\marg{string}}
+%
+% A DOI banner can be created using the command \cs{doibanner}, which requires
+% a DOI string as argument. Moreover, a \oarg{dimen} option can be defined.
+% The latter specifies the banner's width. If it is not declared, the value
+% of the \opt{width} package option is taken into account \default{3.6cm}.
+%
+% \DescribeMacro{\doibanner}
+% An execution of \cs{doibanner\{xx.xxxx/yyyyyy.zzzzzzzz\}} results in this
+% banner: \doibanner{xx.xxxx/yyyyyy.zzzzzzzz} If a banner with a width of
+% let's say 3\,cm is desired, it can be achieved by specifying the macro option
+% \opt{width} accordingly (\cs{doibanner}\opt{[width=3cm]\{xx.xxxx/yyyyyy.zzzzzzzz\}}):
+% \doibanner[width=3cm]{xx.xxxx/yyyyyy.zzzzzzzz}
+%
+% \DescribeMacro{\doibanner*}
+% The starred version of the command leads to the same banner, but it does
+% not contain a link to the DOI's URL:
+% \doibanner*{xx.xxxx/yyyyyy.zzzzzzzz}
+%
+% \subsubsection*{\cs{doiurl}\marg{string}}
+% ^^A
+% \DescribeMacro{\doiurl}
+% An URL is generated by appending the provided \emph{string} to the string
+% defined as the package option \opt{urlbase}. The resulting link is labelled
+% with the DOI string.
+% A call of \cs{doiurl\{xx.xxxx/yyyyyy.zzzzzzzz\}} results in
+% \doiurl{xx.xxxx/yyyyyy.zzzzzzzz}.
+%
+% \DescribeMacro{\doiurl*}
+% The command is also available as starred version, which prints the full
+% URL instead of the DOI string and does not include a link. Its output for
+% the aforementioned example is as follows:
+% \doiurl*{xx.xxxx/yyyyyy.zzzzzzzz}.
+%
+%
+% ^^A -----------------------------
+%
+% ^^A \section{Known limitations}
+% ^^A ^^A
+% ^^A \begin{itemize}
+% ^^A \item
+% ^^A \end{itemize}
+%
+%
+% ^^A -----------------------------
+%
+% \MaybeStop{
+%
+% \IndexPrologue{%
+% \section{Index}
+% Numbers written in italic refer to the page where the corresponding entry
+% is described; numbers underlined refer to the code line of the definition;
+% numbers in roman refer to the code lines where the entry is used.
+% }
+% \PrintIndex
+%
+% \GlossaryPrologue{%
+% \section{Change History}
+% The changes listed in this section aim to provide a brief overview of the
+% changes introduced into the package \package{doibanner}. The
+% \href{https://codeberg.org/Cs137/doibanner/}{package repository on Codeberg}
+% contains a
+% \href{https://codeberg.org/Cs137/doibanner/src/branch/main/CHANGELOG.md}{changelog file},
+% consult it to read a detailed description of the changes introduced into
+% this package.
+% }
+% \PrintChanges
+%
+% }
+%
+%
+% ^^A -----------------------------
+%
+% \section{Implementation}
+%
+% \subsection{Dependencies}
+% ^^A
+% In order to use \package{doibanner}, the packages
+% \href{https://www.ctan.org/pkg/adjustbox}{\package{adjustbox}},
+% \href{https://www.ctan.org/pkg/hyperref}{\package{hyperref}}, and
+% \href{https://www.ctan.org/pkg/tikz}{\package{tkiz}}
+% are required as package dependencies.
+%
+% \iffalse
+%<*package>
+% \fi
+% \begin{macrocode}
+\RequirePackage{adjustbox}
+\RequirePackage{hyperref}
+\RequirePackage{tikz}
+% \end{macrocode}
+%
+%
+% ^^A -----------------------------
+%
+% \subsection{Constants}
+% ^^A
+% Definition of colours for the banner areas and labels, custom colour
+% definitions are currently not supported.
+% \begin{macrocode}
+\definecolor{leftcolor}{RGB}{82,82,82}
+\definecolor{rightcolor}{RGB}{6,119,183}
+%
+\definecolor{toptextcolor}{RGB}{235,235,235}
+\definecolor{bottomtextcolor}{RGB}{59,59,59}
+% \end{macrocode}
+% ^^A
+% Definition of font and colour for the banner's top and bottom text layers.
+% \begin{macrocode}
+\tikzstyle{toptextstyle} = [
+ font=\fontfamily{\sfdefault}\selectfont\bfseries\Large,toptextcolor]
+\tikzstyle{bottomtextstyle} = [
+ font=\fontfamily{\sfdefault}\selectfont\bfseries\Large,bottomtextcolor]
+% \end{macrocode}
+%
+%
+% ^^A -----------------------------
+%
+% \subsection{Options}
+% ^^A
+% The package options are internally available as \cs{@doibanner@}\meta{option}.
+% \begin{macrocode}
+\DeclareKeys[@doibanner]{
+ label.store = \@doibanner@label,
+ label.usage = load,
+ urlbase.store = \@doibanner@urlbase,
+ urlbase.usage = load,
+ width.store = \@doibanner@width,
+ width.usage = load,
+}
+% \end{macrocode}
+%
+% \subsubsection*{Assignement of default values}
+% \begin{macrocode}
+\SetKeys[@doibanner]{
+ label=DOI,
+ urlbase=https://doi.org/,
+ width=3.6cm,
+}
+% \end{macrocode}
+%
+% \subsubsection*{Processing of package options}
+% \begin{macrocode}
+\ProcessKeyOptions[@doibanner]\relax
+% \end{macrocode}
+%
+%
+% ^^A -----------------------------
+%
+% \subsection{Macros}
+%
+% \changes{v0.2}{2024-07-23}{Remove \cs{doi} macro}
+%
+% \begin{macro}{\doiurl}
+% \changes{v0.2}{2024-07-23}{Remove trailing space}
+% \oarg{dimen}\\
+% The \meta{string} is appended to the package option \opt{urlbase} to
+% generate the URL.
+% \begin{macrocode}
+\NewDocumentCommand\doiurl{s m}{%
+ \IfBooleanTF#1
+ {\@doibanner@urlbase#2}%
+ {\href{\@doibanner@urlbase#2}{#2}}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@doibanner@draw}
+% \changes{v0.3}{2024-07-28}{Rename macro, remove top part}
+% \oarg{dimen}\marg{string}\\
+% Draw the DOI banner including its \opt{label} and \meta{string}, provide
+% \opt{width=\meta{dimen}} to define the banners width as well.
+% \begin{macrocode}
+\NewDocumentCommand\@doibanner@draw{o m}{%
+ \adjustbox{#1}{%
+ \begin{tikzpicture}
+% left part
+ \fill [leftcolor,draw]
+ (1.5,0) --
+ ++(0,.8) {[rounded corners=5] --
+ ++(-1.5,0) --
+ ++(0,-.8)} --
+ cycle
+ {};
+ \node[bottomtextstyle] at (.75,.35) {\@doibanner@label};
+ \node[toptextstyle] at (.75,.4) {\@doibanner@label};
+% right part
+ \fill [rightcolor,draw]
+ (1.5,0) {[rounded corners=5] --
+ ++(6.5,0) --
+ ++(0,.8)} --
+ ++(-6.5,0) --
+ cycle
+ {};
+ \node[bottomtextstyle] at (4.75,.35) {#2};
+ \node[toptextstyle] at (4.75,.4) {#2};
+ \end{tikzpicture}%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\doibanner}
+% \changes{v0.3}{2024-07-28}{Add \opt{width} option}
+% \changes{v0.2}{2024-07-23}{Remove trailing space}
+% \oarg{dimen}\marg{string}\\
+% Display the DOI banner with or without (*) a link to its URL. Specify a
+% \oarg{dimen}, if you want a banner width deviating from the one defined
+% as \opt{width} package option.
+% \begin{macrocode}
+\NewDocumentCommand\doibanner{s O{width=\@doibanner@width} m}{%
+ \IfBooleanTF#1
+ {\@doibanner@draw[#2]{#3}}%
+ {\href{\@doibanner@urlbase#3}{\@doibanner@draw[#2]{#3}}}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \iffalse
+%</package>
+% \fi
+%
+% \Finale
+\endinput
+%%
+%% End of file `doibanner.dtx'.
+
diff --git a/Master/texmf-dist/source/latex/doibanner/doibanner.ins b/Master/texmf-dist/source/latex/doibanner/doibanner.ins
new file mode 100644
index 00000000000..97cfbb3fbb1
--- /dev/null
+++ b/Master/texmf-dist/source/latex/doibanner/doibanner.ins
@@ -0,0 +1,85 @@
+%%
+%% Copyright (C) 2024 Christian Schreinemachers
+%%
+%% This work 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
+%%
+%% http://www.latex-project.org/lppl.txt
+%%
+%% and version 1.3c or later is part of all distributions of
+%% LaTeX version 2008-05-04 or later.
+%%
+%% This work has the LPPL maintenance status `maintained'.
+%%
+%% The current maintainer of this work is Christian Schreinemachers.
+%%
+%% This work consists of the files
+%% doibanner.dtx
+%% doibanner.ins
+%% README.md
+%% and the derived files
+%% doibanner.sty
+%% doibanner.pdf
+%%
+This work has the LPPL maintenance status `maintained'.
+
+The current maintainer of this work is Christian Schreinemachers.
+
+This work consists of the files
+ doibanner.dtx
+ doibanner.ins
+ README.md
+and the derived files
+ doibanner.sty
+ doibanner.pdf
+\input docstrip.tex
+\keepsilent
+
+\preamble
+
+Copyright (C) 2024 Christian Schreinemachers
+
+This work 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
+
+ http://www.latex-project.org/lppl.txt
+
+and version 1.3c or later is part of all distributions of LaTeX
+version 2008-05-04 or later.
+
+This work has the LPPL maintenance status `maintained'.
+
+The current maintainer of this work is
+ Christian Schreinemachers.
+
+This work consists of the files
+ doibanner.dtx
+ doibanner.ins
+and the derived files
+ doibanner.sty
+ doibanner.pdf
+
+\endpreamble
+\askforoverwritefalse
+\generate{\file{doibanner.sty}{\from{doibanner.dtx}{package}}}
+
+\obeyspaces
+\Msg{****************************************************}
+\Msg{* To finish the installation you have to move the *}
+\Msg{* following file into a directory searched by TeX: *}
+\Msg{* *}
+\Msg{* doibanner.sty *}
+\Msg{* *}
+\Msg{* To produce the documentation run the file *}
+\Msg{* bib2qr.dtx through LaTeX. *}
+\Msg{* *}
+\Msg{* Happy TeXing! *}
+\Msg{****************************************************}
+\endbatchfile
+%%
+%% End of file `doibanner.ins'.
+
diff --git a/Master/texmf-dist/source/latex/easybook/easybook.dtx b/Master/texmf-dist/source/latex/easybook/easybook.dtx
index 86d3c17b322..30f78607955 100644
--- a/Master/texmf-dist/source/latex/easybook/easybook.dtx
+++ b/Master/texmf-dist/source/latex/easybook/easybook.dtx
@@ -14,13 +14,13 @@
% This work has the LPPL maintenance status `maintained'.
%<class|package>\NeedsTeXFormat{LaTeX2e}[2021/11/15]
%<*class>
-\ProvidesExplClass{easybook}{2024/06/18}{2024cf}
+\ProvidesExplClass{easybook}{2024/08/14}{2024dj}
{Easily typesetting Chinese theses or books}
\bool_new:N \l__eb_compile_draft_bool
\bool_new:N \l__eb_title_newline_bool
-\bool_set_true:N \l__eb_class_mode_book_bool
-\clist_new:N \g__eb_doc_options_clist
+\bool_set_true:N \l__eb_class_mode_book_bool
+\clist_new:N \g__eb_doc_options_clist
\cs_new_protected:Npn \eb_put_ctexbook:n #1
{ \PassOptionsToClass{#1}{ctexbook} }
\cs_generate_variant:Nn \eb_put_ctexbook:n { V }
@@ -66,10 +66,11 @@
\sys_if_engine_xetex:TF
{
- \cs_new_eq:NN \eb_set_family:nnn \xeCJK_set_family:nnn
+ \cs_new_eq:NN \eb_set_family:nnn \xeCJK_set_family:nnn
\cs_new_eq:NN \eb_switch_family:n \xeCJK_switch_family:n
- }{
- \cs_new_eq:NN \eb_set_family:nnn \ctex_ltj_set_family:nnn
+ }
+ {
+ \cs_new_eq:NN \eb_set_family:nnn \ctex_ltj_set_family:nnn
\cs_new_eq:NN \eb_switch_family:n \ctex_ltj_switch_family:n
}
\cs_generate_variant:Nn \eb_set_family:nnn { x }
@@ -300,7 +301,7 @@
%</class>
%<*package>
\RequirePackage{etoolbox}
-\ProvidesExplPackage{easybase}{2024/06/18}{2024cf}
+\ProvidesExplPackage{easybase}{2024/08/14}{2024dj}
{Easily typesetting Chinese theses or books}
\cs_generate_variant:Nn \dim_set:Nn { NV }
@@ -312,7 +313,7 @@
\cs_generate_variant:Nn \seq_set_from_clist:Nn { No }
\cs_generate_variant:Nn \ctex_define:nn { nx }
\cs_generate_variant:Nn \eb_set_hyperref:n { x }
-\cs_generate_variant:Nn \eb_at_begin_environment:nn { on }
+\cs_generate_variant:Nn \eb_at_begin_environment:nn { o }
\cs_generate_variant:Nn \tl_if_novalue:nF { V }
\cs_set_protected:Npn \ctex_define:nn #1
@@ -331,7 +332,7 @@
\clist_map_inline:nn {#1}
{ \AtBeginEnvironment{##1}{#2} }
}
-\cs_new_protected:Npn \eb_at_end_preamble:n
+\cs_set_protected:Npn \ctex_before_end_preamble:n
{ \BeforeBeginEnvironment{document} }
\cs_new_protected:Npn \eb_if_package_loaded:nnF #1#2#3
{
@@ -371,7 +372,11 @@
\IfNoValueTF{#1}
{\IfFileExists{#2.sty}{\RequirePackage{#2}[#3]}{}}
{\IfFileExists{#2.sty}{\RequirePackage[#1]{#2}[#3]}{}}
+ \IfFileExists{#2.sty}{}
+ {\msg_warning:nnn { easybase } { package-not-found } {#2}}
}
+\msg_new:nnn { easybase } { package-not-found }
+ { The~macro~package~'#1'~can't~be~found. }
\cs_new_protected:Npn \ebloadpackage #1
{
\int_compare:nTF { \clist_count:n {#1} <= 1 }
@@ -382,7 +387,7 @@
}
}
\providecommand{\NewHookWithArguments}[2]{}
-\ProvideDocumentCommand{\AddToHookWithArguments}{mom}{}
+\ProvideDocumentCommand{\AddToHookWithArguments}{mo+m}{}
\bool_set_true:N \l__eb_class_mode_book_bool
\bool_set_false:N \l__eb_compile_draft_bool
@@ -447,16 +452,16 @@
\seq_set_from_clist:Nn \l__eb_module_paths_seq
{
- tools,font,space,
- bib,thmt,toc,
- hdr,float,ref,geo
+ tools,font,space,bib,
+ thmt,toc,hdr,float,
+ ref,geo,cap
}
\seq_map_inline:Nn \l__eb_module_paths_seq
{
\ctex_define:n { #1 .meta:nn = { ctex/#1 } {##1} }
\cs_new_protected:cpn { eb#1set } ##1 { \ctex_set:nn {#1} {##1} }
}
-\RenewDocumentCommand{\ctexset}{om}
+\RenewDocumentCommand{\ctexset}{o+m}
{
\IfValueTF{#1}
{\ctex_set:nn {#1} {#2}}
@@ -504,7 +509,6 @@
\ebloadpackage
{
[text]{spbmark},
- [normalem]{ulem},
[{shortlabels,inline}]{enumitem},
chemformula,siunitx,pifont,
geometry,marginnote,
@@ -801,7 +805,7 @@
\UseFntSymbsList{empty}
\cs_set_eq:NN \DefineFntSymbols \SetFntSymbsList
\cs_set_eq:NN \setfntsymbol \UseFntSymbsList
-\cs_new:Npn \eb_int_format_trans:NN #1
+\cs_new:Npn \eb_int_type_trans:NN #1
{
\str_case:nn {#1}
{
@@ -836,29 +840,44 @@
}
\cs_set_eq:NN \thedownfootnote \thefootnote
}
+\cs_generate_variant:Nn \msg_warning:nnnn { nnnV }
\cs_new_protected:Npn \eb_fnmarktext_short_label_set:Nn #1#2
{
\tl_set:Nn \l__eb_fnmarktext_short_tokens_tl {#2}
\clist_map_inline:nn
{ A,a,1,I,i,c,s }
{
- \regex_match:nnT {##1} {#2}
+ \regex_match:nnTF {##1} {#2}
{
\regex_replace_once:nnN {##1}
- { \c{eb_int_format_trans:NN} ##1 \c{c@footnote} }
+ { \c{eb_int_type_trans:NN} ##1 \c{c@footnote} }
\l__eb_fnmarktext_short_tokens_tl
- \seq_map_break:
+ \cs_set_eq:NN #1 \l__eb_fnmarktext_short_tokens_tl
+ \clist_map_break:
+ }
+ {
+ \str_if_eq:nnT {##1} { s }
+ {
+ \str_if_eq:nnTF {#1} { \thefootnote }
+ { \str_set:Nn \l_tmpa_str { \thedownfootnote } }
+ { \str_set:Nn \l_tmpa_str { \theupfootnote } }
+ \msg_warning:nnnV { easybase } { unknown-fnt-type } {#2} \l_tmpa_str
+ }
}
}
- \cs_set_eq:NN #1 \l__eb_fnmarktext_short_tokens_tl
\cs_set_eq:NN \thedownfootnote \thefootnote
}
+\msg_new:nnn { easybase } { unknown-fnt-type }
+ {
+ The~'#1'~includes~unknown~footnote~numbering~type \\
+ in~#2.
+ }
\cs_new_protected:Npn \eb_footnote_value_handle:n #1
{
\str_case:nnF {#1}
{
{ bottom }
- { \bool_set_true:N \l__eb_fnpara_bottom_bool }
+ { \PushFntBottom }
{ flush }
{
\tl_set:Nn \l__eb_footnote_value_tl { plain }
@@ -891,7 +910,6 @@
}
}
-\bool_new:N \l__eb_fnpara_bottom_bool
\tl_new:N \l__eb_fnmarktext_format_tl
\tl_new:N \l__eb_fncustom_format_tl
\clist_new:N \l__eb_footnote_value_clist
@@ -939,7 +957,7 @@
unknown .code:n = \eb_msg_deprecated_option:n { hdr }
}
-\eb_at_end_preamble:n
+\ctex_before_end_preamble:n
{
\bool_if:NT \l__eb_chap_counter_withpart_bool
{ \counterwithin*{chapter}{part} }
@@ -949,58 +967,91 @@
{ page } { \counterwithin*{footnote}{page} }
}
{ \counterwithout*{footnote}{chapter} }
- \eb_fnpara_if_pos_bottom:
}
-\cs_new_protected:Npn \setspread #1 { \linespread{#1}\selectfont }
-\cs_new:Npn \eb@ifvoid #1#2#3 { \ifvoid #1#2\else #3\fi }
-\cs_new_protected:Npn \eb_fnpara_if_pos_bottom:
+
+\def\@if@footnotes@TF #1#2 {\ifvoid\footins #2\else #1\fi}
+\def\@outputbox@removebskip
{
- \bool_if:NT \l__eb_fnpara_bottom_bool
+ \ifx\@textbottom\relax\else
+ \@outputbox@append
+ {
+ \@tempskipa\lastskip
+ \ifnum\gluestretchorder\@tempskipa>\z@
+ \vskip -\@tempskipa
+ \xdef\@outputbox@reinsertbskip
+ {\noexpand\@outputbox@append{\vskip\the\@tempskipa}}
+ \else
+ \global\let\@outputbox@reinsertbskip\relax
+ \fi
+ }
+ \fi
+ }
+\let\@outputbox@reinsertbskip\relax
+\def\@outputbox@append #1
+ {
+ \setbox\@outputbox\vbox
+ {
+ \boxmaxdepth\@maxdepth
+ \dimen@\dp\@outputbox
+ \unvbox\@outputbox
+ #1
+ }
+ }
+\def\@outputbox@attachfloats{\@combinefloats}
+\NewHook{makecol/footins/before}
+\NewHook{makecol/footins/begin}
+\def\@outputbox@appendfootnotes
+ {
+ \@if@footnotes@TF
{
- \IfPackageLoadedTF{footmisc}
- {\msg_warning:nn { easybase } { bottom-not-compatible }}
+ \UseHook{makecol/footins/before}
+ \@outputbox@append
{
- \cs_set:Npn \@makecol
- {
- \setbox\@outputbox\box\@cclv
- \let\@elt\relax
- \xdef\@freelist{\@freelist\@midlist}
- \global\let\@midlist\@empty
- \@combinefloats
- \eb@ifvoid\footins{}
- {
- \setbox\@outputbox\vbox
- {
- \boxmaxdepth\@maxdepth
- \unvbox\@outputbox
- \vfill\relax
- \vskip\skip\footins
- \color@begingroup
- \normalcolor\footnoterule
- \unvbox\footins
- \color@endgroup
- }
- }
- \eb@ifvoid\@kludgeins
- {\@makespecialcolbox}
- {
- \setbox\@outputbox\vbox to\@colht
- {
- \@texttop\dimen@\dp\@outputbox
- \unvbox\@outputbox
- \vskip -\dimen@\@textbottom
- }
- }
- \global\maxdepth\@maxdepth
- }
+ \vskip\skip\footins
+ \UseHook{makecol/footins/begin}
+ \color@begingroup
+ \normalcolor
+ \footnoterule
+ \@nameuse{pdfcolfoot@current}
+ \unvbox\footins
+ \color@endgroup
}
+ }{}
+ }
+\def\@makenormalcolbox
+ {
+ \setbox\@outputbox\vbox to\@colht
+ {
+ \@texttop
+ \dimen@\dp\@outputbox
+ \unvbox\@outputbox
+ \vskip -\dimen@
+ \@textbottom
}
}
-\msg_new:nnn { easybase } { bottom-not-compatible }
+\cs_new_protected:Npn \PushFntBottom
{
- Not~compatible~with~the~'footmisc'~package. \\
- Please~use~the~'bottom'~option~of~'footmisc'~package.
+ \cs_set:Npn \@makecol
+ {
+ \setbox\@outputbox\box\@cclv
+ \@outputbox@removebskip
+ \let\@elt\relax
+ \xdef\@freelist{\@freelist\@midlist}
+ \global\let\@midlist\@empty
+ \@outputbox@attachfloats
+ \@if@footnotes@TF
+ {\@outputbox@append{\vfill}}
+ {\@outputbox@reinsertbskip}
+ \@outputbox@appendfootnotes
+ \ifvbox\@kludgeins
+ \@makespecialcolbox
+ \else
+ \@makenormalcolbox
+ \fi
+ \global\maxdepth\@maxdepth
+ }
}
+\@onlypreamble\PushFntBottom
\cs_new_protected:Npn \eb_footnote_direct_hang:
{
@@ -1023,7 +1074,7 @@
{
\noindent
\clist_if_in:NnT \l__eb_footnote_value_clist { flush }
- { \dim_zero:N \fnfirstindent }
+ { \tl_set:Nn \fnfirstindent { 0pt } }
\int_case:nn { \dim_sign:V \fnfirstindent }
{
{ 1 } { \use_i:nnn }
@@ -1056,6 +1107,7 @@
\l__eb_fnpara_format_tl{#1}
\tl_if_eq:NnT \l__eb_footnote_value_tl { hang } { \par }
}
+\cs_new_protected:Npn \setspread #1 { \linespread{#1}\selectfont }
\clist_map_inline:nn { \@footnotetext,\@mpfootnotetext }
{
\eb_patch_cmd:Nnn #1
@@ -1071,12 +1123,12 @@
\ctex_at_end_package:nn { footmisc }
{
\eb_package_date_check:nn { footmisc } { 2022/02/10 }
- \boolfalse{FN@setspace}
- \ifbool{FN@para}{}
+ \ifboolexpr{not (bool {FN@para} or bool {FN@sidefn})}
{
+ \boolfalse{FN@setspace}
\cs_set_eq:NN \@makefntext \eb@@makefntext
\cs_set_eq:NN \@footnotetext \eb@@footnotetext
- }
+ }{}
\ifboolexpr
{
bool {FN@hangfoot} or
@@ -1315,7 +1367,7 @@
{
\IfBooleanTF{##1}
{
- \use:c {#1}*{\phantomsection ##3}
+ \use:c {#1}*{##3}
\CTEX@addtocline{#1}{##2}
\tl_if_empty:oF {##4} { \CTEX@addbitocline{#1}{##4} }
\use:c { #1mark }{##2}
@@ -1337,22 +1389,22 @@
\skip_if_eq:nnF { \eb@toc@lol@skip } { \c_zero_skip }
{ \addtocontents{lol}{\protect\addvspace{\skip_use:N \eb@toc@lol@skip}} }
}
-\cs_new_protected:Npn \eb_title_base_set_eq:nn #1#2
- {
- \tl_set_eq:cc { CTEX@#2@beforeskip } { CTEX@#1@beforeskip }
- \tl_set_eq:cc { CTEX@#2@afterskip } { CTEX@#1@afterskip }
- \bool_set_eq:cc { CTEX@#2@numbering } { CTEX@#1@numbering }
- \bool_set_eq:cc { CTEX@#2@fixskip } { CTEX@#1@fixskip }
- \bool_set_eq:cc { CTEX@#2@hang } { CTEX@#1@hang }
- \bool_set_eq:cc { CTEX@#2@runin } { CTEX@#1@runin }
- \cs_set_eq:cc { CTEX@#2@tocline } { CTEX@#1@tocline }
- \tl_set_eq:cc { CTEX@#2@break } { CTEX@#1@break }
- \tl_set_eq:cc { CTEX@#2@format } { CTEX@#1@format }
- \tl_set_eq:cc { CTEX@#2@nameformat } { CTEX@#1@nameformat }
- \tl_set_eq:cc { CTEX@#2@numberformat } { CTEX@#1@numberformat }
- \tl_set_eq:cc { CTEX@#2@titleformat } { CTEX@#1@titleformat }
- \tl_set_eq:cc { CTEX@#2@aftername } { CTEX@#1@aftername }
- \tl_set_eq:cc { CTEX@#2@aftertitle } { CTEX@#1@aftertitle }
+\cs_new_protected:Npn \CopyTitleFormat #1#2
+ {
+ \tl_set_eq:cc { CTEX@#1@beforeskip } { CTEX@#2@beforeskip }
+ \tl_set_eq:cc { CTEX@#1@afterskip } { CTEX@#2@afterskip }
+ \bool_set_eq:cc { CTEX@#1@numbering } { CTEX@#2@numbering }
+ \bool_set_eq:cc { CTEX@#1@fixskip } { CTEX@#2@fixskip }
+ \bool_set_eq:cc { CTEX@#1@hang } { CTEX@#2@hang }
+ \bool_set_eq:cc { CTEX@#1@runin } { CTEX@#2@runin }
+ \cs_set_eq:cc { CTEX@#1@tocline } { CTEX@#2@tocline }
+ \tl_set_eq:cc { CTEX@#1@break } { CTEX@#2@break }
+ \tl_set_eq:cc { CTEX@#1@format } { CTEX@#2@format }
+ \tl_set_eq:cc { CTEX@#1@nameformat } { CTEX@#2@nameformat }
+ \tl_set_eq:cc { CTEX@#1@numberformat } { CTEX@#2@numberformat }
+ \tl_set_eq:cc { CTEX@#1@titleformat } { CTEX@#2@titleformat }
+ \tl_set_eq:cc { CTEX@#1@aftername } { CTEX@#2@aftername }
+ \tl_set_eq:cc { CTEX@#1@aftertitle } { CTEX@#2@aftertitle }
}
\NewDocumentCommand{\NewTitleCommand}{omm}
{
@@ -1374,7 +1426,7 @@
{ \CTEXnumberline{##1}##2 }
\exp_args:Nc \providecommand { ttll@#2 }{#3}
\exp_args:Nc \providecommand { toclevel@#2 }{#3}
- \IfValueT{#1}{\eb_title_base_set_eq:nn {#1} {#2}}
+ \IfValueT{#1}{\CopyTitleFormat{#2}{#1}}
}
\NewDocumentCommand{\NewTitleEntryCommand}{O{toc}m}
{
@@ -1383,35 +1435,39 @@
\bool_if:cTF { CTEX@#2@numbering }
{ \CTEX@ifnametrue }
{ \CTEX@ifnamefalse }
+ \CTEX@makeanchor{#2*}
\addcontentsline{#1}{#2}{\use:c { CTEX@#2@tocline }{#2}{##1}}
}
}
\ctex_define:nn { tools }
{
- hyphen-figure .tl_set:N = \l__eb_hyphen_figure_tl,
- hyphen-table .tl_set:N = \l__eb_hyphen_table_tl,
- hyphen-listing .tl_set:N = \l__eb_hyphen_listing_tl,
- hyphen-equation .tl_set:N = \l__eb_hyphen_equation_tl,
- hyphen-every .meta:n =
+ hyphen-figure .tl_set:N = \l__eb_hyphen_figure_tl,
+ hyphen-table .tl_set:N = \l__eb_hyphen_table_tl,
+ hyphen-lstlisting .tl_set:N = \l__eb_hyphen_lstlisting_tl,
+ hyphen-equation .tl_set:N = \l__eb_hyphen_equation_tl,
+ hyphen-every .meta:n =
{
- hyphen-figure = {#1},hyphen-table = {#1},
- hyphen-listing = {#1},hyphen-equation = {#1}
+ hyphen-figure = {#1},hyphen-table = {#1},
+ hyphen-lstlisting = {#1},hyphen-equation = {#1}
},
- hyphen-every .initial:n = .,
- unknown .code:n = \eb_msg_deprecated_option:n { tools }
+ hyphen-every .initial:n = .,
+ unknown .code:n = \eb_msg_deprecated_option:n { tools }
}
-\clist_map_inline:nn
- { figure,table,listing,equation }
+\AtBeginDocument
{
- \cs_set:cpn { the#1 }
+ \clist_map_inline:nn
+ { figure,table,lstlisting,equation }
{
- \int_compare:nNnT { \c@chapter } > { 0 }
+ \cs_set:cpn { the#1 }
{
- \thechapter
- \tl_use:c { l__eb_hyphen_#1_tl }
+ \int_compare:nNnT { \c@chapter } > { 0 }
+ {
+ \thechapter
+ \tl_use:c { l__eb_hyphen_#1_tl }
+ }
+ \int_to_arabic:v { c@#1 }
}
- \int_to_arabic:v { c@#1 }
}
}
@@ -1421,47 +1477,73 @@
\bool_new:N \l__eb_toc_notitle_bool
\newbool{bitoc}
\cs_new:Npn \ebifbitoc { \ifbool{bitoc} }
+\seq_new:N \l__eb_level_tmpa_seq
+\tl_new:N \l__eb_level_tmpa_tl
+\cs_generate_variant:Nn \regex_extract_all:nnN { no }
+\cs_generate_variant:Nn \keys_define:nn { nx }
+\cs_generate_variant:Nn \ctex_set:nn { ox }
+\cs_new_protected:Npn \eb_toc_extract_level:
+ {
+ \regex_extract_all:noN { \cC. } { \eb@toc@title@level }
+ \l__eb_level_tmpa_seq
+ \seq_get_right:NN \l__eb_level_tmpa_seq \l__eb_level_tmpa_tl
+ \tl_set:Nx \l__eb_level_tmpa_tl
+ {
+ \exp_last_unbraced:No
+ \cs_to_str:N { \l__eb_level_tmpa_tl }
+ }
+ \regex_replace_case_once:nN
+ {
+ { ^bi(.*) } { \1 }
+ { .* } { \0 }
+ }
+ \l__eb_level_tmpa_tl
+ }
\keys_define:nn { eb/tocouter }
{
- level .tl_set:N = \eb@toc@title@level,
- level .initial:n =
+ level .code:n =
+ {
+ \tl_set:Nn \eb@toc@title@level {#1}
+ \eb_toc_extract_level:
+ },
+ level .initial:x =
{
\bool_if:NTF \l__eb_class_mode_book_bool
- { \bichapter* }
- { \bisection* }
+ { \exp_not:N \bichapter* }
+ { \exp_not:N \bisection* }
},
- section .meta:n = { level = \bisection* },
- chapter .meta:n = { level = \bichapter* },
- none .code:n =
+ section .meta:n = { level = \bisection* },
+ chapter .meta:n = { level = \bichapter* },
+ none .code:n =
{
\tl_set:Nn \eb@toc@title@level
{ \par\use_none:nn }
\bool_set_true:N \l__eb_toc_notitle_bool
},
- multoc .int_set:N = \l__eb_toc_columns_int,
- multoc .default:n = 2,
- multoc .initial:n = 1,
+ multoc .int_set:N = \l__eb_toc_columns_int,
+ multoc .default:n = 2,
+ multoc .initial:n = 1,
plan .choice:,
plan .value_required:n = true,
- plan/cn .code:n =
+ plan/cn .code:n =
{
\bool_set_true:N \l__eb_toc_plan_cn_bool
\bool_set_false:N \l__eb_toc_plan_bi_bool
},
- plan/bi .code:n =
+ plan/bi .code:n =
{
\bool_set_false:N \l__eb_toc_plan_cn_bool
\bool_set_true:N \l__eb_toc_plan_bi_bool
},
- plan/both .code:n =
+ plan/both .code:n =
{
\bool_set_true:N \l__eb_toc_plan_cn_bool
\bool_set_true:N \l__eb_toc_plan_bi_bool
},
- plan .initial:n = cn,
- columns .meta:n = { multoc = {#1} },
- title .code:n = \eb_assign_toc_title:n {#1},
- bilist .code:n =
+ plan .initial:n = cn,
+ columns .meta:n = { multoc = {#1} },
+ title .code:n = \eb_assign_toc_title:n {#1},
+ bilist .code:n =
{
\tl_gset:Nn \g__eb_bilist_permute_value_tl {#1}
\str_if_eq:nnTF {#1} { mix }
@@ -1479,12 +1561,16 @@
}
}
},
- name .tl_set:N = \l__eb_print_index_name_tl,
- name .initial:n = \imki@jobname
+ name .tl_set:N = \l__eb_print_index_name_tl,
+ name .initial:n = \imki@jobname,
+ unknown .code:n =
+ {
+ \ctex_set:ox { \l__eb_level_tmpa_tl }
+ { \eb_unknown_kv_handle: }
+ },
+ unknown .default:V = \c_novalue_tl
}
-\bool_if:NTF \l__eb_class_mode_book_bool
- { \keys_define:nn { } { eb/tocouter .inherit:n = ctex/chapter } }
- { \keys_define:nn { } { eb/tocouter .inherit:n = ctex/section } }
+
\NewDocumentCommand{\eb_assign_toc_title:n}
{>{\SplitArgument{1}{,}}m}
{\eb_toc_assign_title_judge:nn #1}
@@ -1540,7 +1626,7 @@
}
\cs_new_protected:Npn \DeclareFloatList #1#2
{
- \exp_args:Nc \DeclareDocumentCommand { listof#1s }{st+o}
+ \exp_args:Nc \DeclareDocumentCommand { listof#1s }{st++o}
{\eb_toc_list_struct_parse:nnnnn {##1} {##2} {##3} {#1} {#2}}
\ctex_define:n
{
@@ -1563,14 +1649,15 @@
{ \protect\numberline{#3}{#4} }
}
}
-\cs_new_protected:Npn \AllotCaptionExt #1#2
+\cs_new_protected:Npn \AssignCaptionExt #1#2
{ \tl_set:cn { ext@#1 } {#2} }
+\cs_set_eq:NN \AllotCaptionExt \AssignCaptionExt
\ctex_define:n
{
bicontentsname .tl_set:N = \bicontentsname,
bicontentsname .initial:n = Contents
}
-\RenewDocumentCommand{\tableofcontents}{st+oD(){}}
+\RenewDocumentCommand{\tableofcontents}{st++o+D(){}}
{
\group_begin:
\tl_set_eq:NN \eb@toc@title \contentsname
@@ -1657,7 +1744,7 @@
{
tocformat = \IfBooleanT{#1}{\contentsmargin{0pt}},
tocindent = 0pt,
- tocrule = \IfBooleanTF{#1}{,~\thecontentspage}{\tocrule{$\cdot$}},
+ tocrule = \IfBooleanTF{#1}{,~\thecontentspage}{\cdottocrule},
toclabel =
{
\bool_if:NTF \l__eb_toc_entry_hang_bool
@@ -1728,7 +1815,7 @@
\eb@register@every@toc@option
}
\RegisterEveryTocOption{tocafter,tocindent,tocrule}
-\NewDocumentCommand{\tocrule}{st-O{0.7pc}d()mO{}}
+\NewDocumentCommand{\tocrule}{st-O{0.6pc}d()mO{}}
{
\normalsize\normalfont
\ttl@row@i[#3]{\IfValueTF{#4}{\scalebox{#4}{#5}}{#5}}#6
@@ -1745,6 +1832,7 @@
}
}
}
+\cs_set:Npn \cdottocrule { \tocrule{\textperiodcentered} }
\ctex_define:nn { toc }
{
lolskip .skip_set:N = \eb@toc@lol@skip,
@@ -1761,6 +1849,8 @@
hang .initial:n = true,
pagenumwd .code:n = \contentsmargin{#1},
pagenumwd .initial:n = 1.55em,
+ fileopen .tl_set:N = \l__eb_fileopen_type_tl,
+ fileopen .initial:n = once,
unknown .code:n = \eb_msg_deprecated_option:n { toc }
}
@@ -1771,8 +1861,7 @@
{
\tl_if_exist:cF { tf@#1 }
{ \iow_new:c { tf@#1 }\iow_open:cn { tf@#1 } { \jobname.#1 } }
- }
- {}
+ }{}
}
\cs_set_eq:NN \eb@starttoc \@starttoc
\cs_set:Npn \@starttoc #1
@@ -1790,16 +1879,30 @@
}
\AddToHook{enddocument/afterlastpage}
{
- \IfHookEmptyTF{starttoc/after}{}
- {\iow_now:Nn \@mainaux { \RemoveFromHook{starttoc/after}[aux] }}
+ \tl_if_eq:NnTF \l__eb_fileopen_type_tl { once }
+ { \iow_now:Nn \@mainaux { \RemoveFromHook{starttoc/after}[*] } }
+ {
+ \IfHookEmptyTF{starttoc/after}{}
+ {\iow_now:Nn \@mainaux { \RemoveFromHook{starttoc/after}[aux] }}
+ }
+ }
+\cs_set_protected:Npn \AssignPartialExt #1#2
+ {
+ \tl_if_exist:cTF { ttl@partial#1 }
+ { \msg_warning:nnnn { easybase } { repeated-ptoc } {#1} {#2} }
+ {
+ \tl_set:cn { ttl@partial#1 } {#2}
+ \AddToHookWithArguments{cmd/ttl@writepartial/before}[ttl/#1]
+ {\ttl@topartial{#1}{##1}{##2}}
+ }
}
-\cs_set_protected:Npn \AllotPartialExt #1#2
+\cs_set_eq:NN \AllotPartialExt \AssignPartialExt
+\msg_new:nnn { easybase } { repeated-ptoc }
{
- \tl_set:cn { ttl@partial#1 } {#2}
- \AddToHookWithArguments{cmd/ttl@writepartial/before}
- {\ttl@topartial{#1}{##1}{##2}}
+ Local~directory~file~'#2'~of~directory~type~'#1'~is \\
+ repeatedly~allocated.
}
-\AllotPartialExt{lol}{pll}
+\AssignPartialExt{lol}{pll}
\cs_new_protected:Npn \RegisterTitleIfname #1
{
@@ -1823,16 +1926,15 @@
}
\RegisterTitleIfname{toc}
-\cs_set_eq:NN \eb@ctexsetii \ctex_set:nn
\cs_new_protected:Npn \SetTocStyle #1#2#3
{
\cs_set_protected:cpn { eb@toc@style@set@#1@#2 }
- { \eb@ctexsetii{#1}{#3} }
+ { \ctex_set:nn {#1} {#3} }
}
\cs_new_protected:Npn \UseTocStyle #1#2#3
{
\cs_if_exist:cTF { eb@toc@style@set@#1@#2 }
- { \addtocontents{#3}{\@nameuse{eb@toc@style@set@#1@#2}} }
+ { \addtocontents{#3}{\string\csuse{eb@toc@style@set@#1@#2}} }
{ \msg_warning:nnnn { easybase } { undefined-toc-style } {#2} {#1} }
}
\msg_new:nnn { easybase } { undefined-toc-style }
@@ -1851,7 +1953,7 @@
{
tocformat = \addvspace{1pc}\sffamily,
tocindent = 0pt,
- tocrule = \tocrule{$\cdot$}[\bfseries],
+ tocrule = \cdottocrule[\bfseries],
tocline = \CTEXnumberline{#1}#2
},
section =
@@ -1861,17 +1963,17 @@
tocrule =
{
\bool_if:NTF \l__eb_class_mode_book_bool
- { \tocrule{$\cdot$} }
- { \tocrule{$\cdot$}[\bfseries] }
+ { \cdottocrule }
+ { \cdottocrule[\bfseries] }
}
},
subsection =
- { tocindent = \bool_if:NTF \l__eb_class_mode_book_bool { 3.8em } { 1.4em } }
+ { tocindent = \bool_if:NTF \l__eb_class_mode_book_bool { 3.8em } { 1.5em } }
}
\ctex_at_end_package:nn { imakeidx }
{
- \RenewDocumentCommand{\printindex}{st+od()}
+ \RenewDocumentCommand{\printindex}{st++o}
{
\group_begin:
\tl_set_eq:NN \eb@toc@title \indexname
@@ -1929,19 +2031,19 @@
\ctex_define:nn { font }
{
- caption-table .tl_set:N = \l__eb_font_caption_table_tl,
- caption-figure .tl_set:N = \l__eb_font_caption_figure_tl,
- caption-listing .tl_set:N = \l__eb_font_caption_listing_tl,
- caption-every .meta:n =
+ caption-table .tl_set:N = \l__eb_font_caption_table_tl,
+ caption-figure .tl_set:N = \l__eb_font_caption_figure_tl,
+ caption-lstlisting .tl_set:N = \l__eb_font_caption_lstlisting_tl,
+ caption-every .meta:n =
{
- caption-table = {#1},caption-figure = {#1},
- caption-listing = {#1}
+ caption-table = {#1},caption-figure = {#1},
+ caption-lstlisting = {#1}
},
- caption-every .initial:n = \sffamily\small,
- footnote .tl_set:N = \eb@font@footnote,
- marginpar .tl_set:N = \marginfont,
- marginpar .initial:n = \footnotesize,
- unknown .code:n = \eb_msg_deprecated_option:n { font }
+ caption-every .initial:n = \sffamily\small,
+ footnote .tl_set:N = \eb@font@footnote,
+ marginpar .tl_set:N = \marginfont,
+ marginpar .initial:n = \footnotesize,
+ unknown .code:n = \eb_msg_deprecated_option:n { font }
}
\cs_new_protected:Npn \ebaddtofont #1#2
{
@@ -1951,13 +2053,13 @@
{ \tl_put_right:Nn \l__eb_font_caption_table_tl {#2} }
{ figure }
{ \tl_put_right:Nn \l__eb_font_caption_figure_tl {#2} }
- { listing }
- { \tl_put_right:Nn \l__eb_font_caption_listing_tl {#2} }
+ { lstlisting }
+ { \tl_put_right:Nn \l__eb_font_caption_lstlisting_tl {#2} }
{ every }
{
\tl_put_right:Nn \l__eb_font_caption_table_tl {#2}
\tl_put_right:Nn \l__eb_font_caption_figure_tl {#2}
- \tl_put_right:Nn \l__eb_font_caption_listing_tl {#2}
+ \tl_put_right:Nn \l__eb_font_caption_lstlisting_tl {#2}
}
{ footnote }
{ \tl_put_right:Nn \eb@font@footnote {#2} }
@@ -1986,7 +2088,7 @@
fntspread .initial:n = 1.2,
captab-spread .fp_set:N = \l__eb_spread_caption_table_fp,
capfig-spread .fp_set:N = \l__eb_spread_caption_figure_fp,
- caplst-spread .fp_set:N = \l__eb_spread_caption_listing_fp,
+ caplst-spread .fp_set:N = \l__eb_spread_caption_lstlisting_fp,
caption-spread .meta:n =
{
captab-spread = {#1},capfig-spread = {#1},
@@ -2026,8 +2128,30 @@
}
\AfterPreamble{\skip_set:Nn \abovedisplayshortskip { 0ex plus .1ex }}
+\cs_new_protected:Npn \eb@register@cap@options #1
+ {
+ \ctex_define:nn { cap }
+ {
+ #1/unknown .code:n =
+ {
+ \use:x
+ {
+ \exp_not:N \captionsetup[#1]
+ { \eb_unknown_kv_handle: }
+ }
+ },
+ #1/unknown .default:V = \c_novalue_tl,
+ #1 .meta:nn = { ctex/cap/#1 } {##1}
+ }
+ }
+\cs_new_protected:Npn \RegisterCapOptions #1
+ {
+ \clist_map_function:nN {#1}
+ \eb@register@cap@options
+ }
+\RegisterCapOptions{table,figure,lstlisting}
\clist_map_inline:nn
- { table,figure,listing }
+ { table,figure,lstlisting }
{
\DeclareCaptionFont{eb@#1@font}
{
@@ -2045,7 +2169,7 @@
}
\captionsetup[table]{font = eb@table@font}
\captionsetup[figure]{font = eb@figure@font}
-\captionsetup[lstlisting]{font = eb@listing@font}
+\captionsetup[lstlisting]{font = eb@lstlisting@font}
\ctex_at_end_package:nn { bicaption }
{
\captionsetup[figure][bi-second]{name = Figure}
@@ -2209,9 +2333,9 @@
\RequirePackage{amsthm,thmtools}
\cs_set_eq:NN \eb@declaretheoremstyle@save \declaretheoremstyle
\cs_set_eq:NN \eb@declaretheorem@save \declaretheorem
- \RenewDocumentCommand{\declaretheoremstyle}{O{}mO{}}
+ \RenewDocumentCommand{\declaretheoremstyle}{+O{}m+O{}}
{\eb@declaretheoremstyle@save[#1,#3]{#2}}
- \RenewDocumentCommand{\declaretheorem}{O{}mO{}}
+ \RenewDocumentCommand{\declaretheorem}{+O{}m+O{}}
{
\eb@declaretheorem@save[style = default,#1,#3]{#2}
\settheoremtocline{#2}
@@ -2219,6 +2343,9 @@
\listnumberline{#2}
\thmtname\thmtifnote{~(\thmtnote)}{}
}
+ \cs_gset:cpn { thmt@contentsline@#2 }
+ { \thmt@contentslineIfNamed }
+ \exp_args:Nc \providecommand { p@#2 }[1]{##1}
}
\ctex_define:nn { thmt }
{
@@ -2239,7 +2366,7 @@
\theoremstyle{default}
\cs_undefine:N \proof
\DeclareFloatList{theorem}{loe}
- \AllotPartialExt{loe}{ple}
+ \AssignPartialExt{loe}{ple}
\eb_preto_cmd:nn { listoftheorems }
{
\group_begin:
@@ -2350,7 +2477,7 @@
{ \exp_args:NV \bibliographystyle \l__eb_bib_both_style_tl }
\tl_if_blank:VF \l__eb_bib_cite_style_tl
{ \exp_args:NV \setcitestyle \l__eb_bib_cite_style_tl }
- \NewDocumentCommand{\printbibliography}{st+o}
+ \NewDocumentCommand{\printbibliography}{st++o}
{
\group_begin:
\tl_set_eq:NN \eb@toc@title \bibname
@@ -2398,7 +2525,7 @@
\setcounter{biburllcpenalty}{1}
\setcounter{biburlnumpenalty}{1}
}
-\eb_at_end_preamble:n
+\ctex_before_end_preamble:n
{
\providecommand{\bibname}{\refname}
\clist_if_empty:NF \l__eb_bib_datafile_clist
@@ -2623,9 +2750,100 @@
lstlistingname = Code
}
}
+
+\cs_if_exist:NF \DeclareObjectType
+ { \RequirePackage{xtemplate} }
+\DeclareObjectType{easybook}{0}
+\DeclareTemplateInterface{easybook}{cover}{0}
+ {
+ content : tokenlist = \c_empty_tl,
+ beforecode : tokenlist = \c_empty_tl,
+ aftercode : tokenlist = \c_empty_tl,
+ align : choice {l,r,c,n} = c
+ }
+\DeclareTemplateCode{easybook}{cover}{0}
+ {
+ content = \l__eb_cover_content_tl,
+ beforecode = \l__eb_cover_before_code_tl,
+ aftercode = \l__eb_cover_after_code_tl,
+ align =
+ {
+ l = \cs_set_eq:NN \eb_cover_align: \raggedright,
+ r = \cs_set_eq:NN \eb_cover_align: \raggedleft,
+ c = \cs_set_eq:NN \eb_cover_align: \centering,
+ n = \cs_set:Npn \eb_cover_align: { }
+ }
+ }
+ {
+ \AssignTemplateKeys
+ \tl_use:N \l__eb_cover_before_code_tl
+ \group_begin:
+ \eb_cover_align:
+ \tl_use:N \l__eb_cover_content_tl
+ \tex_par:D
+ \group_end:
+ \tl_use:N \l__eb_cover_after_code_tl
+ }
+\DeclareInstance{easybook}{top}{cover}{}
+\DeclareInstance{easybook}{bottom}{cover}{}
+\DeclareInstance{easybook}{middle}{cover}
+ {
+ content =
+ {
+ \notbool{@titlepage}
+ {
+ \renewcommand{\theupfootnote}{\@fnsymbol\c@footnote}
+ \renewcommand{\thefootnote}{\@fnsymbol\c@footnote}
+ }
+ {}
+ \LARGE\@title\par\vskip 3em
+ \large
+ \begin{tabular}[t]{c}
+ \@author
+ \end{tabular}\par\vskip 1.5em
+ \@date
+ \notbool{@titlepage}{\par\vskip 1.5em}{}
+ \@thanks
+ },
+ beforecode =
+ {
+ \ifbool{@titlepage}
+ {
+ \begin{titlepage}
+ \let\footnotesize\small
+ \let\footnoterule\relax
+ \let\footnote\thanks
+ \null\vfil\vskip 60\p@
+ }
+ {\null\vskip 20\p@}
+ },
+ aftercode =
+ {
+ \ifbool{@titlepage}
+ {
+ \vfil\null
+ \end{titlepage}
+ }
+ {\thispagestyle{plain}}
+ \setcounter{footnote}{0}
+ }
+ }
+\keys_define:nn { eb/cover }
+ {
+ title .tl_set:N = \@title,
+ author .tl_set:N = \@author,
+ date .tl_set:N = \@date
+ }
+\RenewDocumentCommand{\maketitle}{+O{}}
+ {
+ \keys_set:nn { eb/cover } {#1}
+ \UseInstance{easybook}{top}
+ \UseInstance{easybook}{middle}
+ \UseInstance{easybook}{bottom}
+ }
%</package>
%<*tcolorbox>
-\ProvidesExplFile{eb-tcolorbox.cfg}{2024/06/18}{2024cf}
+\ProvidesExplFile{eb-tcolorbox.cfg}{2024/08/14}{2024dj}
{Customization of tcolorbox for easybook}
\cs_set_protected:Npn \addtotcbstyle #1#2
diff --git a/Master/texmf-dist/source/latex/enverb/enverb.dtx b/Master/texmf-dist/source/latex/enverb/enverb.dtx
new file mode 100644
index 00000000000..a33dc713d70
--- /dev/null
+++ b/Master/texmf-dist/source/latex/enverb/enverb.dtx
@@ -0,0 +1,720 @@
+% \iffalse meta-comment
+%
+% File: enverb.dtx Copyright (C) 2023-2024 Jonathan P. Spratte
+%
+% This work 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:
+%
+% http://www.latex-project.org/lppl.txt
+%
+% ------------------------------------------------------------------------------
+%
+%<*driver>^^A>>=
+\def\nameofplainTeX{plain}
+\ifx\fmtname\nameofplainTeX\else
+ \expandafter\begingroup
+\fi
+\input l3docstrip.tex
+\askforoverwritefalse
+\preamble
+
+--------------------------------------------------------------
+enverb -- read an environment verbatim
+E-mail: jspratte@yahoo.de
+Released under the LaTeX Project Public License v1.3c or later
+See http://www.latex-project.org/lppl.txt
+--------------------------------------------------------------
+
+Copyright (C) 2023-2024 Jonathan P. Spratte
+
+This work 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:
+
+ http://www.latex-project.org/lppl.txt
+
+This work is "maintained" (as per LPPL maintenance status) by
+ Jonathan P. Spratte.
+
+This work consists of the files enverb.dtx
+ enverb-doc.tex
+and the derived files enverb-doc.pdf
+ enverb.sty
+
+\endpreamble
+\postamble
+\endpostamble
+\generate{\file{enverb.sty}{\from{enverb.dtx}{pkg}}}
+\ifx\fmtname\nameofplainTeX
+ \expandafter\endbatchfile
+\else
+ \expandafter\endgroup
+\fi
+%</driver>^^A=<<
+% \fi
+%
+% \gobbledocstriptag
+%<*pkg>
+%
+% \subsection{Who we are}
+%
+% \begin{macro}[internal]{\enverb@date,\enverb@version}
+% We store the package version and date inside macros.
+% \begin{macrocode}
+\newcommand*\enverb@date{2024-08-28}
+\newcommand*\enverb@version{1.0}
+% \end{macrocode}
+% \end{macro}
+%
+% And the package identification:
+% \begin{macrocode}
+\ProvidesPackage{enverb}
+ [\enverb@date\space v\enverb@version\space read an environment verbatim]
+% \end{macrocode}
+%
+% \subsection{Some required \LaTeXe\ style argument grabbers}
+% \begin{macro}[internal]{\@thirdofthree,\@firstofnine}
+% This here are just two argument grabbers that aren't defined in all versions
+% of \LaTeXe.
+% \begin{macrocode}
+\providecommand\@thirdofthree[3]{#3}
+\providecommand\@firstofnine[9]{#1}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Borrow some code}
+% \begin{macro}[internal]
+% {\enverb@count,\enverb@ifxTF,\enverb@chargen,\enverb@othercr}
+% We'll make use of the following two \pkg{expl3} functions, but since the
+% remainder of this package is coded in \LaTeXe\ style we stick to that.
+% \begin{macrocode}
+\ExplSyntaxOn
+\cs_new_eq:NN \enverb@count \tl_count:n
+\cs_new_eq:NN \enverb@ifxTF \token_if_eq_meaning:NNTF
+\cs_new_eq:NN \enverb@chargen \char_generate:nn
+\cs_set:Npx \enverb@othercr { \char_generate:nn {13} {12} }
+\ExplSyntaxOff
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Key-value Setup}
+% First we need to load a package to allow us defining our keys, then we define
+% a bunch of keys:
+% \begin{macrocode}
+\RequirePackage{expkv-def}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\ekvdefinekeys{enverb}
+ {
+ protect code ignore = \let\enverb@ifautoignore\@secondoftwo
+ ,also eint ignore = \enverb@ignore
+ ,boolTF auto-ignore = \enverb@ifautoignore
+ ,initial auto-ignore
+ ,eint more-ignore = \enverb@moreignore
+ ,initial more-ignore = 2
+ ,long store bol = \enverb@bol@content
+ ,long code bol+ = \enverb@add\enverb@bol@content{#1}
+ ,long code +bol = \enverb@pre\enverb@bol@content{#1}
+ ,long store eol = \enverb@eol@content
+ ,einitial eol = \enverb@othercr
+ ,long code eol+ = \enverb@add\enverb@eol@content{#1}
+ ,long code +eol = \enverb@pre\enverb@eol@content{#1}
+ ,protect code key-handler = \protected\long\def\enverb@keyhandler##1{#1}
+ ,protect code key-set = \protected\long\ekvsetdef\enverb@keyhandler{#1}
+ ,unknown code = \enverb@add\enverb@unknown@kv{, {#3} = {#2} }
+ ,unknown noval = \enverb@add\enverb@unknown@kv{, {#2} }
+ ,boolTF oarg-not-enverb = \enverb@ifoargtokeyhandler
+ }
+% \end{macrocode}
+% \begin{macro}{\enverbsetup}
+% We need a user facing macro to set our keys.
+% \begin{macrocode}
+\protected\long\ekvsetdef\enverbsetup{enverb}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[internal]{\enverb@unknown@kv}
+% This is a storage for all unknown keys encountered.
+% \begin{macrocode}
+\let\enverb@unknown@kv\@empty
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Miscellaneous Auxiliary Functions}
+%
+% \begin{macro}[internal]{\enverb@stop}
+% A very simple minded stop-macro, just gobble up to the eponymous mark.
+% \begin{macrocode}
+\long\def\enverb@stop#1\enverb@stop{}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[internal]{\enverb@error}
+% \begin{macrocode}
+\protected\def\enverb@error{\PackageError{enverb}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[internal]{\enverb@misused}
+% This is an error message that'd be used inside a |\lowercase| environment if
+% put where it originally should've been. Hence we define it now to get
+% correct formatting.
+% \begin{macrocode}
+\protected\def\enverb@misused
+ {%
+ \enverb@error
+ {Misused \string\enverb. Input already tokenised}%
+ {%
+ It seems you used the \string\enverb\space based environment
+ {\@currenvir} inside another\MessageBreak
+ macro's or a primitive's argument; that doesn't work.%
+ }%
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[internal]{\enverb@keyhandler, \enverb@keyhandler@}
+% This is the initial definition of the handler for unknown keys, namely throw
+% an error containing the list of unknown keys.
+% \begin{macrocode}
+\protected\long\def\enverb@keyhandler#1%
+ {%
+ \if\relax\detokenize{#1}\relax
+ \expandafter\@gobbletwo
+ \fi
+ \@firstofone
+ {%
+ \enverb@error
+ {%
+ Unknown keys encountered:
+ \expanded
+ {%
+ \ekvparse
+ {\MessageBreak\@spaces\unexpanded}%
+ {\MessageBreak\@spaces\enverb@keyhandler@}%
+ {#1}%
+ }%
+ \@gobble
+ }%
+ {%
+ Perhaps you misspelled some key names? Or you forgot to set up
+ custom key\MessageBreak
+ parsing.%
+ }%
+ }%
+ }
+\long\def\enverb@keyhandler@#1{\unexpanded{#1} = \unexpanded}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Collector}
+%
+% Much of the code in this package works under a weird category code regime,
+% which the following sets up. After this |~| will be an active newline
+% character, |:| will be an active space, and |;| will be an active tab.
+% \begin{macrocode}
+\begingroup
+\lccode`\~=`\^^M
+\catcode`\:=13
+\lccode`\:=`\ % <- space
+\catcode`\;=13
+\lccode`\;=`\^^I % <- tab
+\lowercase{\endgroup
+% \end{macrocode}
+%
+% \begin{macro}[internal]
+% {\enverb@body@space,\enverb@body@tab,\enverb@body@newline,\enverb@collect}
+% To quickly check whether a line contains only spaces or tabs we define them
+% as empty, that way we can remove them simply by one step of |\romannumeral|
+% expansion. The newlines on the other hand grab the entire next line, check
+% whether the matching |\end| is encountered, and if not leave the contents
+% in |\unexpanded|. This grabbing is not done by the newline characters
+% directly, but instead via |\enverb@collect| so that low level errors are
+% easier to understand.
+% \begin{macrocode}
+\def\enverb@body@space{}
+\def\enverb@body@tab{}
+\def\enverb@body@newline{\enverb@collect}
+\def\enverb@collect#1~%
+ {\enverb@ifnotend{#1}{\enverb@bol\unexpanded{#1}\enverb@eol\enverb@collect}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\enverbBody}
+% \begin{macro}[internal]{\enverb@body@setup}
+% This function sets up the entire category code regime and initial
+% assignments of special tokens.
+% \begin{macrocode}
+\protected\def\enverb@body@setup
+ {%
+ \let\enverbBody\@empty
+ \let\do\@makeother\dospecials
+ \endlinechar=`\^^M
+ \catcode`\^^M=13 \let~\enverb@body@newline
+ \catcode`\ =13 \let:\enverb@body@space
+ \catcode`\^^I=13 \let;\enverb@body@tab
+ \let\enverb@bol\relax
+ \let\enverb@eol\relax
+ }
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}[internal]
+% {
+% \enverb@ifxanyTF, \enverb@ifxanyTF@, \enverb@ifxanyTF@ifdone,
+% \enverb@ifxanyTF@F, \enverb@ifxanyTF@T
+% }
+% This function provides a loop to check a list of symbols whether any of them
+% matches the meaning of the first argument.
+% \begin{macrocode}
+\long\def\enverb@ifxanyTF#1#2%
+ {\enverb@ifxanyTF@#1#2\enverb@ifxanyTF@}
+\long\def\enverb@ifxanyTF@#1#2%
+ {%
+ \enverb@ifxanyTF@ifdone#2\enverb@ifxanyTF@F\enverb@ifxanyTF@
+ \enverb@ifxTF#1#2\enverb@ifxanyTF@T{\enverb@ifxanyTF@#1}%
+ }
+\long\def\enverb@ifxanyTF@ifdone#1\enverb@ifxanyTF@{}
+\long\def\enverb@ifxanyTF@F
+ \enverb@ifxanyTF@\enverb@ifxTF#1\enverb@ifxanyTF@T#2#3#4%
+ {#4}
+\long\def\enverb@ifxanyTF@T#1\enverb@ifxanyTF@#2#3{#2}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[internal]{\enverb@search@oarg@a, \enverb@search@oarg@ifx}
+% This function shall search for the optional argument. The first case is
+% rather easy, namely we check for a space (remember that |:| is an active
+% space character in the current context). If this isn't the first line (so
+% the line containing the |\begin| statement) that space is added to the body
+% and searching continues.\par
+% Next repeat the same logic but for an active tab (|;|). Afterwards we check
+% for an active newline (|~|) which if found sets the conditional for the
+% first line to false, still applying the same logic otherwise.\par
+% Lastly we check for the open bracket. If it's found we collect our optional
+% argument, otherwise the body starts, which is either an illegal character
+% immediately following the |\begin| line, or we normally collect the body.
+%
+% \begin{macrocode}
+\def\enverb@search@oarg@ifx#1#2%
+ {%
+ \enverb@ifxTF#1\@let@token
+ {%
+ \ifenverb@firsteol#2\else\enverb@body@add{#1}\fi
+ \enverb@search@oarg@b
+ }%
+ }
+\protected\def\enverb@search@oarg@a
+ {%
+ \enverb@search@oarg@ifx:{}%
+ {%
+ \enverb@search@oarg@ifx;{}%
+ {%
+ \enverb@search@oarg@ifx~\enverb@firsteolfalse
+ {%
+ \enverb@ifxTF{[}\@let@token
+ {\enverb@oarg}%
+ {%
+ \enverb@ifxanyTF\@let@token
+ {%
+ \@sptoken\par\bgroup\egroup$&##^_% $
+ }
+ {%
+ \enverb@misused
+ \endgroup
+ }%
+ {%
+ \ifenverb@firsteol
+ \expandafter\enverb@body@after@begin
+ \else
+ \expandafter\enverb@body
+ \fi
+ }%
+ }%
+ }%
+ }%
+ }%
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[internal]
+% {\enverb@body, \enverb@body@after@oarg, \enverb@body@after@begin}
+% The body collection works by collecting everything inside a macro in one
+% sweep, and a second pass over the collected material to strip leading spaces
+% if the |ignore| or |auto-ignore| feature is used. This macro starts the
+% first sweep. Since during the collection of the optional argument we might
+% already have collected a few tokens we place those at the start by expanding
+% the current definition of |\enverbBody| once.
+% \begin{macrocode}
+\protected\def\enverb@body
+ {\edef\enverbBody{\iffalse}\fi\expandafter\enverb@collect\enverbBody}
+% \end{macrocode}
+% The other two macros also start collecting the body, but are only called
+% after either an optional argument was found, or if the first non-ignored
+% character of the optional argument search was encountered before the first
+% newline. In both cases we check whether the remainder of that line can be
+% considered blank, and if so collect the body.
+% \begin{macrocode}
+\def\enverb@body@after@oarg#1~%
+ {\enverb@ensure@blank{#1}{closing bracket}\enverb@body}
+\def\enverb@body@after@begin#1~%
+ {\enverb@ensure@blank{#1}{\string\begin}\enverb@body}
+% \end{macrocode}
+% This is also the last place we need the strange category setup in, so we
+% close the delimiting brace of the |\lowercase| above here.
+% \begin{macrocode}
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[internal]{\enverb@ensure@blank}
+% We actually need to define the check for an empty line. This check here
+% works for our specifically set up regime of spaces and tabs (which both
+% expand to nothing, the same trick is basically used twice, though we once
+% fully expand and once use romannumeral-expansion).
+% \begin{macrocode}
+\newcommand\enverb@ensure@blank[2]
+ {%
+ \expandafter\enverb@ifempty\expanded{{#1}}{}%
+ {%
+ \expanded
+ {%
+ \noexpand\enverb@error
+ {%
+ Line after #2 not empty.\noexpand\MessageBreak
+ Contains: \detokenize\expandafter{\romannumeral`\^^@#1}%
+ }%
+ {%
+ \noexpand\enverb will try to ignore this. You should clean up
+ your input.%
+ }%
+ }%
+ }%
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[internal]
+% {\enverb@ifempty,\enverb@ifempty@,\enverb@ifempty@true}
+% This is just a quick argument-grabbing based test for an empty argument.
+% \begin{macrocode}
+\newcommand\enverb@ifempty[1]
+ {%
+ \enverb@ifempty@\enverb@ifempty@A#1\enverb@ifempty@B.\enverb@ifempty@true
+ \enverb@ifempty@A\enverb@ifempty@B
+ }
+\def\enverb@ifempty@#1\enverb@ifempty@A\enverb@ifempty@B#2#3{#3}
+\def\enverb@ifempty@true\enverb@ifempty@A\enverb@ifempty@B#1#2{#1}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[internal]{\enverb@add,\enverb@pre,\enverb@body@add}
+% These are just two functions to add things to a token list storing macro,
+% one is available for arbitrary contents, the other is used for the |body|.
+% \begin{macrocode}
+\protected\long\def\enverb@add#1#2{\edef#1{\unexpanded\expandafter{#1#2}}}
+\protected\long\def\enverb@pre#1#2%
+ {\edef#1{\unexpanded{#2}\unexpanded\expandafter{#1}}}
+\protected\def\enverb@body@add{\enverb@add\enverbBody}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\enverb}
+% This macro is the front facing command that starts the entire grabbing
+% logic. The first thing we need to do is define the auxiliary we use to check
+% whether we're done collecting the body, which is dependent on the current
+% environment's name. Next we store the mandatory argument in |marg| and
+% initialise the |oarg|-storage, category regime, and |firsteol|-boolean.
+% Finally we start searching for the optional argument.
+% \begin{macrocode}
+\NewDocumentCommand \enverb { s +m }
+ {%
+ \expandafter\enverb@ifnotend@setup@perhaps\expanded
+ {{\string{\@currenvir\string}}}%
+ \let\enverb@collected@oarg\@empty
+ \edef\enverb@collected@marg{\unexpanded{#2}}%
+ \begingroup
+ \enverb@body@setup
+ \IfBooleanTF{#1}%
+ {\enverb@body@after@begin}%
+ {%
+ \enverb@firsteoltrue
+ \enverb@search@oarg
+ }%
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[internal]
+% {\ifenverb@firsteol,\enverb@firsteoltrue,\enverb@firsteolfalse}
+% A simple \TeX-style boolean to keep track whether we're in front of the
+% first newline.
+% \begin{macrocode}
+\newif\ifenverb@firsteol
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[internal]{\enverb@search@oarg, \enverb@search@oarg@b}
+% The core function to search for an optional argument was already defined
+% above, these are the first and third step of that functionality (starting
+% and resuming to search).
+% \begin{macrocode}
+\protected\def\enverb@search@oarg{\futurelet\@let@token\enverb@search@oarg@a}
+\protected\def\enverb@search@oarg@b{\expandafter\enverb@search@oarg\@gobble}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[internal]{\enverb@oarg, \enverb@oarg@}
+% This is used once the opening brace of the optional argument is found. First
+% we close the group in which the body's category code regime is active, then
+% we actually collect the optional argument with the normal category codes,
+% restore the body's regime and collect it.
+% \begin{macrocode}
+\protected\def\enverb@oarg{\endgroup\enverb@oarg@}
+\NewDocumentCommand\enverb@oarg@{+O{}}
+ {%
+ \enverb@add\enverb@collected@oarg{#1}%
+ \begingroup
+ \enverb@body@setup
+ \enverb@body@after@oarg
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[internal]{\enverb@ifnotend, \enverb@ifnotend}
+% These functions check whether the input contains the string representation
+% |\end|. If it does they invoke \cs[no-index]{enverb@ifnotend@maybe} with the
+% tokens in front of |\end| and after it as two arguments. Otherwise the third
+% argument after \cs{enverb@ifnotend@}'s expansion is directly used, which is
+% the second (curried) argument to \cs{enverb@ifnotend}.
+% \begin{macrocode}
+\newcommand\enverb@ifnotend[1]%
+ {%
+ \def\enverb@ifnotend##1%
+ {%
+ \enverb@ifnotend@
+ ##1\enverb@mark\enverb@ifnotend@maybe
+ #1\enverb@mark\@thirdofthree
+ \enverb@stop
+ }%
+ \def\enverb@ifnotend@##1#1##2\enverb@mark##3##4\enverb@stop{##3{##1}{##2}}%
+ }
+\expandafter\enverb@ifnotend\expanded{{\expandafter\@gobble\string\\end}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[internal]{\enverb@ifnotend@maybe}
+% This function will be used if an |\end| was encountered and should check
+% whether that is indeed the end of our environment, it uses a second stage
+% \cs[no-index]{enverb@ifnotend@perhaps} for that check. The |\romannumeral|
+% expansion it employs will strip any leading spaces or tabs from |#2|.
+% \begin{macrocode}
+\newcommand\enverb@ifnotend@maybe[2]
+ {\expandafter\enverb@ifnotend@perhaps\expandafter{\romannumeral`\^^@#2}{#1}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[internal]
+% {
+% \enverb@ifnotend@setup@perhaps,
+% \enverb@ifnotend@perhaps, \enverb@ifnotend@perhaps@,
+% \@thirdofthree
+% }
+% We need an expandable and fast check to see whether some input really
+% contains the |\end| of our environment. Checking for |\end| itself is
+% already done above, we need to check for the correct argument to it. The
+% following does so by argument grabbing logic.
+% \begin{macrocode}
+\protected\def\enverb@ifnotend@setup@perhaps#1%
+ {%
+ \def\enverb@ifnotend@perhaps##1%
+ {%
+ \enverb@ifnotend@perhaps@\enverb@mark##1\enverb@mark\enverb@ifnotend@end
+ \enverb@mark#1\enverb@mark\@thirdofthree
+ \enverb@stop
+ }%
+ \def\enverb@ifnotend@perhaps@
+ ##1\enverb@mark#1##2\enverb@mark##3##4\enverb@stop
+ {##3{##2}}%
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[internal]{\enverb@ifnotend@end}
+% If the correct |\end| statement was found this function will be called by
+% \cs[no-index]{enverb@ifnotend@perhaps}. It's first argument will be anything
+% in that line following the |\end| statement, the second argument will be the
+% material in front of it. And |#3| will be whatever the argument to
+% \cs[no-index]{enverb@ifnotend} was.
+%
+% The first thing we need to do is end the body collection by placing the
+% matching closing brace. After that we throw an error on lost content after
+% the |\end| if it's non-blank. And finally we need to smuggle the collected
+% body outside the current group's scope.
+% \begin{macrocode}
+\def\enverb@ifnotend@end#1#2#3%
+ {%
+ \iffalse{\fi}%
+ \enverb@ensure@blank{#1}{\string\end}%
+ \expandafter\enverb@finalise\expandafter{\enverbBody}{#2}%
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[internal]{\enverb@finalise}
+% The finalising function closes the group containing the body's catcode
+% regime. The already tokenised body is |#1|, and |#2| is the contents found
+% in front of the |\end| statement, which we might use for the auto-ignore
+% feature.
+%
+% It then does the key=val parsing, sets up the aftertreatment and assigns the
+% final meaning to \cs{enverbBody}. Eventually it calls the end code of the
+% enclosing environment.
+% \begin{macrocode}
+\protected\def\enverb@finalise#1#2%
+ {%
+ \endgroup
+ \expandafter\enverbsetup\expandafter{\enverb@collected@marg}%
+ \enverb@ifoargtokeyhandler
+ {%
+ \expandafter\enverb@keyhandler\expanded
+ {{%
+ \unexpanded\expandafter{\enverb@unknown@kv},%
+ \unexpanded\expandafter{\enverb@collected@oarg}%
+ }}%
+ }%
+ {%
+ \expandafter\enverbsetup\expandafter{\enverb@collected@oarg}%
+ \expandafter\enverb@keyhandler\expandafter{\enverb@unknown@kv}%
+ }%
+ \enverb@ifautoignore
+ {\enverb@setup@ignore{\enverb@count{#2}+\enverb@moreignore}}%
+ {\enverb@setup@ignore\enverb@ignore}%
+ \edef\enverb@line##1\enverb@eol
+ {%
+ \noexpand\unexpanded{##1}%
+ %\noexpand\detokenize{##1}% % TODO
+ \noexpand\unexpanded{\unexpanded\expandafter{\enverb@eol@content}}%
+ }%
+ \edef\enverbBody{#1}%
+ \expandafter\end\expandafter{\@currenvir}%
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[internal]{\enverb@setup@ignore, \enverb@setup@ignore@}
+% \begin{macrocode}
+\protected\def\enverb@setup@ignore#1%
+ {\expandafter\enverb@setup@ignore@\the\numexpr#1\relax;\enverb@line}
+\protected\def\enverb@setup@ignore@#1;#2%
+ {%
+ \ifnum#1>9
+ \expandafter\@firstoftwo
+ \else
+ \expandafter\@secondoftwo
+ \fi
+ {\expandafter\enverb@setup@ignore@\the\numexpr#1-8;{\@firstofnine{#2}}}%
+% \end{macrocode}
+% Just to make sure that |\renewcommand| works correctly, we ensure the macro
+% exists.
+% \begin{macrocode}
+ {%
+ \let\enverb@bol@gobble\@empty
+ \expanded
+ {%
+ \unexpanded{\renewcommand\enverb@bol@gobble}\ifnum#1>\z@[#1]\fi
+ {\unexpanded{#2}}%
+ \unexpanded{\def\enverb@bol##1\enverb@eol}%
+ {%
+ \noexpand\unexpanded
+ {\unexpanded\expandafter{\enverb@bol@content}}%
+ \unexpanded{\expandafter\enverb@ifempty\expanded}{{##1}}%
+ {\noexpand\enverb@line}%
+ {\noexpand\enverb@bol@gobble}%
+ ##1\noexpand\enverb@eol
+ }%
+ }%
+ }%
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Output Oriented Macros}
+%
+% \begin{macro}[internal]{\enverb@rmeol, \enverb@rmeol@}
+% Many of our output routines require the |\scantokens| primitive. Since that
+% one places an additional end of line at the end of its argument we need a
+% way to remove it (this usually results in an additional space in the output
+% otherwise). For that we place a comment character at the end of the input
+% (if it's possible), if that's not available we hope that a stringified
+% |\relax| will do. The code here will use \pkg{expl3} for ease of coding.
+% \begin{macrocode}
+\def\enverb@rmeol
+ {%
+ \ifnum\catcode`\%=14
+ \enverb@chargen{`\%}{12}%
+ \expandafter\enverb@stop
+ \fi
+ \enverb@rmeol@0;%
+ \enverb@stop
+ }
+\def\enverb@rmeol@#1;%
+ {%
+ \ifnum#1=128
+ \string\relax
+ \expandafter\enverb@stop
+ \fi
+ \@firstofone
+ {%
+ \ifnum\catcode`\%=14
+ \enverb@chargen{#1}{12}%
+ \expandafter\enverb@stop
+ \fi
+ \expandafter\enverb@rmeol@\the\numexpr#1+1;%
+ }%
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\enverbExecute}
+% \begin{macrocode}
+\NewDocumentCommand\enverbExecute{}
+ {%
+ \begingroup
+ \newlinechar=`\^^M
+ \expandafter
+ \endgroup
+ \scantokens\expanded
+ {{%
+ \detokenize\expandafter{\enverbBody}%
+ \enverb@rmeol
+ }}%
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\enverbListing}
+% \begin{macro}[internal]{\enverbListing@}
+% \begin{macrocode}
+\NewDocumentCommand \enverbListing { m m }
+ {%
+ \scantokens\expanded
+ {{%
+ \string\begin{#1}\detokenize{#2}\enverb@othercr
+ \detokenize\expandafter{\enverbBody}%
+ \string\end{#1}\enverb@othercr
+ \enverb@rmeol
+ }}%
+ }
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \gobbledocstriptag
+%</pkg>
diff --git a/Master/texmf-dist/source/latex/fancyhdr/fancyhdr.dtx b/Master/texmf-dist/source/latex/fancyhdr/fancyhdr.dtx
index 43c6631bba5..c20c966b8b1 100644
--- a/Master/texmf-dist/source/latex/fancyhdr/fancyhdr.dtx
+++ b/Master/texmf-dist/source/latex/fancyhdr/fancyhdr.dtx
@@ -26,7 +26,7 @@
%<fancyhdr>\ProvidesPackage{fancyhdr}%
%<fancyheadings>\ProvidesPackage{fancyheadings}
%<extramarks>\ProvidesPackage{extramarks}
-%<fancyhdr|extramarks> [2024/04/23 v4.2
+%<fancyhdr|extramarks> [2024/07/23 v4.3.1
%<fancyhdr> Extensive control of page headers and footers]%
%<fancyheadings> [2022/11/09 v4.1
%<fancyheadings> Legacy package to call fancyhdr]
@@ -59,8 +59,6 @@
\def\pAmS{{\the\textfont2
A\kern-.1667em\lower.5ex\hbox{M}\kern-.125emS}}
\def\amslatex/{\ams/-\latex/}
-\newcommand{\PSNFSS}{{\sf
- PSNFSS}}
\newcommand{\bs}{\symbol{'134}}
\newcommand{\env}[1]{\texttt{#1}}
\newcommand{\Package}[1]{\textsf{#1}}
@@ -206,7 +204,7 @@
% \DoNotIndex{\#,\$,\%,\&,\@,\\,\{,\},\^,\_,\~,\ }
% \DoNotIndex{\@ne}
% \DoNotIndex{\advance,\begingroup,\catcode,\closein}
-% \DoNotIndex{\closeout,\day,\def,\edef,\else,\empty,\endgroup}
+% \DoNotIndex{\closeout,\day,\def,\edef,\else,\empty,\@empty,\endgroup}
%
% \title{The \Package{fancyhdr} and \Package{extramarks}
% packages\\{\normalsize version \fileversion.}}
@@ -228,7 +226,7 @@
%
% This documentation describes version 4.0 or later of the
% \Package{fancyhdr} and \Package{extramarks} packages. The user
-% documentation is valid for the versions 3.8 or later of the
+% documentation is valid for the versions 4.0 or later of the
% \Package{fancyhdr} package (except for the changes mentioned in
% section~\ref{sec:version-4}), and version 2.1 or later of the
% \Package{extramarks} package.
@@ -253,11 +251,11 @@
%
% Part IV contains the annotated implementation.
%
-% This document describes version 4 of \Package{fancyhdr}. This version
-% is also described in the forthcoming edition 3 of \textit{The \latex/ Companion},
-% whereas the previous editions describe version 3 of \Package{fancyhdr}.
-% There are some significant differences between these versions. These
-% are summarized in section~\ref{sec:version-4} on page~\pageref{sec:version-4}.
+% This document describes version 4 of \Package{fancyhdr}, which is described in
+% the \emph{The \LaTeX{} Companion, Third Edition}.
+% The differences between this version and previous versions
+% are summarized in section~\ref{sec:version-4} on
+% page~\pageref{sec:version-4}.
% Throughout this documentation it is mentioned when a specific feature
% is only available in version 4, or when there are differences between
% version 3 and 4.
@@ -304,16 +302,14 @@
% \OPTindex{twoside}
% \OPTindex{headings}
% \OPTindex{myheadings}
-% \DescribeMacro{\fancyhead}
-% \DescribeMacro{\fancyfoot}
-% \DescribeMacro{\fancyhf}
-% \begin{verbatim}
-% \fancyhead[places]{field}
-% \fancyfoot[places]{field}
-% \fancyhf[places]{field}
-% \end{verbatim}
-% Here \texttt{places} is a comma-separated list of places where
-% \texttt{field} will be placed. There are 12 places defined: Left,
+%
+% \begin{flushleft}
+% \DescribeMacro{\fancyhead}\cmd{\fancyhead}\oarg{places}\marg{field} \\
+% \DescribeMacro{\fancyfoot}\cmd{\fancyfoot}\oarg{places}\marg{field} \\
+% \DescribeMacro{\fancyhf}\cmd{\fancyhf}\oarg{places}\marg{field}
+% \end{flushleft}
+% Here \meta{places} is a comma-separated list of places where
+% \meta{field} will be placed. There are 12 places defined: Left,
% Center and Right Headers and Footers, and both can be on Even or Odd
% pages. Each place therefore has 3 coordinates which are the inital
% letters of the above description: (1) \texttt{E} or \texttt{O}, (2) \texttt{L}, \texttt{C} or
@@ -321,14 +317,12 @@
% letters, like \texttt{EOH}. A missing coordinate means: all
% possibilities, except for \cs{fancyhead} where \texttt{H} is implied
% and \cs{fancyfoot} where \texttt{F} is implied.
-% \DescribeMacro{\fancyheadoffset}
-% \DescribeMacro{\fancyfootoffset}
-% \DescribeMacro{\fancyhfoffset}
-% \begin{verbatim}
-% \fancyheadoffset[places]{field}
-% \fancyfootoffset[places]{field}
-% \fancyhfoffset[places]{field}
-% \end{verbatim}
+%
+% \begin{flushleft}
+% \DescribeMacro{\fancyheadoffset}\cmd{\fancyheadoffset}\oarg{places}\marg{length} \\
+% \DescribeMacro{\fancyfootoffset}\cmd{\fancyfootoffset}\oarg{places}\marg{length} \\
+% \DescribeMacro{\fancyhfoffset}\cmd{\fancyhfoffset}\oarg{places}\marg{length}
+% \end{flushleft}
% These define offsets to let the headers stick into the margin (or to
% the inside if negative). Places cannot contain the \texttt{C}
% specifier. See section~\ref{sec:book-examples} for more details.
@@ -340,7 +334,6 @@
% \DescribeMacro{\headrule}
% \DescribeMacro{\footrule}
% \DescribeMacro{\headwidth}
-%
% \cs{headrulewidth} and \cs{footrulewidth} are macros to define the
% thickness of a line under the header and above the footer.
% \cs{headruleskip} and \cs{footruleskip} are macros that define the
@@ -353,7 +346,6 @@
% \DescribeMacro{\fancyheadinit}
% \DescribeMacro{\fancyfootinit}
% \DescribeMacro{\fancyhfinit}
-%
% \cs{fancyheadinit} and \cs{fancyfootinit} can be used to define
% initialisation code for the header and footer, respectively, and
% \cs{fancyhfinit} defines both of these. These commands are only
@@ -367,7 +359,6 @@
% \DescribeMacro{\ifbotfloat}
% \DescribeMacro{\iffloatpage}
% \DescribeMacro{\iffootnote}
-%
% The macros \cs{iftopfloat}, \cs{ifbotfloat}, \cs{iffloatpage} and
% \cs{iffootnote} are used to detect if there is a float on the top or
% the bottom of the page, or the page is a float page, or if there is
@@ -375,10 +366,10 @@
% different headers and/or footers if these conditions are met. See
% section~\ref{sec:float} for more details.
%
-% \begin{quote}
-% \DescribeMacro{\fancypagestyle}
-% \verb|\fancypagestyle|\marg{style-name}\oarg{base-style}\marg{definitions}
-% \end{quote}
+% \begin{flushleft}
+% \DescribeMacro{\fancypagestyle}
+% \cmd{\fancypagestyle}\marg{style-name}\oarg{base-style}\marg{definitions}
+% \end{flushleft}
% This command lets you (re)define page styles for use in special
% situations. See section~\ref{sec:fancypagestyle} for more details.
%
@@ -393,13 +384,6 @@
% \DescribeMacro{\lastrightmark}
% \DescribeMacro{\firstrightmark}
% \DescribeMacro{\lastleftmark}
-% \begin{verbatim}
-% \firstleftmark
-% \lastrightmark
-% \firstrightmark
-% \lastleftmark
-% \end{verbatim}
-%
% Standard \latex/ has two marks: a left and a right one. The standard
% command \cs{leftmark} gives you the last left mark on a page, and
% \cs{rightmark} gives you the first right one. These macros give you
@@ -486,7 +470,7 @@
%
% The page headers and footers in \LaTeX{} are defined by the
% \cs{pagestyle} and \cs{pagenumbering} commands. \cs{pagestyle}
-% defines the general contents of the headers and footers (e.g. where the
+% defines the general contents of the headers and footers (e.g.\ where the
% page number will be printed), while
% \cs{pagenumbering} defines the format of the page number.
% \LaTeX{} has four standard page styles:
@@ -527,7 +511,7 @@
%
% These are not user commands, but rather ``variables'' that are used by
% \latex/'s output routine.
-% As the command names contain the character '\texttt{@}', they should
+% As the command names contain the character `\texttt{@}', they should
% be defined in a package file, or otherwise be sandwiched between the commands
% \cs{makeatletter} and \cs{makeatother}.
%
@@ -605,6 +589,12 @@
% We define each of the six ``fields'' and the two decorative lines
% separately.
%
+% \begin{fblock}
+% \textbf{NOTE:} In \Package{fancyhdr} version 4.3 and later, paragraph
+% hooks will not work inside \Package{fancyhdr} headers and footers to
+% avoid unwanted interactions with the main text.
+% \end{fblock}
+%
% \section{A simple example}
% \label{sec:simple}
%
@@ -784,7 +774,7 @@
% for which pages and/or parts of the header/footer they apply. The first
% \cs{fancyhead} command above omits this parameter, and thus applies to all
% header fields. In general this is only useful to get rid of the defaults or
-% a previous definition, as is done here. Similar the \cs{fancyfoot} command
+% a previous definition, as is done here. Similarly the \cs{fancyfoot} command
% without square brackets clears all footer fields. In this particular
% example it could be omitted as all footer fields have a value specified.
% The selectors that can be used
@@ -846,7 +836,7 @@
% \cs{ps@plain} command, but \Package{fancyhdr} gives you an easier way
% with the \cs{fancypagestyle} command. This command can be used to
% redefine existing page styles (like \texttt{plain}) or to define new ones,
-% e.g. if part of your document needs a different page style. This command
+% e.g.\ if part of your document needs a different page style. This command
% has two mandatory parameters: the first one is the name of the page style to be defined, the
% second consists of commands that change the headers and/or footers, i.e.,
% \verb|\fancyhead| etc. Also allowed are changes to \cs{headrulewidth} and
@@ -1105,8 +1095,8 @@
% section and subsection information (section only for one-sided
% printing). \latex/ uses a marker mechanism to remember the chapter and
% section (section and subsection) information for a page; this is
-% discussed in detail in \textit{The \latex/ Companion}, Section 4.3.1, or
-% \textit{The \latex/ Companion, Second Edition}, Section 4.3.4.
+% discussed in detail in \emph{The \LaTeX{} Companion, Third Edition},
+% section 5.3.4 (Part I).
%
% There are two ways you can use and change the higher- and lower-level
% sectioning information available to you. The macros:
@@ -1263,7 +1253,7 @@
%
% As an example let's take a page layout where the leftmarks are generated by
% the sections and the rightmarks by the subsections (as is default in the
-% \texttt{article} class). Take a page with some short sections, e.g.
+% \texttt{article} class). Take a page with some short sections, e.g.,
%
% \begin{samepage}
% \noindent Section 1.\\
@@ -1294,7 +1284,7 @@
% \end{verbatim}
%
% Another problem with the marks in the standard \latex/ classes is that the
-% higher level sectioning commands (e.g. \cs{chapter}) call
+% higher level sectioning commands (e.g.\ \cs{chapter}) call
% \cs{markboth} with an empty right argument. This means that on the first
% page of a chapter (or a section in article style) the \cs{rightmark}
% will be empty. The underlying problem is that the \tex/ machinery has
@@ -1310,7 +1300,7 @@
% \cs{chapter} etc.\ commands do \emph{not} call the mark commands. So if
% you want your preface to set the header info but not be numbered nor be put in
% the table of contents, you must issue the \cs{markboth} command
-% yourself, e.g.
+% yourself, e.g.,
%
% \begin{verbatim}
% \chapter*{Preface}
@@ -1378,7 +1368,8 @@
% \footnote{If you use \texttt{11pt} or \texttt{12pt} you will probably also
% have to do this, because \LaTeX's defaults are quite small}. See the
% warning below.
-% See also Section 4.1 of the \latex/ \emph{Companion} for detail.
+% See also section 5.1 and 5.2 of the \LaTeX{} \emph{Companion, Third Edition}, (Part I)
+% for detail.
%
% For instance, the following code will place the section title and the
% subsection title of an article in two lines in the upper right hand
@@ -1626,7 +1617,7 @@
% in the neighborhood of your header/footer definitions, unless you
% already use such an \texttt{\ldots offset} command, of course.
% \vspace{\baselineskip}
-%
+%
% For the second example, we take the \amslatex/ book\footnote{George Gratzer,
% \textit{Math into LaTeX, An Introduction to \LaTeX{} and \amslatex/}, Birkhauser, Boston.}.
%
@@ -1661,18 +1652,19 @@
% \renewcommand{\footrulewidth}{0pt}
% \end{verbatim}
%
-% The font used in the headers is 9 pt bold Helvetica. The \PSNFSS\ system
-% by Sebastian Rahtz uses the short (Karl Berry) name \verb|phv| for
-% Helvetica, so this font is selected with the commands:
+% The font used in the headers is 9 pt bold Helvetica. The \textsf{PSNFSS} system
+% (originally by the late Sebastian Rahtz) uses the short (Karl Berry) name \texttt{phv} for
+% Helvetica. The more modern \LaTeX{} solution is to use the \TeX{} Gyre font
+% Heros, which uses the short name \texttt{qhv} so this font is selected with the commands^^A
+% \footnote{See \emph{The \LaTeX{} Companion, Third Edition}, Part I, section
+% 9.5.2, and Part II, section 10.8.16.}:
% \begin{verbatim}
-% \fontfamily{phv}\fontseries{b}\fontsize{9}{11}\selectfont
+% \fontfamily{qhv}\fontseries{b}\fontsize{9}{11}\selectfont
% \end{verbatim}
-% (See Sections 7.6.1 and 11.9.1 of the \latex/ \emph{Companion} or
-% Sections 7.6 and 7.9.1 of \emph{The \latex/ Companion, Second Edition}.)
% Let us define a shorthand for this:
% \begin{verbatim}
% \newcommand{\helv}{%
-% \fontfamily{phv}\fontseries{b}\fontsize{9}{11}\selectfont}
+% \fontfamily{qhv}\fontseries{b}\fontsize{9}{11}\selectfont}
% \end{verbatim}
%
% Now we are ready for the page layout:
@@ -1688,7 +1680,7 @@
% \renewcommand{\headrulewidth}{0.5pt}
% \renewcommand{\footrulewidth}{0pt}
% \newcommand{\helv}{%
-% \fontfamily{phv}\fontseries{b}\fontsize{9}{11}\selectfont}
+% \fontfamily{qhv}\fontseries{b}\fontsize{9}{11}\selectfont}
% \fancyhf{}
% \fancyhead[LE,RO]{\helv \thepage}
% \fancyhead[LO]{\helv \rightmark}
@@ -1719,6 +1711,21 @@
% \renewcommand{\headrulewidth}{\iffloatpage{0pt}{0.4pt}}
% \end{verbatim}
%
+% \textbf{NOTE:} There is also a package \TTindex{floatpag}%
+% \Package{floatpag}\footnote{\url{https://www.ctan.org/pkg/floatpag}} by Vytas
+% StatuleviÄius and Sigitas ToluÅ¡is that has a command
+% \cs{floatpagestyle}\marg{pagestyle}, that applies \meta{pagestyle} to
+% all float pages, where \meta{pagestyle} can be defined with
+% \cs{fancypagestyle} (or by any other means).
+%
+% \textbf{NOTE:} There is also a package \TTindex{floatpag}%
+% \Package{floatpag}\footnote{\url{https://www.ctan.org/pkg/floatpag}} by Vytas
+% StatuleviÄius and Sigitas ToluÅ¡is that has a command
+% \cs{floatpagestyle}\marg{pagestyle}, that applies \meta{pagestyle} to
+% all float pages, where \meta{pagestyle} can be defined with
+% \cs{fancypagestyle} (or by any other means). In some cases this might
+% be simpler than putting \cs{iffloatpage} in various headers or footers.
+%
% Sometimes you may want to change the layout also for pages that contain a
% float on the top of the page, a float on the bottom of the page or a footnote on the bottom of the page.
%
@@ -1848,12 +1855,16 @@
% \CmdIndex{pagenumbering}
%
% \begin{verbatim}
+% \clearpage
% \pagenumbering[\thesection]{bychapter}
% \end{verbatim}
%
% What the package also does is reset the page number to 1 at the beginning
% of each chapter.
%
+% In general it is advisable to give a \cs{clearpage} or
+% \cs{cleardoublepage} before changing the page numbering.
+%
% In the frontmatter of your document (for example the Table of
% Contents) there will be no chapter numbers. Therefore a simple page
% number will be used there. This may be confusing, so you might prefer to use roman pagenumbers
@@ -2601,7 +2612,7 @@
% \end{enumerate}
%
% In the first two cases you must first check if you have given the correct
-% ``placement'' parameter to you float, e.g. \Cmd{begin\{figure\}[htp]}
+% ``placement'' parameter to you float, e.g.\ \Cmd{begin\{figure\}[htp]}
% specifies that your figure may be placed either: Here (i.e., in the text
% position where the command is given), on the Top of a page (which may be
% the page where you put the command), or on a separate Page of floats. You
@@ -2660,7 +2671,7 @@
% than 50\% of the page height it will have to wait until some more floats
% are given before a float page can be filled to satisfy the
% \cs{floatpagefraction} parameter. If you have this kind of behaviour you
-% can easily adapt the parameters, e.g. with:
+% can easily adapt the parameters, e.g.\ with:
% \begin{verbatim}
% \renewcommand{\textfraction}{0.05}
% \renewcommand{\topfraction}{0.95}
@@ -2673,7 +2684,7 @@
%
% You can force \latex/ to ignore most of the parameters for one specific float
% occurrence by
-% including an exclamation mark (!) in the placement parameters, e.g.
+% including an exclamation mark (!) in the placement parameters, e.g.,
% \begin{verbatim}
% \begin{figure}[!htb]
% \end{verbatim}
@@ -2811,7 +2822,7 @@
% normal text rather than a \cs{caption}, so that it will not be entered in
% the list of figures. It may also be desirable to issue a \cs{clearpage}
% first, just like we did for the \texttt{longtable}, and to encapsulate this
-% in the \cs{afterpage} command. E.g.
+% in the \cs{afterpage} command. E.g.,
% \begin{verbatim}
% \afterpage{\clearpage\input{myfigure}}
% \end{verbatim}
@@ -2832,7 +2843,7 @@
%
% You have to make sure that the last part is big enough, otherwise \LaTeX{}
% could decide to postpone it until it has collected some more floats. This
-% can be done either by making the figure big enough (e.g. by adding some
+% can be done either by making the figure big enough (e.g.\ by adding some
% \cs{vspace}), or by tweaking the \cs{floatpagefraction}
% \CmdIndex{floatpagefraction} parameter.
%
@@ -3054,9 +3065,27 @@
% \cs{input} in headers/footers when \texttt{verbatim} is active.
% (Issue \# 8 \url{https://github.com/pietvo/fancyhdr/issues/8}.)
% \end{itemize}
+% \item Version 4.3, July 17, 2024
+% \begin{itemize}
+% \item Changed \cs{f@nch@everypar}. If the LaTeX kernel has
+% \texttt{expl3}, use \cs{tex\_everypar:D}, and reset \cs{par},
+% \cs{@@par} and \cs{endgraf} to their original \TeX{} definitions, so that
+% no paragraph hooks will intrude in \Package{fancyhdr} code\footnote
+% {See \url{https://tex.stackexchange.com/q/691262/113546}}.
+% Therefore paragraph hooks will not work inside \Package{fancyhdr} headers and
+% footers to avoid unwanted interactions with the main text.
+% \end{itemize}
+% \item % Version 4.3.1, July 23, 2024
+% \begin{itemize}
+% \item Also reset \cs{everypar} to its original \TeX{} value
+% \cs{tex\_everypar:D} in \cs{f@nch@resetpar}, otherwise environments
+% based on \cs{trivlist} will not work properly in \Package{fancyhdr}
+% headers and footers.
+% \end{itemize}
% \end{itemize}
%
%
+%
% \StopEventually{%
% \PrintChanges
% \PrintIndex}
@@ -3648,26 +3677,8 @@
\ProcessOptions*
% \end{macrocode}
%
-% \begin{macro}{\f@nch@errmsg}
-% This macro generates an error message.
-% \changes{fancyhdr v3.10}{2019/01/25}{Use \cs{f@nch@ifundefined} instead of \cs{ifx}.}
-% \changes{fancyhdr v3.10}{2019/01/25}{Use \cs{newcommand} instead of \cs{def}.}
-% \begin{macrocode}
-\newcommand\f@nch@errmsg[1]{%
- \f@nch@ifundefined{PackageError}{\errmessage{#1}}{\PackageError{fancyhdr}{#1}{}}}
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\f@nch@warning}
-% This macro generates a warning.
-% \changes{fancyhdr v3.10}{2019/01/25}{Use \cs{f@nch@ifundefined} instead of \cs{ifx}.}
-% \changes{fancyhdr v3.10}{2019/01/25}{Use \cs{newcommand} instead of \cs{def}.}
-% \begin{macrocode}
-\newcommand\f@nch@warning[1]{%
- \f@nch@ifundefined{PackageWarning}{\errmessage{#1}}{\PackageWarning{fancyhdr}{#1}{}}}
-% \end{macrocode}
-% \end{macro}
-%
+% \changes{fancyhdr v4.3}{2024/05/08}{Removed \cs{f@nch@errmsg} and
+% \cs{f@nch@warning} and used \cs{PackageError} and \cs{PackageWarning} directly.}
% \begin{macro}{\f@nch@forc}
% Usage: \cs{f@nch@forc} \cs{var} \texttt{\{charstring\}\{body\}}.\\
% Execute the body for each character in \texttt{charstring} bound
@@ -3766,7 +3777,7 @@
\if@twoside\else
\iff@nch@twoside\else
\if\f@nch@@eo e%
- \f@nch@warning {\string#1's `E' option without twoside option is useless.\MessageBreak
+ \PackageWarning{fancyhdr} {\string#1's `E' option without twoside option is useless.\MessageBreak
Please consider using the `twoside' option}%
\fi\fi\fi
}
@@ -3791,8 +3802,8 @@
\f@nch@forc\tmpf@ra{#3}%
{\expandafter\f@nch@ifin\tmpf@ra{eolcrhf,EOLCRHF}%
{}{\edef\temp@c{\temp@c\tmpf@ra}}}%
- \ifx\@empty\temp@c\else \f@nch@errmsg{Illegal char `\temp@c' in
- \string#1 argument: [#3]}%
+ \ifx\@empty\temp@c\else \PackageError{fancyhdr}{Illegal char `\temp@c' in
+ \string#1 argument: [#3]}{}%
\fi \f@nch@for\temp@c{#3}%
{\f@nch@default\f@nch@@eo{eo}\temp@c
\f@nch@fancyhf@Echeck{#1}%
@@ -3827,8 +3838,8 @@
\f@nch@forc\tmpf@ra{#3}%
{\expandafter\f@nch@ifin\tmpf@ra{eolrhf,EOLRHF}%
{}{\edef\temp@c{\temp@c\tmpf@ra}}}%
- \ifx\@empty\temp@c\else \f@nch@errmsg{Illegal char `\temp@c' in
- \string#1 argument: [#3]}%
+ \ifx\@empty\temp@c\else \PackageError{fancyhdr}{Illegal char `\temp@c' in
+ \string#1 argument: [#3]}{}%
\fi \f@nch@for\temp@c{#3}%
{\f@nch@default\f@nch@@eo{eo}\temp@c
\f@nch@fancyhf@Echeck{#1}%
@@ -4000,6 +4011,14 @@
% \begin{macro}{\f@nch@raggedright}
% \begin{macro}{\f@nch@centering}
% \begin{macro}{\f@nch@everypar}
+% \changes{fancyhdr v4.3}{2024/07/17}{Changed \cs{f@nch@everypar}. If the
+% LaTeX kernel has expl3, use \cs{tex\_everypar:D}, and reset \cs{par},
+% \cs{@@par} and \cs{endgraf} to their original \TeX{} definitions, so that
+% no paragraph hooks will intrude in \Package{fancyhdr} code.}
+% \changes{fancyhdr v4.3.1}{2024/07/23}{Also reset \cs{everypar} to its
+% original \TeX{} value \cs{tex\_everypar:D} in \cs{f@nch@resetpar},
+% otherwise environments based on \cs{trivlist}
+% will not work properly in \Package{fancyhdr} headers and footers.}
% Save the standard definitions of \cs{raggedleft}, \cs{raggedright},
% \cs{centering} and \cs{everypar} so that we can reset them when we are
% typesetting the headers and footers. Some packages change these to
@@ -4008,7 +4027,23 @@
\let\f@nch@raggedleft\raggedleft
\let\f@nch@raggedright\raggedright
\let\f@nch@centering\centering
-\let\f@nch@everypar\everypar
+\ifdefined\ExplSyntaxOn
+ \ExplSyntaxOn
+ \let\f@nch@everypar\tex_everypar:D
+ \newcommand\f@nch@resetpar{%
+ \f@nch@everypar{}%
+ \cs_set_eq:NN \everypar\tex_everypar:D
+ \cs_set_eq:NN \par \tex_par:D
+ \cs_set_eq:NN \@@par \tex_par:D
+ \cs_set_eq:NN \endgraf \tex_par:D
+ }
+ \ExplSyntaxOff
+\else
+ \let\f@nch@everypar\everypar
+ \newcommand\f@nch@resetpar{%
+ \f@nch@everypar{}%
+ }
+\fi
% \end{macrocode}
% \end{macro}
% \end{macro}
@@ -4044,8 +4079,10 @@
% \changes{fancyhdr v4.2}{2024/04/19}{Reset catcodes to their default
% values in order to facilitate \cs{input} in headers/footers when \texttt{verbatim}
% is active. (Issue \# 8 \url{https://github.com/pietvo/fancyhdr/issues/8}.)}
+% \changes{fancyhdr v4.3}{2024/05/08}{Remove pre-NFSS stuff}
+% \changes{fancyhdr v4.3}{2024/07/17}{Replace \cs{f@nch@everypar} by \cs{f@nch@resetpar}.}
% \begin{macrocode}
-\def\f@nch@reset{\f@nch@everypar{}\restorecr\endlinechar=13
+\def\f@nch@reset{\f@nch@resetpar\restorecr\endlinechar=13
\catcode`\\=0\catcode`\{=1\catcode`\}=2\catcode`\$=3\catcode`\&=4
\catcode`\#=6\catcode`\^=7\catcode`\_=8\catcode`\ =10\catcode`\@=11
\catcode`\:=11\catcode`\~=13\catcode`\%=14
@@ -4061,10 +4098,8 @@
\expandafter\def\csname MakeUppercase\space\space\space\endcsname
[####1]####2{####2}%
##1}}%
- \f@nch@ifundefined{@newbaseline} % NFSS not present; 2.09 or 2e
- {\f@nch@ifundefined{@normalsize} {\normalsize} % for ucthesis.cls
- {\@normalsize}}%
- {\@newbaseline}% NFSS (2.09) present
+ \f@nch@ifundefined{@normalsize} {\normalsize} % for ucthesis.cls
+ {\@normalsize}%
}
% \end{macrocode}
% \end{macro}
@@ -4213,7 +4248,7 @@
% \begin{macrocode}
\iff@nch@check
\dimen0=#1\advance\dimen0-\ht0
- \f@nch@warning{%
+ \PackageWarning{fancyhdr}{%
\string#1 is too small (\the#1): \MessageBreak
Make it at least \the\ht0, for example:\MessageBreak
\string\setlength{\string#1}{\the\ht0}%
@@ -4309,7 +4344,7 @@
% \cs{color} command. The \cs{ignorespaces} skips initial spaces in
% the parameter, as is usual in a \cs{parbox}, for backwards compatibility.}
% We put the \cs{footrule} in a \cs{vbox} to accommodate for flexible
-% footrules (e.g. using \cs{hrulefill}), so that the \cs{headwidth} will
+% footrules (e.g.\ using \cs{hrulefill}), so that the \cs{headwidth} will
% be used as the line width. But to preserve the vertical spacing we
% then \cs{unvbox} this box.
%
@@ -4348,7 +4383,7 @@
% \end{macro}
%
% \begin{macro}{\@chapapp}
-% Define \cs{@chapapp} for classes that don't have it, e.g. amsbook
+% Define \cs{@chapapp} for classes that don't have it, e.g.\ amsbook
% \begin{macrocode}
\f@nch@ifundefined{@chapapp}{\let\@chapapp\chaptername}{}%
% \end{macrocode}
@@ -4660,9 +4695,10 @@
% \begin{macro}{\iffootnote}
% These can be used in a header/footer field to make them conditional on
% the presence of floats and/or footnotes.
+% \changes{fancyhdr v4.3}{2024/05/08}{Replace \cs{empty} with \cs{@empty}}
% \begin{macrocode}
-\newcommand\iftopfloat[2]{\ifx\topfloat\empty #2\else #1\fi}%
-\newcommand\ifbotfloat[2]{\ifx\botfloat\empty #2\else #1\fi}%
+\newcommand\iftopfloat[2]{\ifx\topfloat\@empty #2\else #1\fi}%
+\newcommand\ifbotfloat[2]{\ifx\botfloat\@empty #2\else #1\fi}%
\newcommand\iffloatpage[2]{\if@fcolmade #1\else #2\fi}%
\newcommand\iffootnote[2]{\iff@nch@footnote #1\else #2\fi}%
% \end{macrocode}
@@ -4688,10 +4724,10 @@
% \begin{macrocode}
\long\def\f@nch@pagestyle#1[#2]#3{%
\f@nch@ifundefined{ps@#2}{%
- \f@nch@errmsg{\string\fancypagestyle: Unknown base page style `#2'}%
+ \PackageError{fancyhdr}{\string\fancypagestyle: Unknown base page style `#2'}{}%
}{%
\f@nch@ifundefined{f@nch@ps@#2-is-fancyhdr}{%
- \f@nch@errmsg{\string\fancypagestyle: Base page style `#2' is not fancyhdr-based}%
+ \PackageError{fancyhdr}{\string\fancypagestyle: Base page style `#2' is not fancyhdr-based}{}%
}%
{%
\@namedef{ps@#1}{\let\f@nch@gbl\relax\@nameuse{ps@#2}#3\relax}%
diff --git a/Master/texmf-dist/source/latex/fillwith/fillwith.dtx b/Master/texmf-dist/source/latex/fillwith/fillwith.dtx
new file mode 100644
index 00000000000..c066ac9dade
--- /dev/null
+++ b/Master/texmf-dist/source/latex/fillwith/fillwith.dtx
@@ -0,0 +1,747 @@
+% \iffalse meta-comment
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% fillwith.dtx
+% Additions and changes Copyright (C) 2024 Clea F. Rees.
+% Code from skeleton.dtx Copyright (C) 2015-2024 Scott Pakin (see below).
+%
+% This work 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-05-04 or later.
+%
+% This work has the LPPL maintenance status \muaintained'.
+%
+% The Current Maintainer of this work is Clea F. Rees.
+%
+% This work consists of all files listed in manifest.txt.
+%
+% The file fillwith.dtx is a derived work under the terms of the
+% LPPL. It is based on version 2.4 of skeleton.dtx which is part of
+% dtxtut by Scott Pakin. A copy of dtxtut, including the
+% unmodified version of skeleton.dtx is available from
+% https://www.ctan.org/pkg/dtxtut and released under the LPPL.
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% \fi
+%
+% \iffalse
+%<*driver>
+\RequirePackage{svn-prov}
+\ProvidesFileSVN{$Id: fillwith.dtx 10202 2024-08-08 15:33:47Z cfrees $}[v0.3 \revinfo][\filename: \filebase]
+\DefineFileInfoSVN[fillwith]
+\GetFileInfoSVN*
+% ref. ateb Max Chernoff: https://tex.stackexchange.com/a/723294/
+\def\MakePrivateLetters{\makeatletter\ExplSyntaxOn\endlinechar13}
+\documentclass[british,a4paper]{ltxdoc}
+\usepackage{babel}
+\usepackage[tt={monowidth,lining,tabular},sf={lining,proportional},rm={lining,proportional}]{cfr-lm}
+\usepackage{fillwith}
+\usepackage{parskip}
+\usepackage{verbatim}
+\usepackage{graphicx}
+\usepackage{xurl}
+% sicrhau hyperindex=false: llwytho CYN bookmark
+\usepackage{hypdoc}% ateb Ulrike Fischer: https://tex.stackexchange.com/a/695555/
+\usepackage{bookmark}
+\usepackage{cleveref}
+\EnableCrossrefs
+\CodelineIndex
+\RecordChanges
+%^^A \OnlyDescription
+%^^A \ExplSyntaxOn
+%^^A \makeatletter
+\DoNotIndex{\verb,\ProvidesPackageSVN,\NeedsTeXFormat,\ProcessKeyOptions,\ExplSyntaxOn,\ExplSyntaxOff,\RequirePackage,\NeedsTeXFormat,\DefineFileInfoSVN,\GetInfoSVN,\@ifundefined,\@ifl@t@r\ExplLoaderFileDate,\endinput,\PackageError,\PackageWarning,\PackageInfo,\keys_define:nn,\keys_set:nn,\ProcessKeysOptionns,\author,\title,\maketitle,\date,\revinfo,\ProcessKeysOptions,\MessageBreak,\fmtversion,\documentclass,\ExplLoaderFileDate,\filebase,\fileversion,\fileinfo,\filebase:,\filedate,\documentclass,\@ifl@t@r,\begin,\end,\item,\IfFormatAtLeastTF}
+%^^A \makeatother
+%^^A \ExplSyntaxOff
+\definecolor{strawberry}{rgb}{1.000,0.000,0.502}
+\definecolor{blueberry}{rgb}{0.000,0.000,1.000}
+\definecolor{moss}{rgb}{0.000,0.502,0.251}
+\hypersetup{%
+ colorlinks=true,
+ citecolor={moss},
+ extension=pdf,
+ linkcolor={strawberry},
+ linktocpage=true,
+ pdfcreator={TeX},
+ pdfproducer={pdfeTeX},
+ urlcolor={blueberry}%
+}
+\NewDocElement[%
+ idxtype=opt.,
+ idxgroup=options,
+ printtype=\textit{opt.},
+]{Opt}{option}
+\NewDocumentCommand \val { m }
+{%
+ {\ttfamily =\,\meta{#1}}%
+}
+\ExplSyntaxOn
+\NewDocumentCommand \vals { m }
+{
+ {
+ \ttfamily = \,
+ \clist_use:nn { #1 } { \textbar }
+ }
+}
+\ExplSyntaxOff
+\setcounter{IndexColumns}{2}
+\makeatletter
+\def\@xobeysp{\leavevmode\penalty100\ }
+\makeatother
+\begin{document}
+ \DocInput{\filename}
+\end{document}
+%</driver>
+% \fi
+% \title{\filebase{} \filerev}
+% \author{Clea F. Rees}
+% \date{\filedate}
+% \maketitle
+% \begin{abstract}
+% A small package originally based on \href{https://tex.stackexchange.com/a/241139/}{Harish Kumar's answer} to a question I asked on \TeX{} SE\footnote{%
+% See \href{https://tex.stackexchange.com/a/241139/}{tex.stackexchange.com/a/241139/}.%
+% }.
+% The intended purpose was the creation of worksheets for students where I would like \LaTeX{} to use the available vertical space to provide lined areas for answers.
+% Since then, the code has been (partially) rewritten in \pkg{expl3} and extended in response to both my own needs and others' questions on \TeX{} SE.
+% The package aims to do one thing: to fill a vertical space in the same way as, say, \verb|\vfill|, but with some kind of ‘filler’ rather than empty space.
+% Currently, the package supports solid rules or dotted lines.
+% The remainder of the current line may optionally be filled in the same way and the ‘filler’ may be coloured if desired.
+%
+% Lines may optionally be numbered, though the numbered versions should not be used to fill long stretches as they are extremely inefficient.
+% \textbf{Numbered fills are highly experimental and not recommended for use in ‘real’ documents.}
+% That is, it seems to work, but I recommend using an alternative package or solution if you need a reliable numbering mechanism.
+% \end{abstract}
+%
+% \section{Load}\label{sec:pkg}
+% To use the package simply load it in your preamble in the usual way.
+%
+% \iffalse
+%<*verb>
+% \fi
+\begin{verbatim}
+ \usepackage[<options>]{fillwith}
+\end{verbatim}
+% \iffalse
+%</verb>
+% \fi
+%
+% A small number of options may be specified when loading the package.
+% See \cref{sec:config}.
+%
+% We start with an example in \cref{sec:ee}.
+% \Cref{sec:use} describes the basic commands illustrated in this example.
+% \Cref{sec:config} explains the options used by these commands, together with other customisation features of \pkg{fillwith}.
+%
+% \section{Example}\label{sec:ee}
+%
+% The code below illustrates most package features.
+%
+% \Cref{fig:ee1} demonstrates filling with rules.
+% Note the effect of altering \texttt{fillwith ht} on line-spacing.
+% \begin{figure}
+% \centering
+% \fbox{\includegraphics{fillwith-example.pdf}}
+% \caption{Filling with rules.}\label{fig:ee1}
+% \end{figure}
+%
+% \Cref{fig:ee2} shows dotted fillings.
+% Note the use of \cmd{\fillwithset} to alter the colour.
+% \begin{figure}
+% \centering
+% \fbox{\includegraphics[page=2]{fillwith-example.pdf}}
+% \caption{Filling with dotted lines.}\label{fig:ee2}
+% \end{figure}
+%
+% \Cref{fig:ee3} shows numbered fillings.
+% Note the use of \texttt{goal ht} to divide the available vertical space more-or-less equally.
+% \begin{figure}
+% \centering
+% \fbox{\includegraphics[page=3]{fillwith-example.pdf}}
+% \caption{Filling with numbered lines.}\label{fig:ee3}
+% \end{figure}
+%
+% \verbatiminput{fillwith-example.tex}
+%
+% \section{Usage}\label{sec:use}
+%
+% \DescribeMacro{\fillwith}\oarg{options}
+% \DescribeMacro{\fillwith*}
+%
+% Fill vertically with current settings, optionally modified by \meta{options}.
+% See \cref{sec:config} for \meta{options}.
+% If used in the middle of a line, the starred form fills to the end of the line first, whereas the unstarred form does not.
+%
+% \DescribeMacro{\fillwithrules}\oarg{line-spacing}
+% \DescribeMacro{\fillwithrules*}
+%
+% Convenience wrappers which just set \texttt{style = rules} and set the line-spacing to \meta{line-spacing}.
+% These macros do nothing which cannot be done using \cmd{\fillwith} and \cmd{\fillwith*}.
+%
+% \DescribeMacro{\fillwithdottedlines}\oarg{line-spacing}
+% \DescribeMacro{\fillwithdottedlines*}
+%
+% Convenience wrappers which just set \texttt{style = dots} and set the line-spacing to \meta{line-spacing}.
+% These macros do nothing which cannot be done using \cmd{\fillwith} and \cmd{\fillwith*}.
+%
+% \DescribeMacro{\fillwithnolines}\oarg{options}
+% \DescribeMacro{\fillwithnolines*}
+%
+% Fill vertically with current settings, numbering each complete line, after optionally setting \meta{options}.
+% Numbering \textbf{requires} use of these commands, as opposed to the generic \cmd{\fillwith}/\cmd{\fillwith*}.
+%
+% \section{Customisation}\label{sec:config}
+%
+% Options can be set per use, locally or globally.
+% A small number of options are implemented as package options (\cref{sec:pkg}).
+%
+% \DescribeMacro{\fillwithset}\marg{options}
+% Set local or global defaults.
+%
+% \DescribeOpt{colour}\val{colour name}
+% \DescribeOpt{color}
+% \DescribeOpt{lliw}
+%
+% Colour to be used for (solid) rules.
+%
+% Initially \texttt{gray}.
+% Available as a package option.
+%
+% \DescribeOpt{dotted color}\val{colour name}
+% \DescribeOpt{dotted colour}
+%
+% Colour to be used for dotted lines.
+%
+% Initially \texttt{black}.
+% Available as a package option.
+%
+% \DescribeOpt{cont}\vals{true,false}
+%
+% Whether to fill the remainder of any current line.
+% Generally, users will probably prefer to use the starred command forms for local usage, but this option permits modification of the package default on a local or global basis.
+%
+% Initially \texttt{false}.
+% Default is \texttt{true}.
+%
+% \DescribeOpt{fillwith~ht}\val{real positive number expressed as decimal}
+%
+% Multiplication factor for line-spacing.
+% Typically, hand-written content requires greater spacing than typewritten content.
+% This option scales the standard line-spacing.
+%
+% Initially \texttt{2}, which is also the default value.
+% Decimal values such as \texttt{1.5} are permitted.
+%
+% \DescribeOpt{goal ~ ht}\val{dimension}
+%
+% Used only by \cmd{\fillwithnolines} and \cmd{\fillwithnolines*}.
+% Sets the target dimension to fill with numbered lines.
+% If unspecified, the code tries to fill the remaining vertical space on the current page.
+% If more than one use of a \pkg{fillwith} macro is used on a single page, this option \textbf{must} be used for numbered fills to prevent a single instance taking (almost) all available space.
+% In contrast, multiple unnumbered fills can coexist on the same page without issue --- the available space will simply be divided equally between them.
+%
+% Initially unset.
+% No default.
+%
+% \DescribeOpt{no ~ font}\val{font switches}
+%
+% Font switches to apply when typesetting numbers for numbered fills.
+%
+% Initially \cmd{\normalfont}\cmd{\normalsize}, which is also the default value.
+% Note the commands used here should be switches rather than text commands -- for example, use \cmd{\bfseries} rather than \cmd{\textbf} --- since the commands should not expect an argument.
+%
+% \DescribeOpt{style}\vals{rule,dots,line,lines,rules}
+%
+% Style of fill.
+% \texttt{rule}, \texttt{line}, \texttt{rules} and \texttt{lines} are synonyms which all denote solid rules or lines.
+% \texttt{dots} uses dotted lines rather than solid rules.
+% The dots are slightly more densely packed than the standard used for dotted fills by the standard classes, as these seem a bit too widely spaced to provide ideal guidelines.
+%
+% Initially \texttt{dots}, which is also the default value.
+%
+% If an unknown value is used, the code will attempt to use two macros derived from that value.
+% The first is constructed simply by preceding \meta{value} with a backslash and the second by also appending \texttt{part}.
+% For example, if \texttt{style}\val{mystyle} is used, the code will try to use \cs{mystyle} and \cs{mystylepart} for complete and partial lines.
+% In theory, this supports filling with somewhat arbitrary content, but the implementation is untested and \textbf{should not be used in real documents}.
+%
+%
+% \changes{v0.0}{???}{First public release.}
+% \changes{\fileversion}{\filedate}{}
+%
+%
+% \MaybeStop{%
+% \PrintChanges
+% \PrintIndex
+% }
+%
+% \section{Implementation}
+%
+% You do not need to read the remainder of this document in order to install or use the package.
+%
+% \iffalse
+%<@@=fillwith>
+%<*sty>
+% \fi
+% \begin{macrocode}
+\NeedsTeXFormat{LaTeX2e}[2021-11-15]
+\RequirePackage{svn-prov}
+\ProvidesPackageSVN[\filebase.sty]{$Id: fillwith.dtx 10202 2024-08-08 15:33:47Z cfrees $}[v0.0 \revinfo][\filebase: fill vertically with non-space]
+% this is needed only because l3doc overwrites \fileversion and \filedate
+% neither ltxdoc nor doc does this
+\DefineFileInfoSVN
+% \end{macrocode}
+% \iffalse
+% ^^A Paid â defnyddio \GetFileInfoSVN*/\GetFileInfoSVN{} yn y fan hon!!
+% \fi
+% \begin{macrocode}
+\RequirePackage{xcolor}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% copied verbatim, excepting format from Joseph Wright's' siunitx.sty under LPPL
+\@ifundefined{ExplLoaderFileDate}{%
+ \RequirePackage{expl3}%
+}{}
+% almost verbatim from siunitx.sty
+\@ifl@t@r\ExplLoaderFileDate{2022-02-24}{%
+}{%
+ \PackageError{fillwith}{Support package expl3 too old}
+ {%
+ You need to update your installation of the bundles 'l3kernel' and
+ 'l3packages'.\MessageBreak
+ Loading~fillwith~will~abort!%
+ }%
+ \endinput
+}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\ExplSyntaxOn
+\prop_gput:Nnn \g_msg_module_name_prop { fillwith } { fillwith }
+
+% BEGIN Expl pkg option setup
+
+\keys_define:nn { fillwith }
+{
+ color .meta:n = {
+ colour = #1,
+ },
+ colour .code:n = {
+ \colorlet{fillwithcolour}{#1}
+ },
+ dotted ~ color .meta:n = {
+ dotted colour = #1,
+ },
+ dotted color .meta:n = {
+ dotted colour = #1,
+ },
+ dotted ~ colour .meta:n = {
+ dotted colour = #1,
+ },
+ dotted colour .code:n = {
+ \colorlet{fillwithdottedcolour}{#1}
+ },
+ lliw .meta:n = {
+ colour = #1,
+ },
+ colour .initial:n = gray,
+ dotted colour .initial:n = black,
+}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% Joseph Wright: from siunitx.sty ; https://chat.stackexchange.com/transcript/message/64327823#64327823
+\providecommand \IfFormatAtLeastTF { \@ifl@t@r \fmtversion }
+\IfFormatAtLeastTF { 2022-06-01 }
+{
+ \ProcessKeyOptions [ fillwith ]
+}{
+ \RequirePackage { l3keys2e }
+ \ProcessKeysOptions { fillwith }
+}
+\IfFormatAtLeastTF { 2020-10-01 }{
+}{
+ \RequirePackage { xparse }
+ \providecommand \ExpandArgs [1]
+ { \cs_if_exist_use:c { exp_args:N #1 } }
+}
+% END Expl pkg option setup
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% BEGIN vars
+\box_new:N \l__fillwith_adj_rule_box
+\box_new:N \l__fillwith_part_rule_box
+\box_new:N \l__fillwith_tmpa_box
+\box_new:N \l__fillwith_tmpb_box
+% BEGIN coffins
+\coffin_new:N \l__fillwith_line_coffin
+\coffin_new:N \l__fillwith_lines_coffin
+\coffin_new:N \l__fillwith_part_coffin
+\coffin_new:N \l__fillwith_tmpa_coffin
+% END coffins
+% BEGIN dims
+\dim_new:N \l__fillwith_ht_dim
+\dim_new:N \l__fillwith_dp_dim
+\dim_new:N \l__fillwith_rem_dim
+\dim_new:N \l__fillwith_line_ht_dim
+\dim_new:N \l__fillwith_line_adj_hsize_dim
+\dim_set:Nn \l__fillwith_line_ht_dim { 0.4pt }
+\dim_new:N \l__fillwith_line_madj_dim
+\dim_new:N \l__fillwith_line_vadj_dim
+\dim_set_eq:NN \l__fillwith_line_vadj_dim \c_zero_dim
+\dim_new:N \l__fillwith_goal_dim
+\dim_new:N \l__fillwith_tmpa_dim
+% END dims
+\int_new:N \g__fillwith_cnt_int
+% END vars
+% BEGIN fns
+\cs_new_protected_nopar:Nn \__fillwith_style: {}
+\cs_new_protected_nopar:Nn \__fillwith_coffin_tht:N
+{
+ \dim_eval:n { \coffin_ht:N #1 + \coffin_dp:N #1 }
+}
+% BEGIN \__fillwith_hrulefill:
+\cs_new_protected_nopar:Npn \__fillwith_hrulefill_part:
+{
+ \vrule height \c_zero_dim depth \l__fillwith_line_ht_dim width 0.1pt
+}
+\cs_new_protected_nopar:Npn \__fillwith_hrulefill:
+{
+ \vrule height \c_zero_dim depth \l__fillwith_line_ht_dim width \l__fillwith_line_adj_hsize_dim
+}
+% END \__fillwith_hrulefill:
+% BEGIN \__fillwith_dottedfill:
+\cs_new_protected_nopar:Npn \__fillwith_dottedfill_part:
+{
+ \hbox to 0.33em {\hss .\hss}
+}
+\cs_new_protected_nopar:Npn \__fillwith_dottedfill:
+{
+ \leaders \hbox to 0.33em {\hss .\hss} \hfill \kern \c_zero_dim
+}
+% END \__fillwith_dottedfill:
+% END fns
+% \end{macrocode}
+% \begin{macro}{\fillwithset}
+% Wrapper command for configuration.
+% Most global or local customisation will use this as most keys are not valid package options.
+% \begin{macrocode}
+\NewDocumentCommand\fillwithset { +m }{
+ \keys_set:nn { fillwith } { #1 }
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+% BEGIN keys (+)
+\keys_define:nn { fillwith }
+{
+ cont .bool_set:N = \l__fillwith_cont_bool,
+ cont .default:n = true,
+ cont .initial:n = false,
+ fillwith~ht .tl_set:N = \l__fillwith_ht_tl,
+ fillwith~ht .initial:n = 2,
+ fillwith~ht .default:n = 2,
+ goal ~ ht .dim_set:N = \l__fillwith_goal_dim,
+ line nos .bool_set:N = \l__fillwith_nos_bool,
+ line ~ nos .bool_set:N = \l__fillwith_nos_bool,
+ line ~ nos .default:n = true,
+ line ~ nos .initial:n = false,
+ no ~ font .tl_set:N = \l__fillwith_no_font_tl,
+ no ~ font .initial:n = { \normalfont\normalsize },
+ no ~ font .default:n = { \normalfont\normalsize },
+ style .choices:nn =
+ {
+ rule, dots , line , lines , rules , unknown
+ }{
+ \if_case:w \l_keys_choice_int
+ \or: \cs_set_eq:NN \__fillwith_style: \__fillwith_hrulefill:
+ \or: \cs_set_eq:NN \__fillwith_style: \__fillwith_dottedfill:
+ \or: \cs_set_eq:NN \__fillwith_style: \__fillwith_hrulefill:
+ \or: \cs_set_eq:NN \__fillwith_style: \__fillwith_hrulefill:
+ \or: \cs_set_eq:NN \__fillwith_style: \__fillwith_hrulefill:
+ \else: \cs_set_protected_nopar:Nn \__fillwith_style: { \use:c { \l_keys_choice_tl } }
+ \fi:
+ \if_case:w \l_keys_choice_int
+ \or: \cs_set_eq:NN \__fillwith_style_part: \__fillwith_hrulefill_part:
+ \or: \cs_set_eq:NN \__fillwith_style_part: \__fillwith_dottedfill_part:
+ \or: \cs_set_eq:NN \__fillwith_style_part: \__fillwith_hrulefill_part:
+ \or: \cs_set_eq:NN \__fillwith_style_part: \__fillwith_hrulefill_part:
+ \or: \cs_set_eq:NN \__fillwith_style_part: \__fillwith_hrulefill_part:
+ \else: \cs_set_protected_nopar:Nn \__fillwith_style_part: { \use:c { \l_keys_choice_tl part } }
+ \fi:
+ },
+ style .default:n = dots,
+ style .initial:n = dots,
+}
+% END keys (+)
+%
+% BEGIN \__fillwith_fill:
+% ref: https://tex.stackexchange.com/a/241139/ Harish Kumar
+\cs_new_protected_nopar:Nn \__fillwith_fill:
+{
+ \__fillwith_measures:
+ \dim_set:Nn \l__fillwith_line_adj_hsize_dim { \hsize - \@totalleftmargin }
+ \vbox_set:Nn \l__fillwith_adj_rule_box
+ {
+ \parindent=0pt
+ \vrule height \l__fillwith_ht_dim depth \l__fillwith_dp_dim width \c_zero_dim
+ \skip_horizontal:n { \@totalleftmargin }
+ \__fillwith_style:
+ }
+ \if_mode_horizontal:
+ \bool_if:NT \l__fillwith_cont_bool
+ {
+ \leaders \box_use:N \l__fillwith_part_rule_box \hfill \kern \c_zero_dim
+ }{
+ \vrule height \l__fillwith_ht_dim depth \l__fillwith_dp_dim width \c_zero_dim
+ }
+ %^^A gweithio ond erbyn y rheolau
+ %^^A byddai'n achosi draferth, siwr o fod
+ % \tex_par:D
+ %^^A yn lle hynny, ceisio hyn - oes perygl hefyd?
+ \para_raw_end:
+ \else:
+ \unskip
+ \skip_vertical:n { \l__fillwith_dp_dim }
+ \fi:
+ \xleaders \box_use:N \l__fillwith_adj_rule_box \vfill
+ \para_end:
+ \normalcolor
+}
+% END \__fillwith_fill:
+% BEGIN \__fillwith_measures:
+\cs_new_protected_nopar:Nn \__fillwith_measures:
+{
+ \color{fillwithcolour}
+ \offinterlineskip
+ \hbox_set:Nn \l__fillwith_part_rule_box
+ {
+ \strut
+ \__fillwith_style_part:
+ \kern \c_zero_dim
+ }
+ \dim_set:Nn \l__fillwith_tmpa_dim { \box_ht:N \l__fillwith_part_rule_box }
+ \dim_set:Nn \l__fillwith_ht_dim { \l__fillwith_ht_tl \l__fillwith_tmpa_dim }
+ \box_set_ht:Nn \l__fillwith_part_rule_box { \l__fillwith_ht_dim }
+ \dim_set:Nn \l__fillwith_tmpa_dim { \box_dp:N \l__fillwith_part_rule_box }
+ % neu \fp_to_dim:n { \l__fillwith_ht_tl * \l__fillwith_tmpa_dim } ??
+ \dim_set:Nn \l__fillwith_dp_dim { \l__fillwith_ht_tl \l__fillwith_tmpa_dim }
+ \box_set_dp:Nn \l__fillwith_part_rule_box { \l__fillwith_dp_dim }
+}
+% END \__fillwith_measures:
+% BEGIN fillwith
+% \end{macrocode}
+% \begin{macro}{\fillwith}
+% The package is basically this macro.
+% \begin{macrocode}
+\NewDocumentCommand \fillwith { s o }
+{
+ \group_begin:
+ \IfValueT { #2 }
+ {
+ \keys_set:nn { fillwith } { #2 }
+ }
+ \IfBooleanTF { #1 }
+ {
+ \bool_set_true:N \l__fillwith_cont_bool
+ }{
+ \bool_set_false:N \l__fillwith_cont_bool
+ }
+ \__fillwith_fill:
+ \group_end:
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+% END fillwith
+% BEGIN fillwithrules
+% \end{macrocode}
+% \begin{macro}{\fillwithrules}
+% Simple convenience wrapper with simplified syntax for (solid) rules.
+% \begin{macrocode}
+\NewDocumentCommand \fillwithrules { s O { 2 } }
+{
+ \group_begin:
+ \IfBooleanTF { #1 }
+ {
+ \bool_set_true:N \l__fillwith_cont_bool
+ }{
+ \bool_set_false:N \l__fillwith_cont_bool
+ }
+ \keys_set:nn { fillwith } { style = rules, fillwith~ht=#2 }
+ \__fillwith_fill:
+ \group_end:
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+% END fillwithrules
+% BEGIN fillwithdottedlines
+% \end{macrocode}
+% \begin{macro}{\fillwithdottedlines}
+% Simple convenience wrapper with simplified syntax for dotted lines.
+% \begin{macrocode}
+\NewDocumentCommand \fillwithdottedlines { s O { 2 } }
+{
+ \group_begin:
+ \IfBooleanTF { #1 }
+ {
+ \bool_set_true:N \l__fillwith_cont_bool
+ }{
+ \bool_set_false:N \l__fillwith_cont_bool
+ }
+ \colorlet{fillwithcolour}{fillwithdottedcolour}
+ \keys_set:nn { fillwith } { style = dots, fillwith~ht=#2 }
+ \__fillwith_fill:
+ \group_end:
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+% END fillwithdottedlines
+% BEGIN fillwithnolines
+\cs_new_protected:Nn \__fillwith_nos: % rhybudd: ARAF ! SLOW!
+{
+ \parindent=0pt
+ \__fillwith_measures:
+ \dim_set_eq:NN \l__fillwith_line_adj_hsize_dim \linewidth
+ \vcoffin_set:Nnn \l__fillwith_line_coffin { \l__fillwith_line_adj_hsize_dim }
+ {
+ \parindent=0pt
+ \vrule height \l__fillwith_ht_dim depth \l__fillwith_dp_dim width \c_zero_dim
+ \skip_horizontal:n \c_zero_skip
+ \__fillwith_style:
+ }
+ \coffin_set_eq:NN \l__fillwith_lines_coffin \l__fillwith_line_coffin
+ \if_mode_horizontal:
+ \bool_if:NTF \l__fillwith_cont_bool
+ {
+ \leaders \box_use:N \l__fillwith_part_rule_box \hfill \kern \c_zero_dim
+ \int_gincr:N \g__fillwith_cnt_int
+ % \vcoffin_set:Nnn \l__fillwith_tmpa_coffin { 1.5em}
+ % {
+ % \l__fillwith_no_font_tl \int_to_arabic:n { \g__fillwith_cnt_int }
+ % }
+ % \coffin_mark_handle:Nnnn \l__fillwith_tmpa_coffin {B} {l} { red }
+ % \coffin_mark_handle:Nnnn \l__fillwith_tmpa_coffin {b} {l} { green }
+ % \coffin_attach:NnnNnnnn \l__fillwith_lines_coffin {B} {r} \l__fillwith_tmpa_coffin {B} {l} {2.5pt} { \l__fillwith_ht_dim + \l__fillwith_dp_dim }
+ % \coffin_mark_handle:Nnnn \l__fillwith_lines_coffin {T} {r} { blue }
+ % \coffin_mark_handle:Nnnn \l__fillwith_lines_coffin {t} {r} { magenta }
+ \dim_set:Nn \l__fillwith_line_vadj_dim { \l__fillwith_dp_dim }
+ }{
+ \vrule height \l__fillwith_ht_dim depth \l__fillwith_dp_dim width \c_zero_dim
+ }
+ \dim_set:Nn \l__fillwith_line_madj_dim { \@totalleftmargin }
+ \para_raw_end:
+ \else:
+ \dim_set_eq:NN \l__fillwith_line_madj_dim \c_zero_dim
+ \unskip
+ \skip_vertical:n { \l__fillwith_dp_dim }
+ \fi:
+ \int_gincr:N \g__fillwith_cnt_int
+ \vcoffin_set:Nnn \l__fillwith_tmpa_coffin { 1.5em}
+ {
+ \l__fillwith_no_font_tl \int_to_arabic:n { \g__fillwith_cnt_int }
+ }
+ \coffin_attach:NnnNnnnn \l__fillwith_lines_coffin {B} {r} \l__fillwith_tmpa_coffin {B} {l} {2.5pt} {\c_zero_dim}
+ \dim_set:Nn \l__fillwith_rem_dim
+ {
+ \l__fillwith_goal_dim -\footskip - \pagetotal
+ }
+ \dim_until_do:nNnn { \__fillwith_coffin_tht:N \l__fillwith_lines_coffin } > { \l__fillwith_rem_dim - \l__fillwith_ht_dim - \l__fillwith_dp_dim }
+ {
+ \coffin_join:NnnNnnnn \l__fillwith_lines_coffin { b } { l } \l__fillwith_line_coffin { t } { l } { \c_zero_dim } { \c_zero_dim }
+ \int_gincr:N \g__fillwith_cnt_int
+ \vcoffin_set:Nnn \l__fillwith_tmpa_coffin {1.5em}
+ {
+ \l__fillwith_no_font_tl \int_to_arabic:n { \g__fillwith_cnt_int }
+ }
+ \coffin_attach:NnnNnnnn \l__fillwith_lines_coffin {B} {r} \l__fillwith_tmpa_coffin {B} {l} {2.5pt} {\c_zero_dim}
+ }
+ \coffin_typeset:Nnnnn \l__fillwith_lines_coffin { B } { l } { \l__fillwith_line_madj_dim } { \l__fillwith_line_vadj_dim }
+ \para_end:
+ \normalcolor
+}
+% \end{macrocode}
+% \begin{macro}{\fillwithnolines}
+% Provisional experimental macro for numbered fill.
+% \begin{macrocode}
+\NewDocumentCommand \fillwithnolines { s O { } }
+{
+ \group_begin:
+ \IfBooleanTF { #1 }
+ {
+ \bool_set_true:N \l__fillwith_cont_bool
+ }{
+ \bool_set_false:N \l__fillwith_cont_bool
+ }
+ \keys_set:nn { fillwith } { goal ~ ht = \pagegoal, #2 }
+ \__fillwith_nos:
+ \group_end:
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+% END fillwithnolines
+\ExplSyntaxOff
+% \end{macrocode}
+% \iffalse
+%</sty>
+% \fi
+%
+% \subsection{Demonstration}
+%
+% Simple example to demonstrate usage.
+%
+% \iffalse
+%<*ee>
+% \fi
+% \begin{macrocode}
+\listfiles
+\documentclass[british,a6paper]{article}
+\usepackage{babel}
+\usepackage[scale=.85,marginparwidth=0pt,marginparsep=0pt]{geometry}
+\usepackage{fillwith}
+\usepackage{cfr-lm}
+\begin{document}
+\author{A. N. Author}
+\title{\texttt{fillwith} Demo}
+\maketitle
+\begin{enumerate}
+ \item What is the answer to the question?
+ \fillwithrules
+ \item How did you answer the previous question?
+ \fillwith*[style=line]
+ \item Why answer?
+
+ \fillwith*[style=rule,fillwith ht=1.25,colour=blue!40!cyan]
+ \clearpage
+ \item Evaluate your responses so far.
+ \fillwithdottedlines
+ \item Evaluate your responses so far.
+
+ {%
+ \fillwithset{dotted colour=magenta}%
+ \fillwithdottedlines[1.5]
+ }
+ \item Criticise your evaluation.
+ \fillwithdottedlines*
+ \clearpage
+ \item Assess your answers.
+ \fillwithnolines[goal ht = .33\textheight]
+ \item Assess your answers.
+
+ \fillwithnolines[style=rules,no font=\bfseries\tiny,colour=green!50!gray,goal ht = .67\textheight]
+ \item Summarise your analysis.
+ \fillwithnolines*
+\end{enumerate}
+
+\end{document}
+% \end{macrocode}
+% \iffalse
+%</ee>
+% \fi
+% \subsection{Other}
+% \iffalse
+%<*other>
+% \fi
+% \begin{macrocode}
+% \end{macrocode}
+% \iffalse
+%</other>
+% \fi
+%\Finale
diff --git a/Master/texmf-dist/source/latex/fillwith/fillwith.ins b/Master/texmf-dist/source/latex/fillwith/fillwith.ins
new file mode 100644
index 00000000000..2f7f4c576cd
--- /dev/null
+++ b/Master/texmf-dist/source/latex/fillwith/fillwith.ins
@@ -0,0 +1,68 @@
+%% $Id: fillwith.ins 10202 2024-08-08 15:33:47Z cfrees $
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% fillwith.ins
+%% Additions and changes Copyright (C) 2024 Clea F. Rees.
+%% Code from skeleton.ins Copyright (C) 2015-2024 Scott Pakin (see below).
+%%
+%% This work 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-05-04 or later.
+%%
+%% This work has the LPPL maintenance status `maintained'.
+%%
+%% The Current Maintainer of this work is Clea F. Rees.
+%%
+%% This work consists of all files listed in manifest.txt.
+%%
+%% The file fillwith.ins is a derived work under the terms of the
+%% LPPL. It is based on version 2.4 of skeleton.ins which is part of
+%% dtxtut by Scott Pakin. A copy of dtxtut, including the
+%% unmodified version of skeleton.ins is available from
+%% https://www.ctan.org/pkg/dtxtut and released under the LPPL.
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\input docstrip.tex
+\keepsilent
+
+%% ???
+\usedir{tex/latex/fillwith}
+
+\declarepreamble\safonol
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+Copyright (C) 2024 Clea F. Rees.
+
+This work 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-05-04 or later.
+
+This work has the LPPL maintenance status `maintained'.
+
+The Current Maintainer of this work is Clea F. Rees.
+
+This file may only be distributed together with a copy of the package
+fillwith. You may however distribute the package fillwith without
+such generated files.
+
+This work consists of all files listed in manifest.txt.
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\endpreamble
+
+% \askonceonly
+\askforoverwritefalse
+
+\usepreamble\safonol
+
+\generate{\file{fillwith.sty}{\from{fillwith.dtx}{sty}}
+ \file{fillwith-example.tex}{\from{fillwith.dtx}{ee}}
+}
+
+
+\endbatchfile
diff --git a/Master/texmf-dist/source/latex/firstaid/latex2e-first-aid-for-external-files.dtx b/Master/texmf-dist/source/latex/firstaid/latex2e-first-aid-for-external-files.dtx
index 152737eaf77..5615d3f6976 100644
--- a/Master/texmf-dist/source/latex/firstaid/latex2e-first-aid-for-external-files.dtx
+++ b/Master/texmf-dist/source/latex/firstaid/latex2e-first-aid-for-external-files.dtx
@@ -111,8 +111,8 @@
% \end{macrocode}
%
% \begin{macrocode}
-\def\LaTeXFirstAidDate{2024/03/20}
-\def\LaTeXFirstAidVersion{v1.1e}
+\def\LaTeXFirstAidDate{2024/06/25}
+\def\LaTeXFirstAidVersion{v1.1f}
% \end{macrocode}
%
% \begin{macrocode}
@@ -721,6 +721,29 @@
}
% \end{macrocode}
%
+% \subsection{The \pkg{arydshln} package first aid}
+%
+% Making two internal commands robust to avoid expansion while constructing the array preamble.
+% \begin{macrocode}
+\AddToHook{package/arydshln/after}[firstaid]{%
+ \FirstAidNeededT{arydshln}{sty}{2019/02/21 v1.76 }
+ {%
+% add \protected
+\protected\def\adl@@vlineL#1#2#3#4{\adl@ivline#4\@nil{#1}{#2}%
+ \xdef\adl@colsL{\adl@colsL
+ \@elt{#3}{\number\@tempcnta}{\number\@tempcntb}%
+ {\adl@dashcolor}{\adl@gapcolor}}}%
+\protected\def\adl@@vlineR#1#2#3#4{\adl@ivline#4\@nil{#1}{#2}%
+ \xdef\adl@colsR{%
+ \@elt{#3}{\number\@tempcnta}{\number\@tempcntb}%
+ {\adl@dashcolor}{\adl@gapcolor}%
+ \adl@colsR}}%
+\let\adl@act@@vlineL\adl@@vlineL
+\let\adl@act@@vlineR\adl@@vlineR
+ }%
+}
+% \end{macrocode}
+%
% \begin{macrocode}
%</kernel>
% \end{macrocode}
diff --git a/Master/texmf-dist/source/latex/gridset/gridset.dtx b/Master/texmf-dist/source/latex/gridset/gridset.dtx
index 68b251db558..29818473fb5 100644
--- a/Master/texmf-dist/source/latex/gridset/gridset.dtx
+++ b/Master/texmf-dist/source/latex/gridset/gridset.dtx
@@ -2,7 +2,7 @@
%
% gridset.dtx
%
-%% Copyright (C) 2008-2020 Markus Kohm
+%% Copyright (C) 2008-2024 Markus Kohm
%%
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either version 1.3c
@@ -25,37 +25,17 @@
%%
%
%<*dtx>
-\def\FmtName{LaTeX2e}
-\ifx\FmtName\fmtname
- % Give me the package or the documentation
- \ifnum \catcode`\@=12\relax
- % Give me the documentation
- \ProvidesFile{gridset.dtx}
+\ifx\ProvidesFile\undfined\def\ProvidesFile#1[#2]{}\fi
+\ProvidesFile{gridset.dtx}
%</dtx>
%<*dtx|package|example>
%<package>\ProvidesPackage{gridset}
%<example>\ProvidesFile{gridsetexample.tex}
- [2020-02-12 v0.3 grid - a.k.a. in-register - setting]
+ [2024-08-17 v0.4 grid - a.k.a. in-register - setting]
%</dtx|package|example>
%<*dtx>
- \documentclass{ltxdoc}
- \begin{document}
- \RecordChanges
- \GetFileInfo{gridset.dtx}
- \DocInput{gridset.dtx}
-%</dtx>
-%<*dtx>
- \expandafter\expandafter\expandafter\enddocument
- \fi
-\else
- % Make the package
- \def\batchfile{gridset.dtx}
- \let\batchendinput\endinput
-%</dtx>
-%<*ins>
-%<ins>\def\batchfile{gridset.ins}
+\ifx\documentclass\undefined
\input docstrip.tex
-
\keepsilent
\askforoverwritefalse
\usedir{tex/latex/gridset}
@@ -98,12 +78,16 @@ about the files the work consists of.
\Msg{*}
\Msg{*********************************************************************}
}
-
-%</ins>
-%<*dtx>
+\else
+ \let\endbatchfile\relax
\fi
-\csname fi\endcsname
-\csname batchendinput\endcsname
+\endbatchfile
+\documentclass{ltxdoc}
+\begin{document}
+\RecordChanges
+\GetFileInfo{gridset.dtx}
+\DocInput{gridset.dtx}
+\end{document}
%</dtx>
% \fi ^^A meta-comment
%
@@ -313,6 +297,12 @@ about the files the work consists of.
% \item the x-coordinate of the absolute position,
% \item the y-coordinate of the absolute position.
% \end{itemize}
+% \begin{description}
+% \item[Todo:] Currently we use our own command \cs{newpos} to store the
+% position information in the \texttt{aux}-file. But with the extended
+% reference mechanism of \LaTeX{} since 2023-11-01 this should be replaced
+% by the new properties.
+% \end{description}
% \begin{macrocode}
\newcommand*{\SavePos}[1]{%
\begingroup
@@ -411,8 +401,17 @@ about the files the work consists of.
that won't be reported!}%
\fi
}
+% \end{macrocode}
+% \changes{0.4}{2024/08/17}{fix deactivation of
+% \cs{grid@unique@test}
+% (\href{https://github.com/komascript/gridset/issues/1}{Issue \#1})}
+% The test should be done only, when reading the \texttt{aux} file at
+% |\begin{document}|, but not later (e.g. at |\end{document}|). So we
+% deactivate the test after reading the \texttt{aux} file in
+% |\begin{document}|.
+% \begin{macrocode}
\AtBeginDocument{%
- \global\let\grid@unique@test\@gobble
+ \global\let\grid@unique@test\@gobbletwo
}
% \end{macrocode}
% \end{macro}
diff --git a/Master/texmf-dist/source/latex/gridset/gridset.ins b/Master/texmf-dist/source/latex/gridset/gridset.ins
new file mode 100644
index 00000000000..de5fbe835e7
--- /dev/null
+++ b/Master/texmf-dist/source/latex/gridset/gridset.ins
@@ -0,0 +1,38 @@
+%%
+%% This is file `gridset.ins',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% gridset.dtx (with options: `ins')
+%%
+%% IMPORTANT NOTE:
+%%
+%% This is a generated file and you are not allowed to distribute it
+%% without the source ot the work. See below about more informations
+%% about the files the work consists of.
+%%
+%% Copyright (C) 2008-2024 Markus Kohm
+%%
+%% This work 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
+%% http://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 work has the LPPL maintenance status "maintained".
+%%
+%% The author and current maintainer of this work is
+%% Markus Kohm <komascript@gmx.info>.
+%%
+%% This work consists of the files gridset.dtx and README.md.
+%%
+%% Important Recommendation:
+%% The LPPL requires that distributions of the Work contain all the files of
+%% the Work (see ``Important Recommendations'' at lppl.txt).
+%%
+\endinput
+%%
+%% End of file `gridset.ins'.
diff --git a/Master/texmf-dist/source/latex/heria/heria.dtx b/Master/texmf-dist/source/latex/heria/heria.dtx
index 5c6b5e96916..7da06a879df 100644
--- a/Master/texmf-dist/source/latex/heria/heria.dtx
+++ b/Master/texmf-dist/source/latex/heria/heria.dtx
@@ -1,10 +1,10 @@
% \iffalse meta-comment
%
-% Copyright 2023 Tristan Miller
-% -----------------------------
+% Copyright 2023, 2024 Tristan Miller
+% -----------------------------------
%
% This work may be distributed and/or modified under the
-% conditions of the LaTeX Project Public License, either version 1.3
+% 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
@@ -18,11 +18,11 @@
\ProvidesFile{heria.dtx}
%</driver>
%<*class>
-%% Copyright 2023 Tristan Miller
+%% Copyright 2023, 2024 Tristan Miller
%% Copyright 2016 John Kormylo
%%
%% This work may be distributed and/or modified under the
-%% conditions of the LaTeX Project Public License, either version 1.3
+%% 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
@@ -33,7 +33,7 @@
%<class>\NeedsTeXFormat{LaTeX2e}
%<class>\ProvidesClass{heria}
%<*class>
-[2023-12-04 v3.2.1.0 Class for Horizon Europe (R)IA proposals]
+[2024-08-14 v3.4.1.1 Class for Horizon Europe (R)IA proposals]
%</class>
%
%<*driver>
@@ -50,7 +50,7 @@
%</driver>
% \fi
%
-% \CheckSum{1506}
+% \CheckSum{1520}
%
% \CharacterTable
% {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
@@ -80,8 +80,9 @@
% for an explanation of the versioning scheme.}}
%
% \author{Tristan Miller\\
-% Austrian Research Institute for Artificial Intelligence\\
-% \texttt{tristan.miller@ofai.at}}
+% Department of Computer Science\\
+% University of Manitoba\\
+% \texttt{Tristan.Miller@umanitoba.ca}}
%
% \maketitle
% \tableofcontents
@@ -104,14 +105,26 @@
% the user. The advantage of this becomes clear when one considers
% that much of the data is reused across multiple tables.
%
-% At the time of writing (2023-12-04), open calls to the RIA and IA
-% calls require proposals to be submitted according to either
-% Version~3.2 (2022-11-15) or Version~3.3 (2023-09-27) of the Part~B
-% template. The \textsf{heria} package was developed with reference
-% to the Version~3.2 template; however, according to the changelog for
-% the Version~3.3 template, the only difference from the previous
-% version is the addition of some instructions concerning the use of
-% generative AI tools for the preparation of the proposal.
+% The \textsf{heria} package can be used to write proposals using
+% either Version~3.2 (2022-11-15), 3.3 (2023-09-27), or 3.4
+% (2024-04-04) of the official Part~B template.
+%
+% \bigskip
+%
+% \noindent Besides this technical manual, there is a journal article
+% that describes the motivation for and development of \textsf{heria}:
+%
+% \begin{quote}
+% Tristan
+% Miller. \href{https://dx.doi.org/10.47397/tb/45-1/tb139miller-horizon}{Preparing
+% Horizon Europe proposals in \LaTeX\ with
+% \textsf{heria}}. \emph{TUGboat: The Communications of the \TeX\
+% Users Group}, 45(1):\allowbreak 59–64, 2024. ISSN 0896-3207. DOI:
+% \href{https://dx.doi.org/10.47397/tb/45-1/tb139miller-horizon}{10.47397/tb/45-1/tb139miller-horizon}.
+% \end{quote}
+%
+% \noindent Please cite this journal article if you want to refer to
+% \textsf{heria} in a publication.
%
% \section{Usage}
%
@@ -140,8 +153,20 @@
%
% \medskip
%
-% \noindent Following \cs{documentclass} you should provide the
-% proposal metadata using the following macros:
+% \noindent Following \cs{documentclass} you should tell
+% \textsf{heria} which version of the official Part~B template you
+% want to use:
+%
+% \DescribeMacro{\templateversion} This macro sets the version of the
+% official Part~B template the proposal should use. It takes a single
+% argument; valid values are \verb|3.2|, \verb|3.3|, and \verb|3.4|.
+% If you omit this macro, \textsf{heria} will default to using the
+% latest version of the template.
+%
+% \medskip
+%
+% \noindent You should then provide the proposal metadata using the
+% following macros:
%
% \DescribeMacro{\title} This macro takes the title of the proposal as
% its sole argument. This title will be printed by the \cs{maketitle}
@@ -446,18 +471,6 @@
%
% \section{Limitations and caveats}
%
-% \paragraph{No backward compatibility.} This version of the
-% \textsf{heria} class implements a specific version of the official
-% Horizon Europe template as described in §\ref{sec:introduction}. It
-% is intended that \textsf{heria}, over the course of its development,
-% will track changes made to the official template. Since these
-% changes may be incompatible with previous versions, you are advised
-% to retain a copy of the version of \textsf{heria} you used to
-% produce a proposal; this way you will still be able to build the
-% proposal even if you later install a new version of \textsf{heria}.
-% See §\ref{sec:version} for further information on \textsf{heria}'s
-% versioning scheme and when to expect breaking changes.
-%
% \paragraph{Table 3.1h.} The instructions in the official template
% are ambiguous about the construction of the tables for purchase
% costs. In particular, it's not clear whether each individual cost
@@ -497,21 +510,28 @@
%
% Each release of the \textsf{heria} class carries a version number in
% the format \textit{omaj.\allowbreak omin.\allowbreak maj.\allowbreak
-% min}. Here \textit{omaj.omin} is the version number of the official
-% Horizon Europe RIA template that the class implements, and
+% min}. Here \textit{omaj.omin} is the highest version number of the
+% official Horizon Europe RIA template that the class implements, and
% \textit{maj} and \textit{min} represent, respectively, major and
% minor revisions to the class (including any ancillary files, such as
% the skeleton proposal and documentation). A major revision is one
-% that includes breaking changes or significant new features; minor
-% revisions are for all other changes. You should generally assume
-% that any change to \textit{omaj.omin} introduces breaking changes to
-% the class interface and\slash or significant changes to the official
-% proposal preparation instructions.
+% that includes potentially breaking changes or significant new
+% features; minor revisions are for all other changes. While efforts
+% will be made to preserve compatibility with earlier versions of the
+% official template (via the \cs{templateversion} macro), any change
+% to \textit{omaj.omin} could unavoidably introduce breaking changes
+% to the class interface. Any such changes will be noted in the
+% package documentation.
%
% \subsection{Version history}
%
% \begin{description}
-% \item[v3.2.1.0 (2023-12-04)] Initial release.
+% \item[v3.4.1.1 (2024-08-14)] Update documentation with a reference
+% to the \emph{TUGboat} paper on \textsf{heria}.
+% \item[v3.4.1.0 (2024-07-14)] Add support for version 3.4 of the
+% official Part~B template and the \cs{templateversion} macro for
+% backward compatibility with earlier versions.
+% \item[v3.2.1.0 (2023-12-04)] Initial release.
% \end{description}
%
% \section{Disclaimer}
@@ -599,6 +619,22 @@
\definecolor{summaryblue}{HTML}{00B0F0}
% \end{macrocode}
%
+% \subsection*{Set official Horizon Europe template version}
+%
+% \begin{macrocode}
+\gdef\@templateversion{3.4} % Default version
+\def\@supportedtemplateversions{3.2,3.3,3.4} % Supported versions
+\ExplSyntaxOn
+\NewDocumentCommand{\templateversion}{m}{%
+ \clist_if_in:NnTF {\@supportedtemplateversions} {#1}
+ {\gdef\@templateversion{#1}}
+ {\PackageError{heria}%
+ {unsupported~template~version}%
+ {Use~one~of~\@supportedtemplateversions}
+ }%
+}
+\ExplSyntaxOff
+% \end{macrocode}
% \subsection*{Basic proposal variables}
%
% \begin{macrocode}
@@ -1459,7 +1495,6 @@
% communication with Tristan Miller on 2023-12-02.
%
% \begin{macrocode}
-\RequirePackage{everypage}
\RequirePackage{environ}
\newcounter{abspage}% \thepage not reliab
\newcommand{\newSFPage}[1]% #1 = \theabspage
@@ -1474,15 +1509,17 @@
\rotatebox{90}{\parbox[c][\textwidth][c]{\textheight}{\BODY}}%
\fi
\end{figure}}
-\AddEverypageHook{% check if sideways figure on this page
- \ifdim\textwidth=\textheight
- \stepcounter{abspage}% already in landscape
- \else
- \@ifundefined{SFPage@\theabspage}{}{\global\pdfpageattr{/Rotate 0}}%
- \stepcounter{abspage}%
- \@ifundefined{SFPage@\theabspage}{}%
- {\global\pdfpageattr{/Rotate 90}}%
- \fi}
+\AddToHook{shipout/background}{% check if sideways figure on this page
+ \put(1in,-1in){%
+ \ifdim\textwidth=\textheight
+ \stepcounter{abspage}% already in landscape
+ \else
+ \@ifundefined{SFPage@\theabspage}{}{\global\pdfpageattr{/Rotate 0}}%
+ \stepcounter{abspage}%
+ \@ifundefined{SFPage@\theabspage}{}%
+ {\global\pdfpageattr{/Rotate 90}}%
+ \fi}%
+ }
% \end{macrocode}
%
% \subsection*{Font setup}
@@ -1987,7 +2024,7 @@ purchase costs for equipment).
environmental objectives of the EU Taxonomy Regulation.}
\item
\emph{If you plan to use, develop and/or deploy artificial
- intellingence (AI) based systems and/or techniques you must
+ intelligence (AI) based systems and/or techniques you must
demonstrate their technical robustness. AI-based systems or techniques
should be, or be developed to become:~}
@@ -2371,12 +2408,33 @@ Please provide the following:
\item
\emph{Give full details. Base your account on the logical structure of
the project and the stages in which it is to be carried out.}
+\makeatletter
+\ifdim\@templateversion pt<3.4pt
\emph{The number of work packages should be proportionate to the scale
and complexity of the project.}
\item
\emph{You should give enough detail in each work package to justify
the proposed resources to be allocated and also quantified information
so that progress can be monitored, including by the Commission}
+\else
+ \emph{Each work package should be a substantial part of the work
+ plan, and the number of work packages should be proportionate to
+ the scale and complexity of the project.}
+\item \emph{Structure each work package by breaking it down into
+ tasks. If tasks are not appropriate, work packages can be
+ organised according to other criteria (e.g., according to the type
+ of work or thematically). For each task or element of the work
+ package, describe all activities to be carried out and quantify
+ them (e.g., number of protocols, tests, measurements,
+ combinations, study subjects, conferences, publications,
+ etc.). Provide enough detail to clarify who will do this work and
+ why it is needed for the project, (e.g., the level of
+ qualification and number of person-months for personnel, as well
+ as the requested equipment, consumables, meetings, etc.), to
+ justify the proposed resources and so that progress can be
+ monitored, including by the Commission.}
+\fi
+\makeatother
\item
\emph{Resources assigned to work packages should be in line with their
objectives and deliverables. You are advised to include a distinct
@@ -2431,9 +2489,15 @@ Please provide the following:
\end{itemize}
%</hi-workplan>
%<*hi-wp-description>
+\makeatletter
+\ifdim\@templateversion pt<3.4pt
(where appropriate, broken down into tasks), lead partner and role of
participants. Deliverables linked to each WP are listed in table 3.1c
(no need to repeat the information here).
+\else
+(where appropriate, broken down into tasks), lead partner and role of participants. For each task, quantify the amount of work. Provide enough detail to justify the resources requested and clarify why the work is needed and who will do it. Deliverables linked to each WP are listed in table 3.1c (no need to repeat the information here).
+\fi
+\makeatother
%</hi-wp-description>
%<*hi-wp-objectives>
\twarn \emph{Participants involved in each WP and their efforts are
@@ -2441,10 +2505,10 @@ participants. Deliverables linked to each WP are listed in table 3.1c
each WP are shown in table 3.1a.)}
%</hi-wp-objectives>
%<*heria-proposal>
-%% Copyright 2023 Tristan Miller
+%% Copyright 2023, 2024 Tristan Miller
%%
%% This work may be distributed and/or modified under the
-%% conditions of the LaTeX Project Public License, either version 1.3
+%% 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
@@ -2453,6 +2517,8 @@ participants. Deliverables linked to each WP are listed in table 3.1c
%%
\documentclass[showinstructions]{heria}
+\templateversion{3.4}
+
\title{Skeleton Horizon Europe Proposal}
\callname{insert call name}
\callidentifier{HORIZON-XX0-0000-XXXXX-00-XXXXX}
diff --git a/Master/texmf-dist/source/latex/heria/heria.ins b/Master/texmf-dist/source/latex/heria/heria.ins
index 89b8b7f72c7..406573836d0 100644
--- a/Master/texmf-dist/source/latex/heria/heria.ins
+++ b/Master/texmf-dist/source/latex/heria/heria.ins
@@ -1,8 +1,8 @@
%%
-%% Copyright 2023 Tristan Miller
+%% Copyright 2023, 2024 Tristan Miller
%%
%% This work may be distributed and/or modified under the
-%% conditions of the LaTeX Project Public License, either version 1.3
+%% 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
diff --git a/Master/texmf-dist/source/latex/oberdiek/hypcap.dtx b/Master/texmf-dist/source/latex/hypcap/hypcap.dtx
index a9bb106fe3d..ef7538e91e2 100644
--- a/Master/texmf-dist/source/latex/oberdiek/hypcap.dtx
+++ b/Master/texmf-dist/source/latex/hypcap/hypcap.dtx
@@ -1,13 +1,13 @@
% \iffalse meta-comment
%
% File: hypcap.dtx
-% Version: 2016/05/16 v1.12
+% Version: 2024-07-26 v1.13
% Info: Adjusting the anchors of captions
%
% Copyright (C)
% 1999-2001, 2006-2008, 2011 Heiko Oberdiek
-% 2016-2019 Oberdiek Package Support Group
-% https://github.com/ho-tex/oberdiek/issues
+% 2016-2024 Oberdiek Package Support Group
+% https://github.com/ho-tex/hypcap/issues
%
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either
@@ -23,15 +23,15 @@
%
% The Current Maintainers of this work are
% Heiko Oberdiek and the Oberdiek Package Support Group
-% https://github.com/ho-tex/oberdiek/issues
+% https://github.com/ho-tex/hypcap/issues
%
% This work consists of the main source file hypcap.dtx
% and the derived files
% hypcap.sty, hypcap.pdf, hypcap.ins, hypcap.drv.
%
% Distribution:
-% CTAN:macros/latex/contrib/oberdiek/hypcap.dtx
-% CTAN:macros/latex/contrib/oberdiek/hypcap.pdf
+% CTAN:macros/latex/contrib/hypcap/hypcap.dtx
+% CTAN:macros/latex/contrib/hypcap/hypcap.pdf
%
% Unpacking:
% (a) If hypcap.ins is present:
@@ -52,7 +52,7 @@
% use A4 as paper format:
% \PassOptionsToClass{a4paper}{article}
%
-% Programm calls to get the documentation (example):
+% Program calls to get the documentation (example):
% pdflatex hypcap.dtx
% makeindex -s gind.ist hypcap.idx
% pdflatex hypcap.dtx
@@ -60,9 +60,9 @@
% pdflatex hypcap.dtx
%
% Installation:
-% TDS:tex/latex/oberdiek/hypcap.sty
-% TDS:doc/latex/oberdiek/hypcap.pdf
-% TDS:source/latex/oberdiek/hypcap.dtx
+% TDS:tex/latex/hypcap/hypcap.sty
+% TDS:doc/latex/hypcap/hypcap.pdf
+% TDS:source/latex/hypcap/hypcap.dtx
%
%<*ignore>
\begingroup
@@ -79,7 +79,7 @@
\input docstrip.tex
\Msg{************************************************************************}
\Msg{* Installation}
-\Msg{* Package: hypcap 2016/05/16 v1.12 Adjusting the anchors of captions (HO)}
+\Msg{* Package: hypcap 2024-07-26 v1.13 Adjusting the anchors of captions (HO)}
\Msg{************************************************************************}
\keepsilent
@@ -91,11 +91,11 @@
This is a generated file.
Project: hypcap
-Version: 2016/05/16 v1.12
+Version: 2024-07-26 v1.13
Copyright (C)
1999-2001, 2006-2008, 2011 Heiko Oberdiek
- 2016-2019 Oberdiek Package Support Group
+ 2016-2024 Oberdiek Package Support Group
This work may be distributed and/or modified under the
conditions of the LaTeX Project Public License, either
@@ -111,7 +111,7 @@ This work has the LPPL maintenance status "maintained".
The Current Maintainers of this work are
Heiko Oberdiek and the Oberdiek Package Support Group
-https://github.com/ho-tex/oberdiek/issues
+https://github.com/ho-tex/hypcap/issues
This work consists of the main source file hypcap.dtx
@@ -124,7 +124,7 @@ and the derived files
\generate{%
\file{hypcap.ins}{\from{hypcap.dtx}{install}}%
\file{hypcap.drv}{\from{hypcap.dtx}{driver}}%
- \usedir{tex/latex/oberdiek}%
+ \usedir{tex/latex/hypcap}%
\file{hypcap.sty}{\from{hypcap.dtx}{package}}%
}
@@ -152,7 +152,7 @@ and the derived files
%<*driver>
\NeedsTeXFormat{LaTeX2e}
\ProvidesFile{hypcap.drv}%
- [2016/05/16 v1.12 Adjusting the anchors of captions (HO)]%
+ [2024-07-26 v1.13 Adjusting the anchors of captions (HO)]%
\documentclass{ltxdoc}
\usepackage{holtxdoc}[2011/11/22]
\begin{document}
@@ -166,9 +166,9 @@ and the derived files
% \GetFileInfo{hypcap.drv}
%
% \title{The \xpackage{hypcap} package}
-% \date{2016/05/16 v1.12}
+% \date{2024-07-26 v1.13}
% \author{Heiko Oberdiek\thanks
-% {Please report any issues at \url{https://github.com/ho-tex/oberdiek/issues}}}
+% {Please report any issues at \url{https://github.com/ho-tex/hypcap/issues}}}
%
% \maketitle
%
@@ -301,7 +301,7 @@ and the derived files
% \begin{macrocode}
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{hypcap}%
- [2016/05/16 v1.12 Adjusting the anchors of captions (HO)]
+ [2024-07-26 v1.13 Adjusting the anchors of captions (HO)]
% \end{macrocode}
%
% For unique command names this package uses |hc@| as prefix
@@ -461,7 +461,7 @@ and the derived files
\capstart
}{%
\if@capstart
- \PackageError{hypcap}{You have forgotten to use \string\caption}%
+ \PackageWarning{hypcap}{You have forgotten to use \string\caption}%
\global\@capstartfalse
\else
\fi
@@ -497,31 +497,11 @@ and the derived files
% \paragraph{Package.} This package is available on
% CTAN\footnote{\CTANpkg{hypcap}}:
% \begin{description}
-% \item[\CTAN{macros/latex/contrib/oberdiek/hypcap.dtx}] The source file.
-% \item[\CTAN{macros/latex/contrib/oberdiek/hypcap.pdf}] Documentation.
+% \item[\CTAN{macros/latex/contrib/hypcap/hypcap.dtx}] The source file.
+% \item[\CTAN{macros/latex/contrib/hypcap/hypcap.pdf}] Documentation.
% \end{description}
%
%
-% \paragraph{Bundle.} All the packages of the bundle `oberdiek'
-% are also available in a TDS compliant ZIP archive. There
-% the packages are already unpacked and the documentation files
-% are generated. The files and directories obey the TDS standard.
-% \begin{description}
-% \item[\CTANinstall{install/macros/latex/contrib/oberdiek.tds.zip}]
-% \end{description}
-% \emph{TDS} refers to the standard ``A Directory Structure
-% for \TeX\ Files'' (\CTANpkg{tds}). Directories
-% with \xfile{texmf} in their name are usually organized this way.
-%
-% \subsection{Bundle installation}
-%
-% \paragraph{Unpacking.} Unpack the \xfile{oberdiek.tds.zip} in the
-% TDS tree (also known as \xfile{texmf} tree) of your choice.
-% Example (linux):
-% \begin{quote}
-% |unzip oberdiek.tds.zip -d ~/texmf|
-% \end{quote}
-%
% \subsection{Package installation}
%
% \paragraph{Unpacking.} The \xfile{.dtx} file is a self-extracting
@@ -537,9 +517,9 @@ and the derived files
% \begin{quote}
% \def\t{^^A
% \begin{tabular}{@{}>{\ttfamily}l@{ $\rightarrow$ }>{\ttfamily}l@{}}
-% hypcap.sty & tex/latex/oberdiek/hypcap.sty\\
-% hypcap.pdf & doc/latex/oberdiek/hypcap.pdf\\
-% hypcap.dtx & source/latex/oberdiek/hypcap.dtx\\
+% hypcap.sty & tex/latex/hypcap/hypcap.sty\\
+% hypcap.pdf & doc/latex/hypcap/hypcap.pdf\\
+% hypcap.dtx & source/latex/hypcap/hypcap.dtx\\
% \end{tabular}^^A
% }^^A
% \sbox0{\t}^^A
@@ -718,6 +698,9 @@ and the derived files
% \item
% Documentation updates.
% \end{Version}
+% \begin{Version}{2024-07-26 v1.13}
+% \item Change error into warning, issue \#1
+% \end{Version}
% \end{History}
%
% \PrintIndex
diff --git a/Master/texmf-dist/source/latex/hyperref/hluatex.dtx b/Master/texmf-dist/source/latex/hyperref/hluatex.dtx
index 8a90953abbc..20a2f3a4a32 100644
--- a/Master/texmf-dist/source/latex/hyperref/hluatex.dtx
+++ b/Master/texmf-dist/source/latex/hyperref/hluatex.dtx
@@ -1,6 +1,6 @@
% \iffalse
% Source File: hluatex.dtx
-% 2024-05-23 v7.01i
+% 2024-07-10 v7.01j
%
% Copyright
% 2016-2019 Oberdiek Package Support Group
@@ -31,7 +31,7 @@
%
% \begin{macrocode}
%<*luatex>
-%% 2024-05-23 v7.01i
+%% 2024-07-10 v7.01j
%% force unicode encoding, see issue #101
%% code mostly copied from hxetex.def
\HyPsd@LoadUnicode
diff --git a/Master/texmf-dist/source/latex/hyperref/hyperref-linktarget.dtx b/Master/texmf-dist/source/latex/hyperref/hyperref-linktarget.dtx
index c35b68d1163..874a4927360 100644
--- a/Master/texmf-dist/source/latex/hyperref/hyperref-linktarget.dtx
+++ b/Master/texmf-dist/source/latex/hyperref/hyperref-linktarget.dtx
@@ -53,7 +53,7 @@
% }^^A
% }
%
-% \date{Version 2024-05-23 v7.01i}
+% \date{Version 2024-07-10 v7.01j}
%
% \maketitle
% \begin{documentation}
diff --git a/Master/texmf-dist/source/latex/hyperref/hyperref-patches.dtx b/Master/texmf-dist/source/latex/hyperref/hyperref-patches.dtx
index c9ffbf15bc5..ac4bac4f8cf 100644
--- a/Master/texmf-dist/source/latex/hyperref/hyperref-patches.dtx
+++ b/Master/texmf-dist/source/latex/hyperref/hyperref-patches.dtx
@@ -55,7 +55,7 @@
% }^^A
% }
%
-% \date{Version 2024-05-23 v7.01i}
+% \date{Version 2024-07-10 v7.01j}
%
% \maketitle
% \begin{documentation}
diff --git a/Master/texmf-dist/source/latex/hyperref/hyperref.dtx b/Master/texmf-dist/source/latex/hyperref/hyperref.dtx
index 8f6096d77d5..80cef9b890d 100644
--- a/Master/texmf-dist/source/latex/hyperref/hyperref.dtx
+++ b/Master/texmf-dist/source/latex/hyperref/hyperref.dtx
@@ -51,7 +51,7 @@
%<puvnenc>\ProvidesFile{puvnenc.def}
%<puarenc>\ProvidesFile{puarenc.def}
%<psdextra>\ProvidesFile{psdextra.def}
-%<!none&!packageEnd> [2024-05-23 v7.01i %
+%<!none&!packageEnd> [2024-07-10 v7.01j %
%<package> Hypertext links for LaTeX]
%<nohyperref> Dummy hyperref (SR)]
%<driver> Hyperref documentation driver file]
@@ -9177,6 +9177,8 @@
\Hy@temp{calculate}
\Hy@temp{onfocus}
\Hy@temp{onblur}
+\Hy@temp{onmousedown}
+\Hy@temp{onmouseup}
\Hy@temp{onenter}
\Hy@temp{onexit}
% \end{macrocode}
@@ -9201,8 +9203,6 @@
}%
\fi
\Hy@temp{ondblclick}
-\Hy@temp{onmousedown}
-\Hy@temp{onmouseup}
\Hy@temp{onmouseover}
\Hy@temp{onmousemove}
\Hy@temp{onmouseout}
@@ -12103,7 +12103,10 @@
% the hyperref version of the counter print command
% \cs{theHcounter} is redefined in order to add the
% parent counter.
+% change 2024-07-10: define |\HyOrg@addtoreset| always for cleveref
+% compability with tagging code, see https://github.com/latex3/tagging-project/issues/2
% \begin{macrocode}
+\def\HyOrg@addtoreset#1#2{\expandafter\@cons\csname cl@#2\endcsname {{#1}}}
\@ifundefined{hyper@nopatch@counter}
{
\let\HyOrg@addtoreset\@addtoreset
diff --git a/Master/texmf-dist/source/latex/hyperref/xr-hyper.dtx b/Master/texmf-dist/source/latex/hyperref/xr-hyper.dtx
index aced2ac70b2..f7b39072f55 100644
--- a/Master/texmf-dist/source/latex/hyperref/xr-hyper.dtx
+++ b/Master/texmf-dist/source/latex/hyperref/xr-hyper.dtx
@@ -26,7 +26,7 @@
%
%<package>\NeedsTeXFormat{LaTeX2e}
%<package>\ProvidesPackage{xr-hyper}
-%<package> [2024-05-23 v7.01i eXternal References (DPC)]
+%<package> [2024-07-10 v7.01j eXternal References (DPC)]
%
%<*driver>
\documentclass{l3doc}
diff --git a/Master/texmf-dist/source/latex/isosafety/isosafety.dtx b/Master/texmf-dist/source/latex/isosafety/isosafety.dtx
deleted file mode 100644
index da754c49324..00000000000
--- a/Master/texmf-dist/source/latex/isosafety/isosafety.dtx
+++ /dev/null
@@ -1,143 +0,0 @@
-% \iffalse meta-comment
-%
-% Copyright (C) 2023 by BenSt099
-% -------------------------------------------------------
-%
-% This file may be distributed and/or modified under the
-% conditions of the LaTeX Project Public License, either version 1.3
-% of this license or (at your option) any later version.
-% The latest version of this license is in:
-%
-% http://www.latex-project.org/lppl.txt
-%
-% and version 1.3 or later is part of all distributions of LaTeX
-% version 2005/12/01 or later.
-%
-% \fi
-%
-% \iffalse
-%<*driver>
-\ProvidesFile{isosafety.dtx}
-%</driver>
-%<package>\NeedsTeXFormat{LaTeX2e}[2005/12/01]
-%<package>\ProvidesPackage{isosafety}
-%<*package>
- [2023/11/09 v1.1 ISO Safety Colors And Safety Signs]
-
-\RequirePackage{graphicx}
-\RequirePackage{xcolor}
-%</package>
-%
-%<*driver>
-\documentclass{ltxdoc}
-\usepackage{isosafety}[2023/11/09]
-\usepackage{hyperref}
-\EnableCrossrefs
-\CodelineIndex
-\RecordChanges
-\begin{document}
- \DocInput{isosafety.dtx}
- \PrintChanges
- \PrintIndex
-\end{document}
-%</driver>
-% \fi
-%
-%
-% \changes{v1.1}{2023/11/09}{Beta version}
-%
-% \GetFileInfo{isosafety.sty}
-%
-% \DoNotIndex{\newcommand,\newenvironment}
-%
-%
-% \title{The \textsf{isosafety} package\thanks{This document
-% corresponds to \textsf{isosafety}~\fileversion, dated \filedate.}}
-% \author{BenSt099 \\ \texttt{github.com/BenSt099}}
-%
-% \maketitle
-%
-% \section{Introduction}
-%
-% This package provides ISO colors and ISO signs according to the ISO standards 3864 and 7010.
-% It can be useful when creating instructions for chemical or physical experiments.
-%
-% \section{Dependencies}
-%
-% The package has the following dependencies: \texttt{graphicx}, \texttt{xcolor}.
-%
-%
-% \section{Usage}
-%
-% \subsection{ISO colors}
-%
-% There are 6 colors that are also used in the signs: \vspace*{5mm}
-%
-% \begin{tabular}{cc}
-% Warning & {\color{Warning} Warning Color} \\
-% Prohibition & {\color{Prohibition} Prohibition Color} \\
-% Mandatory & {\color{Mandatory} Mandatory Color} \\
-% Rescue & {\color{Rescue} Rescue Color} \\
-% Backgrounds & {\color{Backgrounds} Backgrounds Color} \\
-% Symbol & {\color{Symbol} Symbol Color} \\
-% \end{tabular}
-%
-% \subsection{Colors - Example}
-%
-% \begin{verbatim}
-% {\color{Mandatory} Text with mandatory color}
-% \end{verbatim}
-%
-% \subsection{ISO signs}
-%
-% The signs from ISO are placed in a category, have a letter and a number
-%
-% \begin{itemize}
-% \item Safe condition - Letter E (001 - 070)
-% \item Crescent variant - CV (003, 004, 009, 010, 011, 012, 013, 027, 028, 029, 064, 067)
-% \item Fire Protection - Letter F (001 - 019)
-% \item Mandatory - Letter M (001 - 060)
-% \item Prohibition - Letter P (001 - 074)
-% \item Warning - Letter W (001 - 080)
-% \end{itemize}
-%
-% The command to access these signs has the following syntax:
-%
-% \begin{verbatim}
-% \Isosign{{Letter}{Number}}
-% \end{verbatim}
-%
-% \subsection{Signs - Example}
-%
-% Imagine you want to put the sign of a fire extinguisher in your document.
-% Use the following command:
-%
-% \begin{verbatim}
-% \includegraphics{\Isosign{F001}}
-% \end{verbatim}
-%
-% \includegraphics{\Isosign{F001}}
-% \vspace*{5mm}
-%
-% \noindent For an overview, take a look at \href{https://en.wikipedia.org/wiki/ISO_7010}{Wikipedia}
-%
-% \StopEventually{}
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
-\definecolor{Warning}{HTML}{F9A800}
-\definecolor{Prohibition}{HTML}{9B2423}
-\definecolor{Mandatory}{HTML}{005387}
-\definecolor{Rescue}{HTML}{237F52}
-\definecolor{Backgrounds}{HTML}{ECECE7}
-\definecolor{Symbol}{HTML}{2B2B2C}
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\newcommand{\Isosign}[1]{isosafety-pdfs/ISO_7010_#1.pdf}
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-% \Finale
-\endinput \ No newline at end of file
diff --git a/Master/texmf-dist/source/latex/isosafety/isosafety.ins b/Master/texmf-dist/source/latex/isosafety/isosafety.ins
deleted file mode 100644
index f7563b4ab15..00000000000
--- a/Master/texmf-dist/source/latex/isosafety/isosafety.ins
+++ /dev/null
@@ -1,56 +0,0 @@
-%%
-%% Copyright (C) 2023 by BenSt099
-%%
-%% This file may be distributed and/or modified under the conditions of
-%% the LaTeX Project Public License, either version 1.3 of this license
-%% or (at your option) any later version. The latest version of this
-%% license is in:
-%%
-%% http://www.latex-project.org/lppl.txt
-%%
-%% and version 1.3 or later is part of all distributions of LaTeX version
-%% 2005/12/01 or later.
-%%
-
-\input docstrip.tex
-\keepsilent
-
-\usedir{tex/latex/isosafety}
-
-\preamble
-
-This is a generated file.
-
-Copyright (C) 2023 by BenSt099
-
-This file may be distributed and/or modified under the conditions of
-the LaTeX Project Public License, either version 1.3 of this license
-or (at your option) any later version. The latest version of this
-license is in:
-
- http://www.latex-project.org/lppl.txt
-
-and version 1.3 or later is part of all distributions of LaTeX version
-2005/12/01 or later.
-
-\endpreamble
-
-\generate{\file{isosafety.sty}{\from{isosafety.dtx}{package}}}
-
-\obeyspaces
-\Msg{*************************************************************}
-\Msg{* *}
-\Msg{* To finish the installation you have to move the following *}
-\Msg{* file into a directory searched by TeX: *}
-\Msg{* *}
-\Msg{* isosafety.sty *}
-\Msg{* isosafety-pdfs/* *}
-\Msg{* *}
-\Msg{* To produce the documentation run the file isosafety.dtx *}
-\Msg{* through LaTeX. *}
-\Msg{* *}
-\Msg{* Happy TeXing! *}
-\Msg{* *}
-\Msg{*************************************************************}
-
-\endbatchfile
diff --git a/Master/texmf-dist/source/latex/iwonamath/Makefile b/Master/texmf-dist/source/latex/iwonamath/Makefile
index 5b8322bf33a..fcac414a151 100644
--- a/Master/texmf-dist/source/latex/iwonamath/Makefile
+++ b/Master/texmf-dist/source/latex/iwonamath/Makefile
@@ -48,6 +48,7 @@ all: ${PDF} $(PACKAGE).sty $(FD)
pdflatex $<
- bibtex $*
pdflatex $<
+ pdflatex $<
while ( grep -q '^LaTeX Warning: Label(s) may have changed' $*.log) \
do pdflatex $<; done
@@ -64,7 +65,8 @@ clean:
*.ilg *.ind *.out *.lof \
*.lot *.bbl *.blg *.gls \
*.dvi *.ps *.thm *.tgz *.zip *.rpi \
- *.hd sample-blx.bib
+ *.hd sample-blx.bib \
+ omsiwonamathcmsy.fd *.sty
distclean: clean
@@ -75,7 +77,7 @@ distclean: clean
#
archive: all clean
COPYFILE_DISABLE=1 \
- tar -C .. -czvf ../$(PACKAGE).tgz --exclude '*~' \
+ tar -C .. -czvf ../$(PACKAGE).tgz --exclude '*~' --exclude LICENSE \
--exclude '*.tgz' --exclude '*.zip' --exclude .git $(PACKAGE)
mv ../$(PACKAGE).tgz .
diff --git a/Master/texmf-dist/source/latex/iwonamath/iwonamath.dtx b/Master/texmf-dist/source/latex/iwonamath/iwonamath.dtx
index 020c8d6ad08..38aebd666a7 100644
--- a/Master/texmf-dist/source/latex/iwonamath/iwonamath.dtx
+++ b/Master/texmf-dist/source/latex/iwonamath/iwonamath.dtx
@@ -141,7 +141,7 @@
%<oms>{oms_FAMILY_.fd}
%<omx>{omx_FAMILY_.fd}
%<cmsy>{omsiwonamathcmsy.fd}
-%<package|fd>{2023-08-31} {1.0}
+%<package|fd>{2024-07-19} {1.1}
%<package|fd>{Scaled Iwona math fonts}
%<*package>
% \end{macrocode}
@@ -233,7 +233,8 @@
%
% We add delimiters from |cmsy|, as discussed in
% \citep[\S~12.5.5]{TLC3}). We predefine the symbols for the standard
-% versions just in case.
+% versions just in case. The last line is suggested by Enrico
+% Gregorio.
% \begin{macrocode}
\bool_if:NTF \l_@@_delimitershack_bool
{
@@ -241,6 +242,7 @@
\SetSymbolFont{symbols2} {bold}{OMS}{cmsy}{b}{n}
\DeclareMathDelimiter{\lVert}{\mathopen} {symbols2}{"6B}{largesymbols}{"0D}
\DeclareMathDelimiter{\rVert}{\mathclose}{symbols2}{"6B}{largesymbols}{"0D}
+ \DeclareMathDelimiter{\|}{\mathclose}{symbols2}{"6B}{largesymbols}{"0D}
}
{}
% \end{macrocode}
diff --git a/Master/texmf-dist/source/latex/l3kernel/expl3.dtx b/Master/texmf-dist/source/latex/l3kernel/expl3.dtx
index 4b4e61d3c8b..ad5cb365dd9 100644
--- a/Master/texmf-dist/source/latex/l3kernel/expl3.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/expl3.dtx
@@ -24,7 +24,7 @@
%
%<*driver|generic|package|2ekernel>
%</driver|generic|package|2ekernel>
-\def\ExplFileDate{2024-05-27}%
+\def\ExplFileDate{2024-08-16}%
%<*driver>
\documentclass[full]{l3doc}
\usepackage{graphicx}
@@ -51,7 +51,7 @@
% }^^A
% }
%
-% \date{Released 2024-05-27}
+% \date{Released 2024-08-16}
%
% \maketitle
%
@@ -454,6 +454,15 @@
% implementation in \LaTeX3 means that |toks| are not required, and that
% all operations for storing tokens can use the |tl| variable type.
%
+% There are two more special types of constants:
+% \begin{arg-description}
+% \item[q] constants of quark type;
+% \item[s] constants of scan mark type.
+% \end{arg-description}
+% The \meta{type} part of quark and scan mark constants is omitted, and
+% the \meta{module} part of general quarks and scan marks is often
+% omitted too.
+%
% Experienced \TeX{} programmers will notice that some of the variable
% types listed are native \TeX{} registers whilst others are not. In
% general, the underlying \TeX{} implementation for a data structure may
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3basics.dtx b/Master/texmf-dist/source/latex/l3kernel/l3basics.dtx
index 69e44415804..8ef1f6a5beb 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3basics.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3basics.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2024-05-27}
+% \date{Released 2024-08-16}
%
% \maketitle
%
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3bitset.dtx b/Master/texmf-dist/source/latex/l3kernel/l3bitset.dtx
index 4559b56fd3a..5fc681a6776 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3bitset.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3bitset.dtx
@@ -42,7 +42,7 @@
% }^^A
% }
%
-% \date{Released 2024-05-27}
+% \date{Released 2024-08-16}
%
% \maketitle
%
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3bootstrap.dtx b/Master/texmf-dist/source/latex/l3kernel/l3bootstrap.dtx
index 861f0bb5a62..b3c8536420d 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3bootstrap.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3bootstrap.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2024-05-27}
+% \date{Released 2024-08-16}
%
% \maketitle
%
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3box.dtx b/Master/texmf-dist/source/latex/l3kernel/l3box.dtx
index 808d22da232..abe1ce302a6 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3box.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3box.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2024-05-27}
+% \date{Released 2024-08-16}
%
% \maketitle
%
@@ -906,9 +906,9 @@
% \begin{syntax}
% \cs{box_set_trim:Nnnnn} \meta{box} \Arg{left} \Arg{bottom} \Arg{right} \Arg{top}
% \end{syntax}
-% Adjusts the bounding box of the \meta{box} \meta{left} is removed from
+% Adjusts the bounding box of the \meta{box}: \meta{left} is removed from
% the left-hand edge of the bounding box, \meta{right} from the right-hand
-% edge and so fourth. All adjustments are \meta{dim exprs}.
+% edge, and so forth. All adjustments are \meta{dim exprs}.
% Material outside of the bounding box is still displayed in the output
% unless \cs{box_set_clipped:N} is subsequently applied.
% The updated \meta{box} is an
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3cctab.dtx b/Master/texmf-dist/source/latex/l3kernel/l3cctab.dtx
index 4bf8db41a68..56f831becf9 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3cctab.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3cctab.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2024-05-27}
+% \date{Released 2024-08-16}
%
% \maketitle
%
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3clist.dtx b/Master/texmf-dist/source/latex/l3kernel/l3clist.dtx
index 5adb01cffb6..cfad9ac5a33 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3clist.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3clist.dtx
@@ -44,7 +44,7 @@
% }^^A
% }
%
-% \date{Released 2024-05-27}
+% \date{Released 2024-08-16}
%
% \maketitle
%
@@ -324,8 +324,10 @@
% {
% \clist_remove_all:Nn, \clist_remove_all:cn,
% \clist_remove_all:NV, \clist_remove_all:cV,
+% \clist_remove_all:Ne, \clist_remove_all:ce,
% \clist_gremove_all:Nn, \clist_gremove_all:cn,
% \clist_gremove_all:NV, \clist_gremove_all:cV
+% \clist_gremove_all:Ne, \clist_gremove_all:ce
% }
% \begin{syntax}
% \cs{clist_remove_all:Nn} \meta{clist~var} \Arg{item}
@@ -350,7 +352,7 @@
% Reverses the order of items stored in the \meta{clist~var}.
% \end{function}
%
-% \begin{function}[added = 2014-07-18]{\clist_reverse:n}
+% \begin{function}[added = 2014-07-18, EXP]{\clist_reverse:n}
% \begin{syntax}
% \cs{clist_reverse:n} \Arg{comma list}
% \end{syntax}
@@ -1429,13 +1431,15 @@
% \begin{macro}
% {
% \clist_remove_all:Nn, \clist_remove_all:cn,
-% \clist_remove_all:NV, \clist_remove_all:cV
+% \clist_remove_all:NV, \clist_remove_all:cV,
+% \clist_remove_all:Ne, \clist_remove_all:ce
% }
% \UnitTested
% \begin{macro}
% {
% \clist_gremove_all:Nn, \clist_gremove_all:cn,
-% \clist_gremove_all:NV, \clist_gremove_all:cV
+% \clist_gremove_all:NV, \clist_gremove_all:cV,
+% \clist_gremove_all:Ne, \clist_gremove_all:ce
% }
% \UnitTested
% \begin{macro}{\@@_remove_all:NNNn}
@@ -1509,8 +1513,8 @@
\cs_new:Npn \@@_remove_all:
{ \exp_after:wN \@@_remove_all:w \@@_tmp:w , }
\cs_new:Npn \@@_remove_all:w #1 , \s_@@_mark , #2 , { \exp_not:n {#1} }
-\cs_generate_variant:Nn \clist_remove_all:Nn { c , NV , cV }
-\cs_generate_variant:Nn \clist_gremove_all:Nn { c , NV , cV }
+\cs_generate_variant:Nn \clist_remove_all:Nn { c , NV , cV , Ne , ce }
+\cs_generate_variant:Nn \clist_gremove_all:Nn { c , NV , cV , Ne , ce }
% \end{macrocode}
% \end{macro}
% \end{macro}
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3coffins.dtx b/Master/texmf-dist/source/latex/l3kernel/l3coffins.dtx
index 62dc5f92ad3..82f234799e2 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3coffins.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3coffins.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2024-05-27}
+% \date{Released 2024-08-16}
%
% \maketitle
%
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3color.dtx b/Master/texmf-dist/source/latex/l3kernel/l3color.dtx
index b56fb9e0ac2..e973fb5e7cd 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3color.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3color.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2024-05-27}
+% \date{Released 2024-08-16}
%
% \maketitle
%
@@ -103,7 +103,7 @@
% \begin{itemize}
% \item \texttt{Gray} Grayscale color, with a single axis running from
% $0$ (fully black) to $15$ (fully white)
-% \item \texttt{hsb} Hue-saturation-brightness color, with three axes,all
+% \item \texttt{hsb} Hue-saturation-brightness color, with three axes, all
% real values in the range $[0,1]$ for hue saturation and brightness
% \item \texttt{Hsb} Hue-saturation-brightness color, with three axes, integer
% in the range $[0,360]$ for hue, real values in the range $[0,1]$ for
@@ -406,20 +406,20 @@
%
% \begin{function}{\color_export:nnN}
% \begin{syntax}
-% \cs{color_export:nnN} \Arg{color expression} \Arg{format} \Arg{tl}
+% \cs{color_export:nnN} \Arg{color expression} \Arg{format} \meta{tl var}
% \end{syntax}
% Parses the \meta{color expression} as described earlier,
% then converts to the \meta{format} specified and assigns the data to the
-% \meta{tl}.
+% \meta{tl var}.
% \end{function}
%
% \begin{function}{\color_export:nnnN}
% \begin{syntax}
-% \cs{color_export:nnnN} \Arg{model} \Arg{value(s)} \Arg{format} \Arg{tl}
+% \cs{color_export:nnnN} \Arg{model} \Arg{value(s)} \Arg{format} \meta{tl var}
% \end{syntax}
% Expresses the combination of \meta{model} and \meta{value(s)} in an
% internal representation, then converts to the \meta{format} specified and
-% assigns the data to the \meta{tl}.
+% assigns the data to the \meta{tl var}.
% \end{function}
%
% \section{Creating new color models}
@@ -495,7 +495,7 @@
%
% Color profiles are used to ensure color accuracy by linking to collaboration.
% Applying a profile can be used to standardise color which is otherwise
-% device-dependence.
+% device-dependent.
%
% \begin{function}[added = 2021-02-23]{\color_profile_apply:nn}
% \begin{syntax}
@@ -697,14 +697,14 @@
% \begin{macro}{\@@_convert:nnnN, \@@_convert:nVnN, \@@_convert:nnVN}
% \begin{macro}[EXP]
% {
-% \@@_convert_gray_gray:w
-% \@@_convert_gray_rgb:w
-% \@@_convert_gray_cmyk:w
-% \@@_convert_cmyk_gray:w
-% \@@_convert_cmyk_rgb:w
-% \@@_convert_cmyk_cmyk:w
-% \@@_convert_rgb_gray:w
-% \@@_convert_rgb_rgb:w
+% \@@_convert_gray_gray:w,
+% \@@_convert_gray_rgb:w,
+% \@@_convert_gray_cmyk:w,
+% \@@_convert_cmyk_gray:w,
+% \@@_convert_cmyk_rgb:w,
+% \@@_convert_cmyk_cmyk:w,
+% \@@_convert_rgb_gray:w,
+% \@@_convert_rgb_rgb:w,
% \@@_convert_rgb_cmyk:w
% }
% \begin{macro}[EXP]{\@@_convert_rgb_cmyk:nnn}
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3debug.dtx b/Master/texmf-dist/source/latex/l3kernel/l3debug.dtx
index 21e6747a844..41456cf8da1 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3debug.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3debug.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2024-05-27}
+% \date{Released 2024-08-16}
%
% \maketitle
%
@@ -69,7 +69,7 @@
%
% Standard file identification.
% \begin{macrocode}
-\ProvidesExplFile{l3debug.def}{2024-05-27}{}{L3 Debugging support}
+\ProvidesExplFile{l3debug.def}{2024-08-16}{}{L3 Debugging support}
% \end{macrocode}
%
% \begin{variable}{\s_@@_stop}
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3deprecation.dtx b/Master/texmf-dist/source/latex/l3kernel/l3deprecation.dtx
index 5852205ddca..21d96b8f9c9 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3deprecation.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3deprecation.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2024-05-27}
+% \date{Released 2024-08-16}
%
% \maketitle
%
@@ -505,10 +505,10 @@
{ \text_uppercase:nn {#1} {#2} }
\__kernel_patch_deprecation:nnNNpn { 2020-01-03 } { \text_titlecase_first:n }
\cs_new:Npn \tl_mixed_case:n #1
- { \text_titlecase_first:n {#1} }
+ { \text_titlecase_first:n { \text_lowercase:n {#1} } }
\__kernel_patch_deprecation:nnNNpn { 2020-01-03 } { \text_titlecase_first:nn }
\cs_new:Npn \tl_mixed_case:nn #1#2
- { \text_titlecase_first:nn {#1} {#2} }
+ { \text_titlecase_first:nn {#1} { \text_lowercase:n {#2} } }
% \end{macrocode}
% \end{macro}
%
@@ -571,7 +571,7 @@
% \char_lower_case:N, \char_upper_case:N,
% \char_mixed_case:Nn, \char_fold_case:N,
% \char_str_lower_case:N, \char_str_upper_case:N,
-% \char_str_mixed_case:Nn, \char_str_fold_case:N,
+% \char_str_mixed_case:N, \char_str_fold_case:N,
% }
% \begin{macrocode}
\__kernel_patch_deprecation:nnNNpn { 2020-01-03 } { \text_lowercase:n }
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3doc.dtx b/Master/texmf-dist/source/latex/l3kernel/l3doc.dtx
index 43b719ce592..ecd473b8370 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3doc.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3doc.dtx
@@ -71,7 +71,7 @@ and all files in that bundle must be distributed together.
% This isn't included in the typeset documentation because it's a bit
% ugly:
%<*class>
-\ProvidesExplClass{l3doc}{2024-05-27}{}
+\ProvidesExplClass{l3doc}{2024-08-16}{}
{L3 Experimental documentation class}
%</class>
% \fi
@@ -84,7 +84,7 @@ and all files in that bundle must be distributed together.
% require you to do updates, if the class changes.}}
%
% \author{\Team}
-% \date{Released 2024-05-27}
+% \date{Released 2024-08-16}
% \maketitle
% \tableofcontents
%
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3docstrip.dtx b/Master/texmf-dist/source/latex/l3kernel/l3docstrip.dtx
index fecb228324e..29503b2d55e 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3docstrip.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3docstrip.dtx
@@ -63,7 +63,7 @@
% }^^A
% }
%
-% \date{Released 2024-05-27}
+% \date{Released 2024-08-16}
%
% \maketitle
%
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3expan.dtx b/Master/texmf-dist/source/latex/l3kernel/l3expan.dtx
index d13578bde1b..714af5dc27b 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3expan.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3expan.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2024-05-27}
+% \date{Released 2024-08-16}
%
% \maketitle
%
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3file.dtx b/Master/texmf-dist/source/latex/l3kernel/l3file.dtx
index 546222711e1..9074a659216 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3file.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3file.dtx
@@ -44,7 +44,7 @@
% }^^A
% }
%
-% \date{Released 2024-05-27}
+% \date{Released 2024-08-16}
%
% \maketitle
%
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3flag.dtx b/Master/texmf-dist/source/latex/l3kernel/l3flag.dtx
index 88e726df354..a25a02a2ca9 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3flag.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3flag.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2024-05-27}
+% \date{Released 2024-08-16}
%
% \maketitle
%
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-assign.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-assign.dtx
index e6fa97423e5..2c988e21b47 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3fp-assign.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3fp-assign.dtx
@@ -42,7 +42,7 @@
% {latex-team@latex-project.org}^^A
% }^^A
% }
-% \date{Released 2024-05-27}
+% \date{Released 2024-08-16}
% \maketitle
%
% \begin{documentation}
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-aux.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-aux.dtx
index 1ad33e235e4..06c5304064f 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3fp-aux.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3fp-aux.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2024-05-27}
+% \date{Released 2024-08-16}
%
% \maketitle
%
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-basics.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-basics.dtx
index e2d93219b0f..5c8ee332b90 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3fp-basics.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3fp-basics.dtx
@@ -42,7 +42,7 @@
% {latex-team@latex-project.org}^^A
% }^^A
% }
-% \date{Released 2024-05-27}
+% \date{Released 2024-08-16}
%
% \maketitle
%
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-convert.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-convert.dtx
index 4983a3dd1fa..49d25cc51b4 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3fp-convert.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3fp-convert.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2024-05-27}
+% \date{Released 2024-08-16}
%
% \maketitle
%
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-expo.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-expo.dtx
index 7577f640d40..ea6a3015cf4 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3fp-expo.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3fp-expo.dtx
@@ -42,7 +42,7 @@
% {latex-team@latex-project.org}^^A
% }^^A
% }
-% \date{Released 2024-05-27}
+% \date{Released 2024-08-16}
%
% \maketitle
%
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-extended.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-extended.dtx
index 596dc86ef2c..be1137c0d43 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3fp-extended.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3fp-extended.dtx
@@ -42,7 +42,7 @@
% {latex-team@latex-project.org}^^A
% }^^A
% }
-% \date{Released 2024-05-27}
+% \date{Released 2024-08-16}
%
% \maketitle
%
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-functions.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-functions.dtx
index b9e269b988b..7b28783cfa1 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3fp-functions.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3fp-functions.dtx
@@ -42,7 +42,7 @@
% }^^A
% }
%
-% \date{Released 2024-05-27}
+% \date{Released 2024-08-16}
%
% \maketitle
%
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-logic.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-logic.dtx
index 486a3bc579b..c1b9f68b9d5 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3fp-logic.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3fp-logic.dtx
@@ -42,7 +42,7 @@
% {latex-team@latex-project.org}^^A
% }^^A
% }
-% \date{Released 2024-05-27}
+% \date{Released 2024-08-16}
%
% \maketitle
%
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-parse.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-parse.dtx
index 7853c401327..8f8cc99ac40 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3fp-parse.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3fp-parse.dtx
@@ -42,7 +42,7 @@
% {latex-team@latex-project.org}^^A
% }^^A
% }
-% \date{Released 2024-05-27}
+% \date{Released 2024-08-16}
%
% \maketitle
%
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-random.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-random.dtx
index ff999926aba..14a780a392e 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3fp-random.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3fp-random.dtx
@@ -42,7 +42,7 @@
% {latex-team@latex-project.org}^^A
% }^^A
% }
-% \date{Released 2024-05-27}
+% \date{Released 2024-08-16}
%
% \maketitle
%
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-round.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-round.dtx
index 0d39b8a26a1..d6097c32583 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3fp-round.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3fp-round.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2024-05-27}
+% \date{Released 2024-08-16}
%
% \maketitle
%
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-symbolic.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-symbolic.dtx
index 88e214f49e1..387d582d995 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3fp-symbolic.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3fp-symbolic.dtx
@@ -42,7 +42,7 @@
% }^^A
% }
%
-% \date{Released 2024-05-27}
+% \date{Released 2024-08-16}
%
% \maketitle
%
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-traps.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-traps.dtx
index fec48bc1634..f2967021e32 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3fp-traps.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3fp-traps.dtx
@@ -42,7 +42,7 @@
% {latex-team@latex-project.org}^^A
% }^^A
% }
-% \date{Released 2024-05-27}
+% \date{Released 2024-08-16}
% \maketitle
%
% \begin{documentation}
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-trig.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-trig.dtx
index 7c40c6198fa..297deb24497 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3fp-trig.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3fp-trig.dtx
@@ -42,7 +42,7 @@
% {latex-team@latex-project.org}^^A
% }^^A
% }
-% \date{Released 2024-05-27}
+% \date{Released 2024-08-16}
%
% \maketitle
%
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-types.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-types.dtx
index e9269e1f038..b48c37d4531 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3fp-types.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3fp-types.dtx
@@ -42,7 +42,7 @@
% }^^A
% }
%
-% \date{Released 2024-05-27}
+% \date{Released 2024-08-16}
%
% \maketitle
%
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp.dtx
index d273b057eab..d970d631eba 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3fp.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3fp.dtx
@@ -49,7 +49,7 @@
% }^^A
% }
%
-% \date{Released 2024-05-27}
+% \date{Released 2024-08-16}
%
% \maketitle
%
@@ -773,7 +773,7 @@
% The result may contain other functions, which are
% then replaced by their results if they have any. For instance,
% \begin{quote}
-% \cs{fp_new_function:n} |{ foo }| \\
+% \cs{fp_new_function:n} |{ npow }| \\
% \cs{fp_set_function:nnn} |{ npow } { a,b } { a**b }| \\
% \cs{fp_show:n} |{ npow(16,0.25) } }|
% \end{quote}
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fparray.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fparray.dtx
index f48de27af38..b20483a583d 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3fparray.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3fparray.dtx
@@ -44,7 +44,7 @@
% }^^A
% }
%
-% \date{Released 2024-05-27}
+% \date{Released 2024-08-16}
%
% \maketitle
%
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3int.dtx b/Master/texmf-dist/source/latex/l3kernel/l3int.dtx
index 45050964ded..d9698e85162 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3int.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3int.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2024-05-27}
+% \date{Released 2024-08-16}
%
% \maketitle
%
@@ -100,21 +100,6 @@
% restricted-expandable functions can both be used, and \cs{exp_not:n}
% and its variants have no effect while \cs{exp_not:N} may incorrectly
% interrupt the expression.
-% \begin{texnote}
-% Exactly two expansions are needed to evaluate \cs{int_eval:n}.
-% The result is \emph{not} an \meta{internal integer}, and therefore
-% should be terminated by a space if used in \cs{int_value:w} or in
-% a \TeX{}-style integer assignment.
-%
-% As all \TeX{} integers, integer operands can also be:
-% \tn{value}\Arg{\LaTeXe{} counter}; dimension or skip variables,
-% converted to integers in~\texttt{sp}; the character code of some
-% character given as \texttt{`}\meta{char} or
-% \texttt{`\textbackslash}\meta{char}; octal numbers given as
-% \texttt{'} followed by digits from \texttt{0} to \texttt{7}; or
-% hexadecimal numbers given as |"| followed by digits and upper case
-% letters from \texttt{A} to~\texttt{F}.
-% \end{texnote}
%
% \begin{function}[EXP]{\int_eval:n}
% \begin{syntax}
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3intarray.dtx b/Master/texmf-dist/source/latex/l3kernel/l3intarray.dtx
index aa49275e78c..48b5b83ad10 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3intarray.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3intarray.dtx
@@ -44,7 +44,7 @@
% }^^A
% }
%
-% \date{Released 2024-05-27}
+% \date{Released 2024-08-16}
%
% \maketitle
%
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3kernel-functions.dtx b/Master/texmf-dist/source/latex/l3kernel/l3kernel-functions.dtx
index c3bb838acfc..cc6d8f6909e 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3kernel-functions.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3kernel-functions.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2024-05-27}
+% \date{Released 2024-08-16}
%
% \maketitle
%
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3keys.dtx b/Master/texmf-dist/source/latex/l3kernel/l3keys.dtx
index 13772d17817..9225e1042d1 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3keys.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3keys.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2024-05-27}
+% \date{Released 2024-08-16}
%
% \maketitle
%
@@ -649,15 +649,13 @@
% { key } % Name of choice key
% { choice-a , choice-b , choice-c } % Valid choices
% { \exp_not:n {#1} } % Invalid choice given
-% %
-% %
% }
% \end{verbatim}
%
% Multiple choices are created in a very similar manner to mutually-exclusive
% choices, using the properties \texttt{.multichoice:} and
% \texttt{.multichoices:nn}. As with mutually exclusive choices, multiple
-% choices are define as sub-keys. Thus both
+% choices are defined as sub-keys. Thus both
% \begin{verbatim}
% \keys_define:nn { mymodule }
% {
@@ -1926,19 +1924,21 @@
% \end{macro}
%
% \begin{macro}{\@@_define_code:n}
+% \begin{macro}[EXP]{\@@_define_code:nnn}
% \begin{macro}[EXP]{\@@_define_code:w}
% Two possible cases. If there is a value for the key, then just use
% the function. If not, then a check to make sure there is no need for
% a value with the property. If there should be one then complain,
-% otherwise execute it. There is no need to check for a |:| as if it
-% was missing the earlier tests would have failed.
+% otherwise execute it. For a \LaTeXe{} property like |.code| which
+% doesn't contain a |:|, treat it as having arity 1 and pass the
+% (empty) value to it.
% \begin{macrocode}
\cs_new_protected:Npn \@@_define_code:n #1
{
\bool_if:NTF \l_@@_no_value_bool
{
- \exp_after:wN \@@_define_code:w
- \l_@@_property_str \s_@@_stop
+ \@@_define_code:nnn
+ { \use:c { \c_@@_props_root_str \l_@@_property_str } {#1} }
{ \use:c { \c_@@_props_root_str \l_@@_property_str } }
{
\msg_error:nnee { keys } { property-requires-value }
@@ -1947,12 +1947,31 @@
}
{ \use:c { \c_@@_props_root_str \l_@@_property_str } {#1} }
}
-\exp_last_unbraced:NNNNo
- \cs_new:Npn \@@_define_code:w #1 \c_colon_str #2 \s_@@_stop
- { \tl_if_empty:nTF {#2} }
+\cs_new:Npe \@@_define_code:nnn
+ {
+ \exp_not:N \exp_after:wN \exp_not:N \@@_define_code:w
+ \exp_not:N \l_@@_property_str
+ \c_colon_str \c_colon_str
+ \exp_not:N \s_@@_stop
+ }
+\use:e
+ {
+ \cs_new:Npn \exp_not:N \@@_define_code:w
+ #1 \c_colon_str #2 \c_colon_str #3 \exp_not:N \s_@@_stop
+ }
+ {
+ \tl_if_empty:nTF {#3}
+ { \use_i:nnn }
+ {
+ \tl_if_empty:nTF {#2}
+ { \use_ii:nnn }
+ { \use_iii:nnn }
+ }
+ }
% \end{macrocode}
% \end{macro}
% \end{macro}
+% \end{macro}
%
% \subsection{Turning properties into actions}
%
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3legacy.dtx b/Master/texmf-dist/source/latex/l3kernel/l3legacy.dtx
index 4cfce5c5f1e..667b15003ad 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3legacy.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3legacy.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2024-05-27}
+% \date{Released 2024-08-16}
%
% \maketitle
%
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3luatex.dtx b/Master/texmf-dist/source/latex/l3kernel/l3luatex.dtx
index eb10d5aecce..963fdcb032f 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3luatex.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3luatex.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2024-05-27}
+% \date{Released 2024-08-16}
%
% \maketitle
%
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3msg.dtx b/Master/texmf-dist/source/latex/l3kernel/l3msg.dtx
index e901b07c063..c8569dd7ac1 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3msg.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3msg.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2024-05-27}
+% \date{Released 2024-08-16}
%
% \maketitle
%
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3names.dtx b/Master/texmf-dist/source/latex/l3kernel/l3names.dtx
index 5cdd1361e37..9231f409c1a 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3names.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3names.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2024-05-27}
+% \date{Released 2024-08-16}
%
% \maketitle
%
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3pdf.dtx b/Master/texmf-dist/source/latex/l3kernel/l3pdf.dtx
index 55f49476e3d..e827001e9f5 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3pdf.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3pdf.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2024-05-27}
+% \date{Released 2024-08-16}
%
% \maketitle
%
@@ -70,8 +70,8 @@
% \cs{pdf_object_write:nnn} \Arg{object} \Arg{type} \Arg{content}
% \end{syntax}
% Writes the \meta{content} as content of the \meta{object}. Depending on the
-% \meta{type} declared for the object, the format required for the
-% \meta{data} will vary
+% \meta{type} declared for the object, the format required for
+% \meta{content} will vary:
% \begin{itemize}
% \item[\texttt{array}] A space-separated list of values
% \item[\texttt{dict}] Key--value pairs in the form
@@ -159,7 +159,7 @@
% \cs{pdf_object_unnamed_write:nn} \Arg{type} \Arg{content}
% \end{syntax}
% Writes the \meta{content} as content of an anonymous object. Depending on the
-% \meta{type}, the format required for the \meta{data} will vary
+% \meta{type}, the format required for \meta{content} will vary:
% \begin{itemize}
% \item[\texttt{array}] A space-separated list of values
% \item[\texttt{dict}] Key--value pairs in the form
@@ -251,9 +251,9 @@
%
% \section{Destinations}
%
-% Destinations are the places a link jumped too.
-% Unlike the name may suggest they don't described
-% an exact location in the PDF. Instead a destination contains a reference to
+% Destinations are the places a link jumped to.
+% Unlike the name may suggest, they don't describe
+% an exact location in the PDF. Instead, a destination contains a reference to
% a page along with an instruction how to display this page.
% The normally used \enquote{XYZ \textit{top left zoom}} for example instructs
% the viewer to show the page with the given \textit{zoom} and
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3prg.dtx b/Master/texmf-dist/source/latex/l3kernel/l3prg.dtx
index bec4e3a7125..69c66057d44 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3prg.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3prg.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2024-05-27}
+% \date{Released 2024-08-16}
%
% \maketitle
%
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3prop.dtx b/Master/texmf-dist/source/latex/l3kernel/l3prop.dtx
index 21b8d03dd69..5f60f31b81f 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3prop.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3prop.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2024-05-27}
+% \date{Released 2024-08-16}
%
% \maketitle
%
@@ -181,11 +181,11 @@
% \prop_gset_from_keyval:Nn, \prop_gset_from_keyval:cn,
% }
% \begin{syntax}
-% \cs{prop_set_from_keyval:Nn} \meta{property list}
-% \{
-% \meta{key1} |=| \meta{value1} |,|
-% \meta{key2} |=| \meta{value2} |,| \ldots{}
-% \}
+% \cs{prop_set_from_keyval:Nn} \meta{property list} \\
+% ~~\{ \\
+% ~~~~\meta{key1} |=| \meta{value1} |,| \\
+% ~~~~\meta{key2} |=| \meta{value2} |,| \ldots{} \\
+% ~~\}
% \end{syntax}
% Sets \meta{property list} to contain key--value pairs given in the second
% argument. If duplicate keys appear only the last of the values is kept.
@@ -205,11 +205,11 @@
% \begin{function}[added = 2017-11-28, updated = 2021-11-07]
% {\prop_const_from_keyval:Nn, \prop_const_from_keyval:cn}
% \begin{syntax}
-% \cs{prop_const_from_keyval:Nn} \meta{property list}
-% \{
-% \meta{key1} |=| \meta{value1} |,|
-% \meta{key2} |=| \meta{value2} |,| \ldots{}
-% \}
+% \cs{prop_const_from_keyval:Nn} \meta{property list} \\
+% ~~\{ \\
+% ~~~~\meta{key1} |=| \meta{value1} |,| \\
+% ~~~~\meta{key2} |=| \meta{value2} |,| \ldots{} \\
+% ~~\}
% \end{syntax}
% Creates a new constant \enquote{flat} \meta{property list} or raises
% an error if the
@@ -224,11 +224,11 @@
% \begin{function}[added = 2024-02-12]
% {\prop_const_linked_from_keyval:Nn, \prop_const_linked_from_keyval:cn}
% \begin{syntax}
-% \cs{prop_const_linked_from_keyval:Nn} \meta{prop~var}
-% \{
-% \meta{key1} |=| \meta{value1} |,|
-% \meta{key2} |=| \meta{value2} |,| \ldots{}
-% \}
+% \cs{prop_const_linked_from_keyval:Nn} \meta{prop~var} \\
+% ~~\{ \\
+% ~~~~\meta{key1} |=| \meta{value1} |,| \\
+% ~~~~\meta{key2} |=| \meta{value2} |,| \ldots{} \\
+% ~~\}
% \end{syntax}
% Creates a new constant \enquote{linked} \meta{prop~var} or raises an
% error if the
@@ -347,11 +347,11 @@
% \prop_gput_from_keyval:Nn, \prop_gput_from_keyval:cn,
% }
% \begin{syntax}
-% \cs{prop_put_from_keyval:Nn} \meta{property list}
-% \{
-% \meta{key1} |=| \meta{value1} |,|
-% \meta{key2} |=| \meta{value2} |,| \ldots{}
-% \}
+% \cs{prop_put_from_keyval:Nn} \meta{property list} \\
+% ~~\{ \\
+% ~~~~\meta{key1} |=| \meta{value1} |,| \\
+% ~~~~\meta{key2} |=| \meta{value2} |,| \ldots{} \\
+% ~~\}
% \end{syntax}
% Updates the \meta{property list} by adding entries for each key--value
% pair given in the second argument. The addition is done through
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3quark.dtx b/Master/texmf-dist/source/latex/l3kernel/l3quark.dtx
index 136596a3fe2..d4558e216b0 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3quark.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3quark.dtx
@@ -32,7 +32,7 @@
%
% \title{^^A
% The \pkg{l3quark} module\\ Quarks and scan marks^^A
-% }
+% }\ifdefined\thechapter\label{sec:l3quarks}\fi
%
% \author{^^A
% The \LaTeX{} Project\thanks
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2024-05-27}
+% \date{Released 2024-08-16}
%
% \maketitle
%
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3regex.dtx b/Master/texmf-dist/source/latex/l3kernel/l3regex.dtx
index 6ca9c8eeed9..b6ca0d5d2ce 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3regex.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3regex.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2024-05-27}
+% \date{Released 2024-08-16}
%
% \maketitle
%
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3seq.dtx b/Master/texmf-dist/source/latex/l3kernel/l3seq.dtx
index 38fc9471a90..2f0b2237534 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3seq.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3seq.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2024-05-27}
+% \date{Released 2024-08-16}
%
% \maketitle
%
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3skip.dtx b/Master/texmf-dist/source/latex/l3kernel/l3skip.dtx
index 6e96b41326a..788abaf20ce 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3skip.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3skip.dtx
@@ -44,7 +44,7 @@
% }^^A
% }
%
-% \date{Released 2024-05-27}
+% \date{Released 2024-08-16}
%
% \maketitle
%
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3sort.dtx b/Master/texmf-dist/source/latex/l3kernel/l3sort.dtx
index 47cebcad255..6c997672de8 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3sort.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3sort.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2024-05-27}
+% \date{Released 2024-08-16}
%
% \maketitle
%
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3str-convert.dtx b/Master/texmf-dist/source/latex/l3kernel/l3str-convert.dtx
index baf705fe0c2..4da5cf1302d 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3str-convert.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3str-convert.dtx
@@ -44,7 +44,7 @@
% }^^A
% }
%
-% \date{Released 2024-05-27}
+% \date{Released 2024-08-16}
%
% \maketitle
%
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3str.dtx b/Master/texmf-dist/source/latex/l3kernel/l3str.dtx
index f4f7b94b884..787bbf6d874 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3str.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3str.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2024-05-27}
+% \date{Released 2024-08-16}
%
% \maketitle
%
@@ -757,7 +757,7 @@
% \item Case changing text for typesetting: see the
% \cs[index=text_lowercase:n]{text_lowercase:n(n)},
% \cs[index=text_uppercase:n]{text_uppercase:n(n)} and
-% \cs[index=text_titlecase_all:n]{text_titlecase_(all|once):n(n)} functions which
+% \cs[index=text_titlecase_all:n]{text_titlecase_(all|first):n(n)} functions which
% correctly deal with context-dependence and other factors appropriate
% to text case changing.
% \end{itemize}
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3sys.dtx b/Master/texmf-dist/source/latex/l3kernel/l3sys.dtx
index b2228c7fd9e..861865c677e 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3sys.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3sys.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2024-05-27}
+% \date{Released 2024-08-16}
%
% \maketitle
%
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3text-case.dtx b/Master/texmf-dist/source/latex/l3kernel/l3text-case.dtx
index 89cdb9e2b13..2a3702df859 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3text-case.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3text-case.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2024-05-27}
+% \date{Released 2024-08-16}
%
% \maketitle
%
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3text-map.dtx b/Master/texmf-dist/source/latex/l3kernel/l3text-map.dtx
index 35730022441..431e0337074 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3text-map.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3text-map.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2024-05-27}
+% \date{Released 2024-08-16}
%
% \maketitle
%
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3text-purify.dtx b/Master/texmf-dist/source/latex/l3kernel/l3text-purify.dtx
index 35390811aa7..051933eb9bc 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3text-purify.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3text-purify.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2024-05-27}
+% \date{Released 2024-08-16}
%
% \maketitle
%
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3text.dtx b/Master/texmf-dist/source/latex/l3kernel/l3text.dtx
index bcfd15cb62b..0680c19fedc 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3text.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3text.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2024-05-27}
+% \date{Released 2024-08-16}
%
% \maketitle
%
@@ -65,11 +65,11 @@
% \end{syntax}
% Takes user input \meta{text} and expands the content.
% Protected commands (typically
-% formatting) are left in place, and no processing takes place of
+% formatting) are left in place, and no processing of
% math mode material (as delimited by pairs given in
% \cs{l_text_math_delims_tl} or as the argument to commands listed
-% in \cs{l_text_math_arg_tl}). Commands which are neither engine-
-% nor \LaTeX{} protected are expanded exhaustively.
+% in \cs{l_text_math_arg_tl}) takes place. Commands which are neither engine-
+% nor \LaTeX{}-protected are expanded exhaustively.
% Any commands listed in \cs{l_text_expand_exclude_tl} are excluded from
% expansion, as are those in \cs{l_text_case_exclude_arg_tl} and
% \cs{l_text_math_arg_tl}.
@@ -114,8 +114,8 @@
% \end{function}
%
% Upper- and lowercase have the obvious meanings. Titlecasing may be regarded
-% informally as converting the first character of the \meta{tokens} to
-% uppercase. However, the process is more complex
+% informally as converting the first \emph{non-space} character of the
+% \meta{tokens} to uppercase. However, the process is more complex
% than this as there are some situations where a single lowercase character
% maps to a special form, for example \texttt{ij} in Dutch which becomes
% \texttt{IJ}. There are two functions available for titlecasing: one which
@@ -214,8 +214,8 @@
% \text_declare_uppercase_mapping:nnn
% }
% \begin{syntax}
-% \cs{text_declare_lowercase_mapping:nn} \Arg{codeppoint} \Arg{replacement}
-% \cs{text_declare_lowercase_mapping:nnn} \Arg{BCP-47} \Arg{codeppoint} \Arg{replacement}
+% \cs{text_declare_lowercase_mapping:nn} \Arg{codepoint} \Arg{replacement}
+% \cs{text_declare_lowercase_mapping:nnn} \Arg{BCP-47} \Arg{codepoint} \Arg{replacement}
% \end{syntax}
% Declares that the \meta{replacement} tokens should be used when case mapping
% the \meta{codepoint}, rather than the standard mapping given in the
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3tl-analysis.dtx b/Master/texmf-dist/source/latex/l3kernel/l3tl-analysis.dtx
index 4df9ee68a3d..aa4ccae2879 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3tl-analysis.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3tl-analysis.dtx
@@ -44,7 +44,7 @@
% }^^A
% }
%
-% \date{Released 2024-05-27}
+% \date{Released 2024-08-16}
%
% \maketitle
%
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3tl-build.dtx b/Master/texmf-dist/source/latex/l3kernel/l3tl-build.dtx
index 6cd9822ad24..a1e5b27ec86 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3tl-build.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3tl-build.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2024-05-27}
+% \date{Released 2024-08-16}
%
% \maketitle
%
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3tl.dtx b/Master/texmf-dist/source/latex/l3kernel/l3tl.dtx
index 71d68d532cf..2c8de13fd33 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3tl.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3tl.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2024-05-27}
+% \date{Released 2024-08-16}
%
% \maketitle
%
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3token.dtx b/Master/texmf-dist/source/latex/l3kernel/l3token.dtx
index 03bf46b1016..cf0f9981032 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3token.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3token.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2024-05-27}
+% \date{Released 2024-08-16}
%
% \maketitle
%
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3unicode.dtx b/Master/texmf-dist/source/latex/l3kernel/l3unicode.dtx
index 179817d4900..89450e18feb 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3unicode.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3unicode.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2024-05-27}
+% \date{Released 2024-08-16}
%
% \maketitle
%
diff --git a/Master/texmf-dist/source/latex/l3packages/l3keys2e/l3keys2e.dtx b/Master/texmf-dist/source/latex/l3packages/l3keys2e/l3keys2e.dtx
index 2e5c419165a..e8f64160126 100644
--- a/Master/texmf-dist/source/latex/l3packages/l3keys2e/l3keys2e.dtx
+++ b/Master/texmf-dist/source/latex/l3packages/l3keys2e/l3keys2e.dtx
@@ -62,7 +62,7 @@
% }^^A
% }
%
-% \date{Released 2024-05-08}
+% \date{Released 2024-08-16}
%
% \maketitle
%
@@ -154,7 +154,7 @@
% \end{macrocode}
%
% \begin{macrocode}
-\ProvidesExplPackage{l3keys2e}{2024-05-08}{}
+\ProvidesExplPackage{l3keys2e}{2024-08-16}{}
{LaTeX2e option processing using LaTeX3 keys}
% \end{macrocode}
%
diff --git a/Master/texmf-dist/source/latex/l3packages/xfp/xfp.dtx b/Master/texmf-dist/source/latex/l3packages/xfp/xfp.dtx
index fe8dcd51b1d..6e95e429015 100644
--- a/Master/texmf-dist/source/latex/l3packages/xfp/xfp.dtx
+++ b/Master/texmf-dist/source/latex/l3packages/xfp/xfp.dtx
@@ -63,7 +63,7 @@
% }^^A
% }
%
-% \date{Released 2024-05-08}
+% \date{Released 2024-08-16}
%
% \maketitle
%
@@ -171,7 +171,7 @@
% \end{macrocode}
%
% \begin{macrocode}
-\ProvidesExplPackage{xfp}{2024-05-08}{}
+\ProvidesExplPackage{xfp}{2024-08-16}{}
{L3 Floating point unit}
% \end{macrocode}
%
diff --git a/Master/texmf-dist/source/latex/l3packages/xparse/xparse.dtx b/Master/texmf-dist/source/latex/l3packages/xparse/xparse.dtx
index 62ac19ff25d..ac0ee03d3fa 100644
--- a/Master/texmf-dist/source/latex/l3packages/xparse/xparse.dtx
+++ b/Master/texmf-dist/source/latex/l3packages/xparse/xparse.dtx
@@ -67,7 +67,7 @@
% }^^A
% }
%
-% \date{Released 2024-05-08}
+% \date{Released 2024-08-16}
%
% \maketitle
%
@@ -1079,7 +1079,7 @@
% \end{macrocode}
%
% \begin{macrocode}
-\ProvidesExplPackage{xparse}{2024-05-08}{}
+\ProvidesExplPackage{xparse}{2024-08-16}{}
{L3 Experimental document command parser}
% \end{macrocode}
%
@@ -1436,13 +1436,30 @@
%
% \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.
+% its second \enquote{item} is the argument specification unless the
+% command is optimised: in the latter case, we can reconstruct the
+% spec.
% \begin{macrocode}
\cs_gset_protected:Npn \@@_get_arg_spec:NTF #1#2#3
{
\__kernel_cmd_if_xparse:NTF #1
{
- \tl_set:Ne \ArgumentSpecification { \tl_item:Nn #1 { 2 } }
+ \tl_set:Ne \ArgumentSpecification
+ {
+ \exp_args:No \tl_if_head_eq_meaning:nNTF {#1} \@@_start_optimized:
+ {
+ \prg_replicate:nn
+ {
+ \str_count:e
+ {
+ \exp_args:Nc \cs_parameter_spec:N
+ { \cs_to_str:N #1 \c_space_tl code }
+ } / 2
+ }
+ { m }
+ }
+ { \tl_item:Nn #1 { 2 } }
+ }
#2
}
{#3}
diff --git a/Master/texmf-dist/source/latex/l3packages/xtemplate/xtemplate.dtx b/Master/texmf-dist/source/latex/l3packages/xtemplate/xtemplate.dtx
index 7d20c6142f1..17715905adc 100644
--- a/Master/texmf-dist/source/latex/l3packages/xtemplate/xtemplate.dtx
+++ b/Master/texmf-dist/source/latex/l3packages/xtemplate/xtemplate.dtx
@@ -46,7 +46,7 @@
% }^^A
% }
%
-% \date{Released 2024-05-08}
+% \date{Released 2024-08-16}
%
% \maketitle
%
@@ -704,7 +704,7 @@
\endinput
}
{%
- \ProvidesExplPackage{xtemplate}{2024-05-08}{}
+ \ProvidesExplPackage{xtemplate}{2024-08-16}{}
{L3 Experimental prototype document functions}
\long\protected\def\DeclareRestrictedTemplate#1#2#3#4{%
\DeclareTemplateCopy{#1}{#3}{#2}%
@@ -722,6 +722,7 @@
% \end{macro}
% \end{macro}
%
+% \begin{macrocode}
%</package>
% \end{macrocode}
%
diff --git a/Master/texmf-dist/source/latex/lastpage/lastpage.drv b/Master/texmf-dist/source/latex/lastpage/lastpage.drv
index 5125a755167..b58b4defae8 100644
--- a/Master/texmf-dist/source/latex/lastpage/lastpage.drv
+++ b/Master/texmf-dist/source/latex/lastpage/lastpage.drv
@@ -9,7 +9,7 @@
%% This is a generated file.
%%
%% Project: lastpage
-%% Version: 2024-04-27 v2.1a
+%% Version: 2024-07-07 v2.1c
%% Info: Refers to last page's name
%%
%% Copyright (C) 2010 - 2024 by
@@ -32,10 +32,9 @@
%%
%% This package was invented by Jeffrey P. Goldberg.
%% I thought that a replacement was needed and therefore created the pageslts package,
-%% https://ctan.org/pkg/pageslts
-%% . Nevertheless, for compatibility with existing documents/packages as well as for
-%% the low amount of resources needed by the lastpage package (no new counter!),
-%% I updated this package.
+%% https://ctan.org/pkg/pageslts. Nevertheless, for compatibility with existing
+%% documents/packages as well as for the low amount of resources needed by the
+%% lastpage package (no new counter!), I updated this package.
%% Thanks go to Jeffrey P. Goldberg for allowing me to do this.
%%
%% While this package allows for things like "Page slash thepage{} of slash pageref{LastPage}"
@@ -59,8 +58,8 @@
%%
\NeedsTeXFormat{LaTeX2e}[2023-11-01]
\ProvidesFile{lastpage.drv}%
- [2024-04-27 v2.1a Refers to last page's name (HMM)]
-\documentclass{ltxdoc}[2023/03/28]% v2.1j Standard LaTeX documentation class
+ [2024-07-07 v2.1c Refers to last page's name (HMM)]
+\documentclass{ltxdoc}[2024/02/08]% v2.1j Standard LaTeX documentation class
\usepackage{holtxdoc}[2019/12/09]% v0.30 Private additional ltxdoc support (HO)
\hypersetup{%
pdfsubject={Refers to last page's name (HMM; JPG)},%
diff --git a/Master/texmf-dist/source/latex/lastpage/lastpage.dtx b/Master/texmf-dist/source/latex/lastpage/lastpage.dtx
index 104d6b84187..c447d39cc60 100644
--- a/Master/texmf-dist/source/latex/lastpage/lastpage.dtx
+++ b/Master/texmf-dist/source/latex/lastpage/lastpage.dtx
@@ -1,7 +1,7 @@
% \iffalse meta-comment
%
% File: lastpage.dtx
-% Version: 2024-04-27 v2.1a
+% Version: 2024-07-07 v2.1c
% Info: Refers to last page's name
%
% Copyright © 2010 - 2024 by
@@ -65,7 +65,7 @@
\input docstrip.tex
\Msg{**********************************************************************}
\Msg{* Installation *}
-\Msg{* Package: lastpage 2024-04-27 v2.1a Refers to last page's name (HMM)*}
+\Msg{* Package: lastpage 2024-07-07 v2.1c Refers to last page's name (HMM)*}
\Msg{**********************************************************************}
\keepsilent
@@ -77,7 +77,7 @@
This is a generated file.
Project: lastpage
-Version: 2024-04-27 v2.1a
+Version: 2024-07-07 v2.1c
Info: Refers to last page's name
Copyright (C) 2010 - 2024 by
@@ -100,10 +100,9 @@ The Current Maintainer of this work is H.-Martin Muench.
This package was invented by Jeffrey P. Goldberg.
I thought that a replacement was needed and therefore created the pageslts package,
-https://ctan.org/pkg/pageslts
-. Nevertheless, for compatibility with existing documents/packages as well as for
-the low amount of resources needed by the lastpage package (no new counter!),
-I updated this package.
+https://ctan.org/pkg/pageslts. Nevertheless, for compatibility with existing
+documents/packages as well as for the low amount of resources needed by the
+lastpage package (no new counter!), I updated this package.
Thanks go to Jeffrey P. Goldberg for allowing me to do this.
While this package allows for things like "Page slash thepage{} of slash pageref{LastPage}"
@@ -185,8 +184,8 @@ In memoriam
%<*driver>
\NeedsTeXFormat{LaTeX2e}[2023-11-01]
\ProvidesFile{lastpage.drv}%
- [2024-04-27 v2.1a Refers to last page's name (HMM)]
-\documentclass{ltxdoc}[2023/03/28]% v2.1j Standard LaTeX documentation class
+ [2024-07-07 v2.1c Refers to last page's name (HMM)]
+\documentclass{ltxdoc}[2024/02/08]% v2.1j Standard LaTeX documentation class
\usepackage{holtxdoc}[2019/12/09]% v0.30 Private additional ltxdoc support (HO)
\hypersetup{%
pdfsubject={Refers to last page's name (HMM; JPG)},%
@@ -234,23 +233,23 @@ In memoriam
% \DoNotIndex{\@auxout,\@evenfoot,\@firstofone,\@firstoftwo,\@ifl@t@r,\@ifpackagelater,\@ifpackageloaded}
% \DoNotIndex{\@ifundefined,\@kernel@reserved@label@data,\@mainaux,\@number,\@oddfoot}
% \DoNotIndex{\addtocounter,\AddToHook,\arabic,\begin}
-% \DoNotIndex{\bigskip,\clearpage,\csname,\documentclass,\EdefUnescapeString,\empty,\end,\endcsname}
-% \DoNotIndex{\enddocument,\ExplSyntaxOff,\ExplSyntaxOn,\fmtversion}
+% \DoNotIndex{\bigskip,\clearpage,\csname,\detokenize,\documentclass,\EdefUnescapeString,\empty,\end}
+% \DoNotIndex{\endcsname,\enddocument,\expanded,\ExplSyntaxOff,\ExplSyntaxOn,\fmtversion}
% \DoNotIndex{\g,\gdef,\here,\hfil,\Hy@temp,\Hy@unicodefalse}
-% \DoNotIndex{\hypersetup,\if@filesw,\if@nobreak,\ifHy@hypertexnames,\ifHy@pageanchor,\ifHy@plainpages}
+% \DoNotIndex{\hypersetup,\if,\if@filesw,\if@nobreak,\ifHy@hypertexnames,\ifHy@pageanchor,\ifHy@plainpages}
% \DoNotIndex{\ifdim,\ifnum,\IfPackageAtLeastTF,\IfPackageLoadedTF,\ifvmode,\ifx,\immediate,\input}
% \DoNotIndex{\label,\lastpage,\lastpage-example.tex,\lastpage.dtx,\lastpage.sty,\lastpagee.sty}
% \DoNotIndex{\lastpageclassic.sty,\lastpagemodern.sty,\LaTeX,\LaTeX-kernel,\listfiles}
-% \DoNotIndex{\makeatletter,\makeatother,\markboth,\mbox,\message,\MessageBreak}
+% \DoNotIndex{\makeatletter,\makeatother,\markboth,\meaning,\mbox,\message,\MessageBreak}
% \DoNotIndex{\NeedsTeXFormat,\newcommand,\newcounter,\newline,\newpage,\nobreak}
% \DoNotIndex{\noindent,\normalsize,\numexpr,\origenddocument,\PackageError,\PackageWarning}
% \DoNotIndex{\PackageWarningNoLine,\pagenumbering,\pageref,\pdfstringdef,\protect,\ProvidesPackage}
% \DoNotIndex{\qquad,\RequirePackage,\section,\ShowHook,\slshape,\smallskip,\space,\test,\textbf}
% \DoNotIndex{\textit,\textquotedblleft,\textquotedblright,\textsf,\texttt,\the,\thepage}
-% \DoNotIndex{\today,\upshape,\url,\usepackage,\value,\verb,\wd,\write}
+% \DoNotIndex{\today,\upshape,\url,\usepackage,\value,\verb,\wd,\write,\xlastpage@rmpage,\xxlastpage@rmpage}
%
% \title{The \xpackage{lastpage} package}
-% \date{2024-04-27 v2.1a}
+% \date{2024-07-07 v2.1c}
% \author{H.-Martin Münch\\\xemail{Martin.Muench at Uni-Bonn.de}\\
% invented by Jeffrey P. Goldberg\\\xemail{jeffrey+news at goldmark.org}}
%
@@ -559,6 +558,18 @@ In memoriam
% but |\lastpage@putlabel| was replaced by |\lastpage@putl@bel|.
% Because \linebreak |\lastpage@putlabel| is no longer called, now there should not be any
% double definitions of the \texttt{lastpage} label.
+%
+% \subsection{\texttt{\textbackslash pagenumbering\{fnsymbol\}}}
+% When using the foot-note-symbols as page numbers,
+% it can be necessary to declare in the document's preamble:
+% \begin{verbatim}
+% \DeclareTextCommand{\textasteriskcentered}{PD1}{*}
+% \DeclareTextCommand{\textdagger}{PD1}{†}
+% %\DeclareTextCommand{\textdaggerdbl}{PD1}{‡)% seems to neither work nor be necessary
+% \DeclareTextCommand{\textsection}{PD1}{§}
+% \DeclareTextCommand{\textparagraph}{PD1}{¶}
+% \DeclareTextCommand{\textbardbl}{PD1}{‖}
+% \end{verbatim}
% \newpage
%
% \section{Alternatives\label{sec:Alternatives}}
@@ -574,7 +585,7 @@ In memoriam
% \textbf{Note: The current version 2015/12/21 v1.2f of the \pkg{pageslts} package
% has not yet been updated to the new hook mechanism. In special cases (for example }%
% |\pagenumbering{fnsymbol}|\textbf{) the current version of that package combined
-% with a current \LaTeX-format fails. Together with about 80~other packages
+% with a current \LaTeX-format fails. Together with several other packages
% (small to large, public as well as private, some probably obsolete) it is
% in the update queue.}\newline
% The \xpackage{pageslts} package first started as a revision of this
@@ -723,17 +734,17 @@ In memoriam
%
% \begin{macrocode}
%<*example>
-\documentclass[british]{article}[2023/05/17]% v1.4n Standard LaTeX document class
+\documentclass[british]{article}[2024/02/08]% v1.4n Standard LaTeX document class
\makeatletter
\@ifl@t@r\fmtversion{2022/11/01}{%
\AddToHook{enddocument/afterlastpage}[lastpage]{%
\message{^^JLaTeX Info: Executing hook `enddocument/afterlastpage'.}}%
}{\AtEndDocument{\message{^^JLaTeX Info: Executing hook `AtEndDocument'.}}%
}
-\usepackage[draft]{showkeys}[2023/07/08]% v3.19 Show cite and label keys (DPC, MH)
+\usepackage[draft]{showkeys}[2024/05/23]% v3.21 Show cite and label keys (DPC, MH)
%% Use final instead of draft to hide the keys. %%
\usepackage[pdfpagelabels=true,hyperindex=false]{hyperref}[2024-01-20]% v7.01h
-%% Hypertext links for LaTeX
+\@ifpackageloaded{hyperref}{% Hypertext links for LaTeX
\hypersetup{extension=pdf,%
plainpages=false,%
pdflang={en},%
@@ -744,9 +755,8 @@ In memoriam
pdfview=Fit,%
pdfstartview=Fit,%
pdfpagelayout=SinglePage%
-}
-\@ifpackageloaded{hyperref}{}{\usepackage{url}[2013/09/16]}% v3.4
-\usepackage{lastpage}[2024/04/27]% v2.1a
+}}{\usepackage{url}[2013/09/16]}% v3.4
+\usepackage{lastpage}[2024/07/07]% v2.1c
\renewcommand{\@evenfoot}{%
\normalsize\slshape \today\hfil \upshape %
page \thepage{} of \pageref{LastPage}}
@@ -758,7 +768,7 @@ In memoriam
\section*{Example for lastpage}
\markboth{Example for lastpage}{Example for lastpage}
This example demonstrates the use of package\newline
-\textsf{lastpage}, v2.1a as of 2024-04-27 (HMM; JPG).\newline
+\textsf{lastpage}, v2.1c as of 2024-07-07 (HMM; JPG).\newline
The package takes no options.\newline
For more details please see the documentation!\newline
@@ -783,7 +793,7 @@ trademark owner. There is no intention of infringement; the
usage is to the benefit of the trademark owner.\newline
\textbf{Tip}: Use \textit{logical page numbers}
-for the display of the pdf (in Adobe Acrobat Reader 2024.002.20687:
+for the display of the pdf (in Adobe Acrobat Reader 2024.002.20895:
Edit $>$ Preferences $>$ Page Display $>$
Page Content and Information: Use logical page numbers)!\newline
@@ -837,8 +847,8 @@ The code does not generally work even without hyperref.
\end{verbatim}
\end{quote}
-\noindent does work, because \verb|\lastpage@lastpage| contains the name
-of the page, \mbox{example:}
+\noindent does work (two compilations needed), because \verb|\lastpage@lastpage|
+contains the name of the page, \mbox{example:}
\begin{verbatim}
Page \thepage{} is (not) page \makeatletter\lastpage@lastpage\makeatother.
\end{verbatim}
@@ -894,7 +904,7 @@ To see the content of the \texttt{enddocument/afterlastpage}-hook
% \DescribeMacro{lastpage.sty}
% We first need to determine whether we are on \TeX~2.09 or \LaTeX2e.\newline
% (That line, which is too long for the documentation, reads:\newline
-% |\def\loadlastpage{\ProvidesPackage{lastpage}[2024/04/27 v2.1a lastpage:|\linebreak
+% |\def\loadlastpage{\ProvidesPackage{lastpage}[2024/07/07 v2.1c lastpage:|\linebreak
% | 2.09 or 2e? (HMM)]\relax\RequirePackage{lastpage2e}}|.)
%
% \begin{macrocode}
@@ -902,7 +912,7 @@ To see the content of the \texttt{enddocument/afterlastpage}-hook
%% Part of the "lastpage" package
%% loads either lastpage2.09.sty for TeX 2.09 or lastpage2e.sty for LaTeX 2e
%% with code from https://groups.google.com/g/comp.text.tex/c/-Qmhj1ZI4xM
-\def\loadlastpage{\ProvidesPackage{lastpage}[2024/04/27 v2.1a lastpage: 2.09 or 2e? (HMM)]\relax\RequirePackage{lastpage2e}}
+\def\loadlastpage{\ProvidesPackage{lastpage}[2024/07/07 v2.1c lastpage: 2.09 or 2e? (HMM)]\relax\RequirePackage{lastpage2e}}
\begingroup \expandafter \ifx \csname documentclass\endcsname\relax
\endgroup \expandafter \input{lastpage209.sty}
\else \endgroup \expandafter \loadlastpage
@@ -942,7 +952,7 @@ To see the content of the \texttt{enddocument/afterlastpage}-hook
%<*lastpage2e>
%% Part of the "lastpage" package
\NeedsTeXFormat{LaTeX2e}[1994/12/01]
-\ProvidesPackage{lastpage2e}[2024/04/27 v2.1a %
+\ProvidesPackage{lastpage2e}[2024/07/07 v2.1c %
Decide which 2e lastpage version to use (HMM)]
\@ifl@t@r\fmtversion{2023/06/01}{\RequirePackage{lastpagemodern}}{%
\RequirePackage{lastpageclassic}}
@@ -957,7 +967,7 @@ To see the content of the \texttt{enddocument/afterlastpage}-hook
%<*lastpageclassic>
%% Part of the "lastpage" package
\NeedsTeXFormat{LaTeX2e}[1994/12/01]
-\ProvidesPackage{lastpageclassic}[2024/04/27 v2.1a %
+\ProvidesPackage{lastpageclassic}[2024/07/07 v2.1c %
Refers to last page's name (HMM; JPG)]
%% allows for things like "Page \thepage{} of \pageref{LastPage}"
%% to get "Page 7 of 9"
@@ -1375,7 +1385,7 @@ To see the content of the \texttt{enddocument/afterlastpage}-hook
%<*lastpagemodern>
%% Part of the "lastpage" package
\NeedsTeXFormat{LaTeX2e}[2023-06-01]
-\ProvidesPackage{lastpagemodern}[2024-04-27 v2.1a %
+\ProvidesPackage{lastpagemodern}[2024-07-07 v2.1c %
Refers to last page's name (HMM; JPG)]
%% allows for things like "Page \thepage{} of \pageref{LastPage}"
%% to get "Page 7 of 9" or "Page VII of IX";
@@ -1463,14 +1473,69 @@ To see the content of the \texttt{enddocument/afterlastpage}-hook
% \end{macrocode}
% \end{macro}
%
+% \begin{macro}{\lastpage@makeHy}
+% Just once we need the page from |\@currentHpage| without any \mbox{\textquotedblleft |page.|\textquotedblright :}
+% \begin{macrocode}
+\newcommand{\lastpage@makeHy}{%
+ \gdef\lastpage@Hy{}%
+ \IfPackageLoadedTF{hyperref}{%
+ \ifHy@pageanchor%
+ \@ifundefined{@currentHpage}{%
+ \PackageError{lastpage}{%
+ Kernel command \string\@currentHpage\space is undefined}{%
+ Please contact the lastpage maintainer.}%
+% \end{macrocode}
+% |\gdef\lastpage@Hy{}|, but that was already done at the beginning of this command.
+% \begin{macrocode}
+ }{\xdef\lastpage@Hptest{Doc-Start}%
+ \ifx\lastpage@Hptest\@currentHpage\relax%
+ \gdef\lastpage@Hy{\@currentHpage}%
+ \else%
+ \edef\lastpage@Hptest{\@currentHpage}%
+ \ifx\lastpage@Hptest\empty\relax%
+% \end{macrocode}
+% |\gdef\lastpage@Hy{}|, but that was already done at the beginning of this command.
+% \begin{macrocode}
+ \else%
+% \end{macrocode}
+% |\@currentHpage| should be |page.<some number>|, |\lastpage@rmpage| removes the
+% \mbox{\textquotedblleft |page.|\textquotedblright .} Next compilation run,
+% |\lastpage@lastpageHy| gets defined via the \xfile{aux} file.
+% If we arrived at this place, but the definition is still empty,
+% then |\@currentHpage| has some unexpected content.
+% \begin{macrocode}
+ \gdef\lastpage@Hy{\lastpage@rmpage{\@currentHpage}}%
+ \ifx\lastpage@lastpageHy\empty\relax%
+ \PackageWarningNoLine{lastpage}{%
+ \string\@currentHpage\space is\MessageBreak%
+ \meaning\@currentHpage\MessageBreak%
+ not beginning with "page.",\MessageBreak%
+ \string\lastpage@lastpageHy\space is now let empty.}%
+ \fi%
+ \fi%
+ \fi%
+ }%
+ \fi%
+ }{}%
+ }%
+
+% \end{macrocode}
+% \end{macro}
% \begin{macro}{\lastpage@rmpage}
-% Just once we need |\@currentHpage| without the \mbox{\textquotedblleft |page.|\textquotedblright :}
+% |\lastpage@rmpage| removes the \mbox{\textquotedblleft |page.|\textquotedblright.}
+%
% \begin{macrocode}
-%% similar to https://tex.stackexchange.com/a/12811/6865
-\def\lastpage@rmpage#1{\expandafter\lastpage@currentH#1\relax}
-\def\lastpage@currentH#1.#2\relax{#2}
+%% Code provided by David Carlisle at https://tex.stackexchange.com/a/721877
+\def\lastpage@rmpage#1{%
+ \expandafter\xlastpage@rmpage\expanded{#1}\xlastpage@rmpage page.%
+ \xlastpage@rmpage\xxlastpage@rmpage{#1}}
+\def\xlastpage@rmpage #1page.#2\xlastpage@rmpage#3\xxlastpage@rmpage#4{%
+ \if$\detokenize{#1}$#2%\else#4
+ \fi}
% \end{macrocode}
+% |\else#4| means, that it did not start with |page.|, and whatever it is,
+% we cannot use this |#4| for |\lastpage@Hy|.
% \end{macro}
% \begin{macro}{\lastpage@putl@bel}
% \indent This command does the writing of the label.
@@ -1529,15 +1594,13 @@ To see the content of the \texttt{enddocument/afterlastpage}-hook
{\@kernel@reserved@label@data}}%
}%
% \end{macrocode}
-% \pagebreak
% \noindent We also save the values, so that we can later (next rerun) check,
% whether they have been saved in the \xfile{aux} file.
%
% \begin{macrocode}
\protected@iwrite\@auxout{}{%
\string\gdef\string\lastpage@lastpage{\thepage}}%
- \gdef\lastpage@Hy{\IfPackageLoadedTF{hyperref}{%
- \ifHy@pageanchor\lastpage@rmpage{\@currentHpage}\fi}{}}%
+ \lastpage@makeHy%
\protected@iwrite\@auxout{}{%
\string\gdef\string\lastpage@lastpageHy{\lastpage@Hy}}%
% \end{macrocode}
@@ -1553,7 +1616,7 @@ To see the content of the \texttt{enddocument/afterlastpage}-hook
% \end{macrocode}
% \end{macro}
-%
+%\pagebreak
% \begin{macro}{\lastpage@fileswtest}
% \indent \hspace*{2em}Later it will be determined whether it is allowed to write
% to the \xfile{aux} file. If it was \emph{not} allowed, it is checked
@@ -1679,7 +1742,7 @@ To see the content of the \texttt{enddocument/afterlastpage}-hook
% \begin{description}
% \item[-] \TeX Format \LaTeXe{}: \url{https://www.CTAN.org}
%
-% \item[-] document class \xclass{ltxdoc}, 2023/03/28, v2.1j,
+% \item[-] document class \xclass{ltxdoc}, 2024/02/08, v2.1j,
% \url{https://ctan.org/pkg/ltxdoc}
%
% \item[-] package \xpackage{holtxdoc}, 2019/12/09, v0.30,
@@ -1692,7 +1755,7 @@ To see the content of the \texttt{enddocument/afterlastpage}-hook
% \begin{description}
% \item[-] \TeX, \url{https://www.CTAN.org}
%
-% \item[-] package \xpackage{lastpage}, 2024-04-27, v2.1a,
+% \item[-] package \xpackage{lastpage}, 2024-07-07, v2.1c,
% \url{https://ctan.org/pkg/lastpage}
% \end{description}
%
@@ -1702,7 +1765,7 @@ To see the content of the \texttt{enddocument/afterlastpage}-hook
% \begin{description}
% \item[-] \TeX-format \LaTeX{}, v2.09
%
-% \item[-] package \xpackage{lastpage209}, 2024-04-27, v2.1a,
+% \item[-] package \xpackage{lastpage209}, 2024-07-07, v2.1c,
% \url{https://ctan.org/pkg/lastpage}
% \end{description}
% and does not work with \xpackage{hyperref}, which needs \LaTeX2e{}.\smallskip
@@ -1714,7 +1777,7 @@ To see the content of the \texttt{enddocument/afterlastpage}-hook
% \item[-] \TeX-format \LaTeXe{} 1994/12/01 or newer,
% \url{https://www.CTAN.org}
%
-% \item[-] package \xpackage{lastpage}, 2024-04-27, v2.1a,
+% \item[-] package \xpackage{lastpage}, 2024-07-07, v2.1c,
% \url{https://ctan.org/pkg/lastpage}
% \end{description}
%
@@ -1725,7 +1788,7 @@ To see the content of the \texttt{enddocument/afterlastpage}-hook
% \item[-] \TeX-format \LaTeXe{} between 1994/12/01 and 2023-05-31,\newline
% \url{https://www.CTAN.org}
%
-% \item[-] package \xpackage{lastpage}, 2024-04-27, v2.1a,
+% \item[-] package \xpackage{lastpage}, 2024-07-07, v2.1c,
% \url{https://ctan.org/pkg/lastpage}
% \end{description}
% and can use
@@ -1742,13 +1805,13 @@ To see the content of the \texttt{enddocument/afterlastpage}-hook
% \item[-] \TeX-format \LaTeXe{} 2023-06-01 or newer,\newline
% \url{https://www.CTAN.org}
%
-% \item[-] package \xpackage{lastpage}, 2024-04-27, v2.1a,
+% \item[-] package \xpackage{lastpage}, 2024-07-07, v2.1c,
% \url{https://ctan.org/pkg/lastpage}
% \end{description}
% and can use
% \begin{description}
% \item[-] package \xpackage{hyperref}, 2023-11-07 and newer
-% (tested with: 2024-01-20, v7.01h),
+% (tested with: 2024-05-23, v7.01i),
% \url{https://ctan.org/pkg/hyperref}
% \end{description}
% \pagebreak
@@ -1757,7 +1820,7 @@ To see the content of the \texttt{enddocument/afterlastpage}-hook
% The |lastpage-example.tex| requires the same file as all
% documents using the \xpackage{lastpage} package, i.\,e.
% \begin{description}
-% \item[-] package \xpackage{lastpage}, 2024-04-27, v2.1a,
+% \item[-] package \xpackage{lastpage}, 2024-07-07, v2.1c,
% \url{https://ctan.org/pkg/lastpage}\newline
% (Well, it is the example file for this package, and because you are reading the
% documentation for the \xpackage{lastpage} package, it can be assumed that you already
@@ -1765,13 +1828,13 @@ To see the content of the \texttt{enddocument/afterlastpage}-hook
% \end{description}
% and additionally:
% \begin{description}
-% \item[-] class \xpackage{article}, 2023-05-17, v1.4n, from \xpackage{classes}:
+% \item[-] class \xpackage{article}, 2024-02-08, v1.4n, from \xpackage{classes}:
% \url{https://ctan.org/pkg/classes}
%
-% \item[-] package \xpackage{showkeys}, 2023-07-08, v3.19,
+% \item[-] package \xpackage{showkeys}, 2024-05-23, v3.21,
% \url{https://ctan.org/pkg/showkeys}
%
-% \item[-] package \xpackage{hyperref}, 2024-01-20, v7.01h,
+% \item[-] package \xpackage{hyperref}, 2024-05-23, v7.01i,
% \url{https://ctan.org/pkg/hyperref}
% \end{description}
%
@@ -2038,7 +2101,8 @@ To see the content of the \texttt{enddocument/afterlastpage}-hook
% to update it. Further I would like to thank \textsc{Heiko Oberdiek}
% for providing a~lot~(!) of useful packages (from which I also learned everything
% I know about creating a file in \xfile{dtx} format, OK, say it: copying).
-% Thanks for bug reports go to \textsc{Ulrike Fischer} (twice),
+% Thanks to \textsc{David Carlisle} for the new code for |\lastpage@rmpage|.
+% Thanks for bug reports go to \textsc{Ulrike Fischer} (several times),
% \textsc{Sebastian Bank}, \textsc{James Hedges}, \textsc{Mikhail Titov},
% \textsc{Micha\l{} Herman}, \textsc{Matteo Gamboz}, and \textsc{James Small}.
% Thanks to \textsc{Sven Siegmund} for pointing out a necessary further
@@ -2219,8 +2283,7 @@ To see the content of the \texttt{enddocument/afterlastpage}-hook
% \item Replaced |\immediate\write| by a form of (pseudo-code!) |\immediate\protected@write|.
% (Thanks to \textsc{Ulrike Fischer} for the error report and solution!)
% \item Update of the |\lastpage@putl@bel| code to \pkg{hyperref} 2023-07-08, v7.01b,
-% which now allows fnsymbol as page numbering scheme (while links to, for example,
-% a page named $\|$ still do not work).
+% which now allows fnsymbol as page numbering scheme.
% \end{Version}
% \begin{Version}{2023-10-06 v2.0d}
% \item For plain arabic page numbers only, \pkg{lastpage} again writes the page number
@@ -2237,6 +2300,16 @@ To see the content of the \texttt{enddocument/afterlastpage}-hook
% \item |\lastpage@IfNumericTF| is no longer needed, but has not been removed
% so as not to break older documents that use it in a different context.
% \end{Version}
+% \begin{Version}{2024-07-03 v2.1b}
+% \item The \xclass{beamer} class loads \xpackage{hyperref} partially,
+% so that \xpackage{hyperref} is incorrectly detected as having been loaded.
+% The defining operation for |\lastpage@Hy| has been changed to catch this
+% and other different cases.
+% \end{Version}
+% \begin{Version}{2024-07-07 v2.1c}
+% \item With help from \textsc{David Carlisle} |\lastpage@rmpage| no longer assumes
+% |\@currentHpage| to begin with |page.|.
+% \end{Version}
% \end{History}
% \bigskip
%
diff --git a/Master/texmf-dist/source/latex/lastpage/lastpage.ins b/Master/texmf-dist/source/latex/lastpage/lastpage.ins
index e39cb80cbef..120709843e4 100644
--- a/Master/texmf-dist/source/latex/lastpage/lastpage.ins
+++ b/Master/texmf-dist/source/latex/lastpage/lastpage.ins
@@ -9,7 +9,7 @@
%% This is a generated file.
%%
%% Project: lastpage
-%% Version: 2024-04-27 v2.1a
+%% Version: 2024-07-07 v2.1c
%% Info: Refers to last page's name
%%
%% Copyright (C) 2010 - 2024 by
@@ -32,10 +32,9 @@
%%
%% This package was invented by Jeffrey P. Goldberg.
%% I thought that a replacement was needed and therefore created the pageslts package,
-%% https://ctan.org/pkg/pageslts
-%% . Nevertheless, for compatibility with existing documents/packages as well as for
-%% the low amount of resources needed by the lastpage package (no new counter!),
-%% I updated this package.
+%% https://ctan.org/pkg/pageslts. Nevertheless, for compatibility with existing
+%% documents/packages as well as for the low amount of resources needed by the
+%% lastpage package (no new counter!), I updated this package.
%% Thanks go to Jeffrey P. Goldberg for allowing me to do this.
%%
%% While this package allows for things like "Page slash thepage{} of slash pageref{LastPage}"
@@ -60,7 +59,7 @@
\input docstrip.tex
\Msg{**********************************************************************}
\Msg{* Installation *}
-\Msg{* Package: lastpage 2024-04-27 v2.1a Refers to last page's name (HMM)*}
+\Msg{* Package: lastpage 2024-07-07 v2.1c Refers to last page's name (HMM)*}
\Msg{**********************************************************************}
\keepsilent
@@ -72,7 +71,7 @@
This is a generated file.
Project: lastpage
-Version: 2024-04-27 v2.1a
+Version: 2024-07-07 v2.1c
Info: Refers to last page's name
Copyright (C) 2010 - 2024 by
@@ -95,10 +94,9 @@ The Current Maintainer of this work is H.-Martin Muench.
This package was invented by Jeffrey P. Goldberg.
I thought that a replacement was needed and therefore created the pageslts package,
-https://ctan.org/pkg/pageslts
-. Nevertheless, for compatibility with existing documents/packages as well as for
-the low amount of resources needed by the lastpage package (no new counter!),
-I updated this package.
+https://ctan.org/pkg/pageslts. Nevertheless, for compatibility with existing
+documents/packages as well as for the low amount of resources needed by the
+lastpage package (no new counter!), I updated this package.
Thanks go to Jeffrey P. Goldberg for allowing me to do this.
While this package allows for things like "Page slash thepage{} of slash pageref{LastPage}"
diff --git a/Master/texmf-dist/source/latex/lettrine/lettrine.dtx b/Master/texmf-dist/source/latex/lettrine/lettrine.dtx
index c4bf9472c53..e6df6e3b70c 100644
--- a/Master/texmf-dist/source/latex/lettrine/lettrine.dtx
+++ b/Master/texmf-dist/source/latex/lettrine/lettrine.dtx
@@ -107,7 +107,7 @@
\ProvidesFile{lettrine.dtx}
%</dtx>
%<*sty|dtx>
- [2024-01-20 v2.60 (Daniel Flipo)]
+ [2024-06-26 v2.61 (Daniel Flipo)]
%</sty|dtx>
% \fi
%
@@ -314,9 +314,6 @@
% \item |\LettrineImagefalse|,
% \item |\LettrineOnGridfalse|,
% \item |\LettrineRealHeightfalse|,
-% \item |\renewcommand*{\LettrineTextFont}{\scshape}|,
-% \item |\renewcommand*{\LettrineTestString}{EFTZ}|,
-% \item |\renewcommand*{\LettrineSecondString}{x}|,
% \item |\renewcommand{\DefaultOptionsFile}{optfile.cfl}|.
% \end{itemize}
%
@@ -336,6 +333,14 @@
% file will be overridden by the optional arguments eventually given
% to the |\lettrine| command.
%
+% More customisation possibilities are offered by the next four
+% commands:
+% \begin{itemize}
+% \item |\renewcommand*{\LettrineFontHook}{}|,
+% \item |\renewcommand*{\LettrineTextFont}{\scshape}|,
+% \item |\renewcommand*{\LettrineTestString}{EFTZ}|,
+% \item |\renewcommand*{\LettrineSecondString}{x}|,
+% \end{itemize}
% |\LettrineTextFont| sets the font used for the second argument
% of |\lettrine|, its default definition is
% |\newcommand{\LettrineTextFont}{\scshape}| (second argument in
@@ -376,6 +381,8 @@
% all initials in a (part of) document:
% |\renewcommand{\LettrineFontHook}{\color[gray]{0.5}}| \\
% will colour the initials following this command in grey.
+% A |\color| command can be added in |\LettrineTextHook| if the text
+% following the dropped cap requires the same or another colour.
%
% \changes{v1.3}{2002/08/23}{Correct the documentation to
% mention the cm-super fonts and the type1ec package by
@@ -452,6 +459,10 @@
% environments but does not work within `center’ environments
% except with option \texttt{[lines=1]}.
% \item |\lettrine| does not work within lists.
+% \item If |\lettrine| is used inside any environment, it is
+% \emph{mandatory} to end the paragraph starting with the dropped
+% capital \emph{inside} the environment; adding a |\par| command
+% before the end of environment usually fixes placement issues.
% \item The LaTeX |\raggedright| command doesn’t work well with the
% TeX |\parshape| command used internally by |\lettrine|.
% Please use the |\RaggedRight| command from the \pkg{ragged2e}
@@ -668,10 +679,10 @@
{
lines.code = \setcounter{L@lines}{#1} ,
depth.code = \setcounter{L@depth}{#1} ,
- lhang.code = \renewcommand*{\L@hang}{#1} ,
- loversize.code = \renewcommand*{\L@oversize}{#1} ,
- lraise.code = \renewcommand*{\L@raise}{#1} ,
- ante.code = \renewcommand*{\L@ante}{#1} ,
+ lhang.store = \L@hang ,
+ loversize.store = \L@oversize ,
+ lraise.store = \L@raise ,
+ ante.store = \L@ante ,
findent.code = \setlength{\L@Findent}{#1} ,
nindent.code = \setlength{\L@Nindent}{#1} ,
slope.code = \setlength{\L@slope}{#1} ,
@@ -1166,10 +1177,13 @@
% dropped cap, add a \cs{rule} to mimic its height above the baseline
% instead.}
%
+% \changes{v2.61}{2024/06/26}{Include the `ante’ box into the \cs{smash}
+% command in case it is shifted down.}
+%
% Write the dropped capital into the left margin, and wrap
% the rest of paragraph around it.
% \begin{macrocode}
- \llap{\mbox{\L@ante}\smash{\raisebox{\L@lraise}{\usebox{\L@lbox}}}%
+ \llap{\smash{\mbox{\L@ante}\raisebox{\L@lraise}{\usebox{\L@lbox}}}%
\ifL@grid\else\rule{0pt}{\L@ruleht}\fi
\hskip \the\L@Findent}%
\unhcopy\L@tbox\relax
diff --git a/Master/texmf-dist/source/latex/lni/lni.dtx b/Master/texmf-dist/source/latex/lni/lni.dtx
index 20261238d4e..b5699cbac66 100644
--- a/Master/texmf-dist/source/latex/lni/lni.dtx
+++ b/Master/texmf-dist/source/latex/lni/lni.dtx
@@ -134,7 +134,7 @@ This work consists of the file lni.dtx
%<class>\NeedsTeXFormat{LaTeX2e}[1999/12/01]
%<class>\ProvidesClass{lni}
%<*class>
- [2024/01/08 v1.8.1 Official class for submissions to the ``Lecture Notes
+ [2024/07/23 v1.10 Official class for submissions to the ``Lecture Notes
in Informatics'']
%</class>
%<*driver>
@@ -286,6 +286,9 @@ This work consists of the file lni.dtx
% \changes{v1.8}{2022/06/10}{Fix output error in bst files (#97)}
% \changes{v1.8}{2022/11/25}{Make class compatable with latest publisher requirements (#121)}
% \changes{v1.8}{2022/11/25}{Make usage of `hyperref` mandatory (#131)}
+% \changes{v1.9}{2024/07/01}{Support multiple affiliations (#158)}
+% \changes{v1.10}{2024/07/01}{Change font for URLs to text font and change footnote numbers to superscript}
+% \changes{v1.10}{2024/07/23}{Fix support multiple affiliations (#173)}
%
% \GetFileInfo{\jobname.dtx}
% \DoNotIndex{\newcommand,\newenvironment}
@@ -489,12 +492,13 @@ This work consists of the file lni.dtx
% \cs{affil\oarg{number}\marg{information}} where you can use
% \texttt{\textbackslash\textbackslash} to split the address.
% \begin{examplecode}[label={lst:author}]
-% \author[1]{Firstname1 Lastname1}{firstname1.lastname1@affiliation1.org}{0000-0000-0000-0000}
+% \author[1,2]{Firstname1 Lastname1}{firstname1.lastname1@affiliation1.org}{0000-0000-0000-0000}
% \author[2]{Firstname2 Lastname2}{firstname2.lastname2@affiliation2.org}{0000-0000-0000-0000}
-% \author[1]{Firstname3 Lastname3}{firstname3.lastname3@affiliation1.org}{0000-0000-0000-0000}
+% \author[3]{Firstname3 Lastname3}{firstname3.lastname3@affiliation1.org}{0000-0000-0000-0000}
% \author[1]{Firstname4 Lastname4}{firstname4.lastname4@affiliation1.org}{0000-0000-0000-0000}%
-% \affil[1]{Universität\\Abteilung\\Straße\\Postleitzahl Ort\\Land}
-% \affil[2]{University\\Department\\Address\\Country}
+% \affil[1]{Universität 1\\Abteilung\\Straße\\Postleitzahl Ort\\Land}
+% \affil[2]{University 2 \\Department\\Address\\Country}
+% \affil[3]{University 3\\Department\\Address\\Country}
% \end{examplecode}
%
% Leave the third and/or fourth argument empty if there is no email address and/or ORCID iD.
@@ -1044,7 +1048,7 @@ This work consists of the file lni.dtx
\RequirePackage[hang]{footmisc}
\setlength{\footnotemargin}{1em}
\long\def\@makefntext#1{%
- \def\@makefnmark{\rlap{\normalfont\@thefnmark}}%
+ \def\@makefnmark{\rlap{\normalfont\textsuperscript{\@thefnmark}}}%
\ifFN@hangfoot
\bgroup
\setbox\@tempboxa\hbox{%
@@ -1149,53 +1153,71 @@ This work consists of the file lni.dtx
\renewcommand\Authsep{, }
\renewcommand\Authands{\iflanguage{ngerman}{ und }{, and }}
\renewcommand\Authand{\iflanguage{ngerman}{ und }{ and }}
-\renewcommand{\AB@authnote}[1]{$^{\text{\mbox{\normalfont\footnotesize #1}}}$}
+\NewDocumentCommand{\multiaffil}{ >{\SplitList{,}} m m m}{%
+ \gdef\@currEmail{#2}
+ \gdef\@currOrcid{#3}
+ \ProcessList{#1}{\@multiaffil}
+}
+
+\newcommand{\@multiaffil}[1]{%
+ \ifcsundef{@emailsandorcids#1}{\csgdef{@emailsandorcids#1}{}}{}%
+ \ifcsempty{@emailsandorcids#1}%
+ {\protected@csxappto{@emailsandorcids#1}{%
+ \if\relax\@currEmail\relax\else\email{\@currEmail}\fi\if\relax\@currOrcid\relax\else,\ \orcid{\@currOrcid}\fi}}%
+ {\protected@csxappto{@emailsandorcids#1}{%
+ \if\relax\@currEmail\relax\else;\ \email{\@currEmail}\fi\if\relax\@currOrcid\relax\else,\ \orcid{\@currOrcid}\fi}}%
+}
+
\renewcommand\author[4][]{%
\ifnewaffil\addtocounter{affil}{1}%
\edef\AB@thenote{\arabic{affil}}%
\fi%
\if\relax#1\relax\def\AB@note{\AB@thenote}\else\def\AB@note{#1}%
- \ifcsundef{@emailsandorcids\AB@note}{\csgdef{@emailsandorcids\AB@note}{}}{}%
\setcounter{Maxaffil}{0}\fi
\ifnum\value{authors}=0\def\@firstauthor{#2}\fi
\ifnum\value{authors}>1\relax
- \@namedef{@sep\number\c@authors}{\Authsep}\fi
+ \@namedef{@sep\number\c@authors}{\Authsep}\fi
\addtocounter{authors}{1}%
\begingroup
- \let\protect\@unexpandable@protect \let\and\AB@pand
- \def\thanks{\protect\thanks}\def\footnote{\protect\footnote}%
- \@temptokena=\expandafter{\AB@authors}%
- \@temptokenb=\expandafter{\AB@authors}%
- {\def\\{\protect\\[\@affilsep]\protect\Affilfont
- \protect\AB@resetsep}%
- \xdef\AB@author{\AB@blk@and#2}%
- \ifnewaffil\gdef\AB@las{}\gdef\AB@lasx{\protect\Authand}\gdef\AB@as{}%
- \xdef\AB@authors{\the\@temptokena\AB@blk@and}%
- \else
- \xdef\AB@authors{\the\@temptokena\AB@as\AB@au@str}%
- \global\let\AB@las\AB@lasx\gdef\AB@lasx{\protect\Authands}%
- \gdef\AB@as{\Authsep}%
- \fi
- \gdef\AB@au@str{#2}}%
- \@temptokena=\expandafter{\AB@authlist}%
- \@temptokenb=\expandafter{\@authlisthead}%
- \let\\=\authorcr
- \xdef\AB@authlist{\the\@temptokena
- \protect\@nameuse{@sep\number\c@authors}%
- \protect\Authfont#2\if\relax#4\relax\else\,\orcidlink{#4}\fi\AB@authnote{\AB@note}}%
- \xdef\@authlisthead{\the\@temptokenb
- \protect\@nameuse{@sep\number\c@authors}%
- \protect\Authfont#2}%
+ \let\protect\@unexpandable@protect \let\and\AB@pand
+ \def\thanks{\protect\thanks}\def\footnote{\protect\footnote}%
+ \@temptokena=\expandafter{\AB@authors}%
+ \@temptokenb=\expandafter{\AB@authors}%
+ {\def\\{\protect\\[\@affilsep]\protect\Affilfont
+ \protect\AB@resetsep}%
+ \xdef\AB@author{\AB@blk@and#2}%
+ \ifnewaffil\gdef\AB@las{}\gdef\AB@lasx{\protect\Authand}\gdef\AB@as{}%
+ \xdef\AB@authors{\the\@temptokena\AB@blk@and}%
+ \else
+ \xdef\AB@authors{\the\@temptokena\AB@as\AB@au@str}%
+ \global\let\AB@las\AB@lasx\gdef\AB@lasx{\protect\Authands}%
+ \gdef\AB@as{\Authsep}%
+ \fi
+ \gdef\AB@au@str{#2}}%
+ \@temptokena=\expandafter{\AB@authlist}%
+ \@temptokenb=\expandafter{\@authlisthead}%
+ \let\\=\authorcr
+ \xdef\AB@authlist{\the\@temptokena
+ \protect\@nameuse{@sep\number\c@authors}%
+ \protect\Authfont#2\if\relax#4\relax\else\,\orcidlink{#4}\fi\AB@authnote{\AB@note}}%
+ \xdef\@authlisthead{\the\@temptokenb
+ \protect\@nameuse{@sep\number\c@authors}%
+ \protect\Authfont#2}%
\endgroup
\ifnum\value{authors}>2\relax
\@namedef{@sep\number\c@authors}{\Authands}\fi
+ \ifcsundef{@emailsandorcids\AB@note}{\csgdef{@emailsandorcids\AB@note}{}}{}%
+ \sbox\z@{\@tempcnta=0#1\relax}%
+ \expandafter\ifdim\wd\z@>\z@\relax
+ \multiaffil{#1}{#3}{#4}
+ \else
+ \ifcsundef{@emailsandorcids\AB@note}{\csgdef{@emailsandorcids\AB@note}{}}{}%
\ifcsempty{@emailsandorcids\AB@note}%
{\csgappto{@emailsandorcids\AB@note}{%
- \if\relax#3\relax\else\email{#3}\fi\if\relax#4\relax\else,\ \orcid{#4}\fi}%
- }%
+ \if\relax#3\relax\else\email{#3}\fi\if\relax#4\relax\else,\ \orcid{#4}\fi}}%
{\csgappto{@emailsandorcids\AB@note}{%
\if\relax#3\relax\else;\ \email{#3}\fi\if\relax#4\relax\else,\ \orcid{#4}\fi}}%
-
+ \fi%
\newaffilfalse
}
\renewcommand\@author{%
@@ -1529,6 +1551,7 @@ This work consists of the file lni.dtx
% \end{macrocode}
% \begin{macrocode}
\RequirePackage{url}
+\urlstyle{same}
% \end{macrocode}
% improve wrapping of URLs - hint by http://tex.stackexchange.com/a/10419/9075
% \begin{macrocode}
@@ -3071,12 +3094,13 @@ EXECUTE {end.bib}
\title[Ein Kurztitel]{Ein sehr langer Titel über mehrere Zeilen mit sehr vielen
Worten und noch mehr Buchstaben}
%% \subtitle{Untertitel / Subtitle} % if needed
-\author[1]{Firstname1 Lastname1}{firstname1.lastname1@affiliation1.org}{0000-0000-0000-0000}
-\author[2]{Firstname2 Lastname2}{firstname2.lastname2@affiliation2.org}{0000-0000-0000-0000}
-\author[1]{Firstname3 Lastname3}{firstname3.lastname3@affiliation1.org}{0000-0000-0000-0000}
-\author[1]{Firstname4 Lastname4}{firstname4.lastname4@affiliation1.org}{0000-0000-0000-0000}%
-\affil[1]{Universität\\Abteilung\\Straße\\Postleitzahl Ort\\Land}
-\affil[2]{University\\Department\\Address\\Country}
+ \author[1,2]{Firstname1 Lastname1}{firstname1.lastname1@affiliation1.org}{0000-0000-0000-0000}
+ \author[2]{Firstname2 Lastname2}{firstname2.lastname2@affiliation2.org}{0000-0000-0000-0000}
+ \author[3]{Firstname3 Lastname3}{firstname3.lastname3@affiliation1.org}{0000-0000-0000-0000}
+ \author[1]{Firstname4 Lastname4}{firstname4.lastname4@affiliation1.org}{0000-0000-0000-0000}%
+ \affil[1]{Universität 1\\Abteilung\\Straße\\Postleitzahl Ort\\Land}
+ \affil[2]{University 2 \\Department\\Address\\Country}
+ \affil[3]{University 3\\Department\\Address\\Country}
\maketitle
\begin{abstract}
diff --git a/Master/texmf-dist/source/latex/lstaddons/lstautogobble.dtx b/Master/texmf-dist/source/latex/lstaddons/lstautogobble.dtx
index f9d62cf8d3f..106034b6bbb 100644
--- a/Master/texmf-dist/source/latex/lstaddons/lstautogobble.dtx
+++ b/Master/texmf-dist/source/latex/lstaddons/lstautogobble.dtx
@@ -1,6 +1,6 @@
% \iffalse meta-comment
%<=*COPYRIGHT>
-%% Copyright (C) 2011-2012 by Martin Scharrer <martin@scharrer-online.de>
+%% Copyright (c) 2011-2022 by Martin Scharrer <martin.scharrer@web.de>
%% -----------------------------------------------------------------------
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either version 1.3
@@ -69,9 +69,9 @@
%
% \GetFileInfo{lstautogobble.dtx}
% \author{Martin Scharrer}
-% \email{martin@scharrer-online.de}
+% \email{martin.scharrer@web.de}
% \ifdefined\repository
-% \repository{https://bitbucket.org/martin_scharrer/lstautogobble}
+% \repository{https://github.com/MartinScharrer/lstaddons/}
% \fi
%
% \maketitle
diff --git a/Master/texmf-dist/source/latex/lstaddons/lstlinebgrd.dtx b/Master/texmf-dist/source/latex/lstaddons/lstlinebgrd.dtx
index 860e6b6e813..705ffd19a70 100644
--- a/Master/texmf-dist/source/latex/lstaddons/lstlinebgrd.dtx
+++ b/Master/texmf-dist/source/latex/lstaddons/lstlinebgrd.dtx
@@ -1,6 +1,6 @@
% \iffalse meta-comment
%<=*COPYRIGHT>
-%% Copyright (C) 2011-2012 by Martin Scharrer <martin@scharrer-online.de>
+%% Copyright (c) 2011-2024 by Martin Scharrer <martin.scharrer@web.de>
%% ----------------------------------------------------------------------
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either version 1.3
@@ -24,10 +24,10 @@
%<*driver>
\ProvidesFile{lstlinebgrd.dtx}[%
%<=*DATE>
- 2012/05/03
+ 2014/08/18
%<=/DATE>
%<=*VERSION>
- v0.1
+ v0.2
%<=/VERSION>
DTX file for 'lstlinebgrd']
\documentclass{ydoc}
@@ -73,14 +73,15 @@
%
% \changes{v0.1}{2012/05/03}{Initial release.}
+% \changes{v0.2}{2024/08/18}{Updated internal separator.}
%
% \DoNotIndex{\newcommand,\newenvironment}
%
% \GetFileInfo{lstlinebgrd.dtx}
% \author{Martin Scharrer}
-% \email{martin@scharrer-online.de}
+% \email{martin.scharrer@web.de}
% \ifdefined\repository
-% \repository{https://bitbucket.org/martin_scharrer/lstlinebgrd}
+% \repository{https://github.com/MartinScharrer/lstaddons/}
% \fi
%
% \maketitle
@@ -238,10 +239,10 @@
\lst@Key{numbers}{none}{%
\def\lst@PlaceNumber{\lst@linebgrd}%
\lstKV@SwitchCases{#1}%
- {none&\\%
- left&\def\lst@PlaceNumber{\llap{\normalfont
+ {none:\\%
+ left:\def\lst@PlaceNumber{\llap{\normalfont
\lst@numberstyle{\thelstnumber}\kern\lst@numbersep}\lst@linebgrd}\\%
- right&\def\lst@PlaceNumber{\rlap{\normalfont
+ right:\def\lst@PlaceNumber{\rlap{\normalfont
\kern\linewidth \kern\lst@numbersep
\lst@numberstyle{\thelstnumber}}\lst@linebgrd}%
}{\PackageError{Listings}{Numbers #1 unknown}\@ehc}}
diff --git a/Master/texmf-dist/source/latex/magicwatermark/magicwatermark.dtx b/Master/texmf-dist/source/latex/magicwatermark/magicwatermark.dtx
deleted file mode 100644
index 7c9575858bc..00000000000
--- a/Master/texmf-dist/source/latex/magicwatermark/magicwatermark.dtx
+++ /dev/null
@@ -1,597 +0,0 @@
-% \iffalse meta-comment
-% !TEX program = XeLaTeX
-%<*internal>
-\iffalse
-%</internal>
-%<*internal>
-\fi
-\begingroup
- \def\temp{LaTeX2e}
-\expandafter\endgroup\ifx\temp\fmtname\else
-\csname fi\endcsname
-%</internal>
-%<*install>
-
-\input ctxdocstrip %
-
-\let\MetaPrefix\relax
-
-\declarepostamble\emptypostamble
-\endpostamble
-
-\def\MetaPrefix{-- }
-
-
-\let\MetaPrefix\DoubleperCent
-
-\generate
- {
-%</install>
-%<*internal>
- \usedir{source/xelatex/magicwatermark}
- \file{magicwatermark.ins} {\from{\jobname.dtx}{install}}
-%</internal>
-%<*install>
- \usedir{xetex/xelatex/magicwatermark}
- \file{magicwatermark.sty} {\from{\jobname.dtx}{package}}
- \nopreamble\nopostamble
- \usedir{doc/xelatex/magicwatermark}
- }
-
-\endbatchfile
-%</install>
-%<*internal>
-\fi
-%</internal>
-%<package>\NeedsTeXFormat{LaTeX2e}[2020/10/01]
-%<package>\ProvidesPackage{magicwatermark}[2021/12/22 v1.0.1 watermark for ljguo ]
-%<*driver>
-\documentclass{ctxdoc}
-\usepackage{graphicx}
-\usepackage{enumitem}
-\usepackage{listings}
-\lstset{
-frame=tb,framerule=2pt,language={[LaTeX]TeX},basicstyle={\ttfamily},
-language={[LaTeX]TeX},
-keywordstyle=\color{red!70!black}\bfseries,
-keywordstyle={[2]\color{blue!70!black}\bfseries},
-morekeywords={PageSetup,Watermark,NewWatermark,MyPageSetup,MyWatermark,EvenPageSetup,OddPageSetup,EvenWatermark,OddWatermark,ClearWatermark}}
-\usepackage{fontspec}
-\IfFontExistsTF{calibri.ttf}
-{
- \setmainfont{calibri.ttf}[
- BoldFont = calibrib.ttf,
- ItalicFont = calibrii.ttf,
- BoldItalicFont = calibriz.ttf
- ]
-}
-{}
-\setCJKmainfont[AutoFakeBold,AutoFakeSlant]{simfang.ttf}
-\usepackage{magicwatermark}
-\renewcommand*\marg[1]{\{\meta{#1}\}}
-\renewcommand*\oarg[1]{[\meta{#1}]}
-\renewcommand*\parg[1]{(\meta{#1})}
-\begin{document}
-%<!--CODEDOC--> \DisableImplementation
- \EnableImplementation
- \DocInput{\jobname.dtx}
- \IndexLayout
- \PrintChanges
- \PrintIndex
-\end{document}
-%</driver>
-% \fi
-%
-
-% \GetFileId{magicwatermark.sty}
-%
-% \CharacterTable
-% {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 \~}
-%
-%
-%\title{\pkg{magicwatermark}: 魔法水å°å®åŒ…}
-%\author{郭æŽå†› \\ liguo1020@gmail.com}
-%\def\version{v1.0.1}
-%\date{\today\quad\version}
-%\pagestyle{empty}
-%\PageSetup*
-%{
-% \begin{tikzpicture}[remember picture,overlay]
-% \node[cyan,scale = 2,shift={(-1,-1)}] at (current page.north east){--~\thepage~--};
-% \end{tikzpicture}
-%}
-%\Watermark
-%\maketitle
-%\thispagestyle{empty}
-%\tableofcontents
-%\begin{documentation}
-%\changes{v1.0.1}{2021/12/21}{实现了一些基本功能}
-%\begin{abstract}
-%\pkg{magicwatermark} 是一个基于 \pkg{everypage} å’Œ \pkg{tikz} å®åŒ…,并ç»è¿‡ \LaTeX3 \ 进行å°è£…çš„å®åŒ…,它å¯ä»¥å¾ˆçµæ´»çš„设置和清除水å°ï¼Œæ‰€æœ‰æ°´å°å†…容都放在 \verb|tikz| 的一个 \verb|node| 里é¢ï¼Œå¹¶å¤„于页é¢ä¸­å¿ƒã€‚
-%\end{abstract}
-%\section{介ç»}
-%ç›®å‰ \pkg{magicwatermark} å®åŒ…åªèƒ½å®žçŽ°å¦‚下功能
-%\begin{itemize}
-% \item 设置所有页é¢çš„æ°´å°
-% \item 设置奇数页的水å°
-% \item 设置å¶æ•°é¡µçš„æ°´å°
-% \item 新建水å°ï¼ŒåŒé¡µé¢è®¾ç½®å¤šä¸ªæ°´å°
-% \item 清除水å°
-%\end{itemize}
-%\section{用户接å£}
-%\subsection{æ供命令}
-% \begin{function}[added=2021-12-21,updated=2021-12-21]{\PageSetup}
-% \begin{syntax}
-% \tn{PageSetup} \oarg{æ°´å°å‚æ•°} \marg{æ°´å°å†…容}
-% \end{syntax}
-% 此命令用于设置所有页é¢çš„æ°´å°å†…容,接å—两个å‚数,第一个å‚数用于设置一些属性,以 \verb|key=value| çš„å½¢å¼ç»™å‡ºï¼Œ 第二个å‚数用于设置水å°å†…容,å¯ä»¥æ˜¯æ–‡å­—ã€å›¾ç‰‡ã€ç­‰.
-% \end{function}
-%\begin{function}[added=2021-12-21,updated=2021-12-21]{\Watermark}
-%\begin{syntax}
-% \tn{Watermark}
-%\end{syntax}
-% 该命令用于显示上é¢è®¾ç½®çš„æ°´å°
-%\end{function}
-%\begin{function}[added=2021-12-21,updated=2021-12-21]{\EvenPageSetup}
-%\begin{syntax}
-% \tn{EvenPageSetup}\oarg{æ°´å°å‚æ•°}\marg{æ°´å°å†…容}
-%\end{syntax}
-% 该命令用于设置å¶æ•°é¡µçš„æ°´å°å†…容
-%\end{function}
-%\begin{function}[added=2021-12-21,updated=2021-12-21]{\EvenWatermark}
-%\begin{syntax}
-% \tn{EvenWatermark}
-%\end{syntax}
-% 该命令用于显示上é¢è®¾ç½®çš„å¶æ•°é¡µæ°´å°
-%\end{function}
-%\begin{function}[added=2021-12-21,updated=2021-12-21]{\OddPageSetup}
-%\begin{syntax}
-% \tn{OddPageSetup}\oarg{æ°´å°å‚æ•°}\marg{æ°´å°å†…容}
-%\end{syntax}
-% 该命令用于设置奇数页的水å°å†…容
-%\end{function}
-%\begin{function}[added=2021-12-21,updated=2021-12-21]{\OddWatermark}
-%\begin{syntax}
-% \tn{OddWatermark}
-%\end{syntax}
-% 该命令用于显示上é¢è®¾ç½®çš„奇数页水å°
-%\end{function}
-%\subsection{扩展命令}
-%以下带星å·å‘½ä»¤ç”¨æ³•å’Œä¸Šé¢çš„类似,与其说是扩展,ä¸å¦‚说是å–消了é™åˆ¶ï¼Œä»¥ä¸Šçš„命令都将水å°å†…容写在一个\verb|node|中,对于对 TikZ ä¸å¤ªç†Ÿç»ƒçš„用户æ¥è¯´ï¼Œå‰è€…更加方
-%便快æ·ï¼Œè€ŒåŽè€…则更加çµæ´»
-%\begin{function}[added=2022-01-07,updated=2022-01-07]{\PageSetup*}
-%\begin{syntax}
-% \tn{PageSetup*}\marg{æ°´å°å†…容}
-%\end{syntax}
-%\end{function}
-%\begin{function}[added=2022-01-07,updated=2022-01-07]{\EvenPageSetup*}
-%\begin{syntax}
-% \tn{EvenPageSetup*}\marg{æ°´å°å†…容}
-%\end{syntax}
-%\end{function}
-%\begin{function}[added=2022-01-07,updated=2022-01-07]{\OddPageSetup*}
-%\begin{syntax}
-% \tn{OddPageSetup*}\marg{æ°´å°å†…容}
-%\end{syntax}
-%\end{function}
-%\begin{function}[added=2021-12-21,updated=2021-12-21]{\NewWatermark}
-%\begin{syntax}
-% \tn{NewWatermark}\marg{æ°´å°å称}
-%\end{syntax}
-%该命令用于新建一个水å°ï¼Œæ³¨æ„æ°´å°å称ä¸èƒ½æ˜¯ \verb|main|, \verb|even|, \verb|odd|.
-%\end{function}
-%\begin{function}[added=2021-12-21,updated=2021-12-21]{\MyPageSetup}
-%\begin{syntax}
-% \tn{MyPageSetup}\oarg{æ°´å°å‚æ•°}\marg{æ°´å°å称}\marg{æ°´å°å†…容}
-%\end{syntax}
-%用于设置新建的水å°å†…容
-%\end{function}
-%\begin{function}[added=2021-12-21,updated=2021-12-21]{\MyWatermark}
-%\begin{syntax}
-% \tn{MyWatermark}\marg{æ°´å°å称}
-%\end{syntax}
-% 该命令用于显示上é¢è®¾ç½®çš„æ°´å°
-%\end{function}
-%\begin{function}[added=2021-12-21,updated=2021-12-21]{\ClearWatermark}
-%\begin{syntax}
-% \tn{ClearWatermark}\marg{æ°´å°åˆ—表}
-%该命令用于清除设置的水å°ï¼ŒæŽ¥å—一个逗å·åˆ—表作为å‚数,例如:
-%\begin{itemize}
-% \item \verb|\ClearWatermark{main}| 清除由 \verb|\Watermark| 设置的水å°
-% \item \verb|\ClearWatermark{even,odd}| 清除奇数和å¶æ•°é¡µçš„æ°´å°
-% \item \verb|\ClearWatermark{all}| 清除所有的水å°
-% \item \verb|\ClearWatermark{name1,name2,name3,...}|
-%\end{itemize}
-%\end{syntax}
-%\end{function}
-%\subsection{å‚数列表}
-%以上设置命令中的\textbf{æ°´å°å‚æ•°}如下
-%\begin{itemize}
-% \item \verb|scale = <number>| 用于设置缩放比例
-% \item \verb|opacity = <number>| 用于设置ä¸é€æ˜Žåº¦
-% \item \verb|shift = {(x,y)}| 用于按å‘é‡ (x,y) 平移
-% \item \verb|color = <color expression>| 用于设置文本颜色
-% \item \verb|rotate = <angle>| 用于设置旋转角度
-% \item \verb+align = <center|left|right>+ 用于设置多行文本对é½æ–¹å¼ï¼Œé»˜è®¤ä¸º center
-% \item \verb+showframe = <true|false>+ 用于设置是å¦æ˜¾ç¤ºæ–‡æœ¬æ¡†ï¼Œé»˜è®¤ä¸º false
-%\end{itemize}
-%\subsection{一些说明}
-%所有的显示命令和清除命令都仅对该命令åŽé¢çš„文本生效。
-
-%\section{Examples}
-%\subsection{ä¸å¸¦æ˜Ÿå·}
-%\begin{lstlisting}
-\documentclass{ctexart}
-\usepackage{magicwatermark}
-\PageSetup[
- rotate = 30, % 设置旋转角度
- color = red!80, % 设置水å°å†…容颜色
- scale = 6 % 设置比例
-]{
- æ°´å°å†…容
-}
-\Watermark % 全文生效
-\begin{document}
-...
-\end{document}
-\end{lstlisting}
-%\subsection{奇å¶é¡µ}
-%\begin{lstlisting}
-\documentclass{ctexart}
-\usepackage{magicwatermark}
-\EvenPageSetup[color=cyan,showframe,scale=4]{å¶æ•°é¡µ} % 设置奇数页
-\OddPageSetup[color=purple,showframe,scale=4]{奇数页} % 设置å¶æ•°é¡µ
-\EvenWatermark % 显示水å°
-\OddWatermark
-\begin{document}
-...
-\end{document}
-\end{lstlisting}
-%\subsection{带星å·}
-%\begin{lstlisting}
-\documentclass{ctexart}
-\usepackage{magicwatermark}
-\PageSetup*{
- \begin{tikzpicture}[remember picture,overlay]
- \node[cyan,scale = 2,shift={(-1,-1)}] at
- (current page.north east){--~\thepage~--};
- \end{tikzpicture}
-}
-\begin{document}
-...
-\Watermark % 该命令之å‰ä¸ç”Ÿæ•ˆ
-\end{document}
-\end{lstlisting}
-%\subsection{新建水å°}
-%\begin{lstlisting}
-\documentclass{ctexart}
-\usepackage{magicwatermark}
-\NewWatermark{one} % 新建两个水å°
-\NewWatermark{two}
-\MyPageSetup[scale=5,color=blue]{one}{æ°´å°å†…容一} % 设置水å°
-\MyPageSetup[scale=5,color=red]{two}{æ°´å°å†…容二}
-\begin{document}
-\MyWatermark{one} % 使用第一个水å°
-...
-\newpage
-\ClearWatermark{one} % 清除第一个水å°
-\MyWatermark{two} % 使用第二个水å°
-...
-\end{document}
-\end{lstlisting}
-%\end{documentation}
-%
-% \StopEventually{}
-% \section{代ç å®žçŽ°}
-% \begin{macrocode}
-%<*package>
-% \end{macrocode}
-% 加载必è¦çš„å®åŒ…
-% \begin{macrocode}
-\RequirePackage{everypage-1x,tikz,xparse,expl3}
-% \end{macrocode}
-% 打开\LaTeX3 编程环境
-% \begin{macrocode}
-\ExplSyntaxOn
-% \end{macrocode}
-% 声明一些å˜é‡
-% \begin{macrocode}
-\tl_new:N \l_mainpage_tl
-\tl_new:N \l_evenpage_tl
-\tl_new:N \l_oddpage_tl
-\tl_new:N \g_case_tl
-\tl_new:N \g_clear_all_tl
-% \end{macrocode}
-% 定义警告
-% \begin{macrocode}
-\msg_new:nnn{clear}{not~have}{I~can~not~find~the~"\clear"~watermark~!}
-% \end{macrocode}
-% \begin{macro}{\PageSetup}
-% 对所有页é¢è®¾ç½®æ°´å°
-% \begin{macrocode}
-\NewDocumentCommand{\PageSetup}{sO{}+m}
-{
- \IfBooleanTF{#1}
- {
- \tl_set:Nn \l_mainpage_tl{#3}
- }
- {
- \tl_set:Nn \l_mainpage_tl
- {
- \group_begin:
- \keys_set:nn{watermark}{#2}
- \begin{tikzpicture}[remember~picture,overlay]
- \node
- [
- scale = \fp_use:N\l_scale_fp,
- opacity = \fp_use:N\l_opacity_fp,
- shift = \tl_use:N\l_shift_tl,
- color = \tl_use:N \l_color_tl,
- rotate = \fp_use:N \l_rotate_fp,
- align = \tl_use:N \l_align_tl,
- \bool_if:NTF \l_showframe_bool{draw}{},
- ]
- at(current~page.center){#3};
- \end{tikzpicture}
- \group_end:
- }
- }
-}
-% \end{macrocode}
-% \end{macro}
-% \begin{macro}{\Watermark}
-% 用于显示由 \verb|\PageSetup| 命令设置的水å°
-% \begin{macrocode}
-\NewDocumentCommand{\Watermark}{}
-{
- \AddEverypageHook{\tl_use:N \l_mainpage_tl}
-}
-% \end{macrocode}
-% \end{macro}
-% \begin{macro}{\EvenPageSetup}
-% 对å¶æ•°é¡µè®¾ç½®æ°´å°
-% \begin{macrocode}
-\NewDocumentCommand{\EvenPageSetup}{sO{}+m}
-{
- \IfBooleanTF{#1}
- {
- \tl_set:Nn \l_evenpage_tl{#3}
- }
- {
- \tl_set:Nn \l_evenpage_tl
- {
- \group_begin:
- \keys_set:nn{watermark}{#2}
- \begin{tikzpicture}[remember~picture,overlay]
- \node
- [
- scale = \fp_use:N\l_scale_fp,
- opacity = \fp_use:N\l_opacity_fp,
- shift = \tl_use:N\l_shift_tl,
- color = \tl_use:N \l_color_tl,
- rotate = \fp_use:N \l_rotate_fp,
- align = \tl_use:N \l_align_tl,
- \bool_if:NTF \l_showframe_bool{draw}{},
- ]
- at(current~page.center){#3};
- \end{tikzpicture}
- \group_end:
- }
- }
-}
-% \end{macrocode}
-% \end{macro}
-% \begin{macro}{\EvenWatermark}
-% 用于显示由 \verb|\EvenPageSetup| 命令设置的水å°
-% \begin{macrocode}
-\NewDocumentCommand{\EvenWatermark}{}
-{
- \AddEverypageHook
- {
- \int_if_even:nT{\int_use:N \value{page}}
- {
- \tl_use:N \l_evenpage_tl
- }
- }
-}
-% \end{macrocode}
-% \end{macro}
-% \begin{macro}{\OddPageSetup}
-% 对奇数页设置水å°
-% \begin{macrocode}
-\NewDocumentCommand{\OddPageSetup}{sO{}+m}
-{
- \IfBooleanTF{#1}
- {
- \tl_set:Nn \l_oddpage_tl{#3}
- }
- {
- \tl_set:Nn \l_oddpage_tl
- {
- \group_begin:
- \keys_set:nn{watermark}{#2}
- \begin{tikzpicture}[remember~picture,overlay]
- \node
- [
- scale = \fp_use:N\l_scale_fp,
- opacity = \fp_use:N\l_opacity_fp,
- shift = \tl_use:N\l_shift_tl,
- color = \tl_use:N \l_color_tl,
- rotate = \fp_use:N \l_rotate_fp,
- align = \tl_use:N \l_align_tl,
- \bool_if:NTF \l_showframe_bool{draw}{},
- ]
- at(current~page.center){#3};
- \end{tikzpicture}
- \group_end:
- }
- }
-}
-% \end{macrocode}
-% \end{macro}
-% \begin{macro}{\OddWatermark}
-% 用于显示由 \verb|\OddPageSetup| 命令设置的水å°
-% \begin{macrocode}
-\NewDocumentCommand{\OddWatermark}{}
-{
- \AddEverypageHook
- {
- \int_if_odd:nT{\int_use:N \value{page}}
- {
- \tl_use:N \l_oddpage_tl
- }
- }
-}
-% \end{macrocode}
-% \end{macro}
-
-% \begin{macro}{\NewWatermark}
-% 用于新建一个水å°
-% \begin{macrocode}
-\NewDocumentCommand{\NewWatermark}{m}
-{
- \tl_new:c {l_#1_tl}
- \tl_put_right:Nn \g_case_tl {{#1}{\tl_clear:c {l_#1_tl}}}
- \tl_put_right:Nn \g_clear_all_tl {\tl_clear:c {l_#1_tl}}
-}
-% \end{macrocode}
-% \end{macro}
-% \begin{macro}{\MyPageSetup}
-% 用于设置新建的水å°
-% \begin{macrocode}
-\NewDocumentCommand{\MyPageSetup}{O{} m +m}
-{
- \tl_set:cn {l_#2_tl}
- {
- \group_begin:
- \keys_set:nn{watermark}{#1}
- \begin{tikzpicture}[remember~picture,overlay]
- \node
- [
- scale = \fp_use:N\l_scale_fp,
- opacity = \fp_use:N\l_opacity_fp,
- shift = \tl_use:N\l_shift_tl,
- color = \tl_use:N \l_color_tl,
- rotate = \fp_use:N \l_rotate_fp,
- align = \tl_use:N \l_align_tl,
- \bool_if:NTF \l_showframe_bool{draw}{},
- ]
- at(current~page.center){#3};
- \end{tikzpicture}
- \group_end:
- }
-}
-% \end{macrocode}
-% \end{macro}
-
-
-
-% \begin{macro}{\MyWatermark}
-% 用于显示由 \verb|\MyPageSetup| 命令设置的水å°
-% \begin{macrocode}
-\NewDocumentCommand{\MyWatermark}{m}
-{
- \AddEverypageHook{\tl_use:c {l_#1_tl}}
-}
-% \end{macrocode}
-% \end{macro}
-% 定义一些å¯é€‰å‚æ•°, 用于对水å°è¿›è¡Œè®¾ç½®
-% \begin{macrocode}
-\keys_define:nn{watermark}
-{
- scale.fp_set:N = \l_scale_fp,
- scale.initial:n = 1.0,
- scale.default:n = 1.0,
- opacity.fp_set:N = \l_opacity_fp,
- opacity.initial:n = 0.8,
- opacity.default:n = 0.8,
- shift.tl_set:N = \l_shift_tl,
- shift.initial:n = {(0,0)},
- shift.default:n = {(0,0)},
- color.tl_set:N = \l_color_tl,
- color.initial:n = black,
- color.default:n =black,
- rotate.fp_set:N =\l_rotate_fp,
- rotate.initial:n = 0.0,
- rotate.default:n = 0.0,
- align.tl_set:N = \l_align_tl,
- align.initial:n = center,
- align.default:n = center,
- showframe.bool_set:N = \l_showframe_bool,
- showframe.initial:n = false,
- showframe.default:n = true,
-}
-% \end{macrocode}
-% \begin{macro}{\g_clear_all_tl}
-% 用于ä¿å­˜å¾…清空的所有水å°
-% \begin{macrocode}
-\tl_gset:Nn \g_clear_all_tl
-{
- \tl_clear:N \l_mainpage_tl
- \tl_clear:N \l_evenpage_tl
- \tl_clear:N \l_oddpage_tl
-}
-% \end{macrocode}
-% \end{macro}
-% \begin{macro}{\g_case_tl}
-% 用于ä¿å­˜ä¸€äº›å¼€å…³
-% \begin{macrocode}
-\tl_gset:Nn \g_case_tl{
- {all}
- {
- \tl_use:N\g_clear_all_tl
- }
- {even}
- {
- \tl_clear:N \l_evenpage_tl
- }
- {odd}
- {
- \tl_clear:N \l_oddpage_tl
- }
- {main}
- {
- \tl_clear:N \l_mainpage_tl
- }
-}
-% \end{macrocode}
-% \end{macro}
-% \begin{macro}{\ClearWatermark}
-% 用于清除设置的水å°
-% \begin{macrocode}
-\NewDocumentCommand{\ClearWatermark}{m}
-{
-\clist_gset:Nn \g_clear_clist{#1}
-\clist_map_variable:NNn \g_clear_clist \clear
-{
- \exp_args:NV \str_case:nVF \clear
- \g_case_tl
- {\msg_warning:nn{clear}{not~have}}
-}
-}
-% \end{macrocode}
-% \end{macro}
-% 关闭\LaTeX3 编程环境
-% \begin{macrocode}
-\ExplSyntaxOff
-% \end{macrocode}
-% \begin{macrocode}
-%</package>
-% \end{macrocode}
-% \Finale
-%
-\endinput
-\endlinechar
diff --git a/Master/texmf-dist/source/latex/mailing/mailing.dtx b/Master/texmf-dist/source/latex/mailing/mailing.dtx
index 01aabfcfd43..2a1747d4404 100644
--- a/Master/texmf-dist/source/latex/mailing/mailing.dtx
+++ b/Master/texmf-dist/source/latex/mailing/mailing.dtx
@@ -1,33 +1,34 @@
% \iffalse meta-comment
%
-% Copyright 1994-2004 Johannes Braams. All rights reserved.
-%
+% Copyright 1999-2024 Johannes L. Braams. All rights reserved.
+%
% This file is part of the mailing package.
% -----------------------------------------
-%
+%
% It may be distributed and/or modified under the
-% conditions of the LaTeX Project Public License, either version 1.3
+% 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
% http://www.latex-project.org/lppl.txt
-% and version 1.3 or later is part of all distributions of LaTeX
-% version 2003/12/01 or later.
-%
+% and version 1.3c or later is part of all distributions of LaTeX
+% version 2008 or later.
+%
% This work has the LPPL maintenance status "maintained".
-%
+%
% The Current Maintainer of this work is Johannes Braams.
-%
-% The list of all files belonging to the mailing package is
-% given in the file `manifest.txt'.
-%
+%
+% The list of all files belonging to the supertabular package is
+% given in the file `MANIFEST.
+%
% 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
+%
% \CheckSum{157}
%
%\iffalse
-%% Copyright (C) 1999-2004 Johannes L. Braams texniek at braams.cistron.nl
+%% Copyright (C) 1999-2024 Johannes L. Braams texniek at texniek.nl
%%
%%
%<*dtx>
@@ -38,7 +39,7 @@
%<driver>\ProvidesFile{mailing.drv}
%\fi
%\ProvidesFile{mailing}
- [2004/02/20 v1.0b Send letters to multiple addresses]
+ [2024/07/20 v1.0c Send letters to multiple addresses]
%\iffalse
%<*driver>
\documentclass{ltxdoc}
@@ -48,11 +49,14 @@
\end{document}
%</driver>
%\fi
+% \changes{v1.0c}{2024/07/20}{Updated contact info}
%
% \GetFileInfo{mailing}
-% \title{Creating a mailing}
+% \title{Creating a mailing\thanks{This file
+% has version number \fileversion, last
+% revised \filedate.}}
% \author{Johannes Braams}
-% \date{september 7, 1994}
+% \date{\filedate}^^AA original date{september 7, 1994}
% \maketitle
%
% \markboth
@@ -304,4 +308,4 @@
% \end{macro}
%
% \Finale
-\endinput \ No newline at end of file
+\endinput
diff --git a/Master/texmf-dist/source/latex/mailing/mailing.ins b/Master/texmf-dist/source/latex/mailing/mailing.ins
index b9143a89b68..a9c133d718b 100644
--- a/Master/texmf-dist/source/latex/mailing/mailing.ins
+++ b/Master/texmf-dist/source/latex/mailing/mailing.ins
@@ -3,54 +3,43 @@
%% driver files from the doc files in this package when run through
%% LaTeX or TeX.
%%
-%% Copyright 1989-2004 Johannes L. Braams. All rights reserved.
%%
-%% This file is part of the mailing package.
-%% ------------------------------------------
+%% This file is distributed in the hope that it will be useful,
+%% but WITHOUT ANY WARRANTY; without even the implied warranty of
+%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
%%
-%% It may be distributed and/or modified under the
-%% conditions of the LaTeX Project Public License, either version 1.3
-%% of this license or (at your option) any later version.
-%% The latest version of this license is in
-%% http://www.latex-project.org/lppl.txt
-%% and version 1.3 or later is part of all distributions of LaTeX
-%% version 2003/12/01 or later.
+%% IMPORTANT NOTICE:
%%
-%% This work has the LPPL maintenance status "maintained".
+%% Copyright (C) 1994-2024 Johannes Braams, All rights reserved.
%%
-%% The Current Maintainer of this work is Johannes Braams.
-%%
-%% The list of all files belonging to the mailing package is
-%% given in the file `manifest.txt.
-%%
-%% 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.
+%% This program can be redistributed and/or modified under the terms
+%% of the LaTeX Project Public License Distributed from CTAN
+%% archives in directory macros/latex/base/lppl.txt; either
+%% version 1.3c of the License, or any later version.
%%
%% --------------- start of docstrip commands ------------------
%%
% ignored commands
-\def\filedate{2004/02/20}
+\def\filedate{2024/07/20}
\def\batchfile{mailing.ins}
\input docstrip.tex
-
% package file
\preamble
-Copyright (C) 1999-2004 Johannes Braams. All rights reserved.
+Copyright (C) 1999-2024 Johannes Braams. All rights reserved.
This file was generated from file(s) of the mailing package.
------------------------------------------------------------
It may be distributed and/or modified under the
-conditions of the LaTeX Project Public License, either version 1.3
+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
http://www.latex-project.org/lppl.txt
-and version 1.3 or later is part of all distributions of LaTeX
-version 2003/12/01 or later.
+and version 1.3c or later is part of all distributions of LaTeX
+version 2008 or later.
This work has the LPPL maintenance status "maintained".
@@ -61,12 +50,13 @@ mailing package. You may however distribute the mailing package
without such generated files.
The list of all files belonging to the mailing package is
-given in the file `manifest.txt.
+given in the file `MANIFEST'.
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.
\endpreamble
+\keepsilent
\generateFile{mailing.sty}{t}{\from{mailing.dtx}{package}}
diff --git a/Master/texmf-dist/source/latex/mathastext/mathastext.dtx b/Master/texmf-dist/source/latex/mathastext/mathastext.dtx
index d8c464a117b..7857f9b70a6 100644
--- a/Master/texmf-dist/source/latex/mathastext/mathastext.dtx
+++ b/Master/texmf-dist/source/latex/mathastext/mathastext.dtx
@@ -2,8 +2,8 @@
% N.B.: this dtx file does NOT use \DocInput, it only uses docstrip.
% The LaTeX source of the documentation is NOT prefixed with %'s.
%<*dtx>
-\def\dtxtimestamp {Time-stamp: <29-12-2023 at 10:54:52 CET>}
-\def\docdate{2023/12/29}
+\def\dtxtimestamp {Time-stamp: <26-07-2024 at 11:21:35 CEST>}
+\def\docdate{2024/07/27}
% To extract run etex on this file, then to build documentation run
% latexmk on mathastext.tex then dvipdfmx on the dvi.
% For more information see http://jf.burnol.free.fr/v13/INSTALL.txt
@@ -11,8 +11,8 @@
% due to usage of § (<A7>) as an active character.
%</dtx>
%<*drv>
-\def\MSTpkgdate {2023/12/29}
-\def\MSTpkgversion {1.3zb}
+\def\MSTpkgdate {2024/07/27}
+\def\MSTpkgversion {1.4b}
%</drv>
%<*dtx>
\iffalse % meta-comment
@@ -28,13 +28,13 @@
+-------------------------------------------+
This Work may be distributed and/or modified under the conditions
-of the [LPPL1.3c](http://www.latex-project.org/lppl/lppl-1-3c.txt)
+of the [LPPL 1.3c](https://www.latex-project.org/lppl/lppl-1-3c.txt)
The Author of this Work is Jean-Francois Burnol (`jfbu at free dot fr`)
-Copyright (C) 2011-2019, 2022, 2023 Jean-Francois Burnol
+Copyright (C) 2011-2019, 2022-2024 Jean-Francois Burnol
- Source: mathastext.dtx 1.3zb 2023/12/29
+ Source: mathastext.dtx 1.4b 2024/07/27
%</readme>
%<*dtx>
@@ -44,10 +44,10 @@ Copyright (C) 2011-2019, 2022, 2023 Jean-Francois Burnol
%%----------------------------------------------------------------
%% Package: mathastext
%% Info: Use the text font in math mode (JFB)
-%% Version: 1.3zb 2023/12/29
+%% Version: 1.4b 2024/07/27
%% License: LPPL 1.3c (http://www.latex-project.org/lppl/lppl-1-3c.txt)
-%% Copyright (C) 2011-2019, 2022, 2023 Jean-Francois Burnol
-%% <jfbu at free dot fr>
+%% Copyright (C) 2011-2019, 2022-2024 Jean-Francois Burnol
+%% <jfbu at free dot fr>
%% Examples of use of mathastext:
%% http://jf.burnol.free.fr/mathastext.html
%% http://jf.burnol.free.fr/showcase.html
@@ -95,19 +95,11 @@ Copyright (C) 2011-2019, 2022, 2023 Jean-Francois Burnol
\begingroup
\input docstrip.tex
\askforoverwritefalse
-\def\testfilepreamble{\string\def\string\testfileincipit{Test file
- to accompany \string\texttt{mathastext}^^J%
- version \string\texttt{\MSTpkgversion} of \string\texttt{\MSTpkgdate}}}
\generate{\nopreamble\nopostamble
\file{README.md}{\from{mathastext.dtx}{readme}}
\file{ChangeLog.md}{\from{mathastext.dtx}{changelog}}
\usepostamble\defaultpostamble
\file{mathastext.tex}{\from{mathastext.dtx}{drv}}
- \usepreamble\testfilepreamble
- \file{mathastexttestmathversions.tex}{\from{mathastext.dtx}{mathversions}}
- \file{mathastexttestunicodemacos.tex}{\from{mathastext.dtx}{macos}}
- \file{mathastexttestunicodelinux.tex}{\from{mathastext.dtx}{linux}}
- \file{mathastexttestalphabets.tex}{\from{mathastext.dtx}{alphabets}}
\usepreamble\defaultpreamble
\file{mathastext.sty}{\from{mathastext.dtx}{package}}%
}
@@ -120,7 +112,8 @@ Copyright (C) 2011-2019, 2022, 2023 Jean-Francois Burnol
% no file extractions if latex compilation was on mathastext.tex
\ifdefined\MessageDeFin\AtEndDocument{\MessageDeFin}\fi
\begingroup\catcode1 0 \catcode`\\ 12
-% this is to fool TeX's recognition of \if/\else/\fi like tokens in test files
+% This is to fool TeX's recognition of \if/\else/\fi like tokens in test files,
+% but on 2024/07/14 I removed from the dtx four previously included such filss.
^^Aiffalse
%</dtx>
%<*readme>
@@ -200,6 +193,98 @@ MATHASTEXT CHANGE LOG
%</changelog>
%<*readme|changelog>
+1.4b \[2024/07/27\]
+----
+
+* Fix a regression at `1.4` regarding option `nodigits`.
+
+* New option: `noletters`. I am in old age now so I can provide an option
+ completely antithetical to my life work.
+
+* Option `everymath` which is destined to be removed at next major
+ release warns user about it. As major releases tend to happen once
+ per decade I think the constant nagging will become insufferable
+ and you will adapt to the `1.4` changes rather than persisting into
+ using this option.
+
+1.4a \[2024/07/20\]
+----
+
+* There was a documentation glitch in 1.4 and also a problem with the
+ `\MTprimeskip` feature being lost under the emergency fall-back
+ `everymath` option.
+
+1.4 \[2024/07/20\]
+---
+
+* Since 1.2 of 2012/12/20, mathastext has used mathematically active
+ characters to propose certain advanced functionalities. For reasons half
+ lost in the mists of time but whose main one was surely to keep the
+ meaning of the active shape of characters unchanged outside of math mode,
+ this mathematical activation, and (in most cases) the definitions of what
+ active characters do, were done again at *each* entrance into math mode.
+ At this 1.4 release, mathastext does not inject *any* code whatsoever into
+ the `\everymath` and `\everydisplay` toks registers anymore (except for
+ one font-related hack needed under LuaLaTeX, see below). Your documents
+ will compile a tiny bit faster.
+
+* In (unsual) documents where users play with catcodes and mathcodes it is
+ impossible to keep exact backward compatibility, because documented user
+ commands which acted formerly a toggles with delayed action now will enact
+ changes immediately if in the document body. In practice consequences are
+ expected to be few, because catcode active characters are (as was already
+ the case with earlier releases) hacked only when they are Babel shorthands
+ and they are then modified in a way altering only their action in math
+ mode. The precise description of what mathastext does when mathematically
+ activating (or not) a character, depending on circumstances, is to be
+ found among small-print comments in the section "Extended scope of the
+ math alphabets commands". See also the documentation of the
+ `\MTmathactiveletters` command for some specifics regarding ascii letters.
+
+* New option: `everymath`. It instructs mathastext to revert (partially)
+ to its legacy code which uses `\everymath/\everydisplay`. This reversal
+ is partial, the handling of ascii letters not being included into it. The
+ `everymath` option is there only to try as a quick fix in case transition
+ to this release causes a major problem in a user document and time is
+ lacking to investigate. Please report to the author such issues. Option
+ `everymath` is destined to be removed at next major release.
+
+* New option: `activedigits`. Enjoy.
+
+* It is now easier to hook into the mathastext architecture for
+ mathematically activated ascii letters. See the new section "Hacking
+ letters (and even digits) for special tasks".
+
+* Bugfix: do not override special behavior of the math mode dot in
+ babel-spanish.
+
+* Bugfix: A desperate hack related to LuaLaTeX font matters and dating
+ back to 1.3o 2016/05/03 had been for some years in dire need of an update
+ regarding fonts using `Renderer=HarfBuzz`. This is done now. Thanks to
+ tex.sx `user691586` for report. This is currently the sole remaining
+ usage of `\everymath/\everydisplay`.
+
+* Bugfix: an optional feature related to `\{` and `\}` was broken since an
+ upstream LaTeX change at its 2020-02-02 release.
+
+* With option symbolmisc, those math symbol macros formerly defined via
+ `\DeclareRobustCommand` are now declared via `\protected\def`.
+
+* Removal of legacy branches previously kept to support LaTeX earlier than
+ 2020-02-02.
+
+* Removal of support for EU1 and EU2 font encodings.
+
+* Option `noasterisk` deprecated at 1.2d 2013/01/02 has (finally) been removed.
+
+* Four test files previously included and auto-extracted from the
+ distributed dtx have been dropped. One of them is still available
+ on the package homepage.
+
+* Some parts of the documentation have been massively re-ordered and even to some
+ extent improved. But there may be some occasions where obsolete statements will
+ be found having the legacy `\everymath/\everydisplay` situation as background.
+
1.3zb \[2023/12/29\]
-----
@@ -251,6 +336,8 @@ MATHASTEXT CHANGE LOG
* Fix long-standing hyperlink problems in the documentation:
blue color words should now all be functioning hyperlinks.
+%</readme|changelog>
+%<*changelog>
1.3z \[2023/09/01\]
----
@@ -311,8 +398,6 @@ been pushed to CTAN, hence the version increase to 1.3y)
letters and emitted during math version creation in the
preamble.
-%</readme|changelog>
-%<*changelog>
1.3w \[2019/11/16\]
----
@@ -358,7 +443,7 @@ been pushed to CTAN, hence the version increase to 1.3y)
to some other (robust) math alphabet macros, but were not
robust in the strict sense. This does cause some issues for
moving arguments in the context of multiple math versions,
- hence it was a bug. The special behaviour of the math
+ hence it was a bug. The special behavior of the math
alphabet commands (they redefine themselves and other macros
on first use) makes is somewhat problematic for mathastext
to keep them updated across math versions and at the same
@@ -620,16 +705,14 @@ been pushed to CTAN, hence the version increase to 1.3y)
redefined as math symbols and could not be used as delimiters.
-1.3d \[2015/02/26\]
+1.3d \[2014/05/23\]
----
-* the documentation mentions the improved compatibility of mathastext
+* A 2015/02/26 edit to the documentation mentions the
+ improved compatibility of mathastext
with the latest (3.34) beamer release: no more need for
`\usefonttheme{professionalfonts}`.
-1.3d \[2014/05/23\]
-----
-
* new commands `\MTstandardgreek` and `\MTcustomgreek`.
* The Greek letters, in case of use of one of the package related
@@ -760,6 +843,8 @@ use of mathematically active characters in versions 1.2 and 1.2b.
mechanism of letting non-letter symbols obey the math alphabet
commands.
+* the `noasterisk` option is deprecated and made a no-op.
+
* documentation extended and improved.
1.2c \[2012/12/31\]
@@ -904,6 +989,11 @@ use of mathematically active characters in versions 1.2 and 1.2b.
complete manner to adapt the math configuration to fonts
provided with no math support.
+1.13d
+----
+
+* new macros `\MTstandardgreek` and `\MTcustomgreek`
+
1.13b
----
@@ -972,502 +1062,6 @@ use of mathematically active characters in versions 1.2 and 1.2b.
%%% mode: latex
%%% End:
%</drv>
-%<*mathversions>
-%% This file `mathastexttestversions.tex' is for testing the enhanced
-%% concept of math versions provided by the package `mathastext'.
-%%
-%% See `mathastext.dtx' for the copyright and conditions of distribution or
-%% modification.
-%%
-\documentclass{article}
-\usepackage[T1]{fontenc}
-\usepackage{newcent}
-\usepackage[subdued]{mathastext}
-\Mathastext[newcent]
-\renewcommand\familydefault\ttdefault
-\Mathastext[courier]
-\renewcommand\familydefault\sfdefault
-\Mathastext[avantgarde]
-\renewcommand\familydefault\rmdefault
-\begin{document}
-\testfileincipit
-
-text in NewCentury and $math\ as\ in\ default$,%
-\MTversion{courier} text in Courier and $math\ in\ Courier$,%
-\MTversion{avantgarde} text in AvantGarde and $math\ in\ AvantGarde$,%
-\MTversion[newcent]{courier} text in NewCentury and $math\ in\
-Courier$,\MTversion{bold} text in bold NewCentury and $math\ as\ in\
-bold\ default$,\MTversion[courier]{avantgarde} text in Courier and
-$math\ in\ AvantGarde$.
-\end{document}
-%</mathversions>
-%<*macos>
-%% This file `mathastexttestunicodemacos.tex' is for testing the use
-%% of the package `mathastext' with the unicode engines XeTeX or LuaLaTeX.
-%%
-%% Mac OS X specific fonts are used (initially tested on 10.8.2).
-%%
-%% See `mathastext.dtx' for the copyright and conditions of distribution or
-%% modification.
-%%
-\documentclass{article}
-\usepackage[hscale=0.85]{geometry}
-\usepackage{multicol}
-\usepackage[no-math]{fontspec}
-\usepackage{lmodern}
-\usepackage{metalogo}
-\usepackage{iftex}
-\ifXeTeX
-\expandafter\def\expandafter\testfileincipit\expandafter
- {\testfileincipit\ (compiled with \XeLaTeX)}
-\else
-\ifLuaTeX
-\expandafter\def\expandafter\testfileincipit\expandafter
- {\testfileincipit\ (compiled with \LuaLaTeX)}
-\fi\fi
-\usepackage[subdued,italic,asterisk]{mathastext}
-\setmainfont[Color=FF0000]{Hoefler Text} \Mathastext[Hoefler]
-\setmainfont[Color=336633]{American Typewriter}\Mathastext[Typewriter]
-\setmainfont[Color=0000FF]{Herculanum} \Mathastext[Herculanum]
-\setmainfont[Color=FF00FF]{Didot} \Mathastext[Didot]
-\setmainfont[Color=999999]{Comic Sans MS} \Mathastext[Comic]
-\MTDeclareVersion{Times}{T1}{ptm}{m}{n}
-\begin{document}
-\MTversion{normal}
-\testfileincipit
-
-This test uses \verb|mathastext| with its \emph{italic}, \emph{asterisk}, and
-\emph{subdued} options. The base document fonts are the Latin Modern ones (in
-OpenType format). The other OpenType fonts were chosen from those available on
-a Mac OS machine. We also used the Times font in traditional \TeX\ font T1
-encoding, to demonstrate the removal since release \texttt{1.3u} of a former
-limitation that all math versions had to share the same font encoding, else
-some characters such as the dotless \texttt{i} ($\imath$), or the minus sign
-could well vanish from the output in the non-normal math versions.
-
-Furthermore we test (last line of each block, on the left) if the non-letter
-characters obey the math alphabet \verb|\mathbf|. In the normal and bold math
-versions, this feature is de-activated, as option \emph{subdued} was used; and
-if activated we should then use in these math versions the package
-\verb|\Mathbf| rather than \verb|\mathbf| which is there still the original
-one, which will use encoding \verb|OT1| in the normal and bold versions, as we
-loaded \verb|fontspec| with its option \emph{no-math}.
-
-Some among the fonts tested have no bold variant or no italic variant.
-
-Note (tested 2013/09/03): for some reason the \verb|Color| specifications in the
-\verb|\setmainfont| commands work only
-with \XeLaTeX{}, not with \LuaLaTeX{}; a few months back I had not noticed
-such a difference between the two engines.
-
-Update (tested 2016/01/15 with reasonably up-to-date TL2015): \verb|Color|
-spec in use of \verb|\setmainfont| command now functional again with
-\LuaLaTeX.
-
-Note (tested 2019/08/11, reasonably up-to-date TL2019): spacing with the Didot
-font differs widely between \XeLaTeX\ and \LuaLaTeX{} (perhaps related to
-italic corrections, see the package documentation), and also it seems
-\LuaLaTeX{} will not find (from our generic usage of the \verb|fontspec|
-interface, at least) bold variants of the Hoefler Text and American Typewriter
-fonts, contrarily to \XeLaTeX. Also, the \emph{italic} option remains
-seemingly without effect with \LuaLaTeX{} in the case of the Hoefler Text font
-(see the package source code comments on some problems with the two ``modes''
-for text fonts under \LuaLaTeX, which may be related with this specific issue
-here).
-
-Update (tested 2022/10/29, with 1.3x and up-to-date TL2022): it appears that
-most, perhaps even all, of the remarks in the preceding note are now obsolete
-as I do not see obvious differences between outputs from \XeLaTeX{} versus
-\LuaLaTeX{} but I did not seriously compare, only quickly done.
-
-\newcommand\TEST[1]{\MTversion{#1}\def\tmpa{#1}%
- \def\tmpb{normal}\def\tmpc{bold}%
- \ifx\tmpa\tmpb\else\ifx\tmpa\tmpc\else \MTnonlettersobeymathxx
- \MTexplicitbracesobeymathxx\fi\fi
-\begin{multicols}{2}
-\hbox to\columnwidth{\hbox to\columnwidth{\hfil
- $abcdefghijklmnopqrstuvwxyz$\hfil}\kern-2.5em{#1}}
- \centerline{ $ABCDEFGHIJKLMNOPQRSTUVWXYZ$ }
- \centerline{ $0123456789$ }
- \centerline{ $!\,?\,*\,,\,.\,:\,;\,+\,-\,=\,(\,)\,[\,]\,/\,\#\,%
- \$\,\%\,\&\,<\,>\,|\,\{\,\}\,\backslash$ }
- \centerline{ $\mathbf{!\,?\,*\,,\,.\,:\,;\,+\,-\,=\,(\,)\,[\,]\,/\,\#\,%
- \$\,\%\,\&\,<\,>\,|\,\{\,\}\,\backslash}$ }
-\columnbreak
- \centerline{ abcdefghijklmnopqrstuvwxyz }
- \centerline{ ABCDEFGHIJKLMNOPQRSTUVWXYZ }
- \centerline{ 0123456789 }
- \centerline{ !\,?\,*\,,\,.\,:\,;\,+\,-\,=\,(\,)\,[\,]\,/\,\#\,%
- \$\,\%\,\&\,<\,>\,|\,\{\,\}\,\char92 }
- \centerline{\bfseries !\,?\,*\,,\,.\,:\,;\,+\,-\,=\,(\,)\,[\,]\,/\,\#\,%
- \$\,\%\,\&\,<\,>\,|\,\{\,\}\,\char92 }
-\end{multicols}}
-\begin{multicols}{2}
- \centerline{\textbf{math mode}}
-\columnbreak
- \centerline{ \textbf{text} }
-\end{multicols}
-\TEST{Didot}\TEST{Comic}\TEST{normal}\TEST{Herculanum}
-\TEST{Hoefler}\TEST{Typewriter}\TEST{bold}\TEST{Times}
-\end{document}
-%</macos>
-%<*linux>
-%% This file `mathastexttestunicodelinux.tex' is for testing the use
-%% of the package `mathastext' with the unicode engines XeTeX or LuaLaTeX.
-%%
-%% Fonts which were available on a Linux machine are used. Beware that
-%% compilation with LuaLaTeX will abort with errors if specified fonts do not
-%% exist on your system.
-%%
-%% See `mathastext.dtx' for the copyright and conditions of distribution or
-%% modification.
-%%
-\documentclass{article}
-\usepackage[hscale=0.8]{geometry}
-\usepackage{multicol}
-\usepackage[no-math]{fontspec}
-\usepackage{lmodern}
-\usepackage{metalogo}
-\usepackage{iftex}
-\ifXeTeX
-\expandafter\def\expandafter\testfileincipit\expandafter
- {\testfileincipit\ (compiled with \XeLaTeX)}
-\else
-\ifLuaTeX
-\expandafter\def\expandafter\testfileincipit\expandafter
- {\testfileincipit\ (compiled with \LuaLaTeX)}
-\fi\fi
-\usepackage[subdued,italic,asterisk]{mathastext}
-\setmainfont[Color=999999]{Verdana} \Mathastext[Verdana]
-\setmainfont[Color=0000FF]{Arial} \Mathastext[Arial]
-\setmainfont[Color=00C000]{DejaVu Serif} \Mathastext[DejaVu]
-\setmainfont[Color=FF0000]{Andale Mono} \Mathastext[Andale]
-%% commented out as these fonts do not exist anymore on the Linux box
-%% I have access to (test last done 2016/01/15)
-%%\setmainfont[Color=C000C0]{URW Chancery L} \Mathastext[Chancery]
-%%\setmainfont[Color=800080]{URW Palladio L} \Mathastext[Palladio]
-\setmainfont[Color=808000]{Liberation Serif} \Mathastext[Liberation]
-\MTDeclareVersion{Times}{T1}{ptm}{m}{n}
-\begin{document}
-\MTversion{normal}
-\testfileincipit
-
-This test uses \verb|mathastext| with its \emph{italic}, \emph{asterisk}, and
-\emph{subdued} options. The base document fonts are the Latin Modern ones (in
-OpenType format). The other OpenType fonts were chosen from those available on
-a Linux machine. We also used the Times font in traditional \TeX\ font T1
-encoding, to demonstrate the removal since release \texttt{1.3u} of a former
-limitation that all math versions had to share the same font encoding, else
-some characters such as the dotless \texttt{i} ($\imath$), or the minus sign
-could well vanish from the output in the non-normal math versions.
-
-Furthermore we test (last line of each block, on the left) if the non-letter
-characters obey the math alphabet \verb|\mathbf|. In the normal and bold math
-versions, this feature is de-activated, as option \emph{subdued} was used; and
-if activated we should then use in these math versions the package
-\verb|\Mathbf| rather than \verb|\mathbf| which is there still the original
-one, which will use encoding \verb|OT1| in the normal and bold versions, as we
-loaded \verb|fontspec| with its option \emph{no-math}.
-
-Some among the fonts tested have no bold variant or no italic variant.
-
-Note: the two unicode engines \XeLaTeX\ and \LuaLaTeX\ give likely not fully
-identical results particularly for the math mode. At least this is what I
-observed regularly over the years with the variant of this file prepared for
-fonts available on Mac OS, which is my main system where I develop
-|\mathastext|. Lastly for example (TL2019, august 2019), \LuaLaTeX\ could not
-find the bold variant of some system font, but \XeLaTeX\ did. And the spacing
-for the letters of the Didot font was vastly different between the two
-engines.
-
-\newcommand\TEST[1]{\MTversion{#1}\def\tmpa{#1}%
- \def\tmpb{normal}\def\tmpc{bold}%
- \ifx\tmpa\tmpb\else\ifx\tmpa\tmpc\else \MTnonlettersobeymathxx
- \MTexplicitbracesobeymathxx\fi\fi
-\begin{multicols}{2}
-\hbox to\columnwidth{\hbox to\columnwidth{\hfil
- $abcdefghijklmnopqrstuvwxyz$\hfil}\kern-2.5em{#1}}
- \centerline{ $ABCDEFGHIJKLMNOPQRSTUVWXYZ$ }
- \centerline{ $0123456789$ }
- \centerline{ $!\,?\,*\,,\,.\,:\,;\,+\,-\,=\,(\,)\,[\,]\,/\,\#\,%
- \$\,\%\,\&\,<\,>\,|\,\{\,\}\,\backslash$ }
- \centerline{ $\mathbf{!\,?\,*\,,\,.\,:\,;\,+\,-\,=\,(\,)\,[\,]\,/\,\#\,%
- \$\,\%\,\&\,<\,>\,|\,\{\,\}\,\backslash}$ }
-\columnbreak
- \centerline{ abcdefghijklmnopqrstuvwxyz }
- \centerline{ ABCDEFGHIJKLMNOPQRSTUVWXYZ }
- \centerline{ 0123456789}
- \centerline{ !\,?\,*\,,\,.\,:\,;\,+\,-\,=\,(\,)\,[\,]\,/\,\#\,%
- \$\,\%\,\&\,<\,>\,|\,\{\,\}\,\char92 }
- \centerline{\bfseries !\,?\,*\,,\,.\,:\,;\,+\,-\,=\,(\,)\,[\,]\,/\,\#\,%
- \$\,\%\,\&\,<\,>\,|\,\{\,\}\,\char92 }
-\end{multicols}}
-\begin{multicols}{2}
- \centerline{\textbf{math mode}}
-\columnbreak
- \centerline{ \textbf{text} }
-\end{multicols}
-\TEST{DejaVu}
-\TEST{Verdana}
-\TEST{Andale}
-%%\TEST{Palladio}
-\TEST{Arial}
-%%\TEST{Chancery}
-\TEST{Liberation}
-\TEST{bold}\TEST{normal}\TEST{Times}
-\end{document}
-%</linux>
-%<*alphabets>
-%% This file `mathastexttestalphabets.tex' is for testing the extended
-%% scope of the math alphabet commands with package `mathastext', via
-%% the package command \MTnonlettersobeymathxx.
-%%
-%% Compile either with latex, pdflatex, lualatex (pdf output) or xelatex.
-%%
-%% See `mathastext.dtx' for the copyright and conditions of distribution or
-%% modification.
-%%
-\documentclass{article}
-\usepackage[hscale=0.66, vscale=0.72]{geometry}
-\usepackage{amsmath}
-\usepackage{mathtools}\mathtoolsset{centercolon}
-%% WARNING THIS IS INCOMPATIBLE WITH BABEL+FRENCHB
-%% BUT WITH MATHASTEXT LOADED THIS IS CORRECTED
-%% *IF* \MTnonlettersobeymathxx IS MADE USE OF.
-\usepackage{iftex}
-\ifXeTeX
-\expandafter\def\expandafter\testfileincipit\expandafter
- {\testfileincipit\ (compiled with \XeLaTeX)}
-\usepackage[no-math]{fontspec}
-\setmainfont[ExternalLocation,
- Mapping=tex-text,
- BoldFont=texgyretermes-bold,
- ItalicFont=texgyretermes-italic,
- BoldItalicFont=texgyretermes-bolditalic]{texgyretermes-regular}
-\setmonofont[ExternalLocation,
- Mapping=tex-text]{texgyrecursor-regular}
-\setsansfont[ExternalLocation,
- Mapping=tex-text]{texgyreheros-regular}
-\else
-\ifLuaTeX % for pdf output
-\expandafter\def\expandafter\testfileincipit\expandafter
- {\testfileincipit\ (compiled with \LuaLaTeX)}
-\usepackage[no-math]{fontspec}
-\setmainfont[Ligatures=TeX]{TeX Gyre Termes}
-\setmonofont[Ligatures=TeX]{TeX Gyre Cursor}
-\setsansfont[Ligatures=TeX]{TeX Gyre Heros}
-\else
-\usepackage[utf8]{inputenc}
-\usepackage[T1]{fontenc}
-\usepackage{tgtermes}
-\usepackage{tgcursor}
-\usepackage{tgheros}
-\fi\fi
-\usepackage{metalogo} % must be loaded /after/ [no-math]fontspec
-\usepackage[french]{babel}
-\usepackage[italic,asterisk]{mathastext}
-\MTlettershape{n}\Mathastext[upright]
-\MTnonlettersobeymathxx
-\MTexplicitbracesobeymathxx
-\delimitershortfall-1pt
-\usepackage{color}
-\begin{document}
-\testfileincipit
-
-\begin{center}
- \bfseries Two features of \texttt{mathastext}:\\
-extended scope of the math alphabets and added italic corrections\par
-\end{center}
-
-The package makes
-${!}\,{?}\,{,}\,{:}\,{;}\,{+}\,{-}\,{=}\,{(}\,{)}\,{[}\,{]}\,{<}\,{>}\,{\{}\,{\}}$,
-the asterisk $*$, and $.\,/\,\vert\,\backslash\,{\#}\,{\$}\,{\%}\,{\&}$ obey the
-math alphabet commands (this is the maximal list, some characters may have been
-excluded by the corresponding package options). For the characters listed first
-the mechanism involves a `mathematical activation'.
-
-As this process may create incompatibilities, it will be put into action
-for
-${!}\,{?}\,{,}\,{:}\,{;}\,{+}\,{-}\,{=}\,{(}\,{)}\,{[}\,{]}\,{<}\,{>}$
-only if the user makes use of the package command
-\verb|\MTnonlettersobeymathxx| (and the braces necessitate
-\verb|\MTexplicitbracesobeymathxx|).
-
-It could be that one such character has been made `active' in the entire
-document by some other package, typically a language definition file for the
-\verb|babel| system. Here for example we have used \verb|babel| with the
-\verb|french| option, which makes the high punctuation characters !?:; active
-throughout the document (extra spacing is put in front of the character when
-used in text; no change in math but perhaps for other languages and characters
-this could happen, it is up to the language definition file to decide).
-
-When \verb|mathastext| detects that a character it wants to `mathematically
-activate' is already `active', it does not go further except if it seems that
-the activation was done by Babel. If the activation was done by Babel, then
-\verb|mathastext| replaces the expansion of the active character in math mode by
-what is necessary to achieve its goal. It does not additionally mathematically
-activate the character; rather it makes sure that the character is \emph{not}
-mathematically active. In the present document the colon was made mathematically
-active by \verb|mathtools| but this was already canceled in the preamble by
-\verb|mathastext| as it was loaded later. And it is better so, because the
-combination \verb|babel| (with option \verb|frenchb|) +\verb|mathtools| (with
-\verb|centercolon|) makes \verb|$:$| create an infinite loop!
-
-But even if someone had mathematically activated the colon after the preamble,
-or after the loading of \verb|mathastext|, this would be canceled again
-automatically for each inline or displayed mathematical formula (if the user
-does \verb|\MTnonlettersobeymathxx|).
-
-The conclusion with \verb|\MTnonlettersobeymathxx| is: if some package has tried
-to make the character mathematically active, this will be overruled by
-\verb|mathastext|; if some package has made the character globally active, then
-the package wins except if it is Babel, as \verb|mathastext| may in the latter
-case safely modify the action in math mode (paying attention to the fact that
-the character should be usable in \verb|\label| and \verb|\ref| in and outside
-of math mode).
-
-The displayed equations next illustrate the extended scope of the math alphabets
-which now apply to $=$, $-$, $($, $)$, $[$, $]$ (but not to the large delimiters
-of course). Furthermore, for testing purposes the equations were labeled using
-such characters, for example the last one has label \verb|eq=7|, to check that
-the mathematical activation of $=$ does not cause problems with
-\verb|\label/\ref|.
-
-\def\testformula{\quad\Biggl\lbrace\biggl(\left(\left[[\sin(a) + \cos(b) - \log(c) =
-\sec(d)]\right]\right)\biggr)\Biggr\rbrace}
-\begin{equation}\testformula\label{eq:1}\end{equation}
-\begin{equation}\mathnormalbold{mathnormalbold:\testformula}\label{eq;2}\end{equation}
-\begin{equation}\mathrm{mathrm:\testformula}\label{eq?3}\end{equation}
-\begin{equation}\mathbf{mathbf:\testformula}\label{eq!4}\end{equation}
-\begin{equation}\mathit{mathit:\testformula}\label{eq(5}\end{equation}
-\begin{equation}\mathtt{mathtt:\testformula}\label{eq)6}\end{equation}
-\begin{equation}\mathsf{mathsf:\testformula}\label{eq=7}\end{equation}
-
-Equations above are numbered \ref{eq:1}, \ref{eq;2}, \ref{eq?3}, \ref{eq!4}, and
-$\ref{eq(5}$, $\ref{eq)6}$, and $\ref{eq=7}$.
-
-\def\testline#1{$#1$&$\mathnormalbold{#1}$&$\mathrm{#1}$&$\mathbf{#1}$&$\mathit{#1}$&$\mathtt{#1}$&$\mathsf{#1}$}
-
-\centerline{\begin{tabular}{ccccccc}
-\testline{a!b}\\
-\testline{a?b}\\
-\testline{a,b}\\
-\testline{a;b}\\
-\testline{a:b}\\
-\testline{a:=b}\\
-\testline{a\vcentcolon= b}\\
-\testline{a\colon b}\\
-\testline{a.b}\\
-\testline{a-b}\\
-\testline{a+b}\\
-\testline{a=b}\\
-\testline{a<b}\\
-\testline{a>b}\\
-\testline{<x,y>}\\
-\testline{\mathopen{<} x,y\mathclose{>}}\\
-\testline{\left< x,y\right>}\\
-\testline{a/b}\\
-\testline{a\backslash b}\\
-\testline{a\setminus b}\\
-\testline{a|b}\\
-\testline{a\mid b}\\
-\testline{(a,b)}\\
-\testline{[a,b]}\\
-\testline{\{a,b\}}
-\end{tabular}}
-
-The question mark has been made active by \verb|babel+frenchb|.
-\verb|mathastext| has imposed in math mode its ways (now \verb|$\mathbf{???}$|
-gives $\mathbf{???}$). As the extra spacing is added by \verb|frenchb| only in
-text, we had to use the math alphabet to check that indeed \verb|mathastext|
-overruled Babel.
-
-To double-check we will now make \string? mathematically active:
-\verb|\mathcode`?="8000|\mathcode`?="8000. This is a sure cause for disaster
-normally with Babel (don't do this at home without \verb|mathastext|!). But here
-with \verb|$?$| no bad surprise (infinite loop!) awaits us: just $?$.
-
-Let's take some other character, for example the opening parenthesis, and make
-it catcode active:
-\verb|\catcode`(=\active \def ({X}|.
-Let's try the input
-\verb|( and $($|.
-\begingroup
-\catcode`(=\active \gdef ({X}
-This gives ( and $($. We see that \verb|mathastext| does not attempt to modify
-the definition of the active character, as this activation was not done via the
-\verb|babel| services. \catcode`\(=12 \mathcode`(="8000 We now revert the
-parenthesis to catcode other (but maintain \verb|\def ({X}| as definition of its
-active version), and then make it mathematically active using the command
-\verb|\mathcode`(="8000|. If we try \verb|$((($| we see that the parenthesis is
-not converted into an $X$: $((($. The mathematically active character was
-overruled by \verb|mathastext|.
-
-Issuing \verb|\MTnonlettersdonotobeymathxx|\MTnonlettersdonotobeymathxx\ we do
-get the $X$'s from the input \verb|$((($|: $((($
-\endgroup
-This shows that \verb|mathastext| now does not modify in math mode the
-non-letter \verb|(|.
-
-\MTversion{upright}\MTnonlettersobeymathxx
-We defined in the preamble of the document a \verb|mathastext|-enhanced
-math version (named \verb|upright|) having the Latin letters upright in
-math mode. Let's switch to
-it: \newline
-\hbox to\linewidth{\hss\verb|\MTversion{upright}|\hss}
-
-With a font which is neither italic nor slanted, \verb|mathastext| automatically
-inserts italic corrections for better positioning of the subscript:
-\verb|$f_i^i$| gives
-$f_i^i$.
-After \verb|\MTnoicinmath| which turns off this feature\MTnoicinmath{}, the same
-input gives $f_i^i$, which is different.
-\footnote{last time I tried, this only worked with PDF\LaTeX{}, not with
- \LuaLaTeX{} or \XeTeX{}.}
-
-Again with italic corrections on (\verb|\MTicinmath|)\MTicinmath{}
-\verb|$f_{abc}^{def}$| gives $f_{abc}^{def}$, and here is another one:
-$f^{f_{abc}^{def}}_u$. Without italic corrections\MTnoicinmath: $f_{abc}^{def}$,
-and respectively $f^{f_{abc}^{def}}_u$.
-
-\MTicinmath
-
-\verb|mathastext| does not add these italic corrections inside arguments of
-math alphabets, as this would prevent the formation of ligatures:
-$\mathnormal{ff}$, $\mathrm{ff}$, $\mathit{ff}$, $\mathbf{ff}$, $\mathtt{ff}$
-(no ligature in teletype) and $\mathsf{ff}$.\footnote{\llap{\textcolor{magenta}{\bfseries Changed!\kern3em}}Prior to 1.3i,
- italic corrections were added to the \string\mathnormal\ arguments.}
-
-\centerline{\begin{tabular}{ccccccc}
-\testline{a!b}\\
-\testline{a?b}\\
-\testline{a,b}\\
-\testline{a;b}\\
-\testline{a:b}\\
-\testline{a:=b}\\
-\testline{a\vcentcolon= b}\\
-\testline{a\colon b}\\
-\testline{a.b}\\
-\testline{a-b}\\
-\testline{a+b}\\
-\testline{a=b}\\
-\testline{a<b}\\
-\testline{a>b}\\
-\testline{<x,y>}\\
-\testline{\mathopen{<} x,y\mathclose{>}}\\
-\testline{\left< x,y\right>}\\
-\testline{a/b}\\
-\testline{a\backslash b}\\
-\testline{a\setminus b}\\
-\testline{a|b}\\
-\testline{a\mid b}\\
-\testline{(a,b)}\\
-\testline{[a,b]}\\
-\testline{\{a,b\}}
-\end{tabular}}
-
-\end{document}
-%</alphabets>
%<*dtx>
^^Afi^^Aendgroup % end of big \iffalse block including generated files
% Removal of the *sfixed found in tex/latex/mlmodern/omxmlmex.fd
@@ -1523,7 +1117,7 @@ $\mathnormal{ff}$, $\mathrm{ff}$, $\mathit{ff}$, $\mathbf{ff}$, $\mathtt{ff}$
\def\cmd#1{\cs{\expandafter\cmd@to@cs\string#1}}
\def\cmd@to@cs#1#2{\char\number`#2\relax}
% Here I am loading doc=v2 but formerly I was using ltxdoc via scrdoc
-% which I dropped at release 1.4l (2022-05-29) and without much
+% which I dropped at (etoc) release 1.4l (2022-05-29) and without much
% thinking I had kept this.
\DeclareRobustCommand\cs[1]{\texttt{\bslash#1}}
% As I may have the * active, or macro names with _ or ^, I should
@@ -1552,12 +1146,19 @@ $\mathnormal{ff}$, $\mathrm{ff}$, $\mathit{ff}$, $\mathbf{ff}$, $\mathtt{ff}$
% is set by geometry package and a4paper option from xint.tex file. So it
% seems I only need the hologo loading:
\usepackage{hologo}
-\DeclareRobustCommand*{\eTeX}{\hologo{eTeX}}%
-\DeclareRobustCommand*{\pdfLaTeX}{\hologo{pdfLaTeX}}%
-\DeclareRobustCommand*{\LuaTeX}{\hologo{LuaTeX}}%
-\DeclareRobustCommand*{\LuaLaTeX}{\hologo{LuaLaTeX}}%
-\DeclareRobustCommand*{\XeTeX}{\hologo{XeTeX}}%
-\DeclareRobustCommand*{\XeLaTeX}{\hologo{XeLaTeX}}%
+% 1.4 fix to some extra line spacing obviously caused by usage of the
+% \hologo macro.
+% I opened https://github.com/ho-tex/hologo/issues/9
+% after testing, actually only XeTeX and XeLaTeX are problematic
+% update: as per @u-fischer the problem goes away if graphicx package
+% is loaded, but we don't use it in this document...
+\def\msthologo#1{\smash{\hologo{#1}}}
+\DeclareRobustCommand*{\eTeX}{\msthologo{eTeX}}%
+\DeclareRobustCommand*{\pdfLaTeX}{\msthologo{pdfLaTeX}}%
+\DeclareRobustCommand*{\LuaTeX}{\msthologo{LuaTeX}}%
+\DeclareRobustCommand*{\LuaLaTeX}{\msthologo{LuaLaTeX}}%
+\DeclareRobustCommand*{\XeTeX}{\msthologo{XeTeX}}%
+\DeclareRobustCommand*{\XeLaTeX}{\msthologo{XeLaTeX}}%
%
\makeatother
%%% end of ltxdoc+srcdoc emulation from June 2022 xint.dtx,
@@ -1669,7 +1270,8 @@ pdfpagemode=UseOutlines,%
asterisk,%
defaultmathsizes,%
symbolmisc,symbolre,%
- LGRgreek+]{mathastext}
+ LGRgreek+,
+ activedigits]{mathastext}
\let\symbolbullet\bullet
\let\bullet\originalbullet
% This version will use the mlmodern font which is current
@@ -1790,15 +1392,15 @@ pdfpagemode=UseOutlines,%
\def\tt {\normalfont\ttfamily}
% mais bon, en fait je ne les utilise pas.
-% 2023/12/27 pas encore
-% \newcommand\mstrelease[1]{\hyperlink{v#1}{\texttt{#1}}}
-
% 2023/12/27
\DeclareRobustCommand\ctanpkg[1]
{\texorpdfstring{\href{https://ctan.org/pkg/#1}{#1}}{#1}}
-% bataille avec le rendu de l'entrée 1.3zb du change log
-% \hyphenation{ncc-comma}
+% 2024/07/10
+% Attention que si la cible n'existe pas il n'y a AUCUN warning
+% dans le log...
+\newcommand\mstrelease[1]{\hyperlink{#1}{\texttt{#1}}}
+
\begin{document}
% \makeatletter\show\mv@normal\makeatother
% contient
@@ -1924,10 +1526,6 @@ the preamble:
\end{verbatim}
The package records which font is set up for text, at the time it is
loaded,
-%\footnote{alternatively it is possible to configure the text font after
- % loading \mst, and then the command \cs{Mathastext} will accomplish the
- % necessary changes to the font for letters, digits and a few extra ascii
- % symbols in math mode.}
and
then arranges things in order for this text font to be used in math mode as
well. So, with the preamble as above
@@ -1955,293 +1553,6 @@ The exact list of characters concerned by
As one can see, this is a very limited list! Some possibilities exist
regarding Greek letters and will be described later.
-\subsection{Miscellanea}
-
-Please note that most of this section was written many years ago (except for
-the item about math alphabets which was enriched with important background
-information and moved upfront at |1.3zb|). But it should still be valid!
-%
-\begin{description}
-
-\item[math alphabets:] Let us first recall fundamental facts of life, in the
- world of traditional PDF\TeX\ engine and \TeX\ fonts, as background for
- understanding what \mst does in this context, which will be explained next.
- People familiar with using Unicode engines and \ctanpkg{unicode-math}, please be
- aware that the semantics there of the \LaTeX\ math alphabet commands are
- \textbf{significantly} modified!
-\begin{snugshade}
-\begin{itemize}
-\item In the default \LaTeX\ set-up all five of §\mathrm§, §\mathbf§,
- §\mathit§, §\mathsf§ and §\mathtt§ tell \TeX\ to use for their arguments
- specific \texttt{OT1}-encoded fonts,
-\item if the document body uses, as will be the case probably with any
- language other than English or its variants, some other encoding such as
- \texttt{T1} for its fonts, there is no change whatsoever to the math
- configuration, indeed most font packages ignore it completely,
-\item it is thus a priori wrong to think of these commands as switching to
- some body text font, although letters within their scopes will act as in a
- text font, and in particular obey ligatures (this also applies to operator
- names defined by |amsmath|'s \cs{DeclareMathOperator} which are, with some
- extras not mentioned here, as using §\mathrm§),
-\item these commands are completely different in spirit from the \LaTeX\
- \cs{textrm}, \cs{textbf}, and others, which change only some font axis;
- indeed the math alphabet commands inherit from legacy Knuth's \cs{rm},
- \cs{bf}, and others which are complete font specifiers,
-\item in particular when nesting, it is the inner-most which wins,
-\item only mathematical characters (such as letters) which are declared to
- \TeX\ as being of ``variable family type'' react to being in the argument of
- a math alphabet command,
-\item lowercase Greek letters are by default in \LaTeX\ immune to math
- alphabets (so \verb|\mathrm{\pi}| induces no change in output), but the
- eleven uppercase Greek letters are of ``variable family type'' because they
- are picked in the \texttt{OT1}-encoded font also used for operator names
- (the one to which §\mathrm§ maps), \emph{and they occupy the exact same
- slots in the \emph{\texttt{OML}}-encoding to which} §\mathnormal§ maps! So
- in default \TeX, \verb|\mathnormal{\Gamma}| gives a slanted one. The slots
- occupied in \texttt{OML}-encoding by the lowercase Greek letters (to which
- encoding they are a priori assigned) give
- completely unrelated glyphs in the \texttt{OT1}-encoding, so it makes sense
- that the default \LaTeX\ declares them to not react to math alphabets.
- Notice though, that if \LaTeX\ had declared a \cs{mathnormalbold}, mapping
- to a bold \texttt{OML}-encoded font, it would have made sense to also have
- \cs{alpha}, \cs{beta}, etc... be of ``variable family type'',
-\item but of course then one should a priori never use |\mathbf{\pi}| for
- example, because the default §\mathbf§ selects an \texttt{OT1}-encoded
- font, where there is no pi glyph whatsoever and in particular not at the slot of
- pi in the \texttt{OML} encoding (slot number 25)!
-\end{itemize}
-\end{snugshade}
-Please keep all the above in mind when trying to understand what \mst does
-with math alphabets. The most significant point described next naturally is that
-\mst will sync §\mathnormal§, §\mathrm§, §\mathbf§, §\mathit§, §\mathsf§ and
-§\mathtt§ to map to the \mst-ified body text fonts.
- \begin{itemize}
- \item §\mathnormal§, §\mathrm§, §\mathbf§, §\mathit§,
- §\mathsf§ and §\mathtt§ are modified to use the \mst-ified
- text fonts; this can be disabled via §defaultalphabets§ and
- related individual options, but the package always provides
- §\Mathnormal§, §\Mathrm§, etc..., to match the \mst font
- configuration (\RLNote{changed:}{1.3za}prior to |1.3za|
- §defaultalphabets§ and related options also caused the \mst
- alphabet commands not to be defined). Recall that there may
- arise a ``too many math alphabets'' error if too many of these
- commands are \emph{used} in the document:
- \emph{declaring} them is not by itself the cause of the error. See the
- \LaTeX\ news entry of its \texttt{2021-11-15} release for
- the counter \texttt{localmathalphabets} (with default value 2)
- which can be now be used if one hits such a difficulty.
- \item We define a new math alphabet command
- §\mathnormalbold§ which gives direct access to
- the bold version of the §\mathnormal§ alphabet
- (rather than using either the \cs{bm} command from
- the \ctanpkg{bm} package or the \cs{boldsymbol} command
- from the \ctanpkg{amsbsy} package). As it does not
- exist in the default \LaTeX{} math font set-up, this
- alphabet is \emph{not} subjected to the {subdued option} action.
-
-\item version \RightNote{1.2}|1.2| of \mst has extended the scope of the math
- alphabets to apply to non-alphabetical characters and to
- operator names. This respects the automatic white spaces
- added by \TeX{} around math symbols.
-\item The\RightNote{1.3i}
- extra skips around letters (see \autoref{sec:mathskips} and
- \autoref{sec:ic}) are removed in the scope of the math alphabets.
-
- \item Depending on options, further math alphabet commands
- are defined by the package: §\MathEulerBold§,
- §\MathEuler§, §\MathPSymbol§, and since |1.3x| under
- the §LGRgreek§ family of options\RightNote{1.3x} also
- §\mathgreekup§ and §\mathgreekit§. See
- \autoref{sec:newgreek}.
- \item \RightNote{1.3za}Addition of §\mathgreekupbold§ and
- §\mathgreekitbold§ under the §LGRgreek§ family of options.
- \item With\RightNote{1.3za} the §LGRgreek+§ option
- which enhances Greek letters with a specific behavior when in the
- arguments of the §\mathrm§, §\mathbf§, etc..., math alphabet
- commands, this special behavior is not triggered by the §\Mathrm§,
- §\Mathbf§, et al., which are genuine unmodifed math alphabet commands. See
- \autoref{sec:newgreekplus}.
- \end{itemize}
-
-\item[the en-dash as minus sign:] very often the -
- character from the text font does not give a good
- minus sign. So by default, the package uses the
- en-dash sign \textendash{}. Use §noendash§ to
- deactivate it. Starting with version |1.12| of the
- package this `en-dash as minus' should work in all
- encodings, including Unicode (if \ctanpkg{fontspec} has been
- loaded); see also |unicodeminus| for OpenType fonts.
-
-\item[amsmath:] \strut the behaviour of the
- \cs{DeclareMathOperator}\RightNote{1.3n} command
- of |amsmath| is modified by \mst for it to use the correct font.
- Additionally, release |1.3n| of \mst at long last also handles an extra
- operation done by |amsmath| for |'.:/-*| to be used in operator names
- without the extra math spacing.%
-%
-\footnote{To the experts: there is a long story here that \cs{newmcodes@}
- hardcodes the font, that it was not compatible with Unicode engines, that
- during some time (2013-2016) \texttt{lualatex-math} fixed that and very
- recently |amsopn.sty 2016/03/08 v2.02| also, so now \texttt{lualatex-math
- 1.6} does nothing as it is already fixed ``upstream'' in |amsopn.sty|, but
- anyhow in both cases, this still hardcoded the font, so finally \mst does
- the right thing from its point of view. See the code comments for more,
- there is an issue here with \LuaLaTeX\ not applying the curly right quote
- contrarily to \XeLaTeX.}
-%
-This customization is suppressed in §subdued§ mode for the |normal| and |bold|
-math versions.
-
-\item[hbar:] the default \LaTeX\ definition of §\hbar§ would in our context
- make use of the |h| of the current math font (so for us, it is also the text
- font, perhaps in italic shape), but with a bar accross the |h| from the
- original default math font for letters (usually |cmmi|). We redefine
- \cs{hbar} to use the text font macron accent (|\=|) as a mock math accent
- (this takes into account the §italic§ option and is compatible with
- subscripts and superscripts).
-
- Since |1.12| \mst when dealing with a Unicode font sets the \cs{hbar}
- to be the character from the font having hexadecimal codepoint |U+0127|.
-
- Since |1.3u| the general 8bits font encoding is
- supported\RightNote{1.3u} (see discussion of the |mathaccents| option
- at end of this list for the shared limitations). Brief testing with
- various usual \TeX\ fonts shows that the vertical positioning of
- the bar isn't satisfying. It is planned to either add a parameter to
- adjust it or to modify altogether the mode of construction of the |\hbar|.
-
- Use §nohbar§ to tell \mst not do provide its own |\hbar|.
-
-
-\item[dotless i and j:] by default the package redefines \cs{imath} and
- \cs{jmath} to give (in math mode) the dotless i and j (if it exists at
- all) from the text font.%
-%
-\footnote{\RightNote{1.3t}Since \texttt{1.12} it also redefined \cs{i} and
- \cs{j} for usability both in text and math modes, but this has been
- dropped at \texttt{1.3t}. Breaking change!}
-
-\item[asterisk:] versions of \mst earlier than |1.2d [2013/01/02]|
- did not do anything
- with the \cs{ast} control sequence but did pick the asterisk
- $*$ in the document text font, and this often was a rather
- silly thing as the text asterisk is generally in a raised
- position. Furthermore, the $*$ lost its status of a binary
- operator and was treated as an `ordinary' symbol. An option
- |noasterisk| turned this feature off. Starting with |1.2d|,
- the |noasterisk| option is deprecated and the new default is
- to do nothing. But when option §asterisk§ is received by the
- package, then both \cs{ast} and $*$ are simultaneously
- modified to use (as binary operators) the text asterisk,
- slightly lowered. The amount of lowering\footnote{with the
- option \texttt{symbolmisc}, the asterisk is picked from
- the Symbol font, and the amount of lowering is
- non-customizable; however if a math alphabet command is
- used, the asterisk is then again from a text font and the
- lowering will be as specified by \cs{MTlowerast}.} is
- decided by the mandatory argument to the command
- \csb{MTlowerast}\marg{dimen}. The package initially does
- \cs{MTlowerast}|{.3\height}|. Doing \cs{MTlowerast}|{.5ex}| is
- not a good idea as it does not scale properly in the script
- and scriptscript styles. With an argument given as a
- multiple of |\height|, the asterisk will behave as expected
- in subscripts and subscripts of subscripts. But $*$ is now
- `mathematically active'\thinspace\footnote{in a hopefully
- safe way, for example {\ttfamily\$\string\label\{eq*1\}\$}
- is ok.} and |$R^*$| or |$R^\ast$| \emph{must} be input as
- |$R^{*}$| and |$R^{\ast}$|. Furthermore, they will obey the
- math alphabet commands.
-
-\item[\XeTeX{} and \LuaLaTeX{}:] regarding the en-dash and the
- dotless i and j, the package is now under the Unicode engines
- compatible not only with the ``Unicode'' \LaTeX\ font encodings
- EU1 (\XeTeX, old fontspec), EU2 (\LuaLaTeX, old fontspec), TU
- (\XeTeX\ and \LuaLaTeX, modern fontspec), but also with
- traditional 8bits-encodings declared as a |fontenc|
- option.\RightNote{1.3u}
-
-% obsolete
- % Formerly, with a Unicode engine,
- % only OT1, T1 and LY1 were supported by \mst as the 8bit encoding
- % of the document text font, regarding the minus as en-dash and
- % the dotless i and j.
-
- \item[fontspec:] one more note to users of
-\XeTeX{}/\LuaLaTeX{} with \ctanpkg{fontspec}:\newline
-\fbox{it has to be
-loaded {with the option} |no-math|},
-and \emph{before} \mst.
-
-\item[vec accent:] The default \cs{vec} accent is not
- appropriate for upright letters, so \mst
- provides a \cs{fouriervec} which takes its glyph in a
- Fourier font, and an Ersatz \cs{pmvec}
- which is reasonably good looking on upright letters
- and works with the \cs{rightarrow} glyph. Contrarily
- to version |1.0|, the default \cs{vec} is not
- overwritten with \cs{fouriervec}. And contrarily to
- version |1.1|, one now needs to pass the option
- §fouriervec§ to have the math accent \cs{fouriervec}
- defined by the package.%
-%
-\footnote{this costs a math family, as I never came back to this to try to
- do otherwise.}
-
-\item[math accents:] if option §mathaccents§ is used then \mst attempts to let
- the math accents |\acute|, |\grave|, etc... use the suitable glyphs from the
- text font. Prior to |1.3u| only |OT1|, |T1|, and |LY1| were supported (via
- hardcoded slots). It should now work with any 8bits font
- encoding\RightNote{1.3u} having been declared as an option to the
- \ctanpkg{fontenc} package (and of course providing the ten needed text accents which
- will mock math accents).%
- %
- \footnote{The code will raise low-level \TeX\ errors if the user attempts to
- use an 8bits font encoding whose \LaTeX\ definition file is lacking the
- suitable uses of \cs{DeclareTextAccent} or if the low level \LaTeX\ macro
- implementation of text accents changes significantly; in such cases please
- report the problem to the author, so that it can be documented in future
- releases!}
-
- The |\vec| math accent is not handled here, as it is not available in the
- usual 8bits font encodings. See the §fouriervec§ option or the §\pmvec§
- command.
-
- The math accents obey the §subdued§ option\RightNote{1.3u}
- and will change in sync with the \mst-ified text font used in
- each non subdued math version.
-
- (Very) brief testing during |1.3u| development with \XeTeX\ and \LuaTeX\ let
- the author conclude that usage with the \cs{Umathaccent} primitive of an
- OpenType accent glyph slot (which in the text font is for usage as a
- postpended combining character) gives definitely bad horizontal placements
- for both engines (each in its own way). Thus, the redefinitions of accents
- for a \mst declared math version with an OpenType font is by default
- canceled.%
-%
-\footnote{I.e., the \cs{grave} etc... control sequences will, in math versions
- with an OpenType \mst-ified font, expand to macros holding their initial
- meanings, unmodified by \mst, which was in force at the
- |\string\begin\string{document\string}|.}
-%
- Use §unimathaccents§ to force usage of the OpenType font text
- accents glyph slots with the \cs{Umathaccent} primitive. Expert users are
- invited to check out the code and to contribute suggestions if some extras
- can improve it.
-
-\item[varying font encodings:] the very first release of \mst dealt with only
- one font; very soon thereafter it acquired the capacity to define multiple
- math versions, each one using its own text font. But, as was documented at
- this location formerly, various encoding dependent decisions were done once
- and for all during package loading.
-
- This meant in particular that the minus sign (using the text endash), the
- dotless |i| and |j|, the |\hbar|, the math accents were all set up for only
- one unique font encoding. It was thus recommended that all math versions
- share the same font encoding.
-
- The |1.3u| release has lifted this restriction.\RightNote{1.3u}
-\end{description}
-
\subsection{Examples}
\label{sec:examples}
@@ -2473,7 +1784,7 @@ versions.%
% \href{http://mirrors.ctan.org/help/Catalogue/entries/cbgreek-complete.html}{cbfonts},
% \href{http://mirrors.ctan.org/help/Catalogue/entries/txfontsb.html}{txfontsb}.
-\emph{Since |1.3x| this documentation uses globally the |mlmodern|%
+\emph{Since \mstrelease{1.3y} this documentation uses globally the |mlmodern|%
%
\footnote{Daniel Benjamin \textsc{Miller}, \emph{A blacker Type 1 version of Computer Modern, with multilingual
support}, \url{https://ctan.org/pkg/mlmodern}. I have added to the preamble
@@ -2500,7 +1811,7 @@ reasons of PDF file size.}%
\subsubsection{The \blueit{italic} option}
-In the initial version |1.0|, the Latin letters in
+In the initial version \mstrelease{1.0}, the Latin letters in
mathematical mode assumed the exact same shape as in
text mode, and this meant, generally speaking, that
they would turn up upright. Doing this gives a very
@@ -2510,15 +1821,15 @@ one of the design goals of \mst.
Nevertheless, soon after I posted the initial version
of the package to CTAN, I was overwhelmed by
-numerous\footnote{this means ``more then one.''}
+numerous\footnote{this means ``more than one.''}
questions\footnote{I thank in particular
Tariq~\textsc{Perwez} and Kevin~\textsc{Klement} for
their kind remarks (chronological order).} on how to
have the letters be in italic shape.
-The default is still, as in version |1.0|, for everything to be in
+The default is still, as in version \mstrelease{1.0}, for everything to be in
upright shape, but it suffices to pass to the package the option
-§italic§\RightNote{1.1} to let the Latin letters in math mode be
+§italic§\RightNote{\mstrelease{1.1}} to let the Latin letters in math mode be
in italic shape.%
%
\footnote{more precisely stated, the value of \cs{itdefault}
@@ -2547,7 +1858,7 @@ the \ctanpkg{moresize} package. To cancel all of this use option
\subsubsection[The subdued option]{The \blueit{subdued} option}\label{sec:subdued}
-This option was introduced in |v1.15|.\RightNote{1.15} It provides a manner to
+This option was introduced in |v1.15|.\RightNote{\mstrelease{1.15}} It provides a manner to
switch on the \mst-\emph{ification} only for limited portions of
the document, with the help of the mechanism of math versions. Without the
§subdued§ option, the \emph{mathastextification} applies by default
@@ -2560,7 +1871,7 @@ Despite some limitations I will now partially describe, the §subdued§ option
has its utility, as I think is illustrated enough by the examples given at the
start of this document and it works reasonably well.
-\begin{framed}
+\begin{shaded*}
\mst was not written initially in order to allow its action to
be completely canceled. It does not store (all) mathcodes nor
does it set them (all) when changing math versions; only that would
@@ -2569,7 +1880,7 @@ start of this document and it works reasonably well.
official interface to math mode, as it is almost entirely
preamble only).
- Releases |1.3t| and |1.3u| do this kind of things to maintain
+ Releases \mstrelease{1.3t} and \mstrelease{1.3u} do this kind of things to maintain
usability across multiple \mst-ified math versions of characters
which are obviously font encoding dependent such as the minus
sign as en-dash (or unicode minus), the dotless i, the |\hbar|,
@@ -2581,7 +1892,7 @@ start of this document and it works reasonably well.
mode and to multiple math versions amounts to some kind of a
kludge, added to an initial design which handled a single unique
text font.
-\end{framed}
+\end{shaded*}
To get the displayed math
(almost) as if \mst had not been loaded, one must also
@@ -2590,7 +1901,7 @@ as, for example, the colon, the dot, and the minus sign belong
in the default \LaTeX{} math mode set-up to three distinct fonts
whereas \mst will pick (even subdued) the three of them in the same
font,%
-\footnote{\RightNote{1.3t}The minus sign is now perfectly subdued,
+\footnote{\RightNote{\mstrelease{1.3t}}The minus sign is now perfectly subdued,
because its original mathcode is stored and restored; this was only
way to handle the case with Unicode engines
where the math operator font is in a classic
@@ -2604,13 +1915,13 @@ mathcodes, so to
be on the safe side one needs the §basic§ option which limits the
mathastextification to letters and digits.%
%
-\footnote{\RightNote{1.3d}The §subdued§ mode does extinguish
+\footnote{\RightNote{\mstrelease{1.3d}}The §subdued§ mode does extinguish
in the normal and bold math versions the action of options §selfGreek§,
§eulergreek§, and §symbolgreek§ (previously only §LGRgreek§ was
subdue-able).}
-\footnote{\RightNote{1.3t}The \texttt{\string\imath} and
+\footnote{\RightNote{\mstrelease{1.3t}}The \texttt{\string\imath} and
\texttt{\string\jmath} now obey the subdued regime.}
-\footnote{\RightNote{1.3u}Also \texttt{\string\hbar}
+\footnote{\RightNote{\mstrelease{1.3u}}Also \texttt{\string\hbar}
and the math accents (see §mathaccents§ option) obey the subdued regime.}
%
Even then, in some circumstances, this may not suffice: for example the
@@ -2644,80 +1955,192 @@ customization of Greek letters. The command §\MTcustomgreek§ reenables the
customization done by \mst, if it was loaded with the §LGRgreek§ or one of the
other Greek related options.
-\begin{framed}
- Release |1.3x| has added important new aspects to the handling of Greek
+\begin{shaded*}
+ Release \mstrelease{1.3y} has added important new aspects to the handling of Greek
letters via the §LGRgreek§ option. Make sure to read the \autoref{sec:newgreek}.
-\end{framed}
+\end{shaded*}
+
+\subsection{Miscellanea}
+
+Please note that most material to be found in this section was written many
+years ago (except the two subsections on §frenchmath§ on one hand and
+intervals on the other hand). But it should still be valid!
-\subsection{More miscellanea}
+Ultimately most information here should be moved into the
+reference sections \autoref{sec:cmd} and \autoref{sec:opt}, and only some
+generalities should be kept here.
-This may repeat information already given.
+\subsubsection{Load \mst always last}
+
+The ``large'' math symbols are not modified in any way by \mst. Only loading
+some math font packages such as \ctanpkg{fourier}, \ctanpkg{kpfonts}, \ctanpkg{mathabx}, \ctanpkg{mathdesign},
+\ctanpkg{txfonts}, \ctanpkg{newtxmath}, \ctanpkg{libertinust1math}, others\dots{} will change them. Think of loading these
+packages before \mst, else they might undo what \mst did.
+
+More generally any package (such as \ctanpkg{amsmath}) dealing with math mode should be
+loaded \emph{before} \mst.
\subsubsection{Avoid \texorpdfstring{\texttt{OT1}}{OT1} encoding}
- We specified in our minimal working example a |T1| encoding (|LY1| would
- have been ok, too) because the default |OT1| does not have the
+ The default |OT1| does not have the
{\color{joli}\DeleteShortVerb{\|}
$\mathord{<}\,\mathord{>}\,\mathord{|}$\,\{\,\}} and
{\color{joli}$\backslash$\MakeShortVerb{\|}} glyphs. If
\mst detects |OT1| as the default encoding it will leave these characters to
- their defaults from the math fonts.\footnote{the §subdued§ option, described next,
+ their defaults from the math fonts.%
+%
+\footnote{The §subdued§ option, described next,
acts a bit otherwise, it forces, contrarily to its usual low-key character,
the replacement of |OT1| by |T1| for the fonts ultimately used with letters
and digits in math mode.}
-\begin{framed}
+%
+\begin{shaded*}
If \mst detects the obsolete |OT1| encoding it does not do anything with
\DeleteShortVerb{\|}<, >, |, \{, and \} which (except for monospace fonts)
are not available in that encoding.\MakeShortVerb{\|}
To fully benefit from \mst it is
recommended to use some other encoding having these glyphs such as |T1| or
|LY1|.
-\end{framed}
+\end{shaded*}
\subsubsection{Derivative, minus, asterisk}
The text characters {}'{} and {}-{} are not used, and the asterisk is
-done optionally:
+done only optionally:
\begin{itemize}
\item the derivative sign ${}'$ is left to its default as the text font
- glyph {}'{} is not, as a rule, a satisfying alternative.\footnote{|v1.2| adds
+ glyph {}'{} is not, as a rule, a satisfying alternative.%
+%
+\footnote{|v1.2| adds
a customizable tiny space before ${}'$ to separate it from the previous
letter, this is really needed when using upright letters in math mode with
the CM derivative glyph.{\MTversion{upright}\sffamily\MTprimeskip{.5mu}%
Compare $f'$ with \MTprimeskip{0mu}$f'$.} }
+
\item for the minus sign \mst uses the endash character
- \textendash, if available, and not the hyphen character -.%
-%
-\footnote{see the §unicodeminus§ option if using an OpenType font.}
-%
-\item the §asterisk§ option is mandatory for \mst to replace the binary math
- operator $*$ (and the equivalent control sequence \cs{ast}) with a version
- which uses the text asterisk * suitably lowered\footnote{the amount of
- lowering can be customized.} (and with the correct spaces around it as
- binary operator). The reason is that after this inputs such as |$R^*$|
- or |$R^\ast$| raise errors and \emph{must} be written |$R^{*}$| or |$R^{\ast}$|.
+ \textendash, if available, and not the hyphen character -. With
+an OpenType font, \mst uses per default the EN DASH U+2013 (see §unicodeminus§).
+
+\item the §asterisk§ option is required for \mst to use the text font for the
+ binary infix math operator $*$ and
+ the control sequence \cs{ast}. They will use then the text asterisk
+ * suitably lowered, and with the correct spaces around it as binary
+ operator.
+ \begin{snugshade}
+ Attention that with this option, inputs such as |$R^*$| or |$R^\ast$|
+ raise errors and \emph{must} be replaced by |$R^{*}$|, respectively
+ |$R^{\ast}$|.
+ \end{snugshade}
\end{itemize}
+\subsubsection{Large symbols and delimiters}
+
Nothing is changed to the ``large'' math symbols, except for
$\MToriginalprod$ and $\MToriginalsum$ in inline math which, like here:
$\prod\sum$, will be taken from the Symbol Font if option §symbolmisc§
was used.
The left and right delimiters are taken from
-the text font only for the base size: any |\big|, |\bigl|, |\bigr|,
-etc\dots reverts to the original math symbols.
+the text font only for the base size: any one of |\big|, |\bigl|, |\bigr|,
+etc\dots will trigger the use of the original math symbols.
+\subsubsection{amsmath}
+The behavior of the
+ \cs{DeclareMathOperator}\RightNote{\mstrelease{1.3n}} command
+ of |amsmath| is modified by \mst for it to use the correct font.
+ Additionally, release \mstrelease{1.3n} of \mst at long last also handles an extra
+ operation done by |amsmath| for |'.:/-*| to be used in operator names
+ without the extra math spacing.%
+%
+\footnote{To the experts: there is a long story here that \cs{newmcodes@}
+ hardcodes the font, that it was not compatible with Unicode engines, that
+ during some time (2013-2016) \texttt{lualatex-math} fixed that and very
+ recently |amsopn.sty 2016/03/08 v2.02| also, so now \texttt{lualatex-math
+ 1.6} does nothing as it is already fixed ``upstream'' in |amsopn.sty|, but
+ anyhow in both cases, this still hardcoded the font, so finally \mst does
+ the right thing from its point of view. See the code comments for more,
+ there is an issue here with \LuaLaTeX\ not applying the curly right quote
+ contrarily to \XeLaTeX.}
+%
+This customization is suppressed in §subdued§ mode for the |normal| and |bold|
+math versions.
-\subsubsection{Load \mst always last}
+\subsubsection{hbar}
+The default \LaTeX\ definition of §\hbar§ would in our context
+ make use of the |h| of the current math font (so for us, it is also the text
+ font, perhaps in italic shape), but with a bar accross the |h| from the
+ original default math font for letters (usually |cmmi|). We redefine
+ \cs{hbar} to use the text font macron accent (|\=|) as a mock math accent
+ (this takes into account the §italic§ option and is compatible with
+ subscripts and superscripts).
-The ``large'' math symbols are not modified in any way by \mst. Only loading
-some math font packages such as \ctanpkg{fourier}, \ctanpkg{kpfonts}, \ctanpkg{mathabx}, \ctanpkg{mathdesign},
-\ctanpkg{txfonts}, \ctanpkg{newtxmath}, etc\dots{} will change them. Think of loading these
-packages before \mst, else they might undo what \mst did.
+ Since \mstrelease{1.12} \mst when dealing with a Unicode font sets the \cs{hbar}
+ to be the character from the font having hexadecimal codepoint |U+0127|.
-More generally any package (such as \ctanpkg{amsmath}) dealing with math mode should be
-loaded \emph{before} \mst.
+ Since \mstrelease{1.3u} the general 8bits font encoding is
+ supported\RightNote{\mstrelease{1.3u}} (see discussion of the |mathaccents| option
+ at end of this list for the shared limitations). Brief testing with
+ various usual \TeX\ fonts shows that the vertical positioning of
+ the bar isn't satisfying. It is planned to either add a parameter to
+ adjust it or to modify altogether the mode of construction of the |\hbar|.
+
+ Use §nohbar§ to tell \mst not do provide its own |\hbar|.
+
+
+\subsubsection{Dotless i and j}
+By default the package redefines \cs{imath} and
+ \cs{jmath} to give (in math mode) the dotless i and j (if it exists at
+ all) from the text font.%
+
+ \subsubsection{fontspec}
+
+\fbox{\ctanpkg{fontspec}
+has to be
+loaded {with the option} |no-math|},
+\emph{and before} \mst.
+
+\subsubsection{vec accent}
+
+The default \cs{vec} accent is not appropriate for upright letters, so \mst
+provides under option §fouriervec§ a math accent control sequence
+\cs{fouriervec} which takes its glyph in a Fourier font. A poorman Ersatz
+\cs{pmvec} is always available ; it is reasonably good looking on upright
+letters and works with the \cs{rightarrow} glyph.
+
+\subsubsection{math accents}
+If option §mathaccents§ is used then \mst attempts to let
+ the math accents |\acute|, |\grave|, etc... use the suitable glyphs from the
+ text font.
+
+ The |\vec| math accent is not handled here, as it is not available in the
+ usual 8bits font encodings. See the §fouriervec§ option or the §\pmvec§
+ command.
+
+ The math accents obey the §subdued§ option\RightNote{\mstrelease{1.3u}}
+ and will change in sync with the \mst-ified text font used in
+ each non subdued math version.
+
+\begin{footnotesize}
+ (Very) brief testing during \mstrelease{1.3u} development with \XeTeX\ and \LuaTeX\ let
+ the author conclude that usage with the \cs{Umathaccent} primitive of an
+ OpenType accent glyph slot (which in the text font is for usage as a
+ postpended combining character) gives definitely bad horizontal placements
+ for both engines (each in its own way). Thus, the redefinitions of accents
+ for a \mst declared math version with an OpenType font is by default
+ canceled.%
+%
+\footnote{I.e., the \cs{grave} etc... control sequences will, in math versions
+ with an OpenType \mst-ified font, expand to macros holding their initial
+ meanings, unmodified by \mst, which was in force at the
+ |\string\begin\string{document\string}|.}
+%
+ Use §unimathaccents§ to force usage of the OpenType font text
+ accents glyph slots with the \cs{Umathaccent} primitive. Expert users are
+ invited to check out the code and to contribute suggestions if some extras
+ can improve it.\par
+\end{footnotesize}
+
\subsubsection{Sans serif in math}
@@ -2733,8 +2156,6 @@ text.
\subsubsection{\mst with \ctanpkg{beamer}}\label{ssec:beamer}
-%\noindent\llap{\textcolor{green}{\bfseries 2015/02/26}\hspace{1em}}
-
Starting
with release |3.34| of \ctanpkg{beamer}%
%
@@ -2791,24 +2212,9 @@ Antoine~\textsc{Missier}:
\item and load \mst afterwards (with possibly some font packages loaded in-between), passing it
the option §frenchmath*§.
\end{itemize}
-% \begin{footnotesize}
-% The\RightNote{1.3zb} release |2.7| dated |2023/12/23| of
-% \ctanpkg{frenchmath} required \mst to add a compatiblity patch and modify
-% the §frenchmath*§ option. The above instructions cause a build crash with
-% |2.7| \ctanpkg{frenchmath} and \mst |1.3za| and earlier. One must use \mst
-% |1.3zb| or later.\par
-% \end{footnotesize}
-% Also, \ctanpkg{frenchmath} must be at least at
-% version |2.7| of |2023/12/23|.%
Limited testing indicated that the combination of the two packages (using the
options as indicated above) works satisfactorily.
-% as expected but that some adjustments may be needed for some of
-% the macros defined by \ctanpkg{frenchmath}: we
-% observed in particular that the |\paral| command (which produces
-% $\mathrel{/\!\!/}$) may not work well if the $/$ is picked up from the text
-% font due to \mst (alternative could be for most text fonts
-% |\def\paral{\mathrel{//}}|),
There may be some minor adjustments to do, as the \mst-ified math font may
cause issues to some of
the \ctanpkg{frenchmath} macros: for exemple \cs{Oijk} may not work
@@ -2886,9 +2292,9 @@ respectively, which make
the comma (to some extent) `intelligent', i.e. decide on the spacing type
(ordinary or punctuation) depending on next token. Do not load directly the packages
but simply use the corresponding option and \mst will do the loading and take
-appropriate needed measures for compatibility. The\RightNote{1.3zb} §decimalcomma§ option is
+appropriate needed measures for compatibility. The\RightNote{\mstrelease{1.3zb}} §decimalcomma§ option is
included in the §frenchmath*§ option, and the §ncccomma§
-option is included in the §frenchmath+§ option.\RightNote{1.3zb}
+option is included in the §frenchmath+§ option.\RightNote{\mstrelease{1.3zb}}
Let's give another example of usage of \ctanpkg{mathtools} here to define a
macro for integer ranges:
@@ -2924,6 +2330,417 @@ multiple math versions. Read the fine print below for some limitations though.
\mst actions on square brackets (and parentheses).\par
\end{footnotesize}
+\subsubsection{Unicode engines}
+
+\mst is minimally Unicode aware since \mstrelease{1.12} and can be used with \XeTeX{} or
+\LuaTeX{}. Starting with release \mstrelease{1.3}, it needs |luatex| to be at least
+as recent as the one which was provided with the TL2013 distribution.
+
+However \mst applies only to (a subset of) the |32-127| ascii range, and
+optionally to Greek letters, but for the latter only if provided via ``\TeX\
+fonts'' such as Euler, Symbol or LGR-encoded fonts.
+It does not know how to use a given Unicode font simultaneously for Latin and
+Greek letters.
+
+Thus, first consider much better alternatives:
+\begin{itemize}
+\item Since 2018, the package \ctanpkg{mathfont}%
+%
+\footnote{Conrad \textsc{Kosowsky}, \emph{Use TrueType and OpenType fonts in math mode}
+\url{https://ctan.org/pkg/mathfont}.}
+%
+adapts Unicode text fonts to usage in math mode. It works with both \XeTeX\
+and \LuaTeX.
+\item For \XeTeX\ only, \ctanpkg{mathspec}%
+%
+\footnote{Andrew Gilbert \textsc{Moschou}, \emph{Specify arbitrary fonts for mathematics in \XeTeX}
+\url{https://ctan.org/pkg/mathspec}.}
+%
+also allows usage of arbitrary text fonts in mathematics.
+\item and of course
+\ctanpkg{unicode-math}%
+%
+\footnote{Will \textsc{Robertson}, et al., \emph{Unicode mathematics with
+ support for XeTeX and LuaTeX} \url{https://ctan.org/pkg/unicode-math}.}
+%
+is the standard package for using OpenType fonts which are equipped with the needed extra
+support being used in \TeX\ math mode.
+\end{itemize}
+
+If using any one of the above you probably don't need, don't want, and should
+not use \mst.
+
+Let me insist that \mst has not been tested in any systematic
+manner under the Unicode engines; and that it is expected to be most definitely
+incompatible with \ctanpkg{unicode-math}, although your mileage may vary and some
+features may appear to work.
+
+When using \mst with either \XeTeX{} or \LuaTeX{} it is recommended to use the
+\ctanpkg{fontspec} package (see remark below on \cs{encodingdefault}). Furthermore,
+if using \ctanpkg{fontspec} it is \emph{necessary} to load it with its
+|no-math| option, and this \emph{must} happen before loading \mst.
+\begin{shaded*}
+\begin{itemize}[label=$\bullet$, leftmargin=1em]
+\item
+ Use \ctanpkg{fontspec} with its
+ \emph{no-math} option, and load it \emph{prior} to \mst. As some packages
+ load \ctanpkg{fontspec} themselves (for example |polyglossia|), a
+ \centeredline{|\PassOptionsToPackage{no-math}{fontspec}|} early in the
+ preamble might be needed.
+
+\item
+ The \ctanpkg{amsmath} package, if used, \emph{must} be loaded \emph{prior} to \mst.
+
+\item
+ Under |lualatex| engine, it is recommended to also load the package
+ \ctanpkg{lualatex-math}.% Please check its documentation as possibly it has now
+ % been incorporated upstream (I am not following up on the situation).
+\end{itemize}
+\end{shaded*}
+
+I already mentioned in the \autoref{sec:ic} the fact that
+the italic corrections were not available for OpenType fonts
+under the \XeTeX{} engine and only partially available for the
+\LuaTeX{} engine, with the result that the spacings in math
+mode when using for the letters an upright text font will be
+less satisfying than with the standard PDF\TeX{} engine (the
+OpenType fonts not being usable with the latter engine, this is
+not a criterion of choice anyhow).
+
+To define math versions when using unicode fonts, use \ctanpkg{fontspec}'s
+\cs{setmainfont} before the \cs{Mathastext}\oarg{version} command, or simply
+before loading \mst for the default math versions.
+
+It is possible to mix usage of Unicode fonts and classical \TeX{}
+fonts. All used 8bits font encoding must have been passed as
+options to the \ctanpkg{fontenc} package.
+
+\subsubsection{The unicodeminus option}
+
+For legacy reason, \mst uses by default the |EN DASH U+2013| for the minus
+sign in math mode, if the font is determined to be a ``Unicode'' font.
+
+There is now the §unicodeminus§\RightNote{\mstrelease{1.3q}} to use rather
+% BORDEL DE BORDEL DE FAIT CHIER \verb ET Text for \verb command ended by end
+% of line. je l'ai patché dans etoc et xint mais pas ici encore.
+|MINUS SIGN U+2212|.%
+\footnote{Thanks to Tobias~\textsc{Brink} who asked for this feature.}
+%
+Check \hyperref[nicodeminus]{\ttfamily\hyphenchar\font=189 its documentation}
+on page \pageref{nicodeminus}.
+
+\subsubsection{Two examples with OpenType fonts}
+
+\begingroup\def\MacroFont{\normalfont\footnotesize\ttfamily}
+I include
+here two examples which compiled successfully (a long time ago!) with \XeTeX{} and
+\LuaLaTeX{}, the first one on a Linux machine, the second one on a Mac
+OS X machine.
+\begin{verbatim}
+\documentclass{article}
+\usepackage[hscale=0.8]{geometry}
+\usepackage{multicol}
+\usepackage[no-math]{fontspec}
+\usepackage{lmodern}
+\usepackage[subdued,italic]{mathastext}
+\setmainfont[Color=999999]{Verdana} \Mathastext[Verdana]
+\setmainfont[Color=0000FF]{Arial} \Mathastext[Arial]
+\setmainfont[Color=00FF00]{DejaVu Serif} \Mathastext[DejaVu]
+\MTDeclareVersion{times}{T1}{ptm}{m}{n}
+\setmainfont[Color=FF0000]{Andale Mono} \Mathastext[Andale]
+\begin{document}
+\newcommand\TEST[1]{\MTversion{#1}%
+\begin{multicols}{2}
+\hbox to\columnwidth{\hbox to\columnwidth{\hfil
+ $abcdefghijklmnopqrstuvwxyz$\hfil}\kern-2.5em{#1}}
+ \centerline{ $ABCDEFGHIJKLMNOPQRSTUVWXYZ$ }
+ \centerline{ $0123456789$ }
+ \centerline{ $!\,?\,*\,,\,.\,:\,;\,+\,-\,=\,(\,)\,[\,]\,/\,\#\,%
+ \$\,\%\,\&\,<\,>\,|\,\{\,\}\,\backslash$ }
+\columnbreak
+ \centerline{ abcdefghijklmnopqrstuvwxyz }
+ \centerline{ ABCDEFGHIJKLMNOPQRSTUVWXYZ }
+ \centerline{ 0123456789}
+ \centerline{ !\,?\,*\,,\,.\,:\,;\,+\,-\,=\,(\,)\,[\,]\,/\,\#\,%
+ \$\,\%\,\&\,<\,>\,|\,\{\,\}\,\char92 }
+\end{multicols}}
+\begin{multicols}{2}
+ \centerline{\textbf{math mode}}
+\columnbreak
+ \centerline{ \textbf{text} }
+\end{multicols}
+\TEST{DejaVu}\TEST{Verdana}\TEST{times}\TEST{Andale}
+\TEST{Arial}\TEST{bold}\TEST{normal}
+\end{document}
+\end{verbatim}
+And now the same thing with fonts available on Mac OS X:
+\begin{verbatim}
+\documentclass{article}
+\usepackage[hscale=0.8]{geometry}
+\usepackage{multicol}
+\usepackage[no-math]{fontspec}
+\usepackage{lmodern}
+\usepackage[subdued,italic]{mathastext}
+\setmainfont[Color=FF0000]{Hoefler Text} \Mathastext[Hoefler]
+\setmainfont[Color=336633]{American Typewriter}\Mathastext[Typewriter]
+\setmainfont[Color=0000FF]{Herculanum} \Mathastext[Herculanum]
+\setmainfont[Color=FF00FF]{Didot} \Mathastext[Didot]
+\setmainfont[Color=999999]{Comic Sans MS} \Mathastext[Comic]
+\begin{document}
+ --- copy here the code from the previous example ---
+\TEST{Didot}\TEST{Comic}\TEST{normal}\TEST{Herculanum}
+\TEST{Hoefler}\TEST{Typewriter}\TEST{bold}
+\end{document}
+\end{verbatim}
+\endgroup
+
+
+\subsubsection{Compatibility with other packages}\label{sec:compat}
+
+Regarding the namespace of the package: all internal macros use
+\cs{mst@} (or \cs{ifmst@} for \TeX{} conditionals) as prefix. Almost all user
+commands have \cs{MT} prefix, the oldest ones
+may use \cs{Mathastext} or variants.%
+%
+\footnote{It is only years after initial release that I became aware that
+package \ctanpkg{mathtools} used \cs{MT\string_} prefix (with an underscore as
+shown) for most internal constructs, and sometimes \cs{MT@}, and those can not
+clash with our \cs{MT[a-z\string|A-Z]} for public commands and \cs{mst@} for
+internal macros. They do have however user commands \cs{MTFlushSpaceAbove} and
+\cs{MTFlushSpaceBelow}, but nothing else hence some retroactive relief.}
+
+Compatibility issues are often questions of who decides last. They are
+naturally to be expected with packages dealing with the math setting. The fix
+is simply to load \mst last. In particular one should \emph{always} load \mst
+\emph{after} \ctanpkg{amsmath} (this is especially needed with Unicode engines
+but applies in general as well).
+
+Any definition made in a package loaded before \mst of the font to be
+used for letters or for the common characters in the |ascii| basic range
+will be overruled by the loading of \mst.
+Conversely most of the set-up done by \mst may well be overruled by
+packages loaded later which do math related things.
+
+Starting with version \mstrelease{1.2}, \mst makes some characters
+`mathematically active' to achieve certain effects: automatic insertion of the
+italic corrections when using an upright text font in math (\autoref{sec:ic}),
+extended scope of the math alphabet commands which now apply to non-letter
+symbols (\autoref{sec:mathxx}; and also to math operator names, but this is
+much easier to achieve). And the (already mathematically active) right quote
+is modified to have some extra space added before the derivative glyph ${}'$
+(see §\MTprimeskip§).
+
+This mathematical activation is compatible with the \cs{label} and \cs{ref}
+commands in and outside of math mode.
+
+But a difficulty arises when some other package has
+made the character `catcode active' everywhere in the document. If it is
+detected for such a character that \mst wishes to make `mathematically active'
+that it is already `catcode active', \mst then checks if it is handling a Babel
+shorthand. If yes, it then hacks into \ctanpkg{babel} support macros for that
+character to let it do what it desires it to do in math mode. And it does not
+make the character mathematically active, to the contrary it makes sure
+that the character is \emph{not} mathematically active.
+
+\begin{footnotesize}
+ This last paragraph applies to the characters
+ {{;}\,{,}\,{:}\,{!}\,{?}\,{+}\,{\textendash}\,{=}\,{<}\,{>}\,{(}\,{)}\,{[}\,{]}*}
+ mentioned in \autoref{sec:mathxx} as `hard non-letters'. The right tick
+ (which is already mathematically active per default) is also handled via a
+ similar process, and in particular is tested for being a Babel shorthand
+ (which happens in particular with the Spanish language |activeacute| option).
+
+ The reason for avoiding in general for a catcode active character to be at
+ same time mathematically active is illustrated in next shaded box.
+
+ In the case of the Spanish active |'|, the advantage of \mst intervention to
+ reset its mathcode is that in case of a faulty input as a curly right tick
+ |U+8217| ', which \LaTeX{} will map to \cs{textquoteright} which itself
+ gives the catcode 12 |'|, it will show as curly quote in output not as prime
+ glyph, as \mst removes its mathematical activation. This complements the
+ \LaTeX{} warnings about \cs{textquoteright} being invalid in math mode.
+
+ The ascii letters can not have been made active by Babel interface (see code
+ comments of \cs{mst@do@activecase}) so if an ascii letter is catcode active
+ when \mst examines it, nothing will change to its meaning.
+
+ \CHANGED{\mstrelease{1.4}}At \mstrelease{1.4} these actions are done for
+ ascii letters at loading of the package or via \csb{MTmathactiveletters},
+ which is itself done by \csb{MTversion} when entering non-subdued math
+ version. Check documentation of \csb{MTmathactiveletters} for some relevant
+ details.\par
+\end{footnotesize}
+
+\begin{shaded*}
+\footnotesize
+On matters of \emph{mathematical} versus \emph{catcode} active character
+tokens, here is some code, not involving \mst, that you should \textbf{not}
+try at home:
+\begin{verbatim}
+ \documentclass{article}
+ \usepackage[french]{babel}
+ \usepackage{mathtools}\mathtoolsset{centercolon}
+ \begin{document}
+ $:$
+ \end{document}
+\end{verbatim}
+\fbox{DO NOT DO THIS AT HOME}\thinspace: it creates (with |pdflatex|) an infinite
+loop.
+% %
+% \footnote{This seems to still be the case with Babel |3.9f| and
+% frenchb.ldf |2.6e|, as tested on Sep. 2, 2013. Again tested with up-to-date
+% TL2015 Jan. 15, 2016 with same result. Again tested July 11, 2024 with
+% up-to-date TL2024 with the
+% same result.}
+% %
+This is due
+to the fact that the colon is simultaneously active (this is made by
+\ctanpkg{babel-french} at begin document) and mathematically active (done by
+\ctanpkg{mathtools} in the preamble). The interaction gives an infinite loop.
+%
+% Such a
+% situation will be cured by \mst, even loaded before \ctanpkg{mathtools},
+% \emph{if} use is made of §\MTnonlettersobeymathxx§.
+%
+% At each math formula
+% \mst will detect that Babel has activated the colon, and will cancel the
+% mathematical activation (the precise definition done by \ctanpkg{mathtools} was
+% already lost at begin document due to overwriting by \ctanpkg{babel} but the fact that
+% the character was mathematically active remained true).
+\par
+\end{shaded*}
+
+
+ Regarding mathematical activation, an incompatibility of
+ another type arose with \ctanpkg{amsmath}. To fix it, \mst now replaces
+ an inner macro of \ctanpkg{amsmath}
+ (\cs{resetMathstrut@}) with its own version.\\
+ \null\hspace{1cm}\fbox{Always load \ctanpkg{amsmath} before \mst.}
+
+\begin{footnotesize}
+ Actually this last commandment was already made necessary by the use of the
+ text endash to represent the minus sign in math mode, and, especially for
+ Unicode engines, some aspects of the \cs{DeclareMathOperator} macro from
+ \ctanpkg{amsmath}.\par
+\end{footnotesize}
+
+
+
+ \begin{shaded*}
+ \textcolor{magenta}{\bfseries New with 1.3i:} \mst patches |\url| of
+ packages \ctanpkg{url} and \ctanpkg{hyperref}, and also |\nolinkurl|, to force them
+ to do automatically §\MTeverymathoff§. Indeed they use math mode, and it
+ is better to turn \mst off for their dealings.
+
+ See the §\MTeverymathoff§ documentation.
+ \end{shaded*}
+
+
+
+\subsection{Math alphabets}
+
+Let us first recall fundamental facts of life, in the
+ world of traditional PDF\TeX\ engine and \TeX\ fonts, as background for
+ understanding what \mst does in this context.
+ People familiar with using Unicode engines and \ctanpkg{unicode-math}, please be
+ aware that the semantics there of the \LaTeX\ math alphabet commands are
+ \textbf{significantly} modified!
+\begin{shaded*}
+\begin{itemize}
+\item In the default \LaTeX\ set-up all five of §\mathrm§, §\mathbf§,
+ §\mathit§, §\mathsf§ and §\mathtt§ tell \TeX\ to use for their arguments
+ specific \texttt{OT1}-encoded fonts.
+\item If the document body uses, as will be the case probably with any
+ language other than English or its variants, some other encoding such as
+ \texttt{T1} for its fonts, there is no change whatsoever to the math
+ configuration, indeed most font packages ignore it completely.
+\item It is thus a priori wrong to think of these commands as switching to
+ some body text font, although letters within their scopes will act as in a
+ text font, and in particular obey ligatures (this also applies to operator
+ names defined by |amsmath|'s \cs{DeclareMathOperator} which are, with some
+ extras not mentioned here, as using §\mathrm§).
+\item These commands are completely different in spirit from the \LaTeX\
+ \cs{textrm}, \cs{textbf}, and others, which change only some font axis;
+ indeed the math alphabet commands inherit from legacy Knuth's \cs{rm},
+ \cs{bf}, and others which are complete font specifiers.
+\item In particular when nesting, it is the inner-most which wins.
+\item Only mathematical characters (such as letters) which are declared to
+ \TeX\ as being of ``variable family type'' react to being in the argument of
+ a math alphabet command.
+\item Lowercase Greek letters are by default in \LaTeX\ immune to math
+ alphabets (so \verb|\mathrm{\pi}| induces no change in output), but the
+ eleven uppercase Greek letters are of ``variable family type'' because they
+ are picked in the \texttt{OT1}-encoded font also used for operator names
+ (the one to which §\mathrm§ maps), \emph{and they occupy the exact same
+ slots in the \emph{\texttt{OML}}-encoding to which} §\mathnormal§ maps! So
+ in default \TeX, \verb|\mathnormal{\Gamma}| gives a slanted glyph. The slots
+ occupied in \texttt{OML}-encoding by the lowercase Greek letters (to which
+ encoding they are a priori assigned) give
+ completely unrelated glyphs in the \texttt{OT1}-encoding, so it makes sense
+ that the default \LaTeX\ declares lowercase Greek to not react to math alphabets.
+ Notice though, that if \LaTeX\ had declared a \cs{mathnormalbold}, mapping
+ to a bold \texttt{OML}-encoded font, it would have made sense to also have
+ \cs{alpha}, \cs{beta}, etc... be of ``variable family type''.
+\item But of course even if |\pi| is of such ``variable family type'' then
+ |\mathbf{\pi}| will give garbage because the default §\mathbf§ selects an
+ \texttt{OT1}-encoded font, where there is no pi glyph whatsoever and in
+ particular not at the slot (which is 25) of $\pi$ in the \texttt{OML} encoding!
+\end{itemize}
+\end{shaded*}
+
+Please keep all the above in mind when trying to understand what \mst does
+with math alphabets. The most significant point described next naturally is that
+\mst will sync §\mathnormal§, §\mathrm§, §\mathbf§, §\mathit§, §\mathsf§ and
+§\mathtt§ to map to the \mst-ified body text fonts.
+ \begin{itemize}
+ \item §\mathnormal§, §\mathrm§, §\mathbf§, §\mathit§,
+ §\mathsf§ and §\mathtt§ are modified to use the \mst-ified
+ text fonts; this can be disabled via §defaultalphabets§ and
+ related individual options, but the package always provides
+ §\Mathnormal§, §\Mathrm§, etc..., to match the \mst font
+ configuration (\RLNote{changed:}{\mstrelease{1.3za}}prior to \mstrelease{1.3za}
+ §defaultalphabets§ and related options also caused the \mst
+ alphabet commands not to be defined). Recall that there may
+ arise a ``too many math alphabets'' error if too many of these
+ commands are \emph{used} in the document:
+ \emph{declaring} them is not by itself the cause of the error. See the
+ \LaTeX\ news entry of its \texttt{2021-11-15} release for
+ the counter \texttt{localmathalphabets} (with default value 2)
+ which can be now be used if one hits such a difficulty.
+ \item We define a new math alphabet command
+ §\mathnormalbold§ which gives direct access to
+ the bold version of the §\mathnormal§ alphabet
+ (rather than using either the \cs{bm} command from
+ the \ctanpkg{bm} package or the \cs{boldsymbol} command
+ from the \ctanpkg{amsbsy} package). As it does not
+ exist in the default \LaTeX{} math font set-up, this
+ alphabet is \emph{not} subjected to the {subdued option} action.
+
+\item Version \RightNote{\mstrelease{1.2}}\mstrelease{1.2} of \mst has extended the scope of the math
+ alphabets to apply to non-alphabetical characters and to
+ operator names. This respects the automatic white spaces
+ added by \TeX{} around math symbols. See the devoted \autoref{sec:mathxx}.
+\item The optional\RightNote{\mstrelease{1.3i}}
+ extra skips around letters (see \autoref{sec:mathskips} and
+ \autoref{sec:ic}) are removed in the scope of the math alphabets.
+
+ \item Depending on options, further math alphabet commands
+ are defined by the package: §\MathEulerBold§,
+ §\MathEuler§, §\MathPSymbol§, and since \mstrelease{1.3y} under
+ the §LGRgreek§ family of options\RightNote{\mstrelease{1.3y}} also
+ §\mathgreekup§ and §\mathgreekit§. See
+ \autoref{sec:newgreek}. And also §\mathgreekupbold§ and
+ §\mathgreekitbold§ under the §LGRgreek§ family of
+ options.\RightNote{\mstrelease{1.3za}}
+
+ \item With\RightNote{\mstrelease{1.3za}} the §LGRgreek+§ option
+ which enhances Greek letters with a specific behavior when in the
+ arguments of the §\mathrm§, §\mathbf§, etc..., math alphabet
+ commands, this special behavior is not triggered by the §\Mathrm§,
+ §\Mathbf§, et al., which are genuine unmodifed math alphabet commands. See
+ \autoref{sec:newgreekplus}.
+ \end{itemize}
+
\subsection{Math versions}\label{sec:mathversions}
@@ -2972,13 +2789,13 @@ It is still possible to switch on via §\MTversion§ in the document body
\footnote{When not using math versions at all (so not using \texttt{subdued}
mode either) another way to achieve distinct fonts in text and math is
naturally to modify the document text font \emph{after} having loaded \mst (or
-after last usage of \cs{Mathastext} without optional argument).
-Another way is to use \cs{MTfamily}, \cs{MTencoding}, \cs{MTseries},
-\cs{MTshape}, \cs{MTlettershape} in the preamble before a call to
-\cs{Mathastext} which will configure math fonts without having modified the
+after last usage of \csb{Mathastext} without optional argument).
+Another way is to use \csb{MTfamily}, \csb{MTencoding}, \csb{MTseries},
+\csb{MTshape}, \csb{MTlettershape} in the preamble before a call to
+\csb{Mathastext} which will configure math fonts without having modified the
document text fonts. However if one does \texttt{\string\MTversion\{normal\}}
in the document then the text font will be reset to what was recorded as math
-font by the \cs{Mathastext} call in the preamble (as said above, when not
+font by the \csb{Mathastext} call in the preamble (as said above, when not
using \texttt{subdued} option).}
The native \LaTeX{} command \cs{mathversion}\marg{version\_name} would change
@@ -3000,19 +2817,19 @@ For all math versions if not using the §subdued§ option, or only
for the non-\emph{normal} and non-\emph{bold} math versions if
using the §subdued§ option, \cs{MTversion} does further additional tasks:
\begin{itemize}
-\item it resets\RightNote{1.3u} the §\hbar§, \cs{imath}
+\item it resets\RightNote{\mstrelease{1.3u}} the §\hbar§, \cs{imath}
(see §\inodot§), \cs{jmath}, math accents (see option
§mathaccents§) and minus sign as en dash according to the used
font encoding for the \mst-ified text font,
-\item (see sections \ref{sec:mathskips} and \ref{sec:ic}) it re-issues the
+\item (see \autoref{sec:mathskips} and \autoref{sec:ic}) it re-issues the
command §\MTmathactiveletters§ to let a to z, A to Z, be mathematically
active in order to automatically insert the skips as defined by the user
with §\MTsetmathskips§, and the italic corrections (if the font is not
italic or slanted),
-\item (see section \ref{sec:extraskips}) it resets the extra spaces after the
+\item (see \autoref{sec:extraskips}) it resets the extra spaces after the
symbols $\exists$, $\forall$ and before the derivative ${}'$ to the values as
decided by the user in the preamble on a \emph{per version} basis,
-\item (see section \ref{sec:mathxx}) it re-issues the commands
+\item (see \autoref{sec:mathxx}) it re-issues the commands
§\MTmathoperatorsobeymathxx§ and §\MTeasynonlettersobeymathxx§ to let
the math operator names and (`easy') non letter characters obey the math
alphabets,
@@ -3058,8 +2875,9 @@ provided by \mst:
package, Greek letters are the default Computer
Modern ones or have been set-up by other packages;
for example by the \ctanpkg{fourier} package with option
- `upright', which gives upright Greek letters.
-\item[§LGRgreek§:] (this was substantially updated at |1.3x|, make sure to
+ `upright', which gives upright Greek letters
+ or by the author \ctanpkg{lgrmath} package.
+\item[§LGRgreek§:] (this was substantially updated at \mstrelease{1.3y}, make sure to
read the new documentation at \autoref{sec:newgreek})
this option is for fonts which additionally to Latin
letters also provide Greek letters in |LGR| encoding. Here is
@@ -3088,7 +2906,7 @@ provided by \mst:
If you use the §italic§ option note that the italic Greek
letters from the |cbfonts| are not the same glyphs as
the default Greek letters from the |OML| encoded font |cmmi|.
-\item[§LGRgreek+§:] \RightNote{1.3za}extends §LGRgreek§ to allow abusive
+\item[§LGRgreek+§:] \RightNote{\mstrelease{1.3za}}extends §LGRgreek§ to allow abusive
usage of \cs{mathrm} and alike commands with Greek letters.
This is very much not in the spirit (especially with traditional
``8bit'' \TeX\ fonts) of the \LaTeX\ kernel concept of math alphabet
@@ -3146,17 +2964,17 @@ from the lowest to the highest priority:
the digits and operator names (most of the time this means ``upright
shape'', but it can be otherwise),
\item[§itgreek§]: says that Greek letters (both lowercase and uppercase) will
- be in `|it|' shape. \RLNote{changed:}{1.3x}More precisely the expansion of
+ be in `|it|' shape. \RLNote{changed:}{\mstrelease{1.3y}}More precisely the expansion of
§\MTgreekitdefault§ is used.
- This was changed at |1.3x|, formerly the value of \cs{itdefault} which was in
+ This was changed at \mstrelease{1.3y}, formerly the value of \cs{itdefault} which was in
force at the time of using §\Mathastext§ (or at time of loading the package
if no use is made of §\Mathastext§) was used.
\item[§upgreek§]: says that Greek letters (both lowercase and uppercase) will
- be in `|n|' shape. \RLNote{changed:}{1.3x}More precisely the expansion of
+ be in `|n|' shape. \RLNote{changed:}{\mstrelease{1.3y}}More precisely the expansion of
§\MTgreekupdefault§ is used.
- This was changed at |1.3x|, formerly the value of \cs{updefault} which was in
+ This was changed at \mstrelease{1.3y}, formerly the value of \cs{updefault} which was in
force at the time of using §\Mathastext§ (or at time of loading the package
if no use is made of §\Mathastext§) was used. But since \LaTeX{}
|2020-02-02| this caused many Font Warnings in the log because
@@ -3187,7 +3005,7 @@ font family available in |LGR| encoding: for example |lmr|,
|DejaVuSerif-TLF| (needs \ctanpkg{dejavu} package on your system),
etc\dots
-\begin{framed}
+\begin{shaded*}
§\MTitgreek§, §\MTupgreek§, §\MTitGreek§, §\MTupGreek§
have some effect only if one of the §LGRgreek§, §LGRgreeks§,
§selfGreek§ or §selfGreeks§ options was passed to the package.
@@ -3198,14 +3016,14 @@ etc\dots
§\MTgreekfont§ has an effect only for §LGRgreek§ and §selfGreek§. It is
without any effect with §LGRgreeks§ and §selfGreeks§.
-\end{framed}
+\end{shaded*}
\subsubsection{Control sequences to access directly upright or italic
shape for Greek under \texttt{LGRgreek} option}
\label{sec:newgreek}
-Some changes were made at |1.3x| to enhance the §LGRgreek§ (and §LGRgreeks§)
+Some changes were made at \mstrelease{1.3y} to enhance the §LGRgreek§ (and §LGRgreeks§)
options with new features. Everything which will be explained here applies
only to these two options.
@@ -3224,7 +3042,7 @@ command in the preamble (possibly with \oarg{version\_name} optional
argument). Their default definitions are to expand to `|n|' and `|it|'
respectively. They can also be defined prior to loading \mst.
-See\RightNote{1.3x} the \autoref{table:greekup} and \autoref{table:greekit}
+See\RightNote{\mstrelease{1.3y}} the \autoref{table:greekup} and \autoref{table:greekit}
for illustrations (using here the Libertinus Serif font).
\begin{table}[htbp]
\MTversion{libertinus}
@@ -3364,7 +3182,7 @@ etc\dots\ options or §\MTitgreek§ et al.\@ commands. This is on a per \mst-enri
math version basis, depending only on how the options or commands were used
in the preamble.
-Furthermore\RightNote{1.3x} two math alphabets are provided
+Furthermore\RightNote{\mstrelease{1.3y}} two math alphabets are provided
\centeredline{§\mathgreekup§}
\centeredline{§\mathgreekit§}
which can be used to map a letter to the corresponding Greek fonts:
@@ -3379,14 +3197,14 @@ which can be used to map a letter to the corresponding Greek fonts:
\centeredline{$\mathgreekit{W}=\mathgreekit{\Omega}=\mathgreekit{\Omegaup}=\Omegait$}
}
-Some\RightNote{1.3x} refactoring%
+Some\RightNote{\mstrelease{1.3y}} refactoring%
%
\footnote{Technically, formerly two symbol fonts were declared, one for the
lowercase Greek letters and one for the uppercase Greek letters; now those
are dropped and replaced by two symbol fonts, one for `italic' Greek letters,
the other for `upright' Greek letters.}
%
-was required to achieve this at |1.3x|
+was required to achieve this at \mstrelease{1.3y}
and it is not 100\% backwards compatible: if none of the §itgreek§ etc\dots\
things was used, the Greek letters formerly would follow the shape of Latin
letters (for lowercase Greek) and of operator names (for uppercase Greek).
@@ -3414,10 +3232,10 @@ compatibility.
\subsubsection{\cs{mathgreekupbold} and \cs{mathgreekitbold}}
\label{sec:newgreekbold}
-Again this applies only to §LGRgreek§ and §LGRgreeks§ options (and the |1.3za|
+Again this applies only to §LGRgreek§ and §LGRgreeks§ options (and the \mstrelease{1.3za}
added §LGRgreek+§ and §LGRgreeks+§).
-See\RightNote{1.3za} the \autoref{table:greekupbold} and \autoref{table:greekitbold}
+See\RightNote{\mstrelease{1.3za}} the \autoref{table:greekupbold} and \autoref{table:greekitbold}
for illustration of usage (in math mode only) of code such as
\begin{verbatim}
\mathgreekupbold{\alpha}
@@ -3594,7 +3412,7 @@ commands on Latin letters also:
the \texttt{LGRgreek+} option}
\label{sec:newgreekplus}
-With option\RightNote{1.3za} §LGRgreek+§ or §LGRgreeks+§, \mst makes Greek
+With option\RightNote{\mstrelease{1.3za}} §LGRgreek+§ or §LGRgreeks+§, \mst makes Greek
letters control sequences \cs{alpha}, \cs{beta}, ... (but not \cs{alphaup} or
\cs{betait} and the others) react in a special manner within the scope of
§\mathnormal§, §\mathrm§, §\mathit§, §\mathbf§, and §\mathnormalbold§, but not
@@ -3671,15 +3489,24 @@ fonts having only 128 or 256 glyphs, and from the fact that §\mathrm§ and
§\mathbf§ originate in Plain \TeX\ \cs{rm} and \cs{bf} and are still quite
akin to it, they are font switching commands nothing more or less.
+\subsection{Advanced capacities}
+
+Some such capacities are on per default (but if with §subdued§ option will be
+turned off in the \emph{normal} and \emph{bold} math versions), others require
+an action from the user for activation.
-\subsection{Extra spaces around letters}
+\subsubsection{Extra spaces around letters}
\label{sec:mathskips}
-This is a new feature added with release |1.3|: the command §\MTsetmathskips§
-allows the user to set up some spaces (more precisely, `mu glue'; but stretch
-and shrink are discarded) to be
-automatically inserted around the letters in math mode. Some (very) unrealistic
-uses:
+This is a new feature%
+%
+\footnote{It was new in 2013 indeed. Not so much new now, but it is never too
+late to try it out.}
+%
+added with release \mstrelease{1.3}: the command §\MTsetmathskips§ allows the
+user to set up some spaces (more precisely, `mu glue'; but stretch and shrink
+are discarded) to be automatically inserted around the letters in math
+mode. Some (very) unrealistic uses:
\begin{verbatim}
% this may be anywhere in the document (also within a math group):
\MTsetmathskips{x}{20.33mu}{15.66mu}% 20.33mu before all x's and 15.66mu after.
@@ -3699,28 +3526,25 @@ limits as usual the scope of this command. Furthermore the command
§\MTunsetmathskips§ cancels previous use of \cs{MTsetmathskips} for a given
letter.
-The implementation relies on the `mathematical activation' of letters, which is
-done by default by the package since release |1.2b|. Should this cause
-compatibility problems, the command §\MTmathstandardletters§ cancels it
+The implementation relies on the `mathematical activation' of letters, which
+is done by default by the package since release \mstrelease{1.2b}. Should this
+cause compatibility problems, the command §\MTmathstandardletters§ cancels it
entirely. To reactivate it, there is §\MTmathactiveletters§. Note that
-\cs{MTmathactiveletters} is done automatically by \mst when loaded, and also
-each time the package enhanced math-version-switch command §\MTversion§ is used,
-except for the normal and bold math versions under the §subdued§ option.
-
-% Earlier this `mathematical activation' of letters had been used by the package
-% only to add automatically italic corrections, as described in the next
-% section.
+§\MTmathactiveletters§ is done automatically (as part of §\MTicinmath§) by
+\mst when loaded (if not with §subdued§ option), and also each time the
+package enhanced math-version-switch command §\MTversion§ is used, except for
+the normal and bold math versions under the §subdued§ option.
-\begin{framed}
+\begin{shaded*}
The extra skips are set at natural width; they do not contribute to the
overall stretchability or shrinkability of the math formula and do not
create break points.
- \textcolor{magenta}{\bfseries Changed with |1.3i|}: they are \emph{not}
+ \textcolor{magenta}{\bfseries Changed with \mstrelease{1.3i}}: they are \emph{not}
applied within the scope of math alphabet commands.
-\end{framed}
+\end{shaded*}
-\subsection{Italic corrections}
+\subsubsection{Background on italic corrections in math mode}
\label{sec:ic}
{\small Note: this is somewhat technical discussion which may well be skipped in
@@ -3824,9 +3648,14 @@ $\xdef\mstrestorefontdimen{\fontdimen2\textfont\symmtletterfont=
We learn in Appendix G of the \TeX book that the italic correction is used for
the horizontal shift of the superscript with respect to the position of
-the subscript: $\mathit{f_i^j}$, or,
+% CETTE LIGNE PROVOQUE L'AJOUT D'UN LINESKIP
+% the subscript: $\mathit{f_i^j}$, or,
+% En fait déjà en Plain TeX, configuration de base la hauteur totale de
+% $f_i^j$ est > 12pt = baselineskip !
+% Work-around ad hoc
+the subscript: \smash{$\mathit{f_i^j}$}, or,
going back now to the standard math italics $f_i^j$. In the next paragraphs
-we use $f_i^i$ for more accurate comparison of the positioning of the sub- and superscript.
+we use \smash{$f_i^i$} for more accurate comparison of the positioning of the sub- and superscript.
If we try something like this: |${f\/}_i^i$| we obtain ${f\/}_i^i$. Our
overlapping game with |\rlap{$f_i^i$}${f\/}_i^i$| gives
@@ -3889,15 +3718,10 @@ to preserve this behavior).
italic corrections are canceled inside the arguments to the math alphabet
commands, to allow the formation of ligatures as
is expected in the standard default \TeX{} font set-up in math.%
-% \footnotemark
-% \global\let\saved@Href@B\Hy@footnote@currentHref
\end{framed}\vskip-.75\baselineskip
\end{framed}
-%\addtocounter{footnote}{-1}%
-%\let\Hy@footnote@currentHref\saved@Href@A
-%
\footnotetext{the situation is rather ironical! by the way, the warnings in
- section \ref{sec:mathxx} with \texttt{\$x\^{}?\$} or similar are less of an
+ \autoref{sec:mathxx} with \texttt{\$x\^{}?\$} or similar are less of an
issue here, because the letter is only \emph{followed} by \texttt{\char92/}
and anyhow the whole is put by \mst within group braces, so no surprises
with \texttt{\$x\^{}y\$} or \texttt{\$\char92mathbin x\$}. Nevertheless it
@@ -3905,16 +3729,10 @@ to preserve this behavior).
composite objects, something which could surprise other packages. The
command \csb{MTmathstandardletters} cancels this mechanism.}
-%\addtocounter{footnote}{1}%
-% \let\Hy@footnote@currentHref\saved@Href@B
-%
-% \footnotetext{\RightNote{1.3i}Formerly, italic corrections were added to the
-% \cs{mathnormal} arguments.}
-
\makeatother
The feature-implementing commands §\MTicinmath§, §\MTnoicinmath§,
-§\MTicalsoinmathxx§ are described in section \ref{sec:cmds}.
+§\MTicalsoinmathxx§ are described in \autoref{sec:cmds}.
\endgroup
\textbf{\hbox{Note:}} \emph{from brief testing on 2012/12/28, \XeTeX{} seems not
@@ -3944,11 +3762,7 @@ at least on current TL2016.
\noindent\kern-0.5em\relax2022/10/29: no change with current TL2022.}
-% For more see
-% \url{http://tex.stackexchange.com/a/337076} which explores also the differences
-% between the two Unicode engines regarding italic corrections in pure text mode.
-
-\subsection{Extra glue after \texorpdfstring{\cs{exists}}{\textbackslash
+\subsubsection{Extra glue after \texorpdfstring{\cs{exists}}{\textbackslash
exists}, \texorpdfstring{\cs{forall}}{\textbackslash forall}, and before the prime glyph}
\label{sec:extraskips}
@@ -3998,21 +3812,16 @@ Under the §subdued§ option, the \emph{normal} math version (at the start of
the document body, or after |\MTversion{normal}|) and the \emph{bold} math
version (either at the start of the document body after \cs{boldmath}, or after
|\MTversion{bold}|) do not have any extra skip inserted (even one of zero
-width) after $\oldforall$, $ \oldexists$, or before the ${}'$.%
-%
-%\footnote{\RightNote{1.3j}Formerly, skips of zero widths were inserted.}
+width) after $\oldforall$, $ \oldexists$, or before the ${}'$.
\endgroup
-
-\subsection{Extended scope of the math alphabets commands}
+\subsubsection{Extended scope of the math alphabets commands}
\label{sec:mathxx}
\begingroup
\MTversion{italic}\renewcommand\familydefault\sfdefault
-% il faudra peut-être que j'annule cette façon qu'à mathastext de tripatouiller
-% \familydefault...
-\makeatletter\let\mst@doasterisk\relax\makeatother
+\MTnormalasterisk
Ever since the initial version of the package, some characters usually
unaffected by the math alphabet commands \cs{mathbf}, \cs{mathtt},
@@ -4027,21 +3836,31 @@ $<$, or $]$ could not be declared of `variable family' (in addition to being
picked up in the text font) as this would, for reasons of the inner workings of
\TeX{}, not be compatible with the automatically inserted spaces around them.
-A revolutionary\RightNote{1.2} ;-) novelty is introduced with version |1.2| of the package:
+A revolutionary\RightNote{\mstrelease{1.2}} ;-) novelty is introduced with
+version \mstrelease{1.2} of the package:
\begin{enumerate}
\item the pre-declared or user-declared (using the |amsmath|
\cs{DeclareMathOperator} or equivalent) operator names obey the math
alphabet commands,\footnote{contrarily to the next feature, this one is not
likely to create incompatibilities with other packages, so it is
activated by default.}
-\item and, \emph{optionally}, all non alphabetical
- characters\footnote{of course some of them are input preceded by a
- backslash, and the backslash itself is input as \cs{backslash}.} treated by
- \mst, \emph{i.e.}, if not disabled by options,
- ${!}\,{?}\,{,}\,{:}\,{;}\,{+}\,{-}\,{=}\,{(}\,{)}\,{[}\,{]}\,{<}\,{>}\,{\{}\,{\}}$,
- the asterisk $*$, and
- $.\,/\,\vert\,\backslash\,{\#}\,{\$}\,{\%}\,{\&}$%
-%
+\item as well as all non alphabetical characters treated by \mst.
+\end{enumerate}
+
+The non-letters handled by \mst (if not disabled by options) fall into two
+groups:
+\begin{itemize}[nosep]
+\item Those to which \TeX{} associates some specific spacings:
+ \centeredline{${!}\,{?}\,{,}\,{:}\,{;}\,{+}\,{-}\,{=}\,%
+ {(}\,{)}\,{[}\,{]}\,{<}\,{>}\,{\{}\,{\}}\,*$}
+ We call them the ``hard'' ones.
+\item Those for which \TeX{} uses so-called ordinary spacings:
+ \centeredline{$.\,/\,\vert\,\backslash\,{\#}\,{\$}\,{\%}\,{\&}$}
+ We call them the ``easy'' ones.
+\end{itemize}
+The ``easy'' non-letters are handled \emph{easily} by \mst, simply
+by declaring them to be of ``variable family type''. This will
+be done automatically.%
\footnote{%
${\#}\,{\$}\,{\%}\,{\&}$ obey the math alphabets since the initial version
of \mst; the dot $.$, the slash $/$, the vertical bar $\vert$ and the
@@ -4049,431 +3868,326 @@ A revolutionary\RightNote{1.2} ;-) novelty is introduced with version |1.2| of t
around them, and the procedure is then activated by default since
\texttt{1.2} for these characters as they are `easy non-letters'. But for
\cs{mid} and \cs{setminus} which are $\vert$ and $\backslash$ with special
- spacing (of type \cs{mathrel} and \cs{mathbin} resp.) the procedure has
- some constraints explained in the framed box on next page and the
- activation requires \cs{MTnonlettersobeymathxx}.}
+ spacing (of type \cs{mathrel} and \cs{mathbin} resp.) the
+ activation requires \csb{MTnonlettersobeymathxx}.}
%
-will also obey
- the math alphabet commands (when not used as delimiters). The
- important thing is that the spaces added by \TeX{} before and after
- are not modified.
-\end{enumerate}
+The ``hard'' non-letters require a more complex approach using a concept
+called ``mathematical activation''. For reasons explained next, this is not
+done automatically and requires the user to employ the command
+§\MTnonlettersobeymathxx§ (or, for the specific case of the asterisk the option
+§asterisk§).
+
+\begin{shaded*}
+ It is a fundamental feature that the spacing added by \TeX{} before and
+ after each such \mst-ified non-letter is in no way modified.
+\end{shaded*}
+
+
Let us compare, for example, the new behavior of \cs{mathtt} and \cs{mathbf}
-\MTmathoperatorsobeymathxx\MTnonlettersobeymathxx\MTeasynonlettersobeymathxx
-\[ \mathtt{(\sin(n!)<\cos(m-p)?)}\qquad \mathbf{[\sin(x+y)=\cos(z-t)]}\]
-with the traditional default behavior:
-\MTmathoperatorsdonotobeymathxx\MTnonlettersdonotobeymathxx
+when §\MTnonlettersobeymathxx§ has been used
+\MTmathoperatorsobeymathxx
+\MTnonlettersobeymathxx
+\MTeasynonlettersobeymathxx
+\[ new:\quad \mathtt{(\sin(n!)<\cos(m-p)?)}\qquad \mathbf{[\sin(x+y)=\cos(z-t)]}\]
+with the traditional default behavior one observes without \mst or in
+§subdued§ normal or bold math version:
+\MTmathoperatorsdonotobeymathxx
+\MTnonlettersdonotobeymathxx
\MTeasynonlettersdonotobeymathxx
-\[ \mathtt{(\sin(n!)<\cos(m-p)?)}\qquad \mathbf{[\sin(x+y)=\cos(z-t)]}\]
-
-The first feature is activated by default, except of course for the normal and
-bold math versions when the package was given the \emph{subdued} option. The
-second feature is \emph{off} by default for the characters listed first. It is
-\emph{on} for the `easy' cases
-${\#}\,{\$}\,{\%}\,{\&}\,.\,/\,\vert\,\backslash$ (activating the feature for
-them puts no constraint on the user input and should not be too upsetting to
-other packages), and also for $*$ but only if this was required explicitly by
-the option §asterisk§, as the user then is supposed to know that |$R^*$| is no
-valid input anymore and should be replaced by |$R^{*}$|. The remaining `difficult'
-cases create similar
-constraints, which will be commented more upon next. The commands%
-\footnote{these commands are to be used outside of math mode.
- Their scope is limited to the current \LaTeX{} environment or group. They use
- the \cs{everymath} and \cs{everydisplay} mechanism so if the document needs to
- modify these token lists it has to do so in a responsible manner, extending
- not annihilating their previous contents.}
-%
-for deactivation are:\\
+\[ standard:\quad \mathtt{(\sin(n!)<\cos(m-p)?)}\qquad \mathbf{[\sin(x+y)=\cos(z-t)]}\]
+
+The commands for
+\emph{deactivation} are:\\
\mbox{}\hspace{1cm}\csb{MTmathoperatorsdonotobeymathxx},\\
\mbox{}\hspace{1cm}\csb{MTeasynonlettersdonotobeymathxx},\\
\mbox{}\hspace{1cm}\csb{MTnonlettersdonotobeymathxx},\\
-and those for activation:\\
-\mbox{}\hspace{1cm}\csb{MTmathoperatorsobeymathxx} regards operator names and is executed by default,\\
-\mbox{}\hspace{1cm}\csb{MTeasynonlettersobeymathxx} is done by default and applies to \centeredline{${\#}\,{\$}\,{\%}\,{\&}\,.\,/\,\vert\,\backslash$} and also to $*$ under package option §asterisk§,\\
-\mbox{}\hspace{1cm}\csb{MTnonlettersobeymathxx} is \emph{not} done by default (see explanations why in the framed box next) and regards \centeredline{${!}\,{?}\,{,}\,{:}\,{;}\,{+}\,{-}\,{=}\,{(}\,{)}\,{[}\,{]}\,{<}\,{>}$} and also \cs{mid} and \cs{setminus} but applies to
-the braces ${\{}\,{\}}$ only if \csb{MTexplicitbracesobeymathxx} is also used.\par
-%
-%% suppression de cette note de bas de page à 1.3u car elle est obsolète
-%% (pas sûr si à 100%, mais en tout cas l'exemple avec \mathbf{-} n'a plus
-%% de problème.
-% \footnote{when in subdued mode, the
-% math alphabets are the default ones, not the ones modified by \mst to use the
-% document text fonts. As a result, matters of font encodings may then give
-% unexpected results, for example for $-$. On the present document page we
-% switched to a math version to escape from the |subdued| mode and avoid the
-% problem with \cs{mathbf\{-\}} giving in the normal (subdued) math version
-% {\MTversion{normal}\MTnonlettersobeymathxx$\mathbf-$\sffamily, when
-% `non-letters' are declared to obey math alphabets.}}
+and those for \emph{activation}:\\
+\mbox{}\hspace{1cm}\csb{MTmathoperatorsobeymathxx} (done by default),\\
+\mbox{}\hspace{1cm}\csb{MTeasynonlettersobeymathxx} (done by default),\\
+\mbox{}\hspace{1cm}\csb{MTnonlettersobeymathxx} is \emph{not} done by default
+(see explanations why in the shaded box next) and applies to the ``hard''
+non-letters mentioned above and also to \cs{mid} and \cs{setminus}.
+Furthermore, it applies to
+the braces ${\{}\,{\}}$ only if \csb{MTexplicitbracesobeymathxx} is also used.
+
+
+\begin{shaded*}
+ \textbf{Important:} the package does not execute on its own
+ \csb{MTnonlettersobeymathxx}. The reason is that the
+ mechanism in effet replaces the original ``hard'' characters such as
+ |?|, |[|, |<| by (in math mode only) a more complex structure, which
+ ceases looking to \TeX{} as only one token, and as a consequence |$x^?$|, |$R^+$|
+ or |$\mathopen<A\mathclose>$| raise an error, the workaround being to
+ employ additional braces: |$x^{?}$|, |$R^{+}$| and |$\mathopen{<}A\mathclose{>}$|.
+
+ Similarly |$R^*$| does not work anymore under option §asterisk§, the user is
+ supposed to know that with this option |$R^{*}$| is the mark-up to use.
+
+ Thus, if one adds
+ \centeredline{|\usepackage{mathastext}|§\MTnonlettersobeymathxx§} to a
+ pre-existing document, it is needed to check if the mark-up satisfies
+ to the above guidelines. For this reason the mechanism is by default
+ not activated and the user has to execute:
+ \centeredline{§\MTnonlettersobeymathxx§}
+ This can be done in the preamble and will trigger actual modifications
+ only at time of |\begin{document}|.
+\end{shaded*}
-\begin{framed}
- \textbf{Important:} the package does \csb{MTnonlettersdonotobeymathxx} by
- default. The reason is that activating the mechanism adds some constraints to
- the way things must be input, adding
-\centeredline{|\usepackage{mathastext}|\csb{MTnonlettersobeymathxx}}
- to a pre-existing
- document might well create errors:
- all these characters treated by \mst, such
- as |?|, |[|, |<| now represent (in math mode only!) \emph{two} `tokens' and
- this will utterly confuse \TeX{} if some precautions are not taken: |$x^?$|,
- |$R^+$| or |$\mathopen<A\mathclose>$| \emph{must} now be coded as |$x^{?}$|,
- |$R^{+}$| and |$\mathopen{<}A\mathclose{>}$| (the rule is to do as if |?|,
- |+|, |<| or |>| were each really \emph{two} characters).
-
- Even if this rule is respected in the document source, it is still a
- possibility that incompatibilities with other packages will arise because
- \mst does a \emph{mathematical activation} of the characters which could be
- unexpected and unchecked for by other packages. This is precisely the case
- with the \ctanpkg{amsmath} package, and the problem goes away by just making sure
- that |amsmath| is loaded before \mst{} (generally speaking, \mst should be
- loaded last after all packages dealing with math things).
-\end{framed}
+
+\begin{footnotesize}
+Some \TeX nical notes:%
+%
+\footnote{The complete truth is only to be found in source code. Here are
+ some extra details:
+
+ The
+ dollar sign and the curly braces are not tested for mathematical or catcode
+ activation.
+
+ The $*$\RLNote{changed:}{\mstrelease{1.4}} is tested as
+ are the ``hard'' non-letters, except under option §everymath§. On the
+ other hand \cs{ast} will be modified independently of what is decided for
+ $*$. Comprenne qui pourra.}
+
+\begin{itemize}[nosep]
+\item
+The asterisk $*$ is associated with its own option §asterisk§, because
+independently of the matter of its behavior in the scope of math alphabets
+commands, its handling by \mst (via the §\MTlowerast§ associated
+configuration) always requires it to be made mathematically active and to
+expand to a more complex structure. So once this option is received by the
+package, it goes full steam and also adds by default the responsiveness to
+math alphabet commands (in non-§subdued§ math versions).
+
+\item The legacy situation which is a bit late to change is that the
+ responsiveness of the asterisk to math alphabets being on by default under
+ option §asterisk§, it was decided that this responsiveness would be turned
+ off by §\MTeasynonlettersdonotobeymathxx§ and back on by
+ §\MTeasynonlettersobeymathxx§, although the $*$ is part of the ``hard''
+ non-letters. One can use §\MTnormalasterisk§ to stop the $*$ to obey math
+ alphabet commands, but it also cancels the §\MTlowerast§ mechanism.
+
+\item At\RLNote{changed:}{\mstrelease{1.4}} \mstrelease{1.4} ``easy''
+ non-letters found out to be (at |\begin{document}| or with §\MTversion§
+ except for §subdued§ \emph{normal} or \emph{bold}) mathematically active
+ characters will not get overridden by \mst.
+ This applies for example with
+ the dot ``.'' under \ctanpkg{babel} with Spanish language. Its special
+ behavior to transform into a comma ``,'' if before a digit is now
+ kept. As an amusing side note, if §\MTnonlettersobeymathxx§ is used, this
+ comma does obey math alphabet commands.
+
+\item An ``easy'' non-letter which (at |\begin{document}| or with §\MTversion§
+ except for §subdued§ \emph{normal} or \emph{bold}) is catcode active will
+ still be set by \mst to be of ``variable family type'', if it is not
+ mathematically active. The catcode status is not checked nor modified, only
+ the mathcode as per previous item. Now whether the \mst-ification has any
+ effect depends on how the user has configured the catcode active character
+ to behave if in math mode.
+
+\item When \mst wants to employ mathematical activation for a non-letter
+ character among the ``hard'' cases (inclusive of the asterisk), which is done
+ at |\begin{document}| if not §subdued§ or with every §\MTversion§ except for
+ §subdued§ \emph{normal} or \emph{bold}, it first checks if this character
+ is currently catcode active. If this is the case, it then checks if the
+ character is a \ctanpkg{babel} shorthand. If yes, it then hooks into
+ \ctanpkg{babel} internals to modify the way this shorthand acts in math
+ mode, so that now the character will respond to math alphabet commands.
+ If however the catcode active character does not appear to be a
+ \ctanpkg{babel} shorthand, then \mst does not do anything at all (beyond
+ its general business at package loading time to set-up the
+ font used for the non-active token).
+%
+ In relation to this context \mst should always be loaded \emph{after} \ctanpkg{babel}.
+ And also \emph{after} the \ctanpkg{amsmath} package.
+
+\item
The braces |\{| and |\}| remain unresponsive to the alphabet changing commands
-even after \csb{MTnonlettersobeymathxx}. One must issue also
-\csb{MTexplicitbracesobeymathxx}, but it has the disadvantage that |\{| and
+even after \csb{MTnonlettersobeymathxx}. The user must employ for this
+\centeredline{\csb{MTexplicitbracesobeymathxx}}
+This has the disadvantage that |\{| and
|\}| become then unusable as variable-size delimiters: |\big\{| or |\big\}|
create errors and one must make use of |\big\lbrace| and |\big\rbrace|. But
-\MTmathoperatorsobeymathxx\MTnonlettersobeymathxx\MTexplicitbracesobeymathxx
+%
+\MTmathoperatorsobeymathxx
+\MTnonlettersobeymathxx
+\MTexplicitbracesobeymathxx
+%
one can now enjoy $\mathtt{\{a, a>b\}}$, $\mathbf{\{a, a>b\}}$,
-$\mathsf{\{a, a>b\}}$, or even $\mathnormalbold{\{a, a>b\}}$.\footnote{this
- last example uses the \cs{mathnormalbold} additional alphabet defined by
- \mst.}\footnote{Let me recall that braces will anyhow not be handled at all
+$\mathsf{\{a, a>b\}}$, or even $\mathnormalbold{\{a, a>b\}}$.%
+%
+\footnote{This
+ last example uses the \csb{mathnormalbold} additional alphabet defined by
+ \mst.}%
+%
+\footnote{Let me recall that braces will anyhow not be handled at all
by \mst if the document
font encoding is |OT1|, except under option |alldelims|.}
-Even with \csb{MTnonlettersobeymathxx}, the parenthese-like symbols $($, $)$,
+\item
+Even with \csb{MTnonlettersobeymathxx}, the parentheses-like symbols $($, $)$,
$[$, $]$, $<$ and $>$ and the slashes $/$, $\backslash$, \emph{if used as
- left/right delimiters} (i.e.\@ with |\left/\right|) do not react to math
+ left/right delimiters} (i.e.\@ with |\left/\right|) will not respond to math
alphabet commands. This is mainly explained by the fact that the text font
-will not contain suitable glyphs, hence no attempt was made to make the
+will not contain suitable glyphs, hence no attempt was made by \mst to make the
delimiters pick up their glyphs there.
But \mst does try to pick up most of the `small variants' of the delimiters
-from the text font: |$\left<x\right>$| gives $\left<x\right>$ (but
-|$\left<b\right>$| gives $\left<b\right>$.) Notice that this differs from
+from the text font: |$\left<x\right>$| gives $\left<x\right>$ but
+|$\left<b\right>$| gives $\left<b\right>$. Notice that this differs from
standard \LaTeX{} for which |$\left< x\right>$| gives $\langle x\rangle$. As
-it is perhaps a bit strange to have $\left< x\right>$ next to
-$\left< X\right>$ there is option §nosmalldelims§: with this option the
-small-sized variants of the delimiters are not modified by \mst (option
-§nosmalldelims§ has the side effect that, for the non-delimiter uses of
-|\{, \}|
-to be \mst-ified it is necessary to issue \csb{MTnonlettersobeymathxx} and
-\csb{MTexplicitbracesobeymathxx}.)
-
-At any rate, as said above, whether `small' or not, delimiters are
-unresponsive to math alphabet commands, due to technical aspects of \TeX, and
-the way \mst handles these things. Examples: |\mathbf{<a,b>}| gives
-$\mathbf{<a,b>}$
-%{\setbox0\hbox{$\mathbf{<a,b>}$}\typeout{ICI}\showboxdepth\maxdimen
-% \showboxbreadth\maxdimen \showbox0}
-(no use of |\left/\right|, hence brackets do obey the math alphabets --- as we
-issued §\MTnonlettersobeymathxx§ a bit earlier), |\mathbf{\left<a,b\right>}|
-gives $\mathbf{\left<a,b\right>}$ (brackets used with |\left/\right| do not
-obey the math alphabets), |\mathbf{\mathopen{<}a,b \mathclose{>}}| gives
-$\mathbf{\mathopen{<} a,b \mathclose{>}}$ (no |\left/\right|, brackets
-do obey the math alphabets).
-
-\endgroup
-For comparison, the \LaTeX{} standard behavior for
-\centeredline{|\mathbf{\mathopen{<}a,b\mathclose{>}}|}
-is $\mathbf{\mathopen{<} a,b
- \mathclose{>}}$ (neither brackets nor the comma do respond).
-
-
-\subsection{Unicode engines}
-
-\mst is minimally Unicode aware since |1.12| and can be used with \XeTeX{} or
-\LuaTeX{}. Starting with release |1.3|, it needs |luatex| to be at least
-as recent as the one which was provided with the TL2013 distribution.
-
-However \mst applies only to (a subset of) the |32-127| ascii range, and
-optionally to Greek letters, but for the latter only if provided via ``\TeX\
-fonts'' such as Euler, Symbol or LGR-encoded fonts.
-It does not know how to use a given Unicode font simultaneously for Latin and
-Greek letters.
-
-Thus, first consider much better alternatives:
-\begin{itemize}
-\item Since 2018, the package \ctanpkg{mathfont}%
-%
-\footnote{Conrad \textsc{Kosowsky}, \emph{Use TrueType and OpenType fonts in math mode}
-\url{https://ctan.org/pkg/mathfont}.}
-%
-adapts Unicode text fonts to usage in math mode. It works with both \XeTeX\
-and \LuaTeX.
-\item For \XeTeX\ only, \ctanpkg{mathspec}%
-%
-\footnote{Andrew Gilbert \textsc{Moschou}, \emph{Specify arbitrary fonts for mathematics in \XeTeX}
-\url{https://ctan.org/pkg/mathspec}.}
-%
-also allows usage of arbitrary text fonts in mathematics.
-\item and of course
-\ctanpkg{unicode-math}%
-%
-\footnote{Will \textsc{Robertson}, et al., \emph{Unicode mathematics with
- support for XeTeX and LuaTeX} \url{https://ctan.org/pkg/unicode-math}.}
-%
-is the standard package for using OpenType fonts which are equipped with the needed extra
-support being used in \TeX\ math mode.
-\end{itemize}
-
-If using any one of the above you probably don't need, don't want, and should
-not use \mst.
-
-Let me insist that \mst has not been tested in any systematic
-manner under the Unicode engines; and that it is expected to be most definitely
-incompatible with \ctanpkg{unicode-math}, although your mileage may vary and some
-features may appear to work.
+it is perhaps a bit strange to have $\left< x\right>$ and $\left< y\right>$
+not use the same bracketing glyphs, there is an option §nosmalldelims§: with
+this option the small-sized variants of the delimiters are not modified by
+\mst (option §nosmalldelims§ has the side effect that, for the non-delimiter
+uses of |\{, \}| to be \mst-ified it is necessary to issue
+\csb{MTnonlettersobeymathxx} and \csb{MTexplicitbracesobeymathxx}.)\par
-When using \mst with either \XeTeX{} or \LuaTeX{} it is recommended to use the
-\ctanpkg{fontspec} package (see remark below on \cs{encodingdefault}). Furthermore,
-if using \ctanpkg{fontspec} it is \emph{necessary} to load it with its
-|no-math| option, and this \emph{must} happen before loading \mst.
-\begin{framed}
-\begin{itemize}[label=$\bullet$, leftmargin=1em]
\item
- Use \ctanpkg{fontspec} with its
- \emph{no-math} option, and load it \emph{prior} to \mst. As some packages
- load \ctanpkg{fontspec} themselves (for example |polyglossia|), a
- \centeredline{|\PassOptionsToPackage{no-math}{fontspec}|} early in the
- preamble might be needed.
-
-\item
- The \ctanpkg{amsmath} package, if used, \emph{must} be loaded \emph{prior} to \mst.
-
-\item
- Under |lualatex| engine, it is recommended to also load the package
- \ctanpkg{lualatex-math}.% Please check its documentation as possibly it has now
- % been incorporated upstream (I am not following up on the situation).
+At any rate, as said above, whether `small' or not, delimiters will remain
+unresponsive to math alphabet commands, due to technical aspects of \TeX, and
+the way \mst handles these things. Examples:
+\begin{itemize}[nosep]
+\item |\mathbf{<a,b>}| gives $\mathbf{<a,b>}$: no use of |\left/\right|, hence
+ brackets do obey the math alphabets --- as we issued
+ §\MTnonlettersobeymathxx§ a bit earlier,
+\item |\mathbf{\left<a,b\right>}| gives
+ $\mathbf{\left<a,b\right>}$: delimiters used with |\left/\right| will not obey
+ the math alphabets,
+\item |\mathbf{\mathopen{<}a,b \mathclose{>}}| gives
+ $\mathbf{\mathopen{<} a,b \mathclose{>}}$: no |\left/\right|, so the
+ brackets do obey the math alphabets due to §\MTnonlettersobeymathxx§.
+\item
+\MTnonlettersdonotobeymathxx
+to compare, the \LaTeX{} standard for
+|\mathbf{\mathopen{<}a,b\mathclose{>}}| is to produce
+$\mathbf{\mathopen{<} a,b \mathclose{>}}$: neither brackets nor the comma are
+responding to \cs{mathbf}.
\end{itemize}
-\end{framed}
-
-% obsolete with release 1.3:
-% A little piece of the functionality of \mst is less fully
-% realized under the \LuaLaTeX{} engine than it is with
-% \XeTeX{}. This is a temporary situation as the needed feature
-% of \LuaLaTeX{} has been implemented in its latest development
-% release. I will update \mst when these binaries will have
-% reached the distribution stage.
-
-I already mentioned in the section \ref{sec:ic} the fact that
-the italic corrections were not available for OpenType fonts
-under the \XeTeX{} engine and only partially available for the
-\LuaTeX{} engine, with the result that the spacings in math
-mode when using for the letters an upright text font will be
-less satisfying than with the standard PDF\TeX{} engine (the
-OpenType fonts not being usable with the latter engine, this is
-not a criterion of choice anyhow).
-
-To define math versions when using unicode fonts, use \ctanpkg{fontspec}'s
-\cs{setmainfont} before the \cs{Mathastext}\oarg{version} command, or simply
-before loading \mst for the default math versions.
-
-It is possible to mix usage of Unicode fonts and classical \TeX{}
-fonts. All used 8bits font encoding must have been passed as
-options to the \ctanpkg{fontenc} package.
-
-\subsubsection{The unicodeminus option}
-
-For legacy reason, \mst uses by default the |EN DASH U+2013| for the minus
-sign in math mode, if the font is determined to be a ``Unicode'' font.
-
-There is now the §unicodeminus§\RightNote{1.3q} to use rather
-% BORDEL DE BORDEL DE FAIT CHIER \verb ET Text for \verb command ended by end
-% of line. je l'ai patché dans etoc et xint mais pas ici encore.
-|MINUS SIGN U+2212|.%
-\footnote{Thanks to Tobias~\textsc{Brink} who asked for this feature.}
-%
-Check \hyperref[nicodeminus]{\ttfamily\hyphenchar\font=189 its documentation}
-on page \pageref{nicodeminus}.
+\end{itemize}
+\end{footnotesize}
-\subsubsection{Two examples}
+\endgroup
-I include
-here two examples which compiled successfully with \XeTeX{} and
-\LuaLaTeX{}, the first one on a Linux machine, the second one on a Mac
-OS X machine.\footnote{A |tex mathastext.dtx| (in a temporary repertory) on a
- copy of |kpsewhich mathastext.dtx| will extract extended versions of
- these examples as test files.}
+\subsubsection{Hacking letters (and even digits) for special tasks}
+\label{ssec:hackingletters}
+
+For some ascii characters, i.e.\@ the ``hard'' non-letters considered in the
+previous section, and even more spectacularly for all ascii letters, \mst
+achieves the capabilities describes in earlier sections via a \TeX nique known
+as ``mathematically active characters''. For letters this is turned on by
+default, but for the non-letter characters it is the command
+\cs{MTnonlettersobeymathxx} which triggers this mathematical activation.
+
+It is possible for daring \LaTeX{} users to hook into this architecture.
+Release \mstrelease{1.4} has made this especially easy regarding ascii letters
+(and even for digits if using the package option §activedigits§).
+
+Except if told otherwise, \mst will make all Latin ascii letters mathematically
+active, and when \TeX{} encounters e.g.\@ `e' in math mode it replaces it with
+the macro having name \cs{MTcommandlettere} (mind the ending |e|). Its
+default definition inserts \hyperref[sec:mathskips]{optional extra skips}
+and/or an \hyperref[sec:ic]{italic correction}.
+
+You can redefine this \cs{MTcommandlettere}, or any
+\cs{MTcommandletter}\meta{ascii-letter}, to achieve (globally or locally)
+custom goals.%
+%
+\footnote{\CHANGED{\mstrelease{1.4}}%
+Prior to \mstrelease{1.4}, there was no equivalent to
+\cs{MTcommandletter}\meta{letter}. An internal macro \cs{mst@}\meta{letter}
+stood for what is denoted now \cs{MTmathcharletter}\meta{letter}, but required
+a \cs{protected} if redefined as it was submitted to an \cs{edef} during
+processing.}
+%
+Attention, this redefinition should not use `e' itself as a ``naked''
+character to typeset in math mode, else an infinite loop will arise at time of
+use. To access a symbol equivalent to the ``naked'' `e', use
+\cs{MTmathcharlettere} (again mind the ending |e|). For example:
\begin{verbatim}
-\documentclass{article}
-\usepackage[hscale=0.8]{geometry}
-\usepackage{multicol}
-\usepackage[no-math]{fontspec}
-\usepackage{lmodern}
-\usepackage[subdued,italic]{mathastext}
-\setmainfont[Color=999999]{Verdana} \Mathastext[Verdana]
-\setmainfont[Color=0000FF]{Arial} \Mathastext[Arial]
-\setmainfont[Color=00FF00]{DejaVu Serif} \Mathastext[DejaVu]
-\MTDeclareVersion{times}{T1}{ptm}{m}{n}
-\setmainfont[Color=FF0000]{Andale Mono} \Mathastext[Andale]
-\begin{document}
-\newcommand\TEST[1]{\MTversion{#1}%
-\begin{multicols}{2}
-\hbox to\columnwidth{\hbox to\columnwidth{\hfil
- $abcdefghijklmnopqrstuvwxyz$\hfil}\kern-2.5em{#1}}
- \centerline{ $ABCDEFGHIJKLMNOPQRSTUVWXYZ$ }
- \centerline{ $0123456789$ }
- \centerline{ $!\,?\,*\,,\,.\,:\,;\,+\,-\,=\,(\,)\,[\,]\,/\,\#\,%
- \$\,\%\,\&\,<\,>\,|\,\{\,\}\,\backslash$ }
-\columnbreak
- \centerline{ abcdefghijklmnopqrstuvwxyz }
- \centerline{ ABCDEFGHIJKLMNOPQRSTUVWXYZ }
- \centerline{ 0123456789}
- \centerline{ !\,?\,*\,,\,.\,:\,;\,+\,-\,=\,(\,)\,[\,]\,/\,\#\,%
- \$\,\%\,\&\,<\,>\,|\,\{\,\}\,\char92 }
-\end{multicols}}
-\begin{multicols}{2}
- \centerline{\textbf{math mode}}
-\columnbreak
- \centerline{ \textbf{text} }
-\end{multicols}
-\TEST{DejaVu}\TEST{Verdana}\TEST{times}\TEST{Andale}
-\TEST{Arial}\TEST{bold}\TEST{normal}
-\end{document}
+\renewcommand\MTcommandlettere{\mathsf{\MTmathcharlettere}}% not \mathsf{e}!
\end{verbatim}
-And now the same thing with fonts available on Mac OS X:
+In this case we could do the simpler approach with \cs{textsf}, which works
+as it will then typeset the |e| in text mode, not math mode.
\begin{verbatim}
-\documentclass{article}
-\usepackage[hscale=0.8]{geometry}
-\usepackage{multicol}
-\usepackage[no-math]{fontspec}
-\usepackage{lmodern}
-\usepackage[subdued,italic]{mathastext}
-\setmainfont[Color=FF0000]{Hoefler Text} \Mathastext[Hoefler]
-\setmainfont[Color=336633]{American Typewriter}\Mathastext[Typewriter]
-\setmainfont[Color=0000FF]{Herculanum} \Mathastext[Herculanum]
-\setmainfont[Color=FF00FF]{Didot} \Mathastext[Didot]
-\setmainfont[Color=999999]{Comic Sans MS} \Mathastext[Comic]
-\begin{document}
- --- copy here the code from the previous example ---
-\TEST{Didot}\TEST{Comic}\TEST{normal}\TEST{Herculanum}
-\TEST{Hoefler}\TEST{Typewriter}\TEST{bold}
-\end{document}
+\renewcommand\MTcommandlettere{\textsf{e}}% not \mathsf{e}!
\end{verbatim}
-% The test files which will be produced by running |latex| on
-% |mathastext.dtx| are more extent.
+This gives a priori the same result in our \mst context, which
+picks the font for \cs{mathsf} from the one used by \cs{textsf}, assuming here
+default configuration in the preamble following the loading of \mst.%
+%
+\footnote{This example simply reassigns \texttt{e} to another font, and one
+could use also the \LaTeX{} command \cs{DeclareMathSymbol} for this. But few
+\LaTeX{} users are familiar with its interface, and such an approach could
+cost adding an extra math symbol font, depending on what one wants to do.
+Besides \cs{DeclareMathSymbol} is a preamble-only command, which limits
+considerably its usability, forcing basically the change to apply to the whole
+document. Using the \mst interface via mathematically active characters opens
+up the possibility of arbitrary replacements, of local scope in the document
+body.}
-\subsection{Compatibility issues}\label{sec:compat}
-
-Compatibility issues (or just questions of who decides last) are naturally to
-be expected with packages dealing with the math setting; the fix is simply to
-load \mst last. And one should always load |amsmath| before \mst (this is
-especially true when using Unicode engines but applies in general as well).
-
-Any definition made in a package loaded before \mst of the font to be
-used for letters or for the common characters in the |ascii| basic range
-will be overruled by the loading of \mst (this includes the case
-when the earlier package had made the character `mathematically active').
-Conversely most of the set-up done by \mst may well be overruled by
-packages loaded later which do math related things.
-
-Starting with version |1.2|, \mst makes some characters `mathematically
-active' to achieve certain effects: automatic insertion of the italic
-corrections when using an upright text font in math, extended scope of
-the math alphabet commands which now apply to non-letter symbols (and
-also to math operator names, but this is much easier to achieve). And
-the (already mathematically active) right quote is modified to have some
-extra space added before the derivative glyph ${}'$.
-
-This is compatible with using \cs{label} and \cs{ref} in and outside of
-math mode. But a difficulty arises when some other package has made the
-character `globally active' everywhere in the document. The action of
-\mst is made anew at each mathematical inline or displayed formula. If
-it is detected that a character has been activated then nothing further
-will be done (so the \mst feature\footnote{italic correction insertion
- for the latin letters, receptivity to the math alphabet action for the
- other characters.} for that character is lost) \emph{except} if it
-appears that this activation was done by the Babel system. In that case
-\mst does not make the character mathematically active but it modifies
-in the appropriate manner the action of Babel for that character in math
-mode. Furthermore \mst makes the character mathematically
-\emph{inactive}.\footnote{only the characters
- {{;}\,{,}\,{:}\,{!}\,{?}\,{+}\,{\textendash}\,{=}\,{<}\,{>}\,{(}\,{)}\,{[}\,{]}\,*}
- mentioned in section \ref{sec:mathxx} as `difficult non letters' (and
- the right quote {'}) and
- the latin letters are concerned here; it seems highly unprobable that
- a latin letter ${\in}\{a\mbox{--}z,A\mbox{--}Z\}$ will have been made
- globally active (only letters never being used in command names are
- possible candidates), but \mst has been
- designed to cope with it, should it happen ...}
-
-Here is indeed some code that you should \textbf{not} try at
-home:
+
+It is recommended in general to add an extra pair of braces
+to avoid problems when used with |_| and |^|. Let's give an other example and
+demonstrate its output:
\begin{verbatim}
- \documentclass{article}
- \usepackage[french]{babel}
- \usepackage{mathtools}\mathtoolsset{centercolon}
- \begin{document}
- $:$
- \end{document}
+\[
+\renewcommand\MTcommandlettere{{\mathcolor{blue}{\mathsf{\MTmathcharlettere}}}}%
+abcde^efgh
+\]
\end{verbatim}
-\fbox{DO NOT DO THIS AT HOME}\thinspace: it creates an infinite
-loop.\footnote{This seems to still be the case with Babel |3.9f| and
- frenchb.ldf |2.6e|, as tested on Sep. 2, 2013. Again tested with up-to-date
- TL2015 Jan. 15, 2016 with same result.} This is due
-to the fact that the colon is simultaneously active (this is made by
-\ctanpkg{babel-french} at begin document) and mathematically active (done by
-\ctanpkg{mathtools} in the preamble). The interaction gives an infinite loop. Such a
-situation will be cured by \mst, even loaded before \ctanpkg{mathtools},
-\emph{if} use is made of \cs{MTnonlettersobeymathxx}. At each math formula
-\mst will detect that Babel has activated the colon, and will cancel the
-mathematical activation (the precise definition done by \ctanpkg{mathtools} was
-already lost at begin document due to overwriting by \ctanpkg{babel} but the fact that
-the character was mathematically active remained true).
+\MTversion{times}
+\[
+\renewcommand\MTcommandlettere{{\mathcolor{blue}{\mathsf{\MTmathcharlettere}}}}%
+abcde^efgh
+\]%
+\MTversion{normal}%
+As this document is in §subdued§ mode, we had, to show the effect, to
+switch temporarily to some math version activating \mst, and we used here a
+|times| math version with Times and Helvetica clones.
+
+If you redefine \cs{MTcommandlettere} as described in this section the optional extra
+math skips added before or after via §\MTsetmathskips§ will be lost, as well
+as the automatic italic correction |\/| added by \mst for an upright font, and it
+is up to the redefinition of \cs{MTcommandlettere} to do the job.
+
+The explanations above apply to any (ascii) Latin letters \meta{ascii-letter}
+with associed macros \cs{MTcommandletter}\meta{ascii-letter} and ``naked''
+symbol command \cs{MTmathcharletter}\meta{ascii-letter}.
+
+With option §activedigits§ you can even extend the game to digits. The
+``raw'' digit symbol is kept as a math symbol control sequence
+\cs{MTmathchardigit}\meta{y} where \meta{y} stands for the Roman version of
+the digit: empty
+for $0$, then |i|, |ii|, etc... until |ix|. The macro to redefine for special
+effect is \cs{MTcommanddigit}\meta{y}. Example:
+\begin{verbatim}
+\[
+\renewcommand\MTcommanddigit{{\MTmathchardigit^{\mathcolor{blue}{1}}
+ _{\mathcolor{red}{2}}}}%
+\renewcommand\MTcommanddigiti{{\boxed{\mathbf{\MTmathchardigiti}}}}
+0^0_0
+\]
+\end{verbatim}
+\MTversion{times}
+\[
+\renewcommand\MTcommanddigit{{\MTmathchardigit^{\mathcolor{blue}{1}}
+ _{\mathcolor{red}{2}}}}%
+\renewcommand\MTcommanddigiti{{\boxed{\mathbf{\MTmathchardigiti}}}}
+0^0_0
+\]%
+\MTversion{normal}%
+(\cs{boxed} is from \ctanpkg{amsmath}) Let's hope you find better
+usage... recall that you can't use digit $0$ in its redefinition but must use
+\cs{MTcommanddigit}. But you can of course use other digits... except if
+their definitions use the digit $0$ rather than the non-active symbol control
+sequence \cs{MTmathchardigit}.
+See also §\MTmathactiveletters§ and §\MTmathactivedigits§.
- So far I have briefly described the problem of document active
- characters (see the test file |mathastexttestalphabets.tex| for more
- explanations and illustrations, and the commented source code of the
- package). Pure mathematical activation revealed an incompatibility of
- another type with \ctanpkg{amsmath}. To fix it, \mst now replaces
- an inner macro of \ctanpkg{amsmath}
- (\cs{resetMathstrut@}) with its own version.\\
- \null\hspace{1cm}\fbox{Always load \ctanpkg{amsmath} before \mst.}\\
- Actually this last commandment was already made necessary by the use of the
- text endash to represent the minus sign in math mode, and, especially for
- Unicode engines, some aspects of the \cs{DeclareMathOperator} macro from
- \ctanpkg{amsmath}.
-
- \begin{framed}\kern-.75\baselineskip
- \begin{framed}
- \textbf{Important!} As is mentioned in the section \ref{sec:mathxx},
- after command §\MTnonlettersobeymathxx§, characters such as
- |?|, or |[|, now represent \emph{two} `tokens' and this will utterly
- confuse \TeX{} if some precautions are not taken. Examples: |$0^+$| or
- |$x\mathrel?y$| or |$R^*$| \emph{must} be input now as |$0^{+}$|
- and, respectively,
- |$x\mathrel{?}y$| or |$R^{*}$|. This is why the package does
- §\MTnonlettersdonotobeymathxx§ by default.
- \end{framed}\vskip-.75\baselineskip
- \end{framed}
- One thing to take note of is that this mechanism uses the \cs{everymath}
- and \cs{everydisplay}, so if it is needed to add to these \TeX{} `token
- lists' some additional things this should be done in a way preserving the
- former contents.
-
- If one issues (after |\begin{document}|) |\everymath={}| and
- |\everydisplay={}| this annihilates not only all the \mst (evil ?) doings
- with math active characters but also everything else some other package
- might have put in these token registers, so it is better, if the need
- arises to cancel the math activation of characters done by \mst to use the
- command §\MTeverymathoff§, which does all of
- §\MTmathoperatorsdonotobeymathxx§, §\MTnonlettersdonotobeymathxx§ (already
- default), §\MTmathstandardletters§, §\MTnormalprime§, and
- §\MTnormalasterisk§. This is supposed to be used in a group or
- environment (as there is no |\MTactivemathon|). It must be used prior to
- entering math mode.
-
- \begin{framed}
- \textcolor{magenta}{\bfseries New with 1.3i:} \mst patches |\url| of
- packages \ctanpkg{url} and \ctanpkg{hyperref}, and also |\nolinkurl|, to force them
- to do automatically §\MTeverymathoff§. Indeed they use math mode, and it
- is better to turn \mst off for their dealings.
- \end{framed}
-
% 2 septembre 2013; finalisé 22:58
% Mardi 19 décembre 2023: l'utilisation de bleu alors que ce n'est
@@ -4503,7 +4217,7 @@ option).
\item \mstcmd{Mathastext} (or \mstcmd{mathastext}) reinitializes \mst: it sets the
fonts used in math mode (in versions |normal| and |bold|) for letters,
digits and a few ascii symbols to the \emph{current} defaults of encoding,
- family, series and shape.\footnote{\texttt{\char92Mathastext} updates also
+ family, series and shape.\footnote{\csb{Mathastext} updates also
the font and shapes for the Greek letters (|LGRgreek| option), and the
skips to be inserted after the symbols $\oldforall$ and $\oldexists$,
see \emph{infra.}} Both the normal and bold math version are modified by
@@ -4517,7 +4231,7 @@ option).
the \LaTeX{} \cs{DeclareMathVersion} macro. \emph{Do not use}
|\string\Mathastext[foo]| \emph{with
|foo| equal to ``normal'' or ``bold'';} this is already taken care of by the
- initial loading of the package or a later command \cs{Mathastext}
+ initial loading of the package or a later command \csb{Mathastext}
without any optional argument. And it will be rejected.}
\item %\textbf{inheritance:}
\csb{Mathastext}\oarg{version\_name}\oarg{parent\_name}
@@ -4553,7 +4267,7 @@ option).
\mstcmd{MTlettershape}\marg{sh}.%
%
\footnote{These commands exist also with
- long names: \texttt{\char92Mathastextencoding},
+ long names: \csb{Mathastextencoding},
etc\dots{} The same applies to the other commands
mentioned in this section.}
%
@@ -4597,7 +4311,7 @@ optional argument) will these commands have any real effect.
of the time of loading the package.} else letters will
have the same shape as used for digits and operator-names.
- Another optional argument may be used as last argument.\RightNote{1.3c}
+ Another optional argument may be used as last argument.\RightNote{\mstrelease{1.3c}}
Similarly as its
use with §\Mathastext§ this makes the declared math version inherit, for
things not modified by \mst like large symbols, the font set up of the math
@@ -4645,7 +4359,7 @@ optional argument) will these commands have any real effect.
redefined). In the absence of the optional argument, the mandatory one is
used. The versions \emph{must} be either |normal|, or |bold|, or previously
declared ones via §\Mathastext§ or §\MTDeclareVersion§.
- \item the starred variant\RightNote{1.3c} does the math set-up, but changes \emph{nothing} to
+ \item the starred variant\RightNote{\mstrelease{1.3c}} does the math set-up, but changes \emph{nothing} to
the text fonts (see \autoref{sec:mathversions} for a description of the math
set-up, which summarizes
what is done additionally to only using \LaTeX{}'s |\mathversion|).
@@ -4659,7 +4373,7 @@ optional argument) will these commands have any real effect.
option the package checks separately the letter shape for lowercase and
uppercase.
- \RightNote{1.3j}§\MTversion§ also does §\MTexistsdoesskip§,
+ \RightNote{\mstrelease{1.3j}}§\MTversion§ also does §\MTexistsdoesskip§,
§\MTforalldoesskip§, and also §\MTprimedoesskip§,
\csb{MTmathoperatorsobeymathxx}, except under the |subdued| option for
\emph{normal} and \emph{bold}, in which case it does the opposite actions.
@@ -4668,17 +4382,13 @@ optional argument) will these commands have any real effect.
the |italic| option) combining the |h| letter and the \={ } accent from the
\mst font. Note that \cs{mathrm}|{\hbar}| and \cs{mathbf}|{\hbar}| will
work and that \cs{hbar} does scale in subscripts and exponents. Since
- |1.3u|, this is a priori compatible with all 8bits text font
- encodings\RightNote{1.3u} supporting the |\=| text accent in
+ \mstrelease{1.3u}, this is a priori compatible with all 8bits text font
+ encodings\RightNote{\mstrelease{1.3u}} supporting the |\=| text accent in
the LaTeX way.%
%
-\footnote{\RightNote{1.3u}The horizontal skips for letter |h| from
- \cs{MTsetmathskips} are ignored for \cs{hbar}.% Formerly, a positive
- % ``before'' skip was not properly taken into account for the horizontal
- % positioning of the accent and thus gave a bad result. The user can extend
- % the package \cs{hbar} definition to add skips.
-}
-\footnote{\RightNote{1.3u}The \cs{hbar} redefinition is canceled in normal and
+\footnote{\RightNote{\mstrelease{1.3u}}The horizontal skips for letter |h| from
+ \csb{MTsetmathskips} are ignored for \cs{hbar}.}
+\footnote{\RightNote{\mstrelease{1.3u}}The \cs{hbar} redefinition is canceled in normal and
bold math versions under the |subdued| option.}
\item \mstcmd{fouriervec}: this is a |\vec| accent taken from the Fourier font;
@@ -4687,7 +4397,7 @@ if option §fouriervec§.
\item \mstcmd{pmvec}: this provides a poor man \cs{vec} accent command, for
upright letters. It uses the right arrow. Does not change
size in subscripts and exponents.
-\item \RLNote{new description:}{1.3za}\mstcmd{Mathnormal}, \mstcmd{Mathrm},
+\item \RLNote{new description:}{\mstrelease{1.3za}}\mstcmd{Mathnormal}, \mstcmd{Mathrm},
\mstcmd{Mathbf}, \mstcmd{Mathit}, \mstcmd{Mathsf}, \mstcmd{Mathtt}: they use the
\mst-ified fonts. By default, \mstcmd{mathnormal}, \mstcmd{mathrm},
\mstcmd{mathbf}, \mstcmd{mathit}, \mstcmd{mathsf}, \mstcmd{mathtt} are redefined
@@ -4707,7 +4417,7 @@ size in subscripts and exponents.
This command is also made available under §subdued§ option in
the ``normal'' and ``bold'' math versions, as \LaTeX\ does not define it a
priori, contrarily to §\mathbf§ and other math alphabet commands.
- \item \RightNote{1.3x}\mstcmd{mathgreekup}: math alphabet, only available
+ \item \RightNote{\mstrelease{1.3y}}\mstcmd{mathgreekup}: math alphabet, only available
under §LGRgreek§ (or §LGRgreeks§) option, which gives access to `upright'
Greek letters (picked up from a font available in |LGR|-encoding). Note
that the package also defines \cs{alphaup}, \dots, \cs{piup}, \dots\
@@ -4725,7 +4435,7 @@ size in subscripts and exponents.
support as long as suitable usage of §\MTgreekfont§ later on configures a
suitable font).
- \RightNote{1.3za}Also \mstcmd{mathgreekupbold}.
+ \RightNote{\mstrelease{1.3za}}Also \mstcmd{mathgreekupbold}.
\begin{footnotesize}
These math alphabets are also available under §subdued§ option in the
@@ -4764,14 +4474,14 @@ size in subscripts and exponents.
the §subdued§ option anyhow.\par
\end{footnotesize}
-\item \RightNote{1.3x}\mstcmd{mathgreekit}: math alphabet, only available
+\item \RightNote{\mstrelease{1.3y}}\mstcmd{mathgreekit}: math alphabet, only available
under §LGRgreek§ (or §LGRgreeks§) option, which gives access to `italic'
Greek letters (picked up from a font available in |LGR|-encoding). The
actual shape is configurable via re-defining §\MTgreekitdefault§ and then
redeclaring the math version via §\Mathastext§ (with optional argument if
for a math version other than the ``normal'' one), or §\MTDeclareVersion§.
- \RightNote{1.3za}Also \mstcmd{mathgreekitbold}.
+ \RightNote{\mstrelease{1.3za}}Also \mstcmd{mathgreekitbold}.
\begin{footnotesize}
See the discussion of §\mathgreekup§ for some \TeX\ hacker level
@@ -4782,13 +4492,6 @@ size in subscripts and exponents.
font for use in math mode. By default, |\imath| and |\jmath| are redefined to use
them. Since \texttt{1.3t}, these macros obey the \texttt{subdued}
regime.
-%
-% \footnote{\RightNote{1.3t}Formerly (i.e.\@ since \texttt{1.12}) \mst
-% redefined the \texttt{\string\i} and \texttt{\string\j} as robust
-% commands usable both in text and math mode and using the above macros
-% in the latter. I have decided it wasn't such a good idea and there is
-% from now on \texttt{1.3t} no such redefinition of \texttt{\string\i}
-% and \texttt{\string\j}!}
\item \mstcmd{MathEuler}, \mstcmd{MathEulerBold}: math alphabets to access
all the glyphs of the Euler font, if option |eulergreek| (or
|eulerdigits| was passed to the package.
@@ -4811,14 +4514,14 @@ all the glyphs of the Euler font, if option |eulergreek| (or
\cs{let}\cs{varepsilon}$=$\cs{epsilon}, etc\dots,
in case only the `variant' form of the letter was used
in the documents.
-\item \hypertarget{symbolmisc}{Miscelleneous mathematical symbols} from the
+\item \hypertarget{symbolmisc}{Miscellaneous mathematical symbols} from the
postscript Symbol font are made available (or replaced) by option
§symbolmisc§.\footnote{option \blueit{asterisk} is also required to treat the
$*$.
Recall from \autoref{sec:mathxx} that the asterisk in math mode (also
when using the control sequence \cs{ast}) appears then to \TeX{} to be
a composite object.}
- \makeatletter\let\mst@doasterisk\mst@@doasterisk\makeatother They are
+ \MTactiveasterisk They are
\cs{prod}~$\prod$ \cs{sum}~$\sum$ \cs{implies}~$\implies$
\cs{impliedby}~$\impliedby$ \cs{iff}~$\iff$ \cs{shortiff}~$\shortiff$
\cs{to}~$\to$ \cs{longto}~$\longto$ \cs{mapsto}~$\mapsto$
@@ -4864,64 +4567,106 @@ comments).
The timing for actions of \mst falls into three cases:
\begin{enumerate}
-\item things done during the loading of the package, or delayed to
- |\AtBeginDocument|,
+\item things done by \mst itself during its loading (some are delayed to
+ |\begin{document}|),
\item things done as the result of user commands, either in the preamble or in
- the body of the document,
+ the body of the document, (but note that some commands if used in preamble
+ have a real effect only at the time of |\begin{document}|),
\item things done everytime math mode is entered.
\end{enumerate}
-The second category overlaps with the others, as the (preamble) use of some
-commands can have either immediate effect or only trigger some actions in
-|\AtBeginDocument| or perhaps only influence the things done later by \mst
-each time math mode is entered.
-
-The third category deserves some brief additional comments: it mainly (but not
-exclusively) regards the ``math activation'' of characters, and conversely all
-``math activations'' fall into this category. The package re-checks each time
-math mode is entered if some characters have been made in-between catcode
-active, or math active, and takes appropriate decisions: one important aspect
-of this issue is that |babel|'s mechanism for activating character was not, last
-time I checked, very robust against math active characters. I now checked
-again (on January 15, 2016) that
-\begin{verbatim}
- \documentclass{article}
- \usepackage[french]{babel}
- \usepackage{mathtools}\mathtoolsset{centercolon}
- \begin{document}
- $:$
- \end{document}
-\end{verbatim}
-creates an infinite loop (see section \ref{sec:compat} where this was
-mentioned already, some years ago). Thus \mst has (since |1.2e 2013/01/10|) a
-somewhat elaborate mechanism related to these issues (see the code comments),
-installed into the list of things done by \TeX\ systematically each time
-it enters math mode. For some legacy reason the package also puts into
-this list a few other things which could arguably be done elsewhere once and
-for all. The command \csb{MTeverymathoff} cancels all actions done by
-\mst.
+At \mstrelease{1.4}\RLNote{changed:}{\mstrelease{1.4}} a very significant
+change took place: the last category, the one of things done everytime math mode
+is entered, has become \emph{empty}.%
+%
+\footnote{There ia always an exception to a good
+rule, and here it is: only with \LuaLaTeX{} engine, a certain
+command is executed as part of \cs{everymath}. For details see
+\csb{MTfixfonts}.}
+
+The §everymath§ option added at \mstrelease{1.4} re-establishes the legacy
+behavior. Except for ascii letters: they will not even then be made
+mathematically active at each entrance in to math mode, but only once at time
+of package loading (if not §subdued§) and also when using §\MTversion§ (for
+non-§subdued§ math versions).
+
+\begin{shaded*}
+Under §everymath§ option some commands described here as being usable
+everywhere have in fact an effect only if used externally of math mode.
+The documentation is only accurate for the default \mstrelease{1.4}
+configuration, not for the legacy one as re-enacted by §everymath§.
+\end{shaded*}
+
+\subsubsection{Expert commands which are preamble-only}
+
+\begin{enumerate}[label=$\bullet$, leftmargin=1em]
+\item \mstcmd{MTgreekupdefault}:\RightNote{\mstrelease{1.3y}} a command with
+ no argument whose expansion specifies, under §LGRgreek§ regime, the
+ shape for the `|up|' Greek control sequences (and for the no-postfix
+ Greek control sequences under §upgreek§ option) in all \mst math
+ versions declared \emph{afterwards} via \cs{Mathastext} or
+ \cs{MTDeclareVersion}. The a priori default for this shape is `|n|'
+ (without the quotes). See
+ \autoref{sec:newgreek}.
+
+ This command can also be defined \emph{prior} to loading the package,
+ as the package itself only does:
+ \centeredline{|\providecommand*\MTgreekupdefault{n}|}
+
+\item \mstcmd{MTgreekitdefault}:\RightNote{\mstrelease{1.3y}} a command with
+ no argument whose expansion specifies, under §LGRgreek§ regime, the
+ shape for the `|it|' Greek control sequences (and for the no-postfix
+ Greek control sequences under §itgreek§ option) in all \mst math
+ versions declared \emph{afterwards} via \cs{Mathastext} or
+ \cs{MTDeclareVersion}. The a priori default for this shape is `|it|'
+ (without the quotes).
+ See \autoref{sec:newgreek}.
+
+ This command can also be defined \emph{prior} to loading the package,
+ as the package itself only does:
+ \centeredline{|\providecommand*\MTgreekitdefault{it}|}
+\end{enumerate}
+
\subsubsection{Expert commands usable everywhere}\label{sec:cmds}
\begin{enumerate}[label=$\bullet$, leftmargin=1em]
+ \item \mstcmd{MTcustomgreek}:\RightNote{\mstrelease{1.3d}} in case \mst has been loaded with one of its
+ Greek related options, this activates the corresponding
+ customization of Greek letters in math mode. It is issued
+ automatically by the package in the preamble (except if loaded with
+ |subdued| option) and at each switch of math version via
+ |\MTversion| or |\MTversion*| (except for the normal and bold math
+ versions in subdued mode). Also available as
+ |\Mathastextcustomgreek|. May be used even inside of math mode.
+
+ \item \mstcmd{MTstandardgreek}:\RightNote{\mstrelease{1.3d}} in case \mst was loaded with one of the Greek
+ related options this command reverts the customization, it resets the Greek
+ letters to their definitions in force at package loading time. Can be used
+ in the preamble, but is mainly for the document body (may even be used
+ inside math mode ...). Done automatically
+ under the |subdued| option when switching to the normal or bold math
+ version. Also available as |\Mathastextstandardgreek|.
+
+
\DeleteShortVerb{\|}%
\item \mstcmd{MTsetmathskips}\marg{a-z|A-Z}\marg{muglue\_before}\marg{muglue\_after}:
%
\MakeShortVerb{\|}%
%
- is\RightNote{1.3a} used to specify extra skips (or rather mu glue) to be
+ is\RightNote{\mstrelease{1.3a}} used to specify extra skips (or rather mu glue) to be
inserted in math mode, before and after a letter. The rationale is that
standard text fonts used in math mode may sometimes cause glyph (near-)
collisions with math symbols, as \TeX{} has some implicit expectations on the
design of fonts for math letters.
- \begin{framed}
+ \begin{snugshade}
These extra skips around letters are set at their natural width and do not
add any stretchability or shrinkability to the math formula as a whole,
nor do they result in extra potential break points.
- \end{framed}
+ \end{snugshade}
Random (silly) examples:
\centeredline{|\MTsetmathskips{x}{\medmuskip}{\thickmuskip}|} \centeredline
@@ -4941,19 +4686,19 @@ for all. The command \csb{MTeverymathoff} cancels all actions done by
\makeatother
\end{verbatim}
- \begin{framed}
+ \begin{snugshade}
\emph{\color{magenta}\bfseries Starting with |v1.3i|:} the extra skips are
\emph{not} applied to the letters within the scope of math alphabet
commands, or the letters from operator names (pre-defined or user
declared).
- \end{framed}
+ \end{snugshade}
{\footnotesize
Note that contrarily to the \csb{MTexistsskip}, \csb{MTforallskip}, and
\csb{MTprimeskip} commands described next, these extra skips (which may be
specified in the preamble) are not recorded in the definition of the math
- version (as defined via §\Mathastext§ with its optional argument or via
- §\MTDeclareVersion§). The declared skips hold thoughout the document
+ version (as defined via \csb{Mathastext} with its optional argument or via
+ \csb{MTDeclareVersion}). The declared skips hold thoughout the document
until modified or canceled, independently of math versions (of
course, \mst cancels the skips in the normal and bold math versions if
package option \blueit{subdued} was used).\par}
@@ -4967,18 +4712,15 @@ for all. The command \csb{MTeverymathoff} cancels all actions done by
cancels the skips
for that letter (they are not set to |0mu| but completely removed).
-
- % setting the skips to |0mu| which prevents formation of ligatures
- % when the letter is used inside a \cs{mathbf} for example). Example (using a
- % version with upright Latin Modern): \centeredline
- % {|\MTsetmathskips{f}{8mu}{0mu}$gffg\MTunsetmathskips{f}ff\mathbf{ff}$|}
- % gives: \begingroup\MTversion{upright}%
- % \MTsetmathskips{f}{8mu}{0mu}$gffg\MTunsetmathskips{f}ff\mathbf{ff}$\endgroup.
- % The ligature was correctly formed.
-
The argument may be a macro (or any expandable code) expanding to a letter.
+\item \RightNote{\mstrelease{1.3j}}\mstcmd{MTnormalexists}, \mstcmd{MTexistsdoesskip}: the
+ latter (done by default if not |subdued|, and also on each use of
+ |\MTversion| in the body of the document) makes it so that $\oldexists$
+ takes into account the math glue as specified by §\MTexistsskip§. The
+ former is its opposite.
+
\item \mstcmd{MTexistsskip}\marg{math glue}: specifies the amount of skip or more
generally glue to put after each $\oldexists$ math symbol. Indeed, upright
letters (or digits for that matter) often appear to be positioned a bit too
@@ -4991,17 +4733,13 @@ for all. The command \csb{MTeverymathoff} cancels all actions done by
version (and subsequent ones). One may also use the command at any time in
the document. In the case of the option |subdued|, the skip is canceled in
the \emph{normal} and \emph{bold} math versions.
-%
-% \footnote{\RightNote{1.3j}%
-% Formerly, it was set to |0mu|.}
-%
In the case of the option |italic|, the
default skip is set to zero.
-\item \RightNote{1.3j}\mstcmd{MTnormalexists}, \mstcmd{MTexistsdoesskip}: the
+\item \RightNote{\mstrelease{1.3j}}\mstcmd{MTnormalforall}, \mstcmd{MTforalldoesskip}: the
latter (done by default if not |subdued|, and also on each use of
- |\MTversion| in the body of the document) makes it so that $\oldexists$
- takes into account the math glue as specified by \csb{MTexistsskip}. The
+ |\MTversion| in the body of the document) makes it so that $\oldforall$
+ takes into account the math glue as specified by §\MTforallskip§. The
former is its opposite.
\item \mstcmd{MTforallskip}\marg{math glue}: the default is to add a |.6667mu| math
@@ -5012,138 +4750,191 @@ for all. The command \csb{MTeverymathoff} cancels all actions done by
be declared} math versions. In the case of the option |subdued|, the skip
is canceled in the \emph{normal} and \emph{bold} math
versions.
-%
-%\footnote{\RightNote{1.3j}Formerly, it was set to |0mu|.}
In the
case of the option |italic|, the default skip is zero for all math versions.
One may use the command at any location in the document.
-\item \RightNote{1.3j}\mstcmd{MTnormalforall}, \mstcmd{MTforalldoesskip}: the
- latter (done by default if not |subdued|, and also on each use of
- |\MTversion| in the body of the document) makes it so that $\oldforall$
- takes into account the math glue as specified by \csb{MTforallskip}. The
- former is its opposite.
+\item \RightNote{\mstrelease{1.3j}}\mstcmd{MTnormalprime},
+ \mstcmd{MTprimedoesskip}: the latter (done by default if not |subdued|,
+ and also on each use of \csb{MTversion} in the body of the document except
+ for the §subdued§ \emph{normal} and \emph{bold} math version) makes it so
+ that $'$ takes into account the math glue as specified by
+ §\MTprimeskip§. The former is its opposite. In all cases the right quote
+ |'| is a mathematically active character throughout the document producing
+ ${}'$ as is the default in \TeX, it is only its meaning which changes to
+ include or not an extra skip.
+
+ \begin{footnotesize}
+ Even though §\MTprimedoesskip§ is not done in the §subdued§ case, it is
+ \emph{not} a no-op even then in the preamble or in the \emph{normal} and
+ \emph{bold} math versions.\par
+ \end{footnotesize}
-\item \mstcmd{MTprimeskip}\marg{math glue}: the default is to add a |0.5mu| skip
- before the derivative glyph, except for the |italic| option. In the case of
- the option |subdued|, the skip is canceled in the \emph{normal} and
+\item \mstcmd{MTprimeskip}\marg{math glue}: specifies the amount of math
+ skip to add before the derivative glyph. The default iniitial value is
+ |0.5mu|, except with the |italic| option where it is |0mu|. In the case
+ of the option |subdued|, the skip is canceled in the \emph{normal} and
\emph{bold} math versions.
-%
-%\footnote{\RightNote{1.3j}Formerly, it was set to
-% |0mu|.}
-% obsolete et même faux avec 1.3j
-% \footnote{if \cs{begin\{document\}} is not followed
-% with \cs{MTversion\{normal\}}, the latest values set in the preamble by
-% these commands are used at the beginning of the document,
-% even under option \texttt{subdued}.}
+\item \mstcmd{MTnormalasterisk}, \mstcmd{MTactiveasterisk}: the latter will
+ use for |*| and |\ast| the text font asterisk, suitably lowered; the former
+ if used in the preamble tells \mst to not modify the non-\mst situation, or
+ if used in the body to revert to it. Both are no-op's in absence of option
+ §asterisk§.
+
+\begin{footnotesize}
+ A legacy feature is that §\MTactiveasterisk§ is \emph{not} a no-op in
+ §subdued§ \emph{normal} or \emph{bold} math versions, and does let the
+ asterisk obey the §\MTlowerast§ configuration, if used explicitly by user
+ (even in the preamble).
+
+ At \mstrelease{1.4}\RLNote{changed:}{\mstrelease{1.4}} \mst checks at
+ |\begin{document}| (or each time §\MTaciveasterisk§ is made use of) if
+ * is a Babel shorthand (which I far as I know is the case of no
+ language) or is already mathematically active. In the latter case the
+ * is not modified in math mode; and it is not modified either if
+ found to be catcode active but not a \ctanpkg{babel} shorthand. In
+ contrast, the \cs{ast} will always be set to obey §\MTlowerast§
+ configuration after §\MTactiveasterisk§.
+
+\end{footnotesize}
-\item \mstcmd{MTlowerast}\marg{dimen}: a \cs{raisebox} command is
+\item \mstcmd{MTlowerast}\marg{dimen}: under option §asterisk§
+ a \cs{raisebox} command is
used to lower the text asterisk to produce a reasonable math
asterisk. The package uses this command initially with
argument |0.3\height|, this will have to be fine-tuned for
each given text font but worked out ok with the fonts we
- tried. Note that the dimension argument will be used also in
+ tried. The dimension argument will be used also in
sub-scripts and sub-sub-scripts, so it is best not to use an
- absolute dimension.
+ absolute dimension. The dimension specification is for text
+ it can not be with |mu| unit.
\item \mstcmd{MTmathoperatorsobeymathxx}, \mstcmd{MTmathoperatorsdonotobeymathxx}: the
former is done by default, it makes operator names obey math alphabets. See
- also section \ref{sec:mathxx}. This functionality \emph{does
+ also \autoref{sec:mathxx}. This functionality \emph{does
{\normalfont\bfseries not} rely}
on ``math active characters''. Automatically issued by each \cs{MTversion},
except under option |subdued| when switching to \emph{normal} or \emph{bold}.
- \item \mstcmd{MTcustomgreek}:\RightNote{1.3d} in case \mst has been loaded with one of its
- Greek related options, this activates the corresponding
- customization of Greek letters in math mode. It is issued
- automatically by the package in the preamble (except if loaded with
- |subdued| option) and at each switch of math version via
- |\MTversion| or |\MTversion*| (except for the normal and bold math
- versions in subdued mode). Also available as
- |\Mathastextcustomgreek|. May be used even inside of math mode.
+\item \mstcmd{MTmathactiveletters}:\RightNote{\mstrelease{1.3}}
+ `math activation' of all ascii Latin
+ letters. This is done by the package automatically except under the
+ §subdued§ option.
- \item \mstcmd{MTstandardgreek}:\RightNote{1.3d} in case \mst was loaded with one of the Greek
- related options this command reverts the customization, it resets the Greek
- letters to their definitions in force at package loading time. Can be used
- in the preamble, but is mainly for the document body (may even be used
- inside math mode ...). Done automatically
- under the |subdued| option when switching to the normal or bold math
- version. Also available as |\Mathastextstandardgreek|.
-\end{enumerate}
-
-\subsubsection{Expert commands which are preamble-only}
-
-\begin{enumerate}[label=$\bullet$, leftmargin=1em]
-\item \mstcmd{MTgreekupdefault}:\RightNote{1.3x} a command with
- no argument whose expansion specifies, under §LGRgreek§ regime, the
- shape for the `|up|' Greek control sequences (and for the no-postfix
- Greek control sequences under §upgreek§ option) in all \mst math
- versions declared \emph{afterwards} via \cs{Mathastext} or
- \cs{MTDeclareVersion}. The a priori default for this shape is `|n|'
- (without the quotes). See
- \autoref{sec:newgreek}.
-
- This command can also be defined \emph{prior} to loading the package,
- as the package itself only does:
- \centeredline{|\providecommand*\MTgreekupdefault{n}|}
-
-\item \mstcmd{MTgreekitdefault}:\RightNote{1.3x} a command with
- no argument whose expansion specifies, under §LGRgreek§ regime, the
- shape for the `|it|' Greek control sequences (and for the no-postfix
- Greek control sequences under §itgreek§ option) in all \mst math
- versions declared \emph{afterwards} via \cs{Mathastext} or
- \cs{MTDeclareVersion}. The a priori default for this shape is `|it|'
- (without the quotes).
- See \autoref{sec:newgreek}.
-
- This command can also be defined \emph{prior} to loading the package,
- as the package itself only does:
- \centeredline{|\providecommand*\MTgreekitdefault{it}|}
-\end{enumerate}
-
-\subsubsection{Expert commands usable only outside of math mode}\label{sec:cmdsoutmath}
+ At \mstrelease{1.4}\RLNote{changed:}{\mstrelease{1.4}} its behavior was
+ modified significantly: instead of setting some toggle obeyed only at
+ entrance of math mode, it acts on the spot immediately.
+\begin{snugshade}
+ Formerly, this command was only a configuration toggle with no immediate
+ impact (and was not usable from inside math mode). Indeed, the \mst work of
+ mathematical activation was done (or not done) \emph{each time} math mode
+ was entered (if not in §subdued§), and the ascii letters kept standard
+ mathcodes outside of math mode.
+
+ The command now does the mathematical activation on the spot and the meaning
+ of the active shape of the ascii letters --- a priori undefined because
+ typesetting a document with an active ascii letter is near impossible, as no
+ \LaTeX{} command name used in the document can contain it --- is modified
+ here and then; but of course the catcodes are not modified only the
+ mathcodes are. Except if \mst is loaded with the §subdued§ option, this
+ mathematical activation is executed already at package loading time.
+
+ If with the §subdued§ option, the command is inactive in the preamble, as
+ well as in the \emph{normal} and \emph{bold} math versions. In all cases it
+ gets (re-)executed automatically when §\MTversion§ is used for activating a
+ non-subdued math version.
-They are usable only from outside math mode because they act via turning on
-or off the execution, each time math mode is entered, of certain macros added
-by \mst to the \cs{everymath} and \cs{everydisplay} token list variables.
+ \begin{footnotesize}
+ The new situation may be dangerous if the document author makes a letter,
+ say |A|, catcode active at some point, with a definition of the active
+ state using |\string A|. As \mst has (earlier, in the preamble) set |A|
+ to be mathematically active as well, and as the \cs{string} changes
+ nothing to that, an infinite loop will be triggered by such an |A| in math
+ mode.
+
+ But, having an active ascii letter can only be in very localized portions
+ of a document, and only be authored by experts. The experts should
+ carefully make sure the mathcode of the letter is not active if they set
+ the catcode to active and let the active meaning use \cs{string} on the
+ letter itself, thus we can trust that the mathematical activation done
+ earlier by \mst is undone and there will be no problems.\par
+ \end{footnotesize}
-\begin{enumerate}[label=$\bullet$, leftmargin=1em]
+ This \mstrelease{1.4} change may thus need to be followed by some
+ adjustments in some quite special circumstances caused by some expert
+ interventions.
-\item \mstcmd{MTmathactiveletters}: activates the `math activation' of Latin
- letters. This is done by the package during loading, except under the
- |subdued| option.
-%
-% \footnote{\RightNote{1.3j}Formerly, it was also executed
-% from each \cs{Mathastext} in the preamble.}
- It is again executed in the
- body at each \cs{MTversion}, except under the |subdued| option when
- switching to the \emph{normal} or \emph{bold} math versions.
+ See \autoref{sec:mathskips} and \autoref{sec:ic} for the rationale of this
+ mathematical activation, and \autoref{ssec:hackingletters} for ways to
+ use it for other goals.
+\end{snugshade}
+ \begin{footnotesize}
+ If you do want mathematically active letters also in subdued \emph{normal}
+ or \emph{bold} math versions (to apply tricks such as those of
+ \autoref{ssec:hackingletters}) there is \cs{mst@mathactivateletters} which
+ does not check the §subdued§ status.\par
+ \end{footnotesize}
+
+\item \mstcmd{MTmathstandardletters}:\RightNote{\mstrelease{1.3}}
+ turns off the mathematical active
+ ascii letters, i.e.\@ reverts their mathcodes to package font configuration.
+ Here ``standard'' only means
+ that the letters will not be mathematically active, but they are still under the
+ influence of \mst regarding the typeface they use, so they are only
+ ``standard'' from \mst point of view.
+
+ At \mstrelease{1.4}\RLNote{changed:}{\mstrelease{1.4}} its behavior was
+ modified: instead of setting some toggle obeyed only at entrance of math
+ mode, it acts on the spot immediately.
+ \begin{snugshade}
+ §\MTmathstandardletters§ will not try to restore the meaning associated to
+ the catcode active variant of the letter token which may have been in place
+ at the time of §\MTmathactiveletters§. This meaning is not saved for
+ later reset.
+
+ \emph{Except} if the \emph{letter} was an active Babel-shorthand at the time
+ of §\MTmathactiveletters§, which is in fact almost impossible to achieve
+ via the \ctanpkg{babel} interface.
+
+ And if the letter was catcode-active due to user action,
+ §\MTmathactiveletters§ will not have made it mathematically active, nor
+ will it have modified its active meaning. So the active meaning may get
+ overwritten only for a letter having a normal catcode at time of
+ §\MTmathactiveletters§ but which for some reason has some meaning
+ associated to its catcode active variant.
+ \end{snugshade}
+
+\item \mstcmd{MTmathactivedigits}:\RLNote{new:}{\mstrelease{1.4}}
+ is a no-op except under option
+ §activedigits§. It then makes all digits mathematically active and is
+ executed during package loading, except if §subdued§. It is again executed
+ when entering any non-§subdued§ math version in the document body. See
+ \autoref{ssec:hackingletters} for an example of use.
- The letters are made mathematically active\footnote{the |mathcode|'s are
- only modified at the time of execution of \cs{everymath},
- \cs{everydisplay}.} to insert the extra skips as specified by
- \csb{MTsetmathskips} (see section \ref{sec:mathskips}), and also possibly
- the italic corrections when using upright fonts (see section \ref{sec:ic}).
+ \begin{footnotesize}
+ If you do want mathematically active digits also in subdued \emph{normal}
+ or \emph{bold} math versions (to apply tricks such as those of
+ \autoref{ssec:hackingletters}) there is \cs{mst@mathactivatedigits} which
+ does not check the §subdued§ status.\par
+ \end{footnotesize}
-\item \mstcmd{MTmathstandardletters}: cancels the `math activation' of the letters.
- Must be re-issued after each \csb{MTversion}, but see
- \csb{MTeverymathdefault}.
+\item \mstcmd{MTmathstandarddigits}:\RLNote{new:}{\mstrelease{1.4}}
+ a no-op except under option
+ §activedigits§. Under this option it resets the digits to their normal
+ mathcodes as configured by the package.
\item \mstcmd{MTicinmath}: this command is executed by default by \mst except in
case of option |subdued| or if the user chosen letter shape is oblique (|it|
or |sl|). It tells \mst to add italic corrections after all letters in math
mode, except within the scope of math alphabets.
-%
-% \footnote{\RightNote{1.3i}%
-% Formerly, italic corrections were added to the (non-oblique) letters of
-% \cs{mathnormal} arguments.}
- This command and the next ones in this item can be used in the preamble as
- well as in the body of the document (in case of |subdued| option, using the
- commands from within the preamble will remain without effect, as the
- document body will start in the subdued normal math version anyhow.) But
- each \cs{MTversion} in the body will re-emit \cs{MTicinmath} (in case of
+ This\RLNote{changed:}{\mstrelease{1.4}}
+ command and the next ones in this item can be used anywhere in the
+ document and even from inside math mode. In case of §subdued§ option, using the
+ command from within the preamble remains without effect, as the
+ document body will start in the subdued normal math version anyhow.
+ Each \cs{MTversion} in the body reemits \cs{MTicinmath} (in case of
non-oblique letter shape), except if the
|subdued| option was used and the chosen math version is \emph{normal} or
\emph{bold}.
@@ -5153,54 +4944,38 @@ by \mst to the \cs{everymath} and \cs{everydisplay} token list variables.
{\footnotesize
- It may theoretically be used from inside math mode, but the included
- §\MTmathactiveletters§ will have an effect only if issued prior to
- entering math mode.
+ The description above about the command not being executed if the letter
+ shape is italic or slanted is not quite right, as it refers only to the
+ act of inserting or not italic correction. The
+ §\MTmathactiveletters§ component is always executed, however it will be a
+ no-op in |subdued| \emph{normal} and \emph{bold}.
\mstcmd{MTnoicinmath}: this command deactivates the package added
italic corrections. It can be used inside as well as outside
- of math mode (or in the preamble of the document).
-
- \mstcmd{MTICinmath}, \mstcmd{MTnoICinmath}: these commands activate the italic
- corrections only for the uppercase letters (but recall that \cs{MTicinmath}
- is done by default, thus this will typically have to follow
- \cs{MTnoicinmath}.)
-
-% obsolète 1.3i
- % Following some decision of the package author whose rationale has been
- % forgotten, afer \cs{MTICinmath} italic corrections for uppercase letters in
- % arguments to all math alphabets (\emph{i.e.} also \cs{mathnormal}) are
- % suppressed (with \cs{MTicinmath} the italic corrections are suppressed
- % inside the scope of math alphabets \emph{except} \cs{mathnormal}.)
- % No italic corrections are explicitly added inside arguments of math
- % alphabets.
+ of math mode (or in the preamble of the document). Note that it does not
+ deactivate the mathematical activation of the ascii letters. Use
+ §\MTmathstandardletters§ for that.
+
+ \mstcmd{MTICinmath}, \mstcmd{MTnoICinmath}: only acts on the uppercase
+ letters. But recall that \cs{MTicinmath} is done by default, thus
+ using italic corrections only for uppercase needs to go via
+ \cs{MTnoicinmath} then \cs{MTICinmath}.
\mstcmd{MTicalsoinmathxx}: this command de-activates the de-activation of
the italic corrections inside the arguments to the math alphabet
- commands.
-% apart from \cs{mathnormal}.
+ commands.
It can be issued inside as well as outside of math mode. Will be effective
only if §\MTicinmath§ or §\MTICinmath§ is in force.
-% obsolète 1.3i
- % \footnote{it is provided
- % for the \mst defined math alphabet \cs{mathnormalbold} which
- % contrarily to \cs{mathnormal} is not treated apart from the other
- % math alphabets.}
To cancel its effect either enclose it in a group or
environment or re-issue §\MTicinmath§ after it.
}
-\item \mstcmd{MTnormalasterisk}, \mstcmd{MTactiveasterisk}: the latter will use for |*|
- and |\ast| the text font asterisk, suitably lowered; the former tells \mst
- to not modify the \LaTeX\ default. Both are no-op without option
- §asterisk§.
-
\item \mstcmd{MTeasynonlettersobeymathxx}, \mstcmd{MTeasynonlettersdonotobeymathxx}: the
former is done by default, it makes characters \verb+.+, \verb+/+, \verb+|+,
\verb+\+, \verb+#+, \verb+$+, \verb+%+, and \verb+&+
(if not excluded by package options) obey math alphabet commands. See also
- section \ref{sec:mathxx}. This functionality does \emph{not} make the
+ \autoref{sec:mathxx}. This functionality does \emph{not} make the
characters ``math active'' (but it does modify |\mathcode|'s, naturally).
\item \mstcmd{MTnonlettersobeymathxx}, \mstcmd{MTnonlettersdonotobeymathxx}: the former
@@ -5213,105 +4988,110 @@ by \mst to the \cs{everymath} and \cs{everydisplay} token list variables.
it will have to be coded |$a^{!}$|. Hence, by default, the package does
§\MTnonlettersdonotobeymathxx§.
- \begin{framed}
- Under |subdued| option, \cs{MTnonlettersobeymathxx} effect is of course
- canceled in the \emph{normal} and \emph{bold} math versions; but please
- note that when switching back to a non-subdued math version it will be
- mandatory to issue again \cs{MTnonlettersobeymathxx} explicitly if its
- effect is to be re-activated.
-
- In particular, executing \cs{MTnonlettersobeymathxx} in the preamble or at
- the start of the document body serves nothing, because the document is in
- the subdued \emph{normal} math version regime then. It must thus be
- executed after the first usage of \cs{MTversion} switching to a
- non-subdued math version, and again on each successive exit from the
- \emph{normal} or \emph{bold} math versions.
- \end{framed}
-
\item \mstcmd{MTexplicitbracesobeymathxx}: extends an earlier §\MTnonlettersobeymathxx§
to also treat \verb|\{| and \verb|\}|. But then |\left\{|, |\right\}| must
be coded |\left\lbrace|, |\right\rbrace| rather. There is also
\mstcmd{MTexplicitbracesdonotobeymathxx}.
-\item \RightNote{1.3j}\mstcmd{MTnormalprime}, \mstcmd{MTprimedoesskip}: the latter (done by default if not
- |subdued|, and also on each use of \csb{MTversion} in the body of the document
- except for the |subdued| \emph{normal} and \emph{bold} math version)
- makes it so that $'$ takes into account the math glue as specified by
- \csb{MTprimeskip}. The former is its opposite. In all cases the right quote
- |'| is a mathematically active character producing ${}'$ as is the default
- in \TeX, it is only its meaning which changes to include or not an extra
- skip. For some (legacy) reason, this change of meaning is done anew
- by \mst each time math mode is entered. The commands of this item are thus
- no-op from inside math mode.
-
-
-\item \RightNote{1.3j}\mstcmd{MTeverymathdefault}: this hook is executed by
- \csb{MTversion}\marg{version\_name}, except under option |subdued|
- when switching to the \emph{normal} or \emph{bold} math versions. Its
+\item \RightNote{\mstrelease{1.3j}}\mstcmd{MTeverymathdefault}: this hook is executed by
+ \csb{MTversion}\marg{version\_name} (but if under option |subdued|
+ and switching to the \emph{normal} or \emph{bold} math version its default
+ effect is overruled by an §\MTeverymathoff§ executed after it). Its
default meaning is:
\begin{verbatim}
\MTactiveasterisk % this has no effect without option asterisk
\MTprimedoesskip % this makes prime glyph obey extra space
\MTeasynonlettersobeymathxx
- \MTicinmath % this does \MTmathactiveletters, hence also skips from
- % \MTsetmathskips are obeyed.
+ \MTicinmath % this does \MTmathactiveletters, hence the extra
+ % skips from \MTsetmathskips are obeyed.
+ \MTmathactivedigits % this is a no-op in absence of option activedigits
\MTfixfonts % only operant under LuaLaTeX.
\end{verbatim}
- {\footnotesize Notice that under |subdued| option, switching to the
+ {\footnotesize Under |subdued| option, switching to the
\emph{normal} or \emph{bold} version does \csb{MTeverymathoff} which
- includes \cs{MTnonlettersdonotobeymathxx}.
+ includes §\MTnonlettersdonotobeymathxx§.
The default
§\MTeverymathdefault§ which is issued when going back to a
non-\emph{normal} or \emph{bold} math version doesn't do
- \cs{MTnonlettersobeymathxx}: thus it is up to the user to correct this if
- needed (no issue without |subdued| option).
+ §\MTnonlettersobeymathxx§: thus it is up to the user to correct this if
+ desired.
Notice also that \csb{MTversion}\marg{version\_name}, except for \emph{normal}
or \emph{bold} if |subdued| does \csb{MTforalldoesskip} and
\csb{MTexistsdoesskip}, which are not included in \cs{MTeverymathdefault}
-actions as they are not related to \cs{everymath} and \cs{everydisplay}.\par}
+actions as they are not related to \cs{everymath} and \cs{everydisplay}.\par
-\item \RightNote{1.3j}\mstcmd{MTeverymathoff}: does §\MTnormalasterisk§,
+At \mstrelease{1.4}, the name of this command diverges somewhat from its
+action as mathematical activation of ascii letters (or, optionally, of digits)
+will happen on the spot and not during \cs{everymath} or \cs{everydisplay}
+execution.\par
+}
+
+\item \RightNote{\mstrelease{1.3j}}\mstcmd{MTeverymathoff}: does §\MTnormalasterisk§,
§\MTnormalprime§, §\MTnonlettersdonotobeymathxx§,
- §\MTeasynonlettersdonotobeymathxx§, §\MTmathstandardletters§ and
+ §\MTeasynonlettersdonotobeymathxx§, §\MTmathstandardletters§,
+ §\MTmathstandarddigits§\RightNote{\mstrelease{1.4}} and
§\MTdonotfixfonts§.
- {\footnotesize \RightNote{1.3i}The commands
- |\url/\nolinkurl| of package |hyperref| and |url| from |url.sty| (which
+ Automatically done by \csb{MTversion}|{normal}| (or |{bold}|) under option |subdued|
+ (and
+ also \csb{MTnormalexists} and
+ \csb{MTnormalforall} are executed then).
+
+
+ {\footnotesize \RightNote{\mstrelease{1.3i}}The commands
+ |\url/\nolinkurl| of package |hyperref| and |\url| from |url.sty| (which
use math mode under the hood) are patched by \mst to do §\MTeverymathoff§
automatically: this is needed because \mst modifies anew some mathcodes
\emph{each time math mode is entered,} hence may overwrite to some extent
- the specific preparation done by |{url,hyperref}.sty|.
- % {\parfillskip0pt\hfill
- % \rlap{\kern10pt\textcolor{magenta}{\bfseries New! (1.3i)}}\par}
+ the specific preparations done by |{url,hyperref}.sty|.
+
+ \RightNote{\mstrelease{1.4}}However, in some cases it may be interesting to
+ be able to apply hacks as described in \autoref{ssec:hackingletters}.
+ You can use now §\MTeverymathoff§ as a hook inside
+ |\url| and |\nolinkurl| commands. Perhaps redefine it (locally) to do
+ all of the above except §\MTmathstandardletters§ and/or
+ §\MTmathstandarddigits§, and use the \autoref{ssec:hackingletters}
+ instructions to achieve special effects for some letters or digits in
+ the URLs rendered via |\url| and |\nolinkurl|.
+ \par
+ }
+
+\end{enumerate}
- Automatically done by \csb{MTversion} under option |subdued|
- if switching to the \emph{normal} or \emph{bold} math versions; and
- \csb{MTversion} then does also \csb{MTnormalexists} and
- \csb{MTnormalforall}.
-\par}
+\subsubsection{Expert commands usable only outside of math mode}\label{sec:cmdsoutmath}
+
+There is only one pair of commands here: §\MTfixfonts§ and §\MTdonotfixfonts§.
+They are operant only under \LuaLaTeX{}. As §\MTeverymathdefault§ and
+§\MTeverymathoff§ use them, they arguably could have been listed here, but
+only for engine \LuaLaTeX{}.
\small
-\item \RightNote{1.3o}\mstcmd{MTfixfonts}: this is operant only under
+\begin{enumerate}[label=$\bullet$, leftmargin=1em]
+
+\item \RightNote{\mstrelease{1.3o}}\mstcmd{MTfixfonts}: this is operant only under
\LuaLaTeX{}. It has the effect that each time math mode is entered macro
\csb{MTfixmathfonts} will be executed. The latter forces so-called |base|
mode for the used text font in math mode, in an effort to (only partially,
see code comments) fix the fact that OpenType features such as Lining
Figures were in some cases not being applied in math mode when one uses text
fonts there (text fonts are declared by \LuaTeX+|luaotfload| to use |node|
- mode, which is non-functional in math.) It is invoked automatically by the
+ or |harf| mode, which are non-functional in math.) It is invoked automatically by the
package (except for |normal| and |bold| math versions under |subdued|
option), and in normal situations, there is no reason to use it directly.
+ \RLNote{changed:}{\mstrelease{1.4}}The hack was updated at \mstrelease{1.4}
+ in order to also handle fonts using |Renderer=HarfBuzz|.
+
% pas envie de perdre mon temps là-dessus. D'ailleurs peut-être déjà pour
% commencer bm ne fonctionne pas avec fontes OpenType.
% Notice (not tested) that package |bm| is presumably not compatible.
-\item \RightNote{1.3o}\mstcmd{MTdonotfixfonts}: cancels the job of
+\item \RightNote{\mstrelease{1.3o}}\mstcmd{MTdonotfixfonts}: cancels the job of
|\MTfixfonts|. Done automatically in §subdued§ mode when in the |normal| or
|bold| math version; in normal contexts, there is no reason to use this
command. Only operant under \LuaLaTeX.
@@ -5321,17 +5101,19 @@ actions as they are not related to \cs{everymath} and \cs{everydisplay}.\par}
\subsubsection{Expert commands usable only in math mode}
\begin{enumerate}[label=$\bullet$, leftmargin=1em]
-{\small
-\item\RightNote{1.3p}%
+
+\item\RightNote{\mstrelease{1.3p}}%
\mstcmd{MTfixmathfonts}: this used to be an internal package macro
- but it is given a public name at |1.3p| because I discovered that
+ but it is given a public name at \mstrelease{1.3p} because I discovered that
|$..\hbox{\mathversion{foo}$..$}..$| causes an
issue and one needs to invoke again \cs{MTfixmathfonts} \emph{after} the
\verb|\hbox|, for some reason. To be used \emph{only} under \LuaLaTeX{} and only for
such rare cases where it may be needed.\par
-}
+
\end{enumerate}
+\normalsize
+
\section{Package options}
\subsection{Summary of main options}
@@ -5388,7 +5170,8 @@ actions as they are not related to \cs{everymath} and \cs{everydisplay}.\par}
roughly by themes. So, objectively, the best for the diligent reader is to
read thoroughly all descriptions.
\begin{enumerate}[label=$\bullet$, leftmargin=1em]
- \item \mstopt{basic}: only mathastextify letters and digits.
+ \item \mstopt{basic}: only mathastextify (ascii) letters and digits. Can
+ be combined with either §nodigits§ or §noletters§.
\item \mstopt{subdued}: acts in a subdued way, which means that the \LaTeX\
``normal'' (default) and ``bold'' (triggered by \cs{boldmath} or
\cs{mathversion}|{bold}|, undone by \cs{unboldmath} or on exit from a
@@ -5410,10 +5193,10 @@ actions as they are not related to \cs{everymath} and \cs{everydisplay}.\par}
handles Greek letters, also lowercase (but not uppercase) Greek
letters will use this a priori italic shape except if some other
option such as \blueit{upgreek} was used.%
- \footnote{Since \texttt{1.3x}, in presence of the \blueit{LGRgreek}
- option in addition to \blueit{italic}, the \cs{MTgreekitdefault}
+ \footnote{Since \texttt{1.3y}, in presence of the \blueit{LGRgreek}
+ option in addition to \blueit{italic}, the \csb{MTgreekitdefault}
shape is then used for lowercase Greek letters and
- \cs{MTgreekupdefault} for uppercase.}
+ \csb{MTgreekupdefault} for uppercase.}
\item \mstopt{frenchmath}: configures the lowercase Latin letters to use
italic shape (\cs{itdefault}), and uppercase Latin letters to be in
same shape as for digits and operator names (i.e.\@ a priori
@@ -5424,8 +5207,8 @@ actions as they are not related to \cs{everymath} and \cs{everydisplay}.\par}
and uppercase Greek letters will use the same shape as
operator names, except if some other option such as \blueit{itgreek}
was used.%
- \footnote{Under \blueit{LGRgreek} and since |1.3x|, the
- \cs{MTgreekupdefault} is used for Greek letters if no other option
+ \footnote{Under \blueit{LGRgreek} and since \mstrelease{1.3y}, the
+ \csb{MTgreekupdefault} is used for Greek letters if no other option
such as \blueit{itgreek} was employed.}
\begin{snugshade}
@@ -5434,9 +5217,7 @@ actions as they are not related to \cs{everymath} and \cs{everydisplay}.\par}
be in the same shape as the one for digits and operator
names) is \textbf{not} undone in the §subdued§ ``normal''
and ``bold'' math versions. It holds throughout the
- document, but math versions declared by \mst may use
- §\MTshape§ and §\MTlettershape§ to, in effect, obtain
- whatever configuration is desired.
+ document.
As a bonus, note that doing
\centeredline{|\usepackage[basic,subdued,frenchmath]{mathastext}|}
@@ -5490,7 +5271,7 @@ actions as they are not related to \cs{everymath} and \cs{everydisplay}.\par}
%\end{footnotesize}
-\item \mstopt{defaultalphabets}: \RLNote{new behavior}{1.3za}\mst
+\item \mstopt{defaultalphabets}: \RLNote{new behavior}{\mstrelease{1.3za}}\mst
always defines \cs{Mathnormal}, \cs{Mathrm}, \cs{Mathbf} etc... to
refer to the \mst-ified text fonts, and redefines the math
alphabets \cs{mathrm}, \cs{mathit}, \cs{mathtt} etc\dots{} (but
@@ -5501,22 +5282,22 @@ actions as they are not related to \cs{everymath} and \cs{everydisplay}.\par}
be available whether or not this option is made use of.
\begin{footnotesize}
- Prior to |1.3za| (and since |1.15f|), this option also prevented the
+ Prior to \mstrelease{1.3za} (and since \mstrelease{1.15f}), this option also prevented the
package to declare the \cs{Mathnormal} et al.\@ and \cs{mathnormalbold}
commands. In this context, recall that the dreaded ``too many math
alphabets'' error can only occur on \emph{use} in the document of too many
of such commands, and not at the time of their declarations. The author's
- notes from time of |1.15f| release (|2012/10/25|) only say that it may not
+ notes from time of \mstrelease{1.15f} release (|2012/10/25|) only say that it may not
be ``useful'' to package user to have both (for example) |\mathrm| and
|\Mathrm|, which sounds weird if they are to acquire distinct meanings.
- So since |1.3za| both will exist. In the default package configuration
+ So since \mstrelease{1.3za} both will exist. In the default package configuration
|\mathrm| is configured to expand to |\Mathrm| (with some extra behavior
under §LGRgreek+§), and with this option or the §defaultrm§ option
|\mathrm| is kept with its original meaning (and the §LGRgreek+§ extras do
not work).\par
\end{footnotesize}
-\item \RLNote{changed:}{1.3za}\mstopt{defaultnormal}, \mstopt{defaultrm},
+\item \RLNote{changed:}{\mstrelease{1.3za}}\mstopt{defaultnormal}, \mstopt{defaultrm},
\mstopt{defaultbf}, \mstopt{defaultit}, \mstopt{defaultsf},
\mstopt{defaulttt}: tell \mst to not set up, respectively, the
\cs{mathnormal}, \cs{mathrm}, \cs{mathbf}, \cs{mathit}, \cs{mathsf}, and
@@ -5524,11 +5305,11 @@ actions as they are not related to \cs{everymath} and \cs{everydisplay}.\par}
always via \cs{Mathnormal}, \cs{Mathrm}, \cs{Mathbf}, \cs{Mathit}, etc...
\begin{footnotesize}
- Prior to |1.3za| these options also prevented the creation of the
+ Prior to \mstrelease{1.3za} these options also prevented the creation of the
corresponding \mst command with an uppercased initial.\par
\end{footnotesize}
-\item \mstopt{ncccomma}:\RightNote{1.3x} it triggers the loading of the
+\item \mstopt{ncccomma}:\RightNote{\mstrelease{1.3y}} it triggers the loading of the
\ctanpkg{ncccomma} package%
%
\footnote{Alexander I. \textsc{Rozhenko}, \emph{Use comma as decimal
@@ -5553,8 +5334,8 @@ those parts of the document using another language than French.%
reenact it. For background on this issue see
\url{https://github.com/latex3/babel/issues/190}.
- This does not apply to \ctanpkg{decimalcomma} |1.3| or later.}
-\item \mstopt{decimalcomma}:\RightNote{1.3zb} it triggers the loading of the
+ This does not apply to \ctanpkg{decimalcomma} \mstrelease{1.3} or later.}
+\item \mstopt{decimalcomma}:\RightNote{\mstrelease{1.3zb}} it triggers the loading of the
\ctanpkg{decimalcomma} package%
%
\footnote{Antoine \textsc{Missier}, \emph{Comma for decimal numbers},
@@ -5565,7 +5346,7 @@ The same remarks apply as for the §ncccomma§ option. In particular \emph{note
\emph{\texttt{decimalcomma}}, the correct way is to use the eponymous
option.}
-\item \mstopt{binarysemicolon}:\RightNote{1.3x} sets (except if
+\item \mstopt{binarysemicolon}:\RightNote{\mstrelease{1.3y}} sets (except if
\blueit{nopunctuation} is used) the semi-colon to let \TeX\ use
spacing of binary type, not punctuation type, around the semi-colon
(it is often used in French mathematical typesetting as separator in
@@ -5575,12 +5356,12 @@ The same remarks apply as for the §ncccomma§ option. In particular \emph{note
The effect applies to all math versions, even the \emph{normal} and
\emph{bold} math versions with \mst having been loaded with the
\blueit{subdued} option.
-\item \mstopt{frenchmath*}:\RLNote{CHANGED!}{1.3zb} does all three of \blueit{frenchmath},
+\item \mstopt{frenchmath*}:\RLNote{CHANGED!}{\mstrelease{1.3zb}} does all three of \blueit{frenchmath},
\blueit{decimalcomma} and \blueit{binarysemicolon}.
\begin{footnotesize}
- Prior to |1.3zb|, this option did what is now available via §frenchmath+§.
- The |1.3zb|
+ Prior to \mstrelease{1.3zb}, this option did what is now available via §frenchmath+§.
+ The \mstrelease{1.3zb}
change was made as a follow-up consecutive to the |2.7| release \ctanpkg{frenchmath}.
Indeed this option as explained in \autoref{ssec:frenchmath} is provided as
a compatiblity layer with \ctanpkg{frenchmath}, and it was mandatory to
@@ -5588,20 +5369,75 @@ The same remarks apply as for the §ncccomma§ option. In particular \emph{note
consecutive to the internal change of \ctanpkg{frenchmath} at its |2.7|
release to use \ctanpkg{decimalcomma}.\par
\end{footnotesize}
-\item \mstopt{frenchmath+}:\RightNote{1.3zb} does all three of \blueit{frenchmath},
+\item \mstopt{frenchmath+}:\RightNote{\mstrelease{1.3zb}} does all three of \blueit{frenchmath},
\blueit{ncccomma} and \blueit{binarysemicolon}. This is what used to be
- called §frenchmath*§ prior to |1.3zb|.
+ called §frenchmath*§ prior to \mstrelease{1.3zb}.
\item \mstopt{endash}, \mstopt{emdash}: use the text font en-dash (\textendash) or even
the em-dash (\textemdash, but this seems crazy) for the minus sign
rather than {}-{}. §endash§ option is default for the package.
-\item \mstopt{unicodeminus}:\RightNote{1.3q} use the |MINUS SIGN U+2212| (requires
+\item \mstopt{unicodeminus}:\RightNote{\mstrelease{1.3q}} use the |MINUS SIGN U+2212| (requires
\ctanpkg{fontspec}.) Or, in the form |unicodeminus=HHHH| with four \emph{uppercased}
hexadecimal digits: use the |U+HHHH| code point. As §noendash§ really means
``use the hyphen from the text font'', §unicodeminus§ remains without effect
under it, or, naturally, under §nominus§. Without this option,
\mst uses the |EN DASH U+2013| by default for OpenType fonts.
-\item \mstopt{asterisk}: use the text font (or the Symbol font) asterisk in math mode.
-\item \mstopt{nohbar}: prevents \mst from defining its own
+\item \mstopt{asterisk}: this tells \mst to replace the binary math operator $*$
+ and the control sequence \cs{ast} with versions which uses the text asterisk
+ * suitably lowered, and with the correct spaces around it as binary
+ operator. The amount of lowering%
+%
+\footnote{With the option
+ \texttt{symbolmisc}, the asterisk is picked from the Symbol font, and the
+ amount of lowering is non-customizable; however if a math alphabet command
+ is used, the asterisk is then again from a text font and the lowering will
+ be as specified by \cs{MTlowerast}.}
+%
+ is decided by the mandatory argument to the command
+ \csb{MTlowerast}\marg{dimen}. The package does
+ \cs{MTlowerast}|{.3\height}|. Using the |ex| unit as in
+ \cs{MTlowerast}|{.5ex}| is not a good idea as it does not scale properly in
+ the script and scriptscript styles.
+
+ Attention that if using this option, inputs such as |$R^*$| or |$R^\ast$|
+ raise errors and \emph{must} be replaced by |$R^{*}$|, respectively
+ |$R^{\ast}$|. The $*$ is now `mathematically active'\thinspace%
+%
+\footnote{In
+ a hopefully safe way, for example {\ttfamily\$\string\label\{eq*1\}\$} is
+ ok.}
+%
+ and |*| and |\ast| will obey the math alphabet
+ commands (see \autoref{sec:mathxx}).
+
+\item \mstopt{activedigits}:\RLNote{new:}{\mstrelease{1.4}}
+ it makes all digits mathematically active! This is
+ reserved to expert \LaTeX{} users. See \autoref{ssec:hackingletters} for an
+ example. Do not use this option if you don't intend to make use of such
+ techniques to achieve special effects at some location of your document at
+ least. (I know this goes without saying, but passing this option and not
+ using it is only adding overhead to all your equations with digits).
+
+\item \mstopt{nodigits}: no \mst-ification of digits.
+\item \mstopt{noletters}:\RLNote{new:}{\mstrelease{1.4b}}
+ This is quite antithetical to the package core aim, but here you go.
+
+ \begin{footnotesize}
+ This option implies §nohbar§ and §defaultimath§.
+
+ Note though that \mst will still declare to \LaTeX{} two extra symbol
+ fonts and define alphabet commands such as §\Mathrm§, §\Mathnormal§ and
+ §\mathnormalbold§ which map to them. But ascii letters will if not in
+ arguments of these commands not use the \mst-font and all business of
+ active letters (see \autoref{ssec:hackingletters}) is now irrevocably
+ inaccessible.
+
+ If you simply want to avoid the overhead of math active
+ letters, use rather §\MTmathstandardletters§ in the preamble after having
+ loaded the package (although this does not undo the fact that \mst will
+ have redefined what a letter does if it is catcode active but that remark
+ should have been made in an even smaller typeface).\par
+ \end{footnotesize}
+ \item \mstopt{nohbar}: prevents \mst from defining its own
\cs{hbar}.
\item \mstopt{noendash}: the minus sign will be the - from the
text font, not the en-dash \textendash.
@@ -5616,7 +5452,7 @@ The same remarks apply as for the §ncccomma§ option. In particular \emph{note
\ \mstopt{nopunctuation} ,\,.\,:\,;\ \mstopt{noplus},
\mstopt{nominus}, \mstopt{noplusnominus}\ +\,\textendash{} \mstopt{noequal} =\
\mstopt{noparenthesis} (\,)\,[\,]\,/\ \mstopt{nospecials}
-\#\,\$\,\%\,\&\ and \mstopt{nodigits}.
+\#\,\$\,\%\,\&\ (and §nodigits§ and §noletters§ mentioned earlier).
\item \mstopt{alldelims}: true by default, means that the
characters excluded by §nolessnomore§ are
treated. Use this option in case of a mono-width
@@ -5690,7 +5526,7 @@ Euler font.
declared |\alphaup|, |\alphait|, ...., and the
associated §\mathgreekup§
and §\mathgreekit§ commands to access the underlying fonts, and also since
- |1.3za| §\mathgreekupbold§ and §\mathgreekitbold§.
+ \mstrelease{1.3za} §\mathgreekupbold§ and §\mathgreekitbold§.
The font used by these math
alphabet commands in the subdued ``normal'' and ``bold'' is either
@@ -5699,7 +5535,7 @@ Euler font.
§\MTgreekfont§ when the command §\Mathastext§ (without
optional argument) was used in the preamble.
- |1.3za| fixes here a bug which froze the target font to be
+ \mstrelease{1.3za} fixes here a bug which froze the target font to be
the one at time of loading the package: this bug applied
(only) to the subdued ``normal'' and ``bold'' math versions
and was not readily visible as there is a priori no reason to
@@ -5716,7 +5552,7 @@ Euler font.
§LGRgreek§ and then §\MTgreekfont§ manually appropriately.
\item \mstopt{LGRgreek+} and
- \mstopt{LGRgreeks+}:\RightNote{1.3za} they extend
+ \mstopt{LGRgreeks+}:\RightNote{\mstrelease{1.3za}} they extend
respectively §LGRgreek§ or §LGRgreeks§ to let Greek letters
control sequences when in the scope of §\mathrm§, §\mathit§,
and §\mathbf§ behave as would be expected by LaTeX users who
@@ -5747,7 +5583,7 @@ Euler font.
accents. As in vanilla \LaTeX{}, they are taken from the font
for the digits and \cs{log}-like names. Obey the alphabet
changing commands.
- \item \mstopt{unimathaccents}:\RightNote{1.3u} extends |mathaccents| to
+ \item \mstopt{unimathaccents}:\RightNote{\mstrelease{1.3u}} extends |mathaccents| to
OpenType fonts. Gave bad results in my brief testing.
\item \mstopt{defaultimath}: do not overwrite \cs{imath} and
\cs{jmath} to use \cs{inodot} and \cs{jnodot}.
@@ -5756,7 +5592,29 @@ OpenType fonts. Gave bad results in my brief testing.
\item \mstopt{fouriervec}: provides a \cs{fouriervec} command. The user can then
add in the preamble \cs{let}\cs{vec}$=$\cs{fouriervec}. There is also
always available a ``poor man'' vec accent \cs{pmvec} for upright letters.
- \end{enumerate}
+\item \mstopt{everymath}:\RLNote{new:}{\mstrelease{1.4}} this option tells
+ \mst to employ as in the \mstrelease{1.3} releases the
+ \cs{everymath}/\cs{everydisplay} registers to store certain actions to be
+ executed at each entrance into math mode. The main change with
+ \mstrelease{1.4} is that mathcode changes done by user (or possibly via
+ language changes in a multilingual \ctanpkg{babel} context) in the document
+ body, and which apply to those characters which \mst used to handle as part of
+ \cs{everymath}/\cs{everydisplay}, will now have an effect, whereas with
+ earlier releases or this one
+ with the §everymath§ option, they may get overruled by \mst. Use
+ §everymath§ for backward compatibility if needed (and \emph{only} if needed).
+ Notice though that regarding ascii letters, there is no return to the
+ pre-\mstrelease{1.4}: they will not acquire their mathcode active status only
+ at each entrance into math mode, even with this option,
+ but once and for all at package loading time, if not §subdued§, or when using
+ §\MTversion§ to enter a non-§subdued§ math version.
+
+ Please report breakages due to the \mstrelease{1.4} release, which made it
+ necessary for you to use this option §everymath§ as workaround.
+
+ The option is destined to be removed at next major release and it will warn
+ the user about this.
+\end{enumerate}
Thanks to Kevin~\textsc{Klement}, Tariq~\textsc{Perwez}
and Ricard~\textsc{Torres} for sending bug reports and feature requests when
@@ -5780,6 +5638,7 @@ Numerous examples will be found there:\\
\label{sec:changelog}
\begingroup
+\hyphenation{Lua-La-TeX}
\def\MacroFont{\footnotesize\normalfont}
% utilisé par verbatim en classe scrdoc (ou plutôt shortvrb)
@@ -5817,16 +5676,27 @@ Numerous examples will be found there:\\
\lccode`\~`1
\lowercase{\endgroup\def~}{\ifvmode\medskip\expandafter\@DTXLOGhelper\fi 1}
+% 2024/07/10 hypertargets pour \mstrelease (importé de etoc, et j'ai déjà ici
+% toute une infrastructure rendant le truc trivial avec un fol 1 actif). Par
+% contre j'ai fait une modification s/#1\[/#1 \[/ car le #1 avant se terminait
+% par un espace.\]\]
+% Et attention au detokenize...
+% Il y a juste un problème avec le cas "1.15f and 1.15g".
\begingroup
\catcode`\| 0
\catcode`\\ 12
-|long|gdef|@DTXLOGhelper #1 ----#2|par{|@@DTXLOGhelper #1\[\]|par}
-|long|gdef|@@DTXLOGhelper #1\[#2\]#3|par%
- {|textbf{#1}% le #1 ici contient un espace
+% Je réduis à --- ici.
+|long|gdef|@DTXLOGhelper #1 ---#2|par{|@@DTXLOGhelper #1 \[\]|par}
+|long|gdef|@@DTXLOGhelper #1 \[#2\]#3|par%
+ {|hypertarget{|detokenize|expandafter{|fixonexv#1 and|relax}}{|textbf{#1}} %
|ifx|relax #2|relax|else [#2]|fi
|par|nopagebreak}
|endgroup
+% uniquement pour s'occuper de "1.15f and 1.15g" et en profitant du fait qu'il
+% n'y a de référence à 1.15g nulle part.
+\def\fixonexv#1 and#2\relax{#1}
+
\catcode`-=\active
\def-{%
\catcode`M\active
@@ -5869,7 +5739,7 @@ Numerous examples will be found there:\\
\StopEventually{\end{document}\endinput}
\cleardoublepage
-\newgeometry{hmarginratio=3:2}
+\newgeometry{hmarginratio=2:1}
\small
\section{Implementation}
@@ -5884,27 +5754,44 @@ Numerous examples will be found there:\\
%
%</dtx>
%<*package>
-% The usual catcode regime for letters and digits is assumed and some characters
-% such as |*|, |`|, |"|, |=| are supposed to be of catcode other at the time of loading
-% of \mst. The source of \mst takes precautions for some other characters such
-% as the right quote |'|, which may thus be active with no harm at the time of
-% loading. By the way, I think \LaTeX2e should have provided to authors a
+% The comments are a kind of palimpsest. Indeed they are not destined to the
+% reader but to the author: when coming back to the source code perhaps years
+% after having last looked at it, all bits of past information even if
+% obsolete are useful. Not only comments but perhaps also some ancient parts
+% of the code itself are a bit strange (the author hardly new any \LaTeX{} at
+% that time).
+%
+% For about the same reason, there may be some long macro names which do not
+% fit in the margins and that one sees only partially. The author sometimes
+% has used a workaround to hyphenate, but not systematically. Life is
+% time-limited. At \mstrelease{1.4} large chunks of code have been re-ordered
+% but the global architecture is still somewhat of a mess and doing some such
+% large diffs makes it sometimes difficult to follow small bits of code across
+% commit history, so this is done reluctantly.
+%
+% The usual catcode regime for letters and digits is assumed and some
+% characters such as |*|, |`|, |"|, |=| are supposed to be of catcode other at
+% the time of loading of \mst. The source of \mst takes precautions for some
+% other characters such as the right quote |'|, which may thus be active with
+% no harm at the time of loading (note added |2024/07/16|: very hard to
+% understand why I was so paranoid, but I have kept this annoying constraint).
+%
+% By the way, I think \LaTeX2e should have provided to authors a
% standard macro to be used at the beginning of a style file to make sure the
% catcodes are standard. Shorthands created by Babel should be mostly no problem
% as Babel does the activation only at the |\begin{document}|.
%
-% The comments have been accumulating through successive versions with only
-% partial efforts to achieve some sort of coherence; as a result some are a
-% bit strange or obsolete to various degrees. And the similar remark
-% applies to some ancient parts of the code itself!
-%
-% Should I require |2005/12/01| \LaTeX? (not sure about the month).
+% \mstrelease{1.4} removes a few code branches still there for support to
+% old \LaTeX{} and requires \LaTeX{} |2020-02-02| (which made |\{| and |\}|
+% \cs{protected}; earlier release |2019-10-01| had math macros such as the
+% math accents and \cs{hbar} robust and so far we kept supporting both new and
+% old contexts).
% \begin{macrocode}
-\NeedsTeXFormat{LaTeX2e}
+\NeedsTeXFormat{LaTeX2e}[2020/02/02]
\ProvidesPackage {mathastext}
- [2023/12/29 v1.3zb Use the text font in math mode (JFB)]
+ [2024/07/27 v1.4b Use the text font in math mode (JFB)]
% \end{macrocode}
-% |1.3zb| avoids writing \mst info messages also to console output, only log file.
+% \mstrelease{1.3zb} avoids writing \mst info messages also to console output, only log file.
% Make prefix occupy 20 not 25 characters for alignment with \texttt{LaTeX Font Info},
% as the latter often issues info messages. For similar reason the usages of
% \cs{PackageInfo} will be done with empty lines above and below for better visual
@@ -5915,16 +5802,9 @@ Numerous examples will be found there:\\
\immediate\write\m@ne{}
\PackageInfo{mathastext}{Starting the math mode configuration\@gobble}
% \end{macrocode}
-% \LaTeX{} |2019-10-01| release has made robust math macros such as the math
-% accents and \cs{hbar}.
-% \begin{macrocode}
-\newif\ifmst@robust@obsessed@LaTeX@era
-\@ifl@t@r\fmtversion{2019/10/01}{\mst@robust@obsessed@LaTeX@eratrue}{}
-\edef\mst@robustifyingspace{\ifmst@robust@obsessed@LaTeX@era\space\fi}
-% \end{macrocode}
% Testing for \XeTeX\ and \LuaLaTeX.
%
-% |1.3g 2015/10/15|: update for the naming of primitives, the situation has
+% \mstrelease{1.3g} |2015/10/15|: update for the naming of primitives, the situation has
% evolved both on \XeTeX\ side and on the \LuaLaTeX\ side (LaTeX base
% |2015/10/01|): I was told "U" named math primitives were always available
% for \LuaLaTeX. For \XeTeX, the XeTeX prefix got replaced by U prefix with
@@ -5967,10 +5847,37 @@ Numerous examples will be found there:\\
\ifmst@LuaTeX\mst@XeOrLuatrue\fi
\ifmst@XeTeX \mst@XeOrLuatrue\fi
% \end{macrocode}
-% |1.2|: all inner macros of \mst now starts with |\mst@| for a cleaner
+% \mstrelease{1.4}. I only checked this is correct with TL2024.
+% The macro will be used with |#1| a catcode 11 or 12 token or a one character
+% control sequence such as |\#|.
+% \begin{macrocode}
+\ifmst@XeTeX
+ \def\mst@OnlyIfNotMathActive#1{%
+ \ifnum\mst@Umathcodenum`#1="1FFFFF
+ \expandafter\@gobble
+ \else\expandafter\@firstofone
+ \fi
+ }
+\else\ifmst@LuaTeX
+ \def\mst@OnlyIfNotMathActive#1{%
+ \ifnum\mst@Umathcodenum`#1="1000000
+ \expandafter\@gobble
+ \else\expandafter\@firstofone
+ \fi
+ }
+\else
+ \def\mst@OnlyIfNotMathActive#1{%
+ \ifnum\mathcode`#1="8000
+ \expandafter\@gobble
+ \else\expandafter\@firstofone
+ \fi
+ }
+\fi\fi
+% \end{macrocode}
+% \mstrelease{1.2}: all inner macros of \mst now starts with |\mst@| for a cleaner
% name-space.
%
-% |1.3l 2016/01/29|: hmmm... at this late stage where nobody would expect me
+% \mstrelease{1.3l} |2016/01/29|: hmmm... at this late stage where nobody would expect me
% to still look at the code, I have found at least two macros which still
% didn't: \cs{do@the@endashstuff} and \cs{do@the@emdashstuff}.
%
@@ -5980,16 +5887,16 @@ Numerous examples will be found there:\\
% engines for a while, hence it is not hard to adapt to the replacement of
% |EU1/EU2| by |TU|, maintaining compatibility with legacy installations.
%
+% At \mstrelease{1.4} the support for obsolete |EU1| and |EU2| font encodings
+% has been removed.
+%
% \begin{macro}{\mst@OneifUniEnc}
% The \cs{mst@OneifUniEnc} is expandable but must be used after
% having set \cs{mst@tmp@enc}...
% \begin{macrocode}
\def\mst@oti{OT1}
-\def\mst@eui{EU1}\def\mst@euii{EU2}\def\mst@tu{TU}
-\def\mst@OneifUniEnc {%
- \ifx \mst@tmp@enc\mst@tu 1\else
- \ifx \mst@tmp@enc\mst@eui 1\else
- \ifx \mst@tmp@enc\mst@euii 1\else 0\fi\fi\fi }
+\def\mst@tu{TU}
+\def\mst@OneifUniEnc{\ifx\mst@tmp@enc\mst@tu1\else0\fi}
\newif\ifmst@goahead
\newif\ifmst@abort
% \end{macrocode}
@@ -6006,9 +5913,13 @@ Numerous examples will be found there:\\
\def\mst@enc{\encodingdefault}
\def\mst@fam{\familydefault}
\def\mst@ser{\seriesdefault}
- \def\mst@opsh{\shapedefault} %% will be default shape for operator names
+% \end{macrocode}
+% \noindent\cs{mst@opsh} will hold default shape for operator names.\newline
+% \cs{mst@ltsh} will hold default shape for letters.
+% \begin{macrocode}
+ \def\mst@opsh{\shapedefault}
\def\mst@bold{\bfdefault}
- \def\mst@ltsh{\shapedefault} %% will be default shape for letters
+ \def\mst@ltsh{\shapedefault}
% \end{macrocode}
% \end{macro}
% \end{macro}
@@ -6017,7 +5928,7 @@ Numerous examples will be found there:\\
% \end{macro}
% \end{macro}
% \begin{macro}{\mst@greekfont}
-% |1.15c|: for use by the LGRgreek and selfGreek options. Defined as
+% \mstrelease{1.15c}: for use by the LGRgreek and selfGreek options. Defined as
% an \cs{edef} in order to be able to set-up once and for all the
% Greek at the time of \cs{usepackage}. Modifiable in the preamble
% via \cs{MTgreekfont}\marg{font\_name}\cs{Mathastext}.
@@ -6026,20 +5937,24 @@ Numerous examples will be found there:\\
% \end{macrocode}
% \end{macro}
% \begin{macro}{Package options}
-% |2011/03/09|: |1.13| introduces the option LGRgreek and systematic use
+% |2011/03/09|: \mstrelease{1.13} introduces the option LGRgreek and systematic use
% of \cs{if...} conditionals, for better readability (by myself) of
% the code.
%
-% |1.3x| of |2022/11/03| adds |ncccomma|, |binarysemicolon| and
+% \mstrelease{1.3y} of |2022/11/03| adds |ncccomma|, |binarysemicolon| and
% |frenchmath*| options.
%
-% |1.3za| adds |LGRgreek+| and |LGRgreeks+|.
+% \mstrelease{1.3za} adds |LGRgreek+| and |LGRgreeks+|.
%
-% |1.3zb| adds |decimalcomma| and modifies |frenchmath*| to use it. And
-% provides |frenchmath+| as an alias to former |frenchmath*|. Consecutive
-% to the change at |2.7| of \ctanpkg{frenchmath} which replaced
+% \mstrelease{1.3zb} adds |decimalcomma| and modifies |frenchmath*| to use
+% it. And provides |frenchmath+| as an alias to former |frenchmath*|.
+% Consecutive to the change at |v2.7| of \ctanpkg{frenchmath} which replaced
% \ctanpkg{ncccomma} by \ctanpkg{decimalcomma} and broke the compatibility
% recipe explained in \autoref{ssec:frenchmath}.
+%
+% \mstrelease{1.4} adds options |everymath| and |activedigits|.
+%
+% \mstrelease{1.4b} adds |noletters|.
% \begin{macrocode}
\newif\ifmst@italic
\newif\ifmst@frenchmath
@@ -6082,25 +5997,32 @@ Numerous examples will be found there:\\
\newif\ifmst@noexclam
\DeclareOption{noexclam}{\mst@noexclamtrue}
\newif\ifmst@asterisk
- \DeclareOption{noasterisk}{\PackageWarningNoLine{mathastext}
- {option `noasterisk\string' is deprecated.^^J\space\space\space
- Check the documentation}}
\DeclareOption{asterisk}{\mst@asterisktrue}
\newif\ifmst@nospecials
\DeclareOption{nospecials}{\mst@nospecialstrue}
-\newif\ifmst@basic % 1.3 to avoid unnecessary patch of amsmath \newmcodes@
+\newif\ifmst@basic
\DeclareOption{basic}{\mst@basictrue
\ExecuteOptions{noparenthesis,nopunctuation,%
noplusnominus,noequal,noexclam,nospecials,nolessnomore}}
\newif\ifmst@nohbar
\DeclareOption{nohbar}{\mst@nohbartrue}
+% \end{macrocode}
+% \mstrelease{1.4} adds option |activedigits|.
+% \begin{macrocode}
+\newif\ifmst@activedigits
+ \DeclareOption{activedigits}{\mst@activedigitstrue}
\newif\ifmst@nodigits
\DeclareOption{nodigits}{\mst@nodigitstrue}
\newif\ifmst@defaultimath
\DeclareOption{defaultimath}{\mst@defaultimathtrue}
+% \end{macrocode}
+% \mstrelease{1.4b} adds option |noletters|.
+% \begin{macrocode}
+\newif\ifmst@noletters
+ \DeclareOption{noletters}{\mst@noletterstrue\ExecuteOptions{nohbar,defaultimath}}
\newif\ifmst@mathaccents
\DeclareOption{mathaccents}{\mst@mathaccentstrue}
-\newif\ifmst@unimathaccents % 1.3u
+\newif\ifmst@unimathaccents
\DeclareOption{unimathaccents}{\mst@mathaccentstrue\mst@unimathaccentstrue}
\newif\ifmst@needsymbol
\newif\ifmst@symboldelimiters
@@ -6108,7 +6030,7 @@ Numerous examples will be found there:\\
\newif\ifmst@symboldigits
\DeclareOption{symboldigits}{\mst@needsymboltrue\mst@symboldigitstrue}
\newif\ifmst@symbolgreek
-\newif\ifmst@customgreek %% new with 1.3d
+\newif\ifmst@customgreek
\DeclareOption{symbolgreek}{\mst@needsymboltrue\mst@symbolgreektrue
\mst@customgreektrue }
\newif\ifmst@symbolre
@@ -6144,13 +6066,13 @@ Numerous examples will be found there:\\
\DeclareOption{itGreek}{\def\mst@greek@select{1}}
\DeclareOption{upGreek}{\def\mst@greek@select{2}}
% \end{macrocode}
-% Starting with |1.15f| the meaning of the `defaultxx' options has changed. They
+% Starting with \mstrelease{1.15f} the meaning of the `defaultxx' options has changed. They
% now prevent |mathastext| from defining additional alphabets rather than
% prevent it from identifying the `mathxx' with the new `Mathxx'. The
% `Mathnormal' and `Mathrm' alphabet commands are always created as they are
% SymbolFontAlphabets.
%
-% This was again changed at |1.3za|. The additional alphabets are
+% This was again changed at \mstrelease{1.3za}. The additional alphabets are
% always declared, the options only prevent mapping the existing
% `mathxx' to the new `Mathxx'. This may be breaking change if
% people used these options because they had a need for the
@@ -6169,7 +6091,7 @@ Numerous examples will be found there:\\
\newif\ifmst@defaulttt
\DeclareOption{defaulttt}{\mst@defaulttttrue}
% \end{macrocode}
-% Here and elsewhere |1.3za| has removed an
+% Here and elsewhere \mstrelease{1.3za} has removed an
% \cs{ifmst@nonormalbold} conditional.
% \begin{macrocode}
\DeclareOption{defaultalphabets}{\ExecuteOptions{defaultnormal,defaultrm,%
@@ -6185,14 +6107,25 @@ defaultbf,defaultit,defaultsf,defaulttt}}
\newif\ifmst@fouriervec
\DeclareOption{fouriervec}{\mst@fouriervectrue}
% \end{macrocode}
-% |1.15|: the subdued option.
+% \mstrelease{1.15}: the |subdued| option.
% \begin{macrocode}
\newif\ifmst@subdued
\DeclareOption{subdued}{\mst@subduedtrue}
% \end{macrocode}
-% |1.3q|: the unicode option. Thanks to Tobias~\textsc{Brink} for suggesting its
-% incorporation. The parsing of |\CurrentOption| does not seek any robustness,
-% it just does its job if the option is used correctly.
+% \mstrelease{1.4}: the |everymath| option.
+% \begin{macrocode}
+\newif\ifmst@everymath
+ \DeclareOption{everymath}{\mst@everymathtrue
+\PackageWarningNoLine{mathastext}{%
+ `everymath\string' will be removed at next major release.\MessageBreak
+ Please report to the author the circumstances\MessageBreak
+ which mandated its use in the present document}%
+}
+% \end{macrocode}
+% \mstrelease{1.3q}: the |unicode| option. Thanks to Tobias~\textsc{Brink}
+% for suggesting its incorporation. The parsing of \cs{CurrentOption} does
+% not seek any robustness, it just does its job if the option is used
+% correctly.
% \begin{macrocode}
\def\mst@unicodeminus {2013}
\def\mst@checkoption #1unicodeminus#2\mst@#3\mst@@
@@ -6216,7 +6149,7 @@ defaultbf,defaultit,defaultsf,defaulttt}}
%
% This broke usage of \cs{Mathastext} macro in preamble.
%
-% |1.3w| works around this via \cs{mst@DeclareMathAccent}. And other
+% \mstrelease{1.3w} works around this via \cs{mst@DeclareMathAccent}. And other
% changes were made in \mst code to cope with these complications around
% robustness.
% \begin{macrocode}
@@ -6226,13 +6159,36 @@ defaultbf,defaultit,defaultsf,defaulttt}}
\DeclareMathAccent{#1}}
% \end{macrocode}
% \end{macro}
+% \begin{macro}{\mst@normalversionname}
+% \begin{macro}{\mst@boldversionname}
% Helper macros to test math version names. User is not allowed to redefine
% via \cs{Mathastext} with optional argument or via \cs{MTDeclareVersion} the
-% |normal| and |bold| math versions! Added at |1.3w|, about 7 years late.
+% |normal| and |bold| math versions. Added at \mstrelease{1.3w}, about 7 years late.
% \begin{macrocode}
\def\mst@normalversionname{normal}%
\def\mst@boldversionname{bold}%
% \end{macrocode}
+% \end{macro}\end{macro}
+% \begin{macro}{\mst@OnlyIfNotSubdued}
+% \mstrelease{1.3u} adds this check that we are not in a subdued normal or
+% bold math version. We do not push the |#1| out of the TeX conditionals,
+% and anyhow there was no real need for expandable coding.
+% \begin{macrocode}
+\def\mst@OnlyIfNotSubdued#1{%
+ \ifmst@subdued
+ \ifx\math@version\mst@normalversionname
+ \else
+ \ifx\math@version\mst@boldversionname
+ \else
+ #1%
+ \fi
+ \fi
+ \else
+ #1%
+ \fi
+}%
+% \end{macrocode}
+% \end{macro}
% \begin{macro}{\exists} \begin{macro}{\mst@exists@skip}
% \begin{macro}{\forall} \begin{macro}{\mst@forall@skip}
% \begin{macro}{\MTnormalexists}
@@ -6240,7 +6196,7 @@ defaultbf,defaultit,defaultsf,defaulttt}}
% \begin{macro}{\MTnormalforall}
% \begin{macro}{\MTforalldoesskip }
%
-% |1.15e| |2012/10/21|: math skip/glue \emph{after} \cs{exists} and
+% \mstrelease{1.15e} |2012/10/21|: math skip/glue \emph{after} \cs{exists} and
% \cs{forall}, this is useful with upright letters in math mode.
% Each math version has its own user defined values for the skips,
% stored as macros. The redefinitions of $\exists$ and $\forall$ are
@@ -6249,32 +6205,32 @@ defaultbf,defaultit,defaultsf,defaulttt}}
%
% The subdued option (later and only for the normal and bold math
% version) and the italic option (here) set to zero the package
-% default skips. With |1.2| the skips can be modified on the fly in
+% default skips. With \mstrelease{1.2} the skips can be modified on the fly in
% the document, they are not necessarily set in the preamble once
% and for all for each math version.
%
-% |1.3j| adds \cs{MTnormalexists}, \cs{MTexistsdoesskip},
+% \mstrelease{1.3j} adds \cs{MTnormalexists}, \cs{MTexistsdoesskip},
% \cs{MTnormalforall}, \cs{MTforalldoesskip}.
%
-% Earlier to |1.3j|, |\let\mst@exists@original\exists| was done at End of
+% Earlier to \mstrelease{1.3j}, |\let\mst@exists@original\exists| was done at End of
% Package, now it is done at Begin Document, and same for |\forall|. We
% pay attention that use of \cs{MTnormalexists} etc... inside the
% preamble does not create self-let's.
%
% Also |subdued| mode will do \cs{MTnormalexists}, \cs{MTnormalforall}
-% (earlier than |1.3j|, it only set the muskips to |0mu|.) Same when
+% (earlier than \mstrelease{1.3j}, it only set the muskips to |0mu|.) Same when
% using |\MTversion{normal}|, if |subdued|.
%
% For some (random, legacy) reason, the handling of $\exists$ and
% $\forall$ is part of the things
% not included inside |\everymath/\everydisplay|.
%
-% |1.3v| The \mst-defined \cs{exists} and \cs{forall} are created
+% \mstrelease{1.3v} The \mst-defined \cs{exists} and \cs{forall} are created
% \cs{protected}. We feel this matches better with their default
% definition as \cs{mathchardef} tokens than dealing with \LaTeX2e robust
% macros. Besides, the coding is simpler.
% \begin{macrocode}
-\newmuskip\mst@exists@muskip %% v 1.15e
+\newmuskip\mst@exists@muskip
\newmuskip\mst@forall@muskip
\def\mst@exists@skip{1mu}
\def\mst@forall@skip{.6667mu}
@@ -6318,13 +6274,13 @@ defaultbf,defaultit,defaultsf,defaulttt}}
% \begin{macro}{\MTnormalprime}
% \begin{macro}{\MTprimedoesskip}
%
-% |1.2| |2012/12/17|: math skip/glue \emph{before} the \cs{prime}
+% \mstrelease{1.2} |2012/12/17|: math skip/glue \emph{before} the \cs{prime}
% glyph. This is useful with the default CM glyph and upright letters
% (in contrast the prime from |txfonts| works fine with upright
% letters). For this we replace the \LaTeX{} kernel \cs{active@math@prime}
% with our own skip-enhanced version \cs{mst@active@math@prime}.
%
-% |1.2b| |2012/12/31|: doing\\
+% \mstrelease{1.2b} |2012/12/31|: doing\\
% \null\hspace{1cm}|{\catcode`\'=\active \global\let'\mst@active@math@prime}|\\
% is awfully wrong when the right quote is made active at begin document by
% some other package (as happens with |babel| for some languages). So \mst
@@ -6340,47 +6296,102 @@ defaultbf,defaultit,defaultsf,defaulttt}}
% does its job only as part of the \cs{everymath} and
% \cs{everydisplay} token lists.
%
-% |1.2e| being paranoid, we take precautions against a possibly
+% \mstrelease{1.2e} being paranoid, we take precautions against a possibly
% catcode active right quote at
% the time of loading mathastext.
%
-% |1.3i| adds \cs{MTactiveprime}.
+% \mstrelease{1.3i} adds \cs{MTactiveprime}.
%
-% |1.3j| renames it to \cs{MTprimedoesskip}. Besides, it makes use in the
-% preamble of \cs{MTnormalprime} or \cs{MTprimedoesskip}.
+% \mstrelease{1.3j} renames it to \cs{MTprimedoesskip}. Besides, it makes use in the
+% preamble of \cs{MTnormalprime} or \cs{MTprimedoesskip}.
+%
+% \mstrelease{1.4} adds the support for the new ``non-everymath''
+% implementation, which has to satisfy to very different constraints.
+%
+% The \cs{MTprimedoesskip} is not a |no-op| in |subdued| math version.
+% This is legacy situation, not changed at \mstrelease{1.4}.
+%
% \begin{macrocode}
-\newmuskip\mst@prime@muskip %% v 1.2
+\newmuskip\mst@prime@muskip
\def\mst@prime@skip{.5mu}
\ifmst@italic\ifmst@frenchmath\else\def\mst@prime@skip{0mu}\fi\fi
+% \end{macrocode}
+% Shouldn't I have rather hacked \cs{prim@s}? (answer: perhaps related to
+% Babel see a comment above).\par
+% \noindent
+% TODO: clarify why I used \cs{sp} not |^| in
+% \cs{mst@active@math@prime} in 2012/2013.\newline
+% TODO: clarify why I am paranoid regarding the |'| catcode here.
+%
+% The |everymath| branch was initially superficially refactored at
+% \mstrelease{1.4}, but unfortunately as \cs{mst@mathactivate} had been
+% modified to not handle mathematically active characters, this meant that the
+% \mst feature of extra math skip was lost under the |everymath| option, due to
+% an oversight by the author. For this among other reasons having mainly to
+% do with code comments we did \mstrelease{1.4a}.
+%
+% At \mstrelease{1.4} we can not go via \cs{mst@mathactivate} (defined further
+% down in the code) which filters out the already mathematically active
+% characters.
+%
+% Why am I paranoid here about |'| catcode at package loading time? (this
+% looks ridiculous...).
+% \begin{macrocode}
+\def\mst@tmp#1{%
+\def\mst@mathactivateprime{%
+ \ifnum\catcode`#1=\active
+ \@ifundefined{active@char#1}
+ {}
+ {\mst@do@activecase #1{}{\mst@active@math@prime}}%
+ \else
+ \mst@@mathactivate #1{}{\mst@active@math@prime}%
+ \fi
+}%
+% \end{macrocode}
+% The ``undo'' is needed at \mstrelease{1.4} (but not if |everymath|).
+% \begin{macrocode}
+\def\mst@undo@mathactivateprime{\mst@mathdeactivate#1{"8000}}%
+}\expandafter\mst@tmp\string'
\def\mst@active@math@prime{\sp\bgroup\mskip\mst@prime@muskip\prim@s}
-{\catcode`\'=12
-\gdef\mst@@modifyprime{\mst@mathactivate'{}\mst@active@math@prime}}
-\newcommand*\MTnormalprime {\let\mst@modifyprime\@empty }
-\newcommand*\MTprimedoesskip {\let\mst@modifyprime\mst@@modifyprime}
-\ifmst@subdued
- \MTnormalprime
+\ifmst@everymath
+ \newcommand*\MTnormalprime {\let\mst@modifyprime\@empty}
+ \newcommand*\MTprimedoesskip{\let\mst@modifyprime\mst@mathactivateprime}%
+ \AtBeginDocument{%
+ \everymath\expandafter
+ {\the\everymath \mst@modifyprime \MTnormalprime}%
+ \everydisplay\expandafter
+ {\the\everydisplay \mst@modifyprime \MTnormalprime}%
+% \end{macrocode}
+% MEMO: |subdued| case will do its own \cs{MTnormalprime} at
+% |\begin{document}| later as part of \cs{MTeverymathoff}.
+% \begin{macrocode}
+ \MTprimedoesskip
+ }
\else
- \MTprimedoesskip
+% \end{macrocode}
+% \mstrelease{1.4} must do things a bit differently.
+% \begin{macrocode}
+ \newcommand*\MTnormalprime {\mst@undo@mathactivateprime}
+ \newcommand*\MTprimedoesskip{\mst@mathactivateprime}
+% \end{macrocode}
+% MEMO: |subdued| case will do its own \cs{MTnormalprime} at
+% |\begin{document}| later as part of \cs{MTeverymathoff}.
+% \begin{macrocode}
+ \AtBeginDocument{\MTprimedoesskip}
\fi
-\AtBeginDocument{%
- \everymath\expandafter
- {\the\everymath \mst@modifyprime \MTnormalprime}%
- \everydisplay\expandafter
- {\the\everydisplay \mst@modifyprime \MTnormalprime}%
-}
% \end{macrocode}
% \end{macro}\end{macro}\end{macro}\end{macro}\end{macro}
% \begin{macro}{\MTexistsskip}
% \begin{macro}{\MTforallskip}
% \begin{macro}{\MTprimeskip}
-% |1.15e|: These user macros set up the amount of muglue after
+% \mstrelease{1.15e}: These user macros set up the amount of muglue after
% \cs{exists} or \cs{forall}. The normal and
% bold math versions inherit the same skips; these skips are set to
% zero in case of the subdued, or the italic option. Each command
% \cs{Mathastext}\oarg{version\_name} stores the current values in
% the definition of the math version.
%
-% |1.2|: \cs{MTprimeskip} added, the silly \cs{@onlypreamble} are removed
+% \mstrelease{1.2}: \cs{MTprimeskip} added, the silly \cs{@onlypreamble} are removed
% and the macros are modified to have immediate effect in the document,
% independently of their possible use in the preamble for the math
% versions to store values.
@@ -6433,35 +6444,49 @@ defaultbf,defaultit,defaultsf,defaulttt}}
% mathastext font (both in the current math version). If option
% |noparenthesis| was used, we leave everything untouched.
%
-% In |1.3a|, |2013/09/04|, the modification is done only at the time of
+% In \mstrelease{1.3a}, |2013/09/04|, the modification is done only at the time of
% \cs{MTnonlettersobeymathxx}. It is canceled by
% \cs{MTnonlettersdonotobeymathxx}. So the code has been moved to these
% macros and here we just store at the begin document the then meaning of
% \cs{resetMathstrut@}, and check also if \cs{MTnonlettersobeymathxx} has
% been invoked in the preamble.
%
-% |1.3f| |2015/09/12| issues only an Info message not a Warning, as I am
+% \mstrelease{1.3f} |2015/09/12| issues only an Info message not a Warning, as I am
% becoming aware from another context (etoc) that Warnings are stressful to
% users, in some integrated environments for editing and compiling \LaTeX{}
% source files.
+%
+% \mstrelease{1.4} adds here an \cs{AtEndOfPackage}. As this must be
+% executed (if not in the legacy |everymath| context) after the
+% redefinition of \cs{MTnonlettersobeymathxx} which happens at begin
+% document.
% \begin{macrocode}
\ifmst@noparen\else
-\AtBeginDocument{%
- \@ifundefined{resetMathstrut@}{% nothing to do, no amsmath
- }{% amsmath loaded, and possibly patched by things such as lualatex-math
- \let\mst@savedresetMathstrut@\resetMathstrut@
-% \PackageInfo{mathastext}{current `at begin document\string' meaning of
-% amsmath\MessageBreak
-% \string\resetMathstrut@\space preserved for
-% future use\@gobble}%
- \ifx\mst@the\the % means that \MTnonlettersobeymathxx was used in preamble
- \let\mst@the\@gobble\MTnonlettersobeymathxx
- \fi}}
+\AtEndOfPackage{%
+ \AtBeginDocument{%
+ \@ifundefined{resetMathstrut@}
+ {}%
+ {%
+ \let\mst@savedresetMathstrut@\resetMathstrut@
+% \end{macrocode}
+% The |\ifx\mst@the\the| is true iff \cs{MTnonlettersobeymathxx} was used in preamble
+% (last compared to \cs{MTnonlettersdonotobeymathxx}).
+% Setting \cs{mst@the} to \cs{@gobble} here wiil cause \cs{MTnonlettersobeymathxx}
+% to indeed modify \cs{resetMathstrut@} (and it resets \cs{mst@the} to \cs{the} for
+% its behavior in \cs{everymath}).
+% \begin{macrocode}
+ \ifx\mst@the\the
+ \let\mst@the\@gobble
+ \MTnonlettersobeymathxx
+ \fi
+ }%
+ }%
+}%
\fi
% \end{macrocode}
% \end{macro}
%
-% |1.2| |2012/12/20| does some rather daring \emph{math} activation of
+% \mstrelease{1.2} |2012/12/20| does some rather daring \emph{math} activation of
% \verb$; , : ! ? + - = < > ( ) [ ]$ in
% math mode to achieve something I wanted to do since a long time: overcome
% the mutually excluding relation between the variable-family concept and
@@ -6476,7 +6501,7 @@ defaultbf,defaultit,defaultsf,defaulttt}}
% the entrance of the math mode are discussed later),\\
% \null\hspace{1cm}\fbox{but the concerned characters will now expand in math
% mode to \emph{two} tokens.}\\
-% |1.2c| |2012/12/31|: hence, this current
+% \mstrelease{1.2c} |2012/12/31|: hence, this current
% implementation puts constraints on the input: |$x^?$| or |$x\mathrel?y$|
% now create errors. They must be input
% |$x^{?}$|, respectively |$x\mathrel{?}y$|.\\
@@ -6488,8 +6513,7 @@ defaultbf,defaultit,defaultsf,defaulttt}}
% should be used instead) but it can be activated for them too.
%
%
-% \begin{macro}{\mst@mathactivate}
-% |1.2b| |2012/12/30|: there were bad oversights in the |1.2| code
+% \mstrelease{1.2b} |2012/12/30|: there were bad oversights in the \mstrelease{1.2} code
% for \cs{mst@mathactivate} related to the possibility for some
% characters to have been made active (in the sense of the catcode)
% elsewhere (something which often is done by language definition
@@ -6503,7 +6527,7 @@ defaultbf,defaultit,defaultsf,defaulttt}}
% |:| (assuming for the latter that things would have worked ok before
% the twiddling by \mst).
%
-% |1.2e| |2013/01/09|: alas |$\ref{eq:1}$| still was a problem.
+% \mstrelease{1.2e} |2013/01/09|: alas |$\ref{eq:1}$| still was a problem.
% Indeed in that case the \mst prefix had no means to know it was
% inside a \cs{ref} so it made the character expand to its \mst
% redefinition, which is not acceptable inside a
@@ -6566,13 +6590,13 @@ defaultbf,defaultit,defaultsf,defaulttt}}
% the mathcode to 32768!!}, rather it makes \emph{sure} the character
% is not mathematically active.
%
-% As |1.2e| is a bit paranoid it takes precautions against
+% As \mstrelease{1.2e} is a bit paranoid it takes precautions against
% the possibility of characters it treats being active at
% the time of its loading. Excepted from the scope of the
% paranoia are the latin letters (that would be crazy!) and
% also |*|, |"| and the left quote |`|.
%
-% |1.2f| |2013/01/21| with earlier versions (*) it was important not
+% \mstrelease{1.2f} |2013/01/21| with earlier versions (*) it was important not
% to do twice the business of \cs{mst@mathactivate} (think
% |$\hbox{$?$}$|), so I used (this was a bit wasteful) some sort of
% boolean macro for each character. But now that there are the
@@ -6590,57 +6614,274 @@ defaultbf,defaultit,defaultsf,defaulttt}}
% |\label| or |\ref|. So testing for active characters should be done
% always... many things should be done always... I leave as is.
%
-% |1.3i| |2016/01/06| removes a spurious end of line space in
+% \mstrelease{1.3i} |2016/01/06| removes a spurious end of line space in
% \cs{mst@mathactivate} (did not show as anyhow done in math mode).
%
-% \begin{macro}{\mst@do@az}
-% \begin{macro}{\mst@do@AZ}
-% \begin{macro}{\mst@addtodo@az}
-% \begin{macro}{\mst@addtodo@AZ}
-% \begin{macro}{\mst@the}
-% |1.2b| |2012/12/28| now that we understand the great advantages of |"8000|
-% we do it also for all letters a-z and A-Z to insert automatically the
-% italic corrections. See the \hyperref[sec:ic]{discussion} in the user
-% manual. Ironically I wrote the code initially for the |italic| option only
-% to realize later it was more suitable to using an \emph{upright} text font
-% in math mode! So this mathematical activation of the letters is not done if
-% the font shape is detected to be |it| or |sl|; to bypass this the command
-% \cs{MTicinmath} is provided.
-%
-% |1.2e| |2013/01/10| corrects a bad oversight of |1.2b| in
-% \cs{mst@mathactivate} which made the reproduction of the user manual
-% illustrations with |$f_i^i$| impossible. As \cs{mst@mathactivate} was
-% originally used also to get the non-letters obey math alphabet while
-% maintaining the \TeX{} spacings, it added no extra braces. The braces
-% should however be added for expansion of math active letters, in order of
-% things like |x^y| to work as expected. (the group braces do not prevent
-% ligatures when the letters are arguments to the math alphabet commands,
-% the added macros \cs{mst@itcorr} and \cs{mst@before<letter>} expanding to
-% nothing).
+% \mstrelease{1.4} has significantly refactored the coding, there were
+% simplication from a changed way to use \cs{mst@mathactivate} for letters
+% and added branches to accomodate the renouncement to \cs{everymath}.
+% \begin{macro}{\mst@do@activecase}
+% Called by \cs{mst@mathactivate} if |#1| is catcode active.
+%
+% Check if token activation originates apparently into \ctanpkg{babel}:
+% \begin{itemize}[nosep]
+% \item if NO, nothing is done. The active meaning of |#1| is not modified.
+% \item if YES, we hook into \ctanpkg{babel} associated macros so
+% that in math mode the catcode active token does what \mst expects it to
+% do. Its \cs{mathcode} is set to the
+% one of the associated \cs{mathalpha} symbol as declared by \mst, except
+% for asterisk and right tick which simply use their ascii number as mathcode.
+% \end{itemize}
+%
+% In the case of \ctanpkg{babel}-spanish which has a catcode active right
+% tick, resetting its mathcode has the advantage to reveal in output the case
+% of a faulty input using the curly right tick U+8217 which one can get easily
+% from copy paste, for example from the |babel-spanish.pdf| file.
+%
+% And in general it is dangerous to have a character both catcode active and
+% mathcode active.
+%
+% Some auxiliaries.
+% \begin{macrocode}
+\def\mst@magic@v #1#2#3#4#5{#1#3#4}
+\def\mst@magic@vi #1#2#3#4#5#6{#1#2#4#5}
+\def\mst@fork{\ifmmode\mst@magic@v\fi\@thirdofthree}
+\def\mst@safefork{\ifmmode\if@safe@actives\else\mst@magic@vi\fi\fi\@thirdofthree}
+% \end{macrocode}
+% Some refactoring (and streamlining) at \mstrelease{1.4} here.
+% \begin{footnotesize}
+% There was at some point in the case of a Babel-active token a special
+% hanlding for |#1| to use \cs{MTmathcharletter}|#1| (and event for
+% digits!). But this is almost impossible to arise in practice:
+% \begin{itemize}[nosep]
+% \item Babel commands to set up a shorthand are preamble only (they use
+% \cs{AtBeginDocument}),
+% \item A shorthand is made active at begin document, and we don't want that
+% for a letter!
+% \item Activation is recorded as an instruction in the |.aux| file which
+% breaks it almost surely (except perhaps for letter |Z| or such not
+% likely to appear in macro names in the |.aux| file).
+% \item Even if we somehow hack against that (which I did to test) a more
+% subtle problem arises that Babel updates \cs{nfss@catcodes}, so that the
+% latter will want to make (e.g.) |a| of catcode 12! This causes breakage
+% very easily at the time of \cs{process@table} almost as easily as with
+% the |a| set to be an active character...
+% \end{itemize}
+%
+%^^A In revisiting and
+%^^A improving the coding here (following up on a simplification of
+%^^A \cs{mst@mathactivate} itself, I discovered a bug of earlier releases: in
+%^^A this fictitious "letter made active by Babel" branch the insertion of mu
+%^^A glue around the letter was lost, only the italic correction was kept in the
+%^^A modified meaning of Babel active letter in math mode. This bug was
+%^^A dissolved by the new way \cs{mst@mathactivate} is used by
+%^^A \cs{mst@DeclareMathLetter} and the ensuing simplifcation here. But in fact
+%^^A as summarized above this is purely fictitious code, which will never get
+%^^A executed in real life!
+%^^A As I am not of the repenting type, I also add at \mstrelease{1.4} a similar
+%^^A fictituous layer for catcode active digits...\par
+% \end{footnotesize}
+% |#1| here is a character token of catcode 11 or 12.
+% We do something only if the catcode activation appears to have been triggered
+% by \ctanpkg{babel}. The test has been moved earlier at \mstrelease{1.4}.
+% \begin{macrocode}
+\def\mst@do@activecase#1#2#3{%
+% \end{macrocode}
+% As letters and digits are impossible here, |#2| is either empty (which
+% happens only now for asterisk and right tick) or a single token (\cs{mathclose},
+% \cs{mathopen},... ). When |#2| is not empty, |#3| is always a mathchar
+% token. For safety we make sure then the mathcode is not active.
+%
+% The rationale is
+% to avoid context where people have both catcode and math active and use
+% |\string|. In the case of \ctanpkg{babel}-spanish with
+% |activeacute| option it allows to reveal more easily input errors using
+% curly right tick U+8217.
+%
+% Arguably I probably mainly wanted to do this if the character was found
+% catcode active but not a Babel shorthand. But it ended into the Babel
+% branch and the non-Babel branch for active catcode is to do nothing.
+%
+% |#2| is empty exactly for the case of the right tick and the asterisk.
+% In all other cases, then |#3| is a mathchar token.
+% \begin{macrocode}
+ \ifx\relax #2\relax\mathcode`#1=`#1\relax\else\mathcode`#1=#3\relax\fi
+% \end{macrocode}
+% Less \cs{expandafter}'s at \mstrelease{1.4}. Also, it is now required
+% to make sure:
+% \begin{itemize}[nosep]
+% \item not do it twice in succession (else infinite loop),
+% \item and undo it when deactivating.
+% \end{itemize}
+% This was easily done under legacy code (now only used under |everymath|
+% option, and only for non-letters) as it activated only when entering into
+% math mode.
+%
+% This is more annoying when activation happens in an uncontrolled
+% scope, and we handle this via a \cs{mst@hackedshorthand@<char>} flag.
+%
+% MEMO: the undoing is done in \cs{mst@mathdeactivate} which is invoked
+% only for those non-letters submitted to \cs{mst@mathactivate}.
+% \begin{macrocode}
+ \ifmst@everymath\else\@ifundefined{mst@hackedshorthand@#1}{\fi
+ \expandafter\let\csname mst@orig@user@active#1\expandafter\endcsname
+ \csname user@active#1\endcsname
+ \expandafter\let\csname mst@orig@normal@char#1\expandafter\endcsname
+ \csname normal@char#1\endcsname
+ \ifmst@everymath\else}{}\fi
+% \end{macrocode}
+% No more \cs{edef}'s at \mstrelease{1.4}. At this release, in letter case
+% |#3| is empty and |#2| is a single token which needs no extra brace
+% pair as this brace pair will come from its expansion.
+% We can use |{#2}{#3}| in all cases rather than either |{{#2#3}}{}| versus
+% |{#2}#3| depending on whether |#1| is letter or not as was done in the past.
+% Attention that |#2| and |#3| may each be empty.
+% \begin{macrocode}
+ \def\mst@tmp##1##2{\def##1{\mst@fork{#2}{#3}##2}}%
+ \expandafter\mst@tmp\csname user@active#1\expandafter\endcsname
+ \csname mst@orig@user@active#1\endcsname
+ \def\mst@tmp##1##2{\def##1{\mst@safefork{#2}{#3}##2}}%
+ \expandafter\mst@tmp\csname normal@char#1\expandafter\endcsname
+ \csname mst@orig@normal@char#1\endcsname
+ \ifmst@everymath
+ \else
+ \expandafter\let\csname mst@hackedshorthand@#1\endcsname\@empty
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\mst@@mathactivate}
+% \begin{macrocode}
+\begingroup
+ \catcode`\~=\active
+ \def\x{%
+\endgroup
+% \end{macrocode}
+% |##1| is always a token of catcode 11 or 12.
+% \begin{macrocode}
+\ifmst@everymath
+ \def\mst@@mathactivate##1##2##3{%
+ \begingroup
+ \lccode`~=`##1
+ \lccode`##1=`##1
+% \end{macrocode}
+% Careful here as |##2| is empty in the asterisk and prime case. And |##3|
+% also is at \mstrelease{1.4} empty for letters.
+% \begin{macrocode}
+ \lowercase{\endgroup
+% \end{macrocode}
+% Refactoring at \mstrelease{1.4} merged the catcode 11 and catcode 12
+% branches here and in particular avoided in former case an \cs{edef}. This
+% helped into providing the \cs{MTcommandletter}\meta{letter} as a
+% customizable macro. There was no equivalent to this macro, which here is
+% |##2|, prior to \mstrelease{1.4}.
+% \begin{macrocode}
+ \mathcode`##1="8000
+ \def~{##2##3}%
+ }%
+ }%
+\else
+ \def\mst@@mathactivate##1##2##3{%
+ \begingroup
+ \lccode`~=`##1
+ \lccode`##1=`##1
+ \lowercase{\endgroup
+ \mathcode`##1="8000
+% \end{macrocode}
+% Also, \mstrelease{1.4} possibly execute \cs{mst@mathactivate} everywhere
+% in document body (at version changes for example) or at begin document.
+% Hence this modifies globally the active meaning. So we add some safeguard
+% here using an \cs{ifmmode}. And we store the original meaning of the
+% active variant of the token to reset it when ``undoing''.
+%
+% Careful not to do it twice in a row... (but this means \cs{mst@deactivate}
+% might not revert to a user custom redefinition done in-between but to a
+% prior one; although if the character is made active the second
+% \cs{mst@mathactivate} would not have been done).
+% \begin{macrocode}
+ \@ifundefined{mst@prioractivemeaning@##1}
+ {\expandafter\let
+ \csname mst@prioractivemeaning@##1\endcsname ~}
+ {}%
+ \def~{\ifmmode##2##3\else##1\fi}%
+ }%
+ }%
+\fi
+}\x
+% \end{macrocode}
+% At \mstrelease{1.4} the macro was split into two, to test first whether the
+% character which is encountered is currently with active catcode.
%
-% Added note |2016/01/06|: it should be explicitly said that the extra
-% |{..}| in |\mst@mathactivate| for letters end up creating |\hbox|'es
-% around each letter with its extra skips and explicit italic correction,
-% when present. These skips are thus set at natural width and do not add
-% any break point.
+% At \mstrelease{1.4} the non-catcode active branch is entered only if the
+% character isn't mathematically active at time of use..
%
-% \begin{macro}{\MTmath-}\begin{macro}{activeletters}
-% \begin{macro}{\MTmath-}\begin{macro}{standardletters}
-% |1.3| |2013/09/02| extends the use of mathematically active letters to
-% allow the user to specify muglue before and after the letter itself (see
-% \cs{MTsetmathskips}, below).
-% Mathematically active letters were previously used only to add the italic
-% correction; the math activation has now been separated and put in
-% \cs{MTmathactiveletters}. There is also \cs{MTmathactiveLetters} to allow
-% math activation only for the uppercase letters. To cancel the (now default,
-% even with option |italic|) math
-% activation of letters, there is \cs{MTmathstandardletters}. Version |1.3a|
-% removes some silly |\string|'s from the code, which prevented to pass
-% macros as first argument to the command.
-% \begin{macro}{\MTnonletters-}\begin{macro}{obeymathxx}
-% \begin{macro}{\MTnonletters-}\begin{macro}{donotobeymathxx}
-% \begin{macro}{\resetMathstrut@}
-% These macros are modified in version |1.3a| |2013/09/04| in order to
+% Careful that |#2| and |#3| may each be empty. The test for being a Babel
+% shorthand is done here and not as prior to \mst@release{1.4} inside
+% \cs{mst@do@activecase}.
+% \begin{macrocode}
+\def\mst@mathactivate#1#2#3{%
+ \ifnum\catcode`#1=\active
+ \@ifundefined{active@char#1}{}{\mst@do@activecase #1{#2}{#3}}%
+ \else
+ \mst@OnlyIfNotMathActive{#1}{\mst@@mathactivate #1{#2}{#3}}%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\mst@mathdeactivate}
+% This is needed at \mstrelease{1.4} for non-letters which are mathematically
+% activated. See comments above in \cs{mst@do@activecase}. Works in
+% sync with \cs{mst@addtodo@nonletters}.
+%
+% The \cs{mst@mathdeactivate} is active (sic) only in the non |everymath|
+% situation. It will restore a previously existing active meaning if it has
+% been changed.
+% \begin{macrocode}
+\ifmst@everymath
+\else
+\def\mst@mathdeactivate#1#2{%
+ \mathcode`#1=#2\relax
+ \@ifundefined{active@char#1}
+ {\@ifundefined{mst@prioractivemeaning@#1}
+ {}%
+ {\mst@restoreactivemeaning#1%
+ \expandafter\let\csname mst@prioractivemeaning@#1\endcsname\relax}%
+ }
+ {\@ifundefined{mst@hackedshorthand@#1}
+ {}
+ {\expandafter\let\csname user@active#1\expandafter\endcsname
+ \csname mst@orig@user@active#1\endcsname
+ \expandafter\let\csname normal@char#1\expandafter\endcsname
+ \csname mst@orig@normal@char#1\endcsname
+ \expandafter\let\csname mst@hackedshorthand@#1\endcsname\relax
+ }%
+ }%
+}%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\mst@restoreactivemeaning}
+% At \mstrelease{1.4} when we undo the mathematical activation we now also
+% restore the prior existing active meaning, if any. Only in the ``no
+% |everymath|'' branch (because in the |everymath| \TeX{} itself takes care
+% of that on exiting the scope of the math mode).
+% \begin{macrocode}
+\def\mst@restoreactivemeaning#1{%
+ \begingroup
+ \lccode`~=`#1
+ \lccode`#1=`#1
+ \lowercase{\endgroup
+ \expandafter\let\expandafter~\csname mst@prioractivemeaning@#1\endcsname
+ }%
+}
+\fi
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\mst@do@nonletters}
+% \begin{macro}{\mst@addtodo@nonletters}
+% \begin{macro}{\mst@the}
+% \begin{macro}{\MTnonlettersobeymathxx}
+% \begin{macro}{\MTnonlettersdonotobeymathxx}
+% These macros are modified in version \mstrelease{1.3a} |2013/09/04| in order to
% cleverly adjust, or not, the |amsmath| \cs{resetMathstrut@}. When used in
% the preamble, they just modify \cs{mst@the}. And there is code at begin
% document to check the status there of \cs{mst@the} and if its meaning is
@@ -6658,7 +6899,7 @@ defaultbf,defaultit,defaultsf,defaulttt}}
% |2016/03/03 v2.15a| of |amsmath.sty| is still not compatible with a math
% active opening parenthesis. Hence my patch here is still needed.
%
-% At |1.3u| \cs{MTnonlettersobeymathxx} and \cs{MTeasynonlettersobeymathxx}
+% At \mstrelease{1.3u} \cs{MTnonlettersobeymathxx} and \cs{MTeasynonlettersobeymathxx}
% are made no-ops under subdued mode. This fixes some bug if for example
% the former was used in preamble or immediately after |\begin{document}|
% making the minus sign math active although the \mst action was
@@ -6667,42 +6908,42 @@ defaultbf,defaultit,defaultsf,defaulttt}}
% versions.
% \begin{macrocode}
\newtoks\mst@do@nonletters
-\newtoks\mst@do@easynonletters
-\newtoks\mst@do@az
-\newtoks\mst@do@AZ
+\ifmst@everymath
+\else
+ \newtoks\mst@undo@nonletters
+\fi
+% \end{macrocode}
+% |#1| is a category 12 character, |#2| is a \cs{mathopen}, or \cs{mathclose},
+% etc..., |#3| is a \cs{mathchar} (of variable family type).
+%
+% At \mstrelease{1.4}, \cs{mst@mathactivate} will not do anything if |#1|
+% is mathcode active (but not catcode active) at time of use.
+% \begin{macrocode}
+\ifmst@everymath
+ \def\mst@addtodo@nonletters#1#2#3{\mst@do@nonletters\expandafter
+ {\the\mst@do@nonletters\mst@mathactivate#1#2#3}%
+ }%
+\else
+% \end{macrocode}
+% We need to automatize some safeguards related to \cs{mst@do@activecase} when
+% deactivating.
+% \begin{macrocode}
+ \def\mst@addtodo@nonletters#1#2#3{\mst@do@nonletters\expandafter
+ {\the\mst@do@nonletters\mst@mathactivate#1#2#3}%
+ \edef\mst@tmp{\noexpand\mst@mathdeactivate#1{\the\mathcode`#1}}%
+ \mst@undo@nonletters\expandafter\expandafter\expandafter
+ {\expandafter\mst@tmp\the\mst@undo@nonletters}%
+ }%
+\fi
\let\mst@the\@gobble
-\newcommand*\MTnonlettersdonotobeymathxx{%
- \ifx\mst@the\@gobble
- \else
- \@ifundefined{mst@savedresetMathstrut@}{}{%
- \PackageInfo{mathastext}{restoring for this group or environment
- the original\MessageBreak
- amsmath \protect\resetMathstrut@}%
- \let\resetMathstrut@\mst@savedresetMathstrut@}%
- \fi
- \let\mst@the\@gobble
-}%
% \end{macrocode}
-% |1.3u| adds this check that we are not in a subdued normal or bold math
-% version. No need for expandable coding.
+% As \cs{mst@savedresetMathstrut@} will only be defined at begin document,
+% the next two macros are no-op in the preamble.
% \begin{macrocode}
-\def\mst@OnlyIfNotSubdued#1{%
- \ifmst@subdued
- \ifx\math@version\mst@normalversionname
- \else
- \ifx\math@version\mst@boldversionname
- \else
- #1%
- \fi
- \fi
- \else
- #1%
- \fi
-}%
-\def\mst@nonlettersobeymathxx{%
- \ifx\mst@the\the
- \else
- \@ifundefined{mst@savedresetMathstrut@}{}{%
+\def\mst@redefine@resetMathstrut@{%
+ \@ifundefined{mst@savedresetMathstrut@}
+ {}
+ {%
\ifmst@symboldelimiters
\def\resetMathstrut@{%
\setbox\z@\hbox{\the\textfont\symmtpsymbol\char40
@@ -6715,234 +6956,186 @@ defaultbf,defaultit,defaultsf,defaulttt}}
\the\textfont\symoperators\char40}%
\ht\Mathstrutbox@\ht\z@ \dp\Mathstrutbox@\dp\z@}%
\fi
- \PackageInfo{mathastext}{\string\resetMathstrut@\space
- from amsmath replaced for this\MessageBreak group or environment}}%
- \fi
- \let\mst@the\the
+ \PackageInfo{mathastext}{\string\resetMathstrut@\space
+ from amsmath replaced for this\MessageBreak group or environment}%
+ }%
}%
-\newcommand*\MTnonlettersobeymathxx
- {\mst@OnlyIfNotSubdued\mst@nonlettersobeymathxx}%
-\newcommand*\MTeasynonlettersdonotobeymathxx{\let\mst@theeasy\@gobble}%
-\def\mst@easynonlettersobeymathxx{\let\mst@theeasy\the}%
-\newcommand*\MTeasynonlettersobeymathxx
- {\mst@OnlyIfNotSubdued\mst@easynonlettersobeymathxx}%
-\MTeasynonlettersobeymathxx % no-op here if subdued mode
-\def\mst@mathactiveletters{\let\mst@thef\the \let\mst@theF\the}%
-\newcommand*\MTmathactiveletters
- {\mst@OnlyIfNotSubdued\mst@mathactiveletters}%
-\MTmathactiveletters % no-op here if subdued mode
-\def\mst@mathactiveLetters{\let\mst@theF\the}%
-\newcommand*\MTmathactiveLetters
- {\mst@OnlyIfNotSubdued\mst@mathactiveLetters}%
-\newcommand*\MTmathstandardletters{\let\mst@thef\@gobble \let\mst@theF\@gobble}%
+\def\mst@restore@resetMathstrut@{%
+ \@ifundefined{mst@savedresetMathstrut@}{}{%
+ \PackageInfo{mathastext}{restoring for this group or environment
+ the original\MessageBreak
+ amsmath \protect\resetMathstrut@}%
+ \let\resetMathstrut@\mst@savedresetMathstrut@}%
+}%
+\ifmst@everymath
+ \newcommand*\MTnonlettersobeymathxx{%
+ \mst@OnlyIfNotSubdued{%
+ \ifx\mst@the\the
+ \else
+ \mst@redefine@resetMathstrut@
+ \fi
+ \let\mst@the\the
+ }%
+ }%
+ \newcommand*\MTnonlettersdonotobeymathxx{%
+ \ifx\mst@the\@gobble
+ \else
+ \mst@restore@resetMathstrut@
+ \fi
+ \let\mst@the\@gobble
+ }%
+\else
+ \newcommand*\MTnonlettersobeymathxx{%
+ \mst@OnlyIfNotSubdued{%
+ \AtBeginDocument{\MTnonlettersobeymathxx}%
+ }%
+ }%
+ \newcommand*\MTnonlettersdonotobeymathxx{%
+ \AtBeginDocument{\MTnonlettersdonotobeymathxx}%
+ }%
+ \AtBeginDocument{%
+ \renewcommand*\MTnonlettersobeymathxx{%
+ \mst@OnlyIfNotSubdued{%
+ \the\mst@do@nonletters
+ \ifx\mst@the\the
+ \else
+ \mst@redefine@resetMathstrut@
+ \fi
+ \let\mst@the\the
+ }%
+ }%
+ \renewcommand*\MTnonlettersdonotobeymathxx{%
+ \the\mst@undo@nonletters
+ \ifx\mst@the\@gobble
+ \else
+ \mst@restore@resetMathstrut@
+ \fi
+ \let\mst@the\@gobble
+ }%
+ }%
+\fi
% \end{macrocode}
-% \begin{macro}{\MTicinmath}
-% \begin{macro}{\MTICinmath}
-% \begin{macro}{\MTnoicinmath}
-% \begin{macro}{\MTicalsoinmathxx}
-% \cs{MTnoicinmath} can also be used from inside math mode.
-%
-% \cs{MTicalsoinmathxx} is destined to be used inside
-% \cs{mathnormalbold} as I didn't want to add the complication of
-% extracting the family number used inside \cs{mathnormalbold} (will
-% perhaps come back if I have time to spend on
-% |source2e|). Added note |2016/01/06|: this number is a priori simply
-% |symmtletterfont+1|.
-%
-% \cs{MTicinmath} can also be used inside math mode, to revert an
-% earlier \cs{MTnoicinmath} from inside the same math group: the math mode
-% had to be entered with the math activation of letters allowed.
-%
-% |1.3i| |2016/01/06|: For some reason which I have now forgotten I did
-% until now:
-% \begin{verbatim}
-% \def\mst@itcorr{\ifnum\fam=\m@ne\/\else\ifnum\fam=\symmtletterfont\/\fi\fi}%
-% \end{verbatim}
-% hence italic corrections were also applied inside \cs{mathnormal} (for
-% upright fonts; \cs{mathnormalbold} math alphabet was not treated like
-% \cs{mathnormal}). I now drop this to be more in sync with the handling
-% of the extra skips around letters. Everything gets suppressed inside
-% all math alphabets, allowing ligatures, even for \cs{mathnormal}.
-%
+% \end{macro}\end{macro}\end{macro}\end{macro}\end{macro}
+% \begin{macro}{\MTeasynonlettersobeymathxx}
+% \begin{macro}{\MTeasynonlettersdonotobeymathxx}
% \begin{macrocode}
-\newcommand*\MTicinmath{%
- \MTmathactiveletters
- \def\mst@itcorr{\ifnum\fam=\m@ne\/\fi}%
- \let\mst@ITcorr\mst@itcorr}
-\newcommand*\MTICinmath{%
- \MTmathactiveLetters
- \def\mst@ITcorr{\ifnum\fam=\m@ne\/\fi}}
-\newcommand*\MTnoicinmath{\let\mst@itcorr\@empty\let\mst@ITcorr\@empty}
-\newcommand*\MTnoICinmath{\let\mst@ITcorr\@empty}
-\newcommand*\MTicalsoinmathxx{%
- \ifx\mst@itcorr\@empty\else\def\mst@itcorr{\/}\fi
- \ifx\mst@ITcorr\@empty\else\def\mst@ITcorr{\/}\fi}
+\newtoks\mst@do@easynonletters
+\ifmst@everymath
+ \newcommand*\MTeasynonlettersdonotobeymathxx{\let\mst@theeasy\@gobble}%
+ \newcommand*\MTeasynonlettersobeymathxx{%
+ \mst@OnlyIfNotSubdued{\let\mst@theeasy\the}%
+ }%
+ \MTeasynonlettersobeymathxx
+\else
+ \newtoks\mst@undo@easynonletters
+ \newcommand*\MTeasynonlettersdonotobeymathxx{\the\mst@undo@easynonletters}
+ \newcommand*\MTeasynonlettersobeymathxx{%
+ \mst@OnlyIfNotSubdued{\the\mst@do@easynonletters}%
+ }%
+ \AtEndOfPackage{\MTeasynonlettersobeymathxx}%
+\fi
% \end{macrocode}
-% \end{macro}\end{macro}\end{macro}\end{macro}\end{macro}\end{macro}\end{macro}
-% \end{macro}\end{macro}\end{macro}\end{macro}\end{macro}\end{macro}\end{macro}
-% \end{macro}\end{macro}\end{macro}\end{macro}\end{macro}
-% \begin{macro}{\MTsetmathskips}
-% \begin{macro}{\MTunsetmathskips}
-% |1.3| |2013/09/02|: user level command to specify extra spaces in math mode
-% around the letters (only the 7bit a,b,..,z and A,B,..,Z). First parameter is
-% the letter, second is the math skip to be inserted before, and third the
-% skip to be inserted after; for example \cs{thickmuskip} or explicitly
-% |0.1mu|.
-%
-% For this, letters are made mathematically active. This is now the package
-% default (version |1.2| did this only in the absence of option |italic|, or
-% more precisely when the font used was not of shape |it| or |sl|). But if
-% \cs{MTsetmathskips} has not been used for that letter, the only effect of
-% the math activation is, as in |1.2|, to add the italic correction
-% automatically, except when the font shape is detected to be |it| or |sl|; in
-% these latter cases, although mathematically active, the letter acts in the
-% standard way.
-%
-% The command \cs{MTmathstandardletters} turns off math activation and its
-% effects for all letters.
-%
-% Ligatures within the argument of a math alphabet command are impeached by
-% skips; so \cs{MTunsetmathskips} is provided to cancel the skips for one
-% specific letter (|f| for example).
+% \end{macro}\end{macro}
+% \begin{macro}{\mst@addtodo@easynonletters}
+% |#1| is a one character control sequence (|\.|, |\/|, |\#|, |\%| or |\&|)
+% and |#2| is a mathchar.
%
-% |1.3a| |2013/09/04|: I strangely had |\string#1| inside \cs{MTsetmathskips}.
-% Phobic of catcode active letters... but with |\string| one needs some
-% |\expandafter| to use \cs{MTsetmathskips} in an |\@for| loop for example. It
-% is better to allow the first argument to be a macro or anything expanding to
-% a letter, and to not be paranoid about improbable catcode active letters
-% (the user just has to tame them at the time of the \cs{MTsetmathskip}) so I
-% take out these |\string|'s.
+% Perhaps I should use the Unicode engine \cs{Umathcode} et alia. I do this
+% at other places. However
+% I realized in 2013 and it is still true in 2024 that \LaTeX{} interface
+% \cs{DeclareSymbolFont} does not allow to declare more than 16 font
+% families even with \LuaLaTeX{} despite the latter allowing 256 such.
%
-% |1.3i| |2016/01/06|: the extra skips are suppressed for the arguments of
-% math alphabet commands. This applies in particular for amsmath's
-% \cs{DeclareMathOperator}.
+% So why bother?
%
+% \mstrelease{1.4} adds to this legacy branch a test to not override
+% a mathematically active ``easy'' non-letter. Main case is the dot
+% with Babel Spanish.
% \begin{macrocode}
-\newcommand*\MTsetmathskips[3]{%
- \@namedef{mst@before#1}{\ifnum\fam=\m@ne\mskip#2\relax\fi }%
- \@namedef{mst@after#1}{\ifnum\fam=\m@ne\mskip#3\relax\fi }%
-}
-\newcommand*\MTunsetmathskips[1]{%
- \@namedef{mst@before#1}{}%
- \@namedef{mst@after#1}{}%
-}
+\ifmst@everymath
+ \def\mst@addtodo@easynonletters#1#2{%
+ \mst@do@easynonletters\expandafter{%
+ \the\mst@do@easynonletters
+ \mst@OnlyIfNotMathActive{#1}{\mathcode`#1=#2}%
+ }%
+ }%
+ \def\mst@addtodo@easynonletters@U#1#2{%
+ \mst@do@easynonletters\expandafter{%
+ \the\mst@do@easynonletters
+ \mst@OnlyIfNotMathActive{#1}{\mst@Umathcodenum`#1=#2}%
+ }%
+ }%
+\else
% \end{macrocode}
-% \end{macro}\end{macro}
-% \begin{macro}{\mst@mathactivate}
-% \begin{macro}{\mst@addtodo@nonletters}
-% \begin{macro}{\mst@addtodo@easynonletters}
-% \begin{macro}{\mst@addtodo@az}
-% \begin{macro}{\mst@addtodo@AZ}
-% Added note |2016/01/06|:
-% Notice that the initially |\relax| tokens \verb+\mst@[before|after]@<letter>+
-% formed with |\csname...\endcsname| do not modify TeX's math layout:
-% |{\relax f\relax}| is like |f| (also for ligatures inside |\mathrm| for
-% example).
+% The character may have been made mathcode active
+% exterior to \mst. We can not test this for sure at begin document as it
+% may happen later. If such an ``easy'' character is mathcode active,
+% this can not originate in \mst. So we should not overwrite when
+% we issue \cs{MTeasynonlettersdonotobeymathxx}. Example I know is
+% with \ctanpkg{babel} Spanish which makes the dot math active. With PDF\LaTeX{}
+% it is also catcode active
+%
+% This macro may be used with Unicoe engines, and \LuaTeX{} and \XeTeX{}
+% differ regarding math active characters. I have only tested this (anew)
+% for \mstrelease{1.4} for which this branch is needed, so in 2024.
% \begin{macrocode}
-\def\mst@magic@v #1#2#3#4#5{#1#3#4}
-\def\mst@magic@vi #1#2#3#4#5#6{#1#2#4#5}
-\def\mst@fork{\ifmmode\mst@magic@v\fi\@thirdofthree}
-\def\mst@safefork{\ifmmode\if@safe@actives\else\mst@magic@vi\fi\fi\@thirdofthree}
-\def\mst@do@activecase#1#2#3{% #1 is a category 11 or 12 character token
- \@ifundefined{active@char#1}{}{%
- \ifcat #1a\mathcode`#1=#2\else
- \ifx\relax #2\relax\mathcode`#1=`#1 \else\mathcode`#1=#3\fi\fi
- \expandafter\expandafter\expandafter\let\expandafter\expandafter
- \csname mst@orig@user@active#1\endcsname
- \csname user@active#1\endcsname
- \expandafter\expandafter\expandafter\let\expandafter\expandafter
- \csname mst@orig@normal@char#1\endcsname
- \csname normal@char#1\endcsname
- \ifcat #1a%
- \expandafter\edef\csname user@active#1\endcsname
- {\noexpand\mst@fork {{#2\noexpand#3}}{}\expandafter
- \noexpand\csname mst@orig@user@active#1\endcsname
- }%
- \expandafter\edef\csname normal@char#1\endcsname
- {\noexpand\mst@safefork {{#2\noexpand#3}}{}\expandafter
- \noexpand\csname mst@orig@normal@char#1\endcsname
- }%
- \else
- \expandafter\edef\csname user@active#1\endcsname
- {\noexpand\mst@fork {#2}\noexpand#3\expandafter
- \noexpand\csname mst@orig@user@active#1\endcsname
- }%
- \expandafter\edef\csname normal@char#1\endcsname
- {\noexpand\mst@safefork {#2}\noexpand#3\expandafter
- \noexpand\csname mst@orig@normal@char#1\endcsname
- }%
- \fi}}
-\begingroup
- \catcode`\~=\active
- \def\x{\endgroup
- \def\mst@mathactivate##1##2##3{% ##1 guaranteed of cat 11 or 12
- \begingroup
- \lccode`~=`##1
- \lccode`##1=`##1
- \lowercase{\endgroup
- \ifnum\catcode`##1=\active
- \mst@do@activecase ##1{##2}##3%
- % careful as ##2 is empty in the asterisk and
- % prime case!
- \else
- \mathcode`##1="8000
- % version 1.3 adds the possibility of extra skips around letters,
- % (only if non catcode active at the time of use).
- \ifcat##1a\edef~{% extra braces for a^b for example
- {\expandafter\noexpand\csname mst@before##1\endcsname
- ##2\noexpand##3%
- \expandafter\noexpand\csname mst@after##1\endcsname}}%
- \else\def~{##2##3}\fi
- \fi}}}
-\x
-\def\mst@addtodo@nonletters#1#2#3{%
- % #1 will be of cat 11 or 12.
- % #2 is empty for asterisk and right quote
- \mst@do@nonletters\expandafter
- {\the\mst@do@nonletters \mst@mathactivate#1{#2}#3}%
-}
-\def\mst@addtodo@easynonletters#1#2{% #1 is a one char control sequence
- \mst@do@easynonletters\expandafter{\the\mst@do@easynonletters\mathcode`#1=#2}%
-}
-\def\mst@addtodo@az#1#2{%
- \mst@do@az\expandafter{\the\mst@do@az\mst@mathactivate#1#2\mst@itcorr}
-}
-\def\mst@addtodo@AZ#1#2{%
- \mst@do@AZ\expandafter{\the\mst@do@AZ\mst@mathactivate#1#2\mst@ITcorr}%
-}
+ \def\mst@addtodo@easynonletters#1#2{%
+ \mst@do@easynonletters\expandafter
+ {\the\mst@do@easynonletters
+ \mst@OnlyIfNotMathActive{#1}{\mathcode`#1=#2}}%
+ \def\mst@tmp##1\relax{%
+ \def\mst@tmp{\mst@OnlyIfNotMathActive{#1}{\mathcode`#1=##1\relax}}%
+ }%
+ \expandafter\mst@tmp\the\mathcode`#1\relax
+ \mst@undo@easynonletters\expandafter\expandafter\expandafter
+ {\expandafter\mst@tmp\the\mst@undo@easynonletters}%
+ }%
+ \def\mst@addtodo@easynonletters@U#1#2{%
+ \mst@do@easynonletters\expandafter{%
+ \the\mst@do@easynonletters
+ \mst@OnlyIfNotMathActive{#1}{\mst@Umathcodenum`#1=#2}%
+ }%
+ \def\mst@tmp##1\relax{%
+ \def\mst@tmp{\mst@OnlyIfNotMathActive{#1}{\mst@Umathcodenum`#1=##1\relax}}%
+ }%
+ \expandafter\mst@tmp\the\mst@Umathcodenum`#1\relax
+ \mst@undo@easynonletters\expandafter\expandafter\expandafter
+ {\expandafter\mst@tmp\the\mst@undo@easynonletters}%
+ }%
+\fi
% \end{macrocode}
-% \end{macro}\end{macro}\end{macro}\end{macro}\end{macro}
+% \end{macro}
% \begin{macro}{\newmcodes@}
% \begin{macro}{\mst@newmcodes@}
% \begin{macro}{\MTresetnewmcodes}
% \begin{macro}{\MTcustomizenewmcodes}
-% |1.15d|: the \cs{newmcodes@} amsmath macro causes an error in Unicode engines as soon
-% someone assigns a Unicode mathcode to the minus sign, and then makes a
-% \cs{DeclareMathOperator} declaration. Furthermore it hard-codes the font
-% family 0 as being the one to be used. Moreover just putting the concerned
-% signs |-|, |:|, |.|, |\| ,|'|, |*| inside braces emulates enough the
-% behavior (although the tick will give a prime).
+% \mstrelease{1.15d}: the \cs{newmcodes@} amsmath macro causes an error in
+% Unicode engines as soon someone assigns a Unicode mathcode to the minus
+% sign, and then makes a \cs{DeclareMathOperator} declaration. Furthermore
+% it hard-codes the font family 0 as being the one to be used. Moreover just
+% putting the concerned signs |-|, |:|, |.|, |\| ,|'|, |*| inside braces
+% emulates enough the behavior (although the tick will give a prime).
%
-% |1.3|: now tests if `basic' option was used.
+% \mstrelease{1.3}: now tests if `basic' option was used.
%
-% |1.3d|: I should re-examine the situation with |\newmcodes@|. In the
+% \mstrelease{1.3d}: I should re-examine the situation with |\newmcodes@|. In the
% meantime its relaxification will not be done if lualatex-math is
% loaded. And the whole thing is put at begin document.
%
-% |1.3m|: |lualatex-math 1.5| n'a pas modifié son traitement de |\newmcodes@|
+% \mstrelease{1.3m}: |lualatex-math 1.5| n'a pas modifié son traitement de |\newmcodes@|
% mais par contre a supprimé le patch de \cs{resetMathstrut@}. Mais la date
-% de release est restée à |2015/09/22| (date de |1.4a|) au lieu de quelque
+% de release est restée à |2015/09/22| (date de \mstrelease{1.4a}) au lieu de quelque
% chose comme |2016/03/13| (date pour l'annonce sur CTAN). Il faudra suivre
% l'évolution future de |amsmath.sty| maintenant assurée par D.C.
%
-% |1.3n 2016/04/22|: there is no more a patch of |\newmcodes@| by
+% \mstrelease{1.3n} |2016/04/22|: there is no more a patch of |\newmcodes@| by
% |lualatex-math 1.6| |(2016/04/16)|, as |amsmath 2016/03/10 v2.15b| has now
% a version compatible with \LuaLaTeX.
%
% My very radical |\let\newmcodes@\relax| was only a temporary measure I
% adopted for lack of time on October 13, 2012, and apart from avoiding to
% do that in case |lualatex-math| was detected, I never came back... finally
-% I handle it myself for |1.3n|. The remaining problem of this macro (now
+% I handle it myself for \mstrelease{1.3n}. The remaining problem of this macro (now
% that it does not anymore crash |lualatex| or vice versa) is that (also
% with |amsmath| version |2016/03/10 v2.15b|) it hardcodes the font used.
% The aim of the macro is to modify the type of spacing affected to symbols
@@ -6954,7 +7147,7 @@ defaultbf,defaultit,defaultsf,defaulttt}}
% \item \mst makes (or not, depending on commands issued by the user) these
% characters math active (the right tick already is), which complicates
% recovery of former mathcode. We have mathchar type \emph{macros}, but
-% then the complication is in diverging behaviours of the engines:
+% then the complication is in diverging behaviors of the engines:
% |\numexpr\mst@varfam@minus\relax| works with \LuaTeX, not with \XeTeX.
% \item the |*| must presumably really be the non-lowered text glyph.
% \item for the |-| I hesitated but do use the hyphen in the end.
@@ -6979,7 +7172,7 @@ defaultbf,defaultit,defaultsf,defaulttt}}
% \item I noticed that \LuaLaTeX\ does not apply the ``TeX Ligature'' (bad
% name) regarding the right tick APOSTROPHE being transformed into RIGHT
% SINGLE QUOTATION MARK in math mode, but \XeLaTeX\ does. From the point
-% of view of \mst, the behaviour of \XeLaTeX\ is the coherent one. It
+% of view of \mst, the behavior of \XeLaTeX\ is the coherent one. It
% appears that \LuaLaTeX\ use in math mode of a text font does not obey
% the set features.^^A like this
%^^A \url{http://tex.stackexchange.com/questions/208688/oldstylefigure-issue-with-lualatex-and-mathastext}
@@ -6997,7 +7190,7 @@ defaultbf,defaultit,defaultsf,defaulttt}}
% in 2012! I spent some hours on this small thing, with consequent testing and
% for example this TeX Ligature issue with Unicode engines.
%
-% Since |1.3v| we require e-\TeX{} extensions, so a test for
+% Since \mstrelease{1.3v} we require e-\TeX{} extensions, so a test for
% \cs{numexpr} has been dropped here.
% \begin{macrocode}
\ifmst@basic
@@ -7027,7 +7220,7 @@ defaultbf,defaultit,defaultsf,defaulttt}}
}%
\let\mst@originalnewmcodes@\newmcodes@
\fi
- }% end of AtBeginDocument
+ }%
\else
\AtBeginDocument {%
\ifx\newmcodes@\@undefined\else
@@ -7047,9 +7240,9 @@ defaultbf,defaultit,defaultsf,defaulttt}}
}%
\let\mst@originalnewmcodes@\newmcodes@
\fi
- }% end of second AtBeginDocument
- \fi % mst@XeOrLua
-\fi % mst@basic
+ }%
+ \fi
+\fi
\newcommand*\MTresetnewmcodes{\ifx\mst@originalnewmcodes@\undefined\else
\let\newmcodes@\mst@originalnewmcodes@\fi}
\newcommand*\MTcustomizenewmcodes{\ifx\mst@originalnewmcodes@\undefined\else
@@ -7080,7 +7273,7 @@ defaultbf,defaultit,defaultsf,defaulttt}}
% we'll see.
% \begin{macro}{\MTmathoperators-}\begin{macro}{obeymathxx}
% \begin{macro}{\MTmathoperators-}\begin{macro}{donot-}\begin{macro}{obeymathxx}
-% |1.2|: rather than just replacing \cs{symoperators} by
+% \mstrelease{1.2}: rather than just replacing \cs{symoperators} by
% \cs{symmtoperatorfont} I add a modification which makes the
% declared operator names sensitive to the math alphabets... ouh le
% vilain!
@@ -7093,7 +7286,7 @@ defaultbf,defaultit,defaultsf,defaulttt}}
% \end{macrocode}
% \end{macro}\end{macro}\end{macro}\end{macro}\end{macro}\end{macro}
% \begin{macro}{mtletterfont}
-% At version |1.1|, we add the possibility to mimick the standard
+% At version \mstrelease{1.1}, we add the possibility to mimick the standard
% behavior, that is to have italic letters and upright
% digits. Thanks to Tariq~\textsc{Perwez} and
% Kevin~\textsc{Klement} who asked for such a feature.
@@ -7134,39 +7327,59 @@ defaultbf,defaultit,defaultsf,defaulttt}}
% simultaneously when specified with |mode=base|. It does work with
% |mode=node| but this mode ``does not work in math mode.''
%
-% Done for |1.3o| of |2016/05/03|.
+% Done for \mstrelease{1.3o} of |2016/05/03|.
+%
+% \mstrelease{1.3p} renames the macro to \cs{MTfixmathfonts} for public access.
+%
+% \mstrelease{1.4} intercepts also |mode=harf|. Cf
+% \url{https://tex.stackexchange.com/questions/722084/change-number-style-with-mathastext}
+% (thanks to |user691586| for bug report). The new code unconditionally
+% replaces |mode=foo| by |mode=base|. The complications due to the output of
+% |\fontname| using only category 12 characters are handled in a different way
+% than the |2016| code.
%
-% |1.3p| renames the macro to \cs{MTfixmathfonts} for public access.
+% The \url{https://github.com/latex3/fontspec/issues/525} problem causes
+% additional complications.
+%
+% Perhaps I should simply zap spaces always rather than check for quotes?
+% Anyway this appears to work.
% \begin{macrocode}
-\begingroup
-\catcode`N 12
-\catcode`O 12
-\catcode`D 12
-\catcode`E 12
-\lowercase{\gdef\mst@fixmathfonts@ #1=NODE;#2#3\relax #4\@empty #5}%
- {\ifx#2\empty\else\font\mst@mathfont=#1=base;#2#3\relax#5=\mst@mathfont\fi}
-\lowercase{\gdef\MTfixmathfonts
-{\expandafter\mst@fixmathfonts@
- \fontname\textfont\symmtoperatorfont\relax\relax=NODE;\empty\relax\@empty
- {\textfont\symmtoperatorfont}%
- \expandafter\mst@fixmathfonts@
- \fontname\scriptfont\symmtoperatorfont\relax\relax=NODE;\empty\relax\@empty
- {\scriptfont\symmtoperatorfont}%
- \expandafter\mst@fixmathfonts@
- \fontname\scriptscriptfont\symmtoperatorfont\relax\relax=NODE;\empty\relax\@empty
- {\scriptscriptfont\symmtoperatorfont}%
- \expandafter\mst@fixmathfonts@
- \fontname\textfont\symmtletterfont\relax\relax=NODE;\empty\relax\@empty
- {\textfont\symmtletterfont}%
- \expandafter\mst@fixmathfonts@
- \fontname\scriptfont\symmtletterfont\relax\relax=NODE;\empty\relax\@empty
- {\scriptfont\symmtletterfont}%
- \expandafter\mst@fixmathfonts@
- \fontname\scriptscriptfont\symmtletterfont\relax\relax=NODE;\empty\relax\@empty
- {\scriptscriptfont\symmtletterfont}%
- }%
+\def\mst@fixmathfonts@#1.#2.#3.{%
+\def\mst@fixmathfonts@##1##2#1=##3;##4##5\relax##6\@empty##7{%
+ \ifx##3\empty\else
+ \if"##1%
+ \font\mst@mathfont=##1##2#1=base;##4##5\relax
+ \else
+ \mst@arrrrgh@fixmathfonts##1##2#1=base;##4##5#2\empty#3\relax
+ \fi
+ ##7=\mst@mathfont
+ \fi
}%
-\endgroup
+\def\mst@arrrrgh@fixmathfonts##1#2##2##3#3##4\relax{%
+ \ifx##2\empty
+ \font\mst@mathfont="##1"\relax
+ \else
+ \font\mst@mathfont="##1"#2##2##3#3\relax
+ \fi
+}%
+}%
+\expandafter\mst@fixmathfonts@\detokenize{mode. at.pt.}%
+\def\MTfixmathfonts#1{%
+\def\MTfixmathfonts{%
+ \expandafter\mst@fixmathfonts@\fontname\textfont\symmtoperatorfont
+ \relax\relax #1=;\empty\relax\@empty{\textfont\symmtoperatorfont}%
+ \expandafter\mst@fixmathfonts@\fontname\scriptfont\symmtoperatorfont
+ \relax\relax #1=;\empty\relax\@empty{\scriptfont\symmtoperatorfont}%
+ \expandafter\mst@fixmathfonts@\fontname\scriptscriptfont\symmtoperatorfont
+ \relax\relax #1=;\empty\relax\@empty{\scriptscriptfont\symmtoperatorfont}%
+ \expandafter\mst@fixmathfonts@\fontname\textfont\symmtletterfont
+ \relax\relax #1=;\empty\relax\@empty{\textfont\symmtletterfont}%
+ \expandafter\mst@fixmathfonts@\fontname\scriptfont\symmtletterfont
+ \relax\relax #1=;\empty\relax\@empty{\scriptfont\symmtletterfont}%
+ \expandafter\mst@fixmathfonts@\fontname\scriptscriptfont\symmtletterfont
+ \relax\relax #1=;\empty\relax\@empty{\scriptscriptfont\symmtletterfont}%
+}}%
+\expandafter\MTfixmathfonts\expandafter{\detokenize{mode}}%
\ifmst@LuaTeX
\everymath\expandafter{\the\everymath\mst@fixmathfonts}%
\everydisplay\expandafter{\the\everydisplay\mst@fixmathfonts}%
@@ -7198,7 +7411,7 @@ defaultbf,defaultit,defaultsf,defaulttt}}
% \cs{mathrm} and not \cs{mathnormal}.
%
% Actually math alphabet macros are created robust since \LaTeX{} from 2005,
-% so at |1.3v 2019/09/19| I decided to modify the old \mst approach a bit.
+% so at \mstrelease{1.3v} |2019/09/19| I decided to modify the old \mst approach a bit.
% Indeed with the old approach a \cs{mathtt} in a moving argument translates
% ultimately into \cs{Mathtt} but if for example the new context where it
% gets expanded is a subdued normal math version, this does not give the same
@@ -7220,10 +7433,10 @@ defaultbf,defaultit,defaultsf,defaulttt}}
% robustness (except of course in the subdued math versions as there the math
% alphabets acquire back their original robust meanings.)
%
-% Potential breaking change at |1.3za|, the |defaultbf| etc... options do
+% Potential breaking change at \mstrelease{1.3za}, the |defaultbf| etc... options do
% not prevent the package declaring |\Mathbf| etc... commands.
%
-% |1.3za| defines a \cs{Mathnormalbold} and then defines \cs{mathnormalbold}
+% \mstrelease{1.3za} defines a \cs{Mathnormalbold} and then defines \cs{mathnormalbold}
% in terms of it in place of defining directly \cs{mathnormalbold} as a math
% alphabet. This is in relation to implementation of the |LGRgreek+|
% option. There was some hesitation though to restrict this change to that
@@ -7249,7 +7462,7 @@ defaultbf,defaultit,defaultsf,defaulttt}}
\let\mst@original@it\mathit
\let\mst@original@sf\mathsf
\let\mst@original@tt\mathtt
-\def\mst@restorealphabets{% for subdued
+\def\mst@restorealphabets{%
\let\mathnormal\mst@original@normal
\let\mathrm\mst@original@rm
\let\mathbf\mst@original@bf
@@ -7264,7 +7477,7 @@ defaultbf,defaultit,defaultsf,defaulttt}}
% there to be a robust and easy way to know when one is in the argument of
% \cs{mathrm} or \cs{mathbf}, and the code is spread on various chapters of
% \texttt{source2e.pdf}, and the comments are often not up-to-date. So I did
-% not try a too complex hack and decided for |1.3za| to add a numeric
+% not try a too complex hack and decided for \mstrelease{1.3za} to add a numeric
% indicator to let Greek letters react to it. It incorporates a space to be
% self-delimiting in an \cs{ifcase} to maintain expandability in numeric
% context of the to-be-defined Greek control sequences.
@@ -7316,7 +7529,7 @@ defaultbf,defaultit,defaultsf,defaulttt}}
% \begin{macro}{\MTgreekupdefault}
% \begin{macro}{\MTgreekitdefault}
% \begin{macro}{selfGreek}
-% |1.14b|: We can not move the \cs{DeclareSymbolFont} to the
+% \mstrelease{1.14b}: We can not move the \cs{DeclareSymbolFont} to the
% \cs{Mathastext} macro because it resets the font family in *all*
% math versions, and some could have been defined by the user with
% previous calls to \cs{Mathastext}. So we have to have them here.
@@ -7336,7 +7549,7 @@ defaultbf,defaultit,defaultsf,defaulttt}}
%
% First we establish the cumulative effect of the greek related options.
%
-% |1.15c| introduces some possibilities to change the shapes of Greek letters
+% \mstrelease{1.15c} introduces some possibilities to change the shapes of Greek letters
% in each math versions, and even the Greek font (in LGR encoding). The
% commands \cs{MTitgreek} etc... will be used in-between calls to
% \cs{Mathastext} and re-adjust the shapes. And the command \cs{MTgreekfont}
@@ -7355,7 +7568,7 @@ defaultbf,defaultit,defaultsf,defaulttt}}
% \LaTeX\ (since 2020-02-02 now that I check this out). As a result this
% triggered Font Warnings in the log about the replacement of |up| by |n|.
%
-% |1.3x| refactors completely the handling of Greek letter shapes under the
+% \mstrelease{1.3y} refactors completely the handling of Greek letter shapes under the
% |LGRgreek(s)| options (and only under them). Under these options we don't
% use one font for lowercase Greek and anotherone for uppercase Greek (some
% above code comments have not been updated) but one math font |mtgreekit| for italic Greek
@@ -7372,7 +7585,7 @@ defaultbf,defaultit,defaultsf,defaulttt}}
%
% In order to maintain perfect identical code for non-|LGRgreek|, the
% |LGRgreek| related code is simply added to previously shared
-% constructions. The |LGRgreek| behaviour will remain identical in most
+% constructions. The |LGRgreek| behavior will remain identical in most
% documents, but for example those who used some adventurous `|sc|' for the
% main shape (the one used per default for operator names) need to adjust
% \cs{MTgreekupdefault} to be `|sc|', for the math version being defined, or
@@ -7386,9 +7599,9 @@ defaultbf,defaultit,defaultsf,defaulttt}}
% package; to be examined next time --- which may be a long time in
% future!).
%
-% Unfortunately the |1.3x/1.3y| did some internal renamings here (using
+% Unfortunately the \mstrelease{1.3y} did some internal renamings here (using
% |@lgr@| in macro names in place of |@greek@|) which were not everywhere
-% followed up, and this broke the |selfGreek| option. Fixed at |1.3z|.
+% followed up, and this broke the |selfGreek| option. Fixed at \mstrelease{1.3z}.
%
% \begin{macrocode}
\providecommand*\MTgreekupdefault{n}
@@ -7442,14 +7655,14 @@ defaultbf,defaultit,defaultsf,defaulttt}}
% \begin{macro}{\mathgreekit}
% \begin{macro}{\mathgreekupbold}
% \begin{macro}{\mathgreekitbold}
-% The |1.3x| refactoring was done in order to be able to define \cs{alphaup},
+% The \mstrelease{1.3y} refactoring was done in order to be able to define \cs{alphaup},
% etc \dots\ control sequences (\cs{mathchar}'s), as well as the italic ones.
% Formerly two math fonts were created but to be used respectively with
% lowercase or uppercase Greek. Now we have two fonts indexed by their shape,
% and we take advantage to create two math alphabets mapping to the two
% defined symbol fonts |mtgreekup| and |mtgreekit|.
%
-% |1.3za| adds \cs{mathgreekupbold} and \cs{mathgreekitbold}.
+% \mstrelease{1.3za} adds \cs{mathgreekupbold} and \cs{mathgreekitbold}.
% \begin{macrocode}
\ifmst@LGRgreek
\DeclareFontEncoding{LGR}{}{}
@@ -7484,10 +7697,11 @@ defaultbf,defaultit,defaultsf,defaulttt}}
% In case we need the Euler font, we declare it here. It will use
% |uzeur.fd| from the \ctanpkg{eulervm} package of Walter~\textsc{Schmidt}
% \begin{macrocode}
-\ifmst@needeuler\mst@infoline{will use Euler font; command \string\MTEulerScale}
-\DeclareSymbolFont{mteulervm}{U}{zeur}{m}{n}
-\DeclareSymbolFontAlphabet{\MathEuler}{mteulervm}
-\DeclareMathAlphabet{\MathEulerBold}{U}{zeur}{\mst@bold}{n}
+\ifmst@needeuler
+\mst@infoline{will use Euler font; command \string\MTEulerScale}
+ \DeclareSymbolFont{mteulervm}{U}{zeur}{m}{n}
+ \DeclareSymbolFontAlphabet{\MathEuler}{mteulervm}
+ \DeclareMathAlphabet{\MathEulerBold}{U}{zeur}{\mst@bold}{n}
\fi
\newcommand*\MTEulerScale[1]{\edef\zeu@Scale{#1}}
\let\MathastextEulerScale\MTEulerScale
@@ -7534,14 +7748,15 @@ defaultbf,defaultit,defaultsf,defaulttt}}
% \cs{psy@scale} will be used to scale the font (see at the
% very end of this file).
% \begin{macrocode}
-\ifmst@needsymbol\mst@infoline{will use Symbol font; command \string\MTSymbolScale}
- \def\psy@scale{1}
- \DeclareSymbolFont{mtpsymbol}{U}{psy}{m}{n}
- \DeclareSymbolFontAlphabet{\MathPSymbol}{mtpsymbol}
-\AtBeginDocument{%
- \DeclareFontFamily{U}{psy}{}%
- \DeclareFontShape{U}{psy}{m}{n}{<->s*[\psy@scale] psyr}{}%
-}
+\ifmst@needsymbol
+ \mst@infoline{will use Symbol font; command \string\MTSymbolScale}
+ \def\psy@scale{1}
+ \DeclareSymbolFont{mtpsymbol}{U}{psy}{m}{n}
+ \DeclareSymbolFontAlphabet{\MathPSymbol}{mtpsymbol}
+ \AtBeginDocument{%
+ \DeclareFontFamily{U}{psy}{}%
+ \DeclareFontShape{U}{psy}{m}{n}{<->s*[\psy@scale] psyr}{}%
+ }
\fi
\newcommand*\MTSymbolScale[1]{\edef\psy@scale{#1}}
\let\MathastextSymbolScale\MTSymbolScale
@@ -7553,10 +7768,14 @@ defaultbf,defaultit,defaultsf,defaulttt}}
% \end{macro}
% \end{macro}
% \begin{macro}{\pmvec}
-% Definition of a poor man version of the \cs{vec} accent
+% Definition of a poor man version of the \cs{vec} accent.
+% Done using \cs{protected}\cs{def} at \mstrelease{1.4}.
% \begin{macrocode}
-\DeclareRobustCommand*\pmvec[1]{\mathord{\stackrel{\raisebox{-.5ex}%
-{\tiny\boldmath$\mathord{\rightarrow}$}}{{}#1}}}
+\protected\def\pmvec#1{%
+ \mathord{\stackrel{\raisebox{-.5ex}{\tiny\boldmath$\mathord{\rightarrow}$}}%
+ {{}#1}%
+ }%
+}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\fouriervec}
@@ -7584,7 +7803,7 @@ defaultbf,defaultit,defaultsf,defaulttt}}
% Some public macros to modify our private internals, and
% we will use them also ourself.
%
-% In version |1.1| we add the possibility to have two
+% In version \mstrelease{1.1} we add the possibility to have two
% distinct font shapes for letters and digits. So in fact
% we could as well have two really unrelated fonts but
% this is really not the spirit of the package.
@@ -7594,7 +7813,7 @@ defaultbf,defaultit,defaultsf,defaulttt}}
% same time not modifying the \cs{familydefault} or \cs{romandefault}
% etc\dots
%
-% At time of |1.3za| I considered letting |LGRgreeks| and |selfGreeks|
+% At time of \mstrelease{1.3za} I considered letting |LGRgreeks| and |selfGreeks|
% support \cs{MTgreekfont} and this needed a chaneg to \cs{MTfamily}
% here but I dropped the idea. Too wary of documentation changes.
% \begin{macrocode}
@@ -7622,14 +7841,14 @@ defaultbf,defaultit,defaultsf,defaulttt}}
% \begin{macro}{\MTitGreek}
% \begin{macro}{\MTupGreek}
% \begin{macro}{\MTgreekfont}
-% |1.15c|: These new macros can be used in-between calls to \cs{Mathastext}.
+% \mstrelease{1.15c}: These new macros can be used in-between calls to \cs{Mathastext}.
% They reset the shapes for Greek letters (applies to LGRgreek(s) and
% selfGreek(s) options). The \cs{MTgreekfont} presupposes either LGRgreek or
% selfGreek (it is inoperant under |LGRgreeks| or |selfGreeks|).
% |\MTgreekfont{\familydefault}| is somewhat like using LGRgreeks or
% selfGreeks.
%
-% At time of |1.3za| I let \cs{MTgreekfont} also have an effect under option
+% At time of \mstrelease{1.3za} I let \cs{MTgreekfont} also have an effect under option
% |LGRgreeks| or |selfGreeks|, via a refactoring which also modified \cs{MTfamily}.
% \begin{macrocode}
\newcommand*\MTitgreek{\mst@itgreektrue\mst@upgreekfalse\def\mst@greek@select{0}}
@@ -7648,55 +7867,359 @@ defaultbf,defaultit,defaultsf,defaulttt}}
% \end{macro}
% \end{macro}
% \end{macro}
+%
% At (long...) last we now change the font for the letters of the
-% latin alphabet. In version |1.1|, Latin letters have their own font
+% latin alphabet. In version \mstrelease{1.1}, Latin letters have their own font
% (shape).
%
-% |1.2b| initiated the use of mathematically active letters to insert the italic
-% corrections. With version |1.3| the use of math active letters is also for
-% extra muglue added before and after the letters. Use of |\@for| to shorten the
-% code initiated with release |1.3|.
+% \mstrelease{1.2b} |2012/12/28| now that we understand the great advantages of |"8000|
+% we do it also for all letters a-z and A-Z to insert automatically the
+% italic corrections. See the \hyperref[sec:ic]{discussion} in the user
+% manual. Ironically I wrote the code initially for the |italic| option only
+% to realize later it was more suitable to using an \emph{upright} text font
+% in math mode! So this mathematical activation of the letters is not done if
+% the font shape is detected to be |it| or |sl|; to bypass this the command
+% \cs{MTicinmath} is provided.
+%
+% \mstrelease{1.2e} |2013/01/10| corrects a bad oversight of \mstrelease{1.2b} in
+% \cs{mst@mathactivate} which made the reproduction of the user manual
+% illustrations with |$f_i^i$| impossible. As \cs{mst@mathactivate} was
+% originally used also to get the non-letters obey math alphabet while
+% maintaining the \TeX{} spacings, it added no extra braces. The braces
+% should however be added for expansion of math active letters, in order of
+% things like |x^y| to work as expected. (the group braces do not prevent
+% ligatures when the letters are arguments to the math alphabet commands,
+% the added macros \cs{mst@itcorr} and \cs{mst@before@<letter>} expanding to
+% nothing).
+%
+% Added note |2016/01/06|: it should be explicitly said that the extra
+% |{..}| in |\mst@mathactivate| for letters end up creating |\hbox|'es
+% around each letter with its extra skips and explicit italic correction,
+% when present. These skips are thus set at natural width and do not add
+% any break point.
+%
+% Added note at \mstrelease{1.4}: the extra pair of braces is inserted here
+% at \cs{mst@DeclareMathLetter}, not at \cs{mst@mathactivate}.
+%
+% \mstrelease{1.3} |2013/09/02| extends the use of mathematically active letters to
+% allow the user to specify muglue before and after the letter itself (see
+% \cs{MTsetmathskips}, below).
+% Mathematically active letters were previously used only to add the italic
+% correction; the math activation has now been separated and put in
+% \cs{MTmathactiveletters}. There is also \cs{MTmathactiveLetters} to allow
+% math activation only for the uppercase letters. To cancel the (now default,
+% even with option |italic|) math
+% activation of letters, there is \cs{MTmathstandardletters}. Version \mstrelease{1.3a}
+% removes some silly |\string|'s from the code, which prevented to pass
+% macros as first argument to the command.
+%
+% Added note |2016/01/06|:
+% Notice that the initially |\relax| tokens \verb+\mst@[before|after]@<letter>+
+% formed with |\csname...\endcsname| do not modify TeX's math layout:
+% |{\relax f\relax}| is like |f| (also for ligatures inside |\mathrm| for
+% example).
+%
+% The code here was refactored at \mstrelease{1.4} and this simplified
+% \cs{mst@mathactivate} definition.
+%
+% The \cs{mst@before}\meta{letter} were renamed at \mstrelease{1.4} into
+% \cs{mst@before@}\meta{letter} and are incorporated at the
+% \cs{mst@DeclareMathLetter} location. Formerly \cs{mst@}\meta{letter} was
+% only the math symbol, now \cs{MTmathcharletter}\meta{letter} is used for that and
+% \cs{MTcommandletter}\meta{letter} is the whole thing to which the active letter
+% expands (the definition of the active letter done by \cs{mst@mathactivate}
+% is done with a \cs{def}, not a \cs{let}).
+% \begin{macro}{\mst@DeclareMathLetter}
+%
+% \mstrelease{1.4b} adds |noletters| option.
% \begin{macrocode}
-\def\mst@DeclareMathLetter #1{%
+\ifmst@noletters
+ \let\MTmathactiveletters\@empty
+ \let\MTmathactiveLetters\@empty
+ \let\MTmathstandardletters\@empty
+\else
+\def\mst@DeclareMathLetter#1#2#3#4#5{%
\DeclareMathSymbol {#1}{\mathalpha}{mtletterfont}{`#1}%
- \expandafter
- \DeclareMathSymbol \csname mst@#1\endcsname{\mathalpha}{mtletterfont}{`#1}%
- \expandafter\mst@addtodo@az\expandafter #1\csname mst@#1\endcsname
+ \DeclareMathSymbol {#4}{\mathalpha}{mtletterfont}{`#1}%
+ \def#2{{#3#4#5\mst@itcorr}}%
+}%
+\@tfor\mst@tmp:=abcdefghijklmnopqrstuvwxyz\do{%
+ \expandafter\expandafter\expandafter\mst@DeclareMathLetter
+ \expandafter\mst@tmp
+ \csname MTcommandletter\mst@tmp\expandafter\endcsname
+ \csname mst@before@\mst@tmp\expandafter\endcsname
+ \csname MTmathcharletter\mst@tmp\expandafter\endcsname
+ \csname mst@after@\mst@tmp\endcsname
}%
-\@tfor\mst@tmp:=abcdefghijklmnopqrstuvwxyz\do
- {\expandafter\mst@DeclareMathLetter\mst@tmp}%
\ifmst@frenchmath \def\mst@font@tbu{mtoperatorfont}%
\else \def\mst@font@tbu{mtletterfont}%
\fi
-\def\mst@DeclareMathLetter #1{%
+\def\mst@DeclareMathLetter #1#2#3#4#5{%
\DeclareMathSymbol {#1}{\mathalpha}{\mst@font@tbu}{`#1}%
- \expandafter
- \DeclareMathSymbol \csname mst@#1\endcsname{\mathalpha}{\mst@font@tbu}{`#1}%
- \expandafter\mst@addtodo@AZ\expandafter #1\csname mst@#1\endcsname
+ \DeclareMathSymbol {#4}{\mathalpha}{\mst@font@tbu}{`#1}%
+ \def#2{{#3#4#5\mst@ITcorr}}%
}%
-\@tfor\mst@tmp:=ABCDEFGHIJKLMNOPQRSTUVWXYZ\do
- {\expandafter\mst@DeclareMathLetter\mst@tmp}%
-\let\mst@DeclareMathLetter\relax
+\@tfor\mst@tmp:=ABCDEFGHIJKLMNOPQRSTUVWXYZ\do{%
+ \expandafter\expandafter\expandafter\mst@DeclareMathLetter
+ \expandafter\mst@tmp
+ \csname MTcommandletter\mst@tmp\expandafter\endcsname
+ \csname mst@before@\mst@tmp\expandafter\endcsname
+ \csname MTmathcharletter\mst@tmp\expandafter\endcsname
+ \csname mst@after@\mst@tmp\endcsname
+}%
+\def\mst@mathactivate@lowercase{%
+ \@tfor\mst@tmp:=abcdefghijklmnopqrstuvwxyz\do{%
+ \expandafter\expandafter\expandafter
+ \mst@mathactivate\expandafter\mst@tmp\csname MTcommandletter\mst@tmp\endcsname{}%
+ }%
+}%
+\def\mst@mathactivate@uppercase{%
+ \@tfor\mst@tmp:=ABCDEFGHIJKLMNOPQRSTUVWXYZ\do{%
+ \expandafter\expandafter\expandafter
+ \mst@mathactivate\expandafter\mst@tmp\csname MTcommandletter\mst@tmp\endcsname{}%
+ }%
+}%
+\def\mst@mathdeactivate@lowercase{%
+ \@tfor\mst@tmp:=abcdefghijklmnopqrstuvwxyz\do{%
+ \expandafter\mathcode\expandafter`\mst@tmp=\csname MTmathcharletter\mst@tmp\endcsname
+ }%
+}%
+\def\mst@mathdeactivate@uppercase{%
+ \@tfor\mst@tmp:=ABCDEFGHIJKLMNOPQRSTUVWXYZ\do{%
+ \expandafter\mathcode\expandafter`\mst@tmp=\csname MTmathcharletter\mst@tmp\endcsname
+ }%
+}%
+% \end{macrocode}
+% We redo the definitions with some added layer (silly because will never
+% happen in pratice that a letter is Babel-active) related to
+% \cs{mst@do@activecase} in \ctanpkg{babel} context.
+% \begin{macrocode}
+\ifmst@everymath
+\else
+ \def\mst@mathdeactivate@lowercase{%
+ \@tfor\mst@tmp:=abcdefghijklmnopqrstuvwxyz\do{%
+ \expandafter\mathcode\expandafter`\mst@tmp=
+ \csname MTmathcharletter\mst@tmp\endcsname
+ }%
+ }%
+ \def\mst@mathdeactivate@uppercase{%
+ \@tfor\mst@tmp:=ABCDEFGHIJKLMNOPQRSTUVWXYZ\do{%
+ \expandafter\mathcode\expandafter`\mst@tmp=
+ \csname MTmathcharletter\mst@tmp\endcsname
+ }%
+ }%
+\fi
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\MTmathactiveletters}
+% \begin{macro}{\MTmathstandardletters}
+%
+% Important changes at \mstrelease{1.4}.
+%
+% Ascii letters are math-activated at package loading time, rather than again and
+% again each time math mode is entered. But not under |subdued| mode, then
+% the activation is done as part of switching to some math version.
+%
+% The ordering in this code source is a bit of a mess, and it may be too early
+% here to execute \cs{MTmathactiveletters} (I think it is fine now after some
+% major moving around of code chunks but will not waste time checking
+% it) so this will be postponed to end of package loading. Prior to
+% \mstrelease{1.4} \cs{MTmathactiveletters} could be executed here as it only
+% set some toggle to be obeyed at every math mode entrance.
+% \begin{macrocode}
+\def\mst@mathactivateletters{%
+ \mst@mathactivate@lowercase
+ \mst@mathactivate@uppercase
+}%
+\newcommand*\MTmathactiveletters{%
+ \mst@OnlyIfNotSubdued
+ \mst@mathactivateletters
+}%
+\AtEndOfPackage{\MTmathactiveletters}%
+% \end{macrocode}
+% Duplication due to some legacy reasons, do not rely on these internal
+% macro names, beware they change at future release.
+% \begin{macrocode}
+\def\mst@mathactivateLetters{\mst@activate@uppercase}%
+\newcommand*\MTmathactiveLetters{%
+ \mst@OnlyIfNotSubdued
+ \mst@mathactivateLetters
+}%
+\newcommand*\MTmathstandardletters{%
+ \mst@mathdeactivate@lowercase
+ \mst@mathdeactivate@uppercase
+}%
+\fi
+% \end{macrocode}
+% \end{macro}\end{macro}
+% \begin{macro}{\MTicinmath}
+% \begin{macro}{\MTICinmath}
+% \begin{macro}{\MTnoicinmath}
+% \begin{macro}{\MTicalsoinmathxx}
+% \cs{MTnoicinmath} can also be used from inside math mode.
+%
+% \cs{MTicalsoinmathxx} is destined to be used inside
+% \cs{mathnormalbold} as I didn't want to add the complication of
+% extracting the family number used inside \cs{mathnormalbold} (will
+% perhaps come back if I have time to spend on
+% |source2e|). Added note |2016/01/06|: this number is a priori simply
+% |symmtletterfont+1|.
+%
+% \cs{MTicinmath} can also be used inside math mode, to revert an
+% earlier \cs{MTnoicinmath} from inside the same math group.
+%
+% \mstrelease{1.3i} |2016/01/06|: For some reason which I have now forgotten I did
+% until then:
+% \begin{verbatim}
+% \def\mst@itcorr{\ifnum\fam=\m@ne\/\else\ifnum\fam=\symmtletterfont\/\fi\fi}%
+% \end{verbatim}
+% hence italic corrections were also applied inside \cs{mathnormal} (for
+% upright fonts; \cs{mathnormalbold} math alphabet was not treated like
+% \cs{mathnormal}). I now drop this to be more in sync with the handling
+% of the extra skips around letters. Everything gets suppressed inside
+% all math alphabets, allowing ligatures, even for \cs{mathnormal}.
+%
+% \begin{macrocode}
+\newcommand*\MTicinmath{%
+ \MTmathactiveletters
+ \def\mst@itcorr{\ifnum\fam=\m@ne\/\fi}%
+ \let\mst@ITcorr\mst@itcorr
+}
+\newcommand*\MTICinmath{%
+ \MTmathactiveLetters
+ \def\mst@ITcorr{\ifnum\fam=\m@ne\/\fi}%
+}
+\newcommand*\MTnoicinmath{\let\mst@itcorr\@empty\let\mst@ITcorr\@empty}
+\newcommand*\MTnoICinmath{\let\mst@ITcorr\@empty}
+\newcommand*\MTicalsoinmathxx{%
+ \ifx\mst@itcorr\@empty\else\def\mst@itcorr{\/}\fi
+ \ifx\mst@ITcorr\@empty\else\def\mst@ITcorr{\/}\fi
+}
+% \end{macrocode}
+% \end{macro}\end{macro}\end{macro}\end{macro}
+% \begin{macro}{\MTsetmathskips}
+% \begin{macro}{\MTunsetmathskips}
+% \mstrelease{1.3} |2013/09/02|: user level command to specify extra spaces in math mode
+% around the letters (only the 7bit a,b,..,z and A,B,..,Z). First parameter is
+% the letter, second is the math skip to be inserted before, and third the
+% skip to be inserted after; for example \cs{thickmuskip} or explicitly
+% |0.1mu|.
+%
+% For this, letters are made mathematically active. This is now the package
+% default (version \mstrelease{1.2} did this only in the absence of option |italic|, or
+% more precisely when the font used was not of shape |it| or |sl|). But if
+% \cs{MTsetmathskips} has not been used for that letter, the only effect of
+% the math activation is, as in \mstrelease{1.2}, to add the italic correction
+% automatically, except when the font shape is detected to be |it| or |sl|; in
+% these latter cases, although mathematically active, the letter acts in the
+% standard way.
+%
+% The command \cs{MTmathstandardletters} turns off math activation and its
+% effects for all letters.
+%
+% Ligatures within the argument of a math alphabet command are impeached by
+% skips; so \cs{MTunsetmathskips} is provided to cancel the skips for one
+% specific letter (|f| for example).
+%
+% \mstrelease{1.3a} |2013/09/04|: I strangely had |\string#1| inside \cs{MTsetmathskips}.
+% Phobic of catcode active letters... but with |\string| one needs some
+% |\expandafter| to use \cs{MTsetmathskips} in an |\@for| loop for example. It
+% is better to allow the first argument to be a macro or anything expanding to
+% a letter, and to not be paranoid about improbable catcode active letters
+% (the user just has to tame them at the time of the \cs{MTsetmathskip}) so I
+% take out these |\string|'s.
+%
+% \mstrelease{1.3i} |2016/01/06|: the extra skips are suppressed for the arguments of
+% math alphabet commands. This applies in particular for amsmath's
+% \cs{DeclareMathOperator}.
+%
+% \begin{macrocode}
+\newcommand*\MTsetmathskips[3]{%
+ \@namedef{mst@before@#1}{\ifnum\fam=\m@ne\mskip#2\relax\fi}%
+ \@namedef{mst@after@#1}{\ifnum\fam=\m@ne\mskip#3\relax\fi}%
+}
+\newcommand*\MTunsetmathskips[1]{%
+ \@namedef{mst@before@#1}{}%
+ \@namedef{mst@after@#1}{}%
+}
+% \end{macrocode}
+% \end{macro}\end{macro}
+% \begin{macro}{\mst@DeclareMathDigit}
+% \begin{macro}{\MTmathactivedigits}
+% \begin{macro}{\MTmathstandarddigits}
+% In version \mstrelease{1.1}, we have now separated digits from letters, so paradoxically
+% it is less problematic to give them the |mathalpha| type.
+%
+% \mstrelease{1.4} had defined some no-op \cs{MTmathstandarddigits} and
+% \cs{MTmathactivedigits} but if not under option |nodigits|. As they are
+% used in \cs{MTeverymathoff} and \cs{MTeverymathdefault} though this broke
+% the option |nodigits| (either with |subdued| or when using \cs{MTversion}).
+%
+% Defining them as \cs{empty} so that \LaTeX{} defensive mechanism with
+% \cs{newcommand} works but this is sooooooo hypothetical context!
+% \begin{macrocode}
+\let\MTmathactivedigits\empty
+\let\MTmathstandarddigits\empty
\ifmst@nodigits\else
-\def\mst@font@tbu{mtoperatorfont}%
+ \def\mst@font@tbu{mtoperatorfont}%
+ \ifmst@symboldigits \def\mst@font@tbu{mtpsymbol}\fi
+ \ifmst@eulerdigits \def\mst@font@tbu{mteulervm}\fi
+ \DeclareMathSymbol{0}{\mathalpha}{\mst@font@tbu}{`0}%
+ \DeclareMathSymbol{1}{\mathalpha}{\mst@font@tbu}{`1}%
+ \DeclareMathSymbol{2}{\mathalpha}{\mst@font@tbu}{`2}%
+ \DeclareMathSymbol{3}{\mathalpha}{\mst@font@tbu}{`3}%
+ \DeclareMathSymbol{4}{\mathalpha}{\mst@font@tbu}{`4}%
+ \DeclareMathSymbol{5}{\mathalpha}{\mst@font@tbu}{`5}%
+ \DeclareMathSymbol{6}{\mathalpha}{\mst@font@tbu}{`6}%
+ \DeclareMathSymbol{7}{\mathalpha}{\mst@font@tbu}{`7}%
+ \DeclareMathSymbol{8}{\mathalpha}{\mst@font@tbu}{`8}%
+ \DeclareMathSymbol{9}{\mathalpha}{\mst@font@tbu}{`9}%
% \end{macrocode}
-% In version |1.1|, we have now separated digits from letters, so paradoxically
-% it is less problematic to give them the |mathalpha| type.
-% \begin{macrocode}
-\ifmst@symboldigits \def\mst@font@tbu{mtpsymbol} \fi
-\ifmst@eulerdigits \def\mst@font@tbu{mteulervm} \fi
-\DeclareMathSymbol{0}{\mathalpha}{\mst@font@tbu}{`0}%
-\DeclareMathSymbol{1}{\mathalpha}{\mst@font@tbu}{`1}%
-\DeclareMathSymbol{2}{\mathalpha}{\mst@font@tbu}{`2}%
-\DeclareMathSymbol{3}{\mathalpha}{\mst@font@tbu}{`3}%
-\DeclareMathSymbol{4}{\mathalpha}{\mst@font@tbu}{`4}%
-\DeclareMathSymbol{5}{\mathalpha}{\mst@font@tbu}{`5}%
-\DeclareMathSymbol{6}{\mathalpha}{\mst@font@tbu}{`6}%
-\DeclareMathSymbol{7}{\mathalpha}{\mst@font@tbu}{`7}%
-\DeclareMathSymbol{8}{\mathalpha}{\mst@font@tbu}{`8}%
-\DeclareMathSymbol{9}{\mathalpha}{\mst@font@tbu}{`9}%
+% \mstrelease{1.4} adds possibility of mathematically active digits.
+% \begin{macrocode}
+ \ifmst@activedigits
+ \def\mst@DeclareMathDigit #1#2#3{%
+ \DeclareMathSymbol{#3}{\mathalpha}{\mst@font@tbu}{`#1}%
+ \def#2{#3}%
+ }%
+ \@tfor\mst@tmp:=0123456789\do{%
+ \expandafter\expandafter\expandafter\mst@DeclareMathDigit
+ \expandafter\mst@tmp
+ \csname MTcommanddigit\romannumeral\mst@tmp\expandafter\endcsname
+ \csname MTmathchardigit\romannumeral\mst@tmp\endcsname
+ }%
+ \def\mst@mathactivatedigits{%
+ \@tfor\mst@tmp:=0123456789\do{%
+ \expandafter\expandafter\expandafter\mst@mathactivate
+ \expandafter\mst@tmp\csname MTcommanddigit\romannumeral\mst@tmp\endcsname{}%
+ }%
+ }%
+ \def\MTmathactivedigits{\mst@OnlyIfNotSubdued\mst@mathactivatedigits}%
+ \MTmathactivedigits
+ \ifmst@everymath
+ \def\MTmathstandarddigits{%
+ \@tfor\mst@tmp:=0123456789\do{%
+ \expandafter\mathcode\expandafter`\mst@tmp
+ =\csname MTmathchardigit\romannumeral\mst@tmp\endcsname
+ }%
+ }%
+ \else
+% \end{macrocode}
+% We inject some extra layer (silly because will never happen in pratice
+% that a digit token is Babel-active) related to \cs{mst@do@activecase} in
+% \ctanpkg{babel} context.
+% \begin{macrocode}
+ \def\MTmathstandarddigits{%
+ \@tfor\mst@tmp:=0123456789\do{%
+ \expandafter\mathcode\expandafter`\mst@tmp
+ =\csname MTmathchardigit\romannumeral\mst@tmp\endcsname
+ }%
+ }%
+ \fi
+ \fi
\fi
% \end{macrocode}
+% \end{macro}\end{macro}\end{macro}
% When |symboldelimiters| is passed as an option, we use the
% Symbol font for the printable characters other than
% letters and digits.
@@ -7709,7 +8232,7 @@ defaultbf,defaultit,defaultsf,defaulttt}}
\def\mst@font@tbu{mtoperatorfont}%
\fi
% \end{macrocode}
-% |1.2| adds the tricks to let non letters/digits obey math alphabets. We have
+% \mstrelease{1.2} adds the tricks to let non letters/digits obey math alphabets. We have
% to double the definitions for easy switch on-off of the mechanism, via a token
% list which is put into \cs{everymath} and \cs{everydisplay}.
% \begin{macrocode}
@@ -7727,7 +8250,7 @@ defaultbf,defaultit,defaultsf,defaulttt}}
% \begin{macro}{\mst@@doasterisk}
% \begin{macro}{\MTnormalasterisk}
% \begin{macro}{\MTactiveasterisk}
-% |1.12d| The \cs{ast} or |*| is defined in |fontmath.ltx| as a binary
+% \mstrelease{1.12d} The \cs{ast} or |*| is defined in |fontmath.ltx| as a binary
% operator from the |symbols| font. Usually the asterisk from the text
% font is in a raised position. Previous versions of \mst did nothing
% with \cs{ast} but strangely defined |*| to be the one from the text
@@ -7740,61 +8263,100 @@ defaultbf,defaultit,defaultsf,defaulttt}}
% The user macro \cs{MTlowerast} sets the amount
% of lowering to be applied to the text asterisk.
%
-% |1.12e| Somehow there was a big omission in |1.12d|, the
+% \mstrelease{1.12e} Somehow there was a big omission in \mstrelease{1.12d}, the
% command \cs{MTlowerast} as described in the manual was missing!
%
-% nota bene: it is assumed that |*| is of type |other| when \mst
-% is loaded... it should neither be active, nor of type |letter|!
+% \mstrelease{1.3i} adds \cs{MTnormalasterisk} and \cs{MTactiveasterisk}.
+% They do nothing if package is loaded without option |asterisk|.
+%
+% \mstrelease{1.4} uses \cs{protected} rather than robust commands.
+% And implements the support for the new default of not using \cs{everymath}.
%
-% |1.3i| adds \cs{MTnormalasterisk} and \cs{MTactiveasterisk}. They do nothing
-% without option |asterisk|.
+% The first two \cs{newcommand*} are because the commands were previously
+% defined unconditionally anyhow, in a way making them no-op's without
+% option |asterisk|. Finally using \cs{let} here with \cs{empty} with
+% the idea of less impact on \TeX{} internals, but losing \LaTeX{} check.
% \begin{macrocode}
-\def\mst@@doasterisk{\let\ast\mst@ast\mst@mathactivate*{}\mst@ast}%
-\newcommand*\MTnormalasterisk {\let\mst@doasterisk\relax}
-\newcommand*\MTactiveasterisk {\let\mst@doasterisk\mst@@doasterisk}
+\let\MTnormalasterisk\empty
+\let\MTactiveasterisk\empty
\ifmst@asterisk\mst@infoline{asterisk: \string\ast\space and *}
- \AtBeginDocument{%
- \everymath\expandafter
- {\the\everymath \mst@doasterisk \MTnormalasterisk }%
- \everydisplay\expandafter
- {\the\everydisplay\mst@doasterisk \MTnormalasterisk }}
\ifmst@symbolmisc
- \def\mst@bin@ast{%
- \mathbin{\mathchoice{\raisebox{-.1\height}%
- {\the\textfont\symmtpsymbol\char42}}%
- {\raisebox{-.1\height}%
- {\the\textfont\symmtpsymbol\char42}}%
- {\raisebox{-.1\height}%
- {\the\scriptfont\symmtpsymbol\char42}}%
- {\raisebox{-.1\height}%
- {\the\scriptscriptfont\symmtpsymbol\char42}}}}%
+ \protected\def\mst@bin@ast{\mathbin{\mathchoice
+ {\raisebox{-.1\height}{\the\textfont\symmtpsymbol\char42}}%
+ {\raisebox{-.1\height}{\the\textfont\symmtpsymbol\char42}}%
+ {\raisebox{-.1\height}{\the\scriptfont\symmtpsymbol\char42}}%
+ {\raisebox{-.1\height}{\the\scriptscriptfont\symmtpsymbol\char42}}}%
+ }%
\else
- \def\mst@bin@ast{%
- \mathbin{\mathchoice{\raisebox{-\mst@lowerast}%
- {\the\textfont\symmtoperatorfont\char42}}%
- {\raisebox{-\mst@lowerast}%
- {\the\textfont\symmtoperatorfont\char42}}%
- {\raisebox{-\mst@lowerast}%
- {\the\scriptfont\symmtoperatorfont\char42}}%
- {\raisebox{-\mst@lowerast}%
- {\the\scriptscriptfont\symmtoperatorfont\char42}}}}%
+ \protected\def\mst@bin@ast{\mathbin{\mathchoice
+ {\raisebox{-\mst@lowerast}{\the\textfont\symmtoperatorfont\char42}}%
+ {\raisebox{-\mst@lowerast}{\the\textfont\symmtoperatorfont\char42}}%
+ {\raisebox{-\mst@lowerast}{\the\scriptfont\symmtoperatorfont\char42}}%
+ {\raisebox{-\mst@lowerast}{\the\scriptscriptfont\symmtoperatorfont\char42}}}%
+ }%
\fi
- \def\mst@varfam@ast{\ifnum\fam=\m@ne\mst@bin@ast\else
- \mathbin{\mathchoice{\raisebox{-\mst@lowerast}%
- {\the\textfont\fam\char42}}%
- {\raisebox{-\mst@lowerast}%
- {\the\textfont\fam\char42}}%
- {\raisebox{-\mst@lowerast}%
- {\the\scriptfont\fam\char42}}%
- {\raisebox{-\mst@lowerast}%
- {\the\scriptscriptfont\fam\char42}}}\fi}%
- \MTactiveasterisk
- \DeclareRobustCommand*{\mst@ast}{\mst@bin@ast}
+ \protected\def\mst@varfam@ast{\ifnum\fam=\m@ne
+ \mst@bin@ast
+ \else
+ \mathbin{\mathchoice
+ {\raisebox{-\mst@lowerast}{\the\textfont\fam\char42}}%
+ {\raisebox{-\mst@lowerast}{\the\textfont\fam\char42}}%
+ {\raisebox{-\mst@lowerast}{\the\scriptfont\fam\char42}}%
+ {\raisebox{-\mst@lowerast}{\the\scriptscriptfont\fam\char42}}}%
+ \fi}%
+ \let\mst@ast\mst@bin@ast
\newcommand*\MTlowerast[1]{\def\mst@lowerast{#1}}
\MTlowerast{.3\height}
- \mst@do@easynonletters\expandafter\expandafter\expandafter
- {\expandafter\the\expandafter\mst@do@easynonletters
- \expandafter\def\csname mst@ast \endcsname{\mst@varfam@ast}}
+% \end{macrocode}
+% Arguably \mst should have used the ``hard'' non-letters affiliation here.
+% Probably too late to change this in 2024... and costly in documentation
+% time.
+% \begin{macrocode}
+ \mst@do@easynonletters\expandafter{%
+ \the\mst@do@easynonletters\let\mst@ast\mst@varfam@ast
+ }%
+ \ifmst@everymath
+ \def\mst@@doasterisk {\let\ast\mst@ast\mst@mathactivate*{}\mst@ast}%
+ \def\MTnormalasterisk {\let\mst@doasterisk\relax}
+ \def\MTactiveasterisk {\let\mst@doasterisk\mst@@doasterisk}
+ \MTactiveasterisk
+ \AtBeginDocument{%
+ \everymath\expandafter
+ {\the\everymath \mst@doasterisk \MTnormalasterisk }%
+ \everydisplay\expandafter
+ {\the\everydisplay\mst@doasterisk \MTnormalasterisk }%
+ }%
+ \else
+ \def\MTnormalasterisk{\AtBeginDocument{\MTnormalasterisk}}
+ \def\MTactiveasterisk{\AtBeginDocument{\MTactiveasterisk}}
+% \end{macrocode}
+% For legacy reasons the responsiveness to math alphabets is made part of the
+% handling of ``easy'' non letters (probably because it is on per default),
+% and this causes me problems of internal logic and even more annoyingly of
+% documentation. I am leaving this standing because it would be too much of a
+% pain at this stage to document a change and it was already quite annoying to
+% better document actual situation.
+% \begin{macrocode}
+ \mst@undo@easynonletters\expandafter{%
+ \the\mst@do@easynonletters\let\mst@ast\mst@bin@ast
+ }%
+% \end{macrocode}
+% For legacy reasons the action of \cs{MTactiveasterisk} is not testing if
+% in |subdued| mode.
+%
+% MEMO: if |subdued| there is \cs{MTeverymathoff} added to |\begin{document}|
+% near end of package and it will do \cs{MTnormalasterisk}.
+% \begin{macrocode}
+ \AtBeginDocument{%
+ \let\mst@orig@abd@ast\ast
+ \edef\MTnormalasterisk{\noexpand\mst@mathdeactivate*{\the\mathcode`\*}%
+ \let\noexpand\ast\noexpand\mst@orig@abd@ast}%
+ \def\MTactiveasterisk{\def\ast{\mst@ast}%
+ \mst@mathactivate*{}\mst@ast
+ }%
+ \MTactiveasterisk
+ }
+ \fi
\fi
% \end{macrocode}
% \end{macro}\end{macro}\end{macro}\end{macro}\end{macro}
@@ -7807,17 +8369,19 @@ defaultbf,defaultit,defaultsf,defaulttt}}
%
% [(Dec. 2012) should I reexamine these definitive sounding remarks?]
%
-% |1.3x| of |2022/11/03| adds support for |ncccomma| option.
+% \begin{macro}{ncccomma}
+% \begin{macro}{decimalcomma}
+% \mstrelease{1.3y} of |2022/11/03| adds support for |ncccomma| option.
%
% Some non-obvious hack is needed for compatibility with our home-made
% mechanism of non-letters obeying math alphabet commands. Alternative would
-% have been to not load at all \ctanpkg{ncccomma} (or since |1.3zb|
+% have been to not load at all \ctanpkg{ncccomma} (or since \mstrelease{1.3zb}
% \ctanpkg{decimalcomma}) and provide the functionality purely by our own
% means; because here in order to support \cs{MTnonlettersobeymathxx} we are
% almost contrived to override quasi entirely the contents of these tiny
% packages.
%
-% |1.3zb| adds support for the |decimalcomma| option. This was mandatory to
+% \mstrelease{1.3zb} adds support for the |decimalcomma| option. This was mandatory to
% keep a compatibility layer with \ctanpkg{frenchmath} after its |2.7| release
% of |2023/12/23|.
%
@@ -7838,7 +8402,7 @@ defaultbf,defaultit,defaultsf,defaulttt}}
\RequirePackage{decimalcomma}[2023/12/28]% 1.3 or later
% \end{macrocode}
% Attention
-% that the breaking behavior of \cs{AtBeginDocument} at October 2020
+% that the \textbf{BREAKING CHANGE} to \cs{AtBeginDocument} at October 2020
% \LaTeX{} release means that, \emph{taking into account that \emph{\mst} already has
% employed some \emph{\cs{AtBeginDocument}} prior to loading} \ctanpkg{decimalcomma}, any
% code here will be executed \textbf{BEFORE} the \cs{AtBeginDocument} material
@@ -7855,7 +8419,7 @@ defaultbf,defaultit,defaultsf,defaulttt}}
% latter for which \ctanpkg{babel-french} has a dectection mechanism, which as
% a result avoids the bad interactions with \ctanpkg{numprint} plus its
% |autolanguage| option, which are mentioned below in the \ctanpkg{ncccomma}
-% branch. So we don't need here the workaround done below is in the
+% branch. So we don't need here the workaround done below in the
% |ncccomma| branch. Notice though that in both cases, the `intelligent'
% comma feature will be applied to the whole document, even inside those
% portions where the user has switched to another language such as English.
@@ -7884,19 +8448,26 @@ defaultbf,defaultit,defaultsf,defaulttt}}
\let\mathcomma\mst@varfam@comma
\let\sm@rtcomma\mst@sm@rtcomma
}
- \else % end of decimalcomma branch
- \ifmst@ncccomma
- \mst@infoline{loading package ncccomma for `smart comma\string'}
- \RequirePackage{ncccomma}%
+ \ifmst@everymath
+ \else
+ \edef\mst@tmp{\mathchardef\mathcomma=\the\mathcode`\,\relax}%
+ \mst@undo@nonletters\expandafter\expandafter\expandafter
+ {\expandafter\mst@tmp\the\mst@undo@nonletters}%
+ \fi
+ \else
% \end{macrocode}
% Work around some bad interaction of \ctanpkg{ncccomma}, \ctanpkg{numprint}
% with |autolanguage| and \ctanpkg{babel-french}. See
% \centeredline{\url{https://github.com/latex3/babel/issues/190}} for
-% background. Some hesitation whether I should use the \cs{noextrasfrench}
-% to work around \ctanpkg{babel-french} code influencing non-French sections
-% in the document. Update: I think the last sentence means I was hesitating
-% at time of |1.3x| whether to insert some extra code inside the \cs{noextrasfrench}.
+% background. Some hesitation whether I should use the \cs{noextrasfrench} to
+% work around \ctanpkg{babel-french} code influencing non-French sections in
+% the document. Update: I think the last sentence means I was hesitating at
+% time of \mstrelease{1.3y} whether to insert some extra code inside the
+% \cs{noextrasfrench}.
% \begin{macrocode}
+ \ifmst@ncccomma
+ \mst@infoline{loading package ncccomma for `smart comma\string'}
+ \RequirePackage{ncccomma}%
\AtBeginDocument{%
\mathcode`\,="8000\relax
\@ifpackageloaded{babel}{%
@@ -7918,34 +8489,77 @@ defaultbf,defaultit,defaultsf,defaulttt}}
\let\mathcomma\mst@varfam@comma
\let\NCC@comma\mst@NCC@comma
}
- \else % neither ncccomma nor decimalcomma
+ \ifmst@everymath
+ \else
+% \end{macrocode}
+% Attention that \ctanpkg{ncccomma} (contrarily to \ctanpkg{icomma} loaded by
+% \ctanpkg{decimalcomma} has made the comma math active already when we loaded it.
+% So we don't use |\the\mathcode`\,\relax| here.
+% \begin{macrocode}
+ \edef\mst@tmp{\mathchardef\mathcomma=\the\mathcomma\relax}%
+ \mst@undo@nonletters\expandafter\expandafter\expandafter
+ {\expandafter\mst@tmp\the\mst@undo@nonletters}%
+ \fi
+ \else
+% \end{macrocode}
+% Neither option |ncccomma| nor |decimalcomma|. The \mstrelease{1.4} non-use
+% of \cs{everymath} and consequences is accounted for automatically by
+% \cs{mst@addtodo@nonletters}.
+% \begin{macrocode}
\expandafter\mst@addtodo@nonletters\string,\mathpunct\mst@varfam@comma
\fi\fi
+% \end{macrocode}
+% math dot.
+% \begin{macrocode}
\DeclareMathSymbol{.}{\mathord}{\mst@font@tbu}{"2E}
\DeclareMathSymbol{\mst@varfam@dot}{\mathalpha}{\mst@font@tbu}{"2E}
\mst@addtodo@easynonletters\.\mst@varfam@dot
- \DeclareMathSymbol{:}{\mathrel}{\mst@font@tbu}{"3A} % relation spacing
+% \end{macrocode}
+% math colon.
+% \begin{macrocode}
+ \DeclareMathSymbol{:}{\mathrel}{\mst@font@tbu}{"3A}
\DeclareMathSymbol{\mst@varfam@colon}{\mathalpha}{\mst@font@tbu}{"3A}
\expandafter\mst@addtodo@nonletters\string:\mathrel\mst@varfam@colon
\@ifpackageloaded{amsmath}
- {} % \colon defined in amsmath.sty in terms of : with some enlarged explicit
- % spacing. No need to intervene.
- {% no amsmath, use standard punctuation spacing
+% \end{macrocode}
+% \cs{colon} gets defined in \ctanpkg{amsmath} in terms of |:| with some enlarged explicit
+% spacing. No need to intervene.
+% \begin{macrocode}
+ {}
+% \end{macrocode}
+% No \ctanpkg{amsmath}, use standard punctuation spacing.
+%
+% The reason for |\et\colon\undefined| is if some package has redefined
+% \cs{colon} which then can not be used in \cs{DeclareMathSymbol} anymore (we
+% shamelessly overwrite...)
+% \begin{macrocode}
+ {%
\let\colon\undefined
- % the reason is if some package has redefined \colon which then
- % can not be used in \cs{DeclareMathSymbol} anymore (we
- % shamelessly overwrite...)
\DeclareMathSymbol{\colon}{\mathpunct}{\mst@font@tbu}{"3A}
- \mst@do@nonletters\expandafter{\the\mst@do@nonletters
+ \let\mst@colon\colon
+% \end{macrocode}
+% \mstrelease{1.3v} uses \cs{protected} for the (optional) \cs{colon} redefinition.
+% \begin{macrocode}
+ \mst@do@nonletters\expandafter{%
+ \the\mst@do@nonletters
+ \protected\def\colon{\mathpunct{\mst@varfam@colon}}%
+ }%
% \end{macrocode}
-% |1.3v| uses \cs{protected} for the (optional) \cs{colon} redefinition.
+% \mstrelease{1.4} needs extras.
% \begin{macrocode}
- \protected\def\colon{\mathpunct{\mst@varfam@colon}}}%
+ \ifmst@everymath
+ \else
+ \mst@undo@nonletters\expandafter{%
+ \the\mst@undo@nonletters
+ \let\colon\mst@colon
+ }%
+ \fi
}
- \DeclareMathSymbol{\mst@varfam@pointvirgule}{\mathalpha}{\mst@font@tbu}{"3B}
% \end{macrocode}
-% |1.3x| adds |binarysemicolon| option.
+% Semi-colon.
+% \mstrelease{1.3y} adds |binarysemicolon| option.
% \begin{macrocode}
+ \DeclareMathSymbol{\mst@varfam@pointvirgule}{\mathalpha}{\mst@font@tbu}{"3B}
\ifmst@binarysemicolon
\mst@infoline{semi-colon set to be of type \string\mathbin}
\DeclareMathSymbol{;}{\mathbin}{\mst@font@tbu}{"3B}
@@ -7953,21 +8567,22 @@ defaultbf,defaultit,defaultsf,defaulttt}}
\else
\DeclareMathSymbol{;}{\mathpunct}{\mst@font@tbu}{"3B}
\expandafter\mst@addtodo@nonletters\string;\mathpunct\mst@varfam@pointvirgule
- \fi % binarysemicolno
-\fi % end \ifmst@nopunct else branch
+ \fi
+\fi
% \end{macrocode}
+% \end{macro}\end{macro}
% \begin{macro}{\relbar}
% Due to the way = and - are used by \LaTeX{} in arrows, we will
% have to redefine \cs{Relbar} and \cs{relbar} in order for
% them to preserve their original meanings.
%
-% |1.15d|: Oct 13, 2012. Belated amendment of the code to be compatible
+% \mstrelease{1.15d}: Oct 13, 2012. Belated amendment of the code to be compatible
% with Unicode engines in case someone changed the mathcode of -.
% However, for the time being I can do it in an easy way only for
% \XeTeX, not for \LuaLaTeX. Also I do my modifications to \cs{relbar}
% in a manner testing for the presence of amsmath.
%
-% |1.3v 2019/09/19|: \LaTeX{} of |2019-10-01| defines \cs{leftarrowfill}
+% \mstrelease{1.3v} |2019/09/19|: \LaTeX{} of |2019-10-01| defines \cs{leftarrowfill}
% and \cs{rightarrowfill} as robust macros, so we do the same.
%
% I need to put amsmath under surveillance to check if it decides to
@@ -7981,49 +8596,48 @@ defaultbf,defaultit,defaultsf,defaulttt}}
\else
\ifmst@XeOrLua
\mst@Umathcharnumdef\mst@minus@sign=\mst@Umathcodenum`\-\relax
-%^^A I used this prior to the new \luatexUmathcodenum, as available since TL2013:
-%^^A \mathchardef\mst@minus@sign=8704\relax % "2200
+% \end{macrocode}
+% I used this prior to the new \cs{luatexUmathcodenum}, as available since TL2013:
+% \centeredline{|\mathchardef\mst@minus@sign=8704\relax % "2200|}
+%^^A L'alignement est bizarre dans l'output.
+% \begin{macrocode}
\else
\mathchardef\mst@minus@sign=\mathcode`\-\relax
\fi
\@ifpackageloaded{amsmath}
{\def\relbar{\mathrel{\mathpalette\mathsm@sh\mst@minus@sign}}}
{\DeclareRobustCommand\relbar{\mathrel{\smash\mst@minus@sign}}}
- \ifmst@robust@obsessed@LaTeX@era\expandafter\DeclareRobustCommand
- \else\expandafter\def\fi
- \rightarrowfill{$\m@th\mathord{\relbar}\mkern-7mu%
+ \DeclareRobustCommand\rightarrowfill{$\m@th\mathord{\relbar}\mkern-7mu%
\cleaders\hbox{$\mkern-2mu\relbar\mkern-2mu$}\hfill
\mkern-7mu\mathord\rightarrow$}
- \ifmst@robust@obsessed@LaTeX@era\expandafter\DeclareRobustCommand
- \else\expandafter\def\fi
- \leftarrowfill{$\m@th\mathord\leftarrow\mkern-7mu%
+ \DeclareRobustCommand\leftarrowfill{$\m@th\mathord\leftarrow\mkern-7mu%
\cleaders\hbox{$\mkern-2mu\relbar\mkern-2mu$}\hfill
\mkern-7mu\mathord{\relbar}$}
\fi
% \end{macrocode}
% \end{macro}
% \begin{macro}{endash}
-% |1.1| |2011/01/29|: Producing this next piece of code was not a piece
+% \mstrelease{1.1} |2011/01/29|: Producing this next piece of code was not a piece
% of cake for a novice like myself!\newline
-% |1.11| |2011/02/05|: Compatibility with Unicode (via use of fontspec
+% \mstrelease{1.11} |2011/02/05|: Compatibility with Unicode (via use of fontspec
% encodings EU1 and EU2)\newline
-% |1.12| |2011/02/07|: Improved dealing of Unicode possibility.\newline
-% |1.14b| |2011/04/02|: Corrected some very irresponsible bug in the
+% \mstrelease{1.12} |2011/02/07|: Improved dealing of Unicode possibility.\newline
+% \mstrelease{1.14b} |2011/04/02|: Corrected some very irresponsible bug in the
% Unicode part which caused a problem when 10 or more math families have
% been allocated.\newline
-% |1.15| |2012/09/24|: Added AtBeginDocument to circumvent some amsmath
+% \mstrelease{1.15} |2012/09/24|: Added AtBeginDocument to circumvent some amsmath
% problem with unicode engines.
%
-% |1.3l| |2016/01/29|: anticipating TL2016 fontspec's switch to |TU|.
+% \mstrelease{1.3l} |2016/01/29|: anticipating TL2016 fontspec's switch to |TU|.
%
-% |1.3t| |2018/08/22|: fix to very ancient (|2012/12/20|) bug with
+% \mstrelease{1.3t} |2018/08/22|: fix to very ancient (|2012/12/20|) bug with
% |\DeclareMathSymbol| lacking last argument if encoding not T1, OT1 or
% LY1 when setting up math mode to use the en-dash character as minus
% sign (PDF\TeX\ engine).
%
% \begin{macro}{\mst@subduedminus}
% \begin{macro}{\mst@nonsubduedminus}
-% |1.3t| Further, new macros |\mst@subduedminus| and |\mst@nonsubduedminus|,
+% \mstrelease{1.3t} Further, new macros |\mst@subduedminus| and |\mst@nonsubduedminus|,
% for the good functioning of the subdued option also in case of
% presence of fontspec. This is the only character for which subdued
% option works (now) by setting the mathcode on each math version
@@ -8034,7 +8648,7 @@ defaultbf,defaultit,defaultsf,defaulttt}}
% change. This means also that |\MTversion| and not |\mathversion|
% must be used for good functioning.
%
-% |1.3u| improves the handling of the minus sign by letting it be compatible
+% \mstrelease{1.3u} improves the handling of the minus sign by letting it be compatible
% with math versions (and not only with the with subdued mechanism but all
% math versions) having varying font encodings, even possibly classic 8bit
% font encoding mixed with TU encoding for Unicode engines. For this it is
@@ -8047,9 +8661,9 @@ defaultbf,defaultit,defaultsf,defaulttt}}
% This is counter-intuitive and breaks expectations.
% \end{quotation}
%
-% But the |1.3u| mechanism with \cs{mst@UmathchardefWorkAround@i} introduced a
+% But the \mstrelease{1.3u} mechanism with \cs{mst@UmathchardefWorkAround@i} introduced a
% bug which showed under option |noendash| (hence also |symboldelimiters|) with
-% Unicode engines. Fixed at |1.3w|.
+% Unicode engines. Fixed at \mstrelease{1.3w}.
% \begin{macrocode}
\let\mst@subduedminus\empty
\let\mst@nonsubduedminus\empty
@@ -8063,7 +8677,8 @@ defaultbf,defaultit,defaultsf,defaulttt}}
{\csname\mst@tmp@enc\string\textendash\endcsname}
\DeclareMathSymbol{#2}{\mathalpha}{mtoperatorfont}
{\csname\mst@tmp@enc\string\textendash\endcsname}
- \fi}% mst@dothe@endashstuff
+ \fi
+}%
\def\mst@dothe@emdashstuff#1#2#3{%
\edef\mst@tmp@enc{#3}%
\if1\mst@OneifUniEnc
@@ -8074,7 +8689,8 @@ defaultbf,defaultit,defaultsf,defaulttt}}
{\csname\mst@tmp@enc\string\textemdash\endcsname}
\DeclareMathSymbol{#2}{\mathalpha}{mtoperatorfont}
{\csname\mst@tmp@enc\string\textemdash\endcsname}
- \fi}% mst@dothe@emdashstuff
+ \fi
+}%
\def\mst@dothe@hyphenstuff#1#2{%
\DeclareMathSymbol{#1}{\mathbin}{\mst@font@tbu}{"2D}%
\DeclareMathSymbol{#2}{\mathalpha}{\mst@font@tbu}{"2D}%
@@ -8090,9 +8706,9 @@ defaultbf,defaultit,defaultsf,defaulttt}}
\csname mst@minus@mv\math@version\endcsname
\relax
\else
- \mathcode`\-=\@nameuse{mst@minus@mv\math@version}% self-delimiting
+ \mathcode`\-=\@nameuse{mst@minus@mv\math@version}%
\fi
- }% \mst@nonsubduedminus
+ }%
% \end{macrocode}
% The above works only if the \cs{mst@minus@mv<name>} was really
% defined via \cs{Umathchardef}. If it was defined via \cs{DeclareMathSymbol}
@@ -8101,8 +8717,8 @@ defaultbf,defaultit,defaultsf,defaulttt}}
% \begin{macrocode}
\ifmst@endash\else\ifmst@emdash\else
\def\mst@nonsubduedminus{%
- \mathcode`\-=\@nameuse{mst@minus@mv\math@version}% self-delimiting
- }% non Umathchardef \mst@minus@mv<mathversion> macros
+ \mathcode`\-=\@nameuse{mst@minus@mv\math@version}%
+ }%
\fi\fi
\fi
\def\mst@UmathchardefWorkAround@i
@@ -8112,7 +8728,7 @@ defaultbf,defaultit,defaultsf,defaulttt}}
% \end{macro}\end{macro}\end{macro}
% \begin{macro}{\mst@hbar@mvnormal}
% \begin{macro}{\mst@ltbar@mvnormal}
-% |2011/01/31|, |1.1| I decide to settle the question of the |\hbar|. The
+% |2011/01/31|, \mstrelease{1.1} I decide to settle the question of the |\hbar|. The
% \LaTeX{} definition is |\def\hbar{{\mathchar'26\mkern-9muh}}|
% and its advantage is that |h| is in the correct font. But of course not
% the macron character (|\=|, |\bar|). And anyway |amsfonts| uses a
@@ -8125,26 +8741,26 @@ defaultbf,defaultit,defaultsf,defaulttt}}
% (as an aside, I am only now (April 2, 2011) aware that the package
% |mathtools| provides the |mathrlap| etc... )
%
-% |1.3l 2016/01/29|: anticipating TL2016 fontspec's switch to |TU|.
+% \mstrelease{1.3l} |2016/01/29|: anticipating TL2016 fontspec's switch to |TU|.
%
-% |1.3u 2019/08/20|: encoding (8bits) agnostic construct for hbar, using same
+% \mstrelease{1.3u} |2019/08/20|: encoding (8bits) agnostic construct for hbar, using same
% method as for |mathaccents| option. I should add some way to adjust the
% vertical positioning.
%
% On this occasion I replace |h| by |\mst@h| because the mechanism for
% before and after skips does not interact well with the rlap construct.
%
-% |1.3v 2019/09/19| adapts to maintain the robustness of \cs{hbar} which now
+% \mstrelease{1.3v} |2019/09/19| adapts to maintain the robustness of \cs{hbar} which now
% applies with \LaTeX{} |2019-10-01|.
%
-% |1.3w| works around \url{https://github.com/latex3/latex2e/issues/216} via
+% \mstrelease{1.3w} works around \url{https://github.com/latex3/latex2e/issues/216} via
% \cs{mst@DeclareMathAccent}. The upstream bug affected the definition of
% \cs{mst@ltbar@mvnormal} and broke usage of \cs{Mathastext} in preamble.
%
-% |1.3w| also fixes oversight that \cs{hbar} may have been redefined via
+% \mstrelease{1.3w} also fixes oversight that \cs{hbar} may have been redefined via
% \cs{DeclareMathSymbol} by some package (e.g. |amsfonts|) and with \LaTeX{}
% |2019-10-01| this means \cs{hbar<space>} is now undefined. Modifying it
-% changed nothing to \cs{hbar} behaviour in such circumstances. Finally we
+% changed nothing to \cs{hbar} behavior in such circumstances. Finally we
% opt for a \cs{protected} \cs{hbar} and choose to ignore completely if
% there is a \cs{hbar<space>} or not. To avoid extra steps we do not
% undefine it if it exists, because we would need to restore it in
@@ -8161,7 +8777,7 @@ defaultbf,defaultit,defaultsf,defaulttt}}
\def\mst@mathrlapinternal#1#2{\rlap{$\mathsurround=0pt#1{#2}$}}
\def\mst@dothe@hbarstuff#1#2#3{%
\edef\mst@tmp@enc{#3}%
- \if1\mst@OneifUniEnc % Unicode engine and font
+ \if1\mst@OneifUniEnc
\mst@Umathchardef#1="7 \symmtletterfont "0127 \relax %% or 210F?
\else
\begingroup
@@ -8170,13 +8786,13 @@ defaultbf,defaultit,defaultsf,defaulttt}}
\mst@DeclareMathAccent{#2}{\mathalpha}{mtletterfont}%
{\csname\mst@tmp@enc\string\=\endcsname{}}%
\endgroup
- \protected\def#1{\mst@mathrlap{#2{\ }}\mst@h}%
+ \protected\def#1{\mst@mathrlap{#2{\ }}\MTmathcharletterh}%
\fi
-}% end of \mst@dothe@hbarstuff
+}%
% \end{macrocode}
% \end{macro}
% \end{macro}
-% |1.15d|: Oct 13, 2012. The \cs{mathcode} thing with = is (belatedly,
+% \mstrelease{1.15d}: Oct 13, 2012. The \cs{mathcode} thing with = is (belatedly,
% sorry!) made Unicode compatible.
% \begin{macro}{+,=,\Relbar}
% \begin{macrocode}
@@ -8246,7 +8862,8 @@ defaultbf,defaultit,defaultsf,defaulttt}}
% sequences can not be simultaneously math symbols and math delimiters,
% thus, this complicates things for the mathastextification.
% \begin{macrocode}
-\ifmst@noparen\else\mst@infoline{parentheses \string( \string) \string[ \string] and slash \string/}
+\ifmst@noparen\else
+\mst@infoline{parentheses \string( \string) \string[ \string] and slash \string/}
\ifmst@nosmalldelims
\DeclareMathSymbol{(}{\mathopen}{\mst@font@tbu}{"28}
\DeclareMathSymbol{)}{\mathclose}{\mst@font@tbu}{"29}
@@ -8287,17 +8904,22 @@ defaultbf,defaultit,defaultsf,defaulttt}}
% other math symbol fonts they do respect the encoding of the CM symbols and
% largesymbols, so this is 90\% safe. But in truth I should extract from the
% meaning of \cs{backslash} the |delcode|.
+%
+% At \mstrelease{1.4} I am a bit perplexed at the \cs{mathalpha} here.
+% Adding a a \cs{mst@mathord@backslash} for matters of option |noeverymath|.
% \begin{macrocode}
\DeclareMathDelimiter{\mst@varfam@backslash}
{\mathalpha}{symbols}{"6E}{largesymbols}{"0F}
+ \let\mst@mathord@backslash\backslash
\else
\DeclareMathDelimiter{<}{\mathopen}{\mst@font@tbu}{"3C}{largesymbols}{"0A}
\DeclareMathDelimiter{>}{\mathclose}{\mst@font@tbu}{"3E}{largesymbols}{"0B}
% \end{macrocode}
% There is no backslash in the Symbol font hence |mtoperatorfont| here.
% \begin{macrocode}
- \DeclareMathDelimiter{\backslash}
+ \DeclareMathDelimiter{\mst@mathord@backslash}
{\mathord}{mtoperatorfont}{"5C}{largesymbols}{"0F}
+ \let\backslash\mst@mathord@backslash
\DeclareMathDelimiter{\mst@varfam@backslash}
{\mathalpha}{mtoperatorfont}{"5C}{largesymbols}{"0F}
\fi
@@ -8309,17 +8931,38 @@ defaultbf,defaultit,defaultsf,defaulttt}}
\expandafter\mst@addtodo@nonletters\string>\mathrel\mst@varfam@more
\mst@do@easynonletters\expandafter{\the\mst@do@easynonletters
\let\backslash\mst@varfam@backslash}
+% \end{macrocode}
+% Extras for \mstrelease{1.4} are needed:
+% \begin{macrocode}
+\ifmst@everymath
+\else
+ \mst@undo@easynonletters\expandafter{\the\mst@undo@easynonletters
+ \let\backslash\mst@mathord@backslash}
+\fi
\DeclareMathSymbol{\setminus}{\mathbin}{mtoperatorfont}{"5C}
+\let\mst@setminus\setminus
\DeclareMathSymbol{\mst@varfam@setminus}{\mathalpha}{mtoperatorfont}{"5C}
% \end{macrocode}
-% |1.3v| adds a \cs{protected} here for \cs{setminus}.
+% \mstrelease{1.3v} adds a \cs{protected} here for \cs{setminus}.
% \begin{macrocode}
-\mst@do@nonletters\expandafter{\the\mst@do@nonletters
- \protected\def\setminus{\mathbin{\mst@varfam@setminus}}}
+\mst@do@nonletters\expandafter{%
+ \the\mst@do@nonletters
+ \protected\def\setminus{\mathbin{\mst@varfam@setminus}}%
+}
+% \end{macrocode}
+% Extras for \mstrelease{1.4} are needed:
+% \begin{macrocode}
+\ifmst@everymath
+\else
+ \mst@undo@nonletters\expandafter{%
+ \the\mst@undo@nonletters
+ \let\setminus\mst@setminus
+ }
+\fi
% \end{macrocode}
% \end{macro}\end{macro}\end{macro}
% \begin{macro}{\models}
-% |1.15d|: 13 oct 2012. Before modifying \string| we must preserve \cs{models}.
+% \mstrelease{1.15d}: 13 oct 2012. Before modifying \string| we must preserve \cs{models}.
% \begin{macrocode}
\ifmst@XeOrLua
\mst@Umathcharnumdef\mst@vert@bar=\mst@Umathcodenum`\|\relax
@@ -8335,7 +8978,7 @@ defaultbf,defaultit,defaultsf,defaulttt}}
% it used to be anyhow, so it is too late. Or not (2019)? maybe I
% \emph{should} do something here...
%
-% |1.3v 2019/09/19|: I discover this rather radical legacy
+% \mstrelease{1.3v} |2019/09/19|: I discover this rather radical legacy
% \verb+\def\vert{|}+, which is done here once in the preamble, but I leave
% it unmodified apart from prefixing it with \cs{protected}. I also add a
% \cs{protected} for the definition of \cs{mid} (which applies only under
@@ -8349,34 +8992,53 @@ defaultbf,defaultit,defaultsf,defaulttt}}
\protected\def\vert{|}
\DeclareMathSymbol{\mst@varfam@vbar}{\mathalpha}{\mst@font@tbu}{124}
\mst@addtodo@easynonletters\|\mst@varfam@vbar
-\let\mid\undefined % 1.3: to avoid problems with some packages
+\let\mid\undefined
\DeclareMathSymbol{\mid}{\mathrel}{\mst@font@tbu}{124}
-\mst@do@nonletters\expandafter{\the\mst@do@nonletters
- \protected\def\mid{\mathrel\mst@varfam@vbar}}
+\let\mst@mid\mid
+\mst@do@nonletters\expandafter{%
+ \the\mst@do@nonletters
+ \protected\def\mid{\mathrel\mst@varfam@vbar}%
+}
+% \end{macrocode}
+% Extras for \mstrelease{1.4} are needed:
+% \begin{macrocode}
+\ifmst@everymath
+\else
+ \mst@undo@nonletters\expandafter{%
+ \the\mst@undo@nonletters
+ \let\mid\mst@mid
+ }
+\fi
% \end{macrocode}
% \begin{macro}{\MTexplicitbraces-}\begin{macro}{obeymathxx}
% \begin{macro}{\MTexplicitbraces-}\begin{macro}{donotobeymathxx}
-% Braces. With version |1.2|, |\{| and |\}| will not be acceptable as
+% Braces. With version \mstrelease{1.2}, |\{| and |\}| will not be acceptable as
% delimiters anymore if the redefinitions below in \cs{mst@dobraces} are
-% enacted. But they will obey math alphabets. Improvements in |1.2a|, to
+% enacted. But they will obey math alphabets. Improvements in \mstrelease{1.2a}, to
% preserve robustness.
%
-% For |1.3| I make |\lbrace| and |\rbrace| undefined first, else problems
+% For \mstrelease{1.3} I make |\lbrace| and |\rbrace| undefined first, else problems
% may arise with some packages.
%
-% |1.3e| suppresses under option
+% \mstrelease{1.3e} suppresses under option
% |nosmalldelims| the definitions of |\lbrace| and |\rbrace| as math
% symbols as this made |\left\lbrace| cause an error, it was a bug.
%
-% LaTeX2e defines |\{| and |\}| as robust commands for a long time
+% (obsolete) LaTeX2e defines |\{| and |\}| as robust commands since a long time
% (I don't know since when). The \mst redefinition is done only if user
% has executed \cs{MTexplicitbracesobeymathxx}, and it is done only when
% entering math mode, but there could be some |\hbox| inside math, hence
% it has to be careful to be valid in text too.
%
-% |1.3v| maintains strict \LaTeX2e robustness for |\{| and |\}|.
+% \mstrelease{1.3v} maintains strict \LaTeX2e robustness for |\{| and |\}|.
% This assumes no one fiddled with |\{| and |\}| proper (without space
% in the name).
+%
+% \LaTeX{} made |\{| and |\}| \cs{protected}, not robust, at its
+% |2020-02-02| release, so the code used by \mst under
+% \cs{MTexplicitbracesobeymathxx} toggle remained without effect since
+% as it configured a change to |\{<space>| and |\}<space>|. Fixed at
+% \mstrelease{1.4}.
% \begin{macrocode}
\ifmst@nosmalldelims
\else
@@ -8388,28 +9050,46 @@ defaultbf,defaultit,defaultsf,defaulttt}}
\fi
\DeclareMathSymbol{\mst@varfam@lbrace}{\mathalpha}{\mst@font@tbu}{123}
\DeclareMathSymbol{\mst@varfam@rbrace}{\mathalpha}{\mst@font@tbu}{125}
-\DeclareRobustCommand*{\mst@lbrace}
- {\ifmmode\mathopen\mst@varfam@lbrace\else\textbraceleft\fi}
-\DeclareRobustCommand*{\mst@rbrace}
- {\ifmmode\mathclose\mst@varfam@rbrace\else\textbraceright\fi}
-\mst@do@nonletters\expandafter{\the\mst@do@nonletters
- \mst@dobraces{\expandafter\let\csname\string{ \expandafter\endcsname
- \csname mst@lbrace \endcsname
- \expandafter\let\csname\string} \expandafter\endcsname
- \csname mst@rbrace \endcsname}}
-\fi % end of \ifmst@alldelims
+% \end{macrocode}
+% \begin{macrocode}
+\protected\def\mst@lbrace{\ifmmode\mathopen\mst@varfam@lbrace\else\textbraceleft\fi}
+\protected\def\mst@rbrace{\ifmmode\mathclose\mst@varfam@rbrace\else\textbraceright\fi}
+\mst@do@nonletters\expandafter{%
+ \the\mst@do@nonletters
+ \mst@dobraces{\let\{\mst@lbrace\let\}\mst@rbrace}%
+}
+\fi
\newcommand*{\MTexplicitbracesobeymathxx}{\let\mst@dobraces\@firstofone}
\newcommand*{\MTexplicitbracesdonotobeymathxx}{\let\mst@dobraces\@gobble}
+% \end{macrocode}
+% Extras for \mstrelease{1.4} are needed:
+% \begin{macrocode}
+\ifmst@everymath
+\else
+ \renewcommand*\MTexplicitbracesobeymathxx{%
+ \let\mst@dobraces\@firstofone
+ \MTnonlettersobeymathxx
+ }%
+ \renewcommand*\MTexplicitbracesdonotobeymathxx{%
+ \let\mst@dobraces\@gobble
+ \protected\def\{{\ifmmode \lbrace \else \textbraceleft \fi}%
+ \protected\def\}{\ifmmode \rbrace \else \textbraceright \fi}%
+ }%
+ \mst@undo@nonletters\expandafter{\the\mst@undo@nonletters
+ \protected\def\{{\ifmmode \lbrace \else \textbraceleft \fi}%
+ \protected\def\}{\ifmmode \rbrace \else \textbraceright \fi}%
+ }%
+\fi
\MTexplicitbracesdonotobeymathxx
% \end{macrocode}
% \end{macro}\end{macro}\end{macro}\end{macro}
% \end{macro}\end{macro}
% \begin{macro}{specials}
-% \leavevmode\kern\parindent |1.14b| |2011/04/02|: the redefinitions of
+% \leavevmode\kern\parindent \mstrelease{1.14b} |2011/04/02|: the redefinitions of
% \#, \$, \% and \& were buggy (this showed up when 10 or more math
% families had been created).
%
-% |1.15f| |2012/10/23|: the code, although working, was perhaps a bit insane
+% \mstrelease{1.15f} |2012/10/23|: the code, although working, was perhaps a bit insane
% and
% had definitions which could surprise other packages. For example, it did:\\
% \null\hspace{1cm}|\renewcommand{\%}{\ifmmode\mt@mmode@percent\else\char37\relax\fi}|\\
@@ -8426,60 +9106,80 @@ defaultbf,defaultit,defaultsf,defaulttt}}
% mathcode. So here it is \emph{not} a redefinition of the control sequences,
% purely an adjustment of mathcodes.
%
-% |1.2d| |2013/01/01|: previous versions imposed the variable family type. I
+% \mstrelease{1.2d} |2013/01/01|: previous versions imposed the variable family type. I
% hereby make it possible to de-activate this feature with the macro
% \cs{MTeasynonlettersdonotobeymathxx}. Besides, I have absolutely no idea
% why I had different looking code depending on the engine \XeTeX, \LuaTeX\ or
% default. Removed.
%
-% |1.3c| |2013/12/14|: I have absolutely no idea why I removed the \XeTeX\
-% and \LuaTeX\ code at the time of |1.2d|! the code for tex/pdftex engine
+% \mstrelease{1.3c} |2013/12/14|: I have absolutely no idea why I removed the \XeTeX\
+% and \LuaTeX\ code at the time of \mstrelease{1.2d}! the code for tex/pdftex engine
% could not accomodate more than 16 math families. Code for \XeTeX\ and
% \LuaTeX\ again added. (and since TL2013 no more problems with
% |\luatexUmathcode|.)
+%
+% \mstrelease{1.4} has done slight refactoring here to share more code related
+% to math activation across the two branches.
% \begin{macrocode}
\ifmst@nospecials
\else
- \mst@infoline{\string\#\space\string\mathdollar\space
- \string\%\space\string\&\space}
+ \mst@infoline{\string\#\space\string\mathdollar\space
+ \string\%\space\string\&\space}
\ifmst@XeOrLua
- \mst@Umathcode`\#=0 \symmtoperatorfont "23 \relax
- \mst@Umathchardef\mathdollar=0 \symmtoperatorfont "24 \relax
- \mst@Umathcode`\%=0 \symmtoperatorfont "25 \relax
- \mst@Umathcode`\&=0 \symmtoperatorfont "26 \relax
- \mst@do@easynonletters\expandafter{%
- \the\mst@do@easynonletters
- \mst@Umathcode`\#=7 \symmtoperatorfont "23 \relax
- \mst@Umathchardef\mathdollar=7 \symmtoperatorfont "24 \relax
- \mst@Umathcode`\%=7 \symmtoperatorfont "25 \relax
- \mst@Umathcode`\&=7 \symmtoperatorfont "26 \relax
- }
+ \mst@Umathcode`\#=0 \symmtoperatorfont "23 \relax
+ \mst@Umathchardef\mathdollar=0 \symmtoperatorfont "24 \relax
+ \mst@Umathcode`\%=0 \symmtoperatorfont "25 \relax
+ \mst@Umathcode`\&=0 \symmtoperatorfont "26 \relax
+ \mst@Umathchardef\mst@varfam@mathhash = 7 \symmtoperatorfont "23 \relax
+ \mst@Umathchardef\mst@varfam@mathdollar = 7 \symmtoperatorfont "24 \relax
+ \mst@Umathchardef\mst@varfam@mathpercent = 7 \symmtoperatorfont "25 \relax
+ \mst@Umathchardef\mst@varfam@mathampersand = 7 \symmtoperatorfont "26 \relax
+ \mst@addtodo@easynonletters@U\#\mst@varfam@mathhash
+ \mst@addtodo@easynonletters@U\%\mst@varfam@mathpercent
+ \mst@addtodo@easynonletters@U\&\mst@varfam@mathampersand
\else
- \count@=\symmtoperatorfont
- \multiply\count@ by \@cclvi
- \advance\count@ by 35
- \mathcode`\#\count@
- \advance\count@ by \@ne
- \mathchardef\mathdollar\count@
- \advance\count@ by \@ne
- \mathcode`\%\count@
- \advance\count@ by \@ne
- \mathcode`\&\count@
- \count@=\symmtoperatorfont
- \multiply\count@ by \@cclvi
- \advance\count@ by 28707 % = "7023
- \mathchardef\mst@varfam@mathhash\count@
- \advance\count@ by \@ne
- \mathchardef\mst@varfam@mathdollar\count@
- \advance\count@ by \@ne
- \mathchardef\mst@varfam@mathpercent\count@
- \advance\count@ by \@ne
- \mathchardef\mst@varfam@mathampersand\count@
+ \count@=\symmtoperatorfont
+ \multiply\count@ by \@cclvi
+ \advance\count@ by 35
+ \mathcode`\#\count@
+ \advance\count@ by \@ne
+ \mathchardef\mathdollar\count@
+ \advance\count@ by \@ne
+ \mathcode`\%\count@
+ \advance\count@ by \@ne
+ \mathcode`\&\count@
+ \count@=\symmtoperatorfont
+ \multiply\count@ by \@cclvi
+ \advance\count@ by 28707 % = "7023
+ \mathchardef\mst@varfam@mathhash\count@
+ \advance\count@ by \@ne
+ \mathchardef\mst@varfam@mathdollar\count@
+ \advance\count@ by \@ne
+ \mathchardef\mst@varfam@mathpercent\count@
+ \advance\count@ by \@ne
+ \mathchardef\mst@varfam@mathampersand\count@
+ \mst@addtodo@easynonletters\#\mst@varfam@mathhash
+ \mst@addtodo@easynonletters\%\mst@varfam@mathpercent
+ \mst@addtodo@easynonletters\&\mst@varfam@mathampersand
+ \fi
+% \end{macrocode}
+% It is possible to mathematically activate the dollar sign, and to use
+% it in math mode as |\string$|... well, how many documents will have
+% done that? But we do not modify the mathcode of the |$| character
+% anyhow, so why should I add here a \cs{mst@OnlyIfNotMathActive}?
+% There is no good reason for that.
+% \begin{macrocode}
\mst@do@easynonletters\expandafter{\the\mst@do@easynonletters
- \mathcode`\#=\mst@varfam@mathhash
- \let\mathdollar\mst@varfam@mathdollar
- \mathcode`\%=\mst@varfam@mathpercent
- \mathcode`\&=\mst@varfam@mathampersand}
+ \let\mathdollar\mst@varfam@mathdollar}%
+% \end{macrocode}
+% Extras for \mstrelease{1.4} are needed. Here too we do not worry
+% about math active dollar character.
+% \begin{macrocode}
+ \ifmst@everymath\else
+ \edef\mst@tmp{\ifmst@XeOrLua\mst@Umathcharnumdef\else\mathchardef\fi
+ \mathdollar=\the\mathdollar\relax}%
+ \mst@undo@easynonletters\expandafter\expandafter\expandafter
+ {\expandafter\mst@tmp\the\mst@undo@easynonletters}%
\fi
\fi
% \end{macrocode}
@@ -8495,7 +9195,7 @@ defaultbf,defaultit,defaultsf,defaulttt}}
% manipulations, but well, life is finite.
% \begin{macro}{\prod}
% \begin{macro}{\sum}
-% |1.13b|: I correct the brutal re-definitions of \cs{prod} and \cs{sum} from
+% \mstrelease{1.13b}: I correct the brutal re-definitions of \cs{prod} and \cs{sum} from
% the earlier versions of the package; most of the time the Symbol glyphs do
% appear to be too small in display mode. The new redefinitions do have some
% defects: |$\displaystyle\prod_1^2$| changes the position of limits but not
@@ -8506,40 +9206,50 @@ defaultbf,defaultit,defaultsf,defaulttt}}
%
% October 2012: maybe I should re-examine what I did?
%
-% |1.3c| (|2013/12/14|) renames |\defaultprod| to |\MToriginalprod| and
+% \mstrelease{1.3c} (|2013/12/14|) renames |\defaultprod| to |\MToriginalprod| and
% |\defaultsum| to
% |\MToriginalsum|.
%
-% |1.3v| hesitates about making robust here \cs{prod} and \cs{sum}. Finally I
+% \mstrelease{1.3v} hesitates about making robust here \cs{prod} and \cs{sum}. Finally I
% use \cs{protected} for them.
+%
+% \mstrelease{1.4} finally replaces all control sequences defines earlier via
+% \cs{DeclareRobustCommand} to be defined using \cs{protected}\cs{def}. It
+% also removes \cs{mst@prod} and \cs{mst@sum} which were aliases of
+% \cs{MToriginalprod} and \cs{MToriginalsum}, and having both must have
+% been some left-over of earlier versions in 2012 or 2013 (unchecked).
% \begin{macrocode}
-\ifmst@symbolmisc\mst@infoline{symbolmisc: miscellaneous math symbols from Symbol font}
-\let\mst@prod\prod
+\ifmst@symbolmisc
+\mst@infoline{symbolmisc: miscellaneous math symbols from Symbol font}
\let\MToriginalprod\prod
\DeclareMathSymbol{\prodpsy}{\mathop}{mtpsymbol}{213}
-\protected\def\prod{\ifinner\prodpsy\else\mst@prod\fi}
-\let\mst@sum\sum
+\protected\def\prod{\ifinner\prodpsy\else\MToriginalprod\fi}
\let\MToriginalsum\sum
\DeclareMathSymbol{\sumpsy}{\mathop}{mtpsymbol}{229}
-\protected\def\sum{\ifinner\sumpsy\else\mst@sum\fi}
+\protected\def\sum{\ifinner\sumpsy\else\MToriginalsum\fi}
% \end{macrocode}
% \end{macro}
% \end{macro}
% \begin{macrocode}
\DeclareMathSymbol{\mst@implies}{\mathrel}{mtpsymbol}{222}
-\DeclareRobustCommand*{\implies}{\;\mst@implies\;}
+\protected\def\implies{\;\mst@implies\;}
\DeclareMathSymbol{\mst@impliedby}{\mathrel}{mtpsymbol}{220}
-\DeclareRobustCommand*{\impliedby}{\;\mst@impliedby\;}
-\DeclareRobustCommand*{\iff}{\;\mst@impliedby\mathrel{\mkern-3mu}\mst@implies\;}
+\protected\def\impliedby{\;\mst@impliedby\;}
+\protected\def\iff{\;\mst@impliedby\mathrel{\mkern-3mu}\mst@implies\;}
\DeclareMathSymbol{\mst@iff}{\mathrel}{mtpsymbol}{219}
-\DeclareRobustCommand*{\shortiff}{\;\mst@iff\;}
-\DeclareMathSymbol{\mst@to}{\mathrel}{mtpsymbol}{174}
+\protected\def\shortiff{\;\mst@iff\;}
+% \end{macrocode}
+% \mstrelease{1.4} drops defining a \cs{mst@to} and employs \cs{to}
+% in subsequent definitions
+% \begin{macrocode}
+\let\to\relax
+\DeclareMathSymbol{\to}{\mathrel}{mtpsymbol}{174}
\DeclareMathSymbol{\mst@trait}{\mathrel}{mtpsymbol}{190}
-\DeclareRobustCommand*\to{\mst@to}
-\DeclareRobustCommand*\longto{\mkern2mu\mst@trait\mathrel{\mkern-10mu}\mst@to}
-\DeclareRobustCommand*\mapsto{\mapstochar\mathrel{\mkern0.2mu}\mst@to}
-\DeclareRobustCommand*\longmapsto{%
-\mapstochar\mathrel{\mkern2mu}\mst@trait\mathrel{\mkern-10mu}\mst@to}
+\protected\def\longto{\mkern2mu\mst@trait\mathrel{\mkern-10mu}\to}
+\protected\def\mapsto{\mapstochar\mathrel{\mkern0.2mu}\to}
+\protected\def\longmapsto{%
+ \mapstochar\mathrel{\mkern2mu}\mst@trait\mathrel{\mkern-10mu}\to
+}
\DeclareMathSymbol{\aleph}{\mathord}{mtpsymbol}{192}
\DeclareMathSymbol{\inftypsy}{\mathord}{mtpsymbol}{165}
\DeclareMathSymbol{\emptyset}{\mathord}{mtpsymbol}{198}
@@ -8593,7 +9303,8 @@ defaultbf,defaultit,defaultsf,defaulttt}}
% \begin{macro}{symbolre}
% I like the \cs{Re} and \cs{Im} from Symbol, so I overwrite the CM ones.
% \begin{macrocode}
-\ifmst@symbolre\mst@infoline{symbolre: \string\Re\space and \string\Im\space from Symbol font}
+\ifmst@symbolre
+\mst@infoline{symbolre: \string\Re\space and \string\Im\space from Symbol font}
\DeclareMathSymbol{\Re}{\mathord}{mtpsymbol}{"C2}
\DeclareMathSymbol{\Im}{\mathord}{mtpsymbol}{"C1}
\DeclareMathSymbol{\DotTriangle}{\mathord}{mtpsymbol}{92}
@@ -8603,12 +9314,12 @@ defaultbf,defaultit,defaultsf,defaulttt}}
% \begin{macro}{Greek letters}
% LGRgreek $>$ selfGreek $>$ eulergreek $>$ symbolgreek
%
-% |1.11| I correct some bugs on how eulergreek and
+% \mstrelease{1.11} I correct some bugs on how eulergreek and
% symbolgreek interacted.
%
-% |1.12b| more bug fixes.
+% \mstrelease{1.12b} more bug fixes.
%
-% |1.13|
+% \mstrelease{1.13}
%
% * Option LGRgreek.
%
@@ -8616,10 +9327,10 @@ defaultbf,defaultit,defaultsf,defaulttt}}
% the default shape is now the one for letters, not for operator-names
% and digits. This complies to the ISO standard.
%
-% * bugfix: version |1.12b| did not define the \cs{omicron} in the
+% * bugfix: version \mstrelease{1.12b} did not define the \cs{omicron} in the
% case when no Greek-related option was passed to the package.
%
-% |1.13d| has new macros |\MTstandardgreek| and |\MTcustomgreek|.
+% \mstrelease{1.13d} has new macros |\MTstandardgreek| and |\MTcustomgreek|.
% And in the subdued case |\MTstandardgreek| is done when switching to
% the normal or bold math versions (previously something like this
% was only done in case of |LGRgreek| option. )
@@ -8672,13 +9383,13 @@ defaultbf,defaultit,defaultsf,defaulttt}}
% \begin{macrocode}
\ifx\mst@mathord\mathord
% \end{macrocode}
-% symbolgreek but neither eulergreek nor selfGreek
-% \begin{macrocode}
-%% attention le P de Symbol est un \Pi pas un \Rho
+% \noindent symbolgreek but neither eulergreek nor selfGreek\newline
+% Attention le P de Symbol est un \cs{Pi} pas un \cs{Rho}.\newline
+% Attention le X de Symbol est un \cs{Xi} pas un \cs{Chi}.\newline
+% Attention le F de Symbol est un \cs{Phi}. Il n'y a pas de \cs{Digamma}.
+% \begin {macrocode}
\DeclareMathSymbol{\mst@Rho}{\mathord}{mtpsymbol}{"52}
-%% attention le X de Symbol est un \Xi pas un \Chi
\DeclareMathSymbol{\mst@Chi}{\mathord}{mtpsymbol}{"43}
-%% attention le F de Symbol est un \Phi. Il n'y a pas de \Digamma
\DeclareMathSymbol{\mst@Gamma}{\mathord}{mtpsymbol}{"47}
\DeclareMathSymbol{\mst@Delta}{\mathord}{mtpsymbol}{"44}
\DeclareMathSymbol{\mst@Theta}{\mathord}{mtpsymbol}{"51}
@@ -8690,7 +9401,7 @@ defaultbf,defaultit,defaultsf,defaulttt}}
\DeclareMathSymbol{\mst@Phi}{\mathord}{mtpsymbol}{"46}
\DeclareMathSymbol{\mst@Psi}{\mathord}{mtpsymbol}{"59}
\DeclareMathSymbol{\mst@Omega}{\mathord}{mtpsymbol}{"57}
- \else % de \mst@mathord=\mathord
+ \else
% \end{macrocode}
% not symbolgreek but eulergreek or selfGreek. Note |2015/10/31| : apparemment à
% un moment dans le passé je considérais eulergreek et selfGreek comme pouvant
@@ -8709,8 +9420,8 @@ defaultbf,defaultit,defaultsf,defaulttt}}
\DeclareMathSymbol\mst@Phi {\mathalpha}{\mst@font@tbu}{"08}
\DeclareMathSymbol\mst@Psi {\mathalpha}{\mst@font@tbu}{"09}
\DeclareMathSymbol\mst@Omega {\mathalpha}{\mst@font@tbu}{"0A}
- \fi % de \mst@mathord=\mathord
-\fi % fin de goahead
+ \fi
+\fi
% \end{macrocode}
% There are differences regarding Euler and Symbol with respect to the
% available var-letters. We include one or two things like the |wp| and the
@@ -8796,10 +9507,10 @@ defaultbf,defaultit,defaultsf,defaulttt}}
\fi
% \end{macrocode}
% \begin{macro}{\alphaup etc...}
-% Completely refactored at |1.3x| to define |\Alphaup|, |\Alphait|,
+% Completely refactored at \mstrelease{1.3y} to define |\Alphaup|, |\Alphait|,
% |\alphaup|, |\alphait|, etc\dots{} and prepare templates |\Alpha|, \dots{},
% |\alpha|, \dots{}, which when activating a math version will be submitted to
-% an |\expanded|, whose behaviour will depend on version-specific conditionals.
+% an |\expanded|, whose behavior will depend on version-specific conditionals.
% \begin{macrocode}
\ifmst@LGRgreek
% cf http://milde.users.sourceforge.net/LGR/lgrxenc.def.html
@@ -8832,7 +9543,7 @@ defaultbf,defaultit,defaultsf,defaulttt}}
\DeclareMathSymbol{\Tauit}{\mathalpha}{mtgreekit}{84}
\DeclareMathSymbol{\Chiit}{\mathalpha}{mtgreekit}{81}
% \end{macrocode}
-% |1.3w| and earlier had a bug regarding Digamma which was set up
+% \mstrelease{1.3w} and earlier had a bug regarding Digamma which was set up
% to use same font shape as for lowercase digamma.
% \begin{macrocode}
\DeclareMathSymbol{\Digammaup}{\mathalpha}{mtgreekup}{195}
@@ -8916,7 +9627,9 @@ defaultbf,defaultit,defaultsf,defaulttt}}
\DeclareMathSymbol{\omegaup}{\mathalpha}{mtgreekup}{119}
%
\DeclareMathSymbol{\digammaup}{\mathalpha}{mtgreekup}{147}
-% only varsigma defined (I should check this again)
+% \end{macrocode}
+% Only varsigma defined (I should check this again).
+% \begin{macrocode}
\DeclareMathSymbol{\varsigmaup}{\mathalpha}{mtgreekup}{99}
%
\DeclareMathSymbol{\alphait}{\mathalpha}{mtgreekit}{97}
@@ -8981,12 +9694,12 @@ defaultbf,defaultit,defaultsf,defaulttt}}
% \begin{macro}{\MTstandardgreek}
% \begin{macro}{\MTcustomgreek}
% \begin{macro}{\MTrecordstandardgreek}
-% |1.3d 2014/05/23| defines the commands |\MTstandardgreek| and
+% \mstrelease{1.3d} |2014/05/23| defines the commands |\MTstandardgreek| and
% |\MTcustomgreek| for package and user. I leave |\MTrecordstandardgreek|
% undocumented as I don't want to encourage people to load math packages
% after \mst.
%
-% |1.3h 2015/10/31|: corrected |\MTcustomgreek| as it caused |\ell| to
+% \mstrelease{1.3h} |2015/10/31|: corrected |\MTcustomgreek| as it caused |\ell| to
% become undefined under option |symbolgreek| and, much more catastrophic,
% caused |\alpha|, etc.. to become undefined under option |selfGreek| !
% \begin{macrocode}
@@ -9055,7 +9768,7 @@ defaultbf,defaultit,defaultsf,defaulttt}}
%
\let\mst@origpartial\partial
\let\mst@origwp\wp
- \let\mst@origell\ell }% \MTrecordstandardgreek
+ \let\mst@origell\ell }%
\MTrecordstandardgreek
\renewcommand*{\MTstandardgreek}{%
\let\Alpha\mst@origAlpha
@@ -9119,10 +9832,10 @@ defaultbf,defaultit,defaultsf,defaulttt}}
\let\partial\mst@origpartial
\let\wp\mst@origwp
\let\ell\mst@origell
-}% \MTstandardgreek
+}%
\ifmst@greekplus
% \end{macrocode}
-% |1.3za| implementation of |LGRgreek+| option. It is not exactly
+% \mstrelease{1.3za} implementation of |LGRgreek+| option. It is not exactly
% clear what we should do for \cs{mathnormal} and \cs{mathnormalbold}.
%
% This definition allows usage of \cs{alpha} for example in numerical
@@ -9210,7 +9923,7 @@ defaultbf,defaultit,defaultsf,defaulttt}}
\mst@define@lowergreekletter\omega\mst@omega
\mst@define@lowergreekletter\varsigma\mst@varsigma
\mst@define@lowergreekletter\digamma\mst@digamma
-}% end of True branch of \ifmst@greekplus
+}%
\else
% \end{macrocode}
% Under |selfGreek| or other Greek option but not |LGRgreek|, these Greek
@@ -9243,8 +9956,10 @@ defaultbf,defaultit,defaultsf,defaulttt}}
\let\noexpand\Rho\mst@Rho
\let\noexpand\Tau\mst@Tau
\let\noexpand\Chi\mst@Chi
- }% end of first big \expanded
-% 1.3h: \mst@Digamma not defined if symbolgreek option
+ }%
+% \end{macrocode}
+% \mstrelease{1.3h}: \cs{mst@Digamma} not defined if |symbolgreek| option.
+% \begin{macrocode}
\ifmst@symbolgreek\else
\expanded{\let\noexpand\Digamma\mst@Digamma}%
\fi
@@ -9260,10 +9975,10 @@ defaultbf,defaultit,defaultsf,defaulttt}}
\let\noexpand\Phi\mst@Phi
\let\noexpand\Psi\mst@Psi
\let\noexpand\Omega\mst@Omega
- }% end of second big \expanded
+ }%
% \end{macrocode}
-% |1.3h 2015/10/31| adds this conditional to correct the bad bug in
-% |1.3d 2014/05/23| which caused |\alpha| etc... to become undefined
+% \mstrelease{1.3h} |2015/10/31| adds this conditional to correct the bad bug in
+% \mstrelease{1.3d} |2014/05/23| which caused |\alpha| etc... to become undefined
% under option |selfGreek|.
% \begin{macrocode}
\ifmst@selfGreek\else
@@ -9293,28 +10008,34 @@ defaultbf,defaultit,defaultsf,defaulttt}}
\let\noexpand\psi\mst@psi
\let\noexpand\omega\mst@omega
\let\noexpand\varsigma\mst@varsigma
- }% end of third big \expanded
-% 1.3h: digamma only defined with option LGRgreek:
+ }%
+% \end{macrocode}
+% \mstrelease{1.3h}: digamma only defined with option |LGRgreek|.
+% \begin{macrocode}
\ifmst@LGRgreek
\expanded{\let\noexpand\digamma\mst@digamma}%
\fi
-% conditional added 1.3h 2015/10/31
+% \end{macrocode}
+% Conditional added \mstrelease{1.3h} |2015/10/31|.
+% \begin{macrocode}
\ifmst@LGRgreek\else
\let\varepsilon\mst@varepsilon
\let\vartheta\mst@vartheta
\let\varpi\mst@varpi
\let\varrho\mst@varrho
\let\varphi\mst@varphi
-%
\let\partial\mst@partial
\let\wp\mst@wp
-% 1.3h: no \mst@ell if symbolgreek (bugfix 1.3h 2015/10/31)
+% \end{macrocode}
+% \mstrelease{1.3h}: no \cs{mst@ell} if |symbolgreek| (bugfix
+% \mstrelease{1.3h} |2015/10/31|).
+% \begin{macrocode}
\ifmst@symbolgreek\else\let\ell\mst@ell\fi
\fi
\fi
-}% \MTcustomgreek
-\fi% end of else branch of \ifmst@greekplus
-\fi% end of \ifmst@customgreek
+}%
+\fi
+\fi
\let\Mathastextstandardgreek\MTstandardgreek
\let\Mathastextcustomgreek\MTcustomgreek
\ifmst@subdued\else\MTcustomgreek\fi
@@ -9322,22 +10043,22 @@ defaultbf,defaultit,defaultsf,defaulttt}}
% \end{macro}\end{macro}\end{macro}
% \begin{macro}{\inodot}
% \begin{macro}{\jnodot}
-% In |1.0|, I had them of type |mathord|, here I choose |mathalpha|. If I
+% In \mstrelease{1.0}, I had them of type |mathord|, here I choose |mathalpha|. If I
% used \cs{i} and \cs{j} from the text font the problem would be with the
% fontsize, if in scriptstyle. The amsmath \cs{text} would do the trick.
%
-% |1.14b| |2011/04/02|: again this bug in the EU1/EU2 encoding part, as in the
+% \mstrelease{1.14b} |2011/04/02|: again this bug in the EU1/EU2 encoding part, as in the
% code redefining \$ etc in math mode (see above). Fixed.
%
-% |1.3l| |2016/01/29|: anticipating TL2016 fontspec's switch to |TU|.
+% \mstrelease{1.3l} |2016/01/29|: anticipating TL2016 fontspec's switch to |TU|.
%
-% |1.3t| |2018/08/22| removes the definitions done of |\i| and |\j|
-% since |1.12| (as robust commands usable both in text and math mode).
+% \mstrelease{1.3t} |2018/08/22| removes the definitions done of |\i| and |\j|
+% since \mstrelease{1.12} (as robust commands usable both in text and math mode).
%
-% |1.3u| lets the \cs{imath} and \cs{jmath} react to the font encoding at each
+% \mstrelease{1.3u} lets the \cs{imath} and \cs{jmath} react to the font encoding at each
% math version.
%
-% |1.3v| lets the redefined \cs{imath} and \cs{jmath} be \cs{protected}.
+% \mstrelease{1.3v} lets the redefined \cs{imath} and \cs{jmath} be \cs{protected}.
% \begin{macrocode}
\def\mst@subduedinodot{%
\let\inodot\mst@original@imath
@@ -9352,7 +10073,6 @@ defaultbf,defaultit,defaultsf,defaulttt}}
\def\mst@dothe@inodotstuff#1#2#3{%
\edef\mst@tmp@enc{#3}%
\if1\mst@OneifUniEnc
- % Unicode engine and font
\mst@Umathchardef#1="7 \symmtletterfont "0131 \relax
\mst@Umathchardef#2="7 \symmtletterfont "0237 \relax
\else
@@ -9360,7 +10080,7 @@ defaultbf,defaultit,defaultsf,defaulttt}}
{\csname\mst@tmp@enc\string\i\endcsname}
\DeclareMathSymbol{#2}{\mathalpha}{mtletterfont}
{\csname\mst@tmp@enc\string\j\endcsname}
- \fi}% \mst@dothe@inodotstuff
+ \fi}%
\ifmst@defaultimath\else\mst@infoline{\string\imath\space and \string\jmath\space}
\AtEndOfPackage{\AtBeginDocument{%
\protected\def\imath{\inodot}%
@@ -9382,10 +10102,10 @@ defaultbf,defaultit,defaultsf,defaulttt}}
% define math versions with different encodings. Here I
% take T1 if it was the default at the time of loading the
% package, else OT1.
-% |1.12b|: I add LY1 which is quasi like OT1.
+% \mstrelease{1.12b}: I add LY1 which is quasi like OT1.
% \end{quote}
%
-% At |1.3u 2019/08/20| I decide to remove the hard-coded slot positions
+% At \mstrelease{1.3u} |2019/08/20| I decide to remove the hard-coded slot positions
% for OT1, T1 and LY1, and replace them with some hack which assumes
% LaTeX2e way of handling text accents got executed by the encoding
% definition file. If not, some breakage on package loading could occur, but
@@ -9395,21 +10115,22 @@ defaultbf,defaultit,defaultsf,defaulttt}}
% The |\vec| accent is not considered here because it has no suitable
% available glyph in a standard 8bits text font encodings.
%
-% Also at |1.3u| the math accents adapt to the font encoding at each math
+% Also at \mstrelease{1.3u} the math accents adapt to the font encoding at each math
% version.
%
-% |1.3v| adapts to \LaTeX{} |2019-10-01| which now comes with robust math
-% accent macros. The «original»-named macros are without the robustifying
-% space (NOT true anymore, see |1.3w| next), as they only serve as meaning
+% (obsolete at \mstrelease{1.4}) \mstrelease{1.3v} adapts to \LaTeX{}
+% |2019-10-01| which now comes with robust math accent macros. The
+% «original»-named macros are without the robustifying space (NOT true
+% anymore, see \mstrelease{1.3w} next), as they only serve as meaning
% holders.
%
-% On the other hand the macros
-% indexed by math version names are (in the pdflatex branch) always defined
-% via \cs{DeclareMathAccent} hence they will be robust with |2019-10-01| or
+% (obsolete at \mstrelease{1.4}) On the other hand the macros indexed by
+% math version names are (in the pdflatex branch) always defined via
+% \cs{DeclareMathAccent} hence they will be robust with |2019-10-01| or
% later and we must use the \cs{mst@robustifyingspace} with them to access
% their real meaning (this thus differs from the situation with \cs{hbar}).
%
-% |1.3w| The above was a bit optimistic as |amsmath| for example modifies
+% \mstrelease{1.3w} The above was a bit optimistic as |amsmath| for example modifies
% \LaTeX{} internals and handles math accents differently.
%
% We thus needed to double our
@@ -9456,73 +10177,63 @@ defaultbf,defaultit,defaultsf,defaulttt}}
\let\add@unicode@accent\@firstoftwo
\if1\mst@OneifUniEnc
\ifmst@unimathaccents
- % \` -> \grave
\expandafter\xdef\csname mst@grave@mv#1\mst@robustifyingspace\endcsname
{\mst@Umathaccent
7
\number\symmtoperatorfont\space
\csname#2\string\`\endcsname{}\relax}%
- % \' -> \acute
\expandafter\xdef\csname mst@acute@mv#1\mst@robustifyingspace\endcsname
{\mst@Umathaccent
7
\number\symmtoperatorfont\space
\csname#2\string\'\endcsname{}\relax}%
- % \v -> \check
\expandafter\xdef\csname mst@check@mv#1\mst@robustifyingspace\endcsname
{\mst@Umathaccent
7
\number\symmtoperatorfont\space
\csname#2\string\v\endcsname{}\relax}%
- % \u -> \breve
\expandafter\xdef\csname mst@breve@mv#1\mst@robustifyingspace\endcsname
{\mst@Umathaccent
7
\number\symmtoperatorfont\space
\csname#2\string\u\endcsname{}\relax}%
- % \= -> \bar
\expandafter\xdef\csname mst@bar@mv#1\mst@robustifyingspace\endcsname
{\mst@Umathaccent
7
\number\symmtoperatorfont\space
\csname#2\string\=\endcsname{}\relax}%
- % \. -> \dot
\expandafter\xdef\csname mst@dot@mv#1\mst@robustifyingspace\endcsname
{\mst@Umathaccent
7
\number\symmtoperatorfont\space
\csname#2\string\.\endcsname{}\relax}%
- % \" -> \ddot
\expandafter\xdef\csname mst@ddot@mv#1\mst@robustifyingspace\endcsname
{\mst@Umathaccent
7
\number\symmtoperatorfont\space
\csname#2\string\"\endcsname{}\relax}%
- % \r -> \mathring
\expandafter\xdef\csname mst@mathring@mv#1\mst@robustifyingspace\endcsname
{\mst@Umathaccent
7
\number\symmtoperatorfont\space
\csname#2\string\r\endcsname{}\relax}%
- % \^ -> \hat
\expandafter\xdef\csname mst@hat@mv#1\mst@robustifyingspace\endcsname
{\mst@Umathaccent
7
\number\symmtoperatorfont\space
\csname#2\string\^\endcsname{}\relax}%
- % \~ -> \tilde
\expandafter\xdef\csname mst@tilde@mv#1\mst@robustifyingspace\endcsname
{\mst@Umathaccent
7
\number\symmtoperatorfont\space
\csname#2\string\~\endcsname{}\relax}%
- \else % false branch of ifmst@unimathaccents
+ \else
% \end{macrocode}
-% |1.3u| used some \cs{def} but this made the accent macro meanings look
+% \mstrelease{1.3u} used some \cs{def} but this made the accent macro meanings look
% slightly different depending on whether the math version being set-up was
% with an 8bit encoding or TU encoding.
%
-% For the sake of uniform treatment we modify this at |1.3v|, but this is a
+% For the sake of uniform treatment we modify this at \mstrelease{1.3v}, but this is a
% bit complicated regarding timing: we need, in absence of |unimathaccents|
% option, in math versions with an OpenType font, to let the \cs{acute} etc...
% acquire back some prior non-\mst meanings. To allow maximal flexibility,
@@ -9535,8 +10246,8 @@ defaultbf,defaultit,defaultsf,defaulttt}}
% definition of the «original»-named macros but prior to the (last one, if
% multiple) \cs{mst@nonsubduedmathaccents}.
%
-% Hence |1.3v| delayed a bit the initial execution of this macro (see further
-% down in the code) compared to what happened in |1.3u|.
+% Hence \mstrelease{1.3v} delayed a bit the initial execution of this macro (see further
+% down in the code) compared to what happened in \mstrelease{1.3u}.
%
% We are in a group but \cs{AtEndOfPackage} does the right thing.
% \begin{macrocode}
@@ -9561,7 +10272,6 @@ defaultbf,defaultit,defaultsf,defaulttt}}
%
% But wouldn't it be simpler to manage \cs{protected} macros?
% \begin{macrocode}
- \ifmst@robust@obsessed@LaTeX@era
\@tfor\@tempa:={grave}{acute}{check}{breve}{bar}%
{dot}{ddot}{mathring}{hat}{tilde}%
\do
@@ -9569,58 +10279,47 @@ defaultbf,defaultit,defaultsf,defaulttt}}
{\noexpand\protect
\expandafter\noexpand\csname mst@\@tempa @mv#1 \endcsname}%
}%
- \fi
- \else % false branch of ifUniEnc
+ \else
% \end{macrocode}
% \cs{DeclareMathAccent} works \cs{global}ly. And with \LaTeX{} |2019-10-01|
% or later it creates robust macros.
%
% \cs{mst@DeclareMathAccent} to work around \url{https://github.com/latex3/latex2e/issues/216}
% \begin{macrocode}
- % \` -> \grave
\expandafter\mst@DeclareMathAccent\expandafter
{\csname mst@grave@mv#1\endcsname}{\mathalpha}{mtoperatorfont}%
{\csname#2\string\`\endcsname{}}
- % \' -> \acute
\expandafter\mst@DeclareMathAccent\expandafter
{\csname mst@acute@mv#1\endcsname}{\mathalpha}{mtoperatorfont}%
{\csname#2\string\'\endcsname{}}
- % \v -> \check
\expandafter\mst@DeclareMathAccent\expandafter
{\csname mst@check@mv#1\endcsname}{\mathalpha}{mtoperatorfont}%
{\csname#2\string\v\endcsname{}}
- % \u -> \breve
\expandafter\mst@DeclareMathAccent\expandafter
{\csname mst@breve@mv#1\endcsname}{\mathalpha}{mtoperatorfont}%
{\csname#2\string\u\endcsname{}}
- % \= -> \bar
\expandafter\mst@DeclareMathAccent\expandafter
{\csname mst@bar@mv#1\endcsname}{\mathalpha}{mtoperatorfont}%
{\csname#2\string\=\endcsname{}}
- % \. -> \dot
\expandafter\mst@DeclareMathAccent\expandafter
{\csname mst@dot@mv#1\endcsname}{\mathalpha}{mtoperatorfont}%
{\csname#2\string\.\endcsname{}}
- % \" -> \ddot
\expandafter\mst@DeclareMathAccent\expandafter
{\csname mst@ddot@mv#1\endcsname}{\mathalpha}{mtoperatorfont}%
{\csname#2\string\"\endcsname{}}
- % \r -> \mathring
\expandafter\mst@DeclareMathAccent\expandafter
{\csname mst@mathring@mv#1\endcsname}{\mathalpha}{mtoperatorfont}%
{\csname#2\string\r\endcsname{}}
- % \^ -> \hat
\expandafter\mst@DeclareMathAccent\expandafter
{\csname mst@hat@mv#1\endcsname}{\mathalpha}{mtoperatorfont}%
{\csname#2\string\^\endcsname{}}
- % \~ -> \tilde
\expandafter\mst@DeclareMathAccent\expandafter
{\csname mst@tilde@mv#1\endcsname}{\mathalpha}{mtoperatorfont}%
{\csname#2\string\~\endcsname{}}
\fi
\endgroup
}%
-\fi % \ifmst@mathaccents
+\fi
% \end{macrocode}
% \end{macro}
% \begin{macro}{\MTDeclareVersion}
@@ -9634,14 +10333,14 @@ defaultbf,defaultit,defaultsf,defaulttt}}
% \cs{SetSymbolFont}|{mteulervm}||{versionname}||{U}{zeur}{bx}{n}| if
% one wants to have a math version with bold Euler characters.
%
-% For version |1.1| we add an optional parameter specifying the shape
+% For version \mstrelease{1.1} we add an optional parameter specifying the shape
% to be used for letters.
%
% Note: (|2012/10/24|) I really should check whether the user attempts to
% redefine the `normal' and `bold' versions and issue a warning in
-% that case! Finally done at |1.3w| |2019/11/16|! Better late than never...
+% that case! Finally done at \mstrelease{1.3w} |2019/11/16|! Better late than never...
%
-% |1.3c| (|2013/12/14|) adds an extra optional parameter after all
+% \mstrelease{1.3c} (|2013/12/14|) adds an extra optional parameter after all
% previous ones, to inherit the settings from another version. Typically
% to be used with [bold]. I take this opportunity to sanitize a bit some
% line endings to avoid generating (in the preamble, document macros were
@@ -9650,11 +10349,11 @@ defaultbf,defaultit,defaultsf,defaulttt}}
% purpose) the strange way I used |\@onlypreamble| in earlier
% version.
%
-% |1.3u| adds storage of macros holding the needed meanings for
+% \mstrelease{1.3u} adds storage of macros holding the needed meanings for
% \cs{imath}, \cs{hbar}, math accents, and the minus symbol,
% version wise.
%
-% |1.3w| adds the check to forbid |normal| and |bold| as version names.
+% \mstrelease{1.3w} adds the check to forbid |normal| and |bold| as version names.
% \begin{macrocode}
\newcommand*\MTDeclareVersion[6][]{%
\edef\mst@declareversionargs{{#1}{#2}{#3}{#4}{#5}{#6}}%
@@ -9666,14 +10365,14 @@ defaultbf,defaultit,defaultsf,defaulttt}}
\MTDoNotDeclareVersion@\expandafter\@gobblefour
\fi
\relax\DeclareMathVersion{\mst@version}\MTDeclareVersion@
-}% \MTDeclareVersion
+}%
\newcommand*\MTDoNotDeclareVersion@[1][]{%
\PackageWarningNoLine{mathastext}{You asked to declare a version with name
`\mst@version'.^^J%
\@spaces Sorry but you are not allowed to do that.^^J%
\@spaces \ifmst@subdued Anyway the `subdued' option is in force\else
Use rather \string\Mathastext\space macro (with no optional argument)\fi
-}}%\MTDoNotDeclareVersion@
+}}%
\newcommand*\MTDeclareVersion@[1][]{%
\edef\mst@tmp{#1}%
\ifx\mst@tmp\empty\else
@@ -9685,7 +10384,7 @@ defaultbf,defaultit,defaultsf,defaulttt}}
inherits from `#1\string'\@gobble}%
\fi
\expandafter\MTDeclareVersion@@\mst@declareversionargs
-}% \MTDeclareVersion@
+}%
\newcommand*\MTDeclareVersion@@[6]{%
\expandafter\edef\csname mst@encoding@\mst@version\endcsname{#3}%
\expandafter\edef\csname mst@family@\mst@version\endcsname{#4}%
@@ -9706,46 +10405,69 @@ defaultbf,defaultit,defaultsf,defaulttt}}
\ifx\mst@tmp\empty
\ifmst@italic
\SetSymbolFont{mtletterfont}{#2}{#3}{#4}{#5}{\mst@ltsh}%
-\immediate\write\m@ne{}%
-\PackageInfo{mathastext}{Latin letters in math version `#2\string'\MessageBreak
+ \immediate\write\m@ne{}%
+ \PackageInfo{mathastext}%
+ {\ifmst@noletters
+ \else
+ Latin letters in math version `#2\string'\MessageBreak
declared\on@line\MessageBreak
will use the font #3/#4/#5/\mst@ltsh
\ifmst@frenchmath\space(uppercase: #6)\fi\MessageBreak
+ \fi
Other characters (digits, ...) and \protect\log-like names\MessageBreak
- will be in `#6\string' shape\@gobble}%
-\immediate\write\m@ne{}%
+ \ifmst@noletters
+ will use the font #3/#4/#5/#6%
+ \else
+ will be in `#6\string' shape%
+ \fi\@gobble}%
+ \immediate\write\m@ne{}%
\expandafter\edef\csname mst@ltshape@\mst@version\endcsname{\mst@ltsh}%
\else
\SetSymbolFont{mtletterfont}{#2}{#3}{#4}{#5}{#6}%
-\immediate\write\m@ne{}%
-\PackageInfo{mathastext}{Latin letters in math version `#2\string'\MessageBreak
+ \ifmst@noletters
+ \else
+ \immediate\write\m@ne{}%
+ \PackageInfo{mathastext}%
+ {Latin letters in math version `#2\string'\MessageBreak
declared\on@line\MessageBreak
will use the fonts #3/#4/#5(\mst@bold)/#6\@gobble}%
-\immediate\write\m@ne{}%
+ \fi
+ \immediate\write\m@ne{}%
\expandafter\edef\csname mst@ltshape@\mst@version\endcsname{#6}%
\fi
- \else % #1 not empty
+ \else
+% \end{macrocode}
+% |#1| not empty.
+% \begin{macrocode}
\SetSymbolFont{mtletterfont}{#2}{#3}{#4}{#5}{#1}%
-\immediate\write\m@ne{}%
-\PackageInfo{mathastext}{Latin letters in math version `#2\string'\MessageBreak
+ \immediate\write\m@ne{}%
+ \PackageInfo{mathastext}%
+ {\ifmst@noletters
+ \else
+ Latin letters in math version `#2\string'\MessageBreak
declared\on@line\MessageBreak
will use the font #3/#4/#5/#1%
\ifmst@frenchmath\space(uppercase: #6)\fi\MessageBreak
+ \fi
Other characters (digits, ...) and
\protect\log-like names\MessageBreak
- will be in `#6\string' shape\@gobble}%
-\immediate\write\m@ne{}%
- \expandafter\edef\csname mst@ltshape@\mst@version\endcsname{#1}%
+ \ifmst@noletters
+ will use the font #3/#4/#5/#6%
+ \else
+ will be in `#6\string' shape%
+ \fi\@gobble}%
+ \immediate\write\m@ne{}%
+ \expandafter\edef\csname mst@ltshape@\mst@version\endcsname{#1}%
\fi
% \end{macrocode}
-% Here and elsewhere |1.3za| has removed an
+% Here and elsewhere \mstrelease{1.3za} has removed an
% \cs{ifmst@nonormalbold} conditional.
% \begin{macrocode}
\SetMathAlphabet{\Mathnormalbold}{#2}{#3}{#4}{\mst@bold}%
{\csname mst@ltshape@\mst@version\endcsname}%
\SetSymbolFont{mtoperatorfont}{#2}{#3}{#4}{#5}{#6}%
% \end{macrocode}
-% Since |1.3za| (and prior to |1.15f|) these math alphabet
+% Since \mstrelease{1.3za} (and prior to \mstrelease{1.15f}) these math alphabet
% commands are always defined.
% \begin{macrocode}
\SetMathAlphabet{\Mathbf}{#2}{#3}{#4}{\mst@bold}{#6}
@@ -9765,12 +10487,12 @@ defaultbf,defaultit,defaultsf,defaulttt}}
% options as well as on the (local to this version) shapes for letters
% and digits.
%
-% |1.3x| replaces \cs{updefault} by \cs{MTgreekupdefault} and
+% \mstrelease{1.3y} replaces \cs{updefault} by \cs{MTgreekupdefault} and
% \cs{itdefault} by \cs{MTgreekitdefault}. It also prepares to store
% two Boolean settings saying whether lowercase respectively uppercase
% Greek letters will use `upright' or `italic' (|LGRgreek(s)| only).
%
-% The |1.3x| refactoring of |LGRgreek| is done via a decoupling,
+% The \mstrelease{1.3y} refactoring of |LGRgreek| is done via a decoupling,
% thus things are done here under |selfGreek| or other Greek options
% which ultimately serve nothing and conversely things are done here
% for |LGRgreek| which are superfluous.
@@ -9813,7 +10535,7 @@ defaultbf,defaultit,defaultsf,defaulttt}}
\mst@greek@upper@uptrue
\fi
% \end{macrocode}
-% |1.3za| refactoring to reduce code duplication; I briefly considered
+% \mstrelease{1.3za} refactoring to reduce code duplication; I briefly considered
% trying to enhance \cs{MTgreekfont} to work also with |LGRgreeks| and
% |selfGreeks| but I have dropped the idea for now.
% \begin{macrocode}
@@ -9875,7 +10597,7 @@ defaultbf,defaultit,defaultsf,defaulttt}}
\expandafter\mst@dothe@hyphenstuff\mst@tmp
\fi
\fi
-}% \MTDeclareVersion@@
+}%
\let\MathastextDeclareVersion\MTDeclareVersion
% \end{macrocode}
% \end{macro}
@@ -9890,45 +10612,48 @@ defaultbf,defaultit,defaultsf,defaulttt}}
% additionally to the math fonts. Present already in the initial
% version of the package (January 2011.)
%
-% |1.15|: some modifications for the subdued option vs LGRgreek and
+% \mstrelease{1.15}: some modifications for the subdued option vs LGRgreek and
% for the math muskips after \cs{exists} and \cs{forall}.
%
-% |1.2|: with the subdued option sets the math alphabets in the
+% \mstrelease{1.2}: with the subdued option sets the math alphabets in the
% normal and bold math versions do not apply to operator
% names and non-alphabetical symbols. The switch for braces
% is left as it is.
%
-% |1.2b|: with the subdued option, the italic corrections are not added.
+% \mstrelease{1.2b}: with the subdued option, the italic corrections are not added.
% Else, we check the shape of letters in this version. Also, there was a bug
-% since |1.15|: the values of the math skips were taken not from the
+% since \mstrelease{1.15}: the values of the math skips were taken not from the
% settings for the math version (\#2) but from those of the optional argument
% (\#1), if present...
%
-% |1.3|: activation of italic corrections is now separated from actual math
+% \mstrelease{1.3}: activation of italic corrections is now separated from actual math
% activation of letters.
%
-% |1.3c|: a starred variant is added which does not modify the text fonts,
+% \mstrelease{1.3c}: a starred variant is added which does not modify the text fonts,
% only the math set-tup.
%
-% |1.3d|: replaced in |\MTversion@| things like |\edef\mst@encoding{...}| and
-% |\renewcommand{\encodingdefault}{\mst@@encoding}| by
+% \mstrelease{1.3d}: replaced in |\MTversion@| things like |\edef\mst@encoding{...}| and
+% \centeredline{|\renewcommand{\encodingdefault}{\mst@@encoding}|} by
% |\edef\encodingdefault{...}| etc\dots All those |\mst@@...| things were
% useless. I also redefine |\seriesdefault| rather than |\mddefault|.
%
-% |1.3d|: mechanism of restoration of Greek in subdued normal and bold
+% \mstrelease{1.3d}: mechanism of restoration of Greek in subdued normal and bold
% versions has been to all cases, and not only for the
% |LGRgreek| option.
%
-% |1.3u|: version savvy (i.e.\@ font-encoding savvy) minus sign,
+% \mstrelease{1.3u}: version savvy (i.e.\@ font-encoding savvy) minus sign,
% \cs{hbar}, \cs{imath}, math accents.
%
-% |1.3x|: Booleans recovered from stored data in the math version will
+% \mstrelease{1.3y}: Booleans recovered from stored data in the math version will
% configure the things \cs{MTcustomgreek} do, under |LGRgreek| option.
% \begin{macrocode}
-\newcommand*\MTversion {\@ifstar\MTversion@s\MTversion@ }
-\newcommand*\MTversion@s [1]{\mathversion{#1}\MTversion@@ }
+\newcommand*\MTversion {\@ifstar\MTversion@s\MTversion@}
+\newcommand*\MTversion@s [1]{\mathversion{#1}\MTversion@@}
\newcommand*\MTversion@ [2][]{%
- \mathversion{#2}% defines \math@version as expanded #2
+% \end{macrocode}
+% This defines \cs{math@version} as expanded |#2|.
+% \begin{macrocode}
+ \mathversion{#2}%
\edef\mst@tmpa{#1}%
\ifx\mst@tmpa\empty
\let\mst@tmp\math@version
@@ -9946,14 +10671,14 @@ defaultbf,defaultit,defaultsf,defaulttt}}
\edef\ttdefault {\csname mst@ttdefault@\mst@tmp\endcsname}%
\usefont{\encodingdefault}{\familydefault}{\seriesdefault}{\shapedefault}%
\MTversion@@
-}% \MTversion@
+}%
% \end{macrocode}
-% |1.3j| has a stronger subdued which does \cs{MTnormalprime},
+% \mstrelease{1.3j} has a stronger subdued which does \cs{MTnormalprime},
% \cs{MTnormalexists}, \cs{MTnormalforall} rather than setting the skips to
% |0mu|. Hence \cs{MTversion} by default should do \cs{MTprimedoesskip},
% \cs{MTexistsdoesskip}, \cs{MTforalldoesskip}.
%
-% |1.3u| drops the argument, as the info is in \cs{math@version} from
+% \mstrelease{1.3u} drops the argument, as the info is in \cs{math@version} from
% \LaTeX2e code.
% \begin{macrocode}
\newcommand*\MTversion@@ {%
@@ -9979,18 +10704,18 @@ defaultbf,defaultit,defaultsf,defaulttt}}
\edef\mst@tmpa{\csname mst@ltshape@\math@version\endcsname}%
\edef\mst@tmpb{\csname mst@shape@\math@version\endcsname}%
% \end{macrocode}
-% |v1.15c|: extending subdued to LGRgreek.
+% \mstrelease{1.15c}: extending subdued to LGRgreek.
%
-% |v1.15f|: subdueing math alphabets in a simpler way than in |1.15e|.
+% \mstrelease{1.15f}: subdueing math alphabets in a simpler way than in \mstrelease{1.15e}.
%
-% |v1.2b|: subdueing the activation of characters in math mode.
+% \mstrelease{1.2b}: subdueing the activation of characters in math mode.
%
-% |v1.2d|: special treatment of the asterisk.
+% \mstrelease{1.2d}: special treatment of the asterisk.
%
-% |v1.3d|: extended LGRgreek mechanism of activation/restoration of Greek to all
+% \mstrelease{1.3d}: extended LGRgreek mechanism of activation/restoration of Greek to all
% cases.
%
-% |v1.3j|: use of \cs{MTeverymathdefault}, which includes \cs{MTicinmath}, but
+% \mstrelease{1.3j}: use of \cs{MTeverymathdefault}, which includes \cs{MTicinmath}, but
% must be corrected then according to shape of letters and presence or absence
% of option |frenchmath|. We do only |\def\mst@ITcorr{\ifnum\fam=\m@ne\/\fi}|
% and not \cs{MTICinmath} to not overwrite some user-defined
@@ -9999,6 +10724,12 @@ defaultbf,defaultit,defaultsf,defaulttt}}
% user customizing possibilities, but if I moved it later, I would possibly
% have to put inside the \cs{MTicinmath} the check for |it| ot |sl|. Similary
% the \cs{MTcustomgreek} always executed (if not |subdued|).
+%
+% MEMO: \cs{MTeverymathdefault} is executed \emph{also} if in |subdued| mode
+% but there is a \cs{MTeverymathoff} done next in the \emph{normal} and
+% \emph{bold} version. It does \cs{MTicinmath} and \cs{MTmathactivedigits}
+% which however are no-ops (only partly for the former, and for the latter
+% always anyhow if no option |activedigits|) in subdude mode.
% \begin{macrocode}
\MTmathoperatorsobeymathxx
\MTeverymathdefault
@@ -10009,7 +10740,7 @@ defaultbf,defaultit,defaultsf,defaulttt}}
\@for\mst@tmpc:=it,sl\do{\ifx\mst@tmpc\mst@tmpb\MTnoICinmath\fi}%
\fi
% \end{macrocode}
-% |1.3j| has a stronger subdued which does \cs{MTnormalprime},
+% \mstrelease{1.3j} has a stronger subdued which does \cs{MTnormalprime},
% \cs{MTnormalexists}, \cs{MTnormalforall} rather than simply setting the
% skips to |0mu|. Note: \cs{MTnormalprime} is done as part of
% \cs{MTeverymathoff}.
@@ -10027,13 +10758,18 @@ defaultbf,defaultit,defaultsf,defaulttt}}
\MTmathoperatorsdonotobeymathxx
\MTnormalexists
\MTnormalforall
+% \end{macrocode}
+% \mstrelease{1.4} has kept \cs{MTmathstandardletters} inside
+% \cs{MTeverymathoff} but its action is now quite different from earlier
+% situation as it resets mathcodes from active to normal status on the spot.
+% \begin{macrocode}
\MTeverymathoff
\MTresetnewmcodes
% \end{macrocode}
-% |1.3t| adds better compatibility with |subdued| mode for
+% \mstrelease{1.3t} adds better compatibility with |subdued| mode for
% |\imath/\jmath| and perfect compatibility for the minus sign.
%
-% |1.3u| extends this further to allow per-math-version meanings
+% \mstrelease{1.3u} extends this further to allow per-math-version meanings
% for them.
% \begin{macrocode}
\mst@subduedhbar
@@ -10056,7 +10792,14 @@ defaultbf,defaultit,defaultsf,defaulttt}}
\else
\mst@setalphabets
% \end{macrocode}
-% |1.3x| addition for \cs{MTcustomgreek} under |LGRgreeks| option.
+% \mstrelease{1.3y} addition for \cs{MTcustomgreek} under |LGRgreeks| option.
+%
+% MEMO: the needed mathematical re-activation of letters when switching from
+% \emph{normal} or \emph{bold} to a non-|subdued| math version has already
+% been done above from the \cs{MTicinmath} which is part of
+% \cs{MTeverymathdefault}.
+%
+% MEMO: idem for digits under option |activedigits|.
% \begin{macrocode}
\expandafter\let\csname ifmst@greek@upper@up\expandafter\endcsname
\csname ifmst@greek@\math@version @upper@up\endcsname
@@ -10071,19 +10814,22 @@ defaultbf,defaultit,defaultsf,defaulttt}}
\fi
\else
% \end{macrocode}
-% |1.3x| addition for \cs{MTcustomgreek} under |LGRgreek| option.
+% \mstrelease{1.3y} addition for \cs{MTcustomgreek} under |LGRgreek| option.
+%
+% MEMO: the mathematical activation of letters happened above from
+% \cs{MTeverymathdefault}. Idem if |activedigits| for digits.
% \begin{macrocode}
\expandafter\let\csname ifmst@greek@upper@up\expandafter\endcsname
\csname ifmst@greek@\math@version @upper@up\endcsname
\expandafter\let\csname ifmst@greek@lower@up\expandafter\endcsname
\csname ifmst@greek@\math@version @lower@up\endcsname
- \MTcustomgreek % new with 1.3d
+ \MTcustomgreek
\mst@nonsubduedhbar
\mst@nonsubduedinodot
\mst@nonsubduedmathaccents
\mst@nonsubduedminus
\fi
-}% \MTversion@@
+}%
\let\MathastextVersion\MTversion
\let\Mathastextversion\MTversion
\let\MTVersion\MTversion
@@ -10100,7 +10846,7 @@ defaultbf,defaultit,defaultsf,defaulttt}}
\MTfamily{#3}
\MTseries{#4}
\MTshape{#5}
- \ifmst@italic\MTlettershape{\itdefault}\fi % was missing in v 1.14 and prior
+ \ifmst@italic\MTlettershape{\itdefault}\fi
\edef\mst@tmp{#1}
\ifx\mst@tmp\empty\else\MTlettershape{#1}\fi
\Mathastext}
@@ -10113,23 +10859,23 @@ defaultbf,defaultit,defaultsf,defaulttt}}
% preamble and any number of time, the last one is the
% one that counts.
%
-% In version |1.1| we have two fonts: they only differ in
+% In version \mstrelease{1.1} we have two fonts: they only differ in
% shape. The |mtletterfont| is for letters, and the
% |mtoperatorfont| for digits and log-like operator
% names. The default is that both are upright.
%
-% Starting with version |1.12|, an optional argument makes
+% Starting with version \mstrelease{1.12}, an optional argument makes
% \cs{Mathastext} act as the declaration of a math
% version, to be later used in the document.
%
-% Versions |1.15x| brought some adaptations related to the subdued
+% Versions \mstrelease{1.15x} brought some adaptations related to the subdued
% option.
%
-% |1.3c| adds a second optional parameter to inherit previous settings
+% \mstrelease{1.3c} adds a second optional parameter to inherit previous settings
% from another version; mostly done to inherit the bold version fonts for
% symbols and large symbols. This is done in |\MTDeclareVersion|.
%
-% |1.3j| moves the code related to \cs{MTicinmath} from \cs{Mathastext@} to
+% \mstrelease{1.3j} moves the code related to \cs{MTicinmath} from \cs{Mathastext@} to
% \cs{AtBeginDocument} (code depending on whether |subdued| option in use).
% But we omit for this from \cs{MTicinmath} the \cs{MTmathactiveletters}
% and issue the latter during loading of package, hence allowing
@@ -10139,15 +10885,15 @@ defaultbf,defaultit,defaultsf,defaulttt}}
% command without optional parameter does not any |\SetSymbolFont| etc...
% but it has a few other tasks to complete nevertheless.
%
-% |1.3u| fixes some long-standing bug that \cs{Mathastext} did not repeat some
+% \mstrelease{1.3u} fixes some long-standing bug that \cs{Mathastext} did not repeat some
% font-encoding dependent things: they got done only once during package
% loading (things regarding the \cs{hbar}, \cs{imath}, the math accents and
% the minus sign). They are now part of the contents of \cs{Mathastext} macro
% itself (which is executed during package loading).
%
-% |1.3x| has refactored the |LGRgreek| associated math fonts.
+% \mstrelease{1.3y} has refactored the |LGRgreek| associated math fonts.
% \begin{macrocode}
-\def\Mathastext {\@ifnextchar [\Mathastext@declare\Mathastext@ }
+\def\Mathastext {\@ifnextchar[\Mathastext@declare\Mathastext@}% ]
\def\Mathastext@declare [#1]{%
\edef\mst@tmp{#1}%
\ifx\mst@tmp\empty
@@ -10156,7 +10902,7 @@ defaultbf,defaultit,defaultsf,defaulttt}}
\fi
\Mathastext@
{\MTDeclareVersion[\mst@ltsh]{#1}{\mst@enc}{\mst@fam}{\mst@ser}{\mst@opsh}}%
-}% \Mathastext@declare
+}%
\def\Mathastext@ {%
\mst@update@greeksh
\edef\mst@encoding@normal{\mst@enc}%
@@ -10187,7 +10933,7 @@ defaultbf,defaultit,defaultsf,defaulttt}}
\edef\mst@prime@skip@bold{\mst@prime@skip}%
\ifmst@subdued
% \end{macrocode}
-% Since |1.3j| this branch is actually almost superfluous, as entering
+% Since \mstrelease{1.3j} this branch is actually almost superfluous, as entering
% |normal| or |bold| with \cs{MTversion} does \cs{MTnormalexists},
% \cs{MTnormalforall}, and \cs{MTnormalprime}. But some default values are
% needed if the user insists on issuing \cs{MTexistsdoesskip}, etc...
@@ -10199,7 +10945,7 @@ defaultbf,defaultit,defaultsf,defaulttt}}
\def\mst@exists@skip@bold{0mu}%
\def\mst@forall@skip@bold{0mu}%
\def\mst@prime@skip@bold{0mu}%
- \else % not subdued
+ \else
\ifmst@italic
\ifmst@frenchmath
\mst@exists@muskip\mst@exists@skip\relax
@@ -10220,8 +10966,8 @@ defaultbf,defaultit,defaultsf,defaulttt}}
\fi
\fi
% \end{macrocode}
-% Here and elsewhere |1.3za| has removed usage of an
-% \cs{ifmst@nonormalbold} conditional which was added at |1.15f|.
+% Here and elsewhere \mstrelease{1.3za} has removed usage of an
+% \cs{ifmst@nonormalbold} conditional which was added at \mstrelease{1.15f}.
% \begin{macrocode}
\SetMathAlphabet{\Mathnormalbold}{normal}{\mst@encoding@normal}%
{\mst@family@normal}%
@@ -10249,7 +10995,7 @@ defaultbf,defaultit,defaultsf,defaulttt}}
{\mst@series@bold}%
{\mst@shape@bold}%
% \end{macrocode}
-% |1.3za| removes the |1.15f| added conditional checks.
+% \mstrelease{1.3za} removes the \mstrelease{1.15f} added conditional checks.
% \begin{macrocode}
\SetMathAlphabet{\Mathbf}{normal}{\mst@encoding@normal}%
{\mst@family@normal}%
@@ -10283,10 +11029,10 @@ defaultbf,defaultit,defaultsf,defaulttt}}
{\mst@ttdefault@bold}%
{\mst@series@bold}%
{\mst@shape@bold}%
- \fi % de \ifmst@subdued
+ \fi
% \end{macrocode}
% \begin{macro}{\MathEulerBold}
-% |1.14c|: We reset |mteulervm| and \cs{MathEulerBold} here as the
+% \mstrelease{1.14c}: We reset |mteulervm| and \cs{MathEulerBold} here as the
% variant for bold may have been changed by the user via
% \cs{Mathastextboldvariant}|{m}|; and we should keep this local to
% math versions.
@@ -10309,9 +11055,9 @@ defaultbf,defaultit,defaultsf,defaulttt}}
% \begin{macro}{selfGreek*}
% LGRgreek, LGRgreeks, selfGreek, and selfGreeks options.
%
-% |1.3x| has refactored the |LGRgreek| associated math fonts.
+% \mstrelease{1.3y} has refactored the |LGRgreek| associated math fonts.
%
-% |1.3za| adds the math alphabets \cs{mathgreekitbold} and
+% \mstrelease{1.3za} adds the math alphabets \cs{mathgreekitbold} and
% \cs{mathgreekupbold}.
% And it executes this code also in |subdued| mode, because
% anyhow the symbolfonts |mtgreekup| and |mtgreekit| and
@@ -10352,7 +11098,7 @@ defaultbf,defaultit,defaultsf,defaulttt}}
% \end{macrocode}
% \end{macro}
% \end{macro}
-% |1.3za| adds the log message in case of |selfGreek| option.
+% \mstrelease{1.3za} adds the log message in case of |selfGreek| option.
% \begin{macrocode}
\ifmst@subdued
\else
@@ -10380,7 +11126,7 @@ defaultbf,defaultit,defaultsf,defaulttt}}
\mst@infoline{Other characters (digits, ...) and \string\log-like names will be}%
\mst@infoline{typeset with the \mst@shape@normal\space shape.}%
\fi
- \fi % end of else branch \ifmst@subdued
+ \fi
\ifmst@nohbar\else
\mst@infoline{\string\hbar}%
\mst@dothe@hbarstuff
@@ -10415,9 +11161,9 @@ defaultbf,defaultit,defaultsf,defaulttt}}
\let\mst@varfam@minus@mvbold\mst@varfam@minus@mvnormal
\fi
\fi
- \fi % minus
+ \fi
% \end{macrocode}
-% |1.3zb| moves this info line last and also explicitly mentions |italic| or
+% \mstrelease{1.3zb} moves this info line last and also explicitly mentions |italic| or
% |frenchmath| (here and at some other locations above).
% \begin{macrocode}
\ifmst@subdued
@@ -10427,7 +11173,7 @@ defaultbf,defaultit,defaultsf,defaulttt}}
\mst@infoline{The \ifmst@frenchmath frenchmath \else
italic \fi option is in effect.}%
\fi
-}% \Mathastext@
+}%
\let\mathastext\Mathastext
\Mathastext
% \end{macrocode}
@@ -10488,14 +11234,23 @@ defaultbf,defaultit,defaultsf,defaulttt}}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\MTeverymathoff}
-% |1.3i 2016/01/06| Compatibility patch with |\url| from |url.sty| and
+% \mstrelease{1.3i} |2016/01/06| Compatibility patch with |\url| from |url.sty| and
% |\url/\nolinkurl| from |hyperref.sty|.
%
-% |1.3j 2016/01/15| renamed the macro from |\MTactivemathoff| to
+% \mstrelease{1.3j} |2016/01/15| renamed the macro from |\MTactivemathoff| to
% |\MTeverymathoff|, as it is not exclusively a matter of math active
% characters due to |\MTeasynonlettersdonotobeymathxx|.
%
-% |1.3o 2016/05/03| adds \cs{MTdonotfixfonts}. Operant with \LuaLaTeX\ only.
+% \mstrelease{1.3o} |2016/05/03| adds \cs{MTdonotfixfonts}. Operant with
+% \LuaLaTeX\ only.
+%
+% \mstrelease{1.4} |2024/07/20| keeps the \cs{MTmathstandardletters} as a
+% component of \cs{MTeverymathoff}. It was checked that \ctanpkg{url} and
+% \ctanpkg{hyperref} do not change mathcodes of ascii letters prior to
+% location where \cs{MTeverymathoff} gets executed, so nothing is
+% overwritten, despite the new mode of action of \cs{MTmathstandardletters}.
+%
+% \mstrelease{1.4} has \cs{MTmathstandarddigits} and inserts it into \cs{MTeverymathoff}.
% \begin{macrocode}
\newcommand*\MTeverymathoff {%
\MTnormalasterisk
@@ -10503,6 +11258,7 @@ defaultbf,defaultit,defaultsf,defaulttt}}
\MTnonlettersdonotobeymathxx
\MTeasynonlettersdonotobeymathxx
\MTmathstandardletters
+ \MTmathstandarddigits
\MTdonotfixfonts
}%
\AtBeginDocument {%
@@ -10513,7 +11269,7 @@ defaultbf,defaultit,defaultsf,defaulttt}}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\MTeverymathdefault}
-% |1.3j 2016/01/15| Customizable command which gets executed by
+% \mstrelease{1.3j} |2016/01/15| Customizable command which gets executed by
% \cs{MTversion} except when switching to |normal/bold| if option |subdued|.
% The included \cs{MTicinmath} does \cs{MTmathactiveletters} which will also
% activate the math skips around letters.
@@ -10537,13 +11293,18 @@ defaultbf,defaultit,defaultsf,defaulttt}}
% it will not be overruled (as it is delayed at begin document to after \mst
% dealings).
%
-% |1.3o 2016/05/03| adds \cs{MTfixfonts}. Operant with \LuaLaTeX\ only.
+% \mstrelease{1.3o} |2016/05/03| adds \cs{MTfixfonts}. Operant with
+% \LuaLaTeX\ only.
+%
+% \cs{MTmathactivedigits} of \mstrelease{1.4} is a no-op except under option
+% |activedigits|.
% \begin{macrocode}
\newcommand*\MTeverymathdefault {%
\MTactiveasterisk
\MTprimedoesskip
\MTeasynonlettersobeymathxx
\MTicinmath
+ \MTmathactivedigits
\MTfixfonts
}%
% \end{macrocode}
@@ -10552,48 +11313,54 @@ defaultbf,defaultit,defaultsf,defaulttt}}
% \def~{\rlap}
% \begin{macro}{Things to do last ~{``at begin document''}}
% \let~\temp
+%
+% \mstrelease{1.4} has a significant change here that mathematical
+% activation of ascii letters is now not incorporated into the \cs{everymath}
+% and \cs{everydisplay}.
% \begin{macrocode}
-\AtBeginDocument{%
- \everymath\expandafter{\the\everymath
- \mst@the\mst@do@nonletters \let\mst@the\@gobble
- \mst@theeasy\mst@do@easynonletters \let\mst@theeasy\@gobble
- \mst@thef\mst@do@az \let\mst@thef\@gobble
- \mst@theF\mst@do@AZ \let\mst@theF\@gobble}%
- \everydisplay\expandafter{\the\everydisplay
- \mst@the\mst@do@nonletters \let\mst@the\@gobble
- \mst@theeasy\mst@do@easynonletters \let\mst@theeasy\@gobble
- \mst@thef\mst@do@az \let\mst@thef\@gobble
- \mst@theF\mst@do@AZ \let\mst@theF\@gobble}%
-% \end{macrocode}
-% |1.3j|: moved here to be executed at begin document (and not from inside
+\ifmst@everymath
+ \AtBeginDocument{%
+ \everymath\expandafter{\the\everymath
+ \mst@the\mst@do@nonletters \let\mst@the\@gobble
+ \mst@theeasy\mst@do@easynonletters \let\mst@theeasy\@gobble
+ }%
+ \everydisplay\expandafter{\the\everydisplay
+ \mst@the\mst@do@nonletters \let\mst@the\@gobble
+ \mst@theeasy\mst@do@easynonletters \let\mst@theeasy\@gobble
+ }%
+ }
+\fi
+% \end{macrocode}
+% \mstrelease{1.3j}: moved here to be executed at begin document (and not from inside
% \cs{Mathastext@}.) The \cs{MTeverymathoff} does: \cs{MTnormalasterisk},
% \cs{MTnormalprime}, \cs{MTnonlettersdonotobeymathxx},
% \cs{MTeasynonlettersdonotobeymathxx}, \cs{MTmathstandardletters}.
%
-% |1.3m|: doing \cs{MTmathactiveletters} in subdued mode immediately after
+% \mstrelease{1.3m}: doing \cs{MTmathactiveletters} in subdued mode immediately after
% |\begin{document}| resulted in errors because \cs{mst@itcorr} had been left
% undefined. We thus add \cs{MTnoicinmath} to the subdued initialization.
%
-% Since |1.3n| there is \cs{MTresetnewmcodes} which needs
+% Since \mstrelease{1.3n} there is \cs{MTresetnewmcodes} which needs
% \cs{mst@originalnewmcodes@}, itself defined at begin document. Thus we have
-% wrapped the whole thing in \cs{AtEndOfPackage} (at |1.3u| whole code
+% wrapped the whole thing in \cs{AtEndOfPackage} (at \mstrelease{1.3u} whole code
% directly moved at end of package).
%
-% And |1.3p| adds here \cs{MTcustomizenewmcodes} which had been regrettably
-% forgotten by |1.3n|.
+% And \mstrelease{1.3p} adds here \cs{MTcustomizenewmcodes} which had been regrettably
+% forgotten by \mstrelease{1.3n}.
%
-% |1.3t| adds some extras to handle correctly the minus sign and
+% \mstrelease{1.3t} adds some extras to handle correctly the minus sign and
% dotless i and j in subdued mode, even in case of usage with fontspec.
%
-% |1.3u| similarly lets math accents be correctly subdued.
+% \mstrelease{1.3u} similarly lets math accents be correctly subdued.
%
-% |1.3v| adapts to \cs{hbar} and math accents now being robust with \LaTeX{}
+% \mstrelease{1.3v} adapts to \cs{hbar} and math accents now being robust with \LaTeX{}
% |2019-10-01| or later.
%
-% |1.3w| pays attention to the fact that \cs{hbar} may well be
+% \mstrelease{1.3w} pays attention to the fact that \cs{hbar} may well be
% a |\mathchar| and not a robust macro! And no need to worry about
% \cs{hbar<space>} finally in revised code.
% \begin{macrocode}
+\AtBeginDocument{%
\MTcustomizenewmcodes
\let\mst@original@hbar\hbar
\let\mst@original@imath\imath
@@ -10617,21 +11384,18 @@ defaultbf,defaultit,defaultsf,defaulttt}}
\MTresetnewmcodes
\MTnoicinmath
\MTmathoperatorsdonotobeymathxx
- %\mst@subduedhbar
\let\inodot\imath
\let\jnodot\jmath
- %\mst@subduedmathaccents
\mst@subduedminus
\else
\mst@nonsubduedhbar
% \end{macrocode}
-% |1.3v| needs this \cs{mst@nonsubduedmathaccents} to get executed later (see
+% \mstrelease{1.3v} needs \cs{mst@nonsubduedmathaccents} to get executed later (see
% code comments for \cs{mst@dothe@mathaccentsstuff}).
% \begin{macrocode}
- % \mst@nonsubduedmathaccents % will get executed later
\mst@nonsubduedminus
% \end{macrocode}
-% |1.3j|: an earlier version of this code was earlier part of \cs{Mathastext@}.
+% \mstrelease{1.3j}: an earlier version of this code was earlier part of \cs{Mathastext@}.
% As we are now in \cs{AtBeginDocument} we try to be careful not to overwrite
% \cs{MTicinmath}, \cs{MTnoicinmath}, \cs{MTicalsoinmathxx}, ... if issued by
% the user in the preamble, though. And we do not execute
@@ -10652,12 +11416,12 @@ defaultbf,defaultit,defaultsf,defaulttt}}
\fi
\fi
\fi
-}% \AtBeginDocument
+}%
\AtEndOfPackage{\AtBeginDocument{\ifmst@subdued\else\mst@nonsubduedmathaccents\fi}}%
% \end{macrocode}
% \end{macro}
% \begin{macro}{subdued}
-% |1.15|: The subdued code was initiated in May 2011. I returned to
+% \mstrelease{1.15}: The subdued code was initiated in May 2011. I returned to
% |mathastext| on Sep 24, 2012, and decided to complete what I had started
% then, but in the mean time I had forgotten almost all of the little I knew
% about \LaTeX{} macro programming.
@@ -10671,7 +11435,7 @@ defaultbf,defaultit,defaultsf,defaulttt}}
% $^1$but the \emph{euler} package for example
% assigns the digits to the \emph{letters} symbol font...
%
-% |1.15d|: Oct 13, 2012. The \cs{mathcode} thing has to be used with care
+% \mstrelease{1.15d}: Oct 13, 2012. The \cs{mathcode} thing has to be used with care
% under Unicode engines. Unfortunately the \cs{luatexUmathcode} macro is
% helpless as it is not possible to know if it will return a legacy mathcode
% or a Unicode mathcode. On the other hand the much saner
@@ -10683,14 +11447,14 @@ defaultbf,defaultit,defaultsf,defaulttt}}
% treats identically under both unicode engines the equal and minus signs (and
% the vertical bar).}
%
-% |1.15e|: Oct 22, 2012. I add the necessary things to also subdue the
+% \mstrelease{1.15e}: Oct 22, 2012. I add the necessary things to also subdue the
% \cs{mathbf}, \cs{mathit}, \cs{mathsf} and \cs{mathtt} macros (previous
% version only took care of the symbol alphabets \cs{mathnormal} and
-% \cs{mathrm}.) [update: |1.15f| does that in a completely different and much
+% \cs{mathrm}.) [update: \mstrelease{1.15f} does that in a completely different and much
% simpler way] Notice that the package defines a \cs{mathnormalbold} macro,
% but it will not be subdued in the normal and bold math versions.
%
-% |1.15f|: Oct 23, 2012. The previous version of the code queried the math
+% \mstrelease{1.15f}: Oct 23, 2012. The previous version of the code queried the math
% family of a, respectively 1, to guess and then extract the fonts to be
% reassigned to mtletterfont and mtoperatorfont (which is done at the end of
% this .sty file). The present code simply directly uses letters and operators
@@ -10705,23 +11469,24 @@ defaultbf,defaultit,defaultsf,defaulttt}}
% to revert these changes (and one would have to do even more hacking for
% |\mathversion{normal}| and not only |\MTversion{normal}| to work).
%
-% |1.15f|: and also I take this opportunity to do the subdued math
+% \mstrelease{1.15f}: and also I take this opportunity to do the subdued math
% alphabets things in a much much easier way, see below.
%
-% |1.3s 2018/08/21|: I have half-forgotten the reasons for modifiying the
+% \mstrelease{1.3s} |2018/08/21|: I have half-forgotten the reasons for modifiying the
% font encoding to current |\encodingdefault|, but at any rate this should
% not be done in a \ctanpkg{fontspec} context, encoding default being (now) |TU| it
% is very unlikely modifying from |TU| or to |TU| from something else will
-% do any good.^^A See
+% do any good.
+%^^A See
%^^A \centeredline{\url{https://tex.stackexchange.com/questions/444565/mathastext-wrong-digits-in-math-mode/}}
%^^A for original report.
% I add workaround here for case of \ctanpkg{fontspec} being
% detected via the |\encodingdefault| setting.
%
-% |1.3t 2018/08/22|: the |1.3s| fix erroneously removed the
+% \mstrelease{1.3t} |2018/08/22|: the \mstrelease{1.3s} fix erroneously removed the
% |OT1->T1| replacement in |TU| context.
%
-% |1.3u|: the whole thing will only get executed At Begin
+% \mstrelease{1.3u}: the whole thing will only get executed At Begin
% Document.
%
% I realize extremely late (|2023/12/28|) I never said explicitly anywhere
@@ -10734,7 +11499,7 @@ defaultbf,defaultit,defaultsf,defaulttt}}
% behavior of the package.
% \begin{macrocode}
\ifmst@subdued
-\AtBeginDocument{%
+ \AtBeginDocument{%
\def\mst@reserved#1\getanddefine@fonts\symletters#2#3\@nil{%
\def\mst@normalmv@letter{#2}}%
\expandafter\mst@reserved\mv@normal\@nil
@@ -10773,15 +11538,19 @@ defaultbf,defaultit,defaultsf,defaulttt}}
\else
\mst@tmp@enc
\fi/\mst@reste\endcsname}%
- \expandafter\SetSymbolFont@ \expandafter\mv@normal\mst@normalmv@letter\symmtletterfont
- \expandafter\SetSymbolFont@ \expandafter\mv@bold\mst@boldmv@letter\symmtletterfont
- \expandafter\SetSymbolFont@ \expandafter\mv@normal\mst@normalmv@operator\symmtoperatorfont
- \expandafter\SetSymbolFont@ \expandafter\mv@bold\mst@boldmv@operator\symmtoperatorfont
-\immediate\write\m@ne{}%
+ \expandafter\SetSymbolFont@
+ \expandafter\mv@normal\mst@normalmv@letter\symmtletterfont
+ \expandafter\SetSymbolFont@
+ \expandafter\mv@bold\mst@boldmv@letter\symmtletterfont
+ \expandafter\SetSymbolFont@
+ \expandafter\mv@normal\mst@normalmv@operator\symmtoperatorfont
+ \expandafter\SetSymbolFont@
+ \expandafter\mv@bold\mst@boldmv@operator\symmtoperatorfont
+ \immediate\write\m@ne{}%
\PackageInfo{mathastext}{...entering subdued mode...\MessageBreak ...done}%
-\immediate\write\m@ne{}%
-}% \AtBeginDocument
-\fi % \ifmst@subdued
+ \immediate\write\m@ne{}%
+ }%
+\fi
% \end{macrocode}
%^^A In the short-lived |1.15e| I was doing the following for alphabets:\\
%^^A |\def\mst@reservedc#1#2#3#4{\def\mst@normalmv@mathbf{#4#3}}|\\
diff --git a/Master/texmf-dist/source/latex/moloch/beamercolorthememoloch.dtx b/Master/texmf-dist/source/latex/moloch/beamercolorthememoloch.dtx
index d6a14105cad..f0f644acbd8 100644
--- a/Master/texmf-dist/source/latex/moloch/beamercolorthememoloch.dtx
+++ b/Master/texmf-dist/source/latex/moloch/beamercolorthememoloch.dtx
@@ -14,7 +14,7 @@
% \iffalse
%<*package>
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{beamercolorthememoloch}[2024-03-06 v0.3.0 Moloch color theme] % x-release-please-version
+\ProvidesPackage{beamercolorthememoloch}[2024-07-09 v0.4.0 Moloch color theme] % x-release-please-version
%</package>
% \fi
% \CheckSum{0}
diff --git a/Master/texmf-dist/source/latex/moloch/beamerfontthememoloch.dtx b/Master/texmf-dist/source/latex/moloch/beamerfontthememoloch.dtx
index 4748387c3cc..cc3396fe472 100644
--- a/Master/texmf-dist/source/latex/moloch/beamerfontthememoloch.dtx
+++ b/Master/texmf-dist/source/latex/moloch/beamerfontthememoloch.dtx
@@ -14,7 +14,7 @@
% \iffalse
%<*package>
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{beamerfontthememoloch}[2024-03-06 v0.3.0 Moloch font theme] % x-release-please-version
+\ProvidesPackage{beamerfontthememoloch}[2024-07-09 v0.4.0 Moloch font theme] % x-release-please-version
%</package>
% \fi
% \CheckSum{0}
@@ -27,9 +27,12 @@
%
% A |beamer| font theme sets the style of the font used in the document.
%
+%
+%
% \subsubsection{Package dependencies}
%
% \begin{macrocode}
+\RequirePackage{etoolbox}
\RequirePackage{pgfopts}
% \end{macrocode}
%
@@ -51,6 +54,188 @@
\setbeamerfont{standout}{size=\Large, series=\bfseries}
% \end{macrocode}
%
+%
+%
+% \subsubsection{Title format options}
+%
+% \begin{macro}{titleformat title}
+% Controls the format of the title.
+% \begin{macrocode}
+\pgfkeys{
+ /moloch/font/titleformat title/.cd,
+ .is choice,
+ regular/.code={%
+ \let\moloch@titleformat\@empty%
+ \setbeamerfont{title}{shape=\normalfont}%
+ },
+ smallcaps/.code={%
+ \let\moloch@titleformat\@empty%
+ \setbeamerfont{title}{shape=\scshape}%
+ },
+ allsmallcaps/.code={%
+ \let\moloch@titleformat\lowercase%
+ \setbeamerfont{title}{shape=\scshape}%
+ \PackageNote{beamerthememoloch}{%
+ Be aware that titleformat title=allsmallcaps can lead to problems%
+ }
+ },
+ allcaps/.code={%
+ \let\moloch@titleformat\uppercase%
+ \setbeamerfont{title}{shape=\normalfont}
+ \PackageNote{beamerthememoloch}{%
+ Be aware that titleformat title=allcaps can lead to problems%
+ }
+ },
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{titleformat subtitle}
+% Control the format of the subtitle.
+% \begin{macrocode}
+\pgfkeys{
+ /moloch/font/titleformat subtitle/.cd,
+ .is choice,
+ regular/.code={%
+ \let\moloch@subtitleformat\@empty%
+ \setbeamerfont{subtitle}{shape=\normalfont}%
+ },
+ smallcaps/.code={%
+ \let\moloch@subtitleformat\@empty%
+ \setbeamerfont{subtitle}{shape=\scshape}%
+ },
+ allsmallcaps/.code={%
+ \let\moloch@subtitleformat\MakeLowercase%
+ \setbeamerfont{subtitle}{shape=\scshape}%
+ \PackageNote{beamerthememoloch}{%
+ Be aware that titleformat subtitle=allsmallcaps can lead to problems%
+ }
+ },
+ allcaps/.code={%
+ \let\moloch@subtitleformat\MakeUppercase%
+ \setbeamerfont{subtitle}{shape=\normalfont}%
+ \PackageNote{beamerthememoloch}{%
+ Be aware that titleformat subtitle=allcaps can lead to problems%
+ }
+ },
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{titleformat section}
+% Controls the format of the section title.
+% \begin{macrocode}
+\pgfkeys{
+ /moloch/font/titleformat section/.cd,
+ .is choice,
+ regular/.code={%
+ \let\moloch@sectiontitleformat\@empty%
+ \setbeamerfont{section title}{shape=\normalfont}%
+ },
+ smallcaps/.code={%
+ \let\moloch@sectiontitleformat\@empty%
+ \setbeamerfont{section title}{shape=\scshape}%
+ },
+ allsmallcaps/.code={%
+ \let\moloch@sectiontitleformat\MakeLowercase%
+ \setbeamerfont{section title}{shape=\scshape}%
+ \PackageNote{beamerthememoloch}{%
+ Be aware that titleformat section=allsmallcaps can lead to problems%
+ }
+ },
+ allcaps/.code={%
+ \let\moloch@sectiontitleformat\MakeUppercase%
+ \setbeamerfont{section title}{shape=\normalfont}%
+ \PackageNote{beamerthememoloch}{%
+ Be aware that titleformat section=allcaps can lead to problems%
+ }
+ },
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{frametitleformat}
+% Control the format of the frame title.
+% \begin{macrocode}
+\pgfkeys{
+ /moloch/font/titleformat frame/.cd,
+ .is choice,
+ regular/.code={%
+ \let\moloch@frametitleformat\@empty%
+ \setbeamerfont{frametitle}{shape=\normalfont}%
+ },
+ smallcaps/.code={%
+ \let\moloch@frametitleformat\@empty%
+ \setbeamerfont{frametitle}{shape=\scshape}%
+ },
+ allsmallcaps/.code={%
+ \let\moloch@frametitleformat\MakeLowercase%
+ \setbeamerfont{frametitle}{shape=\scshape}%
+ \PackageNote{beamerthememoloch}{%
+ Be aware that titleformat frame=allsmallcaps can lead to problems%
+ }
+ },
+ allcaps/.code={%
+ \let\moloch@frametitleformat\MakeUppercase%
+ \setbeamerfont{frametitle}{shape=\normalfont}
+ \PackageNote{beamerthememoloch}{%
+ Be aware that titleformat frame=allcaps can lead to problems%
+ }
+ },
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{titleformat aliases}
+% Allows |titleformat title| et al. to be used in the |\usetheme|
+% declaration, where \LaTeX{} automatically removes all spaces.
+% \begin{macrocode}
+\pgfkeys{
+ /moloch/font/.cd,
+ titleformattitle/.code=\pgfkeysalso{titleformat title=#1},
+ titleformatsubtitle/.code=\pgfkeysalso{titleformat subtitle=#1},
+ titleformatsection/.code=\pgfkeysalso{titleformat section=#1},
+ titleformatframe/.code=\pgfkeysalso{titleformat frame=#1},
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\moloch@font@setdefaults}
+% Sets default values for font theme options.
+% \begin{macrocode}
+\newcommand{\moloch@font@setdefaults}{
+ \pgfkeys{/moloch/font/.cd,
+ titleformat title=regular,
+ titleformat subtitle=regular,
+ titleformat section=regular,
+ titleformat frame=regular,
+ }
+}
+% \end{macrocode}
+% \end{macro}
+%
+% We first define hooks to change the case format of the titles.
+%
+% \begin{macrocode}
+\def\moloch@titleformat#1{#1}
+\def\moloch@subtitleformat#1{#1}
+\def\moloch@sectiontitleformat#1{#1}
+\def\moloch@frametitleformat#1{#1}
+% \end{macrocode}
+%
+% To make the uppercase and lowercase macros work in the title, subtitle, etc.,
+% we have to patch the appropriate |beamer| commands that set their values.
+% This solution was suggested by Enrico Gregorio in an answer to
+% \href{http://tex.stackexchange.com/questions/112526/}{this StackExchange
+% question}.
+%
+%
+% \subsubsection{Process package options}
+%
+% \begin{macrocode}
+\moloch@font@setdefaults
+\ProcessPgfPackageOptions{/moloch/font}
+% \end{macrocode}
% \iffalse
%</package>
% \fi
diff --git a/Master/texmf-dist/source/latex/moloch/beamerinnerthememoloch.dtx b/Master/texmf-dist/source/latex/moloch/beamerinnerthememoloch.dtx
index 2b626d526d4..9815a0995f5 100644
--- a/Master/texmf-dist/source/latex/moloch/beamerinnerthememoloch.dtx
+++ b/Master/texmf-dist/source/latex/moloch/beamerinnerthememoloch.dtx
@@ -14,7 +14,7 @@
% \iffalse
%<*package>
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{beamerinnerthememoloch}[2024-03-06 v0.3.0 Moloch inner theme] % x-release-please-version
+\ProvidesPackage{beamerinnerthememoloch}[2024-07-09 v0.4.0 Moloch inner theme] % x-release-please-version
%</package>
% \fi
% \CheckSum{0}
@@ -173,7 +173,7 @@
% \begin{macrocode}
\setbeamertemplate{title}{
\raggedright%
- \inserttitle%
+ \moloch@titleformat{\inserttitle}%
\par%
\vspace*{0.2em}
}
@@ -184,8 +184,9 @@
% Set the subtitle on the title page.
% \begin{macrocode}
\setbeamertemplate{subtitle}{
+ \vspace*{0.1em}
\raggedright%
- \insertsubtitle%
+ \moloch@subtitleformat{\insertsubtitle}%
\par%
\vspace*{0.2em}
}
@@ -201,6 +202,7 @@
\setbeamertemplate{title separator}{
\tikzexternaldisable%
\begin{tikzpicture}
+ \mmzUnmemoizable%
\fill[fg] (0,0) rectangle (\textwidth, \moloch@titleseparator@linewidth);
\end{tikzpicture}%
\tikzexternalenable%
@@ -256,7 +258,7 @@
\begin{center}
\usebeamercolor[fg]{section title}
\usebeamerfont{section title}
- \insertsectionhead\par
+ \moloch@sectiontitleformat{\insertsectionhead}\par
\ifx\insertsubsectionhead\@empty\else
\usebeamercolor[fg]{subsection title}
\usebeamerfont{subsection title}
@@ -270,7 +272,7 @@
\raggedright
\usebeamercolor[fg]{section title}
\usebeamerfont{section title}
- \insertsectionhead\\[-1ex]
+ \moloch@sectiontitleformat{\insertsectionhead}\\[-1ex]
\usebeamertemplate*{progress bar in section page}
\par
\ifx\insertsubsectionhead\@empty\else%
@@ -338,9 +340,10 @@
\setbeamertemplate{progress bar in section page}{
\pgfmathsetlength{\moloch@progressonsectionpage}{
\textwidth * min(1,\insertframenumber/\inserttotalframenumber)
- }
- \tikzexternaldisable
+ }%
+ \tikzexternaldisable%
\begin{tikzpicture}
+ \mmzUnmemoizable%
\fill[bg]
(0,0)
rectangle
@@ -350,7 +353,7 @@
rectangle
(\moloch@progressonsectionpage, \moloch@progressonsectionpage@linewidth);
\end{tikzpicture}
- \tikzexternalenable
+ \tikzexternalenable%
}
% \end{macrocode}
%
diff --git a/Master/texmf-dist/source/latex/moloch/beamerouterthememoloch.dtx b/Master/texmf-dist/source/latex/moloch/beamerouterthememoloch.dtx
index a5d59108319..a0ce0af5804 100644
--- a/Master/texmf-dist/source/latex/moloch/beamerouterthememoloch.dtx
+++ b/Master/texmf-dist/source/latex/moloch/beamerouterthememoloch.dtx
@@ -14,7 +14,7 @@
% \iffalse
%<*package>
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{beamerouterthememoloch}[2024-03-06 v0.3.0 Moloch outer theme] % x-release-please-version
+\ProvidesPackage{beamerouterthememoloch}[2024-07-09 v0.4.0 Moloch outer theme] % x-release-please-version
%</package>
% \fi
% \CheckSum{0}
@@ -160,23 +160,42 @@
% Templates for the frame title, which is optionally underlined with a
% progress bar.
% \begin{macrocode}
+\newlength{\moloch@frametitle@padding}
+\setlength{\moloch@frametitle@padding}{2.2ex}
+\newcommand{\moloch@frametitlestrut@start}{%
+ \rule{0pt}{\moloch@frametitle@padding +%
+ \totalheightof{%
+ \ifcsdef{moloch@frametitleformat}{\moloch@frametitleformat X}{X}%
+ }%
+}%
+}
+
+\newcommand{\moloch@frametitlestrut@end}{%
+ \vphantom{\rule[-\moloch@frametitle@padding]{0pt}{\moloch@frametitle@padding}}
+}
\defbeamertemplate{frametitle}{plain}{%
\nointerlineskip%
\begin{beamercolorbox}[%
wd=\paperwidth,%
- sep=1.1ex,%
- leftskip=0.5ex,%
- rightskip=\the\glueexpr 0.5ex plus 1fill\relax,%
+ leftskip=1.6ex,%
+ rightskip=\the\glueexpr 1.6ex plus 1fill\relax,%
]{frametitle}%
\usebeamerfont{frametitle}%
- \vbox{}\vskip-0.4ex%
- \strut\insertframetitle\nolinebreak\strut\par%
+ \moloch@frametitlestrut@start%
+ \moloch@frametitleformat{\insertframetitle}%
{%
\ifx\insertframesubtitle\@empty%
\else%
- {\usebeamerfont{framesubtitle}\vspace{-0.8ex}\usebeamercolor[fg]{framesubtitle}\strut\insertframesubtitle\strut\par}%
+ {%
+ \par%
+ \usebeamerfont{framesubtitle}%
+ \vspace{-0.8ex}%
+ \usebeamercolor[fg]{framesubtitle}%
+ \insertframesubtitle%
+ }%
\fi
}%
+ \moloch@frametitlestrut@end%
\end{beamercolorbox}%
}
\setbeamertemplate{frametitle continuation}{\romannumeral\insertcontinuationcount}
@@ -192,13 +211,14 @@
\newlength{\moloch@progressinheadfoot@linewidth}
\setlength{\moloch@progressinheadfoot@linewidth}{0.4pt}
\setbeamertemplate{progress bar in head/foot}{
- \nointerlineskip
+ \nointerlineskip%
\pgfmathsetlength{\moloch@progressinheadfoot}{%
\paperwidth * min(1,\insertframenumber/\inserttotalframenumber)%
- }
+ }%
\begin{beamercolorbox}[wd=\paperwidth]{progress bar in head/foot}
- \tikzexternaldisable
+ \tikzexternaldisable%
\begin{tikzpicture}
+ \mmzUnmemoizable%
\fill[bg]
(0,0)
rectangle
@@ -208,7 +228,7 @@
rectangle
(\moloch@progressinheadfoot, \moloch@progressinheadfoot@linewidth);
\end{tikzpicture}
- \tikzexternalenable
+ \tikzexternalenable%
\end{beamercolorbox}
}
% \end{macrocode}
diff --git a/Master/texmf-dist/source/latex/moloch/beamerthememoloch.dtx b/Master/texmf-dist/source/latex/moloch/beamerthememoloch.dtx
index fcebef5a811..e6447ec7918 100644
--- a/Master/texmf-dist/source/latex/moloch/beamerthememoloch.dtx
+++ b/Master/texmf-dist/source/latex/moloch/beamerthememoloch.dtx
@@ -12,7 +12,7 @@
% \iffalse
%<*package>
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{beamerthememoloch}[2024-03-06 v0.3.0 Moloch Beamer theme] % x-release-please-version
+\ProvidesPackage{beamerthememoloch}[2024-07-09 v0.4.0 Moloch Beamer theme] % x-release-please-version
%</package>
% \fi
% \CheckSum{0}
@@ -52,14 +52,69 @@
}
% \end{macrocode}
%
+% \begin{macro}{titleformat plain}
+% Controls the formatting of the text on standout ``plain'' frames.
+% \begin{macrocode}
+\pgfkeys{
+ /moloch/titleformat plain/.cd,
+ .is choice,
+ regular/.code={%
+ \let\moloch@plaintitleformat\@empty%
+ \setbeamerfont{standout}{shape=\normalfont}%
+ },
+ smallcaps/.code={%
+ \let\moloch@plaintitleformat\@empty%
+ \setbeamerfont{standout}{shape=\scshape}%
+ },
+ allsmallcaps/.code={%
+ \let\moloch@plaintitleformat\MakeLowercase%
+ \setbeamerfont{standout}{shape=\scshape}%
+ },
+ allcaps/.code={%
+ \let\moloch@plaintitleformat\MakeUppercase%
+ \setbeamerfont{standout}{shape=\normalfont}%
+ },
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{titleformat}
+% Sets a standard format for titles, subtitles, section titles, frame
+% titles, and the text on standout ``plain'' frames.
+% \begin{macrocode}
+\pgfkeys{
+ /moloch/titleformat/.code=\pgfkeysalso{
+ font/titleformat title=#1,
+ font/titleformat subtitle=#1,
+ font/titleformat section=#1,
+ font/titleformat frame=#1,
+ titleformat plain=#1,
+ }
+}
+% \end{macrocode}
+% \end{macro}
+%
+% Set default values for options.
+%
+% \begin{macrocode}
+\newcommand{\moloch@setdefaults}{
+ \pgfkeys{/moloch/.cd,
+ titleformat plain=regular,
+ }
+}
+% \end{macrocode}
+%
% To avoid generating externalized figures of the progressbar we have to disable
% them with ``tikzexternalenable'' and ``tikzexternaldisable''. However, if the
% ``external'' libray is not loaded we would get undefined control sequence
% problems, hence we define them as no-ops if they are not defined yet.
+% We do the same for the ``mmzUnmemoizable'' command from the memoize package, in
+% order to avoid memoization of the progress bars.
%
% \begin{macrocode}
\providecommand{\tikzexternalenable}{}
\providecommand{\tikzexternaldisable}{}
+\providecommand{\mmzUnmemoizable}{}
% \end{macrocode}
%
% \subsubsection{Component sub-packages}
@@ -98,6 +153,7 @@
% \subsubsection{Process package options}
%
% \begin{macrocode}
+\moloch@setdefaults
\ProcessPgfOptions{/moloch}
% \end{macrocode}
%
diff --git a/Master/texmf-dist/source/latex/moremath/moremath.dtx b/Master/texmf-dist/source/latex/moremath/moremath.dtx
new file mode 100644
index 00000000000..48e7bae62d0
--- /dev/null
+++ b/Master/texmf-dist/source/latex/moremath/moremath.dtx
@@ -0,0 +1,5761 @@
+% \iffalse meta-comment
+%
+% Copyright (C) 2024 Marcel Ilg
+%
+% This work may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% 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.3 or later is part of all distributions of LaTeX
+% version 2005/12/01 or later.
+%
+% This work has the LPPL maintenance status ‘maintained’.
+%
+% The Current Maintainer of this work is Marcel Ilg.
+%
+% This work consists of the files listed in MANIFEST.md.
+% \fi
+%
+% \iffalse
+%
+%<*driver>
+% Generated by ctanbib
+\begin{filecontents*}[overwrite]{\jobname.bib}
+@preamble{ "\providecommand\ctanbibpkgname[1]{\textsl{#1}}" }
+@manual{amsfonts,
+ title = {The \ctanbibpkgname{amsfonts} package},
+ subtitle = {TeX fonts from the American Mathematical Society},
+ author = {{The American Mathematical Society}},
+ url = {https://ctan.org/pkg/amsfonts},
+ urldate = {2024-07-04},
+ date = {},
+ version = {3.04},
+}
+
+@preamble{ "\providecommand\ctanbibpkgname[1]{\textsl{#1}}" }
+@manual{amsmath,
+ title = {The \ctanbibpkgname{amsmath} package},
+ subtitle = {AMS mathematical facilities for LaTeX},
+ author = {{The LaTeX Project Team}},
+ url = {https://ctan.org/pkg/amsmath},
+ urldate = {2024-07-04},
+ date = {2023-05-13},
+ version = {2.17o},
+}
+
+@preamble{ "\providecommand\ctanbibpkgname[1]{\textsl{#1}}" }
+@manual{bm,
+ title = {The \ctanbibpkgname{bm} package},
+ subtitle = {Access bold symbols in maths mode},
+ author = {Carlisle, David and Mittelbach, Frank and {The LaTeX Project Team}},
+ url = {https://ctan.org/pkg/bm},
+ urldate = {2024-07-04},
+ date = {2023-12-19},
+ version = {1.2f},
+}
+
+@preamble{ "\providecommand\ctanbibpkgname[1]{\textsl{#1}}" }
+@manual{mathtools,
+ title = {The \ctanbibpkgname{mathtools} package},
+ subtitle = {Mathematical tools to use with amsmath},
+ author = {Høgholm, Morten and Madsen, Lars and Robertson, Will and Wright, Joseph and {The LaTeX Project Team}},
+ url = {https://ctan.org/pkg/mathtools},
+ urldate = {2024-07-04},
+ date = {2024-03-11},
+ version = {1.30},
+}
+
+@comment{Below are non-package References}
+
+@article{package-rollback,
+ title = {A rollback concept for packages and classes},
+ author = {Frank Mitelbach},
+ year = {2018},
+ journaltitle = {TUGboat},
+ number = 2,
+ url = {https://www.latex-project.org/publications/2018-FMi-TUB-tb122mitt-version-rollback.pdf},
+ urldate = {2024-08-06},
+}
+\end{filecontents*}
+\begin{filecontents*}[overwrite]{\jobname-ams-op-table.tex}
+\begin{tabular}{rlrlrlrl}
+ \cs[module=amsmath,replace=false]{arccos} &\(\arccos\) &\cs[module=amsmath,replace=false]{deg} &\( \deg \) &\cs[module=amsmath,replace=false]{lg} &\( \lg \) &\cs[module=amsmath,replace=false]{projlim} &\( \projlim \)\\
+ \cs[module=amsmath,replace=false]{arcsin} &\(\arcsin\) &\cs[module=amsmath,replace=false]{det} &\( \det \) &\cs[module=amsmath,replace=false]{lim} &\( \lim \) &\cs[module=amsmath,replace=false]{sec} &\( \sec \)\\
+ \cs[module=amsmath,replace=false]{arctan} &\(\arctan\) &\cs[module=amsmath,replace=false]{dim} &\( \dim \) &\cs[module=amsmath,replace=false]{liminf} &\( \liminf \) &\cs[module=amsmath,replace=false]{sin} &\( \sin \)\\
+ \cs[module=amsmath,replace=false]{arg} &\(\arg\) &\cs[module=amsmath,replace=false]{exp} &\( \exp \) &\cs[module=amsmath,replace=false]{limsup} &\( \limsup \) &\cs[module=amsmath,replace=false]{sinh} &\( \sinh \)\\
+ \cs[module=amsmath,replace=false]{cos} &\(\cos\) &\cs[module=amsmath,replace=false]{gcd} &\( \gcd \) &\cs[module=amsmath,replace=false]{ln} &\( \ln \) &\cs[module=amsmath,replace=false]{sup} &\( \sup \)\\
+ \cs[module=amsmath,replace=false]{cosh} &\(\cosh\) &\cs[module=amsmath,replace=false]{hom} &\( \hom \) &\cs[module=amsmath,replace=false]{log} &\( \log \) &\cs[module=amsmath,replace=false]{tan} &\( \tan \)\\
+ \cs[module=amsmath,replace=false]{cot} &\(\cot\) &\cs[module=amsmath,replace=false]{inf} &\( \inf \) &\cs[module=amsmath,replace=false]{max} &\( \max \) &\cs[module=amsmath,replace=false]{tanh} &\( \tanh \)\\
+ \cs[module=amsmath,replace=false]{coth} &\(\coth\) &\cs[module=amsmath,replace=false]{injlim} &\(\injlim\) &\cs[module=amsmath,replace=false]{min} &\( \min \) & &\\
+ \cs[module=amsmath,replace=false]{csc} &\(\csc\) &\cs[module=amsmath,replace=false]{ker} &\(\ker\) &\cs[module=amsmath,replace=false]{Pr} &\( \Pr \) & &\\
+\end{tabular}
+\begin{center}
+ \begin{tabular}{rlrl}
+ \cs[module=amsmath,replace=false]{varinjlim} &\(\varinjlim\) &\cs[module=amsmath,replace=false]{varliminf} &\(\varliminf\)\\
+ \cs[module=amsmath,replace=false]{varprojlim} &\(\varprojlim\) &\cs[module=amsmath,replace=false]{varlimsup} &\(\varlimsup\)\\
+ \end{tabular}
+\end{center}
+\end{filecontents*}
+
+
+% custom commands for use inside the documentation
+\ExplSyntaxOn
+% Property list storing version date information
+\prop_new:N \l__moremathdoc_version_date_prop
+
+\cs_new_protected:Nn \moremathdoc_add_version:nn
+{
+ \prop_put_if_new:Nnn \l__moremathdoc_version_date_prop {#1} {#2}
+}
+
+\cs_new_protected:Nn \moremathdoc_get_version:n
+{
+ \group_begin:
+ \prop_get:NnNT \l__moremathdoc_version_date_prop {#1} \l_tmpa_tl
+ {
+ \tl_use:N \l_tmpa_tl
+ }
+ \group_end:
+}
+
+\NewDocumentCommand \AddVersion { m m }
+{
+ \moremathdoc_add_version:nn {#1} {#2}
+}
+
+\NewDocumentCommand \GetVersionDate { m }
+{
+ \moremathdoc_get_version:n {#1}
+}
+\ExplSyntaxOff
+
+\documentclass[%
+%show-notes,%
+]{l3doc}
+
+\SetupDoc{reportchangedates=true}
+\RecordChanges
+
+\usepackage[american]{babel}
+\AddBabelHook[american]{nofrench}{afterextras}{\frenchspacing}
+
+\usepackage[style=alphabetic]{biblatex}
+\addbibresource{\jobname.bib}
+
+\usepackage{csquotes}
+\SetCiteCommand{\autocite}
+
+\usepackage{amssymb}
+\usepackage[bm]{moremath}
+
+% renew the ctanbibpkgname command
+\NewDocumentCommand\ctanbibpkgname{m}{\pkg{#1}}
+
+% Example operators and commands
+\DeclareMathOperator{\glorb}{glorb}
+\DeclarePairedDelimiter{\inparen}{\lparen}{\rparen}
+\DeclareDelimitedOperator{\pglorb}{\glorb}{\inparen}
+
+\begin{document}
+ \DocInput{moremath.dtx}
+\end{document}
+%</driver>
+% \fi
+%
+% ^^X Get the package version name etc.
+% \GetFileInfo{moremath.sty}
+%
+% ^^X Register changes here
+% \AddVersion{v0.1.0}{2024-06-28}
+% \AddVersion{v0.2.0}{2024-07-04}
+% \AddVersion{v0.3.0}{2024-07-08}
+% \AddVersion{v0.4.0}{2024-07-15}
+% \AddVersion{v0.5.0}{2024-08-20}
+%
+% ^^X Placeholder for unreleased versions
+% \AddVersion{vUNRELEASED}{UNRELEASED}
+%
+% \begin{documentation}
+%
+% \changes{v0.1.0}{\GetVersionDate{v0.1.0}}{Initial development release}
+% \changes{v0.3.0}{\GetVersionDate{v0.3.0}}{
+% Split the documentation into several parts.
+% }
+% \changes{v0.4.0}{\GetVersionDate{v0.4.0}}{
+% \textbf{Breaking Change:} Rename the package
+% and the \meta{prefix} used for function names from
+% "conmath" to "moremath".
+% }
+%
+% \title{The \pkg{moremath} package\thanks{This document coresponds to
+% \textsf{moremath}~\fileversion, dated \filedate.}}
+%
+% \author{Marcel Ilg\thanks{\texttt{mister01x (at) web (dot) de}}}
+%
+% \date{Released \filedate}
+%
+% \maketitle
+%
+% \begin{abstract}
+% The \pkg{moremath} package provides several document level commands
+% to ease the typesetting
+% and \LaTeX{} code readability of certain mathematical constructs.
+% It provides complementary commands to all operators defined by \pkg{amsmath},
+% the commands typeset delimiters that may be automatically, manually or
+% not scaled at all.
+% The commands also accept optional sub- and superscripts to the operators.
+%
+% Furthermore it provides several commands to typeset gradient, divergence,
+% curl, and Laplace operators,
+% for which there are also versions with delimiters.
+% Those commands also accept an optional subscript
+% and their appearance can be modified using key-value options.
+%
+% Additionally commands are provided for producing row and column vectors,
+% as well as (anti-)diagonal matrices,
+% utilizing \pkg{mathtools} \env{matrix*} family of environments.
+%
+% Most of the document level commands defined by this package can also
+% be disabled using a package load-time option to avoid clashes with
+% commands defined by other packages.
+% \end{abstract}
+%
+% \section*{Note: This Package is Still in its Initial Development Phase}
+% Do not expect a stable interface until version 1.0.0 has been reached!
+% While I try to keep the interface stable and backwards compatible,
+% I am unable to promise this.
+%
+% \tableofcontents
+%
+% \part{Document Author Documentation}
+% \label{pt:doc-auth}
+%
+% \section{Introduction}
+% \label{sec:intro}
+%
+% When typesetting mathematics in \LaTeX{} it is very common to often encounter,
+% code patterns such as |\sin \left( \frac{x}{2} \right)|.
+% While this above code works as expected its not especially easy for human
+% readers of this code to immediately understand what that code is going to
+% do.
+%
+% This package tries to ease readability of such commonly used constructs
+% by providing commands that (hopefully) increase readability,
+% as well as speeding up writing math in \LaTeX{}.
+% Using \pkg{moremath} the above code can be simplified to |\psin*{\frac{x}{2}}|,
+% which is shorter and better \enquote{human readable}.
+% The package also provides the possibility for users to define such delimited operators,
+% on their own.
+%
+% There are also other things that can be improved when typesetting math.
+% One prominent example is the typesetting of row and column vectors,
+% which require the use of a \env{matrix} environment.
+% For this case \pkg{moremath} provides commands which accept a comma separated
+% list of vector entries,
+% obliterating the need for a \env{matrix} environment to typeset vectors.
+%
+% The same goes for (anti-)diagonal matrices,
+% only the elements of the diagonal are of importance here.
+% Therefore the production of those matrices may also be simplified into a single command,
+% which again improves readability of the code compared to a mostly empty \env{matrix} environment.
+%
+% Another feature of this package is the definition of several (delimited)
+% vector calculus operators such as gradient, divergence and curl operators,
+% this does not only improve the semantics of the math code
+% (|\mathop{\nabla} f| vs.\ |\grad f|),
+% but also tries to provide the correct spacing between the operator and its
+% arguments.
+%
+% The \pkg{moremath} package is written using \LaTeX{}3
+% and provides a small \LaTeX{}3 interface for class and package writers.
+%
+% The source code for \pkg{moremath} is hosted on GitHub at
+% \begin{center}
+% \url{https://github.com/Mister00X/moremath}
+% \end{center}
+% If you have any issues or found a bug, feel free to register an issue there.
+%
+% \section{Dependencies}
+% \label{sec:deps}
+%
+% The main dependency of this package is \pkg{mathtools}~\autocite{mathtools}.
+% Optionally the \pkg{bm}~\autocite{bm} may be loaded.
+%
+% If the option "no-vector" has \emph{not} been given as a package load time option,
+% this package also loads the \pkg{amssymb}~\autocite{amsfonts} package.
+%
+% \section{Package Options}
+% \label{sec:pack-opts}
+%
+% ^^X SUBSECTION: Package Load Time Options
+% \subsection{Package Load Time Options}
+% \label{sec:pkg-load-time-opts}
+% The options described in this section \emph{must} be given
+% at package load time i.e.\ as package options.
+% All options which are not described below will be passed to
+% \pkg{mathtools}~\autocite{mathtools},
+% see its documentation for more information.
+%
+% \DescribeOption{bm} The \verb|bm| option
+% loads the \pkg{bm}~\autocite{bm} package which provides a better version of
+% the \cs{boldsymbol} command.
+%
+%
+%
+%
+% The options
+% \DescribeOption{no-vector} "no-vector",
+% \DescribeOption{no-abs-shorthands} "no-abs-shorthands",
+% \DescribeOption{no-operators} "no-operators",
+% \DescribeOption{no-crvector} "no-crvector",
+% and \DescribeOption{no-matrix} "no-matrix"
+% disable the definition of the predefined commands described in sections~\ref{sec:vector-calculus},
+% \ref{sec:shorthands},
+% \ref{sec:delim-ops},
+% \ref{sec:rc-vectors},
+% and~\ref{sec:matrices}
+% respectively.
+%
+% \DescribeOption{nopredef}
+% The option |nopredef| achieves the same as the three
+% |no-|\meta{functionality} options above.
+% It accepts multiple values, valid option values are:
+% |vector|,
+% |abs|,
+% |operators|,
+% |crvector|,
+% |matrix|,
+% and |all|.
+% The values
+% |abs|,
+% |operators|,
+% and |vector|
+% disable the predefined
+% document level commands for
+% delimited operators,
+% vector calculus
+% and the shorthands for absolute value and norm respectively.
+% The values "crvector" and "matrix" disable the shorthand commands
+% for row and column vectors, and simple matrices respectively.
+% The special value |all| disables all of them.
+%
+% The option accepts multiple values which can be given as a comma separated
+% list, or as multiple key-value options, like in the examples below:
+% \begin{verbatim}
+% \usepackage[nopredef={vector,abs,operators}]{moremath}
+% \end{verbatim}
+% This is equivalent to
+% \begin{verbatim}
+% \usepackage[nopredef=all]{moremath}
+% \end{verbatim}
+% and to:
+% \begin{verbatim}
+% \usepackage[nopredef=vector,nopredef=abs,nopredef=operators]{moremath}
+% \end{verbatim}
+%
+% The command \cs{NewDelimitedOperator} is not affected by any of the above
+% settings.
+%
+% ^^X SUBSECTION: General Options
+% \subsection{General Options}
+% \label{sec:pkg-general-options}
+%
+% The options described in this section
+% \emph{must not} be given as package options,
+% instead they should be set using \cs{moremathsetup}
+% or given as optional argument to the commands described later.
+% \begin{function}[updated = 2024-07-15]{\moremathsetup}
+% \begin{syntax}
+% \cs{moremathsetup}\marg{kv~list}
+% \end{syntax}
+% Sets the options specified in the \meta{key-value list},
+% the assignment is local to the current group.
+% If a \meta{value} contains a comma it needs to be wrapped in braces.
+% This command may be used anywhere in the document after \pkg{moremath}
+% has been loaded.
+% \end{function}
+%
+% \subsubsection{Options Affecting Vector Calculus Operators}
+% \label{sec:options-vec-calc}
+%
+% \DescribeOption{nabla}
+% The option |nabla| sets the symbol to use by the document level commands
+% described in section~\ref{sec:vector-calculus} to use for the nabla.
+% It accepts a list of \meta{tokens}. Its default value is |\nabla|.
+%
+% \DescribeOption{arrownabla}
+% The option |arrownabla| puts a small arrow over the gradient operator symbol.
+% Its default value is |false|.
+%
+% \DescribeOption{boldnabla}
+% The option |boldnabla| makes the nabla symbol bold.
+% If the |bm| package option has been given the |\boldsymbol| command from
+% the \pkg{bm} package is used for the bold symbol,
+% otherwise the \pkg{amsmath}~\autocite{amsmath} version is used.
+%
+% \DescribeOption{grad-op}
+% The option |grad-op| may be used to overwrite,
+% the built in version of the gradient operator, it accepts a \meta{token list}.
+% Use at your own responsibility.
+%
+% \DescribeOption{laplacian-symb}
+% The option |laplacian-symb| sets the symbol to use by the document level
+% commands described in section~\ref{sec:vector-calculus} to use for the
+% Laplace operator. It accepts a list of \meta{tokens}.
+%
+% \DescribeOption{delta-laplace}
+% The option |delta-laplace| replaces the Laplace operator symbol
+% (by default \(\laplacian\)) with a uppercase delta
+% (\(\laplacian[delta-laplace=true]\)).
+% Its default value is |false|.
+%
+% \DescribeOption{arrowlaplace}
+% The option |arrowlaplace| if set to |true| makes the Laplace operator look
+% like this: \(\laplacian[arrowlaplace=true]\).
+%
+% \DescribeOption{laplacian}
+% Like the option |grad-op| above the option |laplacian| may be used to
+% overwrite the built-in version of the Laplace operator.
+% Use at your own responsibility.
+%
+% \DescribeOption{dalembert-symb}
+% Like the option "nabla" this sets the symbol to use by the document level
+% commands described in section~\ref{sec:dalembert-op-cmds} to use as symbol
+% for the \foreignlanguage{french}{d'Alembert} operator. It accepts a list of
+% \meta{tokens}. It's default value is \cs[module=amssymb,replace=false]{square}.
+%
+% \DescribeOption{vcenter}
+% The option "vcenter" controls if certain mathematical symbols
+% of the operators described in section~\ref{sec:vector-calculus} should be
+% vertically centered along the math-axis.
+% The default value of this option is "true".
+%
+%
+%
+% \subsubsection{Options Affecting Matrices and Vectors}
+% \label{sec:options-matrix}
+%
+% The options in this section only affect the commands described in sections~\ref{sec:rc-vectors}
+% and~\ref{sec:matrices}. To set them with \cs{moremathsetup} it is necessary
+% to add the prefix |matrix / | to these options,
+% so that the resulting command looks like \cs{moremathsetup}\texttt{\{matrix / \meta{option}\}}.
+% When using these options inside the optional argument of the commands described
+% in sections~\ref{sec:rc-vectors} and~\ref{sec:matrices}, the prefix "matrix /"
+% must be omitted.
+%
+% \DescribeOption{delimiter}
+% The option |delimiter| determines the delimiters used for the matrices,
+% valid values are "p" for parenthesis, "b" for brackets, "B" for braces,
+% "v" for single vertical lines (\enquote{\(\vert\)}),
+% "V" for double vertical lines (\enquote{\(\Vert\)}) or empty for no delimiters.
+% The default value is "{}" (empty).
+%
+% \DescribeOption{fill}
+% The fill option determines the values an (anti-)diagonal matrix is filled with,
+% outside the diagonal. The default is again empty.
+%
+% \DescribeOption{align}
+% This option determines the alignment of the numbers inside the matrix.
+% The value of this option gets passed to the optional argument of the \env{matrix*}
+% or \env{smallmatrix*} family of environments defined by \pkg{mathtools}~\autocite{mathtools}.
+% Valid values for both types of those environments are |l| for left alignment,
+% |r| for right alignment and |c| for centered alignment. The default is |c|.
+%
+% \begin{texnote}
+% The non-"small" versions of the commands described in the sections~\ref{sec:rc-vectors}
+% and~\ref{sec:matrices}, accept \textcquote{mathtools}{\textelp{}
+% any column type valid in the usual \env{array} environment.}
+% \end{texnote}
+%
+%
+% \section{Delimited Operators}
+% \label{sec:delim-ops}
+%
+% \subsection{Delimited Operators Predefined by \pkg{moremath}}
+% \label{sec:delim-op-predef}
+%
+% \DescribeOption{no-operators}
+% If the package load time option |no-operators| is not given this package defines several
+% delimited mathematical operators.
+%
+% \begin{table}
+% \caption{%
+% Operator commands defined by the \pkg{amsmath}~\autocite{amsmath}
+% package.}
+% \label{tab:amsmath-operators}
+% \vspace{.5\baselineskip}
+% \input{\jobname-ams-op-table.tex}
+% \end{table}
+%
+% \begin{function}{
+% \parccos, \barccos, \Barccos, \varccos, \Varccos,
+% }
+% \begin{syntax}
+% \cs{parccos} \oarg{size cmd} \marg{contents}
+
+% \cs{parccos} \oarg{size cmd} \textasciicircum\marg{superscript} \marg{contents}
+%
+% \cs{parccos} \oarg{size cmd} \_\marg{subscript} \marg{contents}
+%
+% \cs{parccos} \oarg{size cmd} \textasciicircum\marg{superscript} \_\marg{subscript} \marg{contents}
+%
+% \cs{parccos}* \marg{contents}
+%
+% \cs{parccos}* \textasciicircum\marg{superscript} \marg{contents}
+%
+% \cs{parccos}* \_\marg{subscript} \marg{contents}
+% \cs{parccos}* \textasciicircum\marg{superscript} \_\marg{subscript} \marg{contents}
+%
+%
+% \cs[no-index]{\meta{prefix}\meta{op name}} \oarg{size cmd} \marg{contents}
+% \cs[no-index]{\meta{prefix}\meta{op name}} \oarg{size cmd} \textasciicircum\marg{superscript} \marg{contents}
+% \cs[no-index]{\meta{prefix}\meta{op name}} \oarg{size cmd} \_\marg{subscript} \marg{contents}
+% \cs[no-index]{\meta{prefix}\meta{op name}} \oarg{size cmd} \textasciicircum\marg{superscript} \_\marg{subscript} \marg{contents}
+% \cs[no-index]{\meta{prefix}\meta{op name}}* \marg{contents}
+% \cs[no-index]{\meta{prefix}\meta{op name}}* \textasciicircum\marg{superscript} \marg{contents}
+% \cs[no-index]{\meta{prefix}\meta{op name}}* \_\marg{subscript} \marg{contents}
+% \cs[no-index]{\meta{prefix}\meta{op name}}* \textasciicircum\marg{superscript} \_\marg{subscript} \marg{contents}
+% \end{syntax}
+% For all of the operators predefined by \pkg{amsmath}~\autocite{amsmath},
+% which are shown in table~\ref{tab:amsmath-operators},
+% \pkg{moremath} declares delimited versions.
+% The name of those commands follows the scheme \cs[no-index]{\meta{prefix}\meta{op}},
+% where \meta{prefix} is one of |p|, |b|, |B|, |v|, or |V|
+% and \meta{op} is the name of one of the operators shown in table~\ref{tab:amsmath-operators}.
+%
+% The \meta{prefix}es |p|, |b|, |B|, |v|, and |V| stand for
+% parenthesis, brackets, braces, single vertical lines (\enquote{\(\vert\)}), and double vertical lines
+% (\enquote{\(\Vert\)}) respectively.
+%
+% The commands accept a \meta{size cmd} optional argument, which is usually one of
+% \cs{big}, \cs{Big}, \cs{bigg} and \cs{Bigg}.
+% These \meta{size cmd}s are used to change the size of the delimiters.
+%
+% The commands also accept sub- and superscripts,
+% which have to be issued \emph{after} the optional argument (if present),
+% but before the mandatory argument \meta{contents}.
+%
+% The starred variant uses automatic scaling for the delimiters depending on the height of its contents.
+% \end{function}
+%
+% \paragraph{Examples}
+%
+% The following examples showcase the use of those predefined delimited operators:
+% \begin{enumerate}
+% \item Different delimited operators without any scaling:
+%
+% \begin{verbatim}
+% \[
+% \pcos{x} \times \bcos{y}
+% \times \Bcos{z} \times \vcos{a}
+% \times \Vcos{b}
+% \]
+% \end{verbatim}
+% \[
+% \pcos{x} \times \bcos{y}
+% \times \Bcos{z} \times \vcos{a}
+% \times \Vcos{b}
+% \]
+%
+% \item Delimited operator with automatic scaling:
+%
+% \begin{minipage}{.49\linewidth}
+% \begin{verbatim}
+% \[
+% \pcos*{\frac{x^{2}}{2}}
+% \]
+% \end{verbatim}
+% \end{minipage}\hfill
+% \begin{minipage}{.49\linewidth}
+% \[
+% \pcos*{\frac{x^{2}}{2}}
+% \]
+% \end{minipage}
+%
+% \item Delimited operator with manual scaling:
+%
+% \begin{minipage}{.49\linewidth}
+% \begin{verbatim}
+% \[
+% \pcos[\Big]{\frac{x^{2}}{2}}
+% \]
+% \end{verbatim}
+% \end{minipage}\hfill
+% \begin{minipage}{.49\linewidth}
+% \[
+% \pcos[\Big]{\frac{x^{2}}{2}}
+% \]
+% \end{minipage}
+%
+% \item Delimited operator with subscript:
+%
+% \begin{minipage}{.49\linewidth}
+% \begin{verbatim}
+% \[
+% \plog_{10}{1+x}
+% \]
+% \end{verbatim}
+% \end{minipage}\hfill
+% \begin{minipage}{.49\linewidth}
+% ^^X XXX: Using an underscore is broken here (because of l3doc???) therefore I
+% ^^X use "\sb" instead.
+% \[
+% \plog\sb{10}{1+x}
+% \]
+% \end{minipage}
+%
+% \item Delimited operator with superscript:
+%
+% \begin{minipage}{.49\linewidth}
+% \begin{verbatim}
+% \[
+% \pcos^{2}{x}
+% \]
+% \end{verbatim}
+% \end{minipage}\hfill
+% \begin{minipage}{.49\linewidth}
+% \[
+% \pcos^{2}{x}
+% \]
+% \end{minipage}
+%
+% \item Delimited operator with both sub- and superscript and manual scaling:
+%
+% \begin{minipage}{.49\linewidth}
+% \begin{verbatim}
+% \[
+% \pcos[\Big]^{2}_{x}{\frac{x}{2}}
+% \]
+% \end{verbatim}
+% \end{minipage}\hfill
+% \begin{minipage}{.49\linewidth}
+% ^^X XXX: Again use "\sb" instead of "_" because of l3doc
+% \[
+% \pcos[\Big]^{2}\sb{x}{\frac{x}{2}}
+% \]
+% \end{minipage}
+% \end{enumerate}
+%
+%
+% \subsection{Declaring New Delimited Operators}
+% \label{sec:delim-op-new}
+%
+% \begin{function}{\DeclareDelimitedOperator}
+% \begin{syntax}
+% \cs{DeclareDelimitedOperator}\marg{new op}\marg{op}\marg{delim}
+% \end{syntax}
+% Creates a new delimited operator,
+% the name of the new command will be \meta{new op}.
+% The \meta{op} is the command of the operator to use,
+% which is usually a command declared with
+% \cs[module=amsmath,replace=false]{DeclareMathOperator}.
+% \meta{delim} is the command to use as paired delimiter,
+% it is expected to behave like a paired delimiter declared by
+% \pkg{mathtools}~\autocite{mathtools}
+% \cs[module=mathtools,replace=false]{DeclarePairedDelimiter}.
+% \end{function}
+%
+% \paragraph{Example: Creating a New Delimited Operator}
+% The following code creates a new operator and a paired delimiter
+% and uses it afterwards to declare a paired operator.
+% \begin{verbatim}
+% \documentclass{scrartcl}
+%
+% \DeclareMathOperator{\glorb}{glorb}
+% \DeclarePairedDelimiter{\inparen}{\lparen}{\rparen}
+% \DeclarePairedOperator{\pglorb}{\glorb}{\inparen}
+%
+% \begin{document}
+% \[
+% \pglorb{a}
+% \]
+% \end{document}
+% \end{verbatim}
+% The result then looks like this:
+% \[
+% \pglorb{a}
+% \]
+%
+%
+% \section{Vector Calculus Operators}
+% \label{sec:vector-calculus}
+%
+% \DescribeOption{no-vector}
+% The commands in this section are only declared if the option |no-vector|
+% has not been given to the package as a load time option.
+%
+% \DescribeOption{vcenter}
+% The option "vcenter" controls if the symbols for the operators described below
+% should be vertically centered along the math axis. Its default value is "true".
+%
+% This option only shows its effects if other options like "arrownabla",
+% "arrowlaplace", or "boldnabla" are set to "true".
+% Like in the example below:
+% \begin{quote}
+% \begin{verbatim}
+% \begin{gather*}
+% \grad f(x) \quad \grad[arrownabla,vcenter=false] f(x)
+% \quad \grad[arrownabla,vcenter=true] f(x)\\
+% \laplacian f(x) \quad \laplacian[arrowlaplace,vcenter=false] f(x)
+% \quad \laplacian[arrowlaplace,vcenter=true] f(x)
+% \end{gather*}
+% \end{verbatim}
+% \begin{gather*}
+% \grad f(x) \quad \grad[arrownabla,vcenter=false] f(x)
+% \quad \grad[arrownabla,vcenter=true] f(x)\\
+% \laplacian f(x) \quad \laplacian[arrowlaplace,vcenter=false] f(x)
+% \quad \laplacian[arrowlaplace,vcenter=true] f(x)
+% \end{gather*}
+% \end{quote}
+%
+% All of the commands described in this section take key-value options
+% as optional argument, which are described in section~\ref{sec:options-vec-calc}
+%
+% \subsection{Gradient Operator Commands}
+% \label{sec:grad-op-cmds}
+%
+% \subsubsection{Standalone Operator Command}
+% \label{sec:grad-op-standalone}
+%
+% \begin{function}[updated=2024-07-08]{
+% \grad,
+% }
+% \begin{syntax}
+% \cs{grad} \oarg{kv opts}
+% \cs{grad} \oarg{kv opts} \_\marg{subscript}
+% \end{syntax}
+% The \cs{grad} command produces a gradient operator
+% looking like this \enquote{\(\grad\)} by default.
+% The optional argument \meta{kv opts} accepts the key-value options
+% described in section~\ref{sec:options-vec-calc},
+% whitespace between the command name
+% and \oarg{kv~opts} is \emph{not allowed}.
+% An optional subscript using "_" may be given after the optional argument.
+% \end{function}
+%
+% \paragraph{Examples of Use}
+% \begin{enumerate}
+% \item Standalone gradient operator (with and without subscript):
+%
+% \begin{minipage}{.49\linewidth}
+% \begin{verbatim}
+% \[
+% \grad f(x), \quad \grad_{x} f(x)
+% \]
+% \end{verbatim}
+% \end{minipage}\hfill
+% \begin{minipage}{.49\linewidth}
+% \[
+% \grad f(x), \quad \grad\sb{x} f(x)
+% \]
+% \end{minipage}
+%
+% \item Bold version of the gradient operator:
+%
+% \begin{minipage}{.49\linewidth}
+% \begin{verbatim}
+% \[
+% \grad[boldnabla] f(x)
+% \]
+% \end{verbatim}
+% \end{minipage}\hfill
+% \begin{minipage}{.49\linewidth}
+% \[
+% \grad[boldnabla] f(x)
+% \]
+% \end{minipage}
+%
+% \item Gradient operator with an arrow:
+%
+% \begin{minipage}{.49\linewidth}
+% \begin{verbatim}
+% \[
+% \grad[arrownabla] f(x)
+% \]
+% \end{verbatim}
+% \end{minipage}
+% \begin{minipage}{.49\linewidth}
+% \[
+% \grad[arrownabla] f(x)
+% \]
+% \end{minipage}
+% \end{enumerate}
+%
+% \subsubsection{Operators with Delimiters}
+% \label{sec:grad-op-delim}
+%
+% \begin{function}{
+% \pgrad,
+% \bgrad,
+% \Bgrad,
+% \vgrad,
+% \Vgrad
+% }
+% \begin{syntax}
+% \cs[no-index]{\meta{delim}grad} \oarg{size cmd} \marg{content}
+% \cs[no-index]{\meta{delim}grad} \oarg{kv opts} \marg{content}
+% \cs[no-index]{\meta{delim}grad} \oarg{size cmd} \_\marg{subscript} \marg{content}
+% \cs[no-index]{\meta{delim}grad} \oarg{kv opts} \_\marg{subscript} \marg{content}
+% \cs[no-index]{\meta{delim}grad}* \oarg{kv opts} \marg{content}
+% \cs[no-index]{\meta{delim}grad}* \oarg{kv opts} \_\marg{subscript} \marg{content}
+% \end{syntax}
+% The \cs[no-index]{\meta{delim}grad} family of commands produces
+% gradient operator which is followed by \meta{contents} inside delimiters.
+% The delimiter is determined by the first letter of the command \meta{delim},
+% which may be "p" for parenthesis, "b" for brackets, "B" for braces,
+% "v" for a single vertical line (\enquote{\(\vert\)}), or "V" for a double
+% vertical line (\enquote{\(\Vert\)}).
+%
+% The commands accept either a \meta{size command} as optional argument,
+% which gets passed to \pkg{mathtools}~\autocite{mathtools} paired delimiter
+% or a list of \meta{key-value option}s,
+% the \meta{kv opts} \emph{must} be given using the complete syntax,
+% i.e.\ \meta{key}"="\meta{value},
+% shorthands for options with an implicit default value (|arrownabla|),
+% will not work here.
+% The \meta{size~command} is usually one of \cs{big}, \cs{Big}, \cs{bigg} and
+% \cs{Bigg}.
+% Valid \meta{kv opts} are all options described in section~\ref{sec:options-vec-calc}
+% and the key "scale" which accepts a \meta{size cmd}.
+%
+% \begin{quote}
+% \textbf{Note:}\\
+% Do not mix \meta{kv opts} and \meta{size cmd},
+% use either |\pgrad[\big]{f(x)}| or |\pgrad[arrownabla=true,scale=\big]{f(x)}|.
+% \end{quote}
+%
+% \medskip\noindent
+% An optional \meta{subscript} may be given between the optional argument,
+% and \meta{contents}. One use case for this subscript is to write formulae
+% using the so called Feynman-notation, where the gradient operator acts
+% only on one variable.
+%
+% The starred version of the commands automatically scale the delimiters
+% with its contents.
+% \end{function}
+%
+% \paragraph{Examples:}
+% \begin{enumerate}
+% \item Gradient operator with non-scaled delimiters:
+%
+% \begin{minipage}{.49\linewidth}
+% \begin{verbatim}
+% \[
+% \pgrad{1+\vec{x}}
+% \]
+% \end{verbatim}
+% \end{minipage}\hfill
+% \begin{minipage}{.49\linewidth}
+% \[
+% \pgrad{1+\vec{x}}
+% \]
+% \end{minipage}
+%
+% \item Bold version:
+%
+% \begin{minipage}{.49\linewidth}
+% \begin{verbatim}
+% \[
+% \pgrad[boldnabla=true]{1+\vec{x}}
+% \]
+% \end{verbatim}
+% \end{minipage}\hfill
+% \begin{minipage}{.49\linewidth}
+% \[
+% \pgrad[boldnabla=true]{1+\vec{x}}
+% \]
+% \end{minipage}
+%
+% \item Gradient operator with automatically scaled delimiters:
+%
+% \begin{minipage}{.49\linewidth}
+% \begin{verbatim}
+% \[
+% \pgrad*{\frac{1}{x}}
+% \]
+% \end{verbatim}
+% \end{minipage}\hfill
+% \begin{minipage}{.49\linewidth}
+% \[
+% \pgrad*{\frac{1}{x}}
+% \]
+% \end{minipage}
+%
+% \item Manually scaled version:
+%
+% \begin{minipage}{.49\linewidth}
+% \begin{verbatim}
+% \begin{gather*}
+% \pgrad[\Big]{\frac{1}{x}}\\[.5ex]
+% \pgrad[scale=\Big]{\frac{1}{x}}
+% \end{gather*}
+% \end{verbatim}
+% \end{minipage}\hfill
+% \begin{minipage}{.49\linewidth}
+% \begin{gather*}
+% \pgrad[\Big]{\frac{1}{x}}\\[.5ex]
+% \pgrad[scale=\Big]{\frac{1}{x}}
+% \end{gather*}
+% \end{minipage}
+%
+% \item Feynman-notation:
+%
+% \begin{minipage}{.49\linewidth}
+% \begin{verbatim}
+% \[
+% \pgrad_{x}{x+y+z}
+% \]
+% \end{verbatim}
+% \end{minipage}\hfill
+% \begin{minipage}{.49\linewidth}
+% \[
+% \pgrad\sb{x}{x+y+z}
+% \]
+% \end{minipage}
+% \end{enumerate}
+%
+% \subsection{Divergence Operator Commands}
+% \label{sec:div-op-cmds}
+%
+% \subsubsection{Standalone Operator Command}
+% \label{sec:div-op-standalone}
+%
+% \begin{function}[updated=2024-07-08]{\divergence}
+% \begin{syntax}
+% \cs{divergence} \oarg{kv opts}
+% \cs{divergence} \oarg{kv opts} \_\marg{subscript}
+% \end{syntax}
+% The \cs{divergence} command produces the divergence operator
+% \enquote{\(\divergence\)},
+% its usage is analogous to the use of the \cs{grad} command,
+% which is described in section~\ref{sec:grad-op-standalone}.
+% \end{function}
+%
+% \paragraph{Examples}
+% \begin{enumerate}
+% \item Standalone divergence operator
+%
+% \begin{minipage}{.49\linewidth}
+% \begin{verbatim}
+% \[
+% \divergence f(x)
+% \]
+% \end{verbatim}
+% \end{minipage}\hfill
+% \begin{minipage}{.49\linewidth}
+% \[\divergence f\]
+% \end{minipage}
+%
+% \item Standalone divergence operator
+% with an arrow over the gradient operator
+%
+% \begin{minipage}{.49\linewidth}
+% \begin{verbatim}
+% \[
+% \divergence[arrownabla] f(x)
+% \]
+% \end{verbatim}
+% \end{minipage}\hfill
+% \begin{minipage}{.49\linewidth}
+% \[\divergence[arrownabla] f(x)\]
+% \end{minipage}
+%
+% \item Standalone divergence operator with subscript
+%
+% \begin{minipage}{.49\linewidth}
+% \begin{verbatim}
+% \[
+% \divergence_{x} f(x)
+% \]
+% \end{verbatim}
+% \end{minipage}\hfill
+% ^^X We need to use \sb because of the subscript package
+% \begin{minipage}{.49\linewidth}
+% \[\divergence\sb{x} f(x)\]
+% \end{minipage}
+% \end{enumerate}
+% \subsubsection{Operators with Delimiters}
+% \label{sec:div-op-delim}
+%
+% \begin{function}{
+% \pdiv,
+% \bdiv,
+% \Bdiv,
+% \vdiv,
+% \Vdiv
+% }
+% \begin{syntax}
+% \cs[no-index]{\meta{delim}div} \oarg{size cmd} \marg{content}
+% \cs[no-index]{\meta{delim}div} \oarg{kv opts} \marg{content}
+% \cs[no-index]{\meta{delim}div} \oarg{size cmd} \_\marg{subscript} \marg{content}
+% \cs[no-index]{\meta{delim}div} \oarg{kv opts} \_\marg{subscript} \marg{content}
+% \cs[no-index]{\meta{delim}div}* \oarg{kv opts} \marg{content}
+% \cs[no-index]{\meta{delim}div}* \oarg{kv opts} \_\marg{subscript} \marg{content}
+% \end{syntax}
+% The \cs[no-index]{\meta{delim}div} family of commands produces the divergence
+% operator with its arguments placed inside delimiters.
+% The usage of these commands is analogous to the \cs[no-index]{\meta{delim}grad}
+% family of commands described in section~\ref{sec:grad-op-delim}.
+% \end{function}
+%
+% \paragraph{Examples}
+%
+% \begin{enumerate}
+% \item Divergence operator with parenthesis and no scaling
+%
+% \begin{minipage}{.49\linewidth}
+% \begin{verbatim}
+% \[
+% \pdiv{1+x}
+% \]
+% \end{verbatim}
+% \end{minipage}\hfill
+% \begin{minipage}{.49\linewidth}
+% \[\pdiv{1+x}\]
+% \end{minipage}
+% \item Bold version with manual scaling and subscript
+%
+% \begin{verbatim}
+% \[
+% \pdiv[boldnabla=true,scale=\Big]_{x}{1 + \frac{1}{x}}
+% \]
+% \end{verbatim}
+% \[\pdiv[boldnabla=true,scale=\Big]\sb{x}{1+\frac{1}{x}}\]
+%
+% \item Automatic scaling
+%
+% \begin{minipage}{.49\linewidth}
+% \begin{verbatim}
+% \[
+% \pdiv*{1 + \frac{1}{x}}
+% \]
+% \end{verbatim}
+% \end{minipage}\hfill
+% \begin{minipage}{.49\linewidth}
+% \[\pdiv*{1 + \frac{1}{x}}\]
+% \end{minipage}
+% \end{enumerate}
+%
+% \subsection{Curl Operator Commands}
+% \label{sec:curl-op-cmds}
+%
+% \subsubsection{Standalone Operator Command}
+% \label{sec:curl-op-standalone}
+%
+% \begin{function}[updated=2024-07-08]{\curl}
+% \begin{syntax}
+% \cs{curl} \oarg{kv opts}
+% \cs{curl} \oarg{kv opts} \_\marg{subscript}
+% \end{syntax}
+% The \cs{curl} command produces the curl operator \enquote{\(\curl\)},
+% its usage is analogous to the use of the \cs{grad} command
+% described in section~\ref{sec:grad-op-standalone}.
+% \end{function}
+%
+% \paragraph{Examples}
+% \begin{enumerate}
+% \item Standalone curl operator
+%
+% \begin{minipage}{.49\linewidth}
+% \begin{verbatim}
+% \[
+% \curl f(x)
+% \]
+% \end{verbatim}
+% \end{minipage}\hfill
+% \begin{minipage}{.49\linewidth}
+% \[\curl f(x)\]
+% \end{minipage}
+%
+% \item Standalone curl operator with an arrow over the gradient operator
+%
+% \begin{minipage}{.49\linewidth}
+% \begin{verbatim}
+% \[
+% \curl[arrownabla] f(x)
+% \]
+% \end{verbatim}
+% \end{minipage}\hfill
+% \begin{minipage}{.49\linewidth}
+% \[\curl[arrownabla] f(x)\]
+% \end{minipage}
+%
+% \item Standalone curl operator with subscript
+%
+% \begin{minipage}{.49\linewidth}
+% \begin{verbatim}
+% \[
+% \curl_{x} f(x,y)
+% \]
+% \end{verbatim}
+% \end{minipage}\hfill
+% \begin{minipage}{.49\linewidth}
+% \[\curl\sb{x} f(x,y)\]
+% \end{minipage}
+% \end{enumerate}
+%
+% \subsubsection{Operators with Delimiters}
+% \label{sec:curl-op-delim}
+%
+% \begin{function}{
+% \pcurl,
+% \bcurl,
+% \Bcurl,
+% \vcurl,
+% \Vcurl
+% }
+% \begin{syntax}
+% \cs[no-index]{\meta{delim}curl} \oarg{size cmd} \marg{content}
+% \cs[no-index]{\meta{delim}curl} \oarg{kv opts} \marg{content}
+% \cs[no-index]{\meta{delim}curl} \oarg{size cmd} \_\marg{subscript} \marg{content}
+% \cs[no-index]{\meta{delim}curl} \oarg{kv opts} \_\marg{subscript} \marg{content}
+% \cs[no-index]{\meta{delim}curl}* \oarg{kv opts} \marg{content}
+% \cs[no-index]{\meta{delim}curl}* \oarg{kv opts} \_\marg{subscript} \marg{content}
+% \end{syntax}
+% The \cs[no-index]{\meta{delim}curl} family of commands produce the curl operator
+% with its arguments placed inside delimiters.
+% The usage of these commands is analogous to the \cs[no-index]{\meta{delim}grad}
+% family of commmands described in section~\ref{sec:grad-op-delim}.
+% \end{function}
+%
+% \paragraph{Examples}
+% \begin{enumerate}
+% \item Curl operator with parenthesis without scaling
+%
+% \begin{minipage}{.49\linewidth}
+% \begin{verbatim}
+% \[
+% \pcurl{1+x}
+% \]
+% \end{verbatim}
+% \end{minipage}\hfill
+% \begin{minipage}{.49\linewidth}
+% \[\pcurl{1+x}\]
+% \end{minipage}
+%
+% \item Bold version with manual scaling and subscript
+%
+% \begin{verbatim}
+% \[
+% \pcurl[boldnabla=true,scale=\Big]_{x}{1 + \frac{1}{x}}
+% \]
+% \end{verbatim}
+% \[
+% \pcurl[boldnabla=true,scale=\Big]\sb{x}{1 + \frac{1}{x}}
+% \]
+%
+% \item Automatic scaling
+%
+% \begin{minipage}{.49\linewidth}
+% \begin{verbatim}
+% \[
+% \pcurl*{1 + \frac{1}{x}}
+% \]
+% \end{verbatim}
+% \end{minipage}\hfill
+% \begin{minipage}{.49\linewidth}
+% \[\pcurl*{1 + \frac{1}{x}}\]
+% \end{minipage}
+% \end{enumerate}
+% \changes{v0.2.0}{\GetVersionDate{v0.2.0}}{%
+% Fixed example to match description.
+% }
+%
+%
+% \subsection{Laplace Operator Commands}
+% \label{sec:laplace-op-cmds}
+%
+% This section describes commands which can be used to typeset a Laplace
+% operator.
+%
+%
+% Like the commands described in sections~\ref{sec:grad-op-cmds},
+% \ref{sec:div-op-cmds}, and~\ref{sec:curl-op-cmds}
+% the commands in this section accept key-value options via an optional
+% argument.
+% There is some deviation from the options compared to the above commands:
+% The "arrownabla" option is ignored,
+% instead the "arrowlaplace" option produces an arrow over the operator.
+% The "boldnabla" option on the other hand is not ignored.
+% Finally the "delta-laplace" option replaces the symbol used
+% for the operator from \(\laplacian\) to \(\laplacian[delta-laplace]\)
+%
+% \subsubsection{Standalone Operator Command}
+% \label{sec:laplace-op-standalone}
+%
+%
+% \begin{function}[updated=2024-07-08]{\laplacian}
+% \begin{syntax}
+% \cs{laplacian} \oarg{kv opts}
+% \cs{laplacian} \oarg{kv opts} \_\marg{subscript}
+% \end{syntax}
+% The \cs{laplacian} command produces a Laplace operator,
+% which looks by default like this: \(\laplacian\).
+%
+% Its interface is analogous to the \cs{grad}, \cs{divergence},
+% and \cs{curl} commands described above,
+% with the difference in key-value options described at the start of this
+% subsection.
+% \end{function}
+%
+%
+% \subsubsection{Operators with Delimiters}
+% \label{sec:laplace-op-delim}
+%
+% \begin{function}{
+% \plaplacian,
+% \blaplacian,
+% \Blaplacian,
+% \vlaplacian,
+% \Vlaplacian
+% }
+% \begin{syntax}
+% \cs[no-index]{\meta{delim}laplacian} \oarg{size cmd} \marg{content}
+% \cs[no-index]{\meta{delim}laplacian} \oarg{kv opts} \marg{content}
+% \cs[no-index]{\meta{delim}laplacian} \oarg{size cmd} \_\marg{subscript} \marg{content}
+% \cs[no-index]{\meta{delim}laplacian} \oarg{kv opts} \_\marg{subscript} \marg{content}
+% \cs[no-index]{\meta{delim}laplacian}* \oarg{kv opts} \marg{content}
+% \cs[no-index]{\meta{delim}laplacian}* \oarg{kv opts} \_\marg{subscript} \marg{content}
+% \end{syntax}
+% \end{function}
+%
+% \paragraph{Examples}
+% \begin{enumerate}
+% \item Laplace operator delimited by parenthesis without scaling
+%
+% \begin{minipage}{.49\linewidth}
+% \begin{verbatim}
+% \[
+% \plaplacian{1+x}
+% \]
+% \end{verbatim}
+% \end{minipage}\hfill
+% \begin{minipage}{.49\linewidth}
+% \[\plaplacian{1+x}\]
+% \end{minipage}
+%
+% \item Version with arrow, manual scaling and subscript
+%
+% \begin{verbatim}
+% \[
+% \plaplacian[arrowlaplace=true,scale=\Big]_{x}{1 + \frac{1}{x}}
+% \]
+% \end{verbatim}
+% \[
+% \plaplacian[arrowlaplace=true,scale=\Big]\sb{x}{1 + \frac{1}{x}}
+% \]
+%
+% \item Version with automatic scaling
+%
+% \begin{minipage}{.49\linewidth}
+% \begin{verbatim}
+% \[
+% \plaplacian*{1 + \frac{1}{x}}
+% \]
+% \end{verbatim}
+% \end{minipage}\hfill
+% \begin{minipage}{.49\linewidth}
+% \[\plaplacian*{1 + \frac{1}{x}}\]
+% \end{minipage}
+%
+% \item Using a delta as symbol for the Laplacian
+%
+% \begin{minipage}{.49\linewidth}
+% \begin{verbatim}
+% \[
+% \plaplacian[delta-laplace=true]{1+x}
+% \]
+% \end{verbatim}
+% \end{minipage}\hfill
+% \begin{minipage}{.49\linewidth}
+% \[\plaplacian[delta-laplace=true]{1+x}\]
+% \end{minipage}
+% \end{enumerate}
+%
+%
+% \subsection{^^X
+% Commands Producing a \foreignlanguage{french}{d'Alembert} operator
+% }
+% \label{sec:dalembert-op-cmds}
+%
+% \subsubsection{Standalone Operator Command}
+% \label{sec:dalembert-op-standalone}
+%
+% \begin{function}[
+% added = 2024-07-04,
+% updated=2024-07-08,
+% ]{\quabla}
+% \begin{syntax}
+% \cs{quabla} \oarg{kv~opts}
+% \cs{quabla} \oarg{kv~opts} \_\marg{subscript}
+% \end{syntax}
+% The \cs{quabla} command produces
+% the \foreignlanguage{french}{d'Alembert} operator \enquote{\(\quabla\)}.
+% This command accepts an optional subscript.
+% \end{function}
+%
+% The command is called \cs{quabla} because thats shorter and easier to type than
+% \cs[no-index]{dalembertian}.
+% If you want to have a command called \cs[no-index]{dalembertian},
+% put the following in your documents preamble.
+% \begin{verbatim}
+% \NewCommandCopy\quabla\dalembertian
+% \end{verbatim}
+%
+% \paragraph{Example of Use:}
+% \begin{quote}
+% \begin{minipage}{.49\linewidth}
+% \begin{verbatim}
+% \[
+% \quabla f(x)
+% \]
+% \end{verbatim}
+% \end{minipage}\hfill
+% \begin{minipage}{.49\linewidth}
+% \[\quabla f(x)\]
+% \end{minipage}
+% \end{quote}
+%
+%
+% \subsubsection{Operators with Delimiters}
+% \label{sec:dalembert-op-delim}
+%
+% \begin{function}[added = 2024-07-04]{
+% \pquabla,
+% \bquabla,
+% \Bquabla,
+% \vquabla,
+% \Vquabla,
+% }
+% \begin{syntax}
+% \cs[no-index]{\meta{delim}quabla} \oarg{size~cmd} \marg{contents}
+% \cs[no-index]{\meta{delim}quabla} \oarg{kv~opts} \marg{contents}
+% \cs[no-index]{\meta{delim}quabla} \oarg{size~cmd} \_\marg{subscript} \marg{contents}
+% \cs[no-index]{\meta{delim}quabla} \oarg{kv~opts} \_\marg{subscript} \marg{contents}
+% \cs[no-index]{\meta{delim}quabla}* \oarg{kv~opts} \marg{contents}
+% \cs[no-index]{\meta{delim}quabla}* \oarg{kv~opts} \_\marg{subscript} \marg{contents}
+% \end{syntax}
+% The \cs[no-index]{\meta{delim}quabla} family of commands produce a
+% \foreignlanguage{french}{d'Alembert} operator with <contents> placed inside
+% delimiters.
+% Their usage is analogous to the \cs[no-index]{\meta{delim}grad} family of
+% commands described in section~\ref{sec:grad-op-delim}.
+% \end{function}
+%
+% \changes{v0.2.0}{\GetVersionDate{v0.2.0}}{%
+% Fixed syntax description of standalone operators not matching reality.
+% }
+%
+%
+% \section{Row- and Column Vectors}
+% \label{sec:rc-vectors}
+%
+% \DescribeOption{no-crvector}
+% The command in this section are only declared if the option |no-crvector|
+% has not been given as a package option.
+%
+% ^^X \DescribeOption{delimiter}
+% ^^X \DescribeOption{fill}
+% ^^X \DescribeOption{align}
+% ^^X The commands in this section all accept key-value options as optional argument.
+% Valid keys are "delimiter", "fill", and "align",
+% their usage is described in section~\ref{sec:options-matrix}.
+%
+% \begin{function}[
+% updated=2024-08-20,
+% ]{
+% \cvector,
+% \rvector
+% }
+% \begin{syntax}
+% \cs{cvector} \oarg{kv opts} \marg{clist}
+% \cs{rvector} \oarg{kv opts} \marg{clist}
+% \end{syntax}
+% The commands \cs{cvector} and \cs{rvector} produce row and column vectors
+% respectively. Both of them accept key-value options as optional argument
+% \meta{kv opts}. Valid keys and values are described in section~\ref{sec:options-matrix}.
+%
+% The mandatory argument \meta{clist} is a comma-separated-list,
+% whose elements are the entries of the column/row vector.
+% If a comma has to appear inside an entry the entire entry has to be wrapped
+% in braces.
+%
+% The delimiter of the row or column vectors depends on the current value of
+% the option |delimiter|, by default empty. The option |fill| has no effect
+% on the commands and is simply ignored.
+%
+% \begin{texnote}
+% If you were to define your own \env{matrix*}-like environment
+% called \env{mymatrix*},
+% which has an interface compatible to \pkg{mathtools}'s \env{matrix*}
+% family of environments,
+% you could make use of it by setting the value of |delimiter| to |my|.
+% \end{texnote}
+% \end{function}
+%
+% \medbreak\noindent
+% \textbf{Examples:}
+% \begin{enumerate}
+% \item Column \enquote{vector} without delimiters:
+%
+% \begin{minipage}{.49\linewidth}
+% \begin{verbatim}
+% \[
+% \cvector{a_{1},a_{2},a_{3}}
+% \]
+% \end{verbatim}
+% \end{minipage}\hfill
+% \begin{minipage}{.49\linewidth}
+% \[
+% \cvector{a_{1},a_{2},a_{3}}
+% \]
+% \end{minipage}
+%
+% \item A column vectors delimited with parenthesis and different alignment:
+%
+% \begin{minipage}{.49\linewidth}
+% \begin{verbatim}
+% \[
+% \cvector[delimiter=p,align=c]{-1,2,3}
+% \]
+% \end{verbatim}
+% \end{minipage}\hfill
+% \begin{minipage}{.49\linewidth}
+% \[
+% \cvector[delimiter=p,align=c]{-1,2,3}
+% \]
+% \end{minipage}\\[1ex]
+% \begin{minipage}{.49\linewidth}
+% \begin{verbatim}
+% \[
+% \cvector[delimiter=p,align=r]{-1,2,3}
+% \]
+% \end{verbatim}
+% \end{minipage}\hfill
+% \begin{minipage}{.49\linewidth}
+% \[
+% \cvector[delimiter=p,align=r]{-1,2,3}
+% \]
+% \end{minipage}\\[1ex]
+% \begin{minipage}{.49\linewidth}
+% \begin{verbatim}
+% \[
+% \cvector[delimiter=p,align=l]{-1,2,3}
+% \]
+% \end{verbatim}
+% \end{minipage}\hfill
+% \begin{minipage}{.49\linewidth}
+% \[
+% \cvector[delimiter=p,align=l]{-1,2,3}
+% \]
+% \end{minipage}
+% \end{enumerate}
+%
+% \paragraph{Row- and Column Vectors with Predefined Delimiters}
+%
+% As vectors are commonly delimited by parenthesis, brackets, braces, etc.\
+% several shorthands producing delimited vectors are also available.
+% \begin{function}[updated=2024-08-20]{
+% \pcvector,
+% \bcvector,
+% \Bcvector,
+% \vcvector,
+% \Vcvector,
+% \prvector,
+% \brvector,
+% \Brvector,
+% \vrvector,
+% \Vrvector,
+% \prvector,
+% \brvector,
+% \Brvector,
+% \vrvector,
+% \Vrvector
+% }
+% \begin{syntax}
+% \cs[no-index]{\meta{delim}cvector} \oarg{kv opts} \marg{clist}
+% \cs[no-index]{\meta{delim}rvector} \oarg{kv opts} \marg{clist}
+% \end{syntax}
+% The \cs[no-index]{\meta{delim}\meta{c or r}vector} family of commands,
+% accepts a list of key-value options as optional argument \meta{kv opts}.
+% Valid keys are described in section~\ref{sec:options-matrix}.
+%
+% The mandatory argument \meta{clist} is a comma-separated-list of
+% the entries of the vector.
+% If a comma needs to appear inside an entry of the vector,
+% that entry has to be wrapped in braces.
+%
+% \meta{delim} may have the value "p" for parenthesis,
+% "b" for brackets, "B" for braces, "v" for a single vertical line,
+% or "V" for a double vertical line.
+% \end{function}
+%
+% \subparagraph{Example}
+% \begin{quote}
+% \begin{minipage}{.49\linewidth}
+% \begin{verbatim}
+% \[
+% \pcvector{a_{1},a_{2},a_{3}}
+% \]
+% \end{verbatim}
+% \end{minipage}\hfill
+% \begin{minipage}{.49\linewidth}
+% \[
+% \pcvector{a_{1},a_{2},a_{3}}
+% \]
+% \end{minipage}
+% \end{quote}
+%
+% \subsection{Small Versions for Inline Math}
+% \label{sec:rc-vectors-small}
+%
+% As the \env{matrix} and \env{matrix*} family of environments is unsuitable,
+% for inline math,
+% \pkg{mathtools}~\autocite{mathtools} provides the \env{smallmatrix}
+% and \env{smallmatrix*} family of environments.
+% This package provides analogous commands for row and column vectors
+% to be typeset in inline math mode.
+%
+% \begin{function}[
+% updated=2024-08-20,
+% ]{
+% \smallcvector,
+% \smallrvector
+% }
+% \begin{syntax}
+% \cs{smallcvector} \oarg{kv opts} \marg{clist}
+% \cs{smallrvector} \oarg{kv opts} \marg{clist}
+% \end{syntax}
+% \cs{smallcvector} and \cs{smallrvector} produce column and row vectors
+% suitable for inline math.
+% Both commands accept the same optional key-value arguments as
+% \cs{cvector} and \cs{rvector}.
+% \end{function}
+%
+%
+% \medbreak\noindent
+% \textbf{Example:}
+% \begin{quote}
+% \begin{verbatim}
+% An inline version of \verb|\cvector| looks like this
+% \(\smallcvector{1,0}\).
+% \end{verbatim}
+% An inline version of \verb|\cvector| looks like this
+% \(\smallcvector{1,0}\).
+% \end{quote}
+%
+% \begin{function}[updated=2024-08-20]{
+% \psmallcvector,
+% \bsmallcvector,
+% \Bsmallcvector,
+% \vsmallcvector,
+% \Vsmallcvector,
+% \psmallrvector,
+% \bsmallrvector,
+% \Bsmallrvector,
+% \vsmallrvector,
+% \Vsmallrvector,
+% }
+% \begin{syntax}
+% \cs{psmallcvector} \oarg{kv opts} \marg{clist}
+% \cs[no-index]{psmallrvector} \oarg{kv opts} \marg{clist}
+% \cs[no-index]{\meta{delim}small\meta{c or r}vector} \oarg{kv opts} \marg{clist}
+% \end{syntax}
+% The \cs[no-index]{\meta{delim}small\meta{c or r}vector} family of commands
+% like \cs{psmallcvector} produce small inline math version of row and column
+% vectors. Their interface is identical to the commands described above.
+% \end{function}
+%
+% \medbreak\noindent
+% \textbf{Example:}\nobreak
+% \begin{quote}
+% \begin{verbatim}
+% An inline version of \verb|\pcvector| looks like this
+% \(\psmallcvector{1,0}\).
+% \end{verbatim}
+% An inline version of \verb|\pcvector| looks like this
+% \(\psmallcvector{1,0}\).
+% \end{quote}
+%
+%
+% \section{Shorthands for Simple Matrices}
+% \label{sec:matrices}
+%
+% \DescribeOption{no-matrix}
+% The commands in this section are only defined if the option "no-matrix"
+% \emph{has not been given} to the package at load-time.
+%
+%
+% \subsection{(Anti-)diagonal Matrices}
+% \label{sec:diagonal-matrices}
+%
+% \begin{function}{
+% \diagmat,
+% \antidiagmat,
+% }
+% \begin{syntax}
+% \cs{diagmat} \oarg{kv opts} \marg{diagonal}
+% \cs{antidiagmat} \oarg{kv opts} \marg{diagonal}
+% \end{syntax}
+% \cs{diagmat} and \cs{antidiagmat} produce a diagonal or anti-diagonal matrix
+% respectively.
+% The optional argument \meta{kv~opts} accepts the key value options
+% described in section~\ref{sec:options-matrix}.
+%
+% The key "fill" determines the contents of the matrix entries
+% which are not part of the (anti-)diagonal,
+% its default value is |{}| i.e.\ empty.
+% The key "align" determines the alignment of the entries inside the
+% matrix, valid values are usually "l", "c", and "r",
+% the default is "c".
+% The key "delimiter" determines the delimiter around the matrix,
+% its default value is |{}| (none).
+% Valid values for the delimiters are "p" for parenthesis,
+% "b" for brackets, "B" for braces, "v" for a single vertical line
+% (\enquote{\(\vert\)}), and "V" for a double vertical line (\enquote{\(\Vert\)}).
+% See the \pkg{mathtools} manual~\autocite{mathtools} for more information.
+%
+% \begin{texnote}
+% The value of "delimiter" gets inserted inside the |\begin{#1matrix*}|
+% and |\end{#1matrix*}| commands.
+% Therefore it would be possible to define your own \env{matrix*}
+% like environment,
+% called for example \env{mymatrix*} and set "delimiter=my"
+% to make use of it.
+% \end{texnote}
+%
+% The mandatory argument \meta{diagonal} has to be a comma separated list
+% of the entries of the (anti-)diagonal.
+% If an entry of the diagonal needs to contain a comma "," the entire entry
+% has to be wrapped in braces.
+% \end{function}
+%
+% \medskip\noindent
+% \textbf{Examples:}
+% \begin{enumerate}
+% \item A diagonal and an anti-diagonal matrix without delimiters:
+%
+% \begin{minipage}{.49\linewidth}
+% \begin{verbatim}
+% \begin{gather*}
+% \diagmat{1,2,3}\\[.5ex]
+% \antidiagmat{1,2,3}
+% \end{gather*}
+% \end{verbatim}
+% \end{minipage}\hfill
+% \begin{minipage}{.49\linewidth}
+% \begin{gather*}
+% \diagmat{1,2,3}\\[.5ex]
+% \antidiagmat{1,2,3}
+% \end{gather*}
+% \end{minipage}
+% \item A diagonal matrix delimited by parenthesis filled with zeros:
+%
+% \begin{minipage}{.49\linewidth}
+% \begin{verbatim}
+% \[
+% \diagmat[delimiter=p,fill=0]{1,2,3}
+% \]
+% \end{verbatim}
+% \end{minipage}\hfill
+% \begin{minipage}{.49\linewidth}
+% \[
+% \diagmat[delimiter=p,fill=0]{1,2,3}
+% \]
+% \end{minipage}
+%
+% \item A diagonal matrix filled with a symbol:
+%
+% \begin{minipage}{.49\linewidth}
+% \begin{verbatim}
+% \[
+% \diagmat[fill=\square]{1,2,3}
+% \]
+% \end{verbatim}
+% \end{minipage}\hfill
+% \begin{minipage}{.49\linewidth}
+% \[\diagmat[fill=\square]{1,2,3}\]
+% \end{minipage}
+%
+% \item Diagonal matrices with different alignment:
+%
+% \begin{verbatim}
+% \[
+% \diagmat[delimiter=p,align=c,fill=0]{-1,-2,-3} \qquad
+% \diagmat[delimiter=p,align=l,fill=0]{-1,-2,-3} \qquad
+% \diagmat[delimiter=p,align=r,fill=0]{-1,-2,-3}
+% \]
+% \end{verbatim}
+% \[
+% \diagmat[delimiter=p,align=c,fill=0]{-1,-2,-3} \qquad
+% \diagmat[delimiter=p,align=l,fill=0]{-1,-2,-3} \qquad
+% \diagmat[delimiter=p,align=r,fill=0]{-1,-2,-3}
+% \]
+% \end{enumerate}
+%
+%
+% \paragraph{Shorthands for (Anti-)diagonal Matrices with Delimiters}
+%
+% As matrices are more often than not written inside of delimiters,
+% \pkg{moremath} provides several shorthands for producing those matrices
+% without having to set the "delimiter" key explicitly.
+% \begin{function}{
+% \pdiagmat,
+% \bdiagmat,
+% \Bdiagmat,
+% \vdiagmat,
+% \Vdiagmat
+% }
+% \begin{syntax}
+% \cs{pdiagmat} \oarg{kv opts} \marg{diagonal}
+% \cs{bdiagmat} \oarg{kv opts} \marg{diagonal}
+% \cs{Bdiagmat} \oarg{kv opts} \marg{diagonal}
+% \cs{vdiagmat} \oarg{kv opts} \marg{diagonal}
+% \cs{Vdiagmat} \oarg{kv opts} \marg{diagonal}
+% \end{syntax}
+% The \cs[no-index]{\meta{delim}diagmat} family of commands provides
+% shorthands for producing a delimited (anti-)diagonal matrix
+% without having to set the "delimiter" key explicitly every time.
+% The pre-set "delimiter" may be overwritten by explicitly passing "delimiter"
+% as a key-value option.
+%
+% The optional argument \meta{kv~opts} accepts the same key-value arguments
+% as \cs{diagmat}.
+% \end{function}
+%
+% \medskip\noindent
+% \textbf{Example:}
+% \begin{quote}
+% \begin{minipage}{.49\linewidth}
+% \begin{verbatim}
+% \[
+% \pdiagmat{1,2,3}
+% \]
+% \end{verbatim}
+% \end{minipage}\hfill
+% \begin{minipage}{.49\linewidth}
+% \[
+% \pdiagmat{1,2,3}
+% \]
+% \end{minipage}
+% \end{quote}
+%
+% \begin{function}{
+% \pantidiagmat,
+% \bantidiagmat,
+% \Bantidiagmat,
+% \vantidiagmat,
+% \Vantidiagmat
+% }
+% \begin{syntax}
+% \cs{pantidiagmat} \oarg{kv opts} \marg{diagonal}
+% \cs{bantidiagmat} \oarg{kv opts} \marg{diagonal}
+% \cs{Bantidiagmat} \oarg{kv opts} \marg{diagonal}
+% \cs{vantidiagmat} \oarg{kv opts} \marg{diagonal}
+% \cs{Vantidiagmat} \oarg{kv opts} \marg{diagonal}
+% \end{syntax}
+% The \cs[no-index]{\meta{delim}antidiagmat} family of commands behaves
+% like the \cs[no-index]{\meta{delim}diagmat} commands described above,
+% except they produce anti-diagonal matrices.
+% \end{function}
+%
+% \medskip\noindent
+% \textbf{Example:}
+% \begin{quote}
+% \begin{minipage}{.49\linewidth}
+% \begin{verbatim}
+% \[
+% \pantidiagmat{1,2,3}
+% \]
+% \end{verbatim}
+% \end{minipage}
+% \begin{minipage}{.49\linewidth}
+% \[
+% \pantidiagmat{1,2,3}
+% \]
+% \end{minipage}
+% \end{quote}
+%
+%
+% \subsubsection{Small Versions for Inline Math}
+% \label{sec:matrices-small}
+%
+% \pkg{mathtools} defines special matrix environments for use in
+% inline math mode,
+% the \env{smallmatrix} and \env{smallmatrix*} family of environments.
+% \pkg{moremath} provides for the case of typesetting an (anti-)diagonal
+% matrix several commands which utilize these inline math versions.
+%
+% \begin{function}{
+% \smalldiagmat,
+% \smallantidiagmat,
+% }
+% \begin{syntax}
+% \cs{smalldiagmat} \oarg{kv opts} \marg{diagonal}
+% \cs{smallantidiagmat} \oarg{kv opts} \marg{diagonal}
+% \end{syntax}
+% The \cs{smalldiagmat} and \cs{smallantidiagmat} commands behave like
+% their non-"small" counterpart described above,
+% see their description for more information.
+% \end{function}
+%
+% \medskip\noindent
+% \textbf{Example:}
+% \begin{quote}
+% \begin{verbatim}
+% An inline version of a diagonal matrix looks like this
+% \(\smalldiagmat{1,1}\).
+% \end{verbatim}
+% An inline version of a diagonal matrix looks like this
+% \(\smalldiagmat{1,1}\).
+% \end{quote}
+%
+% \begin{function}{
+% \psmalldiagmat,
+% \bsmalldiagmat,
+% \Bsmalldiagmat,
+% \vsmalldiagmat,
+% \Vsmalldiagmat,
+% }
+% \begin{syntax}
+% \cs{psmalldiagmat} \oarg{kv opts} \marg{diagonal}
+% \cs{bsmalldiagmat} \oarg{kv opts} \marg{diagonal}
+% \cs{Bsmalldiagmat} \oarg{kv opts} \marg{diagonal}
+% \cs{vsmalldiagmat} \oarg{kv opts} \marg{diagonal}
+% \cs{Vsmalldiagmat} \oarg{kv opts} \marg{diagonal}
+% \end{syntax}
+% Like the \cs[no-index]{\meta{delim}diagmat} commands described above
+% there are also shorthand commands for producing an inline math version
+% of a diagonal matrix with pre-set delimiters.
+% \end{function}
+%
+% \medbreak\noindent
+% \textbf{Example:}
+% \begin{quote}
+% \begin{verbatim}
+% An inline math delimited diagonal matrix looks like this
+% \(\psmalldiagmat{1,1}\).
+% \end{verbatim}
+% An inline math delimited diagonal matrix looks like this
+% \(\psmalldiagmat{1,1}\).
+% \end{quote}
+%
+% \begin{function}{
+% \psmallantidiagmat,
+% \bsmallantidiagmat,
+% \Bsmallantidiagmat,
+% \vsmallantidiagmat,
+% \Vsmallantidiagmat,
+% }
+% \begin{syntax}
+% \cs{psmallantidiagmat} \oarg{kv opts} \marg{diagonal}
+% \cs{bsmallantidiagmat} \oarg{kv opts} \marg{diagonal}
+% \cs{Bsmallantidiagmat} \oarg{kv opts} \marg{diagonal}
+% \cs{vsmallantidiagmat} \oarg{kv opts} \marg{diagonal}
+% \cs{Vsmallantidiagmat} \oarg{kv opts} \marg{diagonal}
+% \end{syntax}
+% Like the \cs[no-index]{\meta{delim}antidiagmat} commands described above
+% there are also shorthand commands for producing inline math versions
+% of anti-diagonal matrices inside of delimiters.
+% \end{function}
+%
+% \medbreak\noindent
+% \textbf{Example:}
+% \begin{quote}
+% \begin{verbatim}
+% A delimited version of an inline math anti-diagonal matrix
+% looks like this \(\psmallantidiagmat{1,1}\).
+% \end{verbatim}
+% A delimited version of an inline math anti-diagonal matrix
+% looks like this \(\psmallantidiagmat{1,1}\).
+% \end{quote}
+%
+% \subsection{Identity Matrices}
+% \label{sec:id-matrices}
+%
+% As identity matrices are always quadratic,
+% one can further simplify the typesetting of identity matrices to a command,
+% which constructs the identity matrix from the number of dimensions.
+% The commands in this subsection perform this.
+%
+% \begin{function}[added = 2024-07-04]{
+% \idmat,
+% \smallidmat,
+% }
+% \begin{syntax}
+% \cs{idmat} \oarg{kv~opts} \marg{dimension}
+% \cs{smallidmat} \oarg{kv~opts} \marg{dimension}
+% \end{syntax}
+% The \cs{idmat} command produces an identity matrix.
+% The optional argument <kv~opts> accepts any valid \emph{matrix} key-value
+% arguments,
+% which are described in section~\ref{sec:options-matrix}.
+% The mandatory argument <dimension> expects a \emph{positive} integer,
+% which specifies the dimensions of the identity matrix.
+%
+% The \cs{smallidmat} command behaves like the \cs{idmat} command,
+% except it produces a matrix suitable for inline math mode.
+%
+% \begin{texnote}
+% The maximum number of columns is determined by the \TeX{} counter
+% "MaxMatrixCols",
+% which has a default value of 10.
+% See \textcite{amsmath} for more information.
+% \end{texnote}
+% \end{function}
+%
+%
+% \begin{function}[added = 2024-07-04]{
+% \pidmat,
+% \bidmat,
+% \Bidmat,
+% \vidmat,
+% \Vidmat
+% }
+% \begin{syntax}
+% \cs{pidmat} \oarg{kv~opts} \marg{dimension}
+% \cs{bidmat} \oarg{kv~opts} \marg{dimension}
+% \cs{Bidmat} \oarg{kv~opts} \marg{dimension}
+% \cs{vidmat} \oarg{kv~opts} \marg{dimension}
+% \cs{Vidmat} \oarg{kv~opts} \marg{dimension}
+% \end{syntax}
+% Like the \cs[no-index]{\meta{delim}diagmat} commands,
+% the \cs[no-index]{\meta{delim}idmat} commands produce an identity matrix
+% with a pre-set delimiter around the matrix,
+% i.e.\ they behave like \cs{idmat}|[delimiter = |<delim>|]|\marg{dimension}.
+% <delim> can be "p" for parenthesis,
+% "b" for brackets,
+% "B" for braces,
+% "v" for a single vertical line (\enquote{\(\vert\)}),
+% or "V" for a double vertical line (\enquote{\(\Vert\)}).
+%
+% Furthermore these commands accept the same <kv~opts> as the \cs{idmat} command.
+% \end{function}
+%
+% \begin{function}[added = 2024-07-04]{
+% \psmallidmat,
+% \bsmallidmat,
+% \Bsmallidmat,
+% \vsmallidmat,
+% \Vsmallidmat
+% }
+% \begin{syntax}
+% \cs{psmallidmat} \oarg{kv~opts} \marg{dimension}
+% \cs{bsmallidmat} \oarg{kv~opts} \marg{dimension}
+% \cs{Bsmallidmat} \oarg{kv~opts} \marg{dimension}
+% \cs{vsmallidmat} \oarg{kv~opts} \marg{dimension}
+% \cs{Vsmallidmat} \oarg{kv~opts} \marg{dimension}
+% \end{syntax}
+% These commands are provide inline math suitable versions of the
+% \cs[no-index]{\meta{delim}idmat} commands described above.
+% See their description for more information.
+%
+% The commands accept any of the key-value options described in section~\ref{sec:options-matrix}
+% as optional argument <kv~opts>.
+% \end{function}
+%
+% \paragraph{Examples of Use}
+% \begin{enumerate}
+% \item Identity matrix without delimiters:
+%
+% \begin{minipage}{.49\linewidth}
+% \begin{verbatim}
+% \[
+% \idmat{3}
+% \]
+% \end{verbatim}
+% \end{minipage}\hfill
+% \begin{minipage}{.49\linewidth}
+% \[\idmat{3}\]
+% \end{minipage}
+%
+% \item Identity matrices with different delimiters:
+%
+% \begin{verbatim}
+% \[
+% \pidmat{3}\text{,}\quad \bidmat{3}\text{,}\quad
+% \Bidmat{3}\text{,}\quad \vidmat{3}\text{,}\quad
+% \Vidmat{3}
+% \]
+% \end{verbatim}
+% \[
+% \pidmat{3}\text{,}\quad
+% \bidmat{3}\text{,}\quad
+% \Bidmat{3}\text{,}\quad
+% \vidmat{3}\text{,}\quad
+% \Vidmat{3}
+% \]
+%
+% \item Inline math versions of identity matrices with delimiters:
+%
+% \begin{verbatim}
+% Inline math mode matrices look like this:
+% \(\psmallidmat{2}\), \(\bsmallidmat{2}\), \(\Bsmallidmat{2}\),
+% \(\vsmallidmat{2}\), \(\Vsmallidmat{2}\).
+% \end{verbatim}
+% Inline math mode matrices look like this:
+% \(\psmallidmat{2}\), \(\bsmallidmat{2}\), \(\Bsmallidmat{2}\),
+% \(\vsmallidmat{2}\), \(\Vsmallidmat{2}\).
+%
+% \item Identity matrix using the "fill" option for the non-diagonal elements
+%
+% \begin{minipage}{.49\linewidth}
+% \begin{verbatim}
+% \[
+% \pidmat[fill=\star]{3}
+% \]
+% \end{verbatim}
+% \end{minipage}\hfill
+% \begin{minipage}{.49\linewidth}
+% \[\pidmat[fill=\star]{3}\]
+% \end{minipage}
+% \end{enumerate}
+%
+%
+% \section{Shorthands for Absolute Value and Norm}
+% \label{sec:shorthands}
+%
+% \DescribeOption{no-abs-shorthands}
+% The commands in this section are only declared if the option "no-abs-shorthands"
+% has not been given to the package as a load time option.
+%
+% \begin{function}{
+% \abs,
+% \norm
+% }
+% \begin{syntax}
+% \cs{abs} \oarg{size cmd} \marg{content}
+% \cs{abs}* \marg{content}
+% \cs{norm} \oarg{size cmd} \marg{content}
+% \cs{norm}* \marg{content}
+% \end{syntax}
+% The commands \cs{abs} and \cs{norm}, produce \(\abs{\cdot}\) and
+% \(\norm{\cdot}\) respectively.
+% These commands are simply paired delimiters defined using \pkg{mathtools}'
+% \cs[module=mathtools,replace=false]{DeclarePairedDelimiter} command,
+% instruction on their usage can therefore be found in~\textcite{mathtools}.
+% \end{function}
+%
+%
+% \section{Vertically Centering Math Along the Math Axis}
+% \label{sec:vcenter}
+%
+% Sometimes it is useful to explicitly center a math symbol along the math axis.
+% A prominent example is the case of |\mathop{\boldsymbol\nabla}\nolimits|
+% vs.\ |\mathop{\nabla}\nolimits|,
+% as displayed below.
+% \[
+% \mathop{\boldsymbol\nabla}\nolimits f(x)
+% \quad \mathop{\nabla}\nolimits f(x)
+% \]
+% Here the bold nabla is slightly higher up than the non-bold version.
+%
+% \begin{function}[added=2024-07-08]{\VCenterMath}
+% \begin{syntax}
+% \cs{VCenterMath} \marg{contents}
+% \end{syntax}
+% \begin{danger}
+% The command \cs{VCenterMath} centers <contents> along the current math axis,
+% while adhering to the current math style.
+% This command is not in a \TeX{}-sense
+% \tn[no-index]{long}, i.e.\ it does not take \tn[no-index]{par} tokens.
+%
+% This command is somewhat dangerous as it utilizes the \tn{vcenter} primitive,
+% which leaves math mode and requires to reenter it.
+% \emph{Use at your own responsibility.}
+% \end{danger}
+% \begin{texnote}
+% This command is a wrapper around \tn{vcenter}, \cs{hbox:n}
+% and \tn{mathpalette}, it reenters math mode inside the hbox.
+% \end{texnote}
+% \end{function}
+%
+% With \cs{VCenterMath} it is possible to fix the above example to:
+% \begin{quote}
+% \begin{verbatim}
+% \[
+% \mathop{\VCenterMath{\boldsymbol\nabla}}\nolimits f(x)
+% \quad \mathop{\nabla}\nolimits f(x)
+% \]
+% \end{verbatim}
+% \[
+% \mathop{\VCenterMath{\boldsymbol\nabla}}\nolimits f(x)
+% \quad \mathop{\nabla}\nolimits f(x)
+% \]
+% \end{quote}
+%
+%
+% \part{Documentation for Class and Package Authors}
+% \label{sec:package-auth-doc}
+%
+% \section{Setting of Options}
+% \label{sec:authors-options}
+%
+% \begin{function}[updated = 2024-07-15]{
+% \moremath_setup:n
+% }
+% \begin{syntax}
+% \cs{moremath_setup:n} \marg{kv opts}
+% \end{syntax}
+% This functions sets the key-value options \meta{kv~opts} in the "moremath" namespace.
+% \end{function}
+%
+% \section{Delimited Operators}
+% \label{sec:authors-delim-op}
+%
+% \begin{function}[updated = 2024-07-15]{
+% \moremath_delim_op_noscale:NNnnn,
+% \moremath_delim_op_autoscale:NNnnn
+% }
+% \begin{syntax}
+% \cs{moremath_delim_op_noscale:NNnnn} \meta{math~op} \meta{delim}
+% \hspace*{2ex} \marg{sup~tl} \marg{sub~tl} \marg{tl}
+% \cs{moremath_delim_op_autoscale:NNnnn} \meta{math op} \meta{delim}
+% \hspace*{2ex} \marg{sup~tl} \marg{sub~tl} \marg{tl}
+% \end{syntax}
+% The two functions \cs{moremath_delim_op_noscale:NNnnn} and \cs{moremath_delim_op_autoscale:NNnnn}
+% provide a version of a delimited operator with no scaling or automatic scaling respectively.
+% The token list arguments \meta{sup~tl} and \meta{sub~tl} take the super- and subscript
+% of the operator respectively. Both of those token lists may be empty.
+%
+% The first argument to the function is a control sequence \meta{math~op},
+% which should be an operator declared with
+% \cs[module=amsmath,replace=false]{DeclareMathOperator}.
+% The second argument \meta{delim} has to be a control sequence of a paired delimiter,
+% as defined by \pkg{mathtools}'s
+% \cs[module=mathtools,replace=false]{DeclarePairedDelimiter}.
+%
+% The final argument \meta{tl} is a list of arbitrary token to put inside the delimiters.
+% \end{function}
+%
+% \begin{function}[updated=2024-07-15]{
+% \moremath_delim_op_manuscale:NNnnnn,
+% \moremath_delim_op_manuscale:NNVnnn
+% }
+% \begin{syntax}
+% \cs{moremath_delim_op_manuscale:NNnnnn} \meta{math op} \meta{delim} \marg{scale cmd}
+% \hspace*{2ex} \marg{sup} \marg{sub} \marg{tl}
+% \end{syntax}
+% The function \cs{moremath_delim_op_manuscale:NNnnnn} typesets a math operator with
+% manual scaling of its delimiters.
+% Its arguments are identical to \cs{moremath_delim_op_noscale:NNnnn}
+% except for the argument \meta{scale~cmd} which has to be a token list containing
+% a \meta{size~cmd} that can be understood by \pkg{mathtools},
+% usually \cs{big}, \cs{Big}, \cs{bigg} and \cs{Bigg}.
+% \end{function}
+%
+% \begin{function}[updated=2024-07-15]{
+% \moremath_new_delim_op_command:NNN,
+% \moremath_new_delim_op_command:cNN,
+% }
+% \begin{syntax}
+% \cs{moremath_new_delim_op_command:NNN} \meta{new~csname} \meta{operator} \meta{delim}
+% \end{syntax}
+% The function \cs{moremath_new_delim_op_command:NNN} defines a new document level command
+% called \meta{new~csname}, utilizing the operator \meta{operator} and the delimiter \meta{delim}.
+%
+% \meta{operator} has to be a control sequence referring to an operator,
+% as declared by \cs{DeclareMathOperator}.
+%
+% \meta{delim} has to be a paired delimiter as defined by \pkg{mathtools}'
+% \cs{DeclarePairedDelimiter}.
+% \end{function}
+%
+% \section{Vector Calculus Typesetting}
+% \label{sec:authors-vec-calc}
+%
+% \subsection{Functions Producing Standalone Operators with Subscripts}
+% \label{sec:authors-vec-calc-operators}
+%
+% \begin{function}[updated=2024-07-15]{
+% \moremath_gradient_operator:n,
+% \moremath_divergence_operator:n,
+% \moremath_curl_operator:n,
+% \moremath_laplace_operator:n,
+% \moremath_dalembert_operator:n
+% }
+% \begin{syntax}
+% \cs{moremath_gradient_operator:n} \marg{subscript}
+% \cs{moremath_divergence_operator:n} \marg{subscript}
+% \cs{moremath_curl_operator:n} \marg{subscript}
+% \cs{moremath_laplace_operator:n} \marg{subscript}
+% \cs{moremath_dalembert_operator:n} \marg{subscript}
+% \end{syntax}
+% Each of these functions return a vector calculus operator,
+% with an (optional) subscript.
+% The argument \meta{subscript}, a token list, may be empty,
+% in which case no subscript is produced.
+%
+% The actual operator produced depends on the current settings
+% of the key-value options described in section~\ref{sec:pack-opts}
+% inside the current group.
+% \end{function}
+%
+% \subsection{Functions Producing Operators with Delimiters}
+% \label{sec:authors-vec-calc-delim-ops}
+%
+% \begin{function}[updated=2024-07-15]{
+% \moremath_delim_nabla_op_noscale:NNnn,
+% \moremath_delim_nabla_op_autoscale:NNnn,
+% }
+% \begin{syntax}
+% \cs{moremath_delim_nabla_op_noscale:NNnn} \meta{operator} \meta{delim}
+% \hspace*{2ex} \marg{sub} \marg{contents}
+%
+% \cs{moremath_delim_nabla_op_autoscale:NNnn} \meta{operator} \meta{delim}
+% \hspace*{2ex} \marg{sub} \marg{contents}
+% \end{syntax}
+% The usage of these functions is similar to the functions
+% \cs{moremath_delim_op_noscale:NNnnn} and \cs{moremath_delim_op_autoscale:NNnnn}
+% except for the missing superscript.
+%
+% The first argument \meta{operator} has to be a function which accepts one argument
+% (the subscript).
+% This is usually one of the \cs[no-index]{moremath_\meta{op}_operator:n} commands.
+%
+% The argument \meta{sub}, which may be empty,
+% is a token list to pass as the subscript to
+% \cs[no-index]{moremath_\meta{op}_operator:n}.
+%
+% The last argument \meta{contents} is a token list to put inside the delimiters.
+%
+% \end{function}
+%
+% \begin{function}[updated=2024-07-15]{
+% \moremath_delim_nabla_op_manuscale:NNnnn,
+% \moremath_delim_nabla_op_manuscale:NNVnn,
+% }
+% \begin{syntax}
+% \cs{moremath_delim_nabla_op_manuscale:NNnnn} \meta{operator} \meta{delim}
+% \hspace*{2ex} \marg{scale~cmd} \marg{sub} \marg{contents}
+% \end{syntax}
+% The usage of this function is similar to the above functions
+% except for the additional argument \meta{scale~cmd} which is a token list
+% with a \meta{size~cmd} that should be understood by \pkg{mathtools}
+% (e.g.\ \cs{big}, \cs{Big}, etc.).
+% \end{function}
+%
+% \section{Formatting Matrices and Vectors}
+% \label{sec:authors-matrix}
+%
+% \begin{function}[
+% updated=2024-07-15,
+% updated=2024-08-20,
+% ]{
+% \moremath_column_vector:nn,
+% \moremath_column_vector:Vn,
+% \moremath_row_vector:nn,
+% \moremath_row_vector:Vn,
+% \moremath_column_smallvector:nn,
+% \moremath_column_smallvector:Vn,
+% \moremath_row_smallvector:nn,
+% \moremath_row_smallvector:Vn,
+% }
+% \begin{syntax}
+% \cs{moremath_column_vector:nn} \marg{delim spec tl} \marg{clist}
+% \cs{moremath_row_vector:nn} \marg{delim spec tl} \marg{clist}
+% \cs{moremath_column_smallvector:nn} \marg{delim spec tl} \marg{clist}
+% \cs{moremath_row_smallvector:nn} \marg{delim spec tl} \marg{clist}
+% \end{syntax}
+% These functions produce a column or row vector.
+% The "small"\meta{c~or~r}"vector" versions are intended for inline math mode.
+%
+% The first argument \meta{delim spec tl} should be the specification of
+% a delimiter, as used in the naming of the \env{matrix*} environments
+% by \pkg{mathtools}.
+%
+% The second argument \meta{clist}, is a comma-separated list of entries
+% of the vector.
+%
+% Of this commands the "c" versions produce column vectors, the "r" versions
+% produce row vectors.
+%
+% The alignment of the entries inside the vector depends on the current
+% value of the key "align".
+% \end{function}
+%
+% \begin{function}[
+% updated = 2024-07-04,
+% updated=2024-07-15,
+% updated=2024-08-20,
+% ]{
+% \moremath_diagonal_matrix:nn,
+% \moremath_diagonal_matrix:nV,
+% \moremath_diagonal_matrix:Vn,
+% \moremath_diagonal_matrix:VV,
+% \moremath_antidiagonal_matrix:nn,
+% \moremath_antidiagonal_matrix:nV,
+% \moremath_antidiagonal_matrix:Vn,
+% \moremath_antidiagonal_matrix:VV,
+% \moremath_diagonal_smallmatrix:nn,
+% \moremath_diagonal_smallmatrix:nV,
+% \moremath_diagonal_smallmatrix:Vn,
+% \moremath_diagonal_smallmatrix:VV,
+% \moremath_antidiagonal_smallmatrix:nn,
+% \moremath_antidiagonal_smallmatrix:nV,
+% \moremath_antidiagonal_smallmatrix:Vn,
+% \moremath_antidiagonal_smallmatrix:VV,
+% }
+% \begin{syntax}
+% \cs{moremath_diagonal_matrix:nn} \marg{delim tl} \marg{clist}
+% \cs{moremath_antidiagonal_matrix:nn} \marg{delim tl} \marg{clist}
+% \cs{moremath_diagonal_smallmatrix:nn} \marg{delim tl} \marg{clist}
+% \cs{moremath_antidiagonal_smallmatrix:nn} \marg{delim tl} \marg{clist}
+% \end{syntax}
+% These functions produce (anti-)diagonal matrices.
+% The argument \meta{delim~tl} is a token list,
+% intended to specify the delimiter of the matrix or no delimiter if the
+% <tl> is empty no delimiters are produced.
+%
+% The argument <clist> is a list of comma separated values which specify the
+% entries of the diagonal.
+% Other properties of the matrix to produce like alignment ("align")
+% and the tokens to insert for non-diagonal entries ("fill")
+% depend on the current setting of the keys described in section~\ref{sec:options-matrix}.
+%
+% The "smallmatrix" versions are intended for use in inline math mode.
+% \end{function}
+%
+% \begin{function}[
+% added = 2024-07-04,
+% updated=2024-07-15,
+% ]{
+% \moremath_id_matrix:n,
+% \moremath_id_matrix:V,
+% \moremath_id_smallmatrix:n,
+% \moremath_id_smallmatrix:V,
+% }
+% \begin{syntax}
+% \cs{moremath_id_matrix:n} \marg{dimensions}
+% \cs{moremath_id_smallmatrix:n} \marg{dimensions}
+% \end{syntax}
+% These functions produce a identity matrix with <dimensions> rows and columns.
+% <dimensions> is expected to be a \emph{positive} integer.
+% The "smallmatrix" version utilizes \pkg{mathtools}' \env{smallmatrix*} environment,
+% which makes it suitable for inline math mode.
+%
+% The delimiter around the matrix is determined by the current value of the key
+% "matrix / delimiter" inside the current group.
+%
+% As these functions utilize \cs{moremath_diagonal_matrix:VV} or
+% \cs{moremath_diagonal_smallmatrix:VV} and make use of temporary variables
+% it is advised to put them into their own group,
+% i.e.\ surround them by \cs{group_begin:} and \cs{group_end:}.
+% \end{function}
+%
+% \section{Vertically Centering Math Along the Math Axis}
+% \label{sec:autors-vcenter}
+%
+% As already said in section~\ref{sec:vcenter} sometimes it is needed to
+% explicitly center some math code.
+%
+% \begin{function}[
+% added=2024-07-08,
+% updated=2024-07-15,
+% updated=2024-08-20,
+% ]{
+% \moremath_vcenter:n,
+% }
+% \begin{syntax}
+% \cs{moremath_vcenter:n} \marg{contents}
+% \end{syntax}
+% The function \cs{moremath_vcenter:n} places <contents> inside a "hbox",
+% which is centered along the math axis by \tn{vcenter}.
+% The contents inside the "hbox" are set in math mode.
+% The function also applies the \enquote{outer} math style
+% to the contents of the "hbox".
+%
+% This function is not \tn[no-index]{long},
+% as it sets its contents inside a "hbox".
+%
+% \begin{texnote}
+% This function is a wrapper around \tn{vcenter}, \cs{hbox:n},
+% and \tn{mathpalette}.
+% Inside the "hbox" math mode is reentered.
+% \end{texnote}
+% \end{function}
+%
+% \end{documentation}
+%
+%
+%
+%
+%
+%
+%
+%
+%
+%
+% \begin{implementation}
+% \part{Implementation}
+% \label{pt:implementation}
+% Start the \pkg{DocStrip} guards.
+% \begin{macrocode}
+%<*package>
+% \end{macrocode}
+%
+% Set the internal prefix for this package so that \pkg{DocStrip} knows what to
+% do.
+% \begin{macrocode}
+%<@@=moremath>
+% \end{macrocode}
+%
+% \section{Initial Setup}
+%
+% First set the required version of \LaTeX{},
+% we need at least
+% \begin{macrocode}
+\NeedsTeXFormat{LaTeX2e}[2022-11-01]
+% \end{macrocode}
+% for key-value option handling, \pkg{xparse}-like document commands
+% (especially for using the "=" option specification)
+% and hooks.
+%
+% Afterwards we provide rollback information,
+% for the \pkg{latexrelease} rollback mechanism.
+% (See \textcite{package-rollback} for more information.)
+%
+% For the v0.x.x versions I've decided on using the date of the first release
+% that was uploaded to CTAN\@.
+% \begin{macrocode}
+\DeclareCurrentRelease{v0}{2024-07-15}
+% \end{macrocode}
+% \changes{v0.5.0}{\GetVersionDate{v0.5.0}}{
+% Add information for \LaTeX{}'s package rollback mechanism.
+% }
+%
+% Then identify this package as \pkg{moremath}.
+% \begin{macrocode}
+\ProvidesExplPackage{moremath}
+ {2024-08-20}{v0.5.0}{More Math Macros}
+% \end{macrocode}
+%
+% ^^X Debugging switch
+% \iffalse
+% \debug_on:n {all}
+% \fi
+% \section{Key-value interfaces}
+% \label{sec:key-val}
+% To make use of key-value interfaces we need to define a few keys.
+%
+% \subsection{Package load time options}
+% \label{sec:load-time-options}
+%
+% To allow for the conditional definition of macros at load time
+% we define a few keys.
+%
+% But before doing so we define a few messages to write the package options to
+% the log file.
+% One message to issue if the \texttt{bm} option has been given:
+% \begin{macrocode}
+\msg_new:nnn { moremath } {load / bm}
+{
+ Option~'bm'~given.\\
+ Loading~the~bm~package~\msg_line_context:.
+}
+% \end{macrocode}
+% And a more generic message to issue for the other options,
+% which all disable certain parts of the library.
+% \begin{macrocode}
+\msg_new:nnn {moremath} { load / disabling }
+{
+ Option~'#1'~given.\\
+ Disabling~#2~\msg_line_context:.
+}
+% \end{macrocode}
+%
+% \begin{variable}{
+% \l_@@_predef_vector_op_bool,
+% \l_@@_predef_operators_bool,
+% \l_@@_predef_crvector_bool,
+% \l_@@_predef_matrix_bool,
+% \l_@@_predef_abs_bool,
+% }
+% To store the values of several switch type key-value options
+% we declare several boolean variables.
+% \begin{macrocode}
+\bool_new:N \l_@@_predef_vector_op_bool
+\bool_new:N \l_@@_predef_operators_bool
+\bool_new:N \l_@@_predef_crvector_bool
+\bool_new:N \l_@@_predef_matrix_bool
+\bool_new:N \l_@@_predef_abs_bool
+% \end{macrocode}
+%
+% The variables \cs{l_@@_predef_vector_op_bool}, \cs{l_@@_predef_operators_bool}
+% \cs{l_@@_predef_abs_bool}, \cs{l_@@_predef_matrix_bool}
+% and \cs{l_@@_predef_crvector_bool}
+% control if the predefined macros
+% for vector calculus, delimited operators, the matrix shorthands,
+% the row and column vectors,
+% and the shorthands for absolute value
+% and norm shall be defined.
+%
+% \changes{v0.2.0}{\GetVersionDate{v0.2.0}}{
+% Explicitly declared boolean variables used to store key-value options.
+% }
+% \end{variable}
+%
+% \begin{optionenv}{
+% bm,
+% no-vector,
+% no-operators,
+% no-abs-shorthands,
+% no-matrix,
+% no-crvector,
+% nopredef,
+% }
+% Now we define package load time keys:
+% \begin{macrocode}
+\keys_define:nn { moremath / load }
+{
+% \end{macrocode}
+% We provide an option to conditionally load the \pkg{bm}-package~\autocite{bm}
+% to provide better looking bold symbols.
+% \begin{macrocode}
+ bm .code:n = {
+ \msg_info:nn {moremath} {load / bm}
+ \RequirePackage{bm}
+ },
+ bm .value_forbidden:n = true,
+ bm. usage:n = load,
+% \end{macrocode}
+% Then we define options for en-/disabling predefined macros of this package
+% to avoid name clashes.
+% \begin{macrocode}
+ no-vector .bool_set_inverse:N = \l_@@_predef_vector_op_bool,
+ no-vector .default:n = true,
+ no-vector .initial:n = false,
+ no-vector .usage:n = load,
+ no-operators .bool_set_inverse:N = \l_@@_predef_operators_bool,
+ no-operators .default:n = true,
+ no-operators .initial:n = false,
+ no-operators .usage:n = load,
+ no-abs-shorthands .bool_set_inverse:N = \l_@@_predef_abs_bool,
+ no-abs-shorthands .default:n = true,
+ no-abs-shorthands .initial:n = false,
+ no-abs-shorthands .usage:n = load,
+ no-matrix .bool_set_inverse:N = \l_@@_predef_matrix_bool,
+ no-matrix .initial:n = false,
+ no-matrix .default:n = true,
+ no-matrix .usage:n =load,
+ no-crvector .bool_set_inverse:N = \l_@@_predef_crvector_bool,
+ no-crvector .default:n = true,
+ no-crvector .initial:n = false,
+ no-crvector .usage:n = load,
+ nopredef .multichoice:,
+ nopredef / operators .meta:nn = { moremath / load }
+ {
+ no-operators = true
+ },
+ nopredef / vector .meta:nn = { moremath / load }
+ {
+ no-vector = true
+ },
+ nopredef / abs .meta:nn = { moremath / load }
+ {
+ no-abs-shorthands = true,
+ },
+ noperdef / matrix .meta:nn = { moremath / load }
+ {
+ no-matrix = true,
+ },
+ nopredef / crvector .meta:nn = {moremath / load}
+ {
+ no-crvector = true,
+ },
+ nopredef / all .meta:nn = { moremath / load }
+ {
+ no-operators = true,
+ no-vector = true,
+ no-abs-shorthands = true
+ },
+ nopredef .usage:n = load,
+% \end{macrocode}
+% Unknown package options get passed to \pkg{mathtools}.
+% \begin{macrocode}
+ unknown .code:n = {\PassOptionsToPackage{\CurrentOption}{mathtools}},
+ unknown .usage:n = load,
+}
+% \end{macrocode}
+% \changes{v0.1.0}{\GetVersionDate{v0.1.0}}{
+% Added package load-time options.
+% }
+% \end{optionenv}
+%
+%
+% \subsection{Keys controlling appearance}
+% \label{sec:keys-appearance}
+%
+% \begin{variable}{
+% \l_@@_nabla_tl,
+% \l_@@_nabla_arrow_bool,
+% \l_@@_nabla_arrow_bold_bool,
+% \l_@@_grad_op_tl,
+% \l_@@_laplacian_symb_tl,
+% \l_@@_laplacian_delta_bool,
+% \l_@@_laplacian_arrow_bool,
+% \l_@@_laplacian_tl,
+% \l_@@_dalembert_symb_tl,
+% }
+% We declare several variables to store the values of the keys affecting
+% appearance.
+% \begin{macrocode}
+\tl_new:N \l_@@_nabla_tl
+\bool_new:N \l_@@_nabla_arrow_bool
+\bool_new:N \l_@@_nabla_arrow_bold_bool
+\tl_new:N \l_@@_grad_op_tl
+% \end{macrocode}
+%
+% The symbol to use as \enquote{nabla} is stored in \cs{l_@@_nabla_tl}.
+% The variables \cs{l_@@_nabla_arrow_bool} and \cs{l_@@_nabla_bold_bool}
+% determine if the nabla-symbol shall have an arrow over itself and/or be bold
+% respectively.
+%
+% The variable \cs{l_@@_grad_op_tl} contains a user provided token list to
+% overwrite the built-in gradient operator of the package.
+%
+% \begin{macrocode}
+\tl_new:N \l_@@_laplacian_symb_tl
+\bool_new:N \l_@@_laplacian_delta_bool
+\bool_new:N \l_@@_laplacian_arrow_bool
+\tl_new:N \l_@@_laplacian_tl
+% \end{macrocode}
+% The token list variable \cs{l_@@_laplacian_symb_tl} stores the tokens to be
+% used for the Laplace operator.
+% The boolean variable \cs{l_@@_laplacian_delta_bool}
+% determines if a delta should be used instead
+% of \(\laplacian\) for the laplacian symbol.
+% If the boolean variable \cs{l_@@_laplacian_arrow_bool} a small arrow will be
+% placed over the Laplace operator symbol.
+% If the user wants to overwrite the symbol used for the Laplacian,
+% the user provided list of tokens is stored in the variable
+% \cs{l_@@_laplacian_tl}.
+%
+% Finally we define a variable to hold the symbol to use for the
+% \foreignlanguage{french}{d'Alembert} operator.
+% \begin{macrocode}
+\tl_new:N \l_@@_dalembert_symb_tl
+% \end{macrocode}
+% \changes{v0.2.0}{\GetVersionDate{v0.2.0}}{%
+% Explicitly declared variables before using them to set keys.
+% }
+% \changes{v0.2.0}{\GetVersionDate{v0.2.0}}{%
+% Added: New variable \cs{l_@@_dalembert_symb_tl}
+% }
+% \end{variable}
+%
+% \begin{variable}{
+% \l_@@_vcenter_bool,
+% }
+% Additionally we declare a variable to decide if certain math symbols
+% shall be centered explicitly along the math axis.
+% \begin{macrocode}
+\bool_new:N \l_@@_vcenter_bool
+% \end{macrocode}
+% If \cs{l_@@_vcenter_bool} is true, the symbols of certain math operators,
+% should be centered explicitly.
+% \end{variable}
+%
+% \begin{optionenv}{
+% nabla,
+% arrownabla,
+% boldnabla,
+% grad-op,
+% laplacian-symb,
+% delta-laplace,
+% arrowlaplace,
+% laplacian,
+% dalembert-symb,
+% }
+% First define keys for the vector calculus macros.
+% \begin{macrocode}
+\keys_define:nn { moremath }
+{
+% \end{macrocode}
+% First we define keys for use with the gradient and gradient based operators.
+% \begin{macrocode}
+ % Symbol to use for the nabla
+ nabla .tl_set:N = \l_@@_nabla_tl,
+ nabla .initial:n = {\nabla},
+ nabla .value_required:n = true,
+ % shall the nabla have an arrow over it
+ arrownabla .bool_set:N = \l_@@_nabla_arrow_bool,
+ arrownabla .default:n = {true},
+ arrownabla .initial:n = {false},
+ % shall the nabla be bold
+ boldnabla .bool_set:N = \l_@@_nabla_bold_bool,
+ boldnabla .default:n = {true},
+ boldnabla .initial:n = {false},
+% \end{macrocode}
+% We also provide an override for the gradient operator
+% \begin{macrocode}
+ % Symbol to use for the gradient operator
+ grad-op .tl_set:N = \l_@@_grad_op_tl,
+ grad-op .value_required:n = true,
+% \end{macrocode}
+%
+% Then we define keys for the laplacian.
+% \begin{macrocode}
+ % Symbol to use for the laplacian
+ laplacian-symb .tl_set:N = \l_@@_laplacian_symb_tl,
+ laplacian-symb .initial:n = {\l_@@_nabla_tl},
+ % shall the Laplace operator be a delta
+ delta-laplace .bool_set:N = \l_@@_laplacian_delta_bool,
+ delta-laplace .initial:n = {false},
+ % shall the laplace operator have an arrow over itself
+ arrowlaplace .bool_set:N = \l_@@_laplacian_arrow_bool,
+ arrowlaplace .default:n = {true},
+ arrowlaplace .initial:n = {false},
+ % overwrite the laplace operator
+ laplacian .tl_set:N = \l_@@_laplacian_tl,
+ laplacian .value_required:n = true,
+% \end{macrocode}
+% And keys for the \foreignlanguage{french}{d'Alembert} operator.
+% \begin{macrocode}
+ dalembert-symb .tl_set:N = \l_@@_dalembert_symb_tl,
+ dalembert-symb .initial:n = {\square},
+% \end{macrocode}
+% \begin{optionenv}{
+% vcenter,
+% }
+% The "vcenter" option will control the manual centering of certain math
+% operators.
+% \begin{macrocode}
+ vcenter .bool_set:N = \l_@@_vcenter_bool,
+ vcenter .initial:n = true,
+ vcenter .value_required:n = true,
+}% \keys_define:nn
+% \end{macrocode}
+% \changes{v0.3.0}{\GetVersionDate{v0.3.0}}{
+% Added new option.
+% }
+% \end{optionenv} ^^X vcenter
+% \changes{v0.1.0}{\GetVersionDate{v0.1.0}}{%
+% Added options controlling appearance.
+% }
+% \changes{v0.2.0}{\GetVersionDate{v0.2.0}}{%
+% Added: New option "dalembert-symb".
+% }
+% \end{optionenv}
+%
+% \begin{optionenv}{
+% delimiter,
+% fill,
+% align
+% }
+% Then we define some keys for the matrix based environments:
+% \begin{macrocode}
+\keys_define:nn { moremath / matrix }
+{
+% \end{macrocode}
+% \begin{variable}{
+% \l_@@_matrix_delim_tl,
+% \l_@@_matrix_fill_tl,
+% \l_@@_matrix_align_tl,
+% }
+% Every one of the following keys stores its value inside a token list variable.
+% \begin{macrocode}
+ delimiter .tl_set:N = \l_@@_matrix_delim_tl,
+ delimiter .initial:n = {},
+ fill .tl_set:N = \l_@@_matrix_fill_tl,
+ fill .initial:n = {},
+ align .tl_set:N = \l_@@_matrix_align_tl,
+ align .initial:n = {c},
+ align .value_required:n = true,
+}
+% \end{macrocode}
+% The keys \verb|delimiter| and \verb|fill| set the variables
+% \cs{l_@@_matrix_delim_tl} and \cs{l_@@_matrix_fill_tl} respectively.
+% \cs{l_@@_matrix_delim_tl} determines the delimiter in use to surround
+% matrices and \cs{l_@@_matrix_fill_tl} determines the fill values of the
+% \cs{diag}, \cs{smalldiag}, \cs[no-index]{Xdiag} and \cs[no-index]{Xsmalldiag}
+% commands, which are used for non-diagonal matrix entries.
+% The variable \cs{l_@@_matrix_align_tl} contains the alignment specifier
+% for use with the \env{matrix*} environment.
+%
+% \changes{v0.1.0}{\GetVersionDate{v0.1.0}}{%
+% Added internal variables.
+% }
+% \end{variable}
+% \changes{v0.1.0}{\GetVersionDate{v0.1.0}}{%
+% Added options for the matrix-based environments of \pkg{mathtools}.
+% }
+% \end{optionenv}
+%
+% \subsection{Functions for Setting Options}
+% \label{sec:option-setters}
+%
+%
+% Now we define a function for setting the options within the document
+% \begin{macro}{\moremath_setup:n}
+% \begin{macrocode}
+\cs_new_protected:Nn \moremath_setup:n
+{
+ \keys_set:nn {moremath} {#1}
+}
+% \end{macrocode}
+% \changes{v0.1.0}{\GetVersionDate{v0.1.0}}{%
+% Added function for setting options.
+% }
+% \end{macro}
+%
+% Additionally we provide the user with a version of this command.
+% \begin{macro}{\moremathsetup}
+% \begin{macrocode}
+\NewDocumentCommand \moremathsetup {m}
+{
+ \moremath_setup:n {#1}
+}
+% \end{macrocode}
+% \changes{v0.1.0}{\GetVersionDate{v0.1.0}}{%
+% Added document command for setting package options.
+% }
+% \end{macro}
+% We also need a function for setting the package load time options.
+% This function should set all given values for all key families
+% and pass unknown options to mathtools.
+% \begin{macro}{\@@_load_time_setup:}
+% \begin{macrocode}
+\cs_new_protected:Nn \@@_load_time_setup:
+{
+ \ProcessKeyOptions[ moremath / load ]
+}
+% \end{macrocode}
+% \end{macro}
+%
+% ^^X SUBSECTION: Package Initialization
+% \section{Package Initialization}
+% \label{sec:init}
+%
+% We now \enquote{initialize} the package by processing the package options,
+% all unknown options are passed to \pkg{mathtools}~\autocite{mathtools},
+% which is loaded afterwards.
+% Because certain \pkg{mathtools}-features are needed by this package,
+% we need to require a version of at least 2004/06/05.
+% As explained in section~\ref{sec:load-time-options} this may also load \pkg{bm}
+% if the \verb|bm| package option has been given.
+% \begin{macrocode}
+\@@_load_time_setup:
+% \end{macrocode}
+% If the "no-vector" option has not been given during load time,
+% we also need the \pkg{amssymb} package~\autocite{amsfonts} for the
+% \cs[module=amssymb,replace=false]{square} command.
+% We first define a message to inform the user about this.
+% \begin{macrocode}
+\msg_new:nnn { moremath } { load / loading-amssymb }
+{
+ Vector~calculus~commands~enabled.\\
+ Loading~amssymb~package~\msg_line_context:.
+}
+% \end{macrocode}
+% Then we conditionally load the package.
+% \begin{macrocode}
+\bool_if:NT \l_@@_predef_vector_op_bool
+{
+ \msg_info:nn { moremath } { load / loading-amssymb }
+ \RequirePackage{amssymb}
+}
+% \end{macrocode}
+% \changes{v0.2.0}{\GetVersionDate{v0.2.0}}{
+% New: Load \pkg{amssymb} if the "no-vector" option has \emph{not} been given.
+% }
+%
+% Finally we load our most important dependency \pkg{mathtools}.
+% \begin{macrocode}
+\RequirePackage{mathtools}[2004/06/05]
+% \end{macrocode}
+%
+%
+% \section{Abstractions for \TeX{}-primitives and \LaTeXe{}-commands}
+% \label{sec:impl-abstractions}
+%
+% As this package makes use of certain \TeX{}-primitives and \LaTeXe{}-commands,
+% which are either part of the \LaTeX{}-kernel or of some package.
+% It is sensible to provide a (package internal) abstraction for those commands,
+% so that they can be switched out once a \LaTeX3{}-command has been defined for them.
+%
+% \subsection{\TeX{}-primitives}
+% \label{sec:impl-tex-abstractions}
+%
+% \begin{macro}[added=2024-08-20]{
+% \@@_tex_vcenter:n,
+% }
+% \cs{@@_tex_vcenter:n} is an abstraction for \cs{tex_vcenter:D}
+% i.e.\ \tn{vcenter}.
+% Its single argument is passed to \cs{tex_vcenter:D}.
+% \begin{macrocode}
+\cs_new_protected:Nn \@@_tex_vcenter:n
+{
+ \tex_vcenter:D {#1}
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[added=2024-08-20]{
+% \@@_tex_mathpalette:Nn,
+% }
+% The function \cs{@@_tex_mathpalette:Nn} is an abstraction for the \tn{mathpalette},
+% primitive.
+% The function takes two arguments
+% \begin{arguments}
+% \item The \meta{csname} of the macro to pass to \tn{mathpalette}
+%
+% This macro \textbf{must} accept \textbf{two} arguments:
+% The first is a single token containing the current math-style,
+% the second is the contents to \enquote{typeset}.
+% See \url{https://tex.stackexchange.com/questions/34393/the-mysteries-of-mathpalette/34412#34412}
+% for further information.
+%
+% \item The \meta{tokens} to forward to the macro passed as first argument.
+% \end{arguments}
+% \begin{macrocode}
+\cs_new_protected:Nn \@@_tex_mathpalette:Nn
+{
+ \mathpalette #1 {#2}
+}
+% \end{macrocode}
+% \changes{v0.5.0}{\GetVersionDate{v0.5.0}}{
+% Added new function.
+% }
+% \end{macro}
+%
+% \begin{macro}[added=2024-08-20]{
+% \@@_tex_mathsurround:n
+% }
+% The function \cs{@@_tex_mathsurround:n} provides (hopefully) a correct abstraction
+% for the \tn{mathsurround} primitive.
+% It takes one argument
+% \begin{arguments}
+% \item A \meta{length~expr} for the whitespace surrounding a math switch.
+% \end{arguments}
+% \begin{macrocode}
+\cs_new_protected_nopar:Nn \@@_tex_mathsurround:n
+{
+ \tex_mathsurround:D = #1
+}
+% \end{macrocode}
+% \changes{v0.5.0}{\GetVersionDate{v0.5.0}}{
+% Added new function.
+% }
+% \end{macro}
+%
+% \begin{macro}[added=2024-08-20]{
+% \@@_tex_mathop:n
+% }
+% The function \cs{@@_tex_mathop:n} provides an abstraction for the \tn{mathop}
+% \TeX{}-primitive.
+% It accepts a single argument:
+% \begin{arguments}
+% \item \meta{Tokens} to treat as a math operator.
+% \end{arguments}
+% \begin{macrocode}
+\cs_new_protected_nopar:Nn \@@_tex_mathop:n
+{
+ \tex_mathop:D {#1}
+}
+% \end{macrocode}
+% \changes{v0.5.0}{\GetVersionDate{v0.5.0}}{
+% Added new function.
+% }
+% \end{macro}
+%
+%
+% \subsection{\LaTeXe{}-commands}
+% \label{sec:impl-latex-abstractions}
+%
+% \begin{macro}[EXP,added=2024-08-20]{
+% \@@_matrix_star_begin:nn,
+% \@@_matrix_star_begin:nV,
+% \@@_matrix_star_begin:Vn,
+% \@@_matrix_star_begin:VV,
+% \@@_matrix_star_end:n,
+% \@@_matrix_star_end:V,
+% }
+% The functions \cs{@@_matrix_star_begin:nn} and \cs{@@_matrix_star_end:n}
+% provide an abstraction to the \env{matrix*} family of environments provided
+% by \pkg{mathtools}.
+% \NB{MI}{These functions need to be expandable,
+% as they produce an empty line otherwise.}
+%
+% \cs{@@_matrix_star_begin:nn} takes two arguments:
+% \begin{arguments}
+% \item A \meta{tl} determining the type of the matrix.
+%
+% This is used to further specify which "matrix*" environment to use.
+%
+% The \meta{tl} may be empty.
+%
+% \item A \meta{tl} specifying the column type.
+% \end{arguments}
+% \begin{macrocode}
+\cs_new_nopar:Nn \@@_matrix_star_begin:nn
+{
+ \begin{ #1 matrix* } [ #2 ]
+}
+% \end{macrocode}
+% We also create "nV", "Vn", and "VV" variants of this function:
+% \begin{macrocode}
+\cs_generate_variant:Nn \@@_matrix_star_begin:nn { nV, Vn, VV }
+% \end{macrocode}
+%
+% The function \cs{@@_matrix_star_end:n} takes only one argument
+% \begin{arguments}
+% \item The \meta{tl} determining the type of the \env{matrix*} environment.
+%
+% The \meta{tl} \textbf{must} have the same value as used for
+% \cs{@@_matrix_star_begin:nn}.
+% \end{arguments}
+% \begin{macrocode}
+\cs_new_nopar:Nn \@@_matrix_star_end:n
+{
+ \end{ #1 matrix* }
+}
+% \end{macrocode}
+% We also provide a "V" type variant of this function.
+% \begin{macrocode}
+\cs_generate_variant:Nn \@@_matrix_star_end:n {V}
+% \end{macrocode}
+% \changes{v0.5.0}{\GetVersionDate{v0.5.0}}{
+% Added new functions and variants.
+% }
+% \end{macro}
+%
+%
+% \section{Centering Math Symbols Along the Math-Axis}
+% \label{sec:impl-vcenter}
+%
+% Certain math constructs such cause \TeX{}
+% to not center the operator along the math axis,
+% like case of |\mathop{\nabla}\nolimits| vs.\
+% |\mathop{\boldsymbol\nabla}\nolimits|,
+% as can be seen below.
+% \[
+% \mathop{\nabla}\nolimits f(x)
+% \quad \text{vs.} \quad
+% \mathop{\boldsymbol\nabla}\nolimits f(x)
+% \]
+% As can be seen the bold nabla symbol is slightly higher up than the non-bold
+% version.
+% Because of this it is sometimes useful to manually center some math symbols,
+% along the math axis.\footnote{%
+% The code in this section is inspired by
+% \url{http://www.tug.org/TUGboat/Articles/tb22-4/tb72perlS.pdf}
+% }
+%
+% \begin{macro}[added = 2024-07-08, updated=2024-08-20]{
+% \moremath_vcenter:n
+% }
+% The function \cs{moremath_vcenter:n} is a wrapper around the \tn{vcenter}
+% \TeX{} primitive.
+% It takes a single argument.
+% \begin{arguments}
+% \item A \meta{tl} containing math mode material to center along the math axis.
+%
+% This argument is typeset in math mode.
+% \end{arguments}
+% The function uses the \tn{mathpalette} primitive to switch to the right
+% math style.
+% The function is not in a \TeX{}-sense long,
+% i.e.\ it does not take \tn{par} tokens.
+%
+% As this function might be useful not only for internal use by \pkg{moremath},
+% we declare it as a public function here.
+% \begin{macrocode}
+\cs_new_protected_nopar:Nn \moremath_vcenter:n
+{
+ \@@_tex_mathpalette:Nn \@@_vcenter:Nn {#1}
+}
+% \end{macrocode}
+% \changes{v0.3.0}{\GetVersionDate{v0.3.0}}{
+% Added new function.
+% }
+% \changes{v0.5.0}{\GetVersionDate{v0.5.0}}{
+% Changed: Make use of \cs{@@_tex_mathpalette:Nn}.
+% }
+% \end{macro}
+%
+% \begin{macro}[
+% added=2024-07-08,
+% updated=2024-08-20,
+% ]{
+% \@@_vcenter:Nn,
+% }
+% As \tn{mathpalette} needs as its first argument a macro which takes two
+% arguments
+% (the first is a math style switch and the second the contents).\footnote{%
+% See \TeX{}SE answer \url{https://tex.stackexchange.com/a/34412}
+% }
+% We define an internal helper function for \cs{moremath_vcenter:n} for
+% \cs{mathpalette} to call.
+%
+% The function \cs{@@_vcenter:Nn} takes two arguments:
+% \begin{arguments}
+% \item The math style macro, which is passed to this function by
+% \tn{mathpalette}.
+%
+% \item The \meta{tl} to typeset inside the \tn{vcenter}.
+% \end{arguments}
+%
+% Because of the properties of \tn{vcenter}, it switches to vertical mode,
+% we need to put the contents to typeset inside a horizontal box.
+% Because of this we also need to reenter math mode, and because of this
+% we need to remove the spacing inserted by entering math mode
+% by setting \tn{mathsurround} to zero.
+% \begin{macrocode}
+\cs_new_protected_nopar:Nn \@@_vcenter:Nn
+{
+ \@@_tex_vcenter:n
+ {
+ \hbox:n
+ {
+ $
+ \@@_tex_mathsurround:n {0pt}
+ #1 {#2}
+ $
+ }
+ }
+}
+% \end{macrocode}
+% \changes{v0.5.0}{\GetVersionDate{v0.5.0}}{
+% Changed: Now uses \cs{@@_tex_vcenter:n} and \cs{@@_tex_mathsurround:n}
+% instead of \TeX-primitives.
+% }
+% \end{macro}
+%
+%
+% \subsection*{Document Level Command}
+%
+% Although unlikely there might arise the need for a document author to center
+% some math along the math axis.
+% For this purpose we are going to define a new document level command.
+%
+% But first we are going to declare some messages to use by the command.
+% The first message informs the user that the command is not available,
+% because its \meta{csname} is already taken.
+% \begin{macrocode}
+\msg_new:nnn { moremath } { csname-already-defined }
+{
+ Control~sequence~' #1 '~is~already~ defined.\\
+ Skipping~definition~\msg_line_context:
+}
+% \end{macrocode}
+% The second message should be issued if a command that only works in math mode
+% was given outside of it.
+% \begin{macrocode}
+\msg_new:nnnn { moremath } { vcenter / only-in-math-mode }
+{
+ Command~#1~used~outside~math~mode~\msg_line_context:.
+}
+{
+ The~command~#1~may~only~be~used~inside~math~mode.
+}
+% \end{macrocode}
+% \begin{macro}{
+% \VCenterMath,
+% }
+% Now to the document level command for centering math along the math axis.
+% \begin{macrocode}
+\cs_if_free:NTF \VCenterMath
+{
+ \NewDocumentCommand \VCenterMath { m }
+ {
+ \mode_if_math:TF
+ {
+ \moremath_vcenter:n {#1}
+ }{% \mode_if_math:TF FALSE BRANCH
+ \msg_error:nnn { moremath } { vcenter / only-in-math-mode } {\VCenterMath}
+ }
+ }
+}{% \cs_if_free:NTF \VCenterMath FALSE BRANCH
+ \msg_warning:nnn { moremath } { csname-already-defined } {\VCenterMath}
+}
+% \end{macrocode}
+% \changes{v0.3.0}{\GetVersionDate{v0.3.0}}{
+% Added new document level command.
+% }
+% \end{macro}
+%
+%
+% ^^X SECTION: Paired Delimiters
+% \section{Declaring Paired Delimiters for Internal Use}
+% \label{sec:impl-paired-delim}
+%
+% \begin{macro}{
+% \@@_inparent:w,
+% \@@_inbrack:w,
+% \@@_inbrace:w,
+% \@@_in_vert:w,
+% \@@_in_Vert:w
+% }
+% As we are going to use \pkg{mathtools}' \emph{paired delimiters}
+% at several places throughout this package,
+% we define \emph{paired delimiters} for internal use, as functions with weird
+% syntax.
+% \begin{macrocode}
+\DeclarePairedDelimiter{\@@_inparent:w}{\lparen}{\rparen}
+\DeclarePairedDelimiter{\@@_inbrack:w}{\lbrack}{\rbrack}
+\DeclarePairedDelimiter{\@@_inbrace:w}{\lbrace}{\rbrace}
+\DeclarePairedDelimiter{\@@_in_vert:w}{\lvert}{\rvert}
+\DeclarePairedDelimiter{\@@_in_Vert:w}{\lVert}{\rVert}
+% \end{macrocode}
+% \end{macro}
+%
+% ^^X SECTION: Delimited Operators
+% \section{Delimited Operators}
+% \label{sec:impl-delim-op}
+%
+% We need three different functions for providing the delimited operators.
+% But as we share a lot of code between those, we define an additional
+% helper function beforehand.
+% \begin{macro}{
+% \@@_operator:Nnn
+% }
+% The function \cs{@@_operator:Nnn} takes care of the operator part
+% of the new delimiter.
+% It allows the operator to have super- and subscripts.
+% It takes three arugments.
+% \begin{arguments}
+% \item The \meta{csname} of the operator to use.
+% \item A \meta{token list}, which is used as the superscript operator.
+%
+% This argument may be empty
+% \item A \meta{tl}, which is used as the subscript operator.
+%
+% The \meta{tl} may be empty.
+% \end{arguments}
+% \begin{macrocode}
+\cs_new_protected:Nn \@@_operator:Nnn
+{
+ #1
+ % add superscript if present
+ \tl_if_empty:nF {#2} {^{#2}}
+ % add subscript if present
+ \tl_if_empty:nF {#3} { \c_math_subscript_token {#3} }
+}
+% \end{macrocode}
+% \end{macro}
+%
+% We now define three version of the delimited operators.
+% \begin{macro}{
+% \moremath_delim_op_noscale:NNnnn,
+% \moremath_delim_op_autoscale:NNnnn,
+% }
+% \cs{moremath_delim_op_noscale:NNnnn} is provides a delimited operator without
+% any scaling of the delimiters
+% and \cs{moremath_delim_op_autoscale:NNnnn} provides a version with
+% automatic scaling of the delimiters.
+% Both of them take five arguments:
+% \begin{arguments}
+% \item The \meta{csname} of the operator to use.
+%
+% Any operator declared with \pkg{amsmath}'s \cs{operatorname}
+% and/or\linebreak[3]
+% \cs[module=amsmath,replace=false]{DeclareMathOperator}
+% is valid for this.
+%
+% \item The \meta{csname} of a paired delimiter declared by
+% \pkg{mathtools}'~\autocite{mathtools}
+% \cs[module=mathtools,replace=false]{DeclarePairedDelimiter}.
+%
+% \item A \meta{tl} to use as the superscript of the operator.
+%
+% \item A \meta{tl} to use as the subscript of the operator.
+%
+% \item A \meta{tl} to insert inside the delimiters.
+% \end{arguments}
+% \begin{macrocode}
+\cs_new_protected_nopar:Nn \moremath_delim_op_noscale:NNnnn
+{
+ \@@_operator:Nnn #1 {#3} {#4}
+ % #2 is the paired delimiter
+ #2 {#5}
+}
+
+\cs_new_protected_nopar:Nn \moremath_delim_op_autoscale:NNnnn
+{
+ \@@_operator:Nnn #1 {#3} {#4}
+ % #2 is the paired delimiter
+ #2 * {#5}
+}
+% \end{macrocode}
+% \changes{v0.1.0}{\GetVersionDate{v0.1.0}}{%
+% Added "noscale" and "autoscale" versions.
+% }
+% \end{macro}
+% \begin{macro}{
+% \moremath_delim_op_manuscale:NNnnnn,
+% \moremath_delim_op_manuscale:NNVnnn
+% }
+% \cs{moremath_delim_op_manuscale:NNnnnn} provides a delimited operator with
+% manual scaling.
+% This version takes six arguments:
+% \begin{arguments}
+% \item The \meta{csname} of the operator to use.
+%
+% \item The \meta{csname} of the paired delimiter
+% declared by \pkg{mathtools}'~\autocite{mathtools}\linebreak[3]
+% \cs[module=mathtools,replace=false]{DeclarePairedDelimiter}.
+%
+% \item A \meta{tl} containing the scaling macro i.e.\ \cs{big}, \cs{Big},
+% \cs{Bigg},\dots
+%
+% \item A \meta{tl} containing the superscript of the operator.
+%
+% The \meta{tl} may be empty
+%
+% \item A \meta{tl} containing the subscript of the operator
+%
+% The \meta{tl} may be empty.
+%
+% \item A \meta{tl} to insert inside the delimiters
+% \end{arguments}
+% \begin{macrocode}
+\cs_new_protected_nopar:Nn \moremath_delim_op_manuscale:NNnnnn
+{
+ \@@_operator:Nnn #1 {#4} {#5}
+ % #2 is the paired delimiter
+ #2 [ #3 ] {#6}
+}
+% \end{macrocode}
+% We also provide a variant for the scaling macro.
+% \begin{macrocode}
+\cs_generate_variant:Nn \moremath_delim_op_manuscale:NNnnnn {NNVnnn}
+% \end{macrocode}
+% \changes{v0.1.0}{\GetVersionDate{v0.1.0}}{%
+% Function added.
+% }
+% \end{macro}
+%
+% For the creation of document level commands we also create a function,
+% so that the user is also able to declare new delimited operators.
+% But before we do so we create a message to inform the user if a
+% \meta{csname} was already taken.
+% \begin{macrocode}
+\msg_new:nnn { moremath } { delimop / already-defined-skip }
+{
+ Control~sequence~'#1'~is~already~defined.\\
+ Skipping~definition~of~delimited~operator~'#1'~\msg_line_context:.
+}
+% \end{macrocode}
+%
+% We also create a message to inform the user about conflicting options
+% given to the command.
+% \begin{macrocode}
+\msg_new:nnn { moremath } { delimop / auto-manu-scale-conflict }
+{
+ Both~star~and~scale~cmd~given~to~'#1'.\\
+ Automatic~scaling~will~be~preferred,~the~size~command~will~be~
+ ignored~\msg_line_context:.
+}
+% \end{macrocode}
+% \begin{macro}{
+% \moremath_new_delim_op_command:NNN,
+% \moremath_new_delim_op_command:cNN,
+%}
+% \cs{moremath_new_delim_op_command:NNN} takes three arguments:
+% \begin{arguments}
+% \item The \meta{csname} to be defined.
+%
+% \item The \meta{csname} of the operator to use,
+% which should be an operator declared with
+% \cs[module=amsmath,replace=false]{DeclareMathOperator}.
+%
+% \item The \meta{csname} of the delimiter to use,
+% which should have been declared with
+% \cs[module=mathtools,replace=false]{DeclarePairedDelimiter}.
+% \end{arguments}
+% \begin{macrocode}
+\cs_new_protected:Nn \moremath_new_delim_op_command:NNN
+{
+ \cs_if_free:NTF #1
+ {
+ \exp_args:NNe \NewDocumentCommand #1
+ { s o E{ ^ \char_generate:nn {`_} {8} }{{}{}} m }
+ {
+ \tl_if_novalue:nTF {##2}
+ {
+ % second argument empty
+ \bool_if:nTF {##1}
+ {
+ % star given
+ \moremath_delim_op_autoscale:NNnnn #2 #3 {##3} {##4} {##5}
+ }{
+ % star not given
+ \moremath_delim_op_noscale:NNnnn #2 #3 {##3} {##4} {##5}
+ }
+ }{
+ % second argument present
+ % star given?
+ \bool_if:nTF {##1}
+ {
+ % Warn if both star and scaling factor are present
+ \msg_warning:nnn { moremath } { delimop / auto-manu-scale-conflict }
+ {#1}
+ \moremath_delim_op_autoscale:NNnnn #2 #3 {##3} {##4} {##5}
+ }{ % FALSE BRANCH
+ \moremath_delim_op_manuscale:NNnnnn #2 #3 {##2} {##3} {##4} {##5}
+ }
+ }
+ }
+ }{ % \cs_if_free:nTF #1 FALSE BRANCH
+ \msg_warning:nnn { moremath } { delimop / already-defined-skip }
+ {#1}
+ }
+}
+
+\cs_generate_variant:Nn \moremath_new_delim_op_command:NNN {cNN}
+% \end{macrocode}
+% \changes{v0.1.0}{\GetVersionDate{v0.1.0}}{%
+% Added function and variant.
+% }
+% \end{macro}
+%
+% \subsection{Document Level Commands}
+% \label{sec:impl-delim-op-doc-cmds}
+%
+% \begin{macro}{\DeclareDelimitedOperator}
+% Finally provide the user with a command to declare an additional
+% delimited operator.
+% \begin{macrocode}
+\NewDocumentCommand\DeclareDelimitedOperator { m m m }
+{
+ \msg_redirect_name:nnn { moremath } { delimop / already-defined-skip } { error }
+ \moremath_new_delim_op_command:NNN #1 #2 #3
+ \msg_redirect_name:nnn { moremath } { delimop / already-defined-skip } {}
+}
+% \end{macrocode}
+% \changes{v0.1.0}{\GetVersionDate{v0.1.0}}{Added document level command.}
+% \end{macro}
+%
+% As \pkg{amsmath}~\autocite{amsmath} pre-defines the following operators
+% it is only sensible to also define delimited versions of them:\\
+% \input{\jobname-ams-op-table.tex}
+%
+% \begin{macro}{\@@_new_delim_op_cmds:nN}
+% \cs{@@_new_delim_op_cmds:nN} creates document level macros of the form
+% \cs[no-index]{\meta{prefix}\meta{op name}}.
+% It declares fife versions \cs[no-index]{p\meta{op name}},
+% \cs[no-index]{b\meta{op name}}, \cs[no-index]{B\meta{op name}},
+% \cs[no-index]{v\meta{op name}} and \cs[no-index]{V\meta{op name}}.
+%
+% The function takes two arguments:
+% \begin{arguments}
+% \item A token list which contains \meta{op name}
+%
+% \item The \meta{csname} of the operator to use.
+% \end{arguments}
+% \begin{macrocode}
+\cs_new_protected:Nn \@@_new_delim_op_cmds:nN
+{
+ \moremath_new_delim_op_command:cNN {p #1} #2 \@@_inparent:w
+ \moremath_new_delim_op_command:cNN {b #1} #2 \@@_inbrack:w
+ \moremath_new_delim_op_command:cNN {B #1} #2 \@@_inbrace:w
+ \moremath_new_delim_op_command:cNN {v #1} #2 \@@_in_vert:w
+ \moremath_new_delim_op_command:cNN {V #1} #2 \@@_in_Vert:w
+}
+% \end{macrocode}
+% \end{macro}
+%
+% The decision if the following macros are defined depends on a package load
+% time option.
+% \begin{macrocode}
+\bool_if:NTF \l_@@_predef_operators_bool
+{
+% \end{macrocode}
+% We define the commands for the operators already declared by amsmath.
+% \begin{macro}[documented-as=\parccos]{
+% \parccos, \barccos, \Barccos, \varccos, \Varccos,
+% }
+% For \cs[module=amsmath,replace=false]{arccos},
+% \begin{macrocode}
+\@@_new_delim_op_cmds:nN {arccos} \arccos
+% \end{macrocode}
+% \changes{v0.1.0}{\GetVersionDate{v0.1.0}}{%
+% Added delimited document commands for all \pkg{amsmath}-defined operators.
+% }
+% \end{macro}
+% \begin{macro}[documented-as=\parccos]{
+% \parcsin, \barcsin, \Barcsin, \varcsin, \Varcsin,
+% }
+% \cs[module=amsmath,replace=false]{arcsin},
+% \begin{macrocode}
+\@@_new_delim_op_cmds:nN {arcsin} \arcsin
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}[documented-as=\parccos]{
+% \parctan, \barctan, \Barctan, \varctan, \Varctan,
+% }
+% \cs[module=amsmath,replace=false]{arctan},
+% \begin{macrocode}
+\@@_new_delim_op_cmds:nN {arctan} \arctan
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}[documented-as=\parccos]{
+% \Parg, \barg, \Barg, \varg, \Varg,
+% }
+% \cs[module=amsmath,replace=false]{arg}
+% \begin{macrocode}
+\@@_new_delim_op_cmds:nN {arg} \arg
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}[documented-as=\parccos]{
+% \pcos, \bcos, \Bcos, \vcos, \Vcos,
+% }
+% \cs[module=amsmath,replace=false]{cos}
+% \begin{macrocode}
+\@@_new_delim_op_cmds:nN {cos} \cos
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}[documented-as=\parccos]{
+% \pcosh, \bcosh, \Bcosh, \vcosh, \Vcosh,
+% }
+% \cs[module=amsmath,replace=false]{cosh},
+% \begin{macrocode}
+\@@_new_delim_op_cmds:nN {cosh} \cosh
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}[documented-as=\parccos]{
+% \pcot, \bcot, \Bcot, \vcot, \Vcot,
+% }
+% \cs[module=amsmath,replace=false]{cot},
+% \begin{macrocode}
+\@@_new_delim_op_cmds:nN {cot} \cot
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}[documented-as=\parccos]{
+% \pcoth, \bcoth, \Bcoth, \vcoth, \Vcoth,
+% }
+% \cs[module=amsmath,replace=false]{coth},
+% \begin{macrocode}
+\@@_new_delim_op_cmds:nN {coth} \coth
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}[documented-as=\parccos]{
+% \pcsc, \bcsc, \Bcsc, \vcsc, \Vcsc,
+% }
+% \cs[module=amsmath,replace=false]{csc},
+% \begin{macrocode}
+\@@_new_delim_op_cmds:nN {csc} \csc
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}[documented-as=\parccos]{
+% \pdeg, \bdeg, \Bdeg, \vdeg, \Vdeg,
+% }
+% \cs[module=amsmath,replace=false]{deg},
+% \begin{macrocode}
+\@@_new_delim_op_cmds:nN {deg} \deg
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}[documented-as=\parccos]{
+% \pdet, \bdet, \Bdet, \vdet, \Vdet,
+% }
+% \cs[module=amsmath,replace=false]{det},
+% \begin{macrocode}
+\@@_new_delim_op_cmds:nN {det} \det
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}[documented-as=\parccos]{
+% \pdim, \bdim, \Bdim, \vdim, \Vdim,
+% }
+% \cs[module=amsmath,replace=false]{dim},
+% \begin{macrocode}
+\@@_new_delim_op_cmds:nN {dim} \dim
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}[documented-as=\parccos]{
+% \pexp, \bexp, \Bexp, \vexp, \Vexp,
+% }
+% \cs[module=amsmath,replace=false]{exp},
+% \begin{macrocode}
+\@@_new_delim_op_cmds:nN {exp} \exp
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}[documented-as=\parccos]{
+% \pgcd, \bgcd, \Bgcd, \vgcd, \Vgcd,
+% }
+% \cs[module=amsmath,replace=false]{gcd},
+% \begin{macrocode}
+\@@_new_delim_op_cmds:nN {gcd} \gcd
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}[documented-as=\parccos]{
+% \phom, \bhom, \Bhom, \vhom, \Vhom,
+% }
+% \cs[module=amsmath,replace=false]{hom},
+% \begin{macrocode}
+\@@_new_delim_op_cmds:nN {hom} \hom
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}[documented-as=\parccos]{
+% \pinf, \binf, \Binf, \vinf, \Vinf,
+% }
+% \cs[module=amsmath,replace=false]{inf},
+% \begin{macrocode}
+\@@_new_delim_op_cmds:nN {inf} \inf
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}[documented-as=\parccos]{
+% \pinjlim, \binjlim, \Binjlim, \vinjlim, \Vinjlim,
+% }
+% \cs[module=amsmath,replace=false]{injlim},
+% \begin{macrocode}
+\@@_new_delim_op_cmds:nN {injlim} \injlim
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}[documented-as=\parccos]{
+% \pker, \bker, \Bker, \vker, \Vker,
+% }
+% \cs[module=amsmath,replace=false]{ker},
+% \begin{macrocode}
+\@@_new_delim_op_cmds:nN {ker} \ker
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}[documented-as=\parccos]{
+% \plg, \blg, \Blg, \vlg, \Vlg,
+% }
+% \cs[module=amsmath,replace=false]{lg},
+% \begin{macrocode}
+\@@_new_delim_op_cmds:nN {lg} \lg
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}[documented-as=\parccos]{
+% \plim, \blim, \Blim, \vlim, \Vlim,
+% }
+% \cs[module=amsmath,replace=false]{lim},
+% \begin{macrocode}
+\@@_new_delim_op_cmds:nN {lim} \lim
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}[documented-as=\parccos]{
+% \pliminf, \bliminf, \Bliminf, \vliminf, \Vliminf,
+% }
+% \cs[module=amsmath,replace=false]{liminf},
+% \begin{macrocode}
+\@@_new_delim_op_cmds:nN {liminf} \liminf
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}[documented-as=\parccos]{
+% \plimsup, \blimsup, \Blimsup, \vlimsup, \Vlimsup,
+% }
+% \cs[module=amsmath,replace=false]{limsup},
+% \begin{macrocode}
+\@@_new_delim_op_cmds:nN {limsup} \limsup
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}[documented-as=\parccos]{
+% \pln, \bln, \Bln, \vln, \Vln,
+% }
+% \cs[module=amsmath,replace=false]{ln}
+% \begin{macrocode}
+\@@_new_delim_op_cmds:nN {ln} \ln
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}[documented-as=\parccos]{
+% \plog, \blog, \Blog, \vlog, \Vlog,
+% }
+% \cs[module=amsmath,replace=false]{log},
+% \begin{macrocode}
+\@@_new_delim_op_cmds:nN {log} \log
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}[documented-as=\parccos]{
+% \pmax, \bmax, \Bmax, \vmax, \Vmax,
+% }
+% \cs[module=amsmath,replace=false]{max},
+% \begin{macrocode}
+\@@_new_delim_op_cmds:nN {max} \max
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}[documented-as=\parccos]{
+% \pmin, \bmin, \Bmin, \vmin, \Vmin,
+% }
+% \cs[module=amsmath,replace=false]{min},
+% \begin{macrocode}
+\@@_new_delim_op_cmds:nN {min} \min
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}[documented-as=\parccos]{
+% \pPr, \bPr, \BPr, \vPr, \VPr,
+% }
+% \cs[module=amsmath,replace=false]{Pr},
+% \begin{macrocode}
+\@@_new_delim_op_cmds:nN {Pr} \Pr
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}[documented-as=\parccos]{
+% \pprojlim, \bprojlim, \Bprojlim, \vprojlim, \Vprojlim,
+% }
+% \cs[module=amsmath,replace=false]{projlim},
+% \begin{macrocode}
+\@@_new_delim_op_cmds:nN {projlim} \projlim
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}[documented-as=\parccos]{
+% \psec, \bsec, \Bsec, \vsec, \Vsec,
+% }
+% \cs[module=amsmath,replace=false]{sec},
+% \begin{macrocode}
+\@@_new_delim_op_cmds:nN {sec} \sec
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}[documented-as=\parccos]{
+% \psin, \bsin, \Bsin, \vsin, \Vsin,
+% }
+% \cs[module=amsmath,replace=false]{sin},
+% \begin{macrocode}
+\@@_new_delim_op_cmds:nN {sin} \sin
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}[documented-as=\parccos]{
+% \psinh, \bsinh, \Bsinh, \vsinh, \Vsinh,
+% }
+% \cs[module=amsmath,replace=false]{sinh},
+% \begin{macrocode}
+\@@_new_delim_op_cmds:nN {sinh} \sinh
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}[documented-as=\parccos]{
+% \psup, \bsup, \Bsup, \vsup, \Vsup,
+% }
+% \cs[module=amsmath,replace=false]{sup},
+% \begin{macrocode}
+\@@_new_delim_op_cmds:nN {sup} \sup
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}[documented-as=\parccos]{
+% \ptan, \btan, \Btan, \vtan, \Vtan,
+% }
+% \cs[module=amsmath,replace=false]{tan},
+% \begin{macrocode}
+\@@_new_delim_op_cmds:nN {tan} \tan
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}[documented-as=\parccos]{
+% \ptanh, \btanh, \Btanh, \vtanh, \Vtanh
+% }
+% and \cs[module=amsmath,replace=false]{tanh}.
+% \begin{macrocode}
+\@@_new_delim_op_cmds:nN {tanh} \tanh
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}[documented-as=\parccos]{
+% \pvarinjlim, \bvarinjlim, \Bvarinjlim, \vvarinjlim, \Vvarinjlim,
+% \pvarprojlim, \bvarprojlim, \Bvarprojlim, \vvarprojlim, \Vvarprojlim,
+% \pvarliminf, \bvarliminf, \Bvarliminf, \vvarliminf, \Vvarliminf,
+% \pvarlimsup, \bvarlimsup, \Bvarlimsup, \vvarlimsup, \Vvarlimsup,
+% }
+% We also provide delimited versions of \cs[module=amsmath,replace=false]{varinjlim},
+% \cs[module=amsmath,replace=false]{varprojlim},
+% \cs[module=amsmath,replace=false]{varliminf},
+% and \cs[module=amsmath,replace=false]{varlimsup}.
+% \begin{macrocode}
+\@@_new_delim_op_cmds:nN {varinjlim} \varinjlim
+\@@_new_delim_op_cmds:nN {varprojlim} \varprojlim
+\@@_new_delim_op_cmds:nN {varliminf} \varliminf
+\@@_new_delim_op_cmds:nN {varlimsup} \varlimsup
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+}{
+ \msg_info:nnnn {moremath} {load /disabling} {no-operators}
+ {
+ predefined~delimited~operator~macros
+ }
+} % End of the conditional
+% \end{macrocode}
+%
+% ^^X SECTION: Vector Calculus Macros
+% \section{Vector Calculus Macros}
+% \label{sec:vector-calc}
+%
+% For providing macros which help with vector differentials,
+% we first need some setup functions.
+%
+% \subsection{Macros Providing Symbols of Operators}
+% \label{sec:op-symbols}
+%
+% \begin{macro}{
+% \@@_maybe_vcenter:n,
+% }
+% Sometimes a symbol should be centered explicitly,
+% as this will depend on the current setting of "vcenter",
+% i.e.\ the current value of \cs{l_@@_vcenter_bool},
+% we provide a helper function which puts its argument
+% \begin{arguments}
+% \item A list of \meta{tokens}
+% \end{arguments}
+% inside a \tn{vcenter} by means of \cs{moremath_vcenter:n}
+% or not depending on the current value of \cs{l_@@_vcenter_bool}.
+% \begin{macrocode}
+\cs_new_protected_nopar:Nn \@@_maybe_vcenter:n
+{
+ \bool_if:NTF \l_@@_vcenter_bool
+ {
+ \moremath_vcenter:n {#1}
+ }{
+ #1
+ }
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[updated=2024-08-20]{\@@_gradient_operator_get:}
+% This function returns the gradient operator depending on the current setting
+% of the keys.
+% \begin{macrocode}
+\cs_new_protected:Nn \@@_gradient_operator_get:
+{
+ \tl_if_empty:NTF \l_@@_grad_op_tl
+ {
+ \@@_tex_mathop:n
+ {
+% \end{macrocode}
+% Otherwise we first need to check if the operator shall have an arrow over it.
+% Afterwards if the nabla shall be bold.
+% \begin{macrocode}
+ \bool_if:NTF \l_@@_nabla_arrow_bool
+ {
+ \vec
+ {
+% \end{macrocode}
+% In case \cs{l_@@_nabla_arrow_bool} is true we should \emph{maybe}
+% center the symbol.
+% \begin{macrocode}
+ \@@_maybe_vcenter:n
+ {
+ \bool_if:NT \l_@@_nabla_bold_bool
+ {
+ \boldsymbol
+ }
+ \l_@@_nabla_tl
+ }
+ }
+ }{
+% \end{macrocode}
+% Like in the case above we should \emph{maybe} center the symbol
+% if \cs{l_@@_nabla_bold_bool} is true.
+% \begin{macrocode}
+ \bool_if:NTF \l_@@_nabla_bold_bool
+ {
+ \@@_maybe_vcenter:n
+ {
+ \boldsymbol
+ \l_@@_nabla_tl
+ }
+ }{
+ \l_@@_nabla_tl
+ }
+ }
+ }% \@@_tex_mathop:n
+ \nolimits
+ }{
+% \end{macrocode}
+% If the user provided its own implementation of the operator,
+% we simply return it.
+% \begin{macrocode}
+ \l_@@_grad_op_tl
+ }
+}
+% \end{macrocode}
+% \changes{v0.5.0}{\GetVersionDate{v0.5.0}}{
+% Now uses \cs{@@_tex_mathop:n} instead of \TeX{}-primitives.
+% }
+% \end{macro}
+%
+% \begin{macro}[updated=2024-08-20]{\@@_laplace_operator_get:}
+% Then we define a function for returning the laplace operator symbol,
+% depending on the currently set keys.
+% The function wraps the symbol for the operator inside
+% \tn{mathop} to provide the right spacing.
+% \begin{macrocode}
+\cs_new_protected:Nn \@@_laplace_operator_get:
+{
+ \tl_if_empty:NTF \l_@@_laplacian_tl
+ {
+ \@@_tex_mathop:n
+ {
+ \bool_if:NTF \l_@@_laplacian_delta_bool
+ {
+ \Delta
+ }{
+ \bool_if:NTF \l_@@_laplacian_arrow_bool
+ {
+ \vec{
+ \@@_maybe_vcenter:n
+ {
+ \bool_if:NT \l_@@_nabla_bold_bool {\boldsymbol}
+ \l_@@_laplacian_symb_tl
+ }
+ }
+ }{
+ \bool_if:NTF \l_@@_nabla_bold_bool
+ {
+ \@@_maybe_vcenter:n
+ {
+ \boldsymbol
+ \l_@@_laplacian_symb_tl
+ }
+ }{
+ \l_@@_laplacian_symb_tl
+ }
+ }
+ }
+ }\nolimits
+ \bool_if:NF \l_@@_laplacian_delta_bool
+ {
+ \c_math_superscript_token
+ {
+ 2
+ }
+ }
+ }{
+ \l_@@_laplacian_tl
+ }
+}
+% \end{macrocode}
+% \changes{v0.5.0}{\GetVersionDate{v0.5.0}}{
+% Now uses \cs{@@_tex_mathop:n} instead of \TeX{}-primitives.
+% }
+% \end{macro}
+%
+% \begin{macro}[updated=2024-08-20]{
+% \@@_dalembert_operator_get:
+% }
+% This function returns the \foreignlanguage{french}{d'Alembert} operator
+% depending on the currently set keys. The symbol for the
+% \foreignlanguage{french}{d'Alembert} operator is wrapped inside \tn{mathop}
+% to provide proper spacing.
+% \begin{macrocode}
+\cs_new_protected:Nn \@@_dalembert_operator_get:
+{
+ \@@_tex_mathop:n
+ {
+ \l_@@_dalembert_symb_tl
+ }% \@@_tex_mathop:n
+ \nolimits
+}
+% \end{macrocode}
+% \changes{v0.2.0}{\GetVersionDate{v0.2.0}}{%
+% Added function: \cs{@@_dalembert_operator_get:}
+% }
+% \changes{v0.5.0}{\GetVersionDate{v0.5.0}}{
+% Now uses \cs{@@_tex_mathop:n} instead of \TeX{}-primitives.
+% }
+% \end{macro}
+%
+% \subsection{Macros Producing an Operator}
+% \label{sec:op-macros}
+%
+% After we have defined the symbols it is now time to provide a function which
+% produces the entire gradient operator
+% \begin{macro}{
+% \moremath_gradient_operator:n,
+% \moremath_laplace_operator:n
+% }
+% This function takes one arguments, the subscript to use with the operator.
+% \begin{macrocode}
+\cs_new_protected_nopar:Nn \moremath_gradient_operator:n
+{
+ \@@_gradient_operator_get:
+ \tl_if_empty:nF {#1} {\c_math_subscript_token {#1}}
+}
+% \end{macrocode}
+%
+% Like for the gradient operator we do the same for the laplacian
+% \begin{macrocode}
+\cs_new_protected_nopar:Nn \moremath_laplace_operator:n
+{
+ \@@_laplace_operator_get:
+ \tl_if_empty:nF {#1} {\c_math_subscript_token {#1}}
+}
+% \end{macrocode}
+% \changes{v0.1.0}{\GetVersionDate{v0.1.0}}{%
+% Added functions.
+% }
+% \end{macro}
+%
+% \begin{macro}{
+% \moremath_divergence_operator:n,
+% \moremath_curl_operator:n
+% }
+% Using the already defined gradient operator it is possible to define a
+% function which acts as an operator suitable for representing the divergence
+% operator and the curl operator.
+% Like the gradient operator this functions take one argument
+% \begin{arguments}
+% \item the subscript of the gradient operator.
+% \end{arguments}
+% \begin{macrocode}
+\cs_new_protected_nopar:Nn \moremath_divergence_operator:n
+{
+% \end{macrocode}
+% The braces around \cs{moremath_gradient_operator:n} are necessary to avoid
+% issues with the spacing between \tn{cdot} and the following \tn{mathopen}
+% from any braces.\footnote{%
+% See: \url{https://tex.stackexchange.com/a/223914}
+% }
+% Example:
+% \[
+% \text{With braces:}\quad \pdiv{f(x)} \text{,}
+% \qquad\text{without braces: }\quad \mathop{\nabla}\nolimits\cdot(f(x))
+% \]
+% \begin{macrocode}
+ {
+ \moremath_gradient_operator:n {#1}
+ }
+ \cdot
+}
+
+\cs_new_protected_nopar:Nn \moremath_curl_operator:n
+{
+ {
+ \moremath_gradient_operator:n {#1}
+ }
+ \times
+}
+% \end{macrocode}
+% \changes{v0.1.0}{\GetVersionDate{v0.1.0}}{%
+% Added functions.
+% }
+% \end{macro}
+%
+% \begin{macro}{
+% \moremath_dalembert_operator:n
+% }
+% This function produces the \foreignlanguage{french}{d'Alembert} operator,
+% including an optional subscript.
+% The function takes one argument:
+% \begin{arguments}
+% \item A \meta{tl} with the contents of the subscript of the operator.
+%
+% This variable may be empty,
+% in this case no subscript (not even an empty one) is produced.
+% \end{arguments}
+% \begin{macrocode}
+\cs_new_protected:Nn \moremath_dalembert_operator:n
+{
+ \@@_dalembert_operator_get:
+ \tl_if_empty:nF {#1}
+ {
+ \c_math_subscript_token {#1}
+ }
+}
+% \end{macrocode}
+% \changes{v0.2.0}{\GetVersionDate{v0.2.0}}{%
+% Added new function \cs{moremath_dalembert_operator:n}.
+% }
+% \end{macro}
+%
+%
+% \subsection{Producing Delimited Vector Calculus Operators}
+% \label{sec:delim-vec-ops}
+%
+% \begin{macro}{
+% \moremath_delim_nabla_op_noscale:NNnn,
+% \moremath_delim_nabla_op_autoscale:NNnn
+% }
+% These functions produce a vector calculus operator with \meta{contents}
+% inside delimiters.
+% The "autoscale" variant scales the delimiters with the size of \meta{contents},
+% the "noscale" variant does no scaling at all.
+% \begin{arguments}
+% \item The \meta{csname} of the operator to use.
+%
+% This should have the same form as \cs{moremath_gradient_operator:n},
+% i.e.\ the function passed as \meta{csname} should accept one argument
+% to typeset as subscript.
+%
+% \item The \meta{csname} of the \emph{paired delimiter} to use.
+%
+% The paired delimiter has to be one declared using \pkg{mathtools}'
+% \cs[module=mathtools,replace=false]{DeclarePairedDelimiter} command.
+%
+% \item A \meta{tl} with the subscript of the operator.
+%
+% \item A \meta{tl} with the contents to typeset inside the delimiters
+% \end{arguments}
+% We begin with the "noscale" version.
+% \begin{macrocode}
+\cs_new_protected_nopar:Nn \moremath_delim_nabla_op_noscale:NNnn
+{
+ #1 {#3} #2{#4}
+}
+% \end{macrocode}
+% Then we create the version with automatic scaling.
+% \begin{macrocode}
+\cs_new_protected_nopar:Nn \moremath_delim_nabla_op_autoscale:NNnn
+{
+ #1 {#3} #2 * {#4}
+}
+% \end{macrocode}
+% \changes{v0.1.0}{\GetVersionDate{v0.1.0}}{%
+% Added "noscale" and "autoscale" functions.
+% }
+% \end{macro}
+%
+% \begin{macro}{
+% \moremath_delim_nabla_op_manuscale:NNnnn
+% }
+% This function produces a vector calculus operator like
+% \cs{moremath_delim_nabla_op_noscale:NNnn}
+% and \cs{moremath_delim_nabla_op_autoscale:NNnn},
+% but with manual scaling.
+% It takes five arguments:
+% \begin{arguments}
+% \item The \meta{csname} of the operator to use.
+%
+% \item The \meta{csname} of the paired delimiter.
+%
+% \item A \meta{token~list} containing the \meta{scale~cmd} like
+% \cs{big}, \cs{Big}, \cs{bigg}, etc.
+%
+% \item A \meta{tl} with the subscript of the operator.
+%
+% \item A \meta{tl} with the contents to typeset inside the delimiters.
+% \end{arguments}
+% \begin{macrocode}
+\cs_new_protected_nopar:Nn \moremath_delim_nabla_op_manuscale:NNnnn
+{
+ #1 {#4} #2 [#3] {#5}
+}
+% \end{macrocode}
+% \begin{macro}{
+% \moremath_delim_nabla_op_manuscale:NNVnn
+% }
+% We also declare a variant for passing a variable with the \meta{scale~cmd}
+% instead of a \meta{token~list}.
+% \begin{macrocode}
+\cs_generate_variant:Nn \moremath_delim_nabla_op_manuscale:NNnnn {NNVnn}
+% \end{macrocode}
+% \changes{v0.1.0}{\GetVersionDate{v0.1.0}}{%
+% Add variant.
+% }
+% \end{macro}
+% \changes{v0.1.0}{\GetVersionDate{v0.1.0}}{%
+% Add function.
+% }
+% \end{macro}
+%
+% To ease the definition of those macros we define a function for defining
+% the delimited versions.
+%
+% Of course we also need a way to declare a user interface for this functions.
+% For this purpose we first need some helpers for setting
+% necessary parameters.
+% \begin{macro}{\@@_parse_kv_args:nN}
+% This helper macro takes two arguments,
+% \begin{arguments}
+% \item A token list of the key-value arguments.
+% \item The \meta{csname} of a token list to put the scale value in.
+% \end{arguments}
+% The function sets the given keys but before it does so it searches for a
+% key named \verb|scale| and puts it into the second argument.
+% For this to work it is necessary that all values have \verb|=| in them.
+% \begin{macrocode}
+\cs_new_protected:Nn \@@_parse_kv_args:nN
+{
+% \end{macrocode}
+% We first put the key-value arguments inside a property list.
+% Afterwards we check if the key \verb|scale| has been given.
+% If yes we pop it and assign it to the second argument.
+% Otherwise we do nothing.
+% \NB{MI}{It may be a better idea to use a key instead but I'm not sure.
+% If one nests those environments the size of the outer one will propagate into
+% the inner scope, which might not be what is wanted.}
+% \begin{macrocode}
+ \prop_set_from_keyval:Nn \l_tmpa_prop {#1}
+
+ \prop_pop:NnNT \l_tmpa_prop {scale} #2 {}
+
+ \keys_set:ne {moremath} {\prop_to_keyval:N \l_tmpa_prop}
+}
+% \end{macrocode}
+% \end{macro}
+%
+% We also need a warning message for conflicting arguments,
+% to inform the user that one of his options is going to be ignored.
+% \begin{macrocode}
+\msg_new:nnn { moremath } { vector-calc / scale-star-conflict }
+{
+ Both~star~and~scaling~factor~given~to~'#1'.\\
+ Automatic~scaling~will~be~preferred,~the~size~command~'#2'~will~be~
+ ignored~\msg_line_context:.
+}
+% \end{macrocode}
+%
+% \begin{macro}{
+% \@@_new_delim_nabla_doc_cmd:NNN,
+% \@@_new_delim_nabla_doc_cmd:cNN,
+% }
+% This function takes three arguments:
+% \begin{arguments}
+% \item The \meta{csname} of the to be defined command
+% \item The \meta{csname} of the operator to use.
+%
+% This should be a function like \cs{moremath_gradient_operator:n}.
+% \item The \meta{csname} of the delimiter function to use.
+%
+% This should be a macro/command created with \pkg{mathtools}
+% \cs[module=mathtools,replace=false]{DeclarePairedDelimiter} command.
+% \end{arguments}
+% Its purpose is to create a new document level command,
+% for the delimited vector calculus operators.
+% \begin{macrocode}
+\cs_new_protected:Nn \@@_new_delim_nabla_doc_cmd:NNN
+{
+ \cs_if_free:NTF #1
+ {
+ \exp_args:NNe \NewDocumentCommand #1
+ {
+ s ={scale} o E{ \char_generate:nn {`_}{8} }{ {} } m
+ }
+ { % command code
+ \group_begin:
+ % optional arguments given?
+ \tl_if_novalue:nF {##2}
+ {
+ \@@_parse_kv_args:nN {##2} \l_tmpa_tl
+ }
+ % star given?
+ \bool_if:nTF {##1}
+ {
+ % scale factor given?
+ \tl_if_empty:NF \l_tmpa_tl
+ {
+ \msg_warning:nnnV { moremath } { vector-calc / scale-star-conflict }
+ {#1} \l_tmpa_tl
+ }
+ \moremath_delim_nabla_op_autoscale:NNnn #2 #3 {##3} {##4}
+ }{ % \bool_if:nTF {##1} FALSE BRANCH
+ % scale factor given?
+ \tl_if_empty:NTF \l_tmpa_tl
+ {
+ \moremath_delim_nabla_op_noscale:NNnn #2 #3 {##3} {##4}
+ }{ % FALSE BRANCH
+ \moremath_delim_nabla_op_manuscale:NNVnn #2 #3 \l_tmpa_tl {##3} {##4}
+ }
+ } % \bool_if:nTF {##1}
+ \group_end:
+ }
+ }{ % \cs_if_free:NTF #1 FALSE BRANCH
+ \msg_warning:nnn { moremath } { vector-calc / already-defined-skip } {#1}
+ } % \cs_if_free:NTF #1
+}
+%
+\cs_generate_variant:Nn \@@_new_delim_nabla_doc_cmd:NNN {cNN}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@@_new_nabla_doc_cmds:nN}
+% This internal function creates five different document level commands at once,
+% using \cs{@@_new_delim_nabla_doc_cmd:cNN}.
+% It takes two arguments:
+% \begin{arguments}
+% \item The a \meta{suffix~tl} for constructing the command names.
+%
+% The resulting commands will have the form \cs[no-index]{p\meta{suffix}},
+% \cs[no-index]{b\meta{suffix}}, \cs[no-index]{B\meta{suffix}},
+% \cs[no-index]{v\meta{suffix}} and \cs[no-index]{V\meta{suffix}}.
+%
+% \item The \meta{csname} of the operator to use
+% \end{arguments}
+% \begin{macrocode}
+\cs_new_protected:Nn \@@_new_nabla_doc_cmds:nN
+{
+ \@@_new_delim_nabla_doc_cmd:cNN { p #1 } #2 \@@_inparent:w
+ \@@_new_delim_nabla_doc_cmd:cNN { b #1 } #2 \@@_inbrack:w
+ \@@_new_delim_nabla_doc_cmd:cNN { B #1 } #2 \@@_inbrace:w
+ \@@_new_delim_nabla_doc_cmd:cNN { v #1 } #2 \@@_in_vert:w
+ \@@_new_delim_nabla_doc_cmd:cNN { V #1 } #2 \@@_in_Vert:w
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Document Level Commands}
+% \label{sec:vec-doc-lvl-commands}
+%
+% The predefined macros for vector calculus are also guarded by a package
+% option to be conditionally disabled by the user.
+% \begin{macrocode}
+\bool_if:NTF \l_@@_predef_vector_op_bool
+{
+% \end{macrocode}
+% \subsubsection{Standalone Operators}
+% \label{par:impl-vector-calc-standalone}
+% The user might want to use also a non-delimited version
+% of the vector calculus operators,
+% we provide them with a standalone version of those.
+%
+% As the definition of a new document command can fail if the \meta{csname}
+% clashes with some already defined macro,
+% we define an error message to use when defining document level commands.
+% \begin{macrocode}
+\msg_new:nnn { moremath } { vector-calc / already-defined-skip }
+{
+ Control~sequence~'#1'~is~already~defined.\\
+ Skipping~definition~\msg_line_context:.
+}
+% \end{macrocode}
+%
+% \begin{macro}{
+% \grad,
+% \divergence,
+% \curl,
+% \laplacian
+% }
+% Now we provide the user with document level commands for
+% \cs[no-index]{moremath_\meta{op}_operator:n}.
+% \begin{macrocode}
+\cs_if_free:NTF \grad
+{
+ \exp_args:NNe \NewDocumentCommand \grad { !o E{ \char_generate:nn {`_}{8} }{{}} }
+ {
+ \group_begin:
+ \tl_if_novalue:nF {#1}
+ {
+ \keys_set:nn {moremath} {#1}
+ }
+ \moremath_gradient_operator:n {#2}
+ \group_end:
+ }
+}{
+ \msg_warning:nnn {moremath} { vector-calc / already-defined-skip } {\grad}
+}
+
+\cs_if_free:NTF \divergence
+{
+ \exp_args:NNe \NewDocumentCommand \divergence
+ { !o E{ \char_generate:nn {`_} {8} }{{}} }
+ {
+ \group_begin:
+ \tl_if_novalue:nF {#1}
+ {
+ \keys_set:nn {moremath} {#1}
+ }
+ \moremath_divergence_operator:n {#2}
+ \group_end:
+ }
+}{
+ \msg_warning:nnn {moremath} { vector-calc / already-defined-skip } {\divergence}
+}
+
+\cs_if_free:NTF \curl
+{
+ \exp_args:NNe \NewDocumentCommand \curl
+ { !o E{ \char_generate:nn {`_}{8} }{{}} }
+ {
+ \group_begin:
+ \tl_if_novalue:nF {#1}
+ {
+ \keys_set:nn {moremath} {#1}
+ }
+ \moremath_curl_operator:n {#2}
+ \group_end:
+ }
+}{
+ \msg_warning:nnn {moremath} {vector-calc / already-defined-skip} {\curl}
+}
+
+\cs_if_free:NTF \laplacian
+{
+ \exp_args:NNe \NewDocumentCommand \laplacian
+ { !o E{ \char_generate:nn {`_}{8} }{{}} }
+ {
+ \group_begin:
+ \tl_if_novalue:nF {#1}
+ {
+ \keys_set:nn {moremath} {#1}
+ }
+ \moremath_laplace_operator:n {#2}
+ \group_end:
+ }
+}{
+ \msg_warning:nnn {moremath} { vector-calc / already-defined-skip }
+ {\laplacian}
+}
+% \end{macrocode}
+% \begin{macro}{\quabla}
+% We now also define a command to use as a standalone
+% \foreignlanguage{french}{d'Alembert} operator.
+% As the name \cs[no-index]{dalembertian} is a bit cumbersome to type out,
+% I've decided to use one of its alternate names \cs{quabla}
+% \begin{macrocode}
+\cs_if_free:NTF \quabla
+{
+ \exp_args:NNe \NewDocumentCommand \quabla
+ { !o E{ \char_generate:nn {`_} { 8 } }{{}} }
+ {
+ \group_begin:
+ \tl_if_novalue:nF {#1}
+ {
+ \keys_set:nn { moremath } {#1}
+ }
+ \moremath_dalembert_operator:n {#2}
+ \group_end:
+ }
+}{ % \cs_if_free:NTF \quabla FALSE BRANCH
+ \msg_warning:nnn { moremath } { vector-calc / already-defined-skip }
+ {\quabla}
+}
+% \end{macrocode}
+% \changes{v0.2.0}{\GetVersionDate{v0.2.0}}{
+% Added \cs{quabla} command.
+% }
+% \changes{v0.3.0}{\GetVersionDate{v0.3.0}}{
+% Changed: Spaces between the \meta{csname}
+% and the optional argument are now disallowed.
+% }
+% \end{macro}^^X \quabla
+% \changes{v0.1.0}{\GetVersionDate{v0.1.0}}{
+% Added \cs{grad}, \cs{divergence}, \cs{curl} and \cs{laplacian}
+% commands.
+% }
+% \changes{v0.3.0}{\GetVersionDate{v0.3.0}}{
+% Changed: Spaces between the \meta{csname}
+% and the optional argument are now disallowed
+% for \cs{grad}, \cs{divergence}, \cs{curl} and \cs{laplacian}.
+% }
+% \end{macro}
+%
+% \subsubsection{Operators with Delimiters}
+% \label{par:impl-vec-calc-op-delim}
+%
+% \begin{macro}{
+% \pgrad,
+% \bgrad,
+% \Bgrad,
+% \vgrad,
+% \Vgrad,
+% }
+% Now lets declare the delimited gradient operators.
+% We provide five versions using parenthesis, brackets, braces, single \tn{vert},
+% and double \tn{Vert}.
+% \begin{macrocode}
+\@@_new_nabla_doc_cmds:nN {grad} \moremath_gradient_operator:n
+% \end{macrocode}
+% \changes{v0.1.0}{\GetVersionDate{v0.1.0}}{%
+% Added commands for delimited gradient operators.
+% }
+% \end{macro}
+%
+% \begin{macro}{
+% \pdiv,
+% \bdiv,
+% \Bdiv,
+% \vdiv,
+% \Vdiv
+% }
+% Now we do the same for the divergence operator.
+% \begin{macrocode}
+\@@_new_nabla_doc_cmds:nN {div} \moremath_divergence_operator:n
+% \end{macrocode}
+% \changes{v0.1.0}{\GetVersionDate{v0.1.0}}{%
+% Added commands for delimited divergence operators.
+% }
+% \end{macro}
+%
+% \begin{macro}{
+% \pcurl,
+% \bcurl,
+% \Bcurl,
+% \vcurl,
+% \Vcurl
+% }
+% Now to the curl macros.
+% \begin{macrocode}
+\@@_new_nabla_doc_cmds:nN {curl} \moremath_curl_operator:n
+% \end{macrocode}
+% \changes{v0.1.0}{\GetVersionDate{v0.1.0}}{%
+% Added commands for delimited curl operators.
+% }
+% \end{macro}
+%
+% \begin{macro}{
+% \plaplacian,
+% \blaplacian,
+% \Blaplacian,
+% \vlaplacian,
+% \Vlaplacian
+% }
+% Next we take care of the laplacian
+% \begin{macrocode}
+\@@_new_nabla_doc_cmds:nN {laplacian} \moremath_laplace_operator:n
+% \end{macrocode}
+% \changes{v0.1.0}{\GetVersionDate{v0.1.0}}{%
+% Added commands for delimited Laplace operators.
+% }
+% \end{macro}
+%
+% \begin{macro}{
+% \pquabla,
+% \bquabla,
+% \Bquabla,
+% \vquabla,
+% \Vquabla
+% }
+% Finally we define delimited commands for the
+% \foreignlanguage{french}{d'Alembert} operator.
+% \begin{macrocode}
+\@@_new_nabla_doc_cmds:nN {quabla} \moremath_dalembert_operator:n
+% \end{macrocode}
+% \changes{v0.2.0}{\GetVersionDate{v0.2.0}}{
+% Added commands for a delimited \foreignlanguage{french}{d'Alembert}
+% operator.
+% }
+% \end{macro}
+%
+% If the user issued \texttt{no-vector} as a package loading option,
+% write this to the log file.
+% \begin{macrocode}
+}{ % IF NOT \l_@@_predef_vector_op_bool
+ \msg_info:nnnn {moremath} { load /disabling } {no-vector}
+ {
+ predefined~vector~calculus~macros
+ }
+} % END \l_@@_predef_vector_op_bool
+% \end{macrocode}
+%
+% \section{Macros Producing Matrices and Vectors}
+% \label{sec:impl-matr-vec}
+%
+% \subsection{Producing Row and Column Vectors}
+%
+% The functions in this section are used to generate row and column vectors
+% utilizing \pkg{mathtools}~\autocite{mathtools} \env{matrix*} and
+% \env{smallmatrix*} environments.
+%
+% \begin{variable}{\l_@@_vector_entries_seq}
+% For generating row or column vectors it is necessary to store the entries
+% inside a variable. \cs{l_@@_vector_entries_seq} is used for this purpose.
+% \begin{macrocode}
+\seq_new:N \l_@@_vector_entries_seq
+% \end{macrocode}
+% \end{variable}
+%
+% Then we need a function for formatting the actual entries of the vector.
+% We need two version one for the row vector and one for the column vector
+% version.
+% \begin{macro}{
+% \@@_seq_to_column_vector:N,
+% \@@_seq_to_row_vector:N
+% }
+% These functions take one argument
+% \begin{arguments}
+% \item A sequence which should be converted to the contents of the single
+% column/row matrix.
+% \end{arguments}
+% They format the input suitable to be put inside a \env{matrix*} environment.
+% We begin with the column vector version.
+% \begin{macrocode}
+\cs_new_protected_nopar:Nn \@@_seq_to_column_vector:N
+{
+ \seq_use:Nn #1 {\\}
+}
+% \end{macrocode}
+% Then we get to the row vector.
+% \begin{macrocode}
+\cs_new_protected_nopar:Nn \@@_seq_to_row_vector:N
+{
+ \seq_use:Nn #1 {&}
+}
+% \end{macrocode}
+% \end{macro}
+%
+% In the next step we construct the single row/column matrix from the user
+% provided input.
+% \begin{macro}[updated=2024-08-20]{
+% \moremath_column_vector:nn,
+% \moremath_column_vector:Vn,
+% \moremath_row_vector:nn,
+% \moremath_row_vector:Vn,
+% }
+% The two commands \cs{moremath_column_vector:nn} and \cs{moremath_row_vector:nn}
+% construct the matrix, they both take two arguments.
+% \begin{arguments}
+% \item The delimiter specifier.
+%
+% This should be one of the prefixes of the \env{\meta{prefix}matrix*},
+% environments.
+%
+% Another possibility is to issue |small| as this parameter to get
+% an inline matrix.
+%
+% \item The comma separated contents of the matrix.
+% \end{arguments}
+% \begin{macrocode}
+\cs_new_protected_nopar:Nn \moremath_column_vector:nn
+{
+ \seq_clear:N \l_@@_vector_entries_seq
+ \seq_set_from_clist:Nn \l_@@_vector_entries_seq {#2}
+
+ \@@_matrix_star_begin:nV {#1} \l_@@_matrix_align_tl
+ \@@_seq_to_column_vector:N \l_@@_vector_entries_seq
+ \@@_matrix_star_end:n {#1}
+}
+%
+\cs_new_protected_nopar:Nn \moremath_row_vector:nn
+{
+ \seq_clear:N \l_@@_vector_entries_seq
+ \seq_set_from_clist:Nn \l_@@_vector_entries_seq {#2}
+
+ \@@_matrix_star_begin:nV {#1} \l_@@_matrix_align_tl
+ \@@_seq_to_row_vector:N \l_@@_vector_entries_seq
+ \@@_matrix_star_end:n {#1}
+}
+% \end{macrocode}
+% We also provide a "Vn" variant of those functions.
+% \begin{macrocode}
+\cs_generate_variant:Nn \moremath_column_vector:nn { Vn }
+\cs_generate_variant:Nn \moremath_row_vector:nn { Vn }
+% \end{macrocode}
+% \changes{v0.1.0}{\GetVersionDate{v0.1.0}}{%
+% Added functions producing row- and column vectors.
+% }
+% \changes{v0.5.0}{\GetVersionDate{v0.5.0}}{
+% Changed now uses \cs{@@_matrix_star_begin:nV} instead of raw
+% |\begin{#1matrix*}|.
+% }
+% \changes{v0.5.0}{\GetVersionDate{v0.5.0}}{
+% Added new "Vn" variants.
+% }
+% \end{macro}
+%
+% \begin{macro}{
+% \moremath_column_smallvector:nn,
+% \moremath_column_smallvector:Vn,
+% \moremath_row_smallvector:nn,
+% \moremath_row_smallvector:Vn,
+% }
+% To make the code more readable, we define functions specifically for
+% creating row and column vectors using the \env{smallmatrix*} family of
+% environments. These functions take the same arguments as the non-small
+% versions above.
+% \begin{macrocode}
+\cs_new_protected_nopar:Nn \moremath_column_smallvector:nn
+{
+ \moremath_column_vector:nn {#1 small} {#2}
+}
+
+\cs_new_protected_nopar:Nn \moremath_row_smallvector:nn
+{
+ \moremath_row_vector:nn {#1 small} {#2}
+}
+% Variants
+\cs_generate_variant:Nn \moremath_column_smallvector:nn { Vn }
+\cs_generate_variant:Nn \moremath_row_smallvector:nn { Vn }
+% \end{macrocode}
+% \changes{v0.1.0}{\GetVersionDate{v0.1.0}}{%
+% Added functions producing inline math row- and column vectors.
+% }
+% \changes{v0.5.0}{\GetVersionDate{v0.5.0}}{
+% Added new "Vn" variants.
+% }
+% \end{macro}
+%
+% ^^X SUBSECTION: Shorthands for simple matrices
+% \subsection{Shorthands for Simple Matrices}
+% \label{sec:impl-matr-shorth}
+%
+% The construction of several simple matrices like diagonal matrices,
+% can be simplified as there is no need to use the \env{matrix} environment.\footnote{%
+% The code in this section is heavily inspired by the following answer on
+% \TeX{}SE: \url{https://tex.stackexchange.com/a/539741}
+% }
+%
+% \begin{variable}{
+% \l_@@_mat_diag_entries_seq,
+% \l_@@_mat_row_entries_seq,
+% }
+% We construct the matrices row by row, therefore we need to store the
+% currently constructed row inside a variable.
+% The same is true for the diagonal entries which also need to be stored
+% somewhere.
+% We therefore declare two sequence variables \cs{l_@@_mat_diag_entries_seq}
+% and \cs{l_@@_mat_row_seq} for this purpose
+% \begin{macrocode}
+\seq_clear_new:N \l_@@_mat_diag_entries_seq
+\seq_clear_new:N \l_@@_mat_row_entries_seq
+% \end{macrocode}
+% \end{variable}
+%
+% \subsubsection{(Anti-)diagonal matrices}
+% We split the construction of the matrix into multiple parts,
+% utilizing internal helper functions.
+% \begin{macro}{
+% \@@_constr_diagmat_row:n,
+% \@@_constr_antidiagmat_row:n
+% }
+% \cs{@@_constr_diagmat_row:n} and \cs{@@_constr_antidiagmat_row:n}
+% take one integer argument:
+% \begin{arguments}
+% \item The number of the current row.
+% \end{arguments}
+% They both construct a matrix row and place it inside the input stream.
+% They take the content of the (anti-)diagonal from the variable
+% \cs{l_@@_mat_diag_entries_seq}
+% and use the variable \cs{l_@@_mat_row_entries_seq}
+% to store the current row.
+% \begin{macrocode}
+\cs_new_protected:Nn \@@_constr_diagmat_row:n
+{
+ \seq_clear:N \l_@@_mat_row_entries_seq
+% \end{macrocode}
+% As all diagonal matrices \(M \in A^{m \times n}\), where \(A\) is a field,
+% are quadratic i.e.\ \(A^{m \times n} \equiv A^{n \times n}\) the length of the
+% diagonal sequence equals the number of rows and columns of the matrix.
+% We exploit this fact here.
+% \begin{macrocode}
+ \int_step_inline:nn {\seq_count:N \l_@@_mat_diag_entries_seq}
+ {
+ \int_compare:nTF { #1 == ##1 }
+ {
+ \seq_put_right:Nx \l_@@_mat_row_entries_seq
+ {
+ \seq_item:Nn \l_@@_mat_diag_entries_seq { #1 }
+ }
+ }{ % false branch
+ \seq_put_right:NV \l_@@_mat_row_entries_seq \l_@@_matrix_fill_tl
+ } % \int_compare:nTF { #1 == ##1 }
+ }
+ \seq_use:Nn \l_@@_mat_row_entries_seq { & } \\
+}
+
+% Anti-diagonal version
+\cs_new_protected:Nn \@@_constr_antidiagmat_row:n
+{
+ \seq_clear:N \l_@@_mat_row_entries_seq
+ \int_step_inline:nn {\seq_count:N \l_@@_mat_diag_entries_seq}
+ {
+ \int_compare:nTF { #1 == ##1 }
+ {
+ % as this is a anti diagonal matrix we put in the elements from the
+ % left so that the first entry is the right most entry
+ \seq_put_left:Nx \l_@@_mat_row_entries_seq
+ {
+ \seq_item:Nn \l_@@_mat_diag_entries_seq { #1 }
+ }
+ }{ % false branch
+ \seq_put_left:NV \l_@@_mat_row_entries_seq \l_@@_matrix_fill_tl
+ } % \int_compare:nTF { #1 == ##1 }
+ }
+ \seq_use:Nn \l_@@_mat_row_entries_seq { & } \\
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{
+% \moremath_diagonal_matrix:nn,
+% \moremath_antidiagonal_matrix:nn,
+% \moremath_diagonal_smallmatrix:nn,
+% \moremath_antidiagonal_smallmatrix:nn,
+% }
+% The \cs[no-index]{moremath_\meta{a or d}_matrix:nn} and
+% \cs[no-index]{moremath_\meta{a or d}_smallmatrix:nn} family of functions
+% produce a matrix based on \pkg{mathtools}~\autocite{mathtools}
+% \env{matrix*} environment.
+% The functions take two arguments.
+% \begin{arguments}
+% \item The delimiter specifier.
+%
+% This should be one of the prefixes of the \env{\meta{prefix}matrix*}
+% environments.
+%
+% \item The comma separated contents of the (anti-)diagonal.
+% \end{arguments}
+% These functions also use the values of the variables
+% \cs{l_@@_matrix_fill_tl} and \cs{l_@@_matrix_align_tl}.
+% And modifies the variable \cs{l_@@_mat_diag_entries_seq}.
+% \begin{macrocode}
+\cs_new_protected:Nn \moremath_diagonal_matrix:nn
+{
+ \seq_set_from_clist:Nn \l_@@_mat_diag_entries_seq { #2 }
+ \@@_matrix_star_begin:nV { #1 } \l_@@_matrix_align_tl
+ \int_step_function:nN { \seq_count:N \l_@@_mat_diag_entries_seq }
+ \@@_constr_diagmat_row:n
+ \@@_matrix_star_end:n { #1 }
+}
+%
+% Anti-diagonal matrix
+\cs_new_protected:Nn \moremath_antidiagonal_matrix:nn
+{
+ \seq_set_from_clist:Nn \l_@@_mat_diag_entries_seq { #2 }
+ \@@_matrix_star_begin:nV { #1 } \l_@@_matrix_align_tl
+ \int_step_function:nN { \seq_count:N \l_@@_mat_diag_entries_seq }
+ \@@_constr_antidiagmat_row:n
+ \@@_matrix_star_end:n { #1 }
+}
+
+% Small versions
+\cs_new_protected:Nn \moremath_diagonal_smallmatrix:nn
+{
+ \moremath_diagonal_matrix:nn {#1 small} {#2}
+}
+
+\cs_new_protected:Nn \moremath_antidiagonal_smallmatrix:nn
+{
+ \moremath_antidiagonal_matrix:nn {#1 small} {#2}
+}
+% \end{macrocode}
+% \begin{macro}{
+% \moremath_diagonal_matrix:nV,
+% \moremath_diagonal_matrix:Vn,
+% \moremath_diagonal_matrix:VV,
+% \moremath_antidiagonal_matrix:nV,
+% \moremath_antidiagonal_matrix:Vn,
+% \moremath_antidiagonal_matrix:VV,
+% \moremath_diagonal_smallmatrix:nV,
+% \moremath_diagonal_smallmatrix:Vn,
+% \moremath_diagonal_smallmatrix:VV,
+% \moremath_antidiagonal_smallmatrix:nV,
+% \moremath_antidiagonal_smallmatrix:Vn,
+% \moremath_antidiagonal_smallmatrix:VV,
+% }
+% For convenience we also define some variants of the above functions.
+% \begin{macrocode}
+\cs_generate_variant:Nn \moremath_diagonal_matrix:nn { nV, Vn, VV }
+\cs_generate_variant:Nn \moremath_antidiagonal_matrix:nn { nV, Vn, VV }
+\cs_generate_variant:Nn \moremath_diagonal_smallmatrix:nn { nV, Vn, VV}
+\cs_generate_variant:Nn \moremath_antidiagonal_smallmatrix:nn { nV, Vn, VV }
+% \end{macrocode}
+% \changes{v0.1.0}{\GetVersionDate{v0.1.0}}{Added variants.}
+% \changes{v0.2.0}{\GetVersionDate{v0.2.0}}{Added "nV" and "VV" variants.}
+% \end{macro}
+% \changes{v0.1.0}{\GetVersionDate{v0.1.0}}{%
+% Added functions producing (anti-)diagonal matrices.
+% Also added versions for inline math.
+% }
+% \changes{v0.5.0}{\GetVersionDate{v0.5.0}}{
+% Changed now uses \cs{@@_matrix_star_begin:nV} instead of raw
+% |\begin{#1matrix*}|.
+% }
+% \end{macro}
+%
+%
+% \subsubsection{Identity Matrices}
+% As we already have functions available for producing diagonal matrices,
+% it makes only sense to also provide a shorthand for producing an identity matrix,
+% i.e.\ a diagonal matrix with \enquote{1} along the diagonal.
+%
+%
+% \begin{macro}{
+% \@@_generate_one_filled_clist:Nn
+% }
+% The function \cs{@@_generate_one_filled_clist:Nn} produces a \meta{clist},
+% consisting only of \enquote{1} as entries.
+% This function takes two arguments:
+% \begin{arguments}
+% \item The \emph{csname} of a \meta{clist~var} to store the \meta{clist}
+% into.
+%
+% \item An \meta{int} to represent the number of entries to produce.
+% \end{arguments}
+% \begin{macrocode}
+\cs_new_protected_nopar:Nn \@@_generate_one_filled_clist:Nn
+{
+ \seq_clear:N \l_tmpa_seq
+ \int_step_inline:nn {#2}
+ {
+ \seq_put_right:NV \l_tmpa_seq \c_one_int
+ }
+ \clist_set_from_seq:NN #1 \l_tmpa_seq
+}
+% \end{macrocode}
+% \begin{macro}{
+% \@@_generate_one_filled_clist:NV
+% }
+% We also define a variant accepting an integer variable.
+% \begin{macrocode}
+\cs_generate_variant:Nn \@@_generate_one_filled_clist:Nn { N V }
+% \end{macrocode}
+% \end{macro}
+% \changes{v0.2.0}{\GetVersionDate{v0.2.0}}{%
+% Added function.
+% }
+% \end{macro}
+%
+% \begin{variable}{
+% \l_@@_id_entries_clist
+% }
+% As we want to utilize the \cs{moremath_diagonal_matrix:VV} and
+% \cs{moremath_diagonal_smallmatrix:VV} functions for creating the identity
+% matrix we declare an internal \meta{clist~var} called
+% \cs{l_@@_id_entries_clist} for passing the \meta{clist} around.
+% \begin{macrocode}
+\clist_new:N \l_@@_id_entries_clist
+% \end{macrocode}
+% \changes{v0.2.0}{\GetVersionDate{v0.2.0}}{Added variable.}
+% \end{variable}
+%
+% \begin{macro}{
+% \moremath_id_matrix:n,
+% \moremath_id_smallmatrix:n
+% }
+% These functions are intended to produce an identity matrix from an integer
+% expression.
+% They take one argument.
+% \begin{arguments}
+% \item The number of diagonal entries.
+% \end{arguments}
+% \begin{macrocode}
+\cs_new_protected_nopar:Nn \moremath_id_matrix:n
+{
+ \clist_clear:N \l_@@_id_entries_clist
+ \@@_generate_one_filled_clist:Nn \l_@@_id_entries_clist {#1}
+ \moremath_diagonal_matrix:VV \l_@@_matrix_delim_tl \l_@@_id_entries_clist
+}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\cs_new_protected_nopar:Nn \moremath_id_smallmatrix:n
+{
+ \clist_clear:N \l_@@_id_entries_clist
+ \@@_generate_one_filled_clist:Nn \l_@@_id_entries_clist {#1}
+ \moremath_diagonal_smallmatrix:VV \l_@@_matrix_delim_tl \l_@@_id_entries_clist
+}
+% \end{macrocode}
+%
+% \begin{macro}{
+% \moremath_id_matrix:V,
+% \moremath_id_smallmatrix:V
+% }
+% We also provide variants, which accepts a "V"-type argument:
+% \begin{macrocode}
+\cs_generate_variant:Nn \moremath_id_matrix:n { V }
+\cs_generate_variant:Nn \moremath_id_smallmatrix:n { V }
+% \end{macrocode}
+% \end{macro}
+%
+% \changes{v0.2.0}{\GetVersionDate{v0.2.0}}{%
+% Added functions \cs{moremath_id_matrix:n} and \cs{moremath_id_smallmatrix:n}
+% and variants.
+% }
+% \end{macro}
+%
+% \subsection{Document Level Commands}
+% \label{sec:mat-doc-lvl-cmds}
+%
+% Now we define document level commands for the previously defined
+% functions.
+%
+% But before we do so we define a message to be issued in case the targeted
+% \meta{csname} is already defined elsewhere.
+% \begin{macrocode}
+\msg_new:nnnn { moremath } { matrix / already-defined-doc-cmd-skip }
+{
+ Control~sequence~'#1'~is~already~defined.\\
+ Skipping~definition~\msg_line_context:.
+}
+{
+ The~control~sequence~'#1'~has~already\\
+ been~defined~by~some~other~package.\\
+ And~I~am~refusing~to~overwrite~the~existing~definition,\\
+ therefore~I~am~skipping~the~definition~of~this~command.
+}
+% \end{macrocode}
+%
+% \subsubsection{Row and Column Vectors}
+% We begin with the row and column vector functions.
+% As with the other document level commands, we guard the definitions
+% with a key value option, so that the user can disable them.
+% \begin{macrocode}
+\bool_if:nTF \l_@@_predef_crvector_bool
+{
+% \end{macrocode}
+% \begin{macro}[updated=2024-08-20,]{
+% \cvector,
+% \rvector,
+% \smallcvector,
+% \smallrvector
+% }
+% First we define the document level command for the bare column vector
+% \begin{macrocode}
+\cs_if_free:NTF \cvector
+{
+ \NewDocumentCommand \cvector { o m }
+ {
+ \group_begin:
+ \tl_if_novalue:nF {#1}
+ {
+ \keys_set:nn { moremath / matrix } {#1}
+ }
+ \moremath_column_vector:Vn \l_@@_matrix_delim_tl {#2}
+ \group_end:
+ }
+}{
+ % issue a warning message if the csname is already taken.
+ \msg_warning:nnn { moremath } { matrix / already-defined-doc-cmd-skip }
+ {
+ \cvector
+ }
+} % \cs_if_free:NTF \cvector
+% \end{macrocode}
+% and the row vector.
+% \begin{macrocode}
+\cs_if_free:NTF \rvector
+{
+ \NewDocumentCommand \rvector { o m }
+ {
+ \group_begin:
+ \tl_if_novalue:nF {#1}
+ {
+ \keys_set:nn { moremath / matrix } {#1}
+ }
+ \moremath_row_vector:Vn \l_@@_matrix_delim_tl {#2}
+ \group_end:
+ }
+}{
+ % warn if csname is already taken
+ \msg_warning:nnn { moremath } { matrix / already-defined-doc-cmd-skip}
+ {
+ \rvector
+ }
+} % \cs_if_free:NTF \rvector
+% \end{macrocode}
+% Then we define the smaller inline versions of those commands.
+% \begin{macrocode}
+\cs_if_free:NTF \smallcvector
+{
+ \NewDocumentCommand \smallcvector { o m }
+ {
+ \group_begin:
+ \tl_if_novalue:nF {#1}
+ {
+ \keys_set:nn {moremath / matrix} {#1}
+ }
+ \moremath_column_smallvector:Vn \l_@@_matrix_delim_tl {#2}
+ \group_end:
+ }
+}{
+ % Issue a warning message if the csname is already taken
+ \msg_warning:nnn { moremath } { matrix / already-defined-doc-cmd-skip }
+ {
+ \smallcvector
+ }
+} % \cs_if_free:NTF \smallcvector
+
+\cs_if_free:NTF \smallrvector
+{
+ \NewDocumentCommand \smallrvector { o m }
+ {
+ \group_begin:
+ \tl_if_novalue:nF {#1}
+ {
+ \keys_set:nn { moremath / matrix } {#1}
+ }
+ \moremath_row_smallvector:Vn \l_@@_matrix_delim_tl {#2}
+ \group_end:
+ }
+}{
+ % warn if csname is taken
+ \msg_warning:nnn { moremath } { matrix / already-defined-doc-cmd-skip }
+ {
+ \smallrvector
+ }
+}
+% \end{macrocode}
+% \changes{v0.1.0}{\GetVersionDate{v0.1.0}}{%
+% Added commands producing row and column vectors,
+% including inline math versions.
+% }
+% \changes{v0.5.0}{\GetVersionDate{v0.5.0}}{
+% Use "Vn" versions of functions when passing variables around.
+% }
+% \end{macro}
+%
+% \paragraph{Commands with Pre-defined Delimiters}
+% Next we define several shorthands to for the commonly used delimiters,
+% to avoid code duplication, we first create some helper functions which
+% define those functions.
+% \begin{macro}[updated=2024-08-20]{
+% \@@_new_vector_shorth_doc_cmd:NNn
+% }
+% The function \cs{@@_new_vector_shorth_doc_cmd} creates a new vector shorthand,
+% command. It takes three arguments:
+% \begin{arguments}
+% \item The \meta{csname} to be defined.
+% \item The \meta{function} to use for this shorthand.
+%
+% This should be one of the
+% \cs[no-index]{moremath_\meta{type}_\meta{size}vector:Vn}
+% like commands.
+%
+% \item The \meta{delimiter} to use.
+%
+% Usually one of |p|, |b|, |B|, |v|, |V|.
+% \end{arguments}
+% \begin{macrocode}
+\cs_new_protected:Nn \@@_new_vector_shorth_doc_cmd:NNn
+{
+ \cs_if_free:NTF #1
+ {
+ \NewDocumentCommand #1 { o m }
+ {
+ \group_begin:
+ % set the delimiter key pre-set for this function
+ \keys_set:nn {moremath / matrix } {delimiter = #3}
+ \tl_if_novalue:nF {##1}
+ {
+ \keys_set:nn {moremath / matrix } {##1}
+ }
+ #2 \l_@@_matrix_delim_tl {##2}
+ \group_end:
+ }
+ }{
+ % warn if csname is taken
+ \msg_warning:nnn { moremath } { matrix / already-defined-doc-cmd-skip }
+ {
+ #1
+ }
+ }
+}
+% \end{macrocode}
+% \changes{v0.5.0}{\GetVersionDate{v0.5.0}}{
+% Require function with "Vn" signature to pass variable correctly.
+% }
+% \end{macro}
+%
+% \begin{macro}[updated=2024-08-20]{
+% \pcvector,
+% \bcvector,
+% \Bcvector,
+% \vcvector,
+% \Vcvector,
+% \prvector,
+% \brvector,
+% \Brvector,
+% \vrvector,
+% \Vrvector,
+% }
+% Now we define shorthands for all of the matrix types so that the user
+% does not have to specify |delimiter=|\meta{delim} every time.
+% We begin with the column vector.
+% \begin{macrocode}
+% parenthesis
+\@@_new_vector_shorth_doc_cmd:NNn \pcvector \moremath_column_vector:Vn {p}
+% brackets
+\@@_new_vector_shorth_doc_cmd:NNn \bcvector \moremath_column_vector:Vn {b}
+% braces
+\@@_new_vector_shorth_doc_cmd:NNn \Bcvector \moremath_column_vector:Vn {B}
+% single vert
+\@@_new_vector_shorth_doc_cmd:NNn \vcvector \moremath_column_vector:Vn {v}
+% double vert
+\@@_new_vector_shorth_doc_cmd:NNn \Vcvector \moremath_column_vector:Vn {V}
+% \end{macrocode}
+% Now to the row vectors.
+% \begin{macrocode}
+% parenthesis
+\@@_new_vector_shorth_doc_cmd:NNn \prvector \moremath_row_vector:Vn {p}
+% brackets
+\@@_new_vector_shorth_doc_cmd:NNn \brvector \moremath_row_vector:Vn {b}
+% braces
+\@@_new_vector_shorth_doc_cmd:NNn \Brvector \moremath_row_vector:Vn {B}
+% single vert
+\@@_new_vector_shorth_doc_cmd:NNn \vrvector \moremath_row_vector:Vn {v}
+% double vert
+\@@_new_vector_shorth_doc_cmd:NNn \Vrvector \moremath_row_vector:Vn {V}
+% \end{macrocode}
+% \changes{v0.1.0}{\GetVersionDate{v0.1.0}}{
+% Added commands for row and column vectors with predefined delimiters.
+% }
+% \changes{v0.5.0}{\GetVersionDate{v0.5.0}}{
+% Use functions with "Vn" signature instead of "nn"
+% }
+% \end{macro}
+%
+% \begin{macro}[updated=2024-08-20]{
+% \psmallcvector,
+% \bsmallcvector,
+% \Bsmallcvector,
+% \vsmallcvector,
+% \Vsmallcvector,
+% \psmallrvector,
+% \bsmallrvector,
+% \Bsmallrvector,
+% \vsmallrvector,
+% \Vsmallrvector
+% }
+% We also define shorthands for the \cs{shortcvector} and \cs{shortrvector}
+% versions.
+% \begin{macrocode}
+% column vectors
+% parenthesis
+\@@_new_vector_shorth_doc_cmd:NNn \psmallcvector \moremath_column_smallvector:Vn
+ {p}
+% brackets
+\@@_new_vector_shorth_doc_cmd:NNn \bsmallcvector \moremath_column_smallvector:Vn
+ {b}
+% braces
+\@@_new_vector_shorth_doc_cmd:NNn \Bsmallcvector \moremath_column_smallvector:Vn
+ {B}
+% single vert
+\@@_new_vector_shorth_doc_cmd:NNn \vsmallcvector \moremath_column_smallvector:Vn
+ {v}
+% double vert
+\@@_new_vector_shorth_doc_cmd:NNn \Vsmallcvector \moremath_column_smallvector:Vn
+ {V}
+%
+% row vectors
+% parenthesis
+\@@_new_vector_shorth_doc_cmd:NNn \psmallrvector \moremath_row_smallvector:Vn {p}
+% brackets
+\@@_new_vector_shorth_doc_cmd:NNn \bsmallrvector \moremath_row_smallvector:Vn {b}
+% braces
+\@@_new_vector_shorth_doc_cmd:NNn \Bsmallrvector \moremath_row_smallvector:Vn {B}
+% single vert
+\@@_new_vector_shorth_doc_cmd:NNn \vsmallrvector \moremath_row_smallvector:Vn {v}
+% double vert
+\@@_new_vector_shorth_doc_cmd:NNn \Vsmallrvector \moremath_row_smallvector:Vn {V}
+
+
+}{ % \bool_if:nTF \l_@@_predef_crvector_bool FALSE PATH
+ \msg_info:nnnn {moremath} {load / disabling} {no-crvector}
+ {
+ commands~producing~row~and~column~vectors
+ }
+} % \bool_if:nTF \l_@@_predef_crvector_bool
+% \end{macrocode}
+% \changes{v0.1.0}{\GetVersionDate{v0.1.0}}{
+% Added commands for inline math row and column vectors
+% with predefined delimiters.
+% }
+% \changes{v0.5.0}{\GetVersionDate{v0.5.0}}{
+% Use functions with "Vn" signature instead of "nn"
+% }
+% \end{macro}
+%
+%
+% \subsubsection{(Anti-)diagonal Matrices}
+% Now to the (anti-)diagonal matrix shorthands,
+% these are also guarded by a key value option.
+% \begin{macrocode}
+\bool_if:nTF \l_@@_predef_matrix_bool
+{
+% \end{macrocode}
+% \begin{macro}{
+% \diagmat,
+% \antidiagmat,
+% \smalldiagmat,
+% \smallantidiagmat,
+% }
+% \begin{NOTE}{MI}
+% Say something like we begin with some commands producing a matrix that
+% is not necessarily delimited.
+% \end{NOTE}
+% \begin{macrocode}
+\cs_if_free:NTF \diagmat
+{
+ \NewDocumentCommand \diagmat { o m }
+ {
+ \group_begin:
+ \tl_if_novalue:nF {#1}
+ {
+ \keys_set:nn { moremath / matrix } {#1}
+ }
+ \moremath_diagonal_matrix:Vn \l_@@_matrix_delim_tl {#2}
+ \group_end:
+ }
+}{
+ \msg_warning:nnn {moremath} {matrix / already-defined-doc-cmd-skip}
+ {
+ \diagmat
+ }
+} % \cs_if_free:nTF \diagmat
+
+\cs_if_free:NTF \antidiagmat
+{
+ \NewDocumentCommand \antidiagmat { o m }
+ {
+ \group_begin:
+ \tl_if_novalue:nF {#1}
+ {
+ \keys_set:nn { moremath / matrix } {#1}
+ }
+ \moremath_antidiagonal_matrix:Vn \l_@@_matrix_delim_tl {#2}
+ \group_end:
+ }
+}{
+ \msg_warning:nnn { moremath } { matrix / already-defined-doc-cmd-skip }
+ {
+ \antidiagmat
+ }
+} % \cs_if_free:nTF \antidiagmat
+
+\cs_if_free:NTF \smalldiagmat
+{
+ \NewDocumentCommand \smalldiagmat { o m }
+ {
+ \group_begin:
+ \tl_if_novalue:nF {#1}
+ {
+ \keys_set:nn { moremath / matrix } {#1}
+ }
+ \moremath_diagonal_smallmatrix:Vn \l_@@_matrix_delim_tl {#2}
+ \group_end:
+ }
+}{
+ \msg_warning:nnn { moremath } { matrix / already-defined-doc-cmd-skip }
+ {
+ \smalldiagmat
+ }
+}
+
+\cs_if_free:NTF \smallantidiagmat
+{
+ \NewDocumentCommand \smallantidiagmat { o m }
+ {
+ \group_begin:
+ \tl_if_novalue:nF {#1}
+ {
+ \keys_set:nn { moremath / matrix } {#1}
+ }
+ \moremath_antidiagonal_smallmatrix:Vn \l_@@_matrix_delim_tl {#2}
+ \group_end:
+ }
+}{
+ \msg_warning:nnn { moremath } { matrix / already-defined-doc-cmd-skip }
+ {
+ \smallantidiagmat
+ }
+}
+% \end{macrocode}
+% \changes{v0.1.0}{\GetVersionDate{v0.1.0}}{%
+% Added commands producing (anti-)diagonal matrices, including inline math
+% versions.
+% }
+% \end{macro}
+%
+% \paragraph{(Anti-)diagonal Matrices with Pre-defined Delimiters}
+% As it is sort of cumbersome to always specify the delimiter key,
+% we also provide commands with pre-defined delimiters.
+% \begin{macro}{
+% \@@_new_matrix_shorth_doc_cmd:NNn
+% }
+% To provide several shorthands for delimited matrices,
+% we use a helper function to avoid code duplication.
+% \cs{@@_new_matrix_shorth_doc_cmd:NNn} takes three arguments:
+% \begin{arguments}
+% \item The \meta{csname} to define
+% \item The \meta{csname} of the matrix function to use,
+% which should have the signature |Vn|.
+% \item The \enquote{predefined} delimiter of this version
+% \end{arguments}
+% \begin{macrocode}
+\cs_new_protected:Nn \@@_new_matrix_shorth_doc_cmd:NNn
+{
+ \cs_if_free:NTF #1
+ {
+ \NewDocumentCommand #1 { o m }
+ {
+ \group_begin:
+ \tl_if_empty:nF {#3}
+ {
+ \keys_set:nn { moremath / matrix }
+ {
+ delimiter = #3
+ }
+ } % \tl_if_empty:nF {#3}
+ \tl_if_novalue:nF {##1}
+ {
+ \keys_set:nn { moremath / matrix } {##1}
+ }
+ #2 \l_@@_matrix_delim_tl {##2}
+ \group_end:
+ }
+ }{
+ \msg_warning:nnn { moremath } { matrix / already-defined-doc-cmd-skip }
+ {
+ #1
+ }
+ }
+}
+% \end{macrocode}
+% \end{macro}
+%
+% We now define the shorthand commands with predefined delimiters.
+% \begin{macro}{
+% \pdiagmat,
+% \bdiagmat,
+% \Bdiagmat,
+% \vdiagmat,
+% \Vdiagmat,
+% }
+% We begin with the regular diagonal matrix
+% \begin{macrocode}
+\@@_new_matrix_shorth_doc_cmd:NNn \pdiagmat \moremath_diagonal_matrix:Vn {p}
+\@@_new_matrix_shorth_doc_cmd:NNn \bdiagmat \moremath_diagonal_matrix:Vn {b}
+\@@_new_matrix_shorth_doc_cmd:NNn \Bdiagmat \moremath_diagonal_matrix:Vn {B}
+\@@_new_matrix_shorth_doc_cmd:NNn \vdiagmat \moremath_diagonal_matrix:Vn {v}
+\@@_new_matrix_shorth_doc_cmd:NNn \Vdiagmat \moremath_diagonal_matrix:Vn {V}
+% \end{macrocode}
+% \changes{v0.1.0}{\GetVersionDate{v0.1.0}}{
+% Added commands for delimited diagonal matrices.
+% }
+% \end{macro}
+% \begin{macro}{
+% \pantidiagmat,
+% \bantidiagmat,
+% \Bantidiagmat,
+% \vantidiagmat,
+% \Vantidiagmat,
+% }
+% Now for the anti-diagonal matrix commands.
+% \begin{macrocode}
+\@@_new_matrix_shorth_doc_cmd:NNn \pantidiagmat
+ \moremath_antidiagonal_matrix:Vn {p}
+\@@_new_matrix_shorth_doc_cmd:NNn \bantidiagmat
+ \moremath_antidiagonal_matrix:Vn {b}
+\@@_new_matrix_shorth_doc_cmd:NNn \Bantidiagmat
+ \moremath_antidiagonal_matrix:Vn {B}
+\@@_new_matrix_shorth_doc_cmd:NNn \vantidiagmat
+ \moremath_antidiagonal_matrix:Vn {v}
+\@@_new_matrix_shorth_doc_cmd:NNn \Vantidiagmat
+ \moremath_antidiagonal_matrix:Vn {V}
+% \end{macrocode}
+% \changes{v0.1.0}{\GetVersionDate{v0.1.0}}{
+% Added commands for delimited antidiagonal matrices.
+% }
+% \end{macro}
+%
+% \begin{macro}{
+% \psmalldiagmat,
+% \bsmalldiagmat,
+% \Bsmalldiagmat,
+% \vsmalldiagmat,
+% \Vsmalldiagmat,
+% }
+% We continue with the inline math versions based on the \env{smallmatrix*}
+% environment.
+% \begin{macrocode}
+\@@_new_matrix_shorth_doc_cmd:NNn \psmalldiagmat
+ \moremath_diagonal_smallmatrix:Vn {p}
+\@@_new_matrix_shorth_doc_cmd:NNn \bsmalldiagmat
+ \moremath_diagonal_smallmatrix:Vn {b}
+\@@_new_matrix_shorth_doc_cmd:NNn \Bsmalldiagmat
+ \moremath_diagonal_smallmatrix:Vn {B}
+\@@_new_matrix_shorth_doc_cmd:NNn \vsmalldiagmat
+ \moremath_diagonal_smallmatrix:Vn {v}
+\@@_new_matrix_shorth_doc_cmd:NNn \Vsmalldiagmat
+ \moremath_diagonal_smallmatrix:Vn {V}
+% \end{macrocode}
+% \changes{v0.1.0}{\GetVersionDate{v0.1.0}}{
+% Added commands for delimited diagonal matrices suitable for inline math.
+% }
+% \end{macro}
+% \begin{macro}{
+% \psmallantidiagmat,
+% \bsmallantidiagmat,
+% \Bsmallantidiagmat,
+% \vsmallantidiagmat,
+% \Vsmallantidiagmat,
+% }
+% We provide also anti-diagonal versions of the small matrices.
+% \begin{macrocode}
+\@@_new_matrix_shorth_doc_cmd:NNn \psmallantidiagmat
+ \moremath_antidiagonal_smallmatrix:Vn {p}
+\@@_new_matrix_shorth_doc_cmd:NNn \bsmallantidiagmat
+ \moremath_antidiagonal_smallmatrix:Vn {b}
+\@@_new_matrix_shorth_doc_cmd:NNn \Bsmallantidiagmat
+ \moremath_antidiagonal_smallmatrix:Vn {B}
+\@@_new_matrix_shorth_doc_cmd:NNn \vsmallantidiagmat
+ \moremath_antidiagonal_smallmatrix:Vn {v}
+\@@_new_matrix_shorth_doc_cmd:NNn \Vsmallantidiagmat
+ \moremath_antidiagonal_smallmatrix:Vn {V}
+% \end{macrocode}
+% \changes{v0.1.0}{\GetVersionDate{v0.1.0}}{
+% Added commands for delimited anti-diagonal matrices suitable for inline math.
+% }
+% \end{macro}
+%
+% \subsubsection{Identity Matrices}
+% We also provide document level commands for producing an identity matrix.
+% These commands are also guarded by the same variable as the other matrix commands
+% (\cs{l_@@_predef_matrix_bool}).
+%
+% \begin{macro}{
+% \idmat,
+% \smallidmat,
+% }
+% We provide two document level commands for producing the identiy matrix,
+% one for inline math mode and one for display math mode.
+%
+% We start with the display math mode version.
+% \begin{macrocode}
+\cs_if_free:NTF \idmat
+{
+ \NewDocumentCommand \idmat { o m }
+ {
+ \group_begin:
+ \tl_if_novalue:nF {#1}
+ {
+ \keys_set:nn { moremath / matrix } {#1}
+ }
+ \moremath_id_matrix:n {#2}
+ \group_end:
+ }
+}{ % \cs_if_free:NTF \idmat FALSE BRANCH
+ \msg_warning:nnn { moremath } { matrix / already-defined-doc-cmd-skip }
+ {\idmat}
+}
+% \end{macrocode}
+% Afterwards we continue with the inline math mode version.
+% \begin{macrocode}
+\cs_if_free:NTF \smallidmat
+{
+ \NewDocumentCommand \smallidmat { o m }
+ {
+ \group_begin:
+ \tl_if_novalue:nF {#1}
+ {
+ \keys_set:nn { moremath / matrix } {#1}
+ }
+ \moremath_id_smallmatrix:n {#2}
+ \group_end:
+ }
+}{ % \cs_if_free:NTF \smallidmat FALSE BRANCH
+ \msg_warning:nnn { moremath } { matrix / already-defined-doc-cmd-skip }
+ {\smallidmat}
+}
+% \end{macrocode}
+% \changes{v0.2.0}{\GetVersionDate{v0.2.0}}{%
+% Added \cs{idmat} and \cs{smallidmat} document level commands.
+% }
+% \end{macro}
+%
+% \paragraph{Identity Matrices with Pre-defined Delimiters}
+% We also define shorthands for the commonly used delimiters around matrices,
+% to avoid code duplication, we first declare a helper function for this.
+% \begin{macro}{
+% \@@_new_id_matrix_doc_cmd:NNn
+% }
+% This function creates a new document level command for an identity matrix like
+% command.
+% It allows pre-setting \meta{kv~opts}.
+% The function takes three arguments.
+% \begin{arguments}
+% \item The \meta{csname} of the document level command to define
+%
+% \item The \meta{csname} of the function to use
+%
+% This is indented to be one of \cs{moremath_id_matrix:n} or
+% \cs{moremath_id_smallmatrix:n}
+%
+% \item \meta{kv~opts} to preset in the "moremath / matrix" namespace
+% for this command
+%
+% This is meant to be used for pre-setting the key "delimiter".
+% \end{arguments}
+% \begin{macrocode}
+\cs_new_protected:Nn \@@_new_id_matrix_doc_cmd:NNn
+{
+ \cs_if_free:NTF #1
+ {
+ \NewDocumentCommand #1 { o m }
+ {
+ \group_begin:
+ \tl_if_empty:nF {#3}
+ {
+ \keys_set:nn { moremath / matrix } {#3}
+ }
+ \tl_if_novalue:nF {##1}
+ {
+ \keys_set:nn { moremath / matrix } {##1}
+ }
+ #2 {##2}
+ \group_end:
+ }
+ }{ % \cs_if_free:NTF #1 FALSE BRANCH
+ \msg_warning:nnn { moremath } { matrix / already-defined-doc-cmd-skip }
+ {#1}
+ }
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{
+% \pidmat,
+% \bidmat,
+% \Bidmat,
+% \vidmat,
+% \Vidmat
+% }
+% We begin with the display math versions,
+% starting with the version delimited by parenthesis,
+% \begin{macrocode}
+\@@_new_id_matrix_doc_cmd:NNn \pidmat \moremath_id_matrix:n { delimiter = p }
+% \end{macrocode}
+% continue with the bracketed version,
+% \begin{macrocode}
+\@@_new_id_matrix_doc_cmd:NNn \bidmat \moremath_id_matrix:n { delimiter = b }
+% \end{macrocode}
+% the version using braces,
+% \begin{macrocode}
+\@@_new_id_matrix_doc_cmd:NNn \Bidmat \moremath_id_matrix:n { delimiter = B }
+% \end{macrocode}
+% single vertical lines,
+% \begin{macrocode}
+\@@_new_id_matrix_doc_cmd:NNn \vidmat \moremath_id_matrix:n { delimiter = v }
+% \end{macrocode}
+% and finally double vertical lines.
+% \begin{macrocode}
+\@@_new_id_matrix_doc_cmd:NNn \Vidmat \moremath_id_matrix:n { delimiter = V }
+% \end{macrocode}
+%
+% \changes{v0.2.0}{\GetVersionDate{v0.2.0}}{
+% Added document level commands \cs{pidmat}, \cs{bidmat}, \cs{Bidmat},
+% \cs{vidmat}, and \cs{Vidmat}.
+% }
+% \end{macro}
+%
+% \begin{macro}{
+% \psmallidmat,
+% \bsmallidmat,
+% \Bsmallidmat,
+% \vsmallidmat,
+% \Vsmallidmat,
+% }
+% Now we also define shorthands for inline math mode.
+% We start again defining the version using parenthesis,
+% \begin{macrocode}
+\@@_new_id_matrix_doc_cmd:NNn \psmallidmat \moremath_id_smallmatrix:n
+ { delimiter = p }
+% \end{macrocode}
+% then brackets,
+% \begin{macrocode}
+\@@_new_id_matrix_doc_cmd:NNn \bsmallidmat \moremath_id_smallmatrix:n
+ { delimiter = b }
+% \end{macrocode}
+% then braces,
+% \begin{macrocode}
+\@@_new_id_matrix_doc_cmd:NNn \Bsmallidmat \moremath_id_smallmatrix:n
+ { delimiter = B }
+% \end{macrocode}
+% followed by single vertical lines,
+% \begin{macrocode}
+\@@_new_id_matrix_doc_cmd:NNn \vsmallidmat \moremath_id_smallmatrix:n
+ { delimiter = v }
+% \end{macrocode}
+% and finally double vertical lines.
+% \begin{macrocode}
+\@@_new_id_matrix_doc_cmd:NNn \Vsmallidmat \moremath_id_smallmatrix:n
+ { delimiter = V }
+% \end{macrocode}
+% \changes{v0.2.0}{\GetVersionDate{v0.2.0}}{%
+% Added document level commands \cs{psmallidmat}, \cs{bsmallidmat},
+% \cs{Bsmallidmat}, \cs{vsmallidmat} and \cs{Vsmallidmat}.
+% }
+% \end{macro}
+%
+% \begin{macrocode}
+}{ % \bool_if:nTF \l_@@_predef_matrix_bool FALSE BRANCH
+ \msg_info:nnnn {moremath} { load / disabling } { no-matrix }
+ {
+ (anti-)diagonal~matrix~commands
+ }
+} % \bool_if:nTF \l_@@_predef_matrix_bool
+% \end{macrocode}
+%
+%
+% \section{Shorthand Macros for Absolute Value and Norm}
+% \label{sec:impl-abs-shorthands}
+%
+% We first declare another warning message to inform the user of the case that,
+% the \meta{csnames} are already taken.
+% \begin{macrocode}
+\msg_new:nnnn { moremath } { abs-shorth / csname-already-defined-skip }
+{
+ Control~sequence~'#1'~is~already~defined.\\
+ Skipping~declaration~of~paired~delimiter~\msg_line_context:.\\
+ Use~package~option~'no-abs-shorthands'~to~disable~the~paired\\
+ delimiter~shorthands.
+}{
+ The~control~sequence~'#1'~has~already~been\\
+ defined~by~something~else.\\
+ I~am~refusing~to~overwrite~its~existing~definition~and~instead~avoid\\
+ declaring~a~paired~delimiter.\\
+}
+% \end{macrocode}
+%
+%
+% As with the other parts these macros may be conditionally disabled.
+% \begin{macrocode}
+\bool_if:NTF \l_@@_predef_abs_bool
+{
+% \end{macrocode}
+% \begin{macro}{\abs,\norm}
+% These macros provide shorthands for \(\abs{\meta{content}}\)
+% and \(\norm{\meta{content}}\).
+% \begin{macrocode}
+\cs_if_free:NTF \abs
+{
+ \DeclarePairedDelimiter \abs {\lvert} {\rvert}
+}{
+ % warn if the csname is taken
+ \msg_warning:nnn { moremath } { abs-shorth / csname-already-defined-skip }
+ {\abs}
+} % \cs_if_free:NTF \abs
+
+\cs_if_free:NTF \norm
+{
+ \DeclarePairedDelimiter \norm {\lVert} {\rVert}
+}{
+ % warn if csname is already taken
+ \msg_warning:nnn { moremath } { abs-shorth / csname-already-defined-skip }
+ {\norm}
+} % \cs_if_free:NTF
+% \end{macrocode}
+% \changes{v0.1.0}{\GetVersionDate{v0.1.0}}{%
+% Added shorthands for absolute value and norm.
+% }
+% \end{macro}
+%
+% \begin{macrocode}
+}{
+ \msg_info:nnnn {moremath} {load / disabling} {no-abs-shorthands}
+ {
+ '\abs'~and~'\norm'~macros
+ }
+} % End of the conditional
+% \end{macrocode}
+%
+% \iffalse debug-switch
+%\debug_off:n {all}
+% \fi
+% \begin{macrocode}
+%</package>
+% \end{macrocode}
+% \end{implementation}
+%
+% \section*{Copyright and License}
+% \addcontentsline{toc}{section}{Copyright and License}
+% \label{sec:license}
+%
+% The following copyright notice applies to the \pkg{moremath} package:
+%
+% \begin{quote}
+% Copyright \textcopyright{} 2024 Marcel Ilg
+%
+% This work may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% \url{https://www.latex-project.org/lppl.txt}
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2005/12/01 or later.
+%
+% This work has the LPPL maintenance status \enquote{maintained}.
+%
+% The Current Maintainer of this work is Marcel Ilg.
+%
+% This work consists of the files listed in \file{MANIFEST.md}.
+% \end{quote}
+%
+% \noindent The file \file{MANIFEST.md} has to be distributed together with the
+% package.
+%
+%
+% \printbibliography[heading=bibintoc]
+% \PrintChanges
+% \PrintIndex
diff --git a/Master/texmf-dist/source/latex/moremath/moremath.ins b/Master/texmf-dist/source/latex/moremath/moremath.ins
new file mode 100644
index 00000000000..f04f2b04b20
--- /dev/null
+++ b/Master/texmf-dist/source/latex/moremath/moremath.ins
@@ -0,0 +1,66 @@
+%%
+%% Copyright (C) 2024 Marcel Ilg
+%%
+%% This work may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3
+%% 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.3 or later is part of all distributions of LaTeX
+%% version 2005/12/01 or later.
+%%
+%% This work has the LPPL maintenance status ‘maintained’.
+%%
+%% The Current Maintainer of this work is Marcel Ilg.
+%%
+%% This work consists of the files listed in MANIFEST.md.
+
+\input docstrip
+
+\usedir{tex/latex/moremath}
+
+\keepsilent
+
+\preamble
+
+This is a generated file.
+
+
+Copyright (C) 2024 Marcel Ilg
+
+This work may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+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.3 or later is part of all distributions of LaTeX
+version 2005/12/01 or later.
+
+This work has the LPPL maintenance status ‘maintained’.
+
+The Current Maintainer of this work is Marcel Ilg.
+
+This work consists of the files listed in MANIFEST.md.
+
+\endpreamble
+
+\generate{\file{moremath.sty}{\from{moremath.dtx}{package}}}
+
+\obeyspaces
+\Msg{***************************************************************************}
+\Msg{*}
+\Msg{* To finish the installation you have to move the following file into a}
+\Msg{* directory searched by TeX:}
+\Msg{*}
+\Msg{* moremath.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the file moremath.dtx through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing!}
+\Msg{*}
+\Msg{***************************************************************************}
+\endbatchfile
diff --git a/Master/texmf-dist/source/latex/nicematrix/nicematrix-code.dtx b/Master/texmf-dist/source/latex/nicematrix/nicematrix-code.dtx
index 059c4b2ca6c..58a841a6553 100644
--- a/Master/texmf-dist/source/latex/nicematrix/nicematrix-code.dtx
+++ b/Master/texmf-dist/source/latex/nicematrix/nicematrix-code.dtx
@@ -1,6 +1,6 @@
% \iffalse meta-comment
%
-% This file should be compiled with $xelatex$.
+% This file should be compiled with $lualatex$.
%
% Copyright (C) 2018-2024 by F. Pantigny
% ------------------------------------------
@@ -17,8 +17,8 @@
%
% \fi
% \iffalse
-\def\myfileversion{6.28}
-\def\myfiledate{2024/05/29}
+\def\myfileversion{6.28c}
+\def\myfiledate{2024/08/22}
%
%
%<*batchfile>
@@ -155,9 +155,11 @@ version 2005/12/01 or later.
% In the version 2.6a of \pkg{array}, important modifications have been done for
% the Tagging Project.
% \begin{macrocode}
-\bool_const:Nn \c_@@_tagging_array_bool { \cs_if_exist_p:N \ar@ialign }
+\bool_const:Nn \c_@@_tagging_array_bool
+ { \IfPackageAtLeastTF { array } { 2024/05/01 } \c_true_bool \c_false_bool }
\bool_const:Nn \c_@@_testphase_table_bool
- { \IfPackageLoadedTF { latex-lab-testphase-table } \c_true_bool \c_false_bool }
+ { \IfPackageLoadedTF { latex-lab-testphase-table } \c_true_bool \c_false_bool
+ }
% \end{macrocode}
%
%
@@ -287,19 +289,27 @@ version 2005/12/01 or later.
%
% \bigskip
% \begin{macrocode}
-\cs_new_protected:Npn \@@_security_test_i:w \ignorespaces #1
+\bool_if:NTF \c_@@_tagging_array_bool
{
- \peek_meaning:NF \unskip { \@@_error:n { Internal~error } }
- #1
+ \cs_new_protected:Npn \@@_security_test_i:w \ignorespaces #1
+ {
+ \peek_meaning:NF \textonly@unskip { \@@_error:n { Internal~error } }
+ #1
+ }
+ }
+ {
+ \cs_new_protected:Npn \@@_security_test_i:w \ignorespaces #1
+ {
+ \peek_meaning:NF \unskip { \@@_error:n { Internal~error } }
+ #1
+ }
}
% \end{macrocode}
%
% \bigskip
% Here, the box |\l_tmpa_box| will be used as sandbox to take our security test.
-% This code has been modified in version 6.18 (see question 682891 on TeX
-% StackExchange).
% \begin{macrocode}
-\hook_gput_code:nnn { begindocument / after } { . }
+\hook_gput_code:nnn { begindocument / end } { . }
{
\IfPackageLoadedTF { mdwtab }
{ \@@_fatal:n { mdwtab~loaded } }
@@ -385,6 +395,7 @@ version 2005/12/01 or later.
\tl_const:Nn \c_@@_dot_tl { . }
\tl_const:Nn \c_@@_default_tl { default }
\tl_const:Nn \c_@@_star_tl { * }
+\str_const:Nn \c_@@_star_str { * }
\str_const:Nn \c_@@_r_str { r }
\str_const:Nn \c_@@_c_str { c }
\str_const:Nn \c_@@_l_str { l }
@@ -1489,10 +1500,11 @@ version 2005/12/01 or later.
% \end{macrocode}
%
% \medskip
-% For the vertical position, the possible values are |c|, |t| and |b|.
+% For the vertical position, the possible values are |c|, |t|, |b|, |T| and |B|
+% (but |\l_@@_vpos_block_str| will remain empty if the user doesn't use a key
+% for the vertical position).
% \begin{macrocode}
\str_new:N \l_@@_vpos_block_str
-\str_set:Nn \l_@@_vpos_block_str { c }
% \end{macrocode}
%
%
@@ -1765,6 +1777,14 @@ version 2005/12/01 or later.
\newcounter { tabularnote }
% \end{macrocode}
%
+% We want to avoid error messages for duplicate labels when the package
+% \pkg{hyperref} is used. That's why we will count all the tabular notes of the
+% whole document with |\g_@@_tabularnote_int|.
+% \begin{macrocode}
+\int_new:N \g_@@_tabularnote_int
+\cs_set:Npn \theHtabularnote { \int_use:N \g_@@_tabularnote_int }
+% \end{macrocode}
+%
% \begin{macrocode}
\seq_new:N \g_@@_notes_seq
\seq_new:N \g_@@_notes_in_caption_seq
@@ -1990,7 +2010,12 @@ version 2005/12/01 or later.
% \begin{macrocode}
\int_gdecr:N \c@tabularnote
\int_set_eq:NN \l_tmpa_int \c@tabularnote
- \refstepcounter { tabularnote }
+% \end{macrocode}
+% The following line is only to avoid error messages for multipy defined labels
+% when the package \pkg{hyperref} is used.
+% \begin{macrocode}
+ \int_gincr:N \g_@@_tabularnote_int
+ \refstepcounter { tabularnote }
\int_compare:nNnT \l_tmpa_int = \c@tabularnote
{ \int_gincr:N \c@tabularnote }
\seq_clear:N \l_@@_notes_labels_seq
@@ -2424,7 +2449,7 @@ version 2005/12/01 or later.
%
% \bigskip
% \begin{macrocode}
-\keys_define:nn { NiceMatrix / xdots }
+\keys_define:nn { nicematrix / xdots }
{
shorten-start .code:n =
\hook_gput_code:nnn { begindocument } { . }
@@ -2484,7 +2509,7 @@ version 2005/12/01 or later.
%
% \bigskip
% \begin{macrocode}
-\keys_define:nn { NiceMatrix / rules }
+\keys_define:nn { nicematrix / rules }
{
color .tl_set:N = \l_@@_rules_color_tl ,
color .value_required:n = true ,
@@ -2496,14 +2521,15 @@ version 2005/12/01 or later.
%
%
% \bigskip
-% First, we define a set of keys ``|NiceMatrix / Global|'' which will be used
+% First, we define a set of keys ``|nicematrix / Global|'' which will be used
% (with the mechanism of |.inherit:n|) by other sets of keys.
%
% \begin{macrocode}
-\keys_define:nn { NiceMatrix / Global }
+\keys_define:nn { nicematrix / Global }
{
ampersand-in-blocks .bool_set:N = \l_@@_amp_in_blocks_bool ,
ampersand-in-blocks .default:n = true ,
+ &-in-blocks .meta:n = ampersand-in-blocks ,
no-cell-nodes .code:n =
\cs_set_protected:Npn \@@_node_for_cell:
{ \box_use_drop:N \l_@@_cell_box } ,
@@ -2511,7 +2537,7 @@ version 2005/12/01 or later.
rounded-corners .dim_set:N = \l_@@_tab_rounded_corners_dim ,
rounded-corners .default:n = 4 pt ,
custom-line .code:n = \@@_custom_line:n { #1 } ,
- rules .code:n = \keys_set:nn { NiceMatrix / rules } { #1 } ,
+ rules .code:n = \keys_set:nn { nicematrix / rules } { #1 } ,
rules .value_required:n = true ,
standard-cline .bool_set:N = \l_@@_standard_cline_bool ,
standard-cline .default:n = true ,
@@ -2525,7 +2551,7 @@ version 2005/12/01 or later.
cell-space-bottom-limit = #1 ,
} ,
cell-space-limits .value_required:n = true ,
- xdots .code:n = \keys_set:nn { NiceMatrix / xdots } { #1 } ,
+ xdots .code:n = \keys_set:nn { nicematrix / xdots } { #1 } ,
light-syntax .code:n =
\bool_set_true:N \l_@@_light_syntax_bool
\bool_set_false:N \l_@@_light_syntax_expanded_bool ,
@@ -2618,7 +2644,7 @@ version 2005/12/01 or later.
% We define a set of keys used by the environments of \pkg{nicematrix} (but not
% by the command |\NiceMatrixOptions|).
% \begin{macrocode}
-\keys_define:nn { NiceMatrix / Env }
+\keys_define:nn { nicematrix / environments }
{
corners .clist_set:N = \l_@@_corners_clist ,
corners .default:n = { NW , SW , NE , SE } ,
@@ -2672,7 +2698,7 @@ version 2005/12/01 or later.
% \end{macrocode}
%
% \begin{macrocode}
-\keys_define:nn { NiceMatrix / notes }
+\keys_define:nn { nicematrix / notes }
{
para .bool_set:N = \l_@@_notes_para_bool ,
para .default:n = true ,
@@ -2715,7 +2741,7 @@ version 2005/12/01 or later.
% \end{macrocode}
%
% \begin{macrocode}
-\keys_define:nn { NiceMatrix / delimiters }
+\keys_define:nn { nicematrix / delimiters }
{
max-width .bool_set:N = \l_@@_delimiters_max_width_bool ,
max-width .default:n = true ,
@@ -2728,63 +2754,63 @@ version 2005/12/01 or later.
% We begin the construction of the major sets of keys (used by the different
% user commands and environments).
% \begin{macrocode}
-\keys_define:nn { NiceMatrix }
+\keys_define:nn { nicematrix }
{
NiceMatrixOptions .inherit:n =
- { NiceMatrix / Global } ,
- NiceMatrixOptions / xdots .inherit:n = NiceMatrix / xdots ,
- NiceMatrixOptions / rules .inherit:n = NiceMatrix / rules ,
- NiceMatrixOptions / notes .inherit:n = NiceMatrix / notes ,
- NiceMatrixOptions / sub-matrix .inherit:n = NiceMatrix / sub-matrix ,
- SubMatrix / rules .inherit:n = NiceMatrix / rules ,
- CodeAfter / xdots .inherit:n = NiceMatrix / xdots ,
- CodeBefore / sub-matrix .inherit:n = NiceMatrix / sub-matrix ,
- CodeAfter / sub-matrix .inherit:n = NiceMatrix / sub-matrix ,
+ { nicematrix / Global } ,
+ NiceMatrixOptions / xdots .inherit:n = nicematrix / xdots ,
+ NiceMatrixOptions / rules .inherit:n = nicematrix / rules ,
+ NiceMatrixOptions / notes .inherit:n = nicematrix / notes ,
+ NiceMatrixOptions / sub-matrix .inherit:n = nicematrix / sub-matrix ,
+ SubMatrix / rules .inherit:n = nicematrix / rules ,
+ CodeAfter / xdots .inherit:n = nicematrix / xdots ,
+ CodeBefore / sub-matrix .inherit:n = nicematrix / sub-matrix ,
+ CodeAfter / sub-matrix .inherit:n = nicematrix / sub-matrix ,
NiceMatrix .inherit:n =
{
- NiceMatrix / Global ,
- NiceMatrix / Env ,
+ nicematrix / Global ,
+ nicematrix / environments ,
} ,
- NiceMatrix / xdots .inherit:n = NiceMatrix / xdots ,
- NiceMatrix / rules .inherit:n = NiceMatrix / rules ,
+ NiceMatrix / xdots .inherit:n = nicematrix / xdots ,
+ NiceMatrix / rules .inherit:n = nicematrix / rules ,
NiceTabular .inherit:n =
{
- NiceMatrix / Global ,
- NiceMatrix / Env
+ nicematrix / Global ,
+ nicematrix / environments
} ,
- NiceTabular / xdots .inherit:n = NiceMatrix / xdots ,
- NiceTabular / rules .inherit:n = NiceMatrix / rules ,
- NiceTabular / notes .inherit:n = NiceMatrix / notes ,
+ NiceTabular / xdots .inherit:n = nicematrix / xdots ,
+ NiceTabular / rules .inherit:n = nicematrix / rules ,
+ NiceTabular / notes .inherit:n = nicematrix / notes ,
NiceArray .inherit:n =
{
- NiceMatrix / Global ,
- NiceMatrix / Env ,
+ nicematrix / Global ,
+ nicematrix / environments ,
} ,
- NiceArray / xdots .inherit:n = NiceMatrix / xdots ,
- NiceArray / rules .inherit:n = NiceMatrix / rules ,
+ NiceArray / xdots .inherit:n = nicematrix / xdots ,
+ NiceArray / rules .inherit:n = nicematrix / rules ,
pNiceArray .inherit:n =
{
- NiceMatrix / Global ,
- NiceMatrix / Env ,
+ nicematrix / Global ,
+ nicematrix / environments ,
} ,
- pNiceArray / xdots .inherit:n = NiceMatrix / xdots ,
- pNiceArray / rules .inherit:n = NiceMatrix / rules ,
+ pNiceArray / xdots .inherit:n = nicematrix / xdots ,
+ pNiceArray / rules .inherit:n = nicematrix / rules ,
}
% \end{macrocode}
%
%
% \bigskip
% We finalise the definition of the set of keys
-% ``|NiceMatrix / NiceMatrixOptions|'' with the options specific to
+% ``|nicematrix / NiceMatrixOptions|'' with the options specific to
% |\NiceMatrixOptions|.
% \begin{macrocode}
-\keys_define:nn { NiceMatrix / NiceMatrixOptions }
+\keys_define:nn { nicematrix / NiceMatrixOptions }
{
delimiters / color .tl_set:N = \l_@@_delimiters_color_tl ,
delimiters / color .value_required:n = true ,
delimiters / max-width .bool_set:N = \l_@@_delimiters_max_width_bool ,
delimiters / max-width .default:n = true ,
- delimiters .code:n = \keys_set:nn { NiceMatrix / delimiters } { #1 } ,
+ delimiters .code:n = \keys_set:nn { nicematrix / delimiters } { #1 } ,
delimiters .value_required:n = true ,
width .dim_set:N = \l_@@_width_dim ,
width .value_required:n = true ,
@@ -2832,9 +2858,9 @@ version 2005/12/01 or later.
allow-duplicate-names .code:n =
\@@_msg_redirect_name:nn { Duplicate~name } { none } ,
allow-duplicate-names .value_forbidden:n = true ,
- notes .code:n = \keys_set:nn { NiceMatrix / notes } { #1 } ,
+ notes .code:n = \keys_set:nn { nicematrix / notes } { #1 } ,
notes .value_required:n = true ,
- sub-matrix .code:n = \keys_set:nn { NiceMatrix / sub-matrix } { #1 } ,
+ sub-matrix .code:n = \keys_set:nn { nicematrix / sub-matrix } { #1 } ,
sub-matrix .value_required:n = true ,
matrix / columns-type .tl_set:N = \l_@@_columns_type_tl ,
matrix / columns-type .value_required:n = true ,
@@ -2852,17 +2878,17 @@ version 2005/12/01 or later.
% current TeX group.
% \begin{macrocode}
\NewDocumentCommand \NiceMatrixOptions { m }
- { \keys_set:nn { NiceMatrix / NiceMatrixOptions } { #1 } }
+ { \keys_set:nn { nicematrix / NiceMatrixOptions } { #1 } }
% \end{macrocode}
%
%
% \bigskip
-% We finalise the definition of the set of keys ``|NiceMatrix / NiceMatrix|''.
+% We finalise the definition of the set of keys ``|nicematrix / NiceMatrix|''.
% That set of keys will be used by |{NiceMatrix}|, |{pNiceMatrix}|,
% |{bNiceMatrix}|, etc.
%
% \begin{macrocode}
-\keys_define:nn { NiceMatrix / NiceMatrix }
+\keys_define:nn { nicematrix / NiceMatrix }
{
last-col .code:n = \tl_if_empty:nTF { #1 }
{
@@ -2878,7 +2904,7 @@ version 2005/12/01 or later.
delimiters / color .value_required:n = true ,
delimiters / max-width .bool_set:N = \l_@@_delimiters_max_width_bool ,
delimiters / max-width .default:n = true ,
- delimiters .code:n = \keys_set:nn { NiceMatrix / delimiters } { #1 } ,
+ delimiters .code:n = \keys_set:nn { nicematrix / delimiters } { #1 } ,
delimiters .value_required:n = true ,
small .bool_set:N = \l_@@_small_bool ,
small .value_forbidden:n = true ,
@@ -2889,11 +2915,11 @@ version 2005/12/01 or later.
%
%
% \bigskip
-% We finalise the definition of the set of keys ``|NiceMatrix / NiceArray|''
+% We finalise the definition of the set of keys ``|nicematrix / NiceArray|''
% with the options specific to |{NiceArray}|.
%
% \begin{macrocode}
-\keys_define:nn { NiceMatrix / NiceArray }
+\keys_define:nn { nicematrix / NiceArray }
{
% \end{macrocode}
%
@@ -2915,7 +2941,7 @@ version 2005/12/01 or later.
%
%
% \begin{macrocode}
-\keys_define:nn { NiceMatrix / pNiceArray }
+\keys_define:nn { nicematrix / pNiceArray }
{
first-col .code:n = \int_zero:N \l_@@_first_col_int ,
last-col .code:n = \tl_if_empty:nF {#1}
@@ -2926,7 +2952,7 @@ version 2005/12/01 or later.
delimiters / color .value_required:n = true ,
delimiters / max-width .bool_set:N = \l_@@_delimiters_max_width_bool ,
delimiters / max-width .default:n = true ,
- delimiters .code:n = \keys_set:nn { NiceMatrix / delimiters } { #1 } ,
+ delimiters .code:n = \keys_set:nn { nicematrix / delimiters } { #1 } ,
delimiters .value_required:n = true ,
small .bool_set:N = \l_@@_small_bool ,
small .value_forbidden:n = true ,
@@ -2937,11 +2963,11 @@ version 2005/12/01 or later.
% \end{macrocode}
%
% \bigskip
-% We finalise the definition of the set of keys ``|NiceMatrix / NiceTabular|''
+% We finalise the definition of the set of keys ``|nicematrix / NiceTabular|''
% with the options specific to |{NiceTabular}|.
%
% \begin{macrocode}
-\keys_define:nn { NiceMatrix / NiceTabular }
+\keys_define:nn { nicematrix / NiceTabular }
{
% \end{macrocode}
% The dimension |width| will be used if at least a column of type |X| is used.
@@ -2950,7 +2976,7 @@ version 2005/12/01 or later.
width .code:n = \dim_set:Nn \l_@@_width_dim { #1 }
\bool_set_true:N \l_@@_width_used_bool ,
width .value_required:n = true ,
- notes .code:n = \keys_set:nn { NiceMatrix / notes } { #1 } ,
+ notes .code:n = \keys_set:nn { nicematrix / notes } { #1 } ,
tabularnote .tl_gset:N = \g_@@_tabularnote_tl ,
tabularnote .value_required:n = true ,
caption .tl_set:N = \l_@@_caption_tl ,
@@ -2977,18 +3003,18 @@ version 2005/12/01 or later.
% We \emph{must} put the following instructions \emph{after} the :
%
% \begin{verbatim}
-% CodeAfter / sub-matrix .inherit:n = NiceMatrix / sub-matrix
+% CodeAfter / sub-matrix .inherit:n = nicematrix / sub-matrix
% \end{verbatim}
%
% \begin{macrocode}
-\keys_define:nn { NiceMatrix / CodeAfter }
+\keys_define:nn { nicematrix / CodeAfter }
{
delimiters / color .tl_set:N = \l_@@_delimiters_color_tl ,
delimiters / color .value_required:n = true ,
- rules .code:n = \keys_set:nn { NiceMatrix / rules } { #1 } ,
+ rules .code:n = \keys_set:nn { nicematrix / rules } { #1 } ,
rules .value_required:n = true ,
- xdots .code:n = \keys_set:nn { NiceMatrix / xdots } { #1 } ,
- sub-matrix .code:n = \keys_set:nn { NiceMatrix / sub-matrix } { #1 } ,
+ xdots .code:n = \keys_set:nn { nicematrix / xdots } { #1 } ,
+ sub-matrix .code:n = \keys_set:nn { nicematrix / sub-matrix } { #1 } ,
sub-matrix .value_required:n = true ,
unknown .code:n = \@@_error:n { Unknown~key~for~CodeAfter }
}
@@ -4256,11 +4282,11 @@ version 2005/12/01 or later.
%
% \bigskip
% \begin{macrocode}
-\keys_define:nn { NiceMatrix / CodeBefore }
+\keys_define:nn { nicematrix / CodeBefore }
{
create-cell-nodes .bool_gset:N = \g_@@_recreate_cell_nodes_bool ,
create-cell-nodes .default:n = true ,
- sub-matrix .code:n = \keys_set:nn { NiceMatrix / sub-matrix } { #1 } ,
+ sub-matrix .code:n = \keys_set:nn { nicematrix / sub-matrix } { #1 } ,
sub-matrix .value_required:n = true ,
delimiters / color .tl_set:N = \l_@@_delimiters_color_tl ,
delimiters / color .value_required:n = true ,
@@ -4272,7 +4298,7 @@ version 2005/12/01 or later.
% \begin{macrocode}
\NewDocumentCommand \@@_CodeBefore_keys: { O { } }
{
- \keys_set:nn { NiceMatrix / CodeBefore } { #1 }
+ \keys_set:nn { nicematrix / CodeBefore } { #1 }
\@@_CodeBefore:w
}
% \end{macrocode}
@@ -4533,8 +4559,8 @@ version 2005/12/01 or later.
% |{NiceArray}|, we have the options |t|, |c|, |b| and |baseline|.
% \begin{macrocode}
\bool_if:NTF \g_@@_delims_bool
- { \keys_set:nn { NiceMatrix / pNiceArray } }
- { \keys_set:nn { NiceMatrix / NiceArray } }
+ { \keys_set:nn { nicematrix / pNiceArray } }
+ { \keys_set:nn { nicematrix / NiceArray } }
{ #3 , #5 }
% \end{macrocode}
%
@@ -4566,7 +4592,7 @@ version 2005/12/01 or later.
\skip_horizontal:N \l_@@_right_margin_dim
\skip_horizontal:N \l_@@_extra_right_margin_dim
- % % awful workaround
+ % awful workaround
\int_compare:nNnT \g_@@_col_total_int = \c_one_int
{
\dim_compare:nNnT \l_@@_columns_width_dim > \c_zero_dim
@@ -5416,22 +5442,12 @@ version 2005/12/01 or later.
% \end{macrocode}
%
% \bigskip
-%
% \begin{macrocode}
\str_new:N \c_@@_ignorespaces_str
\str_set:Nx \c_@@_ignorespaces_str { \ignorespaces }
\str_remove_all:Nn \c_@@_ignorespaces_str { ~ }
-% \end{macrocode}
-%
-% \bigskip
-% In order to test whether a cell is empty, we test whether it begins by
-% |\ignorespaces\unskip|. However, in some circunstancies, for example when
-% |\collectcell| of \pkg{collcell} is used, the cell does not begin with
-% |\ignorespaces|. In that case, we consider as not empty...
-%
-% First, we test if the next token is |\ignorespaces| and it's not very easy...
-% \begin{macrocode}
-\cs_new_protected:Npn \@@_test_if_empty: { \peek_after:Nw \@@_test_if_empty_i: }
+\cs_new_protected:Npn \@@_test_if_empty:
+ { \peek_after:Nw \@@_test_if_empty_i: }
\cs_new_protected:Npn \@@_test_if_empty_i:
{
\str_set:Nx \l_tmpa_str { \token_to_meaning:N \l_peek_token }
@@ -5439,17 +5455,40 @@ version 2005/12/01 or later.
{ \@@_test_if_empty:w }
}
\cs_new_protected:Npn \@@_test_if_empty:w \ignorespaces
- {
- \peek_meaning:NT \unskip
- {
- \tl_gput_right:Nn \g_@@_cell_after_hook_tl
- {
- \box_set_wd:Nn \l_@@_cell_box \c_zero_dim
- \skip_horizontal:N \l_@@_col_width_dim
- }
+ { \peek_after:Nw \@@_test_if_empty_ii: }
+% \end{macrocode}
+%
+% \bigskip
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_nullify_cell:
+ {
+ \tl_gput_right:Nn \g_@@_cell_after_hook_tl
+ {
+ \box_set_wd:Nn \l_@@_cell_box \c_zero_dim
+ \skip_horizontal:N \l_@@_col_width_dim
}
}
% \end{macrocode}
+%
+% \bigskip
+% \begin{macrocode}
+\bool_if:NTF \c_@@_tagging_array_bool
+ {
+ \cs_new_protected:Npn \@@_test_if_empty_ii:
+ { \peek_meaning:NT \textonly@unskip \@@_nullify_cell: }
+ }
+% \end{macrocode}
+% In the old version of \pkg{array}, we test whether it begins by
+% |\ignorespaces\unskip|. However, in some circunstancies, for example when
+% |\collectcell| of \pkg{collcell} is used, the cell does not begin with
+% |\ignorespaces|. In that case, we consider as not empty...
+% First, we test if the next token is |\ignorespaces| and it's not very easy...
+% \begin{macrocode}
+ {
+ \cs_new_protected:Npn \@@_test_if_empty_ii:
+ { \peek_meaning:NT \unskip \@@_nullify_cell: }
+ }
+% \end{macrocode}
%
%
% \begin{macrocode}
@@ -6114,6 +6153,24 @@ version 2005/12/01 or later.
}
% \end{macrocode}
%
+% \bigskip
+% We want |\cellcolor| to be available in |\multicolumn| because |\cellcolor| of
+% \pkg{colortbl} is available in |\multicolumn|.
+% \begin{macrocode}
+ \RenewDocumentCommand \cellcolor { O { } m }
+ {
+ \@@_test_color_inside:
+ \tl_gput_right:Nx \g_@@_pre_code_before_tl
+ {
+ \@@_rectanglecolor [ ##1 ]
+ { \exp_not:n { ##2 } }
+ { \int_use:N \c@iRow - \int_use:N \c@jCol }
+ { \int_use:N \c@iRow - \int_eval:n { \c@jCol + #1 } }
+ }
+ \ignorespaces
+ }
+% \end{macrocode}
+%
% \medskip
% The following lines were in the original definition of |\multicolumn|.
% \begin{macrocode}
@@ -6769,7 +6826,7 @@ version 2005/12/01 or later.
}
}
{
- \@@_create_col_nodes:
+ \@@_create_col_nodes:
\endarray
}
% \end{macrocode}
@@ -6817,7 +6874,7 @@ version 2005/12/01 or later.
% \begin{macrocode}
{
\@@_create_col_nodes:
- \endarray
+ \endarray
}
% \end{macrocode}
%
@@ -7193,7 +7250,7 @@ version 2005/12/01 or later.
\endpgfpicture
}
}
- % \cr
+ % \cr
}
% \end{macrocode}
%
@@ -7448,7 +7505,7 @@ version 2005/12/01 or later.
\bool_set_true:N \l_@@_last_col_without_value_bool
\int_set:Nn \l_@@_last_col_int { -1 }
}
- \keys_set:nn { NiceMatrix / NiceMatrix } { ##1 }
+ \keys_set:nn { nicematrix / NiceMatrix } { ##1 }
\@@_begin_of_NiceMatrix:nV { #1 } \l_@@_columns_type_tl
}
{ \use:c { end #1 NiceArray } }
@@ -7466,7 +7523,7 @@ version 2005/12/01 or later.
\bool_set_true:N \l_@@_last_col_without_value_bool
\int_set:Nn \l_@@_last_col_int { -1 }
}
- \keys_set:nn { NiceMatrix / NiceMatrix } { #1 }
+ \keys_set:nn { nicematrix / NiceMatrix } { #1 }
\bool_lazy_or:nnT
{ \clist_if_empty_p:N \l_@@_vlines_clist }
{ \l_@@_except_borders_bool }
@@ -7497,7 +7554,7 @@ version 2005/12/01 or later.
\dim_compare:nNnT \l_@@_width_dim = \c_zero_dim
{ \dim_set_eq:NN \l_@@_width_dim \linewidth }
\str_gset:Nn \g_@@_name_env_str { NiceTabular }
- \keys_set:nn { NiceMatrix / NiceTabular } { #1 , #3 }
+ \keys_set:nn { nicematrix / NiceTabular } { #1 , #3 }
\tl_if_empty:NF \l_@@_short_caption_tl
{
\tl_if_empty:NT \l_@@_caption_tl
@@ -7549,7 +7606,7 @@ version 2005/12/01 or later.
\str_gset:Nn \g_@@_name_env_str { NiceTabularX }
\dim_zero_new:N \l_@@_width_dim
\dim_set:Nn \l_@@_width_dim { #1 }
- \keys_set:nn { NiceMatrix / NiceTabular } { #2 , #4 }
+ \keys_set:nn { nicematrix / NiceTabular } { #2 , #4 }
\@@_settings_for_tabular:
\NiceArray { #3 }
}
@@ -7566,7 +7623,7 @@ version 2005/12/01 or later.
{
\str_gset:Nn \g_@@_name_env_str { NiceTabular* }
\dim_set:Nn \l_@@_tabular_width_dim { #1 }
- \keys_set:nn { NiceMatrix / NiceTabular } { #2 , #4 }
+ \keys_set:nn { nicematrix / NiceTabular } { #2 , #4 }
\@@_settings_for_tabular:
\NiceArray { #3 }
}
@@ -7930,7 +7987,7 @@ version 2005/12/01 or later.
% the |\CodeBefore.|
% \begin{macrocode}
\NewDocumentCommand \@@_CodeAfter_keys: { O { } }
- { \keys_set:nn { NiceMatrix / CodeAfter } { #1 } }
+ { \keys_set:nn { nicematrix / CodeAfter } { #1 } }
% \end{macrocode}
%
%
@@ -8539,7 +8596,7 @@ version 2005/12/01 or later.
\int_compare:nNnT { #1 } = \l_@@_last_row_int
{ \color { nicematrix-last-row } }
}
- \keys_set:nn { NiceMatrix / xdots } { #3 }
+ \keys_set:nn { nicematrix / xdots } { #3 }
\tl_if_empty:oF \l_@@_xdots_color_tl { \color { \l_@@_xdots_color_tl } }
\@@_actually_draw_Ldots:
\group_end:
@@ -8634,7 +8691,7 @@ version 2005/12/01 or later.
\int_compare:nNnT { #1 } = \l_@@_last_row_int
{ \color { nicematrix-last-row } }
}
- \keys_set:nn { NiceMatrix / xdots } { #3 }
+ \keys_set:nn { nicematrix / xdots } { #3 }
\tl_if_empty:oF \l_@@_xdots_color_tl { \color { \l_@@_xdots_color_tl } }
\@@_actually_draw_Cdots:
\group_end:
@@ -8762,7 +8819,7 @@ version 2005/12/01 or later.
\int_compare:nNnT { #2 } = \l_@@_last_col_int
{ \color { nicematrix-last-col } }
}
- \keys_set:nn { NiceMatrix / xdots } { #3 }
+ \keys_set:nn { nicematrix / xdots } { #3 }
\tl_if_empty:oF \l_@@_xdots_color_tl
{ \color { \l_@@_xdots_color_tl } }
\@@_actually_draw_Vdots:
@@ -8911,7 +8968,7 @@ version 2005/12/01 or later.
% \begin{macrocode}
\group_begin:
\@@_open_shorten:
- \keys_set:nn { NiceMatrix / xdots } { #3 }
+ \keys_set:nn { nicematrix / xdots } { #3 }
\tl_if_empty:oF \l_@@_xdots_color_tl { \color { \l_@@_xdots_color_tl } }
\@@_actually_draw_Ddots:
\group_end:
@@ -8975,11 +9032,14 @@ version 2005/12/01 or later.
% extremity of the line by modifying the coordinate |\l_@@_x_initial_dim|.
% \begin{macrocode}
{
- \dim_set:Nn \l_@@_y_final_dim
- {
- \l_@@_y_initial_dim +
- ( \l_@@_x_final_dim - \l_@@_x_initial_dim ) *
- \dim_ratio:nn \g_@@_delta_y_one_dim \g_@@_delta_x_one_dim
+ \dim_compare:nNnF \g_@@_delta_x_one_dim = \c_zero_dim
+ {
+ \dim_set:Nn \l_@@_y_final_dim
+ {
+ \l_@@_y_initial_dim +
+ ( \l_@@_x_final_dim - \l_@@_x_initial_dim ) *
+ \dim_ratio:nn \g_@@_delta_y_one_dim \g_@@_delta_x_one_dim
+ }
}
}
}
@@ -9006,7 +9066,7 @@ version 2005/12/01 or later.
% \begin{macrocode}
\group_begin:
\@@_open_shorten:
- \keys_set:nn { NiceMatrix / xdots } { #3 }
+ \keys_set:nn { nicematrix / xdots } { #3 }
\tl_if_empty:oF \l_@@_xdots_color_tl { \color { \l_@@_xdots_color_tl } }
\@@_actually_draw_Iddots:
\group_end:
@@ -9051,11 +9111,14 @@ version 2005/12/01 or later.
{ \l_@@_y_final_dim - \l_@@_y_initial_dim }
}
{
- \dim_set:Nn \l_@@_y_final_dim
- {
- \l_@@_y_initial_dim +
- ( \l_@@_x_final_dim - \l_@@_x_initial_dim ) *
- \dim_ratio:nn \g_@@_delta_y_two_dim \g_@@_delta_x_two_dim
+ \dim_compare:nNnF \g_@@_delta_x_two_dim = \c_zero_dim
+ {
+ \dim_set:Nn \l_@@_y_final_dim
+ {
+ \l_@@_y_initial_dim +
+ ( \l_@@_x_final_dim - \l_@@_x_initial_dim ) *
+ \dim_ratio:nn \g_@@_delta_y_two_dim \g_@@_delta_x_two_dim
+ }
}
}
}
@@ -9564,7 +9627,7 @@ version 2005/12/01 or later.
\l_@@_last_col_int { \@@_error:nn { in~last~col } \Ddots }
}
{
- \keys_set_known:nn { NiceMatrix / Ddots } { #1 }
+ \keys_set_known:nn { nicematrix / Ddots } { #1 }
\@@_instruction_of_type:nnn \l_@@_draw_first_bool { Ddots }
{ #1 , down = #2 , up = #3 , middle = #4 }
}
@@ -9594,7 +9657,7 @@ version 2005/12/01 or later.
\l_@@_last_col_int { \@@_error:nn { in~last~col } \Iddots }
}
{
- \keys_set_known:nn { NiceMatrix / Ddots } { #1 }
+ \keys_set_known:nn { nicematrix / Ddots } { #1 }
\@@_instruction_of_type:nnn \l_@@_draw_first_bool { Iddots }
{ #1 , down = #2 , up = #3 , middle = #4 }
}
@@ -9612,7 +9675,7 @@ version 2005/12/01 or later.
% Despite its name, the following set of keys will be used for |\Ddots| but also
% for |\Iddots|.
% \begin{macrocode}
-\keys_define:nn { NiceMatrix / Ddots }
+\keys_define:nn { nicematrix / Ddots }
{
draw-first .bool_set:N = \l_@@_draw_first_bool ,
draw-first .default:n = true ,
@@ -9771,7 +9834,7 @@ version 2005/12/01 or later.
{ \color { nicematrix-last-row } }
}
- \keys_set:nn { NiceMatrix / xdots } { #4 }
+ \keys_set:nn { nicematrix / xdots } { #4 }
\tl_if_empty:oF \l_@@_xdots_color_tl { \color { \l_@@_xdots_color_tl } }
\@@_actually_draw_Ldots:
\group_end:
@@ -9877,7 +9940,7 @@ version 2005/12/01 or later.
\int_compare:nNnT { #2 } = \g_@@_col_total_int
{ \color { nicematrix-last-col } }
}
- \keys_set:nn { NiceMatrix / xdots } { #4 }
+ \keys_set:nn { nicematrix / xdots } { #4 }
\tl_if_empty:oF \l_@@_xdots_color_tl { \color { \l_@@_xdots_color_tl } }
\@@_actually_draw_Vdots:
\group_end:
@@ -9904,14 +9967,14 @@ version 2005/12/01 or later.
\peek_remove_spaces:n
{
\bool_gset_true:N \g_@@_rotate_bool
- \keys_set:nn { NiceMatrix / rotate } { #1 }
+ \keys_set:nn { nicematrix / rotate } { #1 }
}
}
% \end{macrocode}
%
% \bigskip
% \begin{macrocode}
-\keys_define:nn { NiceMatrix / rotate }
+\keys_define:nn { nicematrix / rotate }
{
c .code:n = \bool_gset_true:N \g_@@_rotate_c_bool ,
c .value_forbidden:n = true ,
@@ -9965,7 +10028,7 @@ version 2005/12/01 or later.
\exp_args:NNo \NewDocumentCommand \@@_line \l_@@_argspec_tl
{
\group_begin:
- \keys_set:nn { NiceMatrix / xdots } { #1 , #4 , down = #5 , up = #6 }
+ \keys_set:nn { nicematrix / xdots } { #1 , #4 , down = #5 , up = #6 }
\tl_if_empty:oF \l_@@_xdots_color_tl { \color { \l_@@_xdots_color_tl } }
\use:e
{
@@ -10086,7 +10149,7 @@ version 2005/12/01 or later.
% \end{macrocode}
% \medskip
% \begin{macrocode}
-\keys_define:nn { NiceMatrix / RowStyle }
+\keys_define:nn { nicematrix / RowStyle }
{
cell-space-top-limit .dim_set:N = \l_tmpa_dim ,
cell-space-top-limit .value_required:n = true ,
@@ -10123,7 +10186,7 @@ version 2005/12/01 or later.
\int_set_eq:NN \l_@@_key_nb_rows_int \c_one_int
\dim_zero:N \l_tmpa_dim
\dim_zero:N \l_tmpb_dim
- \keys_set:nn { NiceMatrix / RowStyle } { #1 }
+ \keys_set:nn { nicematrix / RowStyle } { #1 }
% \end{macrocode}
% If the key |rowcolor| has been used.
% \begin{macrocode}
@@ -10569,7 +10632,7 @@ version 2005/12/01 or later.
%
% \bigskip
% \begin{macrocode}
-\keys_define:nn { NiceMatrix / rowcolors }
+\keys_define:nn { nicematrix / rowcolors }
{
respect-blocks .bool_set:N = \l_@@_respect_blocks_bool ,
respect-blocks .default:n = true ,
@@ -10606,7 +10669,7 @@ version 2005/12/01 or later.
\seq_set_split:Nnn \l_@@_colors_seq { , } { #3 }
\tl_clear_new:N \l_@@_cols_tl
\cs_set_nopar:Npn \l_@@_cols_tl { - }
- \keys_set:nn { NiceMatrix / rowcolors } { #4 }
+ \keys_set:nn { nicematrix / rowcolors } { #4 }
% \end{macrocode}
% The counter |\l_@@_color_int| will be the rank of the current color in the list of
% colors (modulo the length of the list).
@@ -11265,7 +11328,7 @@ version 2005/12/01 or later.
% However, unknown keys will be analyzed further with another set of keys.
%
% \begin{macrocode}
-\keys_define:nn { NiceMatrix / Rules }
+\keys_define:nn { nicematrix / Rules }
{
position .int_set:N = \l_@@_position_int ,
position .value_required:n = true ,
@@ -11288,7 +11351,7 @@ version 2005/12/01 or later.
% following set of keys.
%
% \begin{macrocode}
-\keys_define:nn { NiceMatrix / RulesBis }
+\keys_define:nn { nicematrix / RulesBis }
{
multiplicity .int_set:N = \l_@@_multiplicity_int ,
multiplicity .initial:n = 1 ,
@@ -11339,7 +11402,7 @@ version 2005/12/01 or later.
% \begin{macrocode}
\group_begin:
\int_set_eq:NN \l_@@_end_int \c@iRow
- \keys_set_known:nnN { NiceMatrix / Rules } { #1 } \l_@@_other_keys_tl
+ \keys_set_known:nnN { nicematrix / Rules } { #1 } \l_@@_other_keys_tl
% \end{macrocode}
% The following test is for the case where the user does not use all the columns
% specified in the preamble of the environment (for instance, a preamble of
@@ -11438,7 +11501,7 @@ version 2005/12/01 or later.
\cs_new_protected:Npn \@@_vline_ii:
{
\tl_clear:N \l_@@_tikz_rule_tl
- \keys_set:nV { NiceMatrix / RulesBis } \l_@@_other_keys_tl
+ \keys_set:nV { nicematrix / RulesBis } \l_@@_other_keys_tl
\bool_if:NTF \l_@@_dotted_bool
\@@_vline_iv:
{
@@ -11594,7 +11657,7 @@ version 2005/12/01 or later.
% \bigskip
% The following command will be executed in the internal |\CodeAfter|. The
% argument |#1| is a list of \textsl{key=value} pairs of the form
-% |{NiceMatrix/Rules}|.
+% |{nicematrix/Rules}|.
% \begin{macrocode}
\cs_new_protected:Npn \@@_hline:n #1
{
@@ -11604,7 +11667,7 @@ version 2005/12/01 or later.
\group_begin:
\int_zero_new:N \l_@@_end_int
\int_set_eq:NN \l_@@_end_int \c@jCol
- \keys_set_known:nnN { NiceMatrix / Rules } { #1 } \l_@@_other_keys_tl
+ \keys_set_known:nnN { nicematrix / Rules } { #1 } \l_@@_other_keys_tl
\@@_hline_i:
\group_end:
}
@@ -11699,7 +11762,7 @@ version 2005/12/01 or later.
\cs_new_protected:Npn \@@_hline_ii:
{
\tl_clear:N \l_@@_tikz_rule_tl
- \keys_set:nV { NiceMatrix / RulesBis } \l_@@_other_keys_tl
+ \keys_set:nV { nicematrix / RulesBis } \l_@@_other_keys_tl
\bool_if:NTF \l_@@_dotted_bool
\@@_hline_iv:
{
@@ -11979,7 +12042,7 @@ version 2005/12/01 or later.
\str_clear_new:N \l_@@_ccommand_str
\str_clear_new:N \l_@@_letter_str
\tl_clear_new:N \l_@@_other_keys_tl
- \keys_set_known:nnN { NiceMatrix / custom-line } { #1 } \l_@@_other_keys_tl
+ \keys_set_known:nnN { nicematrix / custom-line } { #1 } \l_@@_other_keys_tl
% \end{macrocode}
% If the final user only wants to draw horizontal rules, he does not need to
% specify a letter (for the vertical rules in the preamble of the array). On the
@@ -12001,7 +12064,7 @@ version 2005/12/01 or later.
%
%
% \begin{macrocode}
-\keys_define:nn { NiceMatrix / custom-line }
+\keys_define:nn { nicematrix / custom-line }
{
letter .str_set:N = \l_@@_letter_str ,
letter .value_required:n = true ,
@@ -12025,7 +12088,7 @@ version 2005/12/01 or later.
\bool_set_false:N \l_@@_color_bool
% \end{macrocode}
% \begin{macrocode}
- \keys_set:nn { NiceMatrix / custom-line-bis } { #1 }
+ \keys_set:nn { nicematrix / custom-line-bis } { #1 }
\bool_if:NT \l_@@_tikz_rule_bool
{
\IfPackageLoadedTF { tikz }
@@ -12073,10 +12136,10 @@ version 2005/12/01 or later.
% The previous command |\@@_custom_line_i:n| uses the following set of keys.
% However, the whole definition of the customized lines (as provided by the
% final user as argument of |custom-line|) will also be used further with
-% other sets of keys (for instance |{NiceMatrix/Rules}|). That's why the
+% other sets of keys (for instance |{nicematrix/Rules}|). That's why the
% following set of keys has some keys which are no-op.
% \begin{macrocode}
-\keys_define:nn { NiceMatrix / custom-line-bis }
+\keys_define:nn { nicematrix / custom-line-bis }
{
multiplicity .int_set:N = \l_@@_multiplicity_int ,
multiplicity .initial:n = 1 ,
@@ -12111,7 +12174,7 @@ version 2005/12/01 or later.
% deprecated and has been replaced by the key |total-width|.
%
% \begin{macrocode}
-\keys_define:nn { NiceMatrix / custom-line-width }
+\keys_define:nn { nicematrix / custom-line-width }
{
multiplicity .int_set:N = \l_@@_multiplicity_int ,
multiplicity .initial:n = 1 ,
@@ -12201,7 +12264,7 @@ version 2005/12/01 or later.
\bool_set_false:N \l_@@_tikz_rule_bool
\bool_set_false:N \l_@@_total_width_bool
\bool_set_false:N \l_@@_dotted_rule_bool
- \keys_set_known:nn { NiceMatrix / custom-line-width } { #1 }
+ \keys_set_known:nn { nicematrix / custom-line-width } { #1 }
\bool_if:NF \l_@@_total_width_bool
{
\bool_if:NTF \l_@@_dotted_rule_bool
@@ -12527,7 +12590,7 @@ version 2005/12/01 or later.
% Up to now, there is only one option available for the environment
% |{NiceMatrixBlock}|.
% \begin{macrocode}
-\keys_define:nn { NiceMatrix / NiceMatrixBlock }
+\keys_define:nn { nicematrix / NiceMatrixBlock }
{
auto-columns-width .code:n =
{
@@ -12544,7 +12607,7 @@ version 2005/12/01 or later.
{
\int_gincr:N \g_@@_NiceMatrixBlock_int
\dim_zero:N \l_@@_columns_width_dim
- \keys_set:nn { NiceMatrix / NiceMatrixBlock } { #1 }
+ \keys_set:nn { nicematrix / NiceMatrixBlock } { #1 }
\bool_if:NT \l_@@_block_auto_columns_width_bool
{
\cs_if_exist:cT
@@ -12959,7 +13022,7 @@ version 2005/12/01 or later.
% array (and once again when the block will be put in the array).
% Here is the set of keys for the first pass (in the cell of the array).
% \begin{macrocode}
-\keys_define:nn { NiceMatrix / Block / FirstPass }
+\keys_define:nn { nicematrix / Block / FirstPass }
{
j .code:n = \str_set:Nn \l_@@_hpos_block_str j
\bool_set_true:N \l_@@_p_block_bool ,
@@ -12984,6 +13047,9 @@ version 2005/12/01 or later.
b .value_forbidden:n = true ,
B .code:n = \str_set:Nn \l_@@_vpos_block_str B ,
B .value_forbidden:n = true ,
+ m .code:n = \str_set:Nn \l_@@_vpos_block_str c ,
+ m .value_forbidden:n = true ,
+ v-center .meta:n = m ,
p .code:n = \bool_set_true:N \l_@@_p_block_bool ,
p .value_forbidden:n = true ,
color .code:n =
@@ -13000,6 +13066,7 @@ version 2005/12/01 or later.
% \end{macrocode}
%
%
+%
% The following command |\@@_Block:| will be linked to |\Block| in the
% environments of \pkg{nicematrix}. We define it with
% |\NewExpandableDocumentCommand| because it has an optional argument between~
@@ -13071,12 +13138,12 @@ version 2005/12/01 or later.
% \begin{macrocode}
\bool_lazy_or:nnTF
{ \tl_if_blank_p:n { #1 } }
- { \str_if_eq_p:nn { #1 } { * } }
+ { \str_if_eq_p:Vn \c_@@_star_str { #1 } }
{ \int_set:Nn \l_tmpa_int { 100 } }
{ \int_set:Nn \l_tmpa_int { #1 } }
\bool_lazy_or:nnTF
{ \tl_if_blank_p:n { #2 } }
- { \str_if_eq_p:nn { #2 } { * } }
+ { \str_if_eq_p:Vn \c_@@_star_str { #2 } }
{ \int_set:Nn \l_tmpb_int { 100 } }
{ \int_set:Nn \l_tmpb_int { #2 } }
% \end{macrocode}
@@ -13097,7 +13164,7 @@ version 2005/12/01 or later.
%
% \medskip
% \begin{macrocode}
- \keys_set_known:nn { NiceMatrix / Block / FirstPass } { #3 }
+ \keys_set_known:nn { nicematrix / Block / FirstPass } { #3 }
% \end{macrocode}
%
% \begin{macrocode}
@@ -13124,20 +13191,10 @@ version 2005/12/01 or later.
\bool_set_false:N \l_tmpa_bool
\bool_if:NT \l_@@_amp_in_blocks_bool
{ \tl_if_in:nnT { #5 } { & } { \bool_set_true:N \l_tmpa_bool } }
- \bool_if:NTF \l_tmpa_bool
- { \exp_args:Nee \@@_Block_vii:nnnnn }
- {
- \bool_if:NTF \l_@@_p_block_bool
- { \exp_args:Nee \@@_Block_vi:nnnnn }
- {
- \bool_if:nTF
- {
- (
- \int_compare_p:nNn \l_tmpa_int = \c_one_int
- ||
- \int_compare_p:nNn \l_tmpb_int = \c_one_int
- )
- && ! \tl_if_empty_p:n { #5 }
+ \bool_case:nF
+ {
+ \l_tmpa_bool { \exp_args:Nee \@@_Block_vii:nnnnn }
+ \l_@@_p_block_bool { \exp_args:Nee \@@_Block_vi:nnnnn }
% \end{macrocode}
% For the blocks mono-column, we will compose right now in a box in order to
% compute its width and take that width into account for the width of the
@@ -13147,12 +13204,14 @@ version 2005/12/01 or later.
% column, it's imperative. Otherwise, the process for the determination of the
% widths of the columns will be wrong.
% \begin{macrocode}
- && ! \l_@@_X_bool
- }
- { \exp_args:Nee \@@_Block_iv:nnnnn }
- { \exp_args:Nee \@@_Block_v:nnnnn }
- }
- }
+ \l_@@_X_bool { \exp_args:Nee \@@_Block_v:nnnnn }
+ { \tl_if_empty_p:n { #5 } } { \exp_args:Nee \@@_Block_v:nnnnn }
+ { \int_compare_p:nNn \l_tmpa_int = \c_one_int }
+ { \exp_args:Nee \@@_Block_iv:nnnnn }
+ { \int_compare_p:nNn \l_tmpb_int = \c_one_int }
+ { \exp_args:Nee \@@_Block_iv:nnnnn }
+ }
+ { \exp_args:Nee \@@_Block_v:nnnnn }
{ \l_tmpa_int } { \l_tmpb_int } { #3 } { #4 } { #5 }
}
% \end{macrocode}
@@ -13220,10 +13279,42 @@ version 2005/12/01 or later.
\int_compare:nNnT { #1 } = \c_one_int
{
\int_if_zero:nTF \c@iRow
- \l_@@_code_for_first_row_tl
+ {
+% \end{macrocode}
+%
+% \bigskip
+% In the following code, the value of |code-for-first-row| contains a |\Block|
+% (in order to have the ``first row'' centered). But, that block will be
+% executed, since it is entirely contained in the first row, the value of
+% |code-for-first-row| will be inserted once again... with the same command
+% |\Block|. That's why we have to nullify the command |\Block.|
+% \begin{Verbatim}
+% $\begin{bNiceMatrix}%
+% [
+% r,
+% first-row,
+% last-col,
+% code-for-first-row = \Block{}{\scriptstyle\color{blue} \arabic{jCol}},
+% code-for-last-col = \scriptstyle \color{blue} \arabic{iRow}
+% ]
+% & & & & \\
+% -2 & 3 & -4 & 5 & \\
+% 3 & -4 & 5 & -6 & \\
+% -4 & 5 & -6 & 7 & \\
+% 5 & -6 & 7 & -8 & \\
+% \end{bNiceMatrix}$
+% \end{Verbatim}
+%
+% \begin{macrocode}
+ \cs_set_eq:NN \Block \@@_NullBlock:
+ \l_@@_code_for_first_row_tl
+ }
{
\int_compare:nNnT \c@iRow = \l_@@_last_row_int
- \l_@@_code_for_last_row_tl
+ {
+ \cs_set_eq:NN \Block \@@_NullBlock:
+ \l_@@_code_for_last_row_tl
+ }
}
\g_@@_row_style_tl
}
@@ -13265,7 +13356,7 @@ version 2005/12/01 or later.
{ ! \g_@@_rotate_bool }
}
% \end{macrocode}
-% When the block is mono-column in a column with a fixed width (eg |p{3cm}|), we
+% When the block is mono-column in a column with a fixed width (e.g. |p{3cm}|), we
% use a |{minipage}|.
% \begin{macrocode}
{
@@ -13339,9 +13430,16 @@ version 2005/12/01 or later.
}
% \end{macrocode}
% If we are in a mono-row block we take into account the height and the depth of
-% that block for the height and the depth of the row.
+% that block for the height and the depth of the row, excepted when the block
+% uses explicitely an option of vertical position.
% \begin{macrocode}
- \int_compare:nNnT { #1 } = \c_one_int
+ \bool_lazy_and:nnT
+ { \int_compare_p:nNn { #1 } = \c_one_int }
+% \end{macrocode}
+% If the user has not used a key for the vertical position of the block, then
+% |\l_@@_vpos_block_str| remains empty.
+% \begin{macrocode}
+ { \str_if_empty_p:N \l_@@_vpos_block_str }
{
\dim_gset:Nn \g_@@_blocks_ht_dim
{
@@ -13384,7 +13482,6 @@ version 2005/12/01 or later.
{ m }
{ \int_compare:nNnT \c@iRow = \l_@@_last_row_int T }
}
-
}
{
\box_use_drop:c
@@ -13574,8 +13671,11 @@ version 2005/12/01 or later.
%
% \medskip
% \begin{macrocode}
-\keys_define:nn { NiceMatrix / Block / SecondPass }
+\keys_define:nn { nicematrix / Block / SecondPass }
{
+ ampersand-in-blocks .bool_set:N = \l_@@_amp_in_blocks_bool ,
+ ampersand-in-blocks .default:n = true ,
+ &-in-blocks .meta:n = ampersand-in-blocks ,
tikz .code:n =
\IfPackageLoadedTF { tikz }
{ \seq_put_right:Nn \l_@@_tikz_seq { { #1 } } }
@@ -13707,10 +13807,22 @@ version 2005/12/01 or later.
{
\int_compare:nNnTF \l_@@_last_row_int > \g_@@_row_total_int
{ \msg_error:nnnn { nicematrix } { Block~too~large~1 } { #1 } { #2 } }
- { \@@_Block_v:nnnnnn { #1 } { #2 } { #3 } { #4 } { #5 } { #6 } }
+ {
+ \@@_Block_v:nnVVnn
+ { #1 }
+ { #2 }
+ \l_@@_last_row_int
+ \l_@@_last_col_int
+ { #5 }
+ { #6 }
+ }
}
}
% \end{macrocode}
+%
+% \begin{macrocode}
+\cs_generate_variant:Nn \@@_Block_v:nnnnnn { n n V V n n }
+% \end{macrocode}
%
%
% \medskip
@@ -13730,7 +13842,7 @@ version 2005/12/01 or later.
\group_begin:
\int_compare:nNnT { #1 } = { #3 }
{ \str_set:Nn \l_@@_vpos_block_str { t } }
- \keys_set:nn { NiceMatrix / Block / SecondPass } { #5 }
+ \keys_set:nn { nicematrix / Block / SecondPass } { #5 }
% \end{macrocode}
%
%
@@ -14135,6 +14247,9 @@ version 2005/12/01 or later.
}
\endpgfpicture
}
+% \end{macrocode}
+% Now the case where there is no ampersand |&| in the content of the block.
+% \begin{macrocode}
{
\bool_if:NTF \l_@@_p_block_bool
{
@@ -14172,13 +14287,15 @@ version 2005/12/01 or later.
% \end{macrocode}
%
% \bigskip
-% Now, we will put the label of the block.
+% Now, we will put the label of the block. We recall that |\l_@@_vpos_block_str|
+% is empty when the user has not used a key for the vertical position of the block.
% \begin{macrocode}
\pgfpicture
\pgfrememberpicturepositiononpagetrue
\pgf@relevantforpicturesizefalse
\bool_lazy_any:nTF
{
+ { \str_if_empty_p:N \l_@@_vpos_block_str } % added 2024/06/29
{ \str_if_eq_p:on \l_@@_vpos_block_str { c } }
{ \str_if_eq_p:on \l_@@_vpos_block_str { T } }
{ \str_if_eq_p:on \l_@@_vpos_block_str { B } }
@@ -14206,6 +14323,19 @@ version 2005/12/01 or later.
{
\str_case:on \l_@@_vpos_block_str
{
+% \end{macrocode}
+% We recall that |\l_@@_vpos_block_str| is empty when the user has not used a key
+% for the vertical position of the block.
+% \begin{macrocode}
+ { } { % added 2024-06-29
+ \str_case:on \l_@@_hpos_block_str
+ {
+ c { center }
+ l { west }
+ r { east }
+ j { center }
+ }
+ }
c {
\str_case:on \l_@@_hpos_block_str
{
@@ -14321,6 +14451,7 @@ version 2005/12/01 or later.
% \end{macrocode}
%
%
+%
% \bigskip
% The first argument of |\@@_stroke_block:nnn| is a list of options for the
% rectangle that you will stroke. The second argument is the upper-left cell of
@@ -14332,7 +14463,7 @@ version 2005/12/01 or later.
\group_begin:
\tl_clear:N \l_@@_draw_tl
\dim_set_eq:NN \l_@@_line_width_dim \arrayrulewidth
- \keys_set_known:nn { NiceMatrix / BlockStroke } { #1 }
+ \keys_set_known:nn { nicematrix / BlockStroke } { #1 }
\pgfpicture
\pgfrememberpicturepositiononpagetrue
\pgf@relevantforpicturesizefalse
@@ -14386,7 +14517,7 @@ version 2005/12/01 or later.
%
% Here is the set of keys for the command |\@@_stroke_block:nnn|.
% \begin{macrocode}
-\keys_define:nn { NiceMatrix / BlockStroke }
+\keys_define:nn { nicematrix / BlockStroke }
{
color .tl_set:N = \l_@@_draw_tl ,
draw .code:n =
@@ -14408,7 +14539,7 @@ version 2005/12/01 or later.
\cs_new_protected:Npn \@@_vlines_block:nnn #1 #2 #3
{
\dim_set_eq:NN \l_@@_line_width_dim \arrayrulewidth
- \keys_set_known:nn { NiceMatrix / BlockBorders } { #1 }
+ \keys_set_known:nn { nicematrix / BlockBorders } { #1 }
\@@_cut_on_hyphen:w #2 \q_stop
\tl_set_eq:NN \l_@@_tmpc_tl \l_tmpa_tl
\tl_set_eq:NN \l_@@_tmpd_tl \l_tmpb_tl
@@ -14432,7 +14563,7 @@ version 2005/12/01 or later.
\cs_new_protected:Npn \@@_hlines_block:nnn #1 #2 #3
{
\dim_set_eq:NN \l_@@_line_width_dim \arrayrulewidth
- \keys_set_known:nn { NiceMatrix / BlockBorders } { #1 }
+ \keys_set_known:nn { nicematrix / BlockBorders } { #1 }
\@@_cut_on_hyphen:w #2 \q_stop
\tl_set_eq:NN \l_@@_tmpc_tl \l_tmpa_tl
\tl_set_eq:NN \l_@@_tmpd_tl \l_tmpb_tl
@@ -14464,13 +14595,13 @@ version 2005/12/01 or later.
\cs_new_protected:Npn \@@_stroke_borders_block:nnn #1 #2 #3
{
\dim_set_eq:NN \l_@@_line_width_dim \arrayrulewidth
- \keys_set_known:nn { NiceMatrix / BlockBorders } { #1 }
+ \keys_set_known:nn { nicematrix / BlockBorders } { #1 }
\dim_compare:nNnTF \l_@@_rounded_corners_dim > \c_zero_dim
{ \@@_error:n { borders~forbidden } }
{
\tl_clear_new:N \l_@@_borders_tikz_tl
\keys_set:nV
- { NiceMatrix / OnlyForTikzInBorders }
+ { nicematrix / OnlyForTikzInBorders }
\l_@@_borders_clist
\@@_cut_on_hyphen:w #2 \q_stop
\tl_set_eq:NN \l_@@_tmpc_tl \l_tmpa_tl
@@ -14514,7 +14645,7 @@ version 2005/12/01 or later.
% \end{macrocode}
%
% \begin{macrocode}
-\keys_define:nn { NiceMatrix / OnlyForTikzInBorders }
+\keys_define:nn { nicematrix / OnlyForTikzInBorders }
{
tikz .code:n =
\cs_if_exist:NTF \tikzpicture
@@ -14583,7 +14714,7 @@ version 2005/12/01 or later.
% \bigskip
% Here is the set of keys for the command |\@@_stroke_borders_block:nnn|.
% \begin{macrocode}
-\keys_define:nn { NiceMatrix / BlockBorders }
+\keys_define:nn { nicematrix / BlockBorders }
{
borders .clist_set:N = \l_@@_borders_clist ,
rounded-corners .dim_set:N = \l_@@_rounded_corners_dim ,
@@ -14607,7 +14738,7 @@ version 2005/12/01 or later.
\@@_clip_with_rounded_corners:
\clist_map_inline:nn { #5 }
{
- \keys_set_known:nnN { NiceMatrix / SpecialOffset } { ##1 } \l_tmpa_tl
+ \keys_set_known:nnN { nicematrix / SpecialOffset } { ##1 } \l_tmpa_tl
\use:e { \exp_not:N \path [ \l_tmpa_tl ] }
(
[
@@ -14632,9 +14763,21 @@ version 2005/12/01 or later.
%
% \medskip
% \begin{macrocode}
-\keys_define:nn { NiceMatrix / SpecialOffset }
+\keys_define:nn { nicematrix / SpecialOffset }
{ offset .dim_set:N = \l_@@_offset_dim }
% \end{macrocode}
+%
+% \bigskip
+% In some circonstancies, we want to nullify the command |\Block|. In order to
+% reach that goal, we will link the command |\Block| to the following command
+% |\@@_NullBlock:| which has the same syntax as the standard command |\Block|
+% but which is no-op.
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_NullBlock:
+ { \@@_collect_options:n { \@@_NullBlock_i: } }
+\NewExpandableDocumentCommand \@@_NullBlock_i: { m m D < > { } +m }
+ { }
+% \end{macrocode}
%
%
% \section{How to draw the dotted lines transparently}
@@ -14668,7 +14811,7 @@ version 2005/12/01 or later.
% We will extract some keys and pass the other keys to the environment
% |{NiceArrayWithDelims}|.
% \begin{macrocode}
-\keys_define:nn { NiceMatrix / Auto }
+\keys_define:nn { nicematrix / Auto }
{
columns-type .tl_set:N = \l_@@_columns_type_tl ,
columns-type .value_required:n = true ,
@@ -14679,7 +14822,7 @@ version 2005/12/01 or later.
delimiters / color .value_required:n = true ,
delimiters / max-width .bool_set:N = \l_@@_delimiters_max_width_bool ,
delimiters / max-width .default:n = true ,
- delimiters .code:n = \keys_set:nn { NiceMatrix / delimiters } { #1 } ,
+ delimiters .code:n = \keys_set:nn { nicematrix / delimiters } { #1 } ,
delimiters .value_required:n = true ,
rounded-corners .dim_set:N = \l_@@_tab_rounded_corners_dim ,
rounded-corners .default:n = 4 pt
@@ -14700,7 +14843,7 @@ version 2005/12/01 or later.
% The group is for the protection of the keys.
% \begin{macrocode}
\group_begin:
- \keys_set_known:nnN { NiceMatrix / Auto } { #6 } \l_tmpa_tl
+ \keys_set_known:nnN { nicematrix / Auto } { #6 } \l_tmpa_tl
\use:e
{
\exp_not:N \begin { NiceArrayWithDelims } { #1 } { #2 }
@@ -15069,7 +15212,7 @@ version 2005/12/01 or later.
%
%
% \begin{macrocode}
-\keys_define:nn { NiceMatrix / sub-matrix }
+\keys_define:nn { nicematrix / sub-matrix }
{
extra-height .dim_set:N = \l_@@_submatrix_extra_height_dim ,
extra-height .value_required:n = true ,
@@ -15090,12 +15233,12 @@ version 2005/12/01 or later.
hvlines .meta:n = { hlines, vlines } ,
hvlines .value_forbidden:n = true
}
-\keys_define:nn { NiceMatrix }
+\keys_define:nn { nicematrix }
{
- SubMatrix .inherit:n = NiceMatrix / sub-matrix ,
- NiceArray / sub-matrix .inherit:n = NiceMatrix / sub-matrix ,
- pNiceArray / sub-matrix .inherit:n = NiceMatrix / sub-matrix ,
- NiceMatrixOptions / sub-matrix .inherit:n = NiceMatrix / sub-matrix ,
+ SubMatrix .inherit:n = nicematrix / sub-matrix ,
+ NiceArray / sub-matrix .inherit:n = nicematrix / sub-matrix ,
+ pNiceArray / sub-matrix .inherit:n = nicematrix / sub-matrix ,
+ NiceMatrixOptions / sub-matrix .inherit:n = nicematrix / sub-matrix ,
}
% \end{macrocode}
%
@@ -15103,7 +15246,7 @@ version 2005/12/01 or later.
% The following keys set is for the command |\SubMatrix| itself (not the tuning
% of |\SubMatrix| that can be done elsewhere).
% \begin{macrocode}
-\keys_define:nn { NiceMatrix / SubMatrix }
+\keys_define:nn { nicematrix / SubMatrix }
{
delimiters / color .tl_set:N = \l_@@_delimiters_color_tl ,
delimiters / color .value_required:n = true ,
@@ -15129,7 +15272,7 @@ version 2005/12/01 or later.
{ \@@_error:n { Invalid~name } }
} ,
name .value_required:n = true ,
- rules .code:n = \keys_set:nn { NiceMatrix / rules } { #1 } ,
+ rules .code:n = \keys_set:nn { nicematrix / rules } { #1 } ,
rules .value_required:n = true ,
code .tl_set:N = \l_@@_code_tl ,
code .value_required:n = true ,
@@ -15261,7 +15404,7 @@ version 2005/12/01 or later.
{ \@@_error:nn { Construct~too~large } { \SubMatrix } }
{
\str_clear_new:N \l_@@_submatrix_name_str
- \keys_set:nn { NiceMatrix / SubMatrix } { #5 }
+ \keys_set:nn { nicematrix / SubMatrix } { #5 }
\pgfpicture
\pgfrememberpicturepositiononpagetrue
\pgf@relevantforpicturesizefalse
@@ -15656,6 +15799,7 @@ version 2005/12/01 or later.
{
\nullfont
\c_math_toggle_token
+ \colorlet { current-color } { . }
\@@_color:o \l_@@_delimiters_color_tl
\left .
\vcenter
@@ -15667,7 +15811,7 @@ version 2005/12/01 or later.
}
\right #1
\tl_if_empty:nF { #3 } { _ { \smash { #3 } } }
- ^ { \smash { #4 } }
+ ^ { \color { current-color } \smash { #4 } }
\c_math_toggle_token
}
{ #2 }
@@ -15701,13 +15845,16 @@ version 2005/12/01 or later.
%
% \medskip
% \begin{macrocode}
-\keys_define:nn { NiceMatrix / Brace }
+\keys_define:nn { nicematrix / Brace }
{
left-shorten .bool_set:N = \l_@@_brace_left_shorten_bool ,
left-shorten .default:n = true ,
+ left-shorten .value_forbidden:n = true ,
right-shorten .bool_set:N = \l_@@_brace_right_shorten_bool ,
- shorten .meta:n = { left-shorten , right-shorten } ,
right-shorten .default:n = true ,
+ right-shorten .value_forbidden:n = true ,
+ shorten .meta:n = { left-shorten , right-shorten } ,
+ shorten .value_forbidden:n = true ,
yshift .dim_set:N = \l_@@_brace_yshift_dim ,
yshift .value_required:n = true ,
yshift .initial:n = \c_zero_dim ,
@@ -15742,7 +15889,7 @@ version 2005/12/01 or later.
}
{
\tl_clear:N \l_tmpa_tl
- \keys_set:nn { NiceMatrix / Brace } { #4 }
+ \keys_set:nn { nicematrix / Brace } { #4 }
\tl_if_empty:NF \l_tmpa_tl { \color { \l_tmpa_tl } }
\pgfpicture
\pgfrememberpicturepositiononpagetrue
@@ -15893,7 +16040,7 @@ version 2005/12/01 or later.
\bool_new:N \l_@@_not_empty_bool
\bool_new:N \l_@@_empty_bool
-\keys_define:nn { NiceMatrix / TikzEveryCell }
+\keys_define:nn { nicematrix / TikzEveryCell }
{
not-empty .code:n =
\bool_lazy_or:nnTF
@@ -15918,7 +16065,7 @@ version 2005/12/01 or later.
\IfPackageLoadedTF { tikz }
{
\group_begin:
- \keys_set:nn { NiceMatrix / TikzEveryCell } { #1 }
+ \keys_set:nn { nicematrix / TikzEveryCell } { #1 }
% \end{macrocode}
% The inner pair of braces in the following line is mandatory because, the last
% argument of |\@@_tikz:nnnnn| is \emph{a list of lists} of TikZ keys.
@@ -16208,7 +16355,7 @@ version 2005/12/01 or later.
%
%
% \begin{macrocode}
-\keys_define:nn { NiceMatrix / Package }
+\keys_define:nn { nicematrix / Package }
{
renew-dots .bool_set:N = \l_@@_renew_dots_bool ,
renew-dots .value_forbidden:n = true ,
@@ -16221,7 +16368,7 @@ version 2005/12/01 or later.
no-test-for-array .default:n = true ,
unknown .code:n = \@@_error:n { Unknown~key~for~package }
}
-\ProcessKeysOptions { NiceMatrix / Package }
+\ProcessKeysOptions { nicematrix / Package }
% \end{macrocode}
%
% \bigskip
@@ -16438,7 +16585,7 @@ version 2005/12/01 or later.
~you~try~to~use~more~columns~than~allowed~by~your~
\@@_full_name_env:.\@@_message_hdotsfor:\ The~maximal~number~of~columns~is~
\int_use:N \g_@@_static_num_of_col_int\
- ~(plus~the~potential~exterior~ones).
+ ~(plus~the~potential~exterior~ones).~
This~error~is~fatal.
}
% \end{macrocode}
@@ -17211,9 +17358,10 @@ version 2005/12/01 or later.
\c_@@_available_keys_str
}
{
- The~available~keys~are~(in~alphabetic~order):~b,~B,~borders,~c,~draw,~fill,~
- hlines,~hvlines,~l,~line-width,~name,~opacity,~rounded-corners,~r,~
- respect-arraystretch,~t,~T,~tikz,~transparent~and~vlines.
+ The~available~keys~are~(in~alphabetic~order):~&-in-blocks,~ampersand-in-blocks,~
+ b,~B,~borders,~c,~draw,~fill,~hlines,~hvlines,~l,~line-width,~name,~
+ opacity,~rounded-corners,~r,~respect-arraystretch,~t,~T,~tikz,~transparent~
+ and~vlines.
}
% \end{macrocode}
%
@@ -17347,7 +17495,9 @@ version 2005/12/01 or later.
}
{
The~available~keys~are~(in~alphabetic~order):~
+ &-in-blocks,~
allow-duplicate-names,~
+ ampersand-in-blocks,~
caption-above,~
cell-space-bottom-limit,~
cell-space-limits,~
@@ -17405,6 +17555,8 @@ version 2005/12/01 or later.
}
{
The~available~keys~are~(in~alphabetic~order):~
+ &-in-blocks,~
+ ampersand-in-blocks,~
b,~
baseline,~
c,~
@@ -17455,8 +17607,8 @@ version 2005/12/01 or later.
% \end{macrocode}
%
% \medskip
-% This error message is used for the set of keys |NiceMatrix/NiceMatrix| and
-% |NiceMatrix/pNiceArray| (but not by |NiceMatrix/NiceArray| because, for this
+% This error message is used for the set of keys |nicematrix/NiceMatrix| and
+% |nicematrix/pNiceArray| (but not by |nicematrix/NiceArray| because, for this
% set of keys, there is no |l| and |r|).
% \begin{macrocode}
\@@_msg_new:nnn { Unknown~key~for~NiceMatrix }
@@ -17469,6 +17621,8 @@ version 2005/12/01 or later.
}
{
The~available~keys~are~(in~alphabetic~order):~
+ &-in-blocks,~
+ ampersand-in-blocks,~
b,~
baseline,~
c,~
@@ -17532,6 +17686,8 @@ version 2005/12/01 or later.
}
{
The~available~keys~are~(in~alphabetic~order):~
+ &-in-blocks,~
+ ampersand-in-blocks,~
b,~
baseline,~
c,~
diff --git a/Master/texmf-dist/source/latex/oberdiek/aliascnt.dtx b/Master/texmf-dist/source/latex/oberdiek/aliascnt.dtx
index 47bfec1ee27..7010eb64e13 100644
--- a/Master/texmf-dist/source/latex/oberdiek/aliascnt.dtx
+++ b/Master/texmf-dist/source/latex/oberdiek/aliascnt.dtx
@@ -52,7 +52,7 @@
% use A4 as paper format:
% \PassOptionsToClass{a4paper}{article}
%
-% Programm calls to get the documentation (example):
+% Program calls to get the documentation (example):
% pdflatex aliascnt.dtx
% makeindex -s gind.ist aliascnt.idx
% pdflatex aliascnt.dtx
@@ -308,7 +308,7 @@ and the derived files
% Therefore we must ensure that manipulations to the clear list
% are done with the clear list macro of a real counter.
% \begin{macro}{\AC@findrootcnt}
-% \cs{AC@findrootcnt} walks throught the aliasing relations
+% \cs{AC@findrootcnt} walks through the aliasing relations
% to find the base counter.
% \begin{macrocode}
\newcommand*{\AC@findrootcnt}[1]{%
diff --git a/Master/texmf-dist/source/latex/oberdiek/bmpsize.dtx b/Master/texmf-dist/source/latex/oberdiek/bmpsize.dtx
index 0eec647c99c..bdcf6004d06 100644
--- a/Master/texmf-dist/source/latex/oberdiek/bmpsize.dtx
+++ b/Master/texmf-dist/source/latex/oberdiek/bmpsize.dtx
@@ -54,7 +54,7 @@
% use A4 as paper format:
% \PassOptionsToClass{a4paper}{article}
%
-% Programm calls to get the documentation (example):
+% Program calls to get the documentation (example):
% pdflatex bmpsize.dtx
% makeindex -s gind.ist bmpsize.idx
% pdflatex bmpsize.dtx
@@ -339,7 +339,7 @@ and the derived files
%
% A parser sets the switch \cs{ifbmpsize@ok} to true, if it
% could successfully parse the image file.
-% The width and height are returnd in \cs{bmpsize@width} and
+% The width and height are returned in \cs{bmpsize@width} and
% \cs{bmpsize@height}. If information about density is available,
% it is used to calculate width and height of the image, otherwise
% the values given by option \xoption{defaultresolution} is used.
diff --git a/Master/texmf-dist/source/latex/oberdiek/centernot.dtx b/Master/texmf-dist/source/latex/oberdiek/centernot.dtx
index dd990a33197..aa2cff5f0d8 100644
--- a/Master/texmf-dist/source/latex/oberdiek/centernot.dtx
+++ b/Master/texmf-dist/source/latex/oberdiek/centernot.dtx
@@ -52,7 +52,7 @@
% use A4 as paper format:
% \PassOptionsToClass{a4paper}{article}
%
-% Programm calls to get the documentation (example):
+% Program calls to get the documentation (example):
% pdflatex centernot.dtx
% makeindex -s gind.ist centernot.idx
% pdflatex centernot.dtx
diff --git a/Master/texmf-dist/source/latex/oberdiek/chemarr.dtx b/Master/texmf-dist/source/latex/oberdiek/chemarr.dtx
index 78e1a3cbebb..24989ed9db3 100644
--- a/Master/texmf-dist/source/latex/oberdiek/chemarr.dtx
+++ b/Master/texmf-dist/source/latex/oberdiek/chemarr.dtx
@@ -53,7 +53,7 @@
% use A4 as paper format:
% \PassOptionsToClass{a4paper}{article}
%
-% Programm calls to get the documentation (example):
+% Program calls to get the documentation (example):
% pdflatex chemarr.dtx
% makeindex -s gind.ist chemarr.idx
% pdflatex chemarr.dtx
diff --git a/Master/texmf-dist/source/latex/oberdiek/classlist.dtx b/Master/texmf-dist/source/latex/oberdiek/classlist.dtx
index 8b454645215..370fc269d01 100644
--- a/Master/texmf-dist/source/latex/oberdiek/classlist.dtx
+++ b/Master/texmf-dist/source/latex/oberdiek/classlist.dtx
@@ -52,7 +52,7 @@
% use A4 as paper format:
% \PassOptionsToClass{a4paper}{article}
%
-% Programm calls to get the documentation (example):
+% Program calls to get the documentation (example):
% pdflatex classlist.dtx
% makeindex -s gind.ist classlist.idx
% pdflatex classlist.dtx
@@ -233,7 +233,7 @@ and the derived files
% configured by
% \item[\cs{PrintClassListTitle}] for the title and
% \item[\cs{PrintClassListEntry}] for formatting the entries.
-% See the implemenation how to use these.
+% See the implementation for how to use these.
% \end{description}
%
% \StopEventually{
diff --git a/Master/texmf-dist/source/latex/oberdiek/colonequals.dtx b/Master/texmf-dist/source/latex/oberdiek/colonequals.dtx
index aeae542c39f..007a42cbe5f 100644
--- a/Master/texmf-dist/source/latex/oberdiek/colonequals.dtx
+++ b/Master/texmf-dist/source/latex/oberdiek/colonequals.dtx
@@ -52,7 +52,7 @@
% use A4 as paper format:
% \PassOptionsToClass{a4paper}{article}
%
-% Programm calls to get the documentation (example):
+% Program calls to get the documentation (example):
% pdflatex colonequals.dtx
% makeindex -s gind.ist colonequals.idx
% pdflatex colonequals.dtx
diff --git a/Master/texmf-dist/source/latex/oberdiek/dvipscol.dtx b/Master/texmf-dist/source/latex/oberdiek/dvipscol.dtx
index 0141ae2a947..335196bf918 100644
--- a/Master/texmf-dist/source/latex/oberdiek/dvipscol.dtx
+++ b/Master/texmf-dist/source/latex/oberdiek/dvipscol.dtx
@@ -52,7 +52,7 @@
% use A4 as paper format:
% \PassOptionsToClass{a4paper}{article}
%
-% Programm calls to get the documentation (example):
+% Program calls to get the documentation (example):
% pdflatex dvipscol.dtx
% makeindex -s gind.ist dvipscol.idx
% pdflatex dvipscol.dtx
diff --git a/Master/texmf-dist/source/latex/oberdiek/engord.dtx b/Master/texmf-dist/source/latex/oberdiek/engord.dtx
index 6c759532002..a0ba888a1a0 100644
--- a/Master/texmf-dist/source/latex/oberdiek/engord.dtx
+++ b/Master/texmf-dist/source/latex/oberdiek/engord.dtx
@@ -55,7 +55,7 @@
% use A4 as paper format:
% \PassOptionsToClass{a4paper}{article}
%
-% Programm calls to get the documentation (example):
+% Program calls to get the documentation (example):
% pdflatex engord.dtx
% makeindex -s gind.ist engord.idx
% pdflatex engord.dtx
diff --git a/Master/texmf-dist/source/latex/oberdiek/enparen.dtx b/Master/texmf-dist/source/latex/oberdiek/enparen.dtx
index 773ebc861c9..af503d79dc4 100644
--- a/Master/texmf-dist/source/latex/oberdiek/enparen.dtx
+++ b/Master/texmf-dist/source/latex/oberdiek/enparen.dtx
@@ -52,7 +52,7 @@
% use A4 as paper format:
% \PassOptionsToClass{a4paper}{article}
%
-% Programm calls to get the documentation (example):
+% Program calls to get the documentation (example):
% pdflatex enparen.dtx
% makeindex -s gind.ist enparen.idx
% pdflatex enparen.dtx
@@ -335,12 +335,12 @@ and the derived files
% \subsection{Notes}
%
% \begin{description}
-% \item[Implicite kerning:]
-% Unexpandable stuff might affect the implicite kerning.
+% \item[Implicit kerning:]
+% Unexpandable stuff might affect the implicit kerning.
% The package cannot avoid this, because it need to define
-% and redefine macros at the occurence of each symbol.
+% and redefine macros at the occurrence of each symbol.
% This is done before the opening and after the closing
-% symbol, thus that the implicite kerning inside
+% symbol, thus that the implicit kerning inside
% is not affected.
% \end{description}
%
diff --git a/Master/texmf-dist/source/latex/oberdiek/eolgrab.dtx b/Master/texmf-dist/source/latex/oberdiek/eolgrab.dtx
index d27e99d34ec..87f0aceaa45 100644
--- a/Master/texmf-dist/source/latex/oberdiek/eolgrab.dtx
+++ b/Master/texmf-dist/source/latex/oberdiek/eolgrab.dtx
@@ -58,7 +58,7 @@
% use A4 as paper format:
% \PassOptionsToClass{a4paper}{article}
%
-% Programm calls to get the documentation (example):
+% Program calls to get the documentation (example):
% pdflatex eolgrab.dtx
% makeindex -s gind.ist eolgrab.idx
% pdflatex eolgrab.dtx
diff --git a/Master/texmf-dist/source/latex/oberdiek/fibnum.dtx b/Master/texmf-dist/source/latex/oberdiek/fibnum.dtx
index 9c3f8f79868..de66a377109 100644
--- a/Master/texmf-dist/source/latex/oberdiek/fibnum.dtx
+++ b/Master/texmf-dist/source/latex/oberdiek/fibnum.dtx
@@ -56,7 +56,7 @@
% use A4 as paper format:
% \PassOptionsToClass{a4paper}{article}
%
-% Programm calls to get the documentation (example):
+% Program calls to get the documentation (example):
% pdflatex fibnum.dtx
% bibtex fibnum.aux
% makeindex -s gind.ist fibnum.idx
diff --git a/Master/texmf-dist/source/latex/oberdiek/flags.dtx b/Master/texmf-dist/source/latex/oberdiek/flags.dtx
index 6a2d05c7b44..8834113617e 100644
--- a/Master/texmf-dist/source/latex/oberdiek/flags.dtx
+++ b/Master/texmf-dist/source/latex/oberdiek/flags.dtx
@@ -52,7 +52,7 @@
% use A4 as paper format:
% \PassOptionsToClass{a4paper}{article}
%
-% Programm calls to get the documentation (example):
+% Program calls to get the documentation (example):
% pdflatex flags.dtx
% makeindex -s gind.ist flags.idx
% pdflatex flags.dtx
diff --git a/Master/texmf-dist/source/latex/oberdiek/holtxdoc.dtx b/Master/texmf-dist/source/latex/oberdiek/holtxdoc.dtx
index 9ac40aa5ae9..b9ba295cfa6 100644
--- a/Master/texmf-dist/source/latex/oberdiek/holtxdoc.dtx
+++ b/Master/texmf-dist/source/latex/oberdiek/holtxdoc.dtx
@@ -52,7 +52,7 @@
% use A4 as paper format:
% \PassOptionsToClass{a4paper}{article}
%
-% Programm calls to get the documentation (example):
+% Program calls to get the documentation (example):
% pdflatex holtxdoc.dtx
% makeindex -s gind.ist holtxdoc.idx
% pdflatex holtxdoc.dtx
diff --git a/Master/texmf-dist/source/latex/oberdiek/hypbmsec.dtx b/Master/texmf-dist/source/latex/oberdiek/hypbmsec.dtx
index dd26b08d2b5..2b5781775c5 100644
--- a/Master/texmf-dist/source/latex/oberdiek/hypbmsec.dtx
+++ b/Master/texmf-dist/source/latex/oberdiek/hypbmsec.dtx
@@ -52,7 +52,7 @@
% use A4 as paper format:
% \PassOptionsToClass{a4paper}{article}
%
-% Programm calls to get the documentation (example):
+% Program calls to get the documentation (example):
% pdflatex hypbmsec.dtx
% makeindex -s gind.ist hypbmsec.idx
% pdflatex hypbmsec.dtx
@@ -260,7 +260,7 @@ and the derived files
% \begin{itemize}
% \item An additional second optional argument in square brackets.
% \item An additional optional argument in parentheses (in
-% assoziation with a pdf string that is internally surrounded
+% association with a pdf string that is internally surrounded
% by parentheses, too).
% \end{itemize}
% Because \Package{\filename} stores the original meaning of the
@@ -375,7 +375,7 @@ and the derived files
[2016/05/16 v2.5 Bookmarks in sectioning commands (HO)]
% \end{macrocode}
%
-% Because of redifining the sectioning commands, it is dangerous
+% Because of redefining the sectioning commands, it is dangerous
% to reload the package several times.
% \begin{macrocode}
\@ifundefined{hbs@do}{}{%
@@ -554,7 +554,7 @@ and the derived files
% \end{macrocode}
%
% Other packages are allowed to redefine the sectioning commands,
-% if they does not change the syntax. Therefore the redefinitons
+% if they does not change the syntax. Therefore the redefinitions
% of this package should be done after the other packages.
% \begin{macrocode}
\let\hbs@part \part
diff --git a/Master/texmf-dist/source/latex/oberdiek/hypgotoe.dtx b/Master/texmf-dist/source/latex/oberdiek/hypgotoe.dtx
index 3f6af63a3ee..7a4c55e4511 100644
--- a/Master/texmf-dist/source/latex/oberdiek/hypgotoe.dtx
+++ b/Master/texmf-dist/source/latex/oberdiek/hypgotoe.dtx
@@ -53,7 +53,7 @@
% use A4 as paper format:
% \PassOptionsToClass{a4paper}{article}
%
-% Programm calls to get the documentation (example):
+% Program calls to get the documentation (example):
% pdflatex hypgotoe.dtx
% makeindex -s gind.ist hypgotoe.idx
% pdflatex hypgotoe.dtx
@@ -195,7 +195,7 @@ and the derived files
% \item
% Currently only embedded files and named destinations are supported.
% \item
-% Missing are support for destination arrays and attachted files.
+% Missing are support for destination arrays and attached files.
% \item
% Special characters aren't supported either.
% \end{itemize}
diff --git a/Master/texmf-dist/source/latex/oberdiek/hyphsubst.dtx b/Master/texmf-dist/source/latex/oberdiek/hyphsubst.dtx
index e0fd44bf126..996257b0d43 100644
--- a/Master/texmf-dist/source/latex/oberdiek/hyphsubst.dtx
+++ b/Master/texmf-dist/source/latex/oberdiek/hyphsubst.dtx
@@ -56,7 +56,7 @@
% use A4 as paper format:
% \PassOptionsToClass{a4paper}{article}
%
-% Programm calls to get the documentation (example):
+% Program calls to get the documentation (example):
% pdflatex hyphsubst.dtx
% makeindex -s gind.ist hyphsubst.idx
% pdflatex hyphsubst.dtx
diff --git a/Master/texmf-dist/source/latex/oberdiek/ifdraft.dtx b/Master/texmf-dist/source/latex/oberdiek/ifdraft.dtx
index 0b4918a6d07..7b695054496 100644
--- a/Master/texmf-dist/source/latex/oberdiek/ifdraft.dtx
+++ b/Master/texmf-dist/source/latex/oberdiek/ifdraft.dtx
@@ -52,7 +52,7 @@
% use A4 as paper format:
% \PassOptionsToClass{a4paper}{article}
%
-% Programm calls to get the documentation (example):
+% Program calls to get the documentation (example):
% pdflatex ifdraft.dtx
% makeindex -s gind.ist ifdraft.idx
% pdflatex ifdraft.dtx
diff --git a/Master/texmf-dist/source/latex/oberdiek/iflang.dtx b/Master/texmf-dist/source/latex/oberdiek/iflang.dtx
index fa784b7d453..9eebbd0a8cc 100644
--- a/Master/texmf-dist/source/latex/oberdiek/iflang.dtx
+++ b/Master/texmf-dist/source/latex/oberdiek/iflang.dtx
@@ -57,7 +57,7 @@
% use A4 as paper format:
% \PassOptionsToClass{a4paper}{article}
%
-% Programm calls to get the documentation (example):
+% Program calls to get the documentation (example):
% pdflatex iflang.dtx
% makeindex -s gind.ist iflang.idx
% pdflatex iflang.dtx
@@ -200,7 +200,7 @@ and the derived files
% Package \xpackage{babel} defines \cs{iflanguagename}. As first
% argument it takes a language name and executes the second or
% third argument depending on the current language. This
-% language test is based on hypenation patterns. However, it
+% language test is based on hyphenation patterns. However, it
% is possible that different languages or dialects share the
% same patterns. In such cases \cs{iflanguagename} fails.
%
@@ -211,7 +211,7 @@ and the derived files
%
% \begin{declcs}{IfLanguageName} \M{lang} \M{then} \M{else}
% \end{declcs}
-% Makro \cs{IfLanguageName} compares language \meta{lang} with
+% Macro \cs{IfLanguageName} compares language \meta{lang} with
% the current setting of macro \cs{languagename}. If both
% contains the same name then the \meta{then} part is called,
% otherwise the \meta{else} part.
@@ -562,7 +562,7 @@ and the derived files
% at the conference Bacho\TeX~2005:
% \url{http://www.gust.org.pl/projects/pearls/2005p/david-kastrup/bachotex2005-david-kastrup-pearl1.pdf}
%
-% The orignal code allows macros inside the second string.
+% The original code allows macros inside the second string.
% Because also \cs{languagename} might consists of further
% macros, we need a variant that allows macros in the first
% string, too.
diff --git a/Master/texmf-dist/source/latex/oberdiek/oberdiek.ins b/Master/texmf-dist/source/latex/oberdiek/oberdiek.ins
index dc59a6e0247..099d1f538d0 100644
--- a/Master/texmf-dist/source/latex/oberdiek/oberdiek.ins
+++ b/Master/texmf-dist/source/latex/oberdiek/oberdiek.ins
@@ -3,7 +3,7 @@
%
% Copyright (C)
% 1999, 2001, 2006 Heiko Oberdiek
-% 2016-2020 Oberdiek Package Support Group
+% 2016-2024 Oberdiek Package Support Group
% https://github.com/ho-tex/oberdiek/issues
%
% This work may be distributed and/or modified under the
@@ -40,7 +40,6 @@
\batchinput{flags.dtx}
\batchinput{holtxdoc.dtx}
\batchinput{hypbmsec.dtx}
-\batchinput{hypcap.dtx}
\batchinput{hypgotoe.dtx}
\batchinput{hyphsubst.dtx}
\batchinput{ifdraft.dtx}
@@ -58,7 +57,6 @@
\batchinput{stampinclude.dtx}
\batchinput{tabularht.dtx}
\batchinput{tabularkv.dtx}
-\batchinput{telprint.dtx}
\batchinput{thepdfnumber.dtx}
\batchinput{twoopt.dtx}
diff --git a/Master/texmf-dist/source/latex/oberdiek/oberdiek.tex b/Master/texmf-dist/source/latex/oberdiek/oberdiek.tex
index 3849551d71c..0759250c248 100644
--- a/Master/texmf-dist/source/latex/oberdiek/oberdiek.tex
+++ b/Master/texmf-dist/source/latex/oberdiek/oberdiek.tex
@@ -11,11 +11,11 @@
\newcommand*{\Author}{Heiko Oberdiek}
\newcommand*{\Email}{ho-tex at tug.org}
-\newcommand*{\Date}{2023/01/10}
+\newcommand*{\Date}{2024/07/26}
% Copyright (C) 2006-2016 by
% Heiko Oberdiek
-% Copyright (C) 2016-2023 by
+% Copyright (C) 2016-2024 by
% Oberdiek Package Support Group
%
% This work may be distributed and/or modified under the
@@ -203,8 +203,6 @@
[\entrysep]
\entry{hypbmsec}{Bookmarks in sectioning commands}%
[\entrysep]
-\entry{hypcap}{Adjusting the anchors of captions}%
-[\entrysep]
\entry{hypgotoe}{Links to embedded files}%
[\entrysep]
\entry{hyphsubst}{Substitute hyphenation patterns}%
@@ -239,8 +237,6 @@
[\entrysep]
\entry{tabularkv}{Tabular with key value interface}%
[\entrysep]
-\entry{telprint}{Format German phone numbers}%
-[\entrysep]
\entry{thepdfnumber}{Print PDF numbers with minimal digits}%
[\entrysep]
\entry{twoopt}{Definitions with two optional arguments}%
@@ -391,20 +387,6 @@ a replacement for the bookmarks can be given.
\tocinclude{hypbmsec}
\newpage
-\subsection{\pkgsectformat{hypcap}}
-\label{hypcap}
-\begin{abstract}
-This package tries a solution of the problem with
-hyperref, that links to floats points below the
-caption and not at the beginning of the float.
-Therefore this package divides the task into two
-part, the link setting with \cs{capstart} or
-automatically at the beginning of a float and
-the rest in the \cs{caption} command.
-\end{abstract}
-\tocinclude{hypcap}
-
-\newpage
\subsection{\pkgsectformat{hypgotoe}}
\label{hypgotoe}
\begin{abstract}
@@ -520,7 +502,7 @@ is supported. Index preambles can be given either by means of package
\label{setouterhbox}
\begin{abstract}
If math stuff is set in an \cs{hbox}, then TeX
-performs some optimization and omits the implicite
+performs some optimization and omits the implicit
penalties \cs{binoppenalty} and \cs{relpenalty}.
This packages tries to put stuff into an \cs{hbox}
without getting lost of those penalties.
@@ -578,15 +560,6 @@ especially if package \xpackage{tabularht} is used.
\tocinclude{tabularkv}
\newpage
-\subsection{\pkgsectformat{telprint}}
-\label{telprint}
-\begin{abstract}
-Package \xpackage{telprint} provides \cs{telprint} for formatting
-German phone numbers.
-\end{abstract}
-\tocinclude{telprint}
-
-\newpage
\subsection{\pkgsectformat{thepdfnumber}}
\label{thepdfnumber}
\begin{abstract}
diff --git a/Master/texmf-dist/source/latex/oberdiek/pdfcolparallel.dtx b/Master/texmf-dist/source/latex/oberdiek/pdfcolparallel.dtx
index 17893f98a98..02df672d4eb 100644
--- a/Master/texmf-dist/source/latex/oberdiek/pdfcolparallel.dtx
+++ b/Master/texmf-dist/source/latex/oberdiek/pdfcolparallel.dtx
@@ -53,7 +53,7 @@
% use A4 as paper format:
% \PassOptionsToClass{a4paper}{article}
%
-% Programm calls to get the documentation (example):
+% Program calls to get the documentation (example):
% pdflatex pdfcolparallel.dtx
% makeindex -s gind.ist pdfcolparallel.idx
% pdflatex pdfcolparallel.dtx
diff --git a/Master/texmf-dist/source/latex/oberdiek/pdfcolparcolumns.dtx b/Master/texmf-dist/source/latex/oberdiek/pdfcolparcolumns.dtx
index 77d8aab0716..a382037b426 100644
--- a/Master/texmf-dist/source/latex/oberdiek/pdfcolparcolumns.dtx
+++ b/Master/texmf-dist/source/latex/oberdiek/pdfcolparcolumns.dtx
@@ -53,7 +53,7 @@
% use A4 as paper format:
% \PassOptionsToClass{a4paper}{article}
%
-% Programm calls to get the documentation (example):
+% Program calls to get the documentation (example):
% pdflatex pdfcolparcolumns.dtx
% makeindex -s gind.ist pdfcolparcolumns.idx
% pdflatex pdfcolparcolumns.dtx
diff --git a/Master/texmf-dist/source/latex/oberdiek/pdfcrypt.dtx b/Master/texmf-dist/source/latex/oberdiek/pdfcrypt.dtx
index e4681efa8c2..3c5070829c4 100644
--- a/Master/texmf-dist/source/latex/oberdiek/pdfcrypt.dtx
+++ b/Master/texmf-dist/source/latex/oberdiek/pdfcrypt.dtx
@@ -55,7 +55,7 @@
% use A4 as paper format:
% \PassOptionsToClass{a4paper}{article}
%
-% Programm calls to get the documentation (example):
+% Program calls to get the documentation (example):
% pdflatex pdfcrypt.dtx
% makeindex -s gind.ist pdfcrypt.idx
% pdflatex pdfcrypt.dtx
diff --git a/Master/texmf-dist/source/latex/oberdiek/protecteddef.dtx b/Master/texmf-dist/source/latex/oberdiek/protecteddef.dtx
index cff42cccf7d..21aab0c9fcd 100644
--- a/Master/texmf-dist/source/latex/oberdiek/protecteddef.dtx
+++ b/Master/texmf-dist/source/latex/oberdiek/protecteddef.dtx
@@ -56,7 +56,7 @@
% use A4 as paper format:
% \PassOptionsToClass{a4paper}{article}
%
-% Programm calls to get the documentation (example):
+% Program calls to get the documentation (example):
% pdflatex protecteddef.dtx
% makeindex -s gind.ist protecteddef.idx
% pdflatex protecteddef.dtx
@@ -246,7 +246,7 @@ and the derived files
% is not supported. Macro \meta{cmd} is to be defined as
% \cs{long} macro without star with \meta{num} arguments.
%
-% The number of arguments \meta{num} must be given as explicite digit
+% The number of arguments \meta{num} must be given as explicit digit
% |0| upto |9|. Otherwise the part between the argument \meta{cmd} and
% the \meta{definition text} is taken as parameter text in the syntax
% of vanilla \hologo{TeX}. Examples (with \cs{protected}):
diff --git a/Master/texmf-dist/source/latex/oberdiek/resizegather.dtx b/Master/texmf-dist/source/latex/oberdiek/resizegather.dtx
index 4a078649172..8ec4cc8a13c 100644
--- a/Master/texmf-dist/source/latex/oberdiek/resizegather.dtx
+++ b/Master/texmf-dist/source/latex/oberdiek/resizegather.dtx
@@ -53,7 +53,7 @@
% use A4 as paper format:
% \PassOptionsToClass{a4paper}{article}
%
-% Programm calls to get the documentation (example):
+% Program calls to get the documentation (example):
% pdflatex resizegather.dtx
% makeindex -s gind.ist resizegather.idx
% pdflatex resizegather.dtx
diff --git a/Master/texmf-dist/source/latex/oberdiek/rotchiffre.dtx b/Master/texmf-dist/source/latex/oberdiek/rotchiffre.dtx
index 3023347fe16..aa807540118 100644
--- a/Master/texmf-dist/source/latex/oberdiek/rotchiffre.dtx
+++ b/Master/texmf-dist/source/latex/oberdiek/rotchiffre.dtx
@@ -56,7 +56,7 @@
% use A4 as paper format:
% \PassOptionsToClass{a4paper}{article}
%
-% Programm calls to get the documentation (example):
+% Program calls to get the documentation (example):
% pdflatex rotchiffre.dtx
% makeindex -s gind.ist rotchiffre.idx
% pdflatex rotchiffre.dtx
@@ -214,7 +214,7 @@ and the derived files
% \begin{declcs}{EdefRot} \M{type} \M{cmd} \M{text}
% \end{declcs}
% The \meta{text} is expanded and sanitized. All tokens
-% are letters with catcode 12 (other) with the exeption of
+% are letters with catcode 12 (other) with the exception of
% the space token that has character code 32 (0x20) and
% catcode 10 (space). This follows \hologo{TeX}'s convention of
% \cs{string} and \cs{meaning}.
diff --git a/Master/texmf-dist/source/latex/oberdiek/scrindex.dtx b/Master/texmf-dist/source/latex/oberdiek/scrindex.dtx
index fea57fd1a9d..63deeaab2fc 100644
--- a/Master/texmf-dist/source/latex/oberdiek/scrindex.dtx
+++ b/Master/texmf-dist/source/latex/oberdiek/scrindex.dtx
@@ -53,7 +53,7 @@
% use A4 as paper format:
% \PassOptionsToClass{a4paper}{article}
%
-% Programm calls to get the documentation (example):
+% Program calls to get the documentation (example):
% pdflatex scrindex.dtx
% makeindex -s gind.ist scrindex.idx
% pdflatex scrindex.dtx
@@ -195,7 +195,7 @@ and the derived files
% the standard classes |article|, |report|, and |book|. It
% redefines environment `theindex' for its needs.
% However, it does not know other classes such as KOMA-Script.
-% This package closes the compatibiliy gap between KOMA-Script's
+% This package closes the compatibility gap between KOMA-Script's
% classes and package \xpackage{index}.
%
% Environment |theindex| is redefined to support both package
diff --git a/Master/texmf-dist/source/latex/oberdiek/setouterhbox.dtx b/Master/texmf-dist/source/latex/oberdiek/setouterhbox.dtx
index 001cd278d3d..cc937c16a46 100644
--- a/Master/texmf-dist/source/latex/oberdiek/setouterhbox.dtx
+++ b/Master/texmf-dist/source/latex/oberdiek/setouterhbox.dtx
@@ -57,7 +57,7 @@
% use A4 as paper format:
% \PassOptionsToClass{a4paper}{article}
%
-% Programm calls to get the documentation (example):
+% Program calls to get the documentation (example):
% pdflatex setouterhbox.dtx
% makeindex -s gind.ist setouterhbox.idx
% pdflatex setouterhbox.dtx
@@ -190,7 +190,7 @@ and the derived files
%
% \begin{abstract}
% If math stuff is set in an \cs{hbox}, then TeX
-% performs some optimization and omits the implicite
+% performs some optimization and omits the implicit
% penalties \cs{binoppenalty} and \cs{relpenalty}.
% This packages tries to put stuff into an \cs{hbox}
% without getting lost of those penalties.
@@ -234,7 +234,7 @@ and the derived files
% method we discuss here. Nowadays we have \eTeX\ that extends
% the tool set of a \TeX\ macro programmer. Especially useful
% \eTeX\ was in this package for detecting and dealing with
-% errorneous situations.
+% erroneous situations.
%
% However also nowadays a perfect solution for the problem
% is still missing at macro level. Probably someone has
diff --git a/Master/texmf-dist/source/latex/oberdiek/settobox.dtx b/Master/texmf-dist/source/latex/oberdiek/settobox.dtx
index c38d502a534..c1d7af6ae9a 100644
--- a/Master/texmf-dist/source/latex/oberdiek/settobox.dtx
+++ b/Master/texmf-dist/source/latex/oberdiek/settobox.dtx
@@ -53,7 +53,7 @@
% use A4 as paper format:
% \PassOptionsToClass{a4paper}{article}
%
-% Programm calls to get the documentation (example):
+% Program calls to get the documentation (example):
% pdflatex settobox.dtx
% makeindex -s gind.ist settobox.idx
% pdflatex settobox.dtx
@@ -282,7 +282,7 @@ and the derived files
% c) Print #1 commands.
% d) Print box with frame
%
-% The implemenation looks more weird:
+% The implementation looks more weird:
\makeatletter
\newcommand*{\test}[1]{%
\par
diff --git a/Master/texmf-dist/source/latex/oberdiek/stackrel.dtx b/Master/texmf-dist/source/latex/oberdiek/stackrel.dtx
index 6b3444c33c6..09110de9476 100644
--- a/Master/texmf-dist/source/latex/oberdiek/stackrel.dtx
+++ b/Master/texmf-dist/source/latex/oberdiek/stackrel.dtx
@@ -52,7 +52,7 @@
% use A4 as paper format:
% \PassOptionsToClass{a4paper}{article}
%
-% Programm calls to get the documentation (example):
+% Program calls to get the documentation (example):
% pdflatex stackrel.dtx
% makeindex -s gind.ist stackrel.idx
% pdflatex stackrel.dtx
diff --git a/Master/texmf-dist/source/latex/oberdiek/stampinclude.dtx b/Master/texmf-dist/source/latex/oberdiek/stampinclude.dtx
index 9acd8a61f84..ba468e85916 100644
--- a/Master/texmf-dist/source/latex/oberdiek/stampinclude.dtx
+++ b/Master/texmf-dist/source/latex/oberdiek/stampinclude.dtx
@@ -52,7 +52,7 @@
% use A4 as paper format:
% \PassOptionsToClass{a4paper}{article}
%
-% Programm calls to get the documentation (example):
+% Program calls to get the documentation (example):
% pdflatex stampinclude.dtx
% makeindex -s gind.ist stampinclude.idx
% pdflatex stampinclude.dtx
@@ -225,7 +225,7 @@ and the derived files
% This package \xpackage{stampinclude} goes another way.
% \LaTeX\ reads and writes a separate \xext{aux} file for each
% file that is included by \cs{include}. There \LaTeX\ remembers
-% counter valuses. Changed \xext{tex}
+% counter values. Changed \xext{tex}
% files can therefore be detected by comparing the file date stamp of
% the \xext{tex} file with the date stamp of its \xext{aux} file.
% Since version 1.30.0 \pdfTeX\ provides \cs{pdffilemoddate}
@@ -254,7 +254,7 @@ and the derived files
%
% \subsubsection{Other file dependencies}
%
-% A file that is included by \cs{include} may input ore reference
+% A file that is included by \cs{include} may input or reference
% other files:
% \begin{itemize}
% \item other \TeX\ files using \cs{input},
diff --git a/Master/texmf-dist/source/latex/oberdiek/tabularht.dtx b/Master/texmf-dist/source/latex/oberdiek/tabularht.dtx
index 20688068b07..e6c26f1040f 100644
--- a/Master/texmf-dist/source/latex/oberdiek/tabularht.dtx
+++ b/Master/texmf-dist/source/latex/oberdiek/tabularht.dtx
@@ -53,7 +53,7 @@
% use A4 as paper format:
% \PassOptionsToClass{a4paper}{article}
%
-% Programm calls to get the documentation (example):
+% Program calls to get the documentation (example):
% pdflatex tabularht.dtx
% makeindex -s gind.ist tabularht.idx
% pdflatex tabularht.dtx
@@ -250,7 +250,7 @@ and the derived files
% and add the vertical lines. The lines in a tabular
% with \xpackage{tabularht} support (environments of this package)
% are numbered from left to right. The gap that is
-% controlled by \cs{interrowspace} or inbetween \cs{interrowstart}
+% controlled by \cs{interrowspace} or in between \cs{interrowstart}
% and \cs{interrowstop} is then filled with the detected
% vertical lines.
%
@@ -472,7 +472,7 @@ and the derived files
\def\tabH@spread{spread}
% \end{macrocode}
% First argument is the height of the table,
-% then the orignal arguments for tabular follow.
+% then the original arguments for tabular follow.
% \begin{macrocode}
\newenvironment{tabularht}[1]{%
\tabH@setheight{#1}%
diff --git a/Master/texmf-dist/source/latex/oberdiek/tabularkv.dtx b/Master/texmf-dist/source/latex/oberdiek/tabularkv.dtx
index 57ef5e87457..b324e6e8abc 100644
--- a/Master/texmf-dist/source/latex/oberdiek/tabularkv.dtx
+++ b/Master/texmf-dist/source/latex/oberdiek/tabularkv.dtx
@@ -53,7 +53,7 @@
% use A4 as paper format:
% \PassOptionsToClass{a4paper}{article}
%
-% Programm calls to get the documentation (example):
+% Program calls to get the documentation (example):
% pdflatex tabularkv.dtx
% makeindex -s gind.ist tabularkv.idx
% pdflatex tabularkv.dtx
diff --git a/Master/texmf-dist/source/latex/oberdiek/thepdfnumber.dtx b/Master/texmf-dist/source/latex/oberdiek/thepdfnumber.dtx
index 61eb42684c3..c1aa4bf9fac 100644
--- a/Master/texmf-dist/source/latex/oberdiek/thepdfnumber.dtx
+++ b/Master/texmf-dist/source/latex/oberdiek/thepdfnumber.dtx
@@ -57,7 +57,7 @@
% use A4 as paper format:
% \PassOptionsToClass{a4paper}{article}
%
-% Programm calls to get the documentation (example):
+% Program calls to get the documentation (example):
% pdflatex thepdfnumber.dtx
% makeindex -s gind.ist thepdfnumber.idx
% pdflatex thepdfnumber.dtx
@@ -256,7 +256,7 @@ and the derived files
% \item The decimal part is omitted, if the number is an integer (5, 7).
% \item Trailing zeros from the decimal part are stripped (5, 6, 7, 9).
% \end{itemize}
-% The resulting number representation can be catched with one of the
+% The resulting number representation can be caught with one of the
% following Perl regular expressions:
% \begin{itemize}
% \item |^0$| (zero)
@@ -295,11 +295,11 @@ and the derived files
% \subsection{Input number}
%
% The user macros expect a number as argument. The number can either
-% be given explicitely or as macro that expands in one step
-% to an explicite number, because the first token of the argument
+% be given explicitly or as macro that expands in one step
+% to an explicit number, because the first token of the argument
% is expanded once.
%
-% The explicite number consists of
+% The explicit number consists of
% \begin{itemize}
% \item optional signs `\texttt{+}' and `\texttt{-}',
% \item digits `\texttt{0}' upto `\texttt{9}' and
@@ -320,7 +320,7 @@ and the derived files
% The package is not intended for validating numbers or to
% decide if an argument is a number. Therefore it is an usage
% error to use the user macros with arguments that are not
-% explicite numbers as specified in the previous sections.
+% explicit numbers as specified in the previous sections.
% Nevertheless some error conditions are sometimes recognized.
% Errors are given in form of an undefined command sequence.
% It is the only way to notify \hologo{TeX} in expandable context.
diff --git a/Master/texmf-dist/source/latex/oberdiek/twoopt.dtx b/Master/texmf-dist/source/latex/oberdiek/twoopt.dtx
index 10334f0d3a9..806799fd410 100644
--- a/Master/texmf-dist/source/latex/oberdiek/twoopt.dtx
+++ b/Master/texmf-dist/source/latex/oberdiek/twoopt.dtx
@@ -52,7 +52,7 @@
% use A4 as paper format:
% \PassOptionsToClass{a4paper}{article}
%
-% Programm calls to get the documentation (example):
+% Program calls to get the documentation (example):
% pdflatex twoopt.dtx
% makeindex -s gind.ist twoopt.idx
% pdflatex twoopt.dtx
diff --git a/Master/texmf-dist/source/latex/orcidlink/orcidlink.dtx b/Master/texmf-dist/source/latex/orcidlink/orcidlink.dtx
index e096f502f6e..fcc5a731763 100644
--- a/Master/texmf-dist/source/latex/orcidlink/orcidlink.dtx
+++ b/Master/texmf-dist/source/latex/orcidlink/orcidlink.dtx
@@ -1,6 +1,6 @@
% \iffalse meta-comment
%
-% Copyright (C) 2019-2023 by Leo C. Stein <leo.stein@gmail.com>
+% Copyright (C) 2019-2024 by Leo C. Stein <leo.stein@gmail.com>
% ---------------------------------------------------------------------------
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
@@ -27,9 +27,12 @@
%<*driver>
\documentclass{ltxdoc}
\usepackage[dvipsnames]{xcolor}
-\usepackage{orcidlink}[2023/12/30]
-\hypersetup{colorlinks,urlcolor=NavyBlue,citecolor=NavyBlue,linkcolor=NavyBlue,pdfusetitle}
+\usepackage{orcidlink}[2024/06/25]
+\hypersetup{colorlinks,urlcolor=NavyBlue,citecolor=NavyBlue,linkcolor=NavyBlue}
+\hypersetup{pdftitle={The orcidlink package},pdfauthor={Leo C. Stein},
+ pdfsubject={-}}
\usepackage{graphicx}
+\usepackage{microtype}
\EnableCrossrefs
\CodelineIndex
\RecordChanges
@@ -40,7 +43,7 @@
%</driver>
% \fi
%
-% \CheckSum{41}
+% \CheckSum{59}
%
% \CharacterTable
% {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
@@ -69,6 +72,8 @@
% working correctly with XeTeX. Thanks to Tim Henke for the bug report.}
% \changes{v1.0.5}{2023/12/30}{Turn off TikZ externalization of logos.
% Thanks to github user aquileia for the bug report.}
+% \changes{v1.1.0}{2024/06/25}{Support ORCID's three different ID
+% formats. Thanks to Hugo Heagren for suggestions.}
%
% \DoNotIndex{\newcommand,\newenvironment}
%
@@ -84,8 +89,10 @@
%
% \section{Introduction}
%
-% This is a LaTeX style file to add a macro for inserting a linked
-% ORCiD logo. The package provides exactly one command, |\orcidlink|.
+% This is a LaTeX style file providing a macro for inserting a
+% hyperlinked ORCiD logo. The package also provides three commands
+% for ORCiD's three recommended ID printing formats, and a command for
+% just the ORCiD logo, not linked to anything.
%
% \section{Usage}
%
@@ -113,6 +120,36 @@
% \includegraphics[width=0.5\textwidth]{preview}\newline{}
% The macro is used in the author line of this documentation as well.
%
+% \DescribeMacro{\orcidlogo}
+% If you simply want the ORCiD logo without a hyperlink anywhere, use
+% |\orcidlogo|.
+%
+% ORCiD's \href{https://info.orcid.org/brand-guidelines/}{guidelines}
+% recommend three formats: full, compact, and inline. The three
+% formats are available:
+% \begin{enumerate}
+% \item \DescribeMacro{\orcidlinkf\marg{orcid}} Full format. Example:
+% |\orcidlinkf{0000-0001-7559-9597}| will insert
+% \orcidlinkf{0000-0001-7559-9597}
+% \item \DescribeMacro{\orcidlinkc\marg{orcid}} Compact format.
+% Example: |\orcidlinkc{0000-0001-7559-9597}| will insert
+% \orcidlinkc{0000-0001-7559-9597}
+% \item \DescribeMacro{\orcidlinki\marg{Name}\marg{orcid}} Inline
+% format. Example: |\orcidlinki{Leo C. Stein}{0000-0001-7559-9597}|
+% will insert \orcidlinki{Leo C. Stein}{0000-0001-7559-9597}
+% \end{enumerate}
+%
+% \DescribeMacro{\orcidlinkX\marg{before}\marg{orcid}\marg{after}}
+%
+% The command |\orcidlinkX{before}{orcid}{after}| is a helper macro
+% that's used to implement all of the others. Though it is just an
+% internal helper, I saw no reason to keep it internal.
+% |\orcidlinkX{before}{orcid}{after}| results in
+% \orcidlinkX{before}{orcid}{after}. The entire output is hyperlinked
+% to the ORCiD page. There is a thin space |\,| between ``before,''
+% the logo, and ``after.'' However if ``before'' is empty, the space
+% will be omitted; similarly for ``after.''
+%
% \section{Package Compatibility}
%
% This package relies on \texttt{hyperref} and \texttt{tikz}. If you
@@ -132,10 +169,11 @@
% \begin{macrocode}
\NeedsTeXFormat{LaTeX2e}[1994/06/01]
\ProvidesPackage{orcidlink}
- [2023/12/30 v1.0.5 Linked ORCiD logo macro package]
+ [2024/06/26 v1.1.0 Support ORCID's three different ID formats.]
-%% All I did was package up Milo's code on TeX.SE,
-%% see https://tex.stackexchange.com/a/445583/34063
+%% This started out as Milo's code on TeX.SE,
+%% see https://tex.stackexchange.com/a/445583/34063.
+%% It has since been expanded with more commands.
\RequirePackage{hyperref}
\RequirePackage{tikz}
@@ -168,18 +206,45 @@
% \end{macrocode}
%
-% \begin{macro}{\orcidlink}
+% \begin{macro}{\orcidlogo}
% \begin{macrocode}
-\DeclareRobustCommand\orcidlink[1]{%
+\newcommand{\orcidlogo}{%
\texorpdfstring{%
\setlength{\@curXheight}{\fontcharht\font`X}%
-\href{https://orcid.org/#1}{\XeTeXLinkBox{\mbox{%
+\XeTeXLinkBox{%
\@preventExternalization%
\begin{tikzpicture}[yscale=-\@OrigHeightRecip*\@curXheight,
xscale=\@OrigHeightRecip*\@curXheight,transform shape]
\pic{orcidlogo};
\end{tikzpicture}%
-}}}}{}}
+}}{}}
+% \end{macrocode}
+% \end{macro}
+
+% \begin{macro}{\orcidlinkX}
+% \begin{macrocode}
+\DeclareRobustCommand\orcidlinkX[3]{\href{https://orcid.org/#2}{%
+\ifstrempty{#1}{}{#1\,}\orcidlogo\ifstrempty{#3}{}{\,#3}}}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\orcidlinkf}
+% \begin{macrocode}
+\newcommand{\orcidlinkf}[1]{\orcidlinkX{}{#1}{https://orcid.org/#1}}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\orcidlinkc}
+% \begin{macrocode}
+\newcommand{\orcidlinkc}[1]{\orcidlinkX{}{#1}{#1}}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\orcidlinki}
+% \begin{macrocode}
+\newcommand{\orcidlinki}[2]{\orcidlinkX{#1}{#2}{}}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\orcidlink}
+% \begin{macrocode}
+\newcommand{\orcidlink}[1]{\orcidlinkX{}{#1}{}}
\endinput
% \end{macrocode}
diff --git a/Master/texmf-dist/source/latex/orcidlink/orcidlink.ins b/Master/texmf-dist/source/latex/orcidlink/orcidlink.ins
index 201841f6386..bd2ce9a35c8 100644
--- a/Master/texmf-dist/source/latex/orcidlink/orcidlink.ins
+++ b/Master/texmf-dist/source/latex/orcidlink/orcidlink.ins
@@ -1,4 +1,4 @@
-%% Copyright (C) 2019-2023 by Leo C. Stein <leo.stein@gmail.com>
+%% Copyright (C) 2019-2024 by Leo C. Stein <leo.stein@gmail.com>
%% --------------------------------------------------------------------------
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either version 1.3
@@ -25,7 +25,7 @@
This is a generated file.
-Copyright (C) 2019-2023 by Leo C. Stein <leo.stein@gmail.com>
+Copyright (C) 2019-2024 by Leo C. Stein <leo.stein@gmail.com>
--------------------------------------------------------------------------
This work may be distributed and/or modified under the
conditions of the LaTeX Project Public License, either version 1.3
diff --git a/Master/texmf-dist/source/latex/overarrows/overarrows.dtx b/Master/texmf-dist/source/latex/overarrows/overarrows.dtx
index 419593f5775..ff63a958c39 100644
--- a/Master/texmf-dist/source/latex/overarrows/overarrows.dtx
+++ b/Master/texmf-dist/source/latex/overarrows/overarrows.dtx
@@ -16,14 +16,17 @@
%<package>\NeedsTeXFormat{LaTeX2e}
%<package>\ProvidesPackage{overarrows}
%<*package>
-[2023/02/15 v1.1 Custom extensible arrows over math expressions]
+[2024/07/11 v1.2 Custom extensible arrows over math expressions]
%</package>
%
%<*driver>
\documentclass[nohyperref]{ltxdoc}
+\usepackage{metalogo}
+\usepackage{enumitem}
+\usepackage{array}
\usepackage{overarrows-doc} %^^A defined at end of this file, with guard <docstyle>
-\usepackage[old-arrows, esvect, tikz, pstarrows, allcommands]{overarrows}
+\usepackage[old-arrows, esvect, tikz, pstricks, pstarrows, allcommands]{overarrows}
\EnableCrossrefs
\PageIndex
@@ -36,8 +39,8 @@
%% Arrows used in doc
\usepackage{amssymb}% for \twoheadrightarrow
-\NewOverArrowCommand{amsoverrightarrow}{amsmath=strict, end={\rightarrow}}
-\NewOverArrowCommand{overrightnewarrow}{%
+\NewOverArrowCommand{\amsoverrightarrow}{amsmath=strict, end={\rightarrow}}
+\NewOverArrowCommand{\overrightnewarrow}{%
amsmath, middle config=relbar, end=\rightarrow,
right arrow,
}
@@ -49,22 +52,22 @@
\DeclareMathSymbol{\fldrf}{\mathrel}{esvector}{'026}
\DeclareMathSymbol{\fldrg}{\mathrel}{esvector}{'027}
\DeclareMathSymbol{\fldrh}{\mathrel}{esvector}{'030}
-\NewOverArrowCommand{esveca}{esvect=strict, end={\fldra}}
-\NewOverArrowCommand{esvecb}{esvect=strict, end={\fldrb}}
-\NewOverArrowCommand{esvecc}{esvect=strict, end={\fldrc}}
-\NewOverArrowCommand{esvecd}{esvect=strict, end={\fldrd}}
-\NewOverArrowCommand{esvece}{esvect=strict, end={\fldre}}
-\NewOverArrowCommand{esvecg}{esvect=strict, end={\fldrg}}
-\NewOverArrowCommand{esvech}{esvect=strict, end={\fldrh}}
-\NewOverArrowCommand{vva}{esvect, middle config=auto, end=\fldra}
-\NewOverArrowCommand{esvecf}{esvect=strict, end={\fldrf}}
-\NewOverArrowCommand{vvb}{esvect, middle config=auto, end=\fldrb}
-\NewOverArrowCommand{vvc}{esvect, middle config=auto, end=\fldrc}
-\NewOverArrowCommand{vvd}{esvect, middle config=auto, end=\fldrd}
-\NewOverArrowCommand{vve}{esvect, middle config=auto, end=\fldre}
-\NewOverArrowCommand{vvf}{esvect, middle config=auto, end=\fldrf}
-\NewOverArrowCommand{vvg}{esvect, middle config=auto, end=\fldrg}
-\NewOverArrowCommand{vvh}{esvect, middle config=auto, end=\fldrh}
+\NewOverArrowCommand{\esveca}{esvect=strict, end={\fldra}}
+\NewOverArrowCommand{\esvecb}{esvect=strict, end={\fldrb}}
+\NewOverArrowCommand{\esvecc}{esvect=strict, end={\fldrc}}
+\NewOverArrowCommand{\esvecd}{esvect=strict, end={\fldrd}}
+\NewOverArrowCommand{\esvece}{esvect=strict, end={\fldre}}
+\NewOverArrowCommand{\esvecg}{esvect=strict, end={\fldrg}}
+\NewOverArrowCommand{\esvech}{esvect=strict, end={\fldrh}}
+\NewOverArrowCommand{\vva}{esvect, middle config=auto, end=\fldra}
+\NewOverArrowCommand{\esvecf}{esvect=strict, end={\fldrf}}
+\NewOverArrowCommand{\vvb}{esvect, middle config=auto, end=\fldrb}
+\NewOverArrowCommand{\vvc}{esvect, middle config=auto, end=\fldrc}
+\NewOverArrowCommand{\vvd}{esvect, middle config=auto, end=\fldrd}
+\NewOverArrowCommand{\vve}{esvect, middle config=auto, end=\fldre}
+\NewOverArrowCommand{\vvf}{esvect, middle config=auto, end=\fldrf}
+\NewOverArrowCommand{\vvg}{esvect, middle config=auto, end=\fldrg}
+\NewOverArrowCommand{\vvh}{esvect, middle config=auto, end=\fldrh}
\makeatletter
\newcommand{\unsetoldarrows}{
@@ -94,7 +97,7 @@
%
% \title{The \pkg{overarrows} package\thanks{This document
% corresponds to \pkg{overarrows}~\fileversion, dated \filedate.}}
-% \author{Julien Labb\'e \\ \texttt{Julien.Labbe@univ-grenoble-alpes.fr}}
+% \author{Julien Labb\'e \\ {\small \url{https://github.com/julienlabbe/latex-packages}}}
%
% \maketitle
%
@@ -111,7 +114,7 @@
%<*example>
% \fi
\begin{dispExample}
-\NewOverArrowCommand{overrightharpoon}{%
+\NewOverArrowCommand{\overrightharpoon}{%
end=\rightharpoonup
}
@@ -188,9 +191,9 @@
%
% The \pkg{overarrows} package was primitively written for vectors, but in
% a highly customisable way. It can be used to define a large variety of arrows,
-% using math symbols, or PGF/TikZ commands. It's also possible to create
-% commands that draw the arrows under. Some predefined commands are provided,
-% giving\footnotemark{}, for arrow over:
+% using math symbols, or drawing commands from PGF/TikZ or PSTricks. It's also
+% possible to create commands that draw the arrows under. Some predefined
+% commands are provided, giving\footnotemark{}, for arrow over:
% \footnotetext{Displayed here with the \refOpt{old-arrows} option.}
% \begin{align*}
% \overrightarrow{\alpha+\beta}
@@ -222,34 +225,42 @@
% above\footnotemark{}. For this second convention, \TeX/\LaTeX provides the
% command \cs{vec}, which accents its content (using the \cs{mathaccent}
% command) with the character~\symb{\mathchar "017E\relax}
-% (\cs{mathchar}|"017E| in Computer Modern font).
-% But \symb{\mathchar "017E\relax} isn't extensible, and gives: $\vec{v}$,
-% $\vec{AB}$ or $\vec{\text{grad}}$ (there's no command \cs{widevec} analogous
-% to \cs{widehat}).
+% (\cs{mathchar}|"017E| in Computer Modern font). But \symb{\mathchar
+% "017E\relax} isn't extensible\footnotemark{}, and gives: $\vec{v}$, $\vec{AB}$
+% or $\vec{\text{grad}}$ (there's no command \cs{widevec} analogous to
+% \cs{widehat}).
%
+% \addtocounter{footnote}{-2}%^^A two footnotemarks
+%
+% \stepcounter{footnote}
% \footnotetext{See, for example: International Organization for
% Standardization. (2019). \emph{Quantities and units -- Part 2: Mathematics}
% (ISO Standard No. 80000-2:2019).
% \url{https://www.iso.org/standard/64973.html}.}
%
+% \stepcounter{footnote}
+% \footnotetext{In fact, with the unicode engines \LuaTeX{} and \XeTeX{}, the
+% command \cs{Umathaccent} can now define extensible accents. This is used by
+% the \pkg{unicode-math} package, which also set the arrows displayed by \cs{vec}
+% and \cs{overrightarrow} in a coherent manner.}
+%
% An extensible alternative is given by the command \cs{overrightarrow},
% available in \TeX/\LaTeX, and which is redefined by the commonly used
% \pkg{amsmath} package. But its arrow, built with the \cs{rightarrow} symbol
-% \symb{\rightarrow}, is too large with the default \emph{Computer Modern} font:
-% $\amsoverrightarrow{AB}$. Another alternative is the \pkg{esvect} package,
-% which provides the \cs{vv} command and a set of custom arrows: $\esveca{AB}$,
-% $\esvecb{AB}$, $\esvecc{AB}$, $\esvecd{AB}$, $\esvece{AB}$, $\esvecf{AB}$,
-% $\esvecg{AB}$, $\esvech{AB}$.
+% \symb{\rightarrow}, is too large, using the default \emph{Computer Modern}
+% font: $\amsoverrightarrow{AB}$. Another alternative is the \pkg{esvect}
+% package, which provides the \cs{vv} command and a set of custom arrows:
+% $\esveca{AB}$, $\esvecb{AB}$, $\esvecc{AB}$, $\esvecd{AB}$, $\esvece{AB}$,
+% $\esvecf{AB}$, $\esvecg{AB}$, $\esvech{AB}$.
%
% \subsection{Stack and arrow macros}
%
% It's worth looking at the definition of \pkg{amsmath} \cs{overrightarrow}
-% command:
-% \iffalse
+% command: \iffalse
%<*example>
% \fi
\begin{dispListing}
- \long macro:->\mathpalette {\overarrow@ \rightarrowfill@ }
+\long macro:->\mathpalette {\overarrow@ \rightarrowfill@ }
\end{dispListing}
% \iffalse
%</example>
@@ -314,7 +325,7 @@
% The \pkg{overarrows} package also provides an alternative mechanism.
% When used, the length \cs{overarrowlength} is set, according to the arrow
% command content, and can be employed, for example, to draw arrows using
-% PGF/TikZ or the \LaTeX{} picture environment.
+% PGF/TikZ, PSTricks or the \LaTeX{} picture environment.
%
% \section{Quick start}
%
@@ -382,14 +393,13 @@
% \subsection{Commands creation}
%
% Commands are created with \refCom{NewOverArrowCommand}. This macro take two
-% mandatory arguments : the name of the command (without backslash), and the
-% arrow configuration as comma-separated list of key-values. By default, a right
-% arrow is set:
+% mandatory arguments : the name of the command and the arrow configuration as
+% comma-separated list of key-values. By default, a right arrow is set:
% \iffalse
%<*example>
% \fi
\begin{dispExample}
-\NewOverArrowCommand{myovercmd}{}
+\NewOverArrowCommand{\myovercmd}{}
$\myovercmd{test}$
\end{dispExample}
% \iffalse
@@ -417,7 +427,7 @@ $ v_{sub} \qquad \myovercmd{v}_{sub} \qquad \myovercmd*{v}_{sub} $
%<*example>
% \fi
\begin{dispListing}
-\NewOverArrowCommand{overhooktwoheadrightarrow}{%
+\NewOverArrowCommand{\overhooktwoheadrightarrow}{%
start=\lhook, end=\twoheadrightarrow,
}
\end{dispListing}
@@ -436,12 +446,12 @@ $ v_{sub} \qquad \myovercmd{v}_{sub} \qquad \myovercmd*{v}_{sub} $
% \iffalse
%</example>
% \fi
-% With the previous definition, the result of the command
+% But with the previous definition, the result of the command
% \cs{overhooktwoheadrightarrow} is faulty:
% \iffalse
%<*example>
% \fi
-\NewOverArrowCommand{overhooktwoheadrightarrow}{%
+\NewOverArrowCommand{\overhooktwoheadrightarrow}{%
start=\lhook, end=\twoheadrightarrow,
}
\begin{dispExample}
@@ -459,7 +469,7 @@ $ \overhooktwoheadrightarrow{v} \qquad \overhooktwoheadrightarrow{AB} $
% \fi
\csundef{overhooktwoheadrightarrow}
\begin{dispExample}
-\NewOverArrowCommand{overhooktwoheadrightarrow}{%
+\NewOverArrowCommand{\overhooktwoheadrightarrow}{%
start=\lhook, end=\twoheadrightarrow,
trim start=1.5, trim end=2,
}
@@ -474,16 +484,18 @@ $ \overhooktwoheadrightarrow{v} \qquad \overhooktwoheadrightarrow{AB} $
% If the math font differs from the default \emph{Computer Modern}, the central
% part of the arrow may have inappropriate position or line width. This is
% because the default symbol used for the arrow line is \cs{relbareda}
-% \symb{\relbareda} from the \pkg{esvect} package. If needed, try to set the
-% \refKey{middle} key with the symbol \cs{relbar} \symb{\relbar}. The trimming
-% should also be adapted:
+% \symb{\relbareda} from the \pkg{esvect} package\footnote{Except if the
+% \pkg{unicode-math} package is used with a math font that provides the
+% \cs{harrowextender} symbol (see the \refKey*{middle config}|=auto| key).}.
+% If needed, try to set the \refKey{middle} key with the symbol \cs{relbar}
+% \symb{\relbar}. The trimming should also be adapted:
% \iffalse
%<*example>
% \fi
\csundef{overhooktwoheadrightarrow}
\begin{dispExample}
-\NewOverArrowCommand{overhooktwoheadrightarrow}{%
- start=\lhook, end=\twoheadrightarrow, middle=\relbar, %
+\NewOverArrowCommand{\overhooktwoheadrightarrow}{%
+ start=\lhook, end=\twoheadrightarrow, middle=\relbar,
trim start=0, trim end=3, trim middle=5,
}
$ \overhooktwoheadrightarrow{v} \qquad \overhooktwoheadrightarrow{AB} $
@@ -500,7 +512,7 @@ $ \overhooktwoheadrightarrow{v} \qquad \overhooktwoheadrightarrow{AB} $
%<*example>
% \fi
\begin{dispExample}
-\TestOverArrow{overhooktwoheadrightarrow}
+\TestOverArrow{\overhooktwoheadrightarrow}
\end{dispExample}
% \iffalse
%</example>
@@ -514,7 +526,7 @@ $ \overhooktwoheadrightarrow{v} \qquad \overhooktwoheadrightarrow{AB} $
%<*example>
% \fi
\begin{dispExample}
-\NewOverArrowCommand{OverRightarrow}{%
+\NewOverArrowCommand{\OverRightarrow}{%
start=\Relbar,
middle=\Relbar,
end=\Rightarrow,
@@ -535,7 +547,7 @@ $ \OverRightarrow{v} \qquad \OverRightarrow{AB} $
% \fi
\csundef{OverRightarrow}
\begin{dispExample}
-\NewOverArrowCommand{OverRightarrow}{%
+\NewOverArrowCommand{\OverRightarrow}{%
start={\smallermathstyle\Relbar},
middle={\smallermathstyle\Relbar},
end=\Rightarrow,
@@ -557,7 +569,7 @@ $ \OverRightarrow{v} \qquad \OverRightarrow{AB} $
% \fi
\csundef{OverRightarrow}
\begin{dispExample}
-\NewOverArrowCommand{OverRightarrow}{%
+\NewOverArrowCommand{\OverRightarrow}{%
start={\smallermathstyle\Relbar},
middle={\smallermathstyle\Relbar},
end=\Rightarrow,
@@ -579,7 +591,7 @@ $ \OverRightarrow{v} \qquad \OverRightarrow{AB} $
%<*example>
% \fi
\begin{dispExample}
-\NewOverArrowCommand{OverLeftarrow}{%
+\NewOverArrowCommand{\OverLeftarrow}{%
start={\smallermathstyle\Leftarrow},
middle={\smallermathstyle\Relbar},
end=\Relbar,
@@ -601,7 +613,7 @@ $ \OverLeftarrow{v} \qquad \OverLeftarrow{AB} $
%<*example>
% \fi
\begin{dispExample}
-\NewOverArrowCommand{OverLeftRightarrow}{%
+\NewOverArrowCommand{\UnderLeftRightarrow}{%
start={\smallermathstyle\Leftarrow},
middle={\smallermathstyle\Relbar},
end=\Rightarrow,
@@ -610,7 +622,7 @@ $ \OverLeftarrow{v} \qquad \OverLeftarrow{AB} $
space before arrow=0.5ex,
shift left=0, shift right=0,
}
-$ \OverLeftRightarrow{v} \qquad \OverLeftRightarrow{AB} $
+$ \UnderLeftRightarrow{v} \qquad \UnderLeftRightarrow{AB} $
\end{dispExample}
% \iffalse
%</example>
@@ -650,7 +662,7 @@ $ \tttail $
%<*example>
% \fi
\begin{dispExample}
-\NewOverArrowCommand{overtttailrightarrow}{%
+\NewOverArrowCommand{\overtttailrightarrow}{%
start={\tttail},
end={\rightarrow},
trim start=12,
@@ -683,7 +695,7 @@ $ \overtttailrightarrow{v} \qquad \overtttailrightarrow{AB} $
% \fi
\csundef{overtttailrightarrow}
\begin{dispExample}
-\NewOverArrowCommand{overtttailrightarrow}{%
+\NewOverArrowCommand{\overtttailrightarrow}{%
start={\vcenter{\hbox{$\smallermathstyle\tttail$}}},
end={\rightarrow},
trim start=12,
@@ -710,7 +722,7 @@ $ \overtttailrightarrow{v} \qquad \overtttailrightarrow{AB} $
\begin{dispExample}
\newcommand*{\leftarrowhead}{\usefont{U}{lasy}{m}{n}\symbol{40}}
\newcommand*{\righttarrowhead}{\usefont{U}{lasy}{m}{n}\symbol{41}}
-\NewOverArrowCommand{overrightleftarrow}{%
+\NewOverArrowCommand{\overrightleftarrow}{%
start=\text{\righttarrowhead},
end=\text{\leftarrowhead},
trim start=0.7, trim end=0.7,
@@ -751,7 +763,7 @@ $ \overrightleftarrow{AB} \qquad \scriptstyle\overrightleftarrow{AB} $
% \medskip
%
% To use PGF/TikZ language, the optional argument |tikz| must be passed to
-% \refCom{NewOverArrowCommand} . TikZ picture are not extensible. That's why the
+% \refCom{NewOverArrowCommand}. TikZ pictures are not extensible. That's why the
% \pkg{overarrows} package provides three lengths that can be used in TikZ
% commands:
% \begin{itemize}
@@ -767,7 +779,7 @@ $ \overrightleftarrow{AB} \qquad \scriptstyle\overrightleftarrow{AB} $
%<*example>
% \fi
\begin{dispExample}
-\NewOverArrowCommand[tikz]{overtikzarrow}{}
+\NewOverArrowCommand[tikz]{\overtikzarrow}{}
$ \overtikzarrow{v} \qquad \overtikzarrow{AB} $
\end{dispExample}
% \iffalse
@@ -791,7 +803,7 @@ $ \overtikzarrow{v} \qquad \overtikzarrow{AB} $
%<*example>
% \fi
\begin{dispExample}
-\NewOverArrowCommand[tikz]{overarchedleftrightarrow}{%
+\NewOverArrowCommand[tikz]{\overarchedleftrightarrow}{%
add tikz options={y=\overarrowlength},
add tikz options={line width={\overarrowsmallerthickness}},
path options={arrows={<[scale=0.5]->[scale=0.5]}},
@@ -807,20 +819,72 @@ $ \overarchedleftrightarrow{v} \qquad \overarchedleftrightarrow{ABCD} $
%</example>
% \fi
%
+% \subsection{Drawing the arrow with PSTricks}
+%
+% In addition to PGF/TikZ, the arrow can be drawn with PSTricks macros.
+% For this, the optional argument |pstricks| must be passed to
+% \refCom{NewOverArrowCommand}. Like with
+% |tikz|, the three lengths \refCom{overarrowlength}, \refCom{overarrowthickness}
+% and \refCom{overarrowsmallerthickness} can be used in PSTricks commands.
+% By default, a right arrow is drawn:
+% \iffalse
+%<*example>
+% \fi
+\begin{dispExample}
+\NewOverArrowCommand[pstricks]{\overpstarrow}{}
+$ \overpstarrow{v} \qquad \overpstarrow{AB} $
+\end{dispExample}
+% \iffalse
+%</example>
+% \fi
+% \noindent The \pkg{pstricks} package has to be loaded (for example, using the
+% \refOpt{pstricks} option of the \pkg{overarrows} package)
+%
+% Keys to use PSTricks commands are described in section~\ref{sec:pstricks-keys},
+% page~\pageref{sec:pstricks-keys}. The main keys are \refKey{pstricks command},
+% \refKey{psset}, \refDoc{key:pstricks}{arrow}, \refDoc{key:pstricks}{geometry}
+% an \refDoc{key:pstricks}{line thickness}. Examples:
+% \iffalse
+%<*example>
+% \fi
+\begin{dispExample}
+\NewOverArrowCommand[pstricks]{\overreddisks}{%
+ psset={linecolor=red}, arrow=*-*, center arrow,
+}
+$ \overreddisks{v} \qquad \overreddisks{AB} $
+\end{dispExample}
+\begin{dispExample}
+\NewOverArrowCommand[pstricks]{\ellipticarrow}{%
+ pstricks command={%
+ \psellipticarcn{->}%^^A avoid space before coordinates
+ (0.5\overarrowlength,0.2\overarrowlength)%^^A avoid space before coordinates
+ (0.5\overarrowlength,0.2\overarrowlength)
+ {170}{10}
+ },
+ geometry={(0,0.2\overarrowlength)(\overarrowlength,0.4\overarrowlength)},
+ line thickness={\overarrowsmallerthickness},
+ center arrow,
+}
+$ \ellipticarrow{v} \qquad \ellipticarrow{AB} $
+\end{dispExample}
+% \iffalse
+%</example>
+% \fi
+%
% \subsection{Drawing the arrow with \LaTeX{} picture environment}
%
-% As well as TikZ, the \LaTeX{} |picture| environment can be used to draw the
-% arrow. For this, the optional argument |picture| must be passed to
-% \refCom{NewOverArrowCommand}. Like for TikZ, the three lengths
-% \refCom{overarrowlength}, \refCom{overarrowthickness} and
-% \refCom{overarrowsmallerthickness} can be used in |picture| commands.
-% By default, a right vector is drawn:
+% Without any other package, arrows can also be drawn with the \LaTeX{}
+% |picture| environment. In this case, the optional argument |picture| must be
+% passed to \refCom{NewOverArrowCommand}. As with |tikz| or |pstricks|, the
+% three lengths \refCom{overarrowlength}, \refCom{overarrowthickness} and
+% \refCom{overarrowsmallerthickness} are available and can be used in
+% |picture| drawing commands. By default, a right vector is drawn:
% \iffalse
%<*example>
% \fi
\ltxarrows%^^A classic arrows
\begin{dispExample}
-\NewOverArrowCommand[picture]{overpictarrow}{}
+\NewOverArrowCommand[picture]{\overpictarrow}{}
$ \overpictarrow{v} \qquad \overpictarrow{AB} $
\end{dispExample}
% \iffalse
@@ -835,7 +899,7 @@ $ \overpictarrow{v} \qquad \overpictarrow{AB} $
\pstarrows%^^A pst arrows
\csundef{overpictarrow}
\begin{dispExample}
-\NewOverArrowCommand[picture]{overpictarrow}{}
+\NewOverArrowCommand[picture]{\overpictarrow}{}
$ \overpictarrow{v} \qquad \overpictarrow{AB} $
\end{dispExample}
% \iffalse
@@ -844,13 +908,13 @@ $ \overpictarrow{v} \qquad \overpictarrow{AB} $
%
% Keys to use \LaTeX{} |picture| environment are described in
% section~\ref{sec:picture-keys}, page~\pageref{sec:picture-keys}. The main keys
-% are \refKey{picture command}, \refKey{geometry} an \refDoc{key:picture}{line
-% thickness}. Here is an example:
+% are \refKey{picture command}, \refDoc{key:picture}{geometry} an
+% \refDoc{key:picture}{line thickness}. Here is an example:
% \iffalse
%<*example>
% \fi
\begin{dispExample}
-\NewOverArrowCommand[picture]{overbandedarrow}{
+\NewOverArrowCommand[picture]{\overbandedarrow}{
picture command={%
\qbezier
(0.0\overarrowlength,0)
@@ -875,7 +939,6 @@ $ \overbandedarrow{v} \qquad \overbandedarrow{AB} $
% \subsection{Package options}
% \label{sec:package-options}
%
-%
% The \pkg{overarrows} package accepts many options, given as a comma-separated
% list \meta{options} at package loading:
% \cs{usepackage}|[|\meta{options}|]{overarrows}|.
@@ -889,7 +952,8 @@ $ \overbandedarrow{v} \qquad \overbandedarrow{AB} $
% \begin{docOption}{esvect}
% Loads the \pkg{esvect} package and redefines its vector commands \refCom{vv}
% through the \pkg{overarrows} mechanism. Original \pkg{esvect} \cs{vv} macro
-% is still available with \refCom{esvectvv}.
+% is still available with \refCom{esvectvv}. The \pkg{esvect} font description
+% is fixed to allow any font sizes.
%
% The \pkg{esvect} package provides the symbol \cs{relbareda} \symb{\relbareda}
% which is smaller and often more flexible than the classic one \cs{relbar}
@@ -1098,6 +1162,16 @@ $ \overbandedarrow{v} \qquad \overbandedarrow{AB} $
% library are loaded independently.
% \end{docOption}
%
+% \begin{docOption}{pstricks}
+% Loads the package \pkg{pstricks-add}.
+%
+% Note that, as it, this will compile with \LaTeX{}, \LuaLaTeX{} and
+% \XeLaTeX{}, but not with \makebox{pdf\LaTeX} (see the PSTricks
+% documentation). PSTricks arrows, drawn with the |pstricks| method, are
+% always available, even if this option is not set, provided the
+% \pkg{pstricks} package is loaded independently.
+% \end{docOption}
+%
% \begin{docOption}{pstarrows}
% Loads the \pkg{pict2e} package, with its option |pstarrows|. Vectors using
% \LaTeX{} |picture| environment gives then \pstarrows$\overpictarrow{AB}$
@@ -1117,6 +1191,7 @@ $ \overbandedarrow{v} \qquad \overbandedarrow{AB} $
% \end{docOption}
%
% \begin{docOption}{subother}
+% \tcbdocmarginnote{\tcbdocnew{v1.1 2023/02/15}}
% Sets to 12 (\emph{other} catcode category) the catcode of the ``|_|" symbol
% used for subscript detection, when this is enabled by the key \refKey{detect
% subscripts} (see the section~\ref{sec:non-standard-subscripts},
@@ -1124,6 +1199,7 @@ $ \overbandedarrow{v} \qquad \overbandedarrow{AB} $
% \end{docOption}
%
% \begin{docOption}{subactive}
+% \tcbdocmarginnote{\tcbdocnew{v1.1 2023/02/15}}
% Sets to 13 (\emph{active} catcode category) the catcode of the ``|_|" symbol
% used for subscript detection, when this is enabled by the key \refKey{detect
% subscripts} (see the section~\ref{sec:non-standard-subscripts},
@@ -1142,45 +1218,51 @@ $ \overbandedarrow{v} \qquad \overbandedarrow{AB} $
% \begin{docCommands}{%
% {
% doc name=NewOverArrowCommand,
-% doc parameter=\oarg{method}\marg{name}\marg{keys},
+% doc parameter=\oarg{method}\marg{command}\marg{keys},
% },
% {
% doc name=RenewOverArrowCommand,
-% doc parameter=\oarg{method}\marg{name}\marg{keys},
+% doc parameter=\oarg{method}\marg{command}\marg{keys},
% },
% {
% doc name=ProvideOverArrowCommand,
-% doc parameter=\oarg{method}\marg{name}\marg{keys},
+% doc parameter=\oarg{method}\marg{command}\marg{keys},
% },
% {
% doc name=DeclareOverArrowCommand,
-% doc parameter=\oarg{method}\marg{name}\marg{keys},
+% doc parameter=\oarg{method}\marg{command}\marg{keys},
% },
% }
-% Creates the command \cs{\meta{name}} and its starred variant
-% \cs{\meta{name}*}. The starred variant \cs{\meta{name}*} removes the extra
+% Creates the command \meta{command} and its starred variant
+% \meta{command}|*|. The starred variant \meta{command}|*| removes the extra
% end space generated by the arrow, which is suitable, as example, when
% a subscript follows.
%
+% \tcbdocmarginnote{\tcbdocupdated{v1.2 2024/07/11}}
+% \meta{command} can be given with or without backslash (prior to the version
+% 1.2, only the name, without backslash, was accepted).
+%
% \begin{description}
-% \item[\cs{NewOverArrowCommand}] raises an error if \cs{\meta{name}} is
-% already defined.
+% \item[\cs{NewOverArrowCommand}] raises an error if \meta{command} is
+% already defined.
%
-% \item[\cs{RenewOverArrowCommand}] raises an error if \cs{\meta{name}} is undefined.
+% \item[\cs{RenewOverArrowCommand}] raises an error if \meta{command}
+% is undefined.
%
-% \item[\cs{ProvideOverArrowCommand}] sets \cs{\meta{name}} if the command is
-% undefined and does nothing if it is already defined, without raising
-% any error.
+% \item[\cs{ProvideOverArrowCommand}] sets \meta{command} if the command is
+% undefined and does nothing if it is already defined, without raising
+% any error.
%
-% \item[\cs{DeclareOverArrowCommand}] sets \cs{\meta{name}}, whether the
-% command is already defined
-% or not, without raising any error.
+% \item[\cs{DeclareOverArrowCommand}] sets \meta{command}, whether the command
+% is already defined or not, without raising any error.
% \end{description}
%
% The \meta{method} used to draw the arrow must be:
% \begin{description}
% \item[|symb|] to draw the arrow by symbols assemblage (default);
% \item[|tikz|] to draw the arrow with PGF/TikZ;
+% \item[|pstricks|] to draw the arrow with PSTricks;
+% \tcbdocmarginnote{\tcbdocnew{v1.2 2024/07/11}}
% \item[|picture|] to draw the arrow with the \LaTeX{}
% |picture| environment.
% \end{description}
@@ -1196,7 +1278,7 @@ $ \overbandedarrow{v} \qquad \overbandedarrow{AB} $
%<*example>
% \fi
\begin{dispExample}
-\NewOverArrowCommand[tikz]{myoverarrow}{arrows={Bar-Bar}, center arrow}
+\NewOverArrowCommand[tikz]{\myoverarrow}{arrows={Bar-Bar}, center arrow}
$ \myoverarrow{v} \qquad \myoverarrow{ABCD} $
\end{dispExample}
% \iffalse
@@ -1207,19 +1289,23 @@ $ \myoverarrow{v} \qquad \myoverarrow{ABCD} $
% \begin{docCommands}{%
% {
% doc name=TestOverArrow,
-% doc parameter=\oarg{pattern}\marg{name},
+% doc parameter=\oarg{pattern}\marg{command},
% },
% {
% doc name=TestOverArrow*,
-% doc parameter=\oarg{pattern}\marg{name},
+% doc parameter=\oarg{pattern}\marg{command},
% },
% }
-% Displays the result of the command \meta{name} for patterns of various
+% Displays the result of the command \meta{command} for patterns of various
% lengths and for the four math styles. A custom \meta{pattern} can be added
% to the predefined ones.
%
% The starred variant \cs{TestOverArrow*} displays a full report, including
-% kerning tests of the commands \cs{\meta{name}} and \cs{\meta{name}*} .
+% kerning tests of the commands \meta{command} and \meta{command}|*|.
+%
+% \tcbdocmarginnote{\tcbdocupdated{v1.2 2024/07/11}}
+% \meta{command} can be given with or without backslash (prior to the version
+% 1.2, only the name, without backslash, was accepted).
%
% \iffalse
%<*example>
@@ -1261,9 +1347,9 @@ $ \myoverarrow{v} \qquad \myoverarrow{ABCD} $
% \begin{docCommand}{smallermathstyle}{}
% Applies the next math style, smaller than the current. That is:
% \begin{itemize}
-% \item sets \cs{scriptstyle} if the current math style is \cs{displaystyle}
+% \item uses \cs{scriptstyle} if the current math style is \cs{displaystyle}
% or \cs{textstyle};
-% \item sets \cs{scriptscriptstyle} if the current math style is
+% \item uses \cs{scriptscriptstyle} if the current math style is
% \cs{scriptstyle};
% \item does nothing if the current math style is \cs{scriptscriptstyle}.
% \end{itemize}
@@ -1283,19 +1369,20 @@ $ \displaystyle AB \quad \smallermathstyle AB
%
% \end{docCommand}
%
-% \subsubsection{Useful lengths for TikZ or \texttt{picture} environment}
+% \subsubsection{Useful lengths for TikZ, PSTricks or \texttt{picture} environment}
%
-% Arrows drawn with graphic languages, like PGF/TikZ or the \LaTeX{} |picture|
-% environment, are not extensible. The three lengths \refLen*{overarrowlength},
-% \refLen*{overarrowthickness} and \refLen*{overarrowsmallerthickness} are
-% computed at each utilisation of a command set with the |tikz| or |picture|
-% method, so they can be used in drawing commands.
+% Arrows drawn with graphic languages, like PGF/TikZ, PSTricks or the \LaTeX{}
+% |picture| environment, are not extensible. The three lengths
+% \refLen*{overarrowlength}, \refLen*{overarrowthickness} and
+% \refLen*{overarrowsmallerthickness} are computed at each utilisation of
+% a command set with the |tikz|, |pstricks| or |picture| method, so they can be
+% used in drawing commands.
%
% \iffalse
%<*example>
% \fi
\begin{dispExample*}{grow to left by=-2em}
-\NewOverArrowCommand[tikz]{overparabola}{%
+\NewOverArrowCommand[tikz]{\overparabola}{%
path options={x=\overarrowlength, line width=\overarrowsmallerthickness},
path={(0,0) parabola[parabola height=0.2\overarrowlength] (1,0)},
arrows={-}, center arrow, min length=30,
@@ -1320,8 +1407,13 @@ $\scriptstyle \overparabola{v} \qquad \overparabola{ABCD} $ \par
% \item |\fontdimen 8 \scriptscriptfont 3| in
% \cs{scriptscriptstyle}.
% \end{itemize}
+%
+% \tcbdocmarginnote{\tcbdocupdated{v1.2 2024/07/11}}
+% Theses settings are adapted when the package \pkg{unicode-math} is loaded
+% (using \cs{Umathoverbarrule} with \LuaLaTeX{} or |\fontdimen 54|, family~2
+% with \XeLaTeX{} --- see the manual of \pkg{unicode-math}).
% \end{docLength}
-%
+%
% \begin{docLength}{overarrowsmallerthickness}
% Is set to the default rule thickness of the next smaller math style.
% That is:
@@ -1330,6 +1422,11 @@ $\scriptstyle \overparabola{v} \qquad \overparabola{ABCD} $ \par
% \item |\fontdimen 8 \scriptscriptfont 3| in \cs{scriptstyle} or
% \cs{scriptscriptstyle}.
% \end{itemize}
+%
+% \tcbdocmarginnote{\tcbdocupdated{v1.2 2024/07/11}}
+% Theses settings are adapted when the package \pkg{unicode-math} is loaded
+% (using \cs{Umathoverbarrule} with \LuaLaTeX{} or |\fontdimen 54|, family~2
+% with \XeLaTeX{} --- see the manual of \pkg{unicode-math}).
% \end{docLength}
%
% \subsubsection{Vectors macros}
@@ -1507,8 +1604,9 @@ $ \esvectvv*{\imath}{0} \quad \esvectvv*{e}{r} \quad \esvectvv*{L}{\Delta} $
% page~\pageref{sec:macro-for-commands-creation} for the documentation of
% commands creation):
% \begin{itemize}
-% \item \meta{number}| = 0 | for the |symb| method (default);
+% \item \meta{number}| = 0 | for the |symb| method (method by default);
% \item \meta{number}| = 12| for the |tikz| method;
+% \item \meta{number}| = 12| for the |pstricks| method;
% \item \meta{number}| = 18| for the |picture| method.
% \end{itemize}
%
@@ -1516,7 +1614,7 @@ $ \esvectvv*{\imath}{0} \quad \esvectvv*{e}{r} \quad \esvectvv*{L}{\Delta} $
%<*example>
% \fi
\begin{dispExample}
-\NewOverArrowCommand{overlongarrow}{min length=50}
+\NewOverArrowCommand{\overlongarrow}{min length=50}
$ \overlongarrow{v} \qquad \overlongarrow{ABCDEF} $
\end{dispExample}
% \iffalse
@@ -1550,7 +1648,7 @@ $ \overlongarrow{v} \qquad \overlongarrow{ABCDEF} $
%<*example>
% \fi
\begin{dispExample}
-\NewOverArrowCommand{underhooks}{%
+\NewOverArrowCommand{\underhooks}{%
start={\lhook}, end={\rhook}, trim=1,
arrow under, shift leftright=-4,
}
@@ -1580,8 +1678,8 @@ $ \underhooks{v} \qquad \underhooks{AB} $
% page~\pageref{sec:macro-for-commands-creation} for the documentation of
% commands creation):
% \begin{itemize}
-% \item \meta{number}| = 0 | for the |symb| method (default);
-% \item \meta{number}| = -2| for the |tikz| and |picture| methods.
+% \item \meta{number}| = 0 | for the |symb| method (method by default);
+% \item \meta{number}| = -2| for the |tikz|, |pstricks| and |picture| methods.
% \end{itemize}
%
%\end{docKey}
@@ -1590,7 +1688,7 @@ $ \underhooks{v} \qquad \underhooks{AB} $
%<*example>
% \fi
\begin{dispExample*}{grow to left by=-2em}
-\NewOverArrowCommand{lookback}{%
+\NewOverArrowCommand{\lookback}{%
start={\leftarrow}, end={\rightharpoondown},
shift left=-50, shift right=-10,
}
@@ -1658,7 +1756,7 @@ $ \lookback{\text{look back}} $
%<*example>
% \fi
\begin{dispExample*}{grow to left by=-2em}
-\NewOverArrowCommand{overharpoonsdown}{%
+\NewOverArrowCommand{\overharpoonsdown}{%
start=\leftharpoondown, end=\rightharpoondown, center arrow,
space before arrow=-0.2ex, space after arrow=0.3ex,
}
@@ -1693,7 +1791,7 @@ $ \dot{\overharpoonsdown{v}} \qquad \ddot{\overharpoonsdown{AB}}$
%<*example>
% \fi
\begin{dispExample}
-\NewOverArrowCommand{autosub}{detect subscripts}
+\NewOverArrowCommand{\autosub}{detect subscripts}
$ \imath_0 \qquad \autosub{\imath}_0 \qquad
{\autosub{\imath}}_0 \qquad {\autosub*{\imath}}_0 $
\end{dispExample}
@@ -1745,7 +1843,7 @@ $ \imath_0 \qquad \autosub{\imath}_0 \qquad
%<*example>
% \fi
\begin{dispExample}
-\NewOverArrowCommand{smalleroverrightarrow}{%
+\NewOverArrowCommand{\smalleroverrightarrow}{%
start={\smallermathstyle\relbar},
middle={\smallermathstyle\relbareda},
end={\rightarrow},
@@ -1784,16 +1882,26 @@ $ \smalleroverrightarrow{v} \qquad \smalleroverrightarrow{AB} $
% Clears \refKey{trim start}, \refKey{trim middle} and \refKey{trim end}.
% \end{docKey}
%
-%\begin{docKey}{middle config}{=auto\textbar relbar\textbar relbareda}{no default}
-% Sets a suitable configuration for the keys \refKey{middle} and \refKey{trim middle}:
+%\begin{docKey}{middle config}{=auto\textbar relbar\textbar relbareda\textbar harrowextender}{no default}
+% Sets a suitable configuration for the keys \refKey{middle} and \refKey{trim
+% middle}:
% \begin{description}
-% \item[For \refKey*{middle config}| = relbar|,] \refKey{middle} is set to
-% \cs{relbar} \symb{\relbar} and \refKey{trim middle} to |2.5|.
-% \item[For \refKey*{middle config}| = relbareda|,] \refKey{middle} is set to
-% \cs{relbareda} \symb{\relbareda} and \refKey{trim middle} to |1|.
-% \item[For \refKey*{middle config}| = auto|,] \refKey{middle} is set with
-% \refKey*{middle config}| = relabareda| if the option \refOpt{esvect} is set
-% (which is the default) and \refKey*{middle config}| = relabar| if not.
+% \item[For \refKey*{middle config}| = relbar|,] \refKey{middle} is set to
+% \cs{relbar} \symb{\relbar} and \refKey{trim middle} to |2.5|.
+% \item[For \refKey*{middle config}| = relbareda|,] \refKey{middle} is set to
+% \cs{relbareda} \symb{\relbareda} and \refKey{trim middle} to |1|.
+% \item[For \refKey*{middle config}| = harrowextender|,]
+% \tcbdocmarginnote{\tcbdocnew{v1.2 2024/07/11}}
+% \refKey{middle} is set to \cs{harrowextender} and \refKey{trim middle} to
+% |0|.
+% \item[For \refKey*{middle config}| = auto|,]
+% \tcbdocmarginnote{\tcbdocupdated{v1.2 2024/07/11}}
+% if \cs{harrowextender} is provided by the math font\footnote{See the
+% documentation of the package \pkg{unicode-math}.}, \refKey{middle} is set
+% with \refKey*{middle config}| = harrowextender|. If \cs{harrowextender}
+% isn't availlable, \refKey{middle} is set with \refKey*{middle config}%
+% | = relbareda| if the option \refOpt{esvect} is set (which is the
+% default) and \refKey*{middle config}| = relabar| if not.
% \end{description}
%\end{docKey}
%
@@ -1880,14 +1988,14 @@ $ \smalleroverrightarrow{v} \qquad \smalleroverrightarrow{AB} $
% commands creation), the |tikz| method is chosen, then the arrow is drawn by
% the command:
% \begin{center}
-% \cs{tikz}|[|\refKey*{tikz options}|]{|\refKey*{tikz command}|}|
+% \cs{tikz}|[<|\refKey*{tikz options}|>]{<|\refKey*{tikz command}|>}|
% \end{center}
% \noindent where \refKey{tikz options} and \refKey{tikz command} are two keys
% described below. When \refKey*{tikz command} is let unset, the drawing command
% turns into:
% \begin{center}
-% \cs{tikz}|[|\refKey*{tikz options}|]{|\cs{draw}|[|\refKey*{path options}|]|
-% \refKey*{path}|;}|
+% \cs{tikz}|[<|\refKey*{tikz options}|>]{|\cs{draw}|[<|\refKey*{path options}|>]|
+% |<|\refKey*{path}|>;}|
% \end{center}
%
% The best way to customise |tikz| arrows is then to set the keys \refKey{tikz
@@ -1899,7 +2007,7 @@ $ \smalleroverrightarrow{v} \qquad \smalleroverrightarrow{AB} $
%<*example>
% \fi
\begin{dispExample*}{grow to left by=-2em}
-\NewOverArrowCommand[tikz]{overdotteddoublearrow}{%
+\NewOverArrowCommand[tikz]{\overdotteddoublearrow}{%
add tikz options={blue}, add path options={densely dotted},
arrows={->[scale=0.5]>[scale=0.5]}, thinner,
min length=20, space after arrow={0.3ex},
@@ -1910,16 +2018,18 @@ $ \overdotteddoublearrow{v} \qquad \overdotteddoublearrow{AB} $
%</example>
% \fi
%
+% \bigskip
+%
% The following keys are available when the |tikz| method is chosen.
%
-% \begin{docKey}[][before lower=\medskip\par]
+% \begin{docKey}[][before lower=\bigskip\par]
% {tikz options}{=\marg{TikZ options}}
% {no default, initially |x=|\cs{overarrowlength}|, line
% width=|\cs{overarrowthickness}}
% Sets TikZ options to \meta{TikZ options}.
%\end{docKey}
%
-% \begin{docKey}[][before lower=\medskip\par]
+% \begin{docKey}[][before lower=\bigskip\par]
% {path options}{=\marg{path options}}
% {no default, initially |arrows={-Classical TikZ Rightarrow}, cap=round|}
% Sets TikZ path options to \meta{path options}.
@@ -1957,21 +2067,102 @@ $ \overdotteddoublearrow{v} \qquad \overdotteddoublearrow{AB} $
% value \cs{draw}|[|\refKey*{path options}|] |\refKey*{path}|;| is used.
%\end{docKey}
%
+% \subsubsection{PSTricks settings}
+% \label{sec:pstricks-keys}
+%
+% \tcbdocmarginnote{\tcbdocnew{v1.2 2024/07/11}}
+% If, at command creation (see section~\ref{sec:macro-for-commands-creation},
+% page~\pageref{sec:macro-for-commands-creation} for the documentation of
+% commands creation), the |pstricks| method is chosen, then the arrow is drawn
+% by:
+% \begin{flushleft}\leftskip=3cm
+% \cs{begin}|{pspicture}<|\refDoc{key:pstricks}*{geometry}|>%|\\
+% \quad\cs{psset}|{linewidth=<|\refDoc{key:pstricks}*{line thickness}|>}%|\\
+% \quad\cs{psset}|{<|\refKey*{psset}|>}%|\\
+% \quad|<|\refKey*{pstricks command}|>%|\par
+% \cs{end}|{pspicture}%|
+% \end{flushleft}
+% \noindent where \refDoc{key:pstricks}{geometry}, \refDoc{key:pstricks}{line
+% thickness} \refKey*{psset} and \refKey*{pstricks command} are four keys
+% described below.
+%
+%\iffalse
+%<*example>
+% \fi
+\begin{dispExample*}{grow to left by=-2em}
+\NewOverArrowCommand[pstricks]{\overloopandarrow}{
+ pstricks command={%
+ \pscurve{->}(0,0)
+ (0.6\overarrowlength,0.05\overarrowlength)
+ (0.5\overarrowlength,0.1\overarrowlength)
+ (0.4\overarrowlength,0.05\overarrowlength)
+ (\overarrowlength,0)
+ },
+ geometry={(0,0)(\overarrowlength,0.2\overarrowlength)},
+ space after arrow=2pt, min length=20,
+ geometry={(0,0)(\overarrowlength,0.2\overarrowlength)},
+}
+$ \overloopandarrow{v} \qquad \overloopandarrow{AB} $
+\end{dispExample*}
+% \iffalse
+%</example>
+% \fi
+%
+% \bigskip
+%
+% The following keys are available when the |pstricks| method is chosen.
+%
+% \begin{docKey}[][before lower=\bigskip\par]
+% {pstricks command}{=\marg{pstricks command}}
+% {no default, initially \cs{psline}|\{->\}(0,0)(|\refCom*{overarrowlength}|,0)|}
+% Sets the |pspicture| command to \meta{pstricks command}.
+% \end{docKey}
+%
+% \begin{docKey}[][doc label={pstricks:arrow}]%^^A same name as for TikZ
+% {arrow}{=\marg{arrow}}
+% {no default, initially |->|}
+% Sets \refKey{pstricks command} with
+% |\psline{|\meta{arrow}|}(0,0)(|\refCom*{overarrowlength}|,0)|.
+% \end{docKey}
+%
+% \begin{docKey}[][]
+% {psset}{=\marg{pstricks setting}}
+% {no default, initially empty}
+% Sets \meta{pstricks setting} with \cs{psset}.
+% \end{docKey}
+%
+% \begin{docKey}[][before lower=\bigskip\par, doc label={pstricks:geometry}]%^^A same name as for picture
+% {geometry}{=\marg{pstricks geometry specification}}
+% {no default, initially |(0,-0.5ex)(|\refCom*{overarrowlength}|,1ex)|}
+% Sets the |pspicture| geometry to \meta{pstricks geometry specification}.
+% \end{docKey}
+%
+% \begin{docKey}[][doc label={pstricks:line thickness}]%^^A same name as for TikZ
+% {line thickness}{=\marg{length}}{no default}
+% Sets the line thickness to \meta{length}.
+% \end{docKey}
+%
+% \begin{docKey}[][doc label={pstricks:thinner}]%^^A same name as for TikZ
+% {thinner}{}{}
+% Sets the keys \refDoc{key:pstricks}{line thickness} with
+% \cs{overarrowsmallerthickness}.
+% \end{docKey}
+%
% \subsubsection{Picture environment settings}
% \label{sec:picture-keys}
%
% If, at command creation (see section~\ref{sec:macro-for-commands-creation},
% page~\pageref{sec:macro-for-commands-creation} for the documentation of
% commands creation), the |picture| method is chosen, then the arrow is drawn
-% with by:
+% by:
% \begin{flushleft}\leftskip=3cm
-% \cs{begin}|{picture}|\refKey*{geometry}|%|\\
-% \quad\cs{linethickness}|{|\refDoc{key:picture}*{line thickness}|}%|\\
-% \quad\refKey*{picture command}|%|\par
+% \cs{begin}|{picture}<|\refDoc{key:picture}*{geometry}|>%|\\
+% \quad\cs{linethickness}|{<|\refDoc{key:picture}*{line thickness}|>}%|\\
+% \quad|<|\refKey*{picture command}|>%|\par
% \cs{end}|{picture}%|
% \end{flushleft}
-% \noindent where \refKey{geometry}, \refDoc{key:picture}{line thickness} and
-% \refKey*{picture command} are three keys described below.
+% \noindent where \refDoc{key:picture}{geometry}, \refDoc{key:picture}{line
+% thickness} and \refKey*{picture command} are three keys described below.
%
%\iffalse
%<*example>
@@ -1979,7 +2170,7 @@ $ \overdotteddoublearrow{v} \qquad \overdotteddoublearrow{AB} $
\begin{dispExample*}{grow to left by=-2em}
% ^^A \arc and \roundcap commands are from the pict2e package
% ^^A this example needs \usepackage{pict2e} in the preamble
- \NewOverArrowCommand[picture]{overarc}{%
+ \NewOverArrowCommand[picture]{\overarc}{%
picture command={%
\roundcap
\put(0.5\overarrowlength,0){\arc[180,0]{0.6\overarrowlength}}
@@ -1994,15 +2185,18 @@ $ \overdotteddoublearrow{v} \qquad \overdotteddoublearrow{AB} $
% \iffalse
%</example>
% \fi
-% The following keys are available when the |picture| method is chosen.
%
-% \begin{docKey}[][before lower=\medskip\par]
+% \bigskip
+%
+%The following keys are available when the |picture| method is chosen.
+%
+% \begin{docKey}[][before lower=\bigskip\par]
% {picture command}{=\marg{picture command}}
% {no default, initially \cs{put}|(0,0)\{|\cs{vector}|(1,0)\{|\refCom*{overarrowlength}|\}\}|}
% Sets picture command to \meta{picture command}.
% \end{docKey}
%
-% \begin{docKey}[][before lower=\medskip\par]
+% \begin{docKey}[][before lower=\bigskip\par, doc label={picture:geometry}]%^^A same name as for pstricks
% {geometry}{=\marg{picture geometry specification}}
% {no default, initially |(|\refCom*{overarrowlength}|,1ex)(0,-0.5ex)|}
% Sets picture geometry to \meta{picture geometry specification}.
@@ -2029,6 +2223,7 @@ $ \overdotteddoublearrow{v} \qquad \overdotteddoublearrow{AB} $
% \subsubsection{Advanced commands}
%
% \begin{docCommand}{SetOverArrowsSubscriptCommand}{\marg{command}}
+% \tcbdocmarginnote{\tcbdocnew{v1.1 2023/02/15}}
% Sets to \meta{command} the command used for subscript detection, when this
% is enabled by the key \refKey{detect subscripts} (see the
% section~\ref{sec:non-standard-subscripts},
@@ -2131,6 +2326,12 @@ $ \overdotteddoublearrow{v} \qquad \overdotteddoublearrow{AB} $
% \symb{\relbareda} from the \pkg{esvect} package. This can be fixed with the
% \refOpt{noesvect} option.
%
+% Depending of the math font, predefined commands may be faulty. For example, at
+% the time of writing, hooks vertical position is incorrect with \emph{Asana
+% Math} or \cs{harrowextender} is badly positioned with \emph{Stix two Math}
+% (for the smallest math styles), \emph{Libertinus Math} and
+% \emph{GFSNeohellenicMath}.
+%
% \subsubsection{Detection of non standard subscripts}
% \label{sec:non-standard-subscripts}
%
@@ -2225,11 +2426,25 @@ $ \overdotteddoublearrow{v} \qquad \overdotteddoublearrow{AB} $
%
% \subsection{Changelog}
%
-% \begin{description}
-% \item[v1.1] Support for non-standard subscripts
-% \item[v1.0.1] Bug fix for under* options.
-% \item[v1.0] Initial version.
-% \end{description}
+% \begingroup
+% \renewcommand{\arraystretch}{2}
+% \begin{tabular*}{\linewidth}
+% {@{} l @{\extracolsep{\fill}} p{0.9\linewidth} @{}}
+% v1.2 & \noindent\par\vspace{-\baselineskip}
+% \begin{itemize}[left=0pt, topsep=0pt, partopsep=0pt]
+% \item Fix compatibility issues with \pkg{unicode-math}.
+% \item Allow to draw the arrow with PSTricks.
+% \item Make \pkg{esvect} handle all font sizes.
+% \item Rewrite starred variant for better performances.
+% \end{itemize}
+% \\
+% v1.1 & Support for non-standard subscripts.
+% \\
+% v1.0.1 & Bug fix for under* options.
+% \\
+% v1.0 & Initial version.
+% \end{tabular*}
+% \endgroup
%
% \StopEventually{}
%
@@ -2250,6 +2465,7 @@ $ \overdotteddoublearrow{v} \qquad \overdotteddoublearrow{AB} $
\newif\ifovar@option@oldarrows@
\newif\ifovar@option@esvect@ \ovar@option@esvect@true \PassOptionsToPackage{f}{esvect}
\newif\ifovar@option@tikz@
+\newif\ifovar@option@pstricks@
\newif\ifovar@option@pstarrows@
\newif\ifovar@detectsubscripts@
\newif\ifovar@option@subother@
@@ -2280,6 +2496,8 @@ $ \overdotteddoublearrow{v} \qquad \overdotteddoublearrow{AB} $
%
% \subsubsection*{Declaration of options}
%
+% \changes{v1.2}{2024/07/11}{Add option pstricks}
+%
% \begin{macrocode}
\DeclareOption{esvect}{\ovar@option@esvect@true}
\DeclareOption{noesvect}{\ovar@option@esvect@false}
@@ -2293,6 +2511,7 @@ $ \overdotteddoublearrow{v} \qquad \overdotteddoublearrow{AB} $
\DeclareOption{esvecth}{\ovar@option@esvect@true\PassOptionsToPackage{h}{esvect}}
\DeclareOption{old-arrows}{\ovar@option@oldarrows@true}
\DeclareOption{tikz}{\ovar@option@tikz@true}
+\DeclareOption{pstricks}{\ovar@option@pstricks@true}
\DeclareOption{pstarrows}{\ovar@option@pstarrows@true}
\DeclareOption{subscripts}{\ovar@detectsubscripts@true}
\DeclareOption{subother}{\ovar@option@subother@true}
@@ -2381,23 +2600,42 @@ $ \overdotteddoublearrow{v} \qquad \overdotteddoublearrow{AB} $
\RequirePackage{amsmath}
\RequirePackage{etoolbox}
% \end{macrocode}
+%
% Option \refOpt{old-arrows}. Configuration of arrows used for
% predefined commands.
+% \changes{v1.2}{2024/07/11}{Use \cs{def} instead of \cs{let} for
+% \cs{ovar@rightarrow} and \cs{ovar@leftarrow}}
% \begin{macrocode}
-\let\ovar@rightarrow\rightarrow
-\let\ovar@leftarrow\leftarrow
+\def\ovar@rightarrow{\rightarrow}
+\def\ovar@leftarrow{\leftarrow}
\ifovar@option@oldarrows@
\RequirePackage[old]{old-arrows}
- \let\ovar@rightarrow\varrightarrow
- \let\ovar@leftarrow\varleftarrow
+ \def\ovar@rightarrow{\varrightarrow}
+ \def\ovar@leftarrow{\varleftarrow}
\fi
% \end{macrocode}
+%
% Option \refOpt{esvect}.
% \begin{macrocode}
\ifovar@option@esvect@
\RequirePackage{esvect}
+% \end{macrocode}
+% \changes{v1.2}{2024/07/11}{Fix esvect font sizes}
+% Fix font description in |uesvect.fd| to allow any sizes (taken from Enrico
+% Gregorio, \url{https://tex.stackexchange.com/a/689863/})
+% \begin{macrocode}
+ \DeclareFontFamily{U}{esvect}{}
+ \DeclareFontShape{U}{esvect}{m}{n}{
+ <-5.5> vect5
+ <5.5-6.5> vect6
+ <6.5-7.5> vect7
+ <7.5-8.5> vect8
+ <8.5-9.5> vect9
+ <9.5-> vect10
+ }{}
\fi
% \end{macrocode}
+%
% Option \refOpt{tikz}.
% \begin{macrocode}
\ifovar@option@tikz@
@@ -2405,6 +2643,14 @@ $ \overdotteddoublearrow{v} \qquad \overdotteddoublearrow{AB} $
\usetikzlibrary{arrows.meta}
\fi
% \end{macrocode}
+%
+% Option \refOpt{pstricks}.
+% \begin{macrocode}
+\ifovar@option@pstricks@
+ \RequirePackage{pstricks-add}
+\fi
+% \end{macrocode}
+%
% Option \refOpt{pstarrows}.
% \begin{macrocode}
\ifovar@option@pstarrows@
@@ -2412,6 +2658,43 @@ $ \overdotteddoublearrow{v} \qquad \overdotteddoublearrow{AB} $
\fi
% \end{macrocode}
%
+% Add hook rules to apply settings after \pkg{unicode-math}.
+% \begin{macrocode}
+\DeclareHookRule{begindocument}{overarrows}{after}{unicode-math-luatex}
+\DeclareHookRule{begindocument}{overarrows}{after}{unicode-math-xetex}
+% \end{macrocode}
+%
+% \changes{v1.2}{2024/07/11}{Use \cs{harrowextender}, if availlable.}
+% Set \cs{ovar@auto@middle} and \cs{ovar@auto@trim@middle}, used by
+% configurations made with \refKey*{middle config}|=auto|.
+% \begin{macrocode}
+\AddToHook{begindocument}[overarrows]
+ {%
+ \ifdef{\relbareda}
+ {%
+ \gdef\ovar@auto@middle{\relbareda}
+ \gdef\ovar@auto@trim@middle{1}
+ }
+ {%
+ \gdef\ovar@auto@middle{\relbar}
+ \gdef\ovar@auto@trim@middle{2.5}
+ }%
+ \@ifpackageloaded{unicode-math}
+ {%
+% \end{macrocode}
+% Test of \cs{harrowextender} availability taken from Enrico Gregorio,
+% (\url{https://tex.stackexchange.com/a/218407/}).
+% \begin{macrocode}
+ \check@mathfonts
+ \iffontchar\textfont\tw@\string"23AF
+ \gdef\ovar@auto@middle{\mathrel\harrowextender}
+ \gdef\ovar@auto@trim@middle{0}
+ \fi
+ }
+ {}%
+ }
+% \end{macrocode}
+%
% \subsection*{Configuration of subscripts detection}
%
% \changes{v1.1}{2023/02/15}{Support for non-standard subscripts}
@@ -2424,6 +2707,7 @@ $ \overdotteddoublearrow{v} \qquad \overdotteddoublearrow{AB} $
% \end{macro}
%
% Initial configuration.
+% \changes{v1.2}{2024/07/11}{Remove useless \cs{AtBeginDocument}}
% \begin{macrocode}
\SetOverArrowsSubscriptCommand{_}
% \end{macrocode}
@@ -2432,7 +2716,7 @@ $ \overdotteddoublearrow{v} \qquad \overdotteddoublearrow{AB} $
\ifovar@option@subother@
\begingroup
\catcode `_=12
- \AddToHook{begindocument/end}{\SetOverArrowsSubscriptCommand{_}}
+ \SetOverArrowsSubscriptCommand{_}%
\endgroup
\fi
% \end{macrocode}
@@ -2441,7 +2725,7 @@ $ \overdotteddoublearrow{v} \qquad \overdotteddoublearrow{AB} $
\ifovar@option@subactive@
\begingroup
\catcode `_=13
- \AddToHook{begindocument/end}{\SetOverArrowsSubscriptCommand{_}}
+ \SetOverArrowsSubscriptCommand{_}%
\endgroup
\fi
% \end{macrocode}
@@ -2662,12 +2946,25 @@ $ \overdotteddoublearrow{v} \qquad \overdotteddoublearrow{AB} $
}
}
},
+% \end{macrocode}
+% \changes{v1.2}{2024/07/11}{Add config \refKey*{middle config}|=harrowextender|}
+% \begin{macrocode}
+ middle config/harrowextender/.code={%
+ \pgfkeysalso{%
+ middle={\harrowextender},
+ trim middle={0},
+ }
+ },
+% \end{macrocode}
+% Set \refKey*{middle config} with (hopefully) a good configuration. It would be
+% better to reuse the previous \refKey*{middle config} settings, but we have to
+% wait for the |begindocument| hook to know which one to use.
+% \begin{macrocode}
middle config/auto/.code={%
- \ifovar@option@esvect@
- \pgfkeysalso{middle config=relbareda}
- \else
- \pgfkeysalso{middle config=relbar}
- \fi
+ \pgfkeysalso{%
+ middle={\ovar@auto@middle},
+ trim middle={\ovar@auto@trim@middle},
+ }
},
% \end{macrocode}
% \refKey{amsmath}.
@@ -2775,6 +3072,59 @@ $ \overdotteddoublearrow{v} \qquad \overdotteddoublearrow{AB} $
}
% \end{macrocode}
%
+% \subsubsection*{Keys for the \texttt{pstricks} method}
+%
+% \changes{v1.2}{2024/07/11}{Add the method pstricks}
+%
+% \begin{macrocode}
+\SetOverArrowsMethod[lens]{pstricks}{%
+% \end{macrocode}
+% Arrow macro.
+% \begin{macrocode}
+ no arrow macro hook/.code={%
+ \ovar@set{%
+ arrow macro/.expanded={%
+ $\noexpand\mkern \expandonce{\ovar@shift@left} mu\noexpand\relax$%
+ \noexpand\begin{pspicture}\expandonce{\ovar@pstricks@geometry}%
+ \noexpand\psset{linewidth=\expandonce{\ovar@pstricks@linethickness}}%
+ \noexpand\psset{\expandonce{\ovar@pstricks@psset}}%
+ \expandonce{\ovar@pstricks@command}%
+ \noexpand\end{pspicture}%
+ $\noexpand\mkern \expandonce{\ovar@shift@right} mu\noexpand\relax$%
+ }
+ }
+ },
+% \end{macrocode}
+% Pstricks parts: \refKey{pstricks command}, \refKey{psset},
+% \refDoc{key:pstricks}{geometry}, \refDoc{key:pstricks}{line thickness}.
+% \begin{macrocode}
+ pstricks command/.store in=\ovar@pstricks@command,
+ psset/.store in=\ovar@pstricks@psset,
+ geometry/.store in=\ovar@pstricks@geometry,
+ line thickness/.store in=\ovar@pstricks@linethickness,
+ pstricks command/.value required,
+ psset/.value required,
+ geometry/.value required,
+ line thickness/.value required,
+% \end{macrocode}
+% Pstricks handy key: \refDoc{key:pstricks}{arrow}, \refDoc{key:pstricks}{thinner}.
+% \begin{macrocode}
+ arrow/.style={pstricks command={\psline{##1}(0,0)(\overarrowlength,0)}},%
+ arrow/.value required,%
+ thinner/.style={line thickness={\overarrowsmallerthickness}},%
+ thinner/.value forbidden,%
+% \end{macrocode}
+% Initial configuration.
+% \begin{macrocode}
+ shift right=-2,
+ min length=12,
+ geometry={(0,-0.5ex)(\overarrowlength,0.5ex)},%
+ line thickness={\overarrowthickness},%
+ arrow={->},%
+ psset={},%
+}
+% \end{macrocode}
+%
% \subsubsection*{Keys for the \texttt{picture} method}
%
% \begin{macrocode}
@@ -2795,7 +3145,7 @@ $ \overdotteddoublearrow{v} \qquad \overdotteddoublearrow{AB} $
}
},
% \end{macrocode}
-% Picture parts: \refKey{picture command}, \refKey{geometry},
+% Picture parts: \refKey{picture command}, \refDoc{key:picture}{geometry},
% \refDoc{key:picture}{line thickness}.
% \begin{macrocode}
picture command/.store in=\ovar@picture@command,
@@ -2831,9 +3181,9 @@ $ \overdotteddoublearrow{v} \qquad \overdotteddoublearrow{AB} $
Previous definition will be overridden}
}{}
% \end{macrocode}
-% Use a default value of |3.5 mu|, as recommended by egreg (see
+% Use a default value of |3.5 mu|, as recommended by Enrico Gregorio (see
% \url{https://tex.stackexchange.com/a/471736}). \cs{joinrel}
-% uses a value of 3 mu.
+% uses a value of 3 mu.
% \begin{macrocode}
\DeclareRobustCommand{\xjoinrel}[1][3.5]{\mathrel{\mkern-#1mu}}
% \end{macrocode}
@@ -2872,7 +3222,6 @@ $ \overdotteddoublearrow{v} \qquad \overdotteddoublearrow{AB} $
\newlength{\overarrowlength}
\newlength{\overarrowthickness}
\newlength{\overarrowsmallerthickness}
-\newlength{\ovar@extralength}
\newlength{\ovar@tempdim}
% \end{macrocode}
%
@@ -2891,26 +3240,75 @@ $ \overdotteddoublearrow{v} \qquad \overdotteddoublearrow{AB} $
% \end{macro}
%
% \begin{macro}{\ovar@set@arrowthickness}
+% \begin{macro}{\ovar@set@arrowthickness@UM@lua}
% Sets \refLen{overarrowthickness} and \refLen{overarrowsmallerthickness}.\\
-% |#1|: arrow length\\
-% |#2|: math style
+% |#1|: math style
+%
+% Set to the default rule thickness of the current math style, normaly given by
+% \cs{fontdimen} 8 family 3. With \pkg{unicode-math}, use instead:
+% \begin{itemize}
+% \item \cs{fontdimen} 54 family 2 with XeTeX,
+% \item \cs{Umathoverbarrule} with LuaTex.
+% \end{itemize}
+% \changes{v1.2}{2024/07/11}{Get the correct rule thickness with unicode-math}
% \begin{macrocode}
-\def\ovar@set@arrowthickness#1{% use rule thickness=\fontdimen 8 font family 3
+\def\ovar@rulethickness@fontdimen{8}
+\def\ovar@rulethickness@family{3}
+\def\ovar@set@arrowthickness#1{%
\ifx#1\displaystyle%
- \overarrowthickness = \fontdimen 8 \textfont 3%
- \overarrowsmallerthickness = \fontdimen 8 \scriptfont 3%
+ \overarrowthickness =
+ \fontdimen \ovar@rulethickness@fontdimen \textfont \ovar@rulethickness@family%
+ \overarrowsmallerthickness =
+ \fontdimen \ovar@rulethickness@fontdimen \scriptfont \ovar@rulethickness@family%
\else\ifx#1\textstyle%
- \overarrowthickness = \fontdimen 8 \textfont 3%
- \overarrowsmallerthickness = \fontdimen 8 \scriptfont 3%
+ \overarrowthickness =
+ \fontdimen \ovar@rulethickness@fontdimen \textfont \ovar@rulethickness@family%
+ \overarrowsmallerthickness =
+ \fontdimen \ovar@rulethickness@fontdimen \scriptfont \ovar@rulethickness@family%
\else\ifx#1\scriptstyle%
- \overarrowthickness = \fontdimen 8 \scriptfont 3%
- \overarrowsmallerthickness = \fontdimen 8 \scriptscriptfont 3%
+ \overarrowthickness =
+ \fontdimen \ovar@rulethickness@fontdimen \scriptfont \ovar@rulethickness@family%
+ \overarrowsmallerthickness =
+ \fontdimen \ovar@rulethickness@fontdimen \scriptscriptfont \ovar@rulethickness@family%
\else%
- \overarrowthickness = \fontdimen 8 \scriptscriptfont 3%
+ \overarrowthickness =
+ \fontdimen \ovar@rulethickness@fontdimen \scriptscriptfont \ovar@rulethickness@family%
\overarrowsmallerthickness = \overarrowthickness%
\fi\fi\fi%
}
% \end{macrocode}
+% \pkg{unicode-math} with LuaTeX version.
+% \begin{macrocode}
+\def\ovar@set@arrowthickness@UM@lua#1{%
+ \overarrowthickness = \Umathoverbarrule #1
+ \ifx#1\displaystyle%
+ \overarrowsmallerthickness = \Umathoverbarrule \textstyle%
+ \else\ifx#1\textstyle%
+ \overarrowsmallerthickness = \Umathoverbarrule \scriptstyle%
+ \else%
+ \overarrowsmallerthickness = \Umathoverbarrule \scriptscriptstyle%
+ \fi\fi%
+}
+% \end{macrocode}
+% Test which version to use.
+% \begin{macrocode}
+\AddToHook{begindocument}[overarrows]
+ {%
+ \@ifpackageloaded{unicode-math-luatex}
+ {%
+ \global\let\ovar@set@arrowthickness\ovar@set@arrowthickness@UM@lua
+ }
+ {%
+ \@ifpackageloaded{unicode-math-xetex}
+ {%
+ \gdef\ovar@rulethickness@fontdimen{54}
+ \gdef\ovar@rulethickness@family{2}
+ }
+ {}
+ }
+ }
+% \end{macrocode}
+% \end{macro}
% \end{macro}
%
% \subsubsection*{Stack macros}
@@ -3017,18 +3415,39 @@ $ \overdotteddoublearrow{v} \qquad \overdotteddoublearrow{AB} $
%
% \subsubsection*{Macro for commands creation}
%
+% \changes{v1.2}{2024/07/11}{Allow backslash in command name}
+% In the initial version, the commands names must be given as csname (without
+% backslash). To harmonize the syntax with standard \cs{NewDocumentCommand},
+% define an argument processor so that both
+% \cs{NewOverArrowCommand}|{\myarrow}| and
+% \cs{NewOverArrowCommand}|{myarrow}| are accepted.
+%
+% \begin{macrocode}
+\ExplSyntaxOn
+\cs_new_protected:Npn \__overarrows_processor_strip_escape_char:n #1
+ {
+ \regex_match:nnTF { ^\cC. } { #1 }
+ { \tl_set:Nx \ProcessedArgument { \cs_to_str:N #1 } }
+ { \tl_set:Nx \ProcessedArgument { #1 } }
+ }
+\cs_new_eq:NN \ovar@cmdname@processor \__overarrows_processor_strip_escape_char:n
+\ExplSyntaxOff
+% \end{macrocode}
+%
% \begin{macro}{\DeclareOverArrowCommand}
% \begin{macrocode}
-\NewDocumentCommand{\DeclareOverArrowCommand}{ O{symb} m m }{%
+\NewDocumentCommand{\DeclareOverArrowCommand}{
+ O{symb} >{\ovar@cmdname@processor} m m
+}{%
\begingroup
\ovar@set@common
\ifcsdef{ovar@set@#1}{%
\csuse{ovar@set@#1}
}{%
\PackageError{overarrows}{Unknown method #1}
- {Try with 'symb', 'tikz' or 'picture'}
+ {Try with 'symb', 'tikz', 'pstriks' or 'picture'}
}
- \ovar@set{#3 }
+ \ovar@set{#3}
\ifdef{\ovar@macro@arrow}{}{%
\ovar@set{no arrow macro hook}
}
@@ -3050,7 +3469,7 @@ $ \overdotteddoublearrow{v} \qquad \overdotteddoublearrow{AB} $
\ifovar@detectsubscripts@%
\csgdef{ovar@#2@auto}##1{%
% \end{macrocode}
-% \vspace{-2\smallskipamount}%^^A remove space between code blocs
+% \vspace{-2\smallskipamount}%^^A remove space between code blocks
% \changes{v1.1}{2023/02/15}{Support for non-standard subscripts}
% \begin{macrocode}
\@ifnextchar \ovar@subcmd {%
@@ -3080,7 +3499,9 @@ $ \overdotteddoublearrow{v} \qquad \overdotteddoublearrow{AB} $
%
% \begin{macro}{\ProvideOverArrowCommand}
% \begin{macrocode}
-\NewDocumentCommand{\ProvideOverArrowCommand}{ O{symb} m m }{%
+\NewDocumentCommand{\ProvideOverArrowCommand}{
+ O{symb} >{\ovar@cmdname@processor} m m
+}{%
\ifcsdef{#2}{}{
\DeclareOverArrowCommand[#1]{#2}{#3}
}
@@ -3090,7 +3511,9 @@ $ \overdotteddoublearrow{v} \qquad \overdotteddoublearrow{AB} $
%
% \begin{macro}{\NewOverArrowCommand}
% \begin{macrocode}
-\NewDocumentCommand{\NewOverArrowCommand}{ O{symb} m m }{%
+\NewDocumentCommand{\NewOverArrowCommand}{
+ O{symb} >{\ovar@cmdname@processor} m m
+}{%
\ifcsdef{#2}{%
\PackageError{overarrows}{Command \csname #2\endcsname already defined}%
{You have used \protect\NewOverArrowCommand\space with a command that
@@ -3105,7 +3528,9 @@ $ \overdotteddoublearrow{v} \qquad \overdotteddoublearrow{AB} $
%
% \begin{macro}{\RenewOverArrowCommand}
% \begin{macrocode}
-\NewDocumentCommand{\RenewOverArrowCommand}{ O{symb} m m }{%
+\NewDocumentCommand{\RenewOverArrowCommand}{
+ O{symb} >{\ovar@cmdname@processor} m m
+}{%
\ifcsundef{#2}{%
\PackageError{overarrows}{Command \csname #2\endcsname undefined}%
{You have used \protect\RenewOverArrowCommand\space with a command that was
@@ -3120,17 +3545,21 @@ $ \overdotteddoublearrow{v} \qquad \overdotteddoublearrow{AB} $
%
% \subsubsection*{Starred variant}
%
+% \changes{v1.2}{2024/07/11}{Use boxes in starred variant for better performances}
% \begin{macro}{\ovar@starversion}
% |#1|: definition (stack macro + arrow macro)\\
% |#2|: math style\\
% |#3|: content
% \begin{macrocode}
+\newsavebox\ovar@tempbox
\def\ovar@starversion#1#2#3{%
- #1#2{#3}%
- \settowidth{\ovar@extralength}{$\m@th#1#2{#3}$}
- \settowidth{\ovar@tempdim}{$\m@th#2{#3}$}
- \deflength{\ovar@extralength}{0.5\ovar@extralength-0.5\ovar@tempdim}%
- \kern-\ovar@extralength%
+ \sbox{\ovar@tempbox}{$\m@th #1#2{#3}$}%
+ \usebox{\ovar@tempbox}%
+% \end{macrocode}
+% Remove the extra space added by the arrow.
+% \begin{macrocode}
+ \settowidth{\ovar@tempdim}{$\m@th #2{#3}$}%
+ \kern\dimeval{0.5\ovar@tempdim - 0.5\wd\ovar@tempbox}%
}
% \end{macrocode}
% \end{macro}
@@ -3144,7 +3573,11 @@ $ \overdotteddoublearrow{v} \qquad \overdotteddoublearrow{AB} $
\ifovar@option@esvect@
\let\esvectvv\vv
\undef\vv
- \NewOverArrowCommand{vv}{esvect, middle config=auto}
+% \end{macrocode}
+% \changes{v1.2}{2024/07/11}{Use \refKey{middle config}|=relbareda| instead of
+% \refKey{middle config}|=auto|}
+% \begin{macrocode}
+ \NewOverArrowCommand{\vv}{esvect, middle config = relbareda}
\fi
% \end{macrocode}
% \end{macro}
@@ -3152,216 +3585,231 @@ $ \overdotteddoublearrow{v} \qquad \overdotteddoublearrow{AB} $
%
% \subsubsection*{Predefined commands}
%
+% \changes{v1.2}{2024/07/11}{Declare predefined commands after \pkg{unicode-math} settings}
+% Declare predefined commands after \pkg{unicode-math} settings.
+%
+% \begin{macrocode}
+\AddToHook{begindocument}[overarrows]
+ {
+% \end{macrocode}
+%
% \begin{macro}{\overrightarrow}
% \begin{macrocode}
-\ifovar@option@overrightarrow@
- \DeclareOverArrowCommand{overrightarrow}{%
- amsmath, middle config=relbar,
- end=\ovar@rightarrow,
- right arrow,
- }
-\fi
+ \ifovar@option@overrightarrow@
+ \DeclareOverArrowCommand{\overrightarrow}{%
+ amsmath, middle config=relbar,
+ end=\ovar@rightarrow,
+ right arrow,
+ }
+ \fi
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\underrightarrow}
% \begin{macrocode}
-\ifovar@option@underrightarrow@
- \DeclareOverArrowCommand{underrightarrow}{%
- amsmath, middle config=relbar,
- end=\ovar@rightarrow,
- right arrow,
- arrow under,
- }
-\fi
+ \ifovar@option@underrightarrow@
+ \DeclareOverArrowCommand{\underrightarrow}{%
+ amsmath, middle config=relbar,
+ end=\ovar@rightarrow,
+ right arrow,
+ arrow under,
+ }
+ \fi
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\overleftarrow}
% \begin{macrocode}
-\ifovar@option@overleftarrow@
- \DeclareOverArrowCommand{overleftarrow}{%
- amsmath, middle config=relbar,
- start=\ovar@leftarrow,
- end=\relbar,
- left arrow,
- }
-\fi
+ \ifovar@option@overleftarrow@
+ \DeclareOverArrowCommand{\overleftarrow}{%
+ amsmath, middle config=relbar,
+ start=\ovar@leftarrow,
+ end=\relbar,
+ left arrow,
+ }
+ \fi
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\underleftarrow}
% \begin{macrocode}
-\ifovar@option@underleftarrow@
- \DeclareOverArrowCommand{underleftarrow}{%
- amsmath, middle config=relbar,
- start=\ovar@leftarrow,
- end=\relbar,
- left arrow,
- arrow under,
- }
-\fi
+ \ifovar@option@underleftarrow@
+ \DeclareOverArrowCommand{\underleftarrow}{%
+ amsmath, middle config=relbar,
+ start=\ovar@leftarrow,
+ end=\relbar,
+ left arrow,
+ arrow under,
+ }
+ \fi
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\overleftrightarrow}
% \begin{macrocode}
-\ifovar@option@overleftrightarrow@
- \DeclareOverArrowCommand{overleftrightarrow}{%
- amsmath, middle config=relbar,
- start=\ovar@leftarrow,
- end=\ovar@rightarrow,
- center arrow,
- }
-\fi
+ \ifovar@option@overleftrightarrow@
+ \DeclareOverArrowCommand{\overleftrightarrow}{%
+ amsmath, middle config=relbar,
+ start=\ovar@leftarrow,
+ end=\ovar@rightarrow,
+ center arrow,
+ }
+ \fi
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\underleftrightarrow}
% \begin{macrocode}
-\ifovar@option@underleftrightarrow@
- \DeclareOverArrowCommand{underleftrightarrow}{%
- amsmath, middle config=relbar,
- start=\ovar@leftarrow,
- end=\ovar@rightarrow,
- center arrow,
- arrow under,
- }
-\fi
+ \ifovar@option@underleftrightarrow@
+ \DeclareOverArrowCommand{\underleftrightarrow}{%
+ amsmath, middle config=relbar,
+ start=\ovar@leftarrow,
+ end=\ovar@rightarrow,
+ center arrow,
+ arrow under,
+ }
+ \fi
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\overrightharpoonup}
% \begin{macrocode}
-\ifovar@option@overrightharpoonup@
- \DeclareOverArrowCommand{overrightharpoonup}{%
- amsmath, middle config=relbar,
- end=\rightharpoonup,
- right arrow,
- }
-\fi
+ \ifovar@option@overrightharpoonup@
+ \DeclareOverArrowCommand{\overrightharpoonup}{%
+ amsmath, middle config=relbar,
+ end=\rightharpoonup,
+ right arrow,
+ }
+ \fi
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\underrightharpoonup}
% \begin{macrocode}
-\ifovar@option@underrightharpoonup@
- \DeclareOverArrowCommand{underrightharpoonup}{%
- amsmath, middle config=relbar,
- end=\rightharpoonup,
- right arrow,
- arrow under,
- }
-\fi
+ \ifovar@option@underrightharpoonup@
+ \DeclareOverArrowCommand{\underrightharpoonup}{%
+ amsmath, middle config=relbar,
+ end=\rightharpoonup,
+ right arrow,
+ arrow under,
+ }
+ \fi
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\overrightharpoondown}
% \begin{macrocode}
-\ifovar@option@overrightharpoondown@
- \DeclareOverArrowCommand{overrightharpoondown}{%
- amsmath, middle config=relbar,
- end=\rightharpoondown,
- right arrow,
- }
-\fi
+ \ifovar@option@overrightharpoondown@
+ \DeclareOverArrowCommand{\overrightharpoondown}{%
+ amsmath, middle config=relbar,
+ end=\rightharpoondown,
+ right arrow,
+ }
+ \fi
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\underrightharpoondown}
% \begin{macrocode}
-\ifovar@option@underrightharpoondown@
- \DeclareOverArrowCommand{underrightharpoondown}{%
- amsmath, middle config=relbar,
- end=\rightharpoondown,
- right arrow,
- arrow under,
- }
-\fi
+ \ifovar@option@underrightharpoondown@
+ \DeclareOverArrowCommand{\underrightharpoondown}{%
+ amsmath, middle config=relbar,
+ end=\rightharpoondown,
+ right arrow,
+ arrow under,
+ }
+ \fi
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\overleftharpoonup}
% \begin{macrocode}
-\ifovar@option@overleftharpoonup@
- \DeclareOverArrowCommand{overleftharpoonup}{%
- amsmath, middle config=relbar,
- start=\leftharpoonup,
- end=\relbar,
- left arrow,
- }
-\fi
+ \ifovar@option@overleftharpoonup@
+ \DeclareOverArrowCommand{\overleftharpoonup}{%
+ amsmath, middle config=relbar,
+ start=\leftharpoonup,
+ end=\relbar,
+ left arrow,
+ }
+ \fi
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\underleftharpoonup}
% \begin{macrocode}
-\ifovar@option@underleftharpoonup@
- \DeclareOverArrowCommand{underleftharpoonup}{%
- amsmath, middle config=relbar,
- start=\leftharpoonup,
- end=\relbar,
- left arrow,
- arrow under,
- }
-\fi
+ \ifovar@option@underleftharpoonup@
+ \DeclareOverArrowCommand{\underleftharpoonup}{%
+ amsmath, middle config=relbar,
+ start=\leftharpoonup,
+ end=\relbar,
+ left arrow,
+ arrow under,
+ }
+ \fi
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\overleftharpoondown}
% \begin{macrocode}
-\ifovar@option@overleftharpoondown@
- \DeclareOverArrowCommand{overleftharpoondown}{%
- amsmath, middle config=relbar,
- start=\leftharpoondown,
- end=\relbar,
- left arrow,
- }
-\fi
+ \ifovar@option@overleftharpoondown@
+ \DeclareOverArrowCommand{\overleftharpoondown}{%
+ amsmath, middle config=relbar,
+ start=\leftharpoondown,
+ end=\relbar,
+ left arrow,
+ }
+ \fi
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\underleftharpoondown}
% \begin{macrocode}
-\ifovar@option@underleftharpoondown@
- \DeclareOverArrowCommand{underleftharpoondown}{%
- amsmath, middle config=relbar,
- start=\leftharpoondown,
- end=\relbar,
- left arrow,
- arrow under,
- }
-\fi
+ \ifovar@option@underleftharpoondown@
+ \DeclareOverArrowCommand{\underleftharpoondown}{%
+ amsmath, middle config=relbar,
+ start=\leftharpoondown,
+ end=\relbar,
+ left arrow,
+ arrow under,
+ }
+ \fi
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\overbar}
% \begin{macrocode}
-\ifovar@option@overbar@
- \DeclareOverArrowCommand{overbar}{%
- amsmath, middle config=relbar,
- start={\std@minus}, end={\std@minus},% \relbar is defined with \mathsm@sh
- shift leftright=0,
- space after arrow=-0.3ex,
- }
-\fi
+ \ifovar@option@overbar@
+ \DeclareOverArrowCommand{\overbar}{%
+ amsmath, middle config=relbar,
+ start={\std@minus}, end={\std@minus},% \relbar is defined with \mathsm@sh
+ shift leftright=0,
+ space after arrow=-0.3ex,
+ }
+ \fi
% \end{macrocode}
% \end{macro}
%
+% With \pkg{unicode-math}, add |\vphantom{+}| to get the correct position.
% \begin{macro}{\underbar}
% \begin{macrocode}
-\ifovar@option@underbar@
- \DeclareOverArrowCommand{underbar}{%
- amsmath, middle config=relbar,
- start={\std@minus}, end={\std@minus},% \relbar is defined with \mathsm@sh
- shift leftright=0,
- arrow under,
- space before arrow=-0.3ex,
- }
-\fi
+ \ifovar@option@underbar@
+ \DeclareOverArrowCommand{\underbar}{%
+ amsmath, middle config=relbar,
+ start={\vphantom{+}\std@minus}, end={\std@minus},% \relbar is defined with \mathsm@sh
+ shift leftright=0,
+ arrow under,
+ space before arrow=-0.3ex,
+ }
+ \fi
% \end{macrocode}
% \end{macro}
%
+% End of |\AddToHook{begindocument}| hook.
+% \begin{macrocode}
+ }
+% \end{macrocode}
+%
+%
% \subsubsection*{Test macros}
%
% \begin{macro}{\ovar@testmathstyles}
@@ -3422,7 +3870,9 @@ $ \overdotteddoublearrow{v} \qquad \overdotteddoublearrow{AB} $
%
% \begin{macro}{\TestOverArrow}
% \begin{macrocode}
-\NewDocumentCommand{\TestOverArrow}{ s o m }{
+\NewDocumentCommand{\TestOverArrow}{
+ s o >{\ovar@cmdname@processor} m
+}{%
\ifcsdef{#3}{}{%
\PackageWarning{overarrows}{Unknown name '#3' passed to
\protect\TestOverArrow}
@@ -3494,6 +3944,7 @@ $ \overdotteddoublearrow{v} \qquad \overdotteddoublearrow{AB} $
\lstdefinestyle{lstovardoc}{%
language = [LaTeX]TeX,
columns = flexible,
+ keepspaces = true,
keywordstyle = {\bfseries\color{ovar_darkblue}},
texcsstyle = *{\bfseries\color{ovar_darkblue}},
commentstyle = {\color{gray}},
@@ -3618,7 +4069,7 @@ actual '='
name=macrocode,
firstnumber=auto,
style = lstovarcode,
- showlines=false,
+ showlines = false,
% \end{macrocode}
% Commands and lengths identification and indexing
%
@@ -3648,8 +4099,9 @@ actual '='
% \begin{macrocode}
texcs = [4]{% internal macros
ovar@rightarrow, ovar@leftarrow, ifovar@option@oldarrows@,
- ifovar@option@esvect@, ifovar@option@tikz@, ifovar@option@pstarrows@,
- ifovar@detectsubscripts@, ifovar@option@debug@,
+ ifovar@option@esvect@, ifovar@option@tikz@, ifovar@option@pstricks@,
+ ifovar@option@pstarrows@, ifovar@detectsubscripts@,
+ ifovar@option@subother@, ifovar@option@subactive@, ifovar@option@debug@,
ifovar@option@overrightarrow@, ifovar@option@underrightarrow@,
ifovar@option@overleftarrow@, ifovar@option@underleftarrow@,
ifovar@option@overleftrightarrow@, ifovar@option@underleftrightarrow@,
@@ -3657,20 +4109,23 @@ actual '='
ifovar@option@overrightharpoondown@, ifovar@option@underrightharpoondown@,
ifovar@option@overleftharpoonup@, ifovar@option@underleftharpoonup@,
ifovar@option@overleftharpoondown@, ifovar@option@underleftharpoondown@,
- ifovar@option@overbar@, ifovar@option@underbar@, ovar@set, ovar@length@min,
+ ifovar@option@overbar@, ifovar@option@underbar@, ovar@auto@middle,
+ ovar@auto@trim@middle, ovar@subcmd, ovar@set, ovar@length@min,
ovar@before@arrow, ovar@after@arrow, ovar@macro@stack, ovar@macro@arrow,
- ovar@set@, ovar@shift@left, ovar@shift@right, ovar@stack@fill,
- ovar@stackunder@fill, ovar@stack@lens, ovar@stackunder@lens,
- ovar@macro@arrowfill, ovar@arrow@fill, ovar@arrow@start, ovar@trim@start,
- ovar@trim@middle, ovar@arrow@middle, ovar@trim@end, ovar@arrow@end,
- ovar@tikz@command, ovar@tikz@pathoptions, ovar@tikz@path,
- ovar@tikz@options, ovar@picture@geometry, ovar@picture@linethickness,
- ovar@picture@command, ovar@extralength, ovar@tempdim, ovar@set@arrowlength,
- ovar@set@arrowthickness, ovar@stackover@@, ovar@stackunder@@,
- ovar@stackover@, ovar@stackunder@, ovar@stackover@fill,
- ovar@stackover@lens, ovar@set@common, ovar@starversion,
- ovar@testmathstyles, ovar@row@teststyle,%
- ifovar@option@subother@,ifovar@option@subactive@,ovar@subcmd,ovar@testkerning,%
+ ovar@shift@left, ovar@shift@right, ovar@stack@fill, ovar@stackunder@fill,
+ ovar@stack@lens, ovar@stackunder@lens, ovar@macro@arrowfill,
+ ovar@arrow@fill, ovar@arrow@start, ovar@trim@start, ovar@trim@middle,
+ ovar@arrow@middle, ovar@trim@end, ovar@arrow@end, ovar@tikz@command,
+ ovar@tikz@pathoptions, ovar@tikz@path, ovar@tikz@options,
+ ovar@pstricks@geometry, ovar@pstricks@linethickness, ovar@pstricks@psset,
+ ovar@pstricks@command, ovar@picture@geometry, ovar@picture@linethickness,
+ ovar@picture@command, ovar@tempdim, ovar@set@arrowlength,
+ ovar@set@arrowthickness, ovar@set@arrowthickness@UM@lua,
+ ovar@rulethickness@fontdimen, ovar@rulethickness@family, ovar@stackover@@,
+ ovar@stackunder@@, ovar@stackover@, ovar@stackunder@, ovar@stackover@fill,
+ ovar@stackover@lens, ovar@cmdname@processor, ovar@set@common,
+ ovar@starversion, ovar@tempbox, ovar@testmathstyles, ovar@row@teststyle,
+ ovar@testkerning%
},
index = [4][texcs4],%
indexstyle = [4]\indexmacrointernal,%
@@ -3678,20 +4133,25 @@ actual '='
% Other macros identification
% \begin{macrocode}
moretexcs = [5]{% other macros
- Relbar, relbareda, relbaredd, rightarrow, Rightarrow, varleftarrow,
- varrightarrow, twoheadrightarrow,%
+ relbar, Relbar, relbareda, relbaredd, harrowextender, rightarrow,
+ Rightarrow, varleftarrow, varrightarrow, twoheadrightarrow,%
},
% \end{macrocode}
-% Il would be nice to also index keys, but spaces are badly handled by listings.
+% Il would be nice to also index keys, but spaces are badly handled by
+% \pkg{listings}.
% \begin{macrocode}
%^^A morekeywords = [2]{%
-%^^A no stack macro hook, stack macro, arrow macro, no arrow macro hook, min
-%^^A length, before arrow, after arrow, space before arrow, space after arrow,
-%^^A shift left, shift right, shift leftright, center arrow, left arrow, right
-%^^A arrow, arrow under, fill macro, start, middle, end, trim start, trim
-%^^A middle, trim end, trim, no trimming, middle config, amsmath, esvect, tikz
-%^^A command, tikz options, path options, path, add path options, add tikz
-%^^A options, arrows, line thickness, thinner, picture command, geometry, detect subscripts,
+%^^A overarrows, no stack macro hook, stack macro, detect subscripts, arrow
+%^^A macro, no arrow macro hook, min length, before arrow, after arrow, space
+%^^A before arrow, space after arrow, shift left, shift right, shift leftright,
+%^^A center arrow, left arrow, right arrow, arrow under, arrow under/noconfig,
+%^^A arrow under/autoconfig, fill macro, start, middle, end, trim start, trim
+%^^A middle, trim end, trim, no trimming, middle config, middle config/relbar,
+%^^A middle config/relbareda, middle config/harrowextender, middle config/auto,
+%^^A amsmath, amsmath/mimic, amsmath/strict, esvect, esvect/mimic,
+%^^A esvect/strict, tikz command, tikz options, path options, path, add path
+%^^A options, add tikz options, arrows, line thickness, thinner, pstricks
+%^^A command, psset, geometry, arrow, picture command,%
%^^A },
%^^A index = [3][keywords2],%
%^^A indexstyle = [3]\lstindexmacro,%
diff --git a/Master/texmf-dist/source/latex/pdfmanagement-testphase/hyperref-generic.dtx b/Master/texmf-dist/source/latex/pdfmanagement-testphase/hyperref-generic.dtx
index 9a8ee06546d..f38e8d88116 100644
--- a/Master/texmf-dist/source/latex/pdfmanagement-testphase/hyperref-generic.dtx
+++ b/Master/texmf-dist/source/latex/pdfmanagement-testphase/hyperref-generic.dtx
@@ -82,7 +82,7 @@
% }^^A
% }
%
-% \date{Version 0.96i, released 2024-05-23}
+% \date{Version 0.96j, released 2024-08-17}
%
% \maketitle
% \begin{documentation}
@@ -150,7 +150,7 @@
%
% \section{\enquote{Metadata}}
%
-% \enquote{Metadata}, informations about the document, are stored in a PDF in two
+% \enquote{Metadata}, information about the document, are stored in a PDF in two
% places: The |/Info| dictionary and the XMP-metadata. \pkg{hyperref} only handles the
% |/Info| dictionary. The XMP-metadata are added by code from \pkg{l3pdfmeta}.
% (without the pdfmanagement the XMP-metadata can be added with packages like \pkg{pdfx} and
@@ -170,7 +170,7 @@
% this had to patch an number of internal \pkg{hyperref} commands---which is a problem
% if the internal commands change (as happens with this new driver)
% \item \pkg {hyperref} (and also \pkg{hyperxmp})
-% tries to deduce some datas from document commands like
+% tries to deduce some data from document commands like
% \cs{title} or \cs{author}---something that worked reasonably well when only
% some standard classes with well-known definitions of these command existed,
% but gets problematic with classes and packages which define
@@ -190,7 +190,7 @@
%
% \item It is possible to store titles in more than one language. If the value begins with
% an \enquote{optional argument} which represents a language tag, the value is taken
-% as a comma list and splitted. The first value is used for the Info dictionary,
+% as a comma list and split. The first value is used for the Info dictionary,
% the others are used in the XMP-metadata. Commas in a title must then be
% protected with braces:
%
@@ -506,7 +506,7 @@
% and |citebordercolor| has been reduced. A package like \pkg{hyperref}
% can't keep track of such semantic
% contexts like cite, acronym, glossaries and special references and maintain keys for
-% them. The keys are not completly dropped as this would affect packages like
+% them. The keys are not completely dropped as this would affect packages like
% \pkg{natbib}, but they have been separated and are no longer affected by
% group keys like |allcolors| but must be set individually instead.
%
@@ -768,7 +768,7 @@
% location. So |0 -100 200 400| will give a \enquote{box} of width 200bp,
% height 400bp and depth 100dp that the destination should encompass.
% Missing numbers will be set to 0. But one should be aware that is it is quite
-% unpredicable how viewers which support |FitR| handles zero sizes.
+% unpredictable how viewers which support |FitR| handles zero sizes.
%
% \item |pdfstartview| and |pdfremotestartview| will pass
% the values as absolute coordinates.
@@ -818,7 +818,7 @@
% key of the annotation array and in similar keys is set. It does not affect
% the text and graphics colors in the page stream.
% Possible choices are |rgb| (three numbers in the array) and |cmyk| (four numbers).
-% While the PDF reference allows four numbers, PDF readers don't necessarly handle
+% While the PDF reference allows four numbers, PDF readers don't necessarily handle
% this correctly, so the value can be wrong.
%
% \DescribeHypkey{destlabel} This is a boolean key. Currently it must be set
@@ -849,7 +849,7 @@
% /Subtype/Link/A<</S/GoToR /F (mwe2.dvi)>>
% /Subtype/Link/A<</S/GoToR /F (mwe3.dvi)>>
% \end{verbatim}
-% Typically PDF viewer can handle only GoToR annotions pointing to a PDF.
+% Typically PDF viewer can handle only GoToR annotations pointing to a PDF.
% So normally the default value |pdf| of this key should not be changed.
% \DescribeHypkey{nesting}\label{key:nesting}%
% This key is useless in PDF context. The boolean is only used in
@@ -965,7 +965,7 @@
%<@@=hyp>
% \end{macrocode}
% \begin{macrocode}
-\ProvidesFile{hgeneric-testphase.def}[2024-05-23 v0.96i %
+\ProvidesFile{hgeneric-testphase.def}[2024-08-17 v0.96j %
generic Hyperref driver for the LaTeX PDF management testphase bundle]
\RequirePackage{etoolbox} %why?
@@ -1456,7 +1456,7 @@
\pdfstringdefDisableCommands{\let\hrefpdf\@@_secondoftwowithopt:wnn}
\pdfstringdefDisableCommands{\let\hrefrun\@@_secondoftwowithopt:wnn}
% \end{macrocode}
-% \section{Compability commands}
+% \section{Compatibility commands}
% \subsection{Metadata}
% A number of values should be accessible from other packages. Until now
% packages like \pkg{hyperxmp} used variables like \cs{@pdfauthor}. As they are
@@ -1527,19 +1527,29 @@
{
\define@key{BKM}{color}
{
- \__hyp_color_set:ne {__hyp/tmpa}{#1}
- \color_export:nVN
- {__hyp/tmpa}
- \g__hyp_bordercolormodel_str
- \BKM@color
+ \tl_if_blank:nTF {#1}
+ { \cs_set_eq:NN\BKM@color\@empty }
+ {
+ \__hyp_color_set:ne {__hyp/tmpa}{#1}
+ \color_export:nVN
+ {__hyp/tmpa}
+ \g__hyp_bordercolormodel_str
+ \BKM@color
+ }
}
}
-\legacy_if:nT { Hy@bookmarks }
+\legacy_if:nTF { Hy@bookmarks }
{
\AddToHook{begindocument/before}[hyperref/bookmark]
{
\RequirePackage{bookmark}
- }
+ }
+ }
+% \end{macrocode}
+% empty hook chunk to ensure that the chunk exists.
+% \begin{macrocode}
+ {
+ \AddToHook{begindocument/before}[hyperref/bookmark]{}
}
\legacy_if:nT {Hy@draft}
{
@@ -2188,7 +2198,7 @@
% \end{macrocode}
%
% Now the three \pkg{hyperref} commands.
-% The splitted commands \cs{hyper@linkstart} and \cs{hyper@linkend} are used for
+% The split commands \cs{hyper@linkstart} and \cs{hyper@linkend} are used for
% footnotemarks, toc and natbib-cites.
% \begin{function}{\hyper@link}
% \begin{syntax}
@@ -5204,7 +5214,7 @@
}
\ExplSyntaxOff
\ExplSyntaxOn
-% Does an appeareance dict make sense here?
+% Does an appearance dict make sense here?
\def\PDFForm@Text
{
/Subtype/Widget
diff --git a/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3backend-testphase.dtx b/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3backend-testphase.dtx
index f655a84c263..8ab7e948ac0 100644
--- a/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3backend-testphase.dtx
+++ b/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3backend-testphase.dtx
@@ -45,7 +45,7 @@
% }^^A
% }
%
-% \date{Version 0.96i, released 2024-05-23}
+% \date{Version 0.96j, released 2024-08-17}
%
% \maketitle
%
@@ -56,32 +56,32 @@
% \begin{macrocode}
%<drivers>\ProvidesExplFile
%<*dvipdfmx>
- {l3backend-testphase-dvipdfmx.def}{2024-05-23}{}
+ {l3backend-testphase-dvipdfmx.def}{2024-08-17}{}
{LaTeX~PDF~management~testphase~bundle~backend~support: dvipdfmx}
%</dvipdfmx>
%<*dvips>
- {l3backend-testphase-dvips.def}{2024-05-23}{}
+ {l3backend-testphase-dvips.def}{2024-08-17}{}
{LaTeX~PDF~management~testphase~bundle~backend~support: dvips}
%</dvips>
%<*dvisvgm>
- {l3backend-testphase-dvisvgm.def}{2024-05-23}{}
+ {l3backend-testphase-dvisvgm.def}{2024-08-17}{}
{LaTeX~PDF~management~testphase~bundle~backend~support: dvisvgm}
%</dvisvgm>
%<*luatex>
- {l3backend-testphase-luatex.def}{2024-05-23}{}
+ {l3backend-testphase-luatex.def}{2024-08-17}{}
{LaTeX~PDF~management~testphase~bundle~backend~support: PDF output (LuaTeX)}
%</luatex>
%<*pdftex>
- {l3backend-testphase-pdftex.def}{2024-05-23}{}
+ {l3backend-testphase-pdftex.def}{2024-08-17}{}
{LaTeX~PDF~management~testphase~bundle~backend~support: PDF output (pdfTeX)}
%</pdftex>
%<*xdvipdfmx>
- {l3backend-testphase-xetex.def}{2024-05-23}{}
+ {l3backend-testphase-xetex.def}{2024-08-17}{}
{LaTeX~PDF~management~testphase~bundle~backend~support: XeTeX}
%</xdvipdfmx>
% \end{macrocode}
% \subsection{Variants}
-% We need to generate temporarly a few e-types variants of kernel backend commands.
+% We need to generate temporarily a few e-types variants of kernel backend commands.
% These can be removed once the kernel provides them.
% \begin{macrocode}
%<@@=pdf>
@@ -1818,7 +1818,7 @@
%</drivers>
% \end{macrocode}
% \end{macro}
-% Now the driver dependant parts.
+% Now the driver dependent parts.
% By default the new commands are simply copies of the original commands.
% We adapt them then for the engines and engine version which provide support
% for structure destinations.
@@ -2355,7 +2355,7 @@
% \end{macro}
% \subsection{Settings for regression tests}
% When doing pdf based regression tests some meta data in the pdf should have
-% fixed values to get identical pdf's. We define here the backend dependant
+% fixed values to get identical pdf's. We define here the backend dependent
% part. The main command is then in l3pdfmeta
% \begin{macrocode}
%<*drivers>
diff --git a/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdfannot.dtx b/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdfannot.dtx
index ef02e9cf5ad..59268785a41 100644
--- a/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdfannot.dtx
+++ b/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdfannot.dtx
@@ -48,7 +48,7 @@
% }^^A
% }
%
-% \date{Version 0.96i, released 2024-05-23}
+% \date{Version 0.96j, released 2024-08-17}
%
% \maketitle
% \begin{documentation}
@@ -340,7 +340,7 @@
% lead to the unpleasant result that header and footer are part of the link too.
% Since texlive 2021 pdflatex and lualatex has commands similar to a special already
% included in dvipdfmx which allows to interrupt a link. The commands must be used
-% with care: typically they must be outside a box that would be catched by link to
+% with care: typically they must be outside a box that would be caught by link to
% have the wanted effect.
%
% \end{function}
@@ -432,7 +432,7 @@
% \begin{macrocode}
%<@@=pdfannot>
%<*header>
-\ProvidesExplPackage{l3pdfannot}{2024-05-23}{0.96i}
+\ProvidesExplPackage{l3pdfannot}{2024-08-17}{0.96j}
{PDF-annotations}
\RequirePackage{l3pdfdict}
%</header>
diff --git a/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdfdict.dtx b/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdfdict.dtx
index 514595e41ca..2c297fb5c73 100644
--- a/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdfdict.dtx
+++ b/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdfdict.dtx
@@ -49,7 +49,7 @@
% }^^A
% }
%
-% \date{Version 0.96i, released 2024-05-23}
+% \date{Version 0.96j, released 2024-08-17}
%
% \maketitle
% \begin{documentation}
@@ -208,7 +208,7 @@
% \begin{macrocode}
%<@@=pdfdict>
%<*header>
-\ProvidesExplPackage{l3pdfdict}{2024-05-23}{0.96i}
+\ProvidesExplPackage{l3pdfdict}{2024-08-17}{0.96j}
{Tools for PDF dictionaries (LaTeX PDF management testphase bundle)}
%</header>
% \end{macrocode}
diff --git a/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdffield-action.dtx b/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdffield-action.dtx
index f4d71c50e8a..7cda9b31021 100644
--- a/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdffield-action.dtx
+++ b/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdffield-action.dtx
@@ -49,7 +49,7 @@
% }^^A
% }
%
-% \date{Version 0.96i, released 2024-05-23}
+% \date{Version 0.96j, released 2024-08-17}
%
% \maketitle
% \begin{documentation}
@@ -251,10 +251,10 @@
%
% \meta{URL} can be a mail address and should then start with |mailto:|.
% A subject can be attached with |?subject=...|.
-% This normally works quite fine as it only needs a correctly working mail programm.
+% This normally works quite fine as it only needs a correctly working mail program.
% (But for some unknown reason my mail program don't like mail addresses with hyphens in them).
%
-% Alternativly it should be an URL of a script, which should return the correct
+% Alternatively it should be an URL of a script, which should return the correct
% answer (which one this is, is rather unclear).
%
% \end{function}
diff --git a/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdffield-checkbox.dtx b/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdffield-checkbox.dtx
index 7f702d29346..8514ce7200f 100644
--- a/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdffield-checkbox.dtx
+++ b/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdffield-checkbox.dtx
@@ -64,7 +64,7 @@
% }^^A
% }
%
-% \date{Version 0.96i, released 2024-05-23}
+% \date{Version 0.96j, released 2024-08-17}
%
% \maketitle
% \begin{documentation}
diff --git a/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdffield-choice.dtx b/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdffield-choice.dtx
index e6454493939..ceca7dd26fb 100644
--- a/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdffield-choice.dtx
+++ b/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdffield-choice.dtx
@@ -49,7 +49,7 @@
% }^^A
% }
%
-% \date{Version 0.96i, released 2024-05-23}
+% \date{Version 0.96j, released 2024-08-17}
%
% \maketitle
% \begin{documentation}
@@ -77,11 +77,11 @@
% This means that various data will have to be set, and the sorting matters.
% The module here will assume that the various values are stored in sequences:
%
-% \ExplSyntaxOn
+% \begin{verbatim}
% \seq_const_from_clist:Nn \c_my_values_seq {hippo,duck,bear}
% \seq_const_from_clist:Nn \c_my_displayvalues_seq {Sieglinde,,Bär}
-% \seq_const_from_clist:Nn \c_my_defaultvalues_seq {duck,Bär} %check if export or altname ...
-% \ExplSyntaxOff
+% \seq_const_from_clist:Nn \c_my_defaultvalues_seq {duck,Bär}
+% \end{verbatim}
%
% Only the first sequence is required.
% Empty values in the display sequence are possible, then the normal value is used.
@@ -103,9 +103,12 @@
%
%
% \subsection{Appearance}
-% hm ....
+% By default the fields use a grey background as appearance, another appearance
+% can be defined with |\pdffield_appearance:nn| (described in the documentation of
+% l3pdffield) or directly with |\pdfxform_new:nnn| (in l3pdfxfom)
+% and then used with the |appearance| as in other form fields.
%
-% \bigskip
+%
% \subsection{Commands}
% \begin{function}{\pdffield_choice:n}
% \begin{syntax}
@@ -114,9 +117,9 @@
% This creates a choice field.
% The list of allowed keys is described below.
% The \meta{key val list} should at least set the name,
-% without it the default |choice| is used. Choice fields with the same
+% without it the default |choice| is used. Choice fields with the same name
% belong to the same field and if changed, the others are changed accordingly.
-% The default appearance ...
+% As default appearance we reuse the text appearance: a simple gray background.
%
% The first choice field setups the field and so should setup values and field flags.
% \end{function}
@@ -443,7 +446,7 @@
% ,\l_@@_choice_opt_seq
% }
% variables to hold the value, the default value, and display variants. The opt
-% set will be used to build the content of opt
+% seq will be used to build the content of opt
% \begin{macrocode}
\seq_new:N \l_@@_choice_values_seq
\seq_new:N \l_@@_choice_defaultvalues_seq
diff --git a/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdffield-pushbutton.dtx b/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdffield-pushbutton.dtx
index b030de3323c..3c71dc973e7 100644
--- a/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdffield-pushbutton.dtx
+++ b/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdffield-pushbutton.dtx
@@ -55,7 +55,7 @@
% }^^A
% }
%
-% \date{Version 0.96i, released 2024-05-23}
+% \date{Version 0.96j, released 2024-08-17}
%
% \maketitle
% \begin{documentation}
diff --git a/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdffield-radiobutton.dtx b/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdffield-radiobutton.dtx
index 8e16ebb596a..e26f875c377 100644
--- a/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdffield-radiobutton.dtx
+++ b/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdffield-radiobutton.dtx
@@ -83,7 +83,7 @@
% }^^A
% }
%
-% \date{Version 0.96i, released 2024-05-23}
+% \date{Version 0.96j, released 2024-08-17}
%
% \maketitle
% \begin{documentation}
diff --git a/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdffield-textfield.dtx b/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdffield-textfield.dtx
index 0e3fe0c92d7..bdd1c28ffcb 100644
--- a/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdffield-textfield.dtx
+++ b/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdffield-textfield.dtx
@@ -49,7 +49,7 @@
% }^^A
% }
%
-% \date{Version 0.96i, released 2024-05-23}
+% \date{Version 0.96j, released 2024-08-17}
%
% \maketitle
% \begin{documentation}
diff --git a/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdffield.dtx b/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdffield.dtx
index c888fab7c4c..27deb954c3f 100644
--- a/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdffield.dtx
+++ b/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdffield.dtx
@@ -69,7 +69,7 @@
% }^^A
% }
%
-% \date{Version 0.96i, released 2024-05-23}
+% \date{Version 0.96j, released 2024-08-17}
%
% \maketitle
% \begin{documentation}
@@ -87,7 +87,7 @@
% \usepackage{l3pdffield-testphase}
% \end{verbatim}
%
-% The source code is splitted into various submodules. All code is combined in the
+% The source code is split into various submodules. All code is combined in the
% sty, but the documentation is in individual PDF.
% \begin{description}
% \item[\texttt{l3pdffield}] This contains the basic commands and keys
@@ -199,7 +199,7 @@
% \subsection{The look of a field: Appearances and other settings}
%
% The look of widget annotation of a field can be set with various keys. The keys developed over
-% time and some of them superseed older ones. There is for example the simple
+% time and some of them supersede older ones. There is for example the simple
% |/Border|, the more sophisticated |/BS| (\enquote{border style dictionary}),
% the \enquote{dynamic appearance dictionary} |MK|, with lots of keys,
% and the appearance dictionary |/AP| which
@@ -631,7 +631,7 @@
% fields without sortkey will get an empty sortkey and so be at the begin,
% the order of fields with the same sortkey is not defined.
% The module only sorts fields created with the commands of this module, the
-% sorting of fields created by \pkg{hyperref} is independant.
+% sorting of fields created by \pkg{hyperref} is independent.
% \end{function}
%
% \begin{function}{DA}
@@ -972,7 +972,7 @@
%<*package>
%<@@=pdffield>
\NeedsTeXFormat{LaTeX2e}
-\ProvidesExplPackage{l3pdffield-testphase}{2024-05-23}{0.96i}%
+\ProvidesExplPackage{l3pdffield-testphase}{2024-08-17}{0.96j}%
{form fields}
% \end{macrocode}
% \subsection{hyperref specific command}
diff --git a/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdffile.dtx b/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdffile.dtx
index 205dcfd7ba8..68287a9d5cd 100644
--- a/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdffile.dtx
+++ b/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdffile.dtx
@@ -49,7 +49,7 @@
% }^^A
% }
%
-% \date{Version 0.96i, released 2024-05-23}
+% \date{Version 0.96j, released 2024-08-17}
%
% \maketitle
% \begin{documentation}
@@ -398,9 +398,9 @@
%
% \begin{macrocode}
%<*header>
-\ProvidesExplPackage{l3pdffile}{2024-05-23}{0.96i}
+\ProvidesExplPackage{l3pdffile}{2024-08-17}{0.96j}
{embedding and referencing files in PDF---LaTeX PDF management testphase bundle}
-\RequirePackage{l3pdftools} %temporarly!!
+\RequirePackage{l3pdftools} %temporarily!!
%</header>
% \end{macrocode}
%
diff --git a/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdfmanagement.dtx b/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdfmanagement.dtx
index 9213e670f78..28909951265 100644
--- a/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdfmanagement.dtx
+++ b/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdfmanagement.dtx
@@ -57,7 +57,7 @@
% }^^A
% }
%
-% \date{Version 0.96i, released 2024-05-23}
+% \date{Version 0.96j, released 2024-08-17}
%
% \maketitle
% \begin{documentation}
@@ -70,7 +70,7 @@
% They unify a number of primitives like the pdftex
% registers and commands \cs{pdfcatalog}, \cs{pdfpageattr},
% \cs{pdfpagesattr}, \cs{pdfinfo}, \cs{pdfpageresources}
-% and similar commands of the other backends in a backend independant way.
+% and similar commands of the other backends in a backend independent way.
%
% The supported backends are pdflatex, lualatex, (x)dvipdfmx (latex, xelatex
% and---starting in texlive 2021--lualatex)
@@ -180,12 +180,12 @@
% \begin{syntax}
% \cs{pdfmanagement_show:n} \Arg{resource path}
% \end{syntax}
-% This shows the content of the dictionary targetted by
+% This shows the content of the dictionary targeted by
% \Arg{resource path} in the log and on the terminal if possible.
%
% It is not reliable for page resources as these are filled at shipout.
%
-% It also doesn't show necessarly all the content.
+% It also doesn't show necessarily all the content.
% For example most backends add automatically
% entries to the Info dictionary.
% \end{function}
@@ -207,7 +207,7 @@
% can't be removed (but should ever a use case appear it could be added).
% \end{function}
%
-% \subsection{Description of the resource pathes}
+% \subsection{Description of the resource paths}
% \subsubsection{Info: The Info dictionary}
% \begin{NOTE}{UF}
% path: Info
@@ -367,7 +367,7 @@
% pages of different sizes. But you must be careful with the values.
% If you set e.g. with pdflatex \cs{pdfpageheight} to 300bp you get a mediabox of
% |0 0 595 300|, but pdflatex measure from the top and will also move
-% the reference point up, so effectivly
+% the reference point up, so effectively
% you get the \emph{upper} third of the page. If you set the \texttt{/MediaBox}
% to |0 0 595 300| with \cs{pdfmanagement_add:nnn} you get the \emph{lower} third.
% In general it is better to use only the primitive commands to avoid confusing
@@ -398,7 +398,7 @@
% \cs{pdfmanagement_add:nnn} \{Page/Resources/\meta{resource}\} \Arg{name} \Arg{value}
% \end{syntax}
% Adds |/|\meta{name} \meta{value} to the page resource \meta{resource}.
-% \meta{resource} can be |ExtGState|, |ColorSpace|, |Pattern| oder |Shading|.
+% \meta{resource} can be |ExtGState|, |ColorSpace|, |Pattern| or |Shading|.
% The values are always stored globally. The content is written to the pdf
% at the end of the compilation, so values can be added until then.
% \meta{name} should be a valid pdf name without the leading slash,
@@ -434,7 +434,7 @@
% Entries to the top level of the catalog can be added with\\
% |\pdfmanagement_add:nnn {Catalog}|\Arg{Name}\Arg{Value}.
% Entries to subdictionaries by using in the first
-% argument one of the pathes described later.
+% argument one of the paths described later.
% The entries in the catalog have varying requirements regarding the
% PDF management. Some entries (like \texttt{/Lang}) are simple values
% where new values should
@@ -495,7 +495,7 @@
% \par\medskip
%
% \paragraph{Simple entries in subdictionaries of the catalog}
-% The following resource pathes have been predeclared and allow to
+% The following resource paths have been predeclared and allow to
% add values to the respective subdictionaries of the catalog. The
% names of the dictionaries follow the naming and location of the dictionaries
% in the PDF reference.
@@ -632,7 +632,7 @@
%<@@=pdfmanagement>
%<*header>
%
-\ProvidesExplPackage{l3pdfmanagement}{2024-05-23}{0.96i}
+\ProvidesExplPackage{l3pdfmanagement}{2024-08-17}{0.96j}
{Management of core PDF dictionaries (LaTeX PDF management testphase bundle)}
%</header>
% \end{macrocode}
@@ -824,7 +824,7 @@
\pdfdict_if_exist:nTF { g__pdf_Core/#1 }
{
\cs_if_exist:cTF
- { @@_handler/#1/?_gput:nn } %general, name independant handler
+ { @@_handler/#1/?_gput:nn } %general, name independent handler
{ \use:c {@@_handler/#1/?_gput:nn} {#2} {#3} }
{
\cs_if_exist:cTF
@@ -862,7 +862,7 @@
\pdfdict_if_exist:nTF { g__pdf_Core/#1 }
{
\cs_if_exist:cTF
- { @@_handler/#1/?_gremove:n } %general, name independant handler
+ { @@_handler/#1/?_gremove:n } %general, name independent handler
{ \use:c {@@_handler/#1/?_gremove:n} {#2} }
{
\cs_if_exist:cTF
@@ -899,7 +899,7 @@
\cs_new_protected:Npn \@@_show:Nn #1#2
{
\cs_if_exist:cTF
- { @@_handler/#2/?_show: } %general, name independant handler
+ { @@_handler/#2/?_show: } %general, name independent handler
{ \use:c {@@_handler/#2/?_show:} }
{
\prop_if_exist:cTF { \__kernel_pdfdict_name:n { g__pdf_Core/#2 } }
diff --git a/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdfmeta.dtx b/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdfmeta.dtx
index ff5483ca691..a6d31a1e633 100644
--- a/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdfmeta.dtx
+++ b/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdfmeta.dtx
@@ -49,7 +49,7 @@
% }^^A
% }
%
-% \date{Version 0.96i, released 2024-05-23}
+% \date{Version 0.96j, released 2024-08-17}
%
% \maketitle
% \begin{documentation}
@@ -205,6 +205,10 @@
% \item[|no_CharSet|] CharSet is deprecated is pdf 2.0 and should not
% be used in A-4. l3pdfmeta will therefore suppress it for the
% engines pdftex and luatex (the other engines have no suitable option)
+% \item[|omit_CID|] This avoids with PDF/A-2 and newer a failure
+% because of with missing CID identifications
+% (e.g. from rule ISO 19005-2:2011, Clause: 6.2.11.4.2)
+% It has only with luatex an effect.
% \item[|Trailer_no_Info|] The \texttt{Info} dictionary
% has been deprecated since quite some time. Metadata should be set with
% XMP-data instead. In PDF A-4 now the \texttt{Info} dictionary
@@ -432,7 +436,7 @@
% User data should normally be declared in the preamble (or even in the
% |\DocumentMetadata| command), and consist of rather simple text; |&| can be entered
% as |\&| (but directly |&| will normally work too),
-% babel shorthands should not be used. Some datas are interpreted as comma lists,
+% babel shorthands should not be used. Some data are interpreted as comma lists,
% in this cases commas which are part of the text should be protected by braces.
% In some cases a text in brackets like |[en]| is interpreted as language tag,
% if they are part of a text they should be protected by braces too.
@@ -600,7 +604,7 @@
% This add a PDF declaration with the required |conformsTo| property to the XMP metadata.
% \meta{uri} should not be empty and is a URI specifying
% the standard or profile referred to by the PDF
-% Declaration. If the uri contains a hash, use \cs{c_hash_str} to excape it
+% Declaration. If the uri contains a hash, use \cs{c_hash_str} to escape it
% and use the \texttt{e} variant to expand it.
% \end{function}
%
@@ -627,7 +631,7 @@
% \begin{macrocode}
%<@@=pdfmeta>
%<*header>
-\ProvidesExplPackage{l3pdfmeta}{2024-05-23}{0.96i}
+\ProvidesExplPackage{l3pdfmeta}{2024-08-17}{0.96j}
{PDF-Standards---LaTeX PDF management testphase bundle}
%</header>
% \end{macrocode}
@@ -814,7 +818,9 @@
\pdfmeta_standard_verify:nF { Trailer_no_Info }
{ \__pdf_backend_omit_info:n {1} }
\pdfmeta_standard_verify:nF { no_CharSet }
- { \__pdf_backend_omit_charset:n {1} }
+ { \__pdf_backend_omit_charset:n {1} }
+ \pdfmeta_standard_verify:nF { omit_CID }
+ { \__pdf_backend_omit_cidset:n {1} }
\pdfmeta_standard_verify:nnF { min_pdf_version }
{ \pdf_version: }
{ \msg_warning:nneee {pdf}{wrong-pdfversion}
@@ -930,7 +936,9 @@
{ embed_content}
\prop_gput:cnn
{ g_@@_standard_pdf/A-2B_prop }{max_pdf_version}{1.7}
-%A-2u ==============
+\prop_gput:cnn
+ { g_@@_standard_pdf/A-2B_prop }{omit_CID}{}
+ %A-2u ==============
\prop_new:c { g_@@_standard_pdf/A-2U_prop }
\prop_gset_eq:cc
{ g_@@_standard_pdf/A-2U_prop }
@@ -1177,7 +1185,7 @@
% The commands embed the profile, and write the dictionary and add it to
% the catalog. The first command should perhaps be moved to l3color
% as it needs such profiles too. We used named objects so that we can
-% check if the profile is already there. This is not full proof if pathes are
+% check if the profile is already there. This is not foolproof if paths are
% used.
% \begin{macrocode}
\cs_new_protected:Npn \@@_embed_colorprofile:n #1%#1 file name
@@ -1330,6 +1338,15 @@
_pdfstandard / UA-1 .code:n =
{
\AddToDocumentProperties [document]{pdfstandard-UA}{{1}{}}
+ \AddToHook{begindocument/before}
+ {
+ \pdf_version_compare:NnF < {2.0}
+ {
+ \msg_warning:nneee
+ {pdf}{wrong-pdfversion}
+ {\pdf_version:}{high}{UA-1}
+ }
+ }
},
% \end{macrocode}
% currently it is not possible to merge requirements - these need some thoughts as
@@ -1345,6 +1362,12 @@
{
\@@_xmp_wtpdf_accessibility_declaration:
\@@_xmp_wtpdf_reuse_declaration:
+ \pdf_version_compare:NnT < {2.0}
+ {
+ \msg_warning:nneee
+ {pdf}{wrong-pdfversion}
+ {\pdf_version:}{low}{UA-2}
+ }
}
},
xmp .choice:,
@@ -1531,7 +1554,7 @@
%
% \begin{variable}{\l_@@_xmp_currentdate_tl,\l_@@_xmp_currentdate_seq}
% The tl var contains the date of the log-file in PDF format,
-% the seq the result splitted with the regex.
+% the seq the result split with the regex.
% \begin{macrocode}
\tl_new:N \l_@@_xmp_currentdate_tl
\seq_new:N \l_@@_xmp_currentdate_seq
@@ -1542,7 +1565,7 @@
% This checks a document property and if empty uses the current date.
% \begin{macrocode}
\cs_new_protected:Npn \@@_xmp_date_get:nNN #1 #2 #3
- %#1 property, #2 tl var with PDF date, #3 seq for splitted date
+ %#1 property, #2 tl var with PDF date, #3 seq for split date
{
\tl_set:Ne #2 { \GetDocumentProperties{#1} }
\tl_if_blank:VTF #2
@@ -2103,6 +2126,12 @@
{Integer}
{internal}
{Year~of~standard}
+\@@_xmp_property_new:nnnnn
+ {pdfaid}
+ {rev}
+ {Integer}
+ {internal}
+ {Revision~year~of~standard}
% \end{macrocode}
% \end{macro}
% \item[pdfuaid] here we need (?) to declare the property
@@ -2304,7 +2333,7 @@
% that may not be related to PDF technology. Their specification is for example
% described in \url{https://pdfa.org/wp-content/uploads/2019/09/PDF-Declarations.pdf}.
%
-% If declarations are added to the XMP-metadata they need (for pdf/A compliancy) a
+% If declarations are added to the XMP-metadata they need (for pdf/A compliance) a
% schema declaration. We do not add it by default but define here a command to enable
% it. (This can be done in the document preamble as xmp is built only at the end.)
%
diff --git a/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdftools.dtx b/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdftools.dtx
index cc0f14d81b5..e6d655c96e8 100644
--- a/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdftools.dtx
+++ b/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdftools.dtx
@@ -49,7 +49,7 @@
% }^^A
% }
%
-% \date{Version 0.96i, released 2024-05-23}
+% \date{Version 0.96j, released 2024-08-17}
%
% \maketitle
% \begin{documentation}
@@ -235,7 +235,7 @@
%
% \begin{macrocode}
%<*header>
-\ProvidesExplPackage{l3pdftools}{2024-05-23}{0.96i}
+\ProvidesExplPackage{l3pdftools}{2024-08-17}{0.96j}
{candidate commands for l3pdf---LaTeX PDF management testphase bundle}
%</header>
% \end{macrocode}
@@ -329,7 +329,7 @@
% ==========
% uri: utf16BE/string seems not to work, hex neither
% utf8/string works but not on macos,
-% so a specfic utf8/url variant is needed
+% so a specific utf8/url variant is needed
% ==========
% "input" is utf8 for pdftex, empty (native) for unicode engine
% commands to output literal strings (...)
diff --git a/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdfxform.dtx b/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdfxform.dtx
index d567f42cb24..4daa9d2b83c 100644
--- a/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdfxform.dtx
+++ b/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdfxform.dtx
@@ -48,7 +48,7 @@
% }^^A
% }
%
-% \date{Version 0.96i, released 2024-05-23}
+% \date{Version 0.96j, released 2024-08-17}
%
% \maketitle
% \begin{documentation}
@@ -132,7 +132,7 @@
% \begin{macrocode}
%<@@=pdf>
%<*header>
-\ProvidesExplPackage{l3pdfxform}{2024-05-23}{0.96i}
+\ProvidesExplPackage{l3pdfxform}{2024-08-17}{0.96j}
{command to create xforms (beta)---LaTeX PDF management testphase bundle}
%</header>
% \end{macrocode}
diff --git a/Master/texmf-dist/source/latex/pdfmanagement-testphase/ltdocinit.dtx b/Master/texmf-dist/source/latex/pdfmanagement-testphase/ltdocinit.dtx
index b6d1b2f45bf..3d29afa58bc 100644
--- a/Master/texmf-dist/source/latex/pdfmanagement-testphase/ltdocinit.dtx
+++ b/Master/texmf-dist/source/latex/pdfmanagement-testphase/ltdocinit.dtx
@@ -47,7 +47,7 @@
% }^^A
% }
%
-% \date{Version 0.96i, released 2024-05-23}
+% \date{Version 0.96j, released 2024-08-17}
%
% \maketitle
% \begin{documentation}
@@ -220,7 +220,7 @@
% \begin{macrocode}
%<@@=pdfmanagement>
%<*header>
-\ProvidesExplPackage{ltdocinit}{2024-05-23}{0.96i}
+\ProvidesExplPackage{ltdocinit}{2024-08-17}{0.96j}
{Initialize document metadata}
%</header>
% \end{macrocode}
diff --git a/Master/texmf-dist/source/latex/pdfmanagement-testphase/pdfmanagement-firstaid.dtx b/Master/texmf-dist/source/latex/pdfmanagement-testphase/pdfmanagement-firstaid.dtx
index 6bd57345dff..148d15ce957 100644
--- a/Master/texmf-dist/source/latex/pdfmanagement-testphase/pdfmanagement-firstaid.dtx
+++ b/Master/texmf-dist/source/latex/pdfmanagement-testphase/pdfmanagement-firstaid.dtx
@@ -47,7 +47,7 @@
% }^^A
% }
%
-% \date{Version 0.96i, released 2024-05-23}
+% \date{Version 0.96j, released 2024-08-17}
%
% \maketitle
% \begin{documentation}
@@ -63,7 +63,7 @@
% |debug={firstaidoff={name1,name2,...},...}|.
% \begin{macrocode}
%<*package>
-\ProvidesExplPackage{pdfmanagement-firstaid}{2024-05-23}{0.96i}
+\ProvidesExplPackage{pdfmanagement-firstaid}{2024-08-17}{0.96j}
{LaTeX PDF management testphase bundle / firstaid-patches}
%<@@=pdfmanagement>
diff --git a/Master/texmf-dist/source/latex/pdfmanagement-testphase/pdfmanagement-testphase.dtx b/Master/texmf-dist/source/latex/pdfmanagement-testphase/pdfmanagement-testphase.dtx
index 6dc445b7ffe..af4520b433d 100644
--- a/Master/texmf-dist/source/latex/pdfmanagement-testphase/pdfmanagement-testphase.dtx
+++ b/Master/texmf-dist/source/latex/pdfmanagement-testphase/pdfmanagement-testphase.dtx
@@ -47,7 +47,7 @@
% }^^A
% }
%
-% \date{Version 0.96i, released 2024-05-23}
+% \date{Version 0.96j, released 2024-08-17}
%
% \maketitle
% \begin{documentation}
@@ -394,7 +394,7 @@
% \begin{macrocode}
%<@@=pdf>
%<*package>
-\ProvidesExplPackage{pdfmanagement-testphase}{2024-05-23}{0.96i}
+\ProvidesExplPackage{pdfmanagement-testphase}{2024-08-17}{0.96j}
{LaTeX PDF management testphase bundle}
\providecommand\IfFormatAtLeastTF{\@ifl@t@r\fmtversion}
\IfFormatAtLeastTF{2020-10-01}{}{
@@ -422,7 +422,7 @@
% to allow to set it in the document.
% \begin{macrocode}
%<*header>
-\ProvidesExplFile{pdfmanagement-testphase.ltx}{2024-05-23}{0.96i}
+\ProvidesExplFile{pdfmanagement-testphase.ltx}{2024-08-17}{0.96j}
{PDF~management~code~(testphase)}
% \end{macrocode}
% We define a boolean for the new delayed shipout. This is temporary. At some
diff --git a/Master/texmf-dist/source/latex/pdfx/pdfx.dtx b/Master/texmf-dist/source/latex/pdfx/pdfx.dtx
index ffdb92ee01b..573a23b6117 100644
--- a/Master/texmf-dist/source/latex/pdfx/pdfx.dtx
+++ b/Master/texmf-dist/source/latex/pdfx/pdfx.dtx
@@ -1,33 +1,33 @@
% \iffalse meta-comment
-%
+%
% File: pdfx.dtx
%
% Copyright (c) 2019, CV Radhakrishnan <cvr@river-valley.org>,
% Han The Thanh <thanh@river-valley.org>,
% Ross Moore <ross.moore@mq.edu.au>,
% Peter Selinger <selinger@mathstat.dal.ca>
-%
+%
% This file may be distributed and/or modified under the conditions
% of the LaTeX Project Public License, either version 1.2 of this
% license or (at your option) any later version. The latest version
% of this license is in:
-%
+%
% http://www.latex-project.org/lppl.txt
-%
+%
% and version 1.2 or later is part of all distributions of LaTeX
% version 1999/12/01 or later.
%
% \fi
%
-% \CheckSum{6309}
+% \CheckSum{6802}
% \iffalse
%
%<*driver>
\pdfcompresslevel 9
\providecommand{\pdfxopt}{a-2u}
\providecommand{\lastyear}{2018}
-\providecommand{\thisyear}{2019}
-\begin{filecontents*}{./\jobname.xmpdata}
+\providecommand{\thisyear}{2024}
+\begin{filecontents}[force]{./\jobname.xmpdata}
\Title{Generation of PDF/X- and PDF/A-compliant PDFs with pdfTeX \textemdash\ pdfx.sty}
\Author{\CVR\sep \Thanh\sep Ross Moore\sep Peter Selinger}
\Subject{This package supports generation of PDF/X-, PDF/A- and PDF/E-compliant documents, in most of their variants, using pdfLaTeX, LuaLaTeX and XeLaTeX.}
@@ -37,10 +37,10 @@
\Copyright{Public domain.}
\Copyrighted{False}
\CopyrightURL{http://tug.org/texlive/}
-\CoverDisplayDate{March \thisyear}
-\CoverDate{\thisyear-03-10}
+\CoverDisplayDate{July \thisyear}
+\CoverDate{\thisyear-07-01}
\CreatorTool{LaTeX + pdfx.sty with option \pdfxopt, from TeX Live \thisyear}
-\Date{2017-05-18\sep 2017-06-23\sep 2018-11-29\sep 2018-12-22\sep 2019-02-08\sep 2019-03-10}
+\Date{2024-07-01}
\Advisory{An earlier version of this documentation was published as: TUGboat 36, No.2, pp.136\textendash 142 (2015)}
\Advisory{v1.6: Added XMP support for PDF/UA-1. Added more Metadata fields and Language support.}
\Advisory{v1.6: Default RGB and CMYK profiles now require the colorprofiles.sty package.}
@@ -52,16 +52,29 @@
\Advisory{v1.6: Support for 8-bit Hebrew encodings, some Arabic and Devanagari.}
\Advisory{v1.6: Updated documentation, incl. for LaTeX changes.}
\Advisory{v1.6.1: Fixed issue with ifthen package; improved Metadata with LuaTeX and XeTeX.}
-\Advisory{v.1.6.1: Flexibility with page boxes for PDF/X.}
-\Advisory{v.1.6.2: Fixed passing of options to xcolor, and some glyphtounicode values.}
-\Advisory{v.1.6.2: Fixed encoding issue. Extra warning when colorprofiles.tex is missing.}
-\Advisory{v.1.6.3: Properly fixed encoding issue; supports \string\pdfomitcharset\ primitive.}
-\Advisory{v.1.6.3: Reference to veraPDF validation software; additions to glyphtounicode-ntx.tex.}
-\Advisory{v.1.6.3: Patched \string\mathaccentV\ to output accents after the base character.}
+\Advisory{v1.6.1: Flexibility with page boxes for PDF/X.}
+\Advisory{v1.6.2: Fixed passing of options to xcolor, and some glyphtounicode values.}
+\Advisory{v1.6.2: Fixed encoding issue. Extra warning when colorprofiles.tex is missing.}
+\Advisory{v1.6.3: Properly fixed encoding issue; supports \string\pdfomitcharset\ primitive.}
+\Advisory{v1.6.3: Reference to veraPDF validation software; additions to glyphtounicode-ntx.tex.}
+\Advisory{v1.6.3: Patched \string\mathaccentV\ to output accents after the base character.}
+\Advisory{v1.6.4: Added check and warning with luatex for whether \string\pdfminorversion\ can be changed.}
+\Advisory{v1.6.4: Ensure correct \string\catcode for input characters up to 31, when reading .xmpdata file.}
+\Advisory{v1.6.4: Disabled patched \string\mathaccentV\ due to incompatibility with wide base expressions.}
+\Advisory{v1.6.5: Support for \string\Nickname\ as Metadata command.}
+\Advisory{v1.6.5: Ensure par is unexpandable when reading Metadata.}
+\Advisory{v1.6.5a: Support for Memoir class's \string\stockwidth\ and \string\stockheight.}
+\Advisory{v1.6.5a: Added pdf20 option for PDF 2.0, with support for \string\pdfmajorversion.}
+\Advisory{v1.6.5b: Avoid loading xmpincl package from within a TeX grouping.}
+\Advisory{v1.6.5c: Avoid loading stringenc package from within a TeX grouping.}
+\Advisory{v1.6.5d: Disable some options for xcolor after use.}
+\Advisory{v1.6.5e: Ensure \string\pdfmajorversion\ and \string\pdfminorversion\ are both defined and set correctly.}
+\Advisory{v1.6.5e: Updated documentation; added new Bibliography entries and revised URL links.}
+\Advisory{v1.6.5f: Reset ifpdf properly; support \string\creationdate with XeTeX. Revised Glossary layout.}
\pdfxEnableCommands{%
\def\CVR{C.V. Radhakrishnan}\def\Thanh{H\`an Th\eee Thanh}%
\def\eee{^^c3^^aa^^cc^^81 }}
-\end{filecontents*}
+\end{filecontents}
\PassOptionsToPackage{dvipsnames,svgnames}{xcolor}
\documentclass[a4paper]{ltxdoc}
\usepackage[\pdfxopt]{pdfx}
@@ -104,12 +117,12 @@
% \GetFileInfo{pdfx.dtx}
%
% \DoNotIndex{\newcommand,\newenvironment}
-%
+%
% \DoNotIndex{\def,\edef,\gdef,\xdef,\global,\long,\let}
% \DoNotIndex{\expandafter,\string,\the,\ifx,\else,\fi}
% \DoNotIndex{\csname,\endcsname,\relax,\begingroup,\endgroup}
% \DoNotIndex{\DeclareTextCommand,\DeclareTextCompositeCommand}
-% \DoNotIndex{\space,\@empty,\special,\@nil,\advance\@nnil,\z@,\@@mod}
+% \DoNotIndex{\space,\@empty,\special,\@nil,\z@,\@@mod}
% \DoNotIndex{\\,\@gobble,\@@,\@fornoop,\@fortmp,\@ifundefined,\@firstoftwo,\@secondoftwo}
% \DoNotIndex{\@tempcnta,\@tempcntb,\@tempboxa,\ifnot@empty,\@this,\@firstofone}
% \DoNotIndex{\{,\},\alph,\bgroup,\dp,\ht,\kern,\egroup}
@@ -134,78 +147,92 @@
% \DoNotIndex{\scantokens,\typeout,\vrule,\wd}
%
% \changes{v1.00}{2008/12/01}{Initial commit to the CVS.}
-% \changes{v1.01}{2008/12/10}{glyphtounicode-cmr.tex included with the package.}
-% \changes{v1.3}{2008/12/01}{Fix copyright in xmp files.}
+% \changes{v1.01}{2008/12/10}{\texttt{glyphtounicode-cmr.tex} included with the package.}
+% \changes{v1.3}{2008/12/01}{Fix copyright in \texttt{.xmp} files.}
% \changes{v1.5.4}{2015/02/28}{Fixed timezone bug; Unicode support; more
% PDF variants; added color profiles.}
-% \changes{v1.5.5}{2015/03/23}{Support for PDF/X-4p and PDF/X-5pg
+% \changes{v1.5.5}{2015/03/23}{Support for PDF/X-4p and PDF/X-5pg
% with external color profiles.}
% \changes{v1.5.6}{2016/02/05}{Suppressed `dummy-space' font warning;
-% removed spurious '?' in XMP packets; improved handling of Color Profiles;
-% ensure Hy@pdfatrue when building PDF/A, for link flags;
-% properly enables xcolor conversion of color models.}
-% \changes{v1.5.7}{2016/02/17}{Removed UTF-8 characters that appear in
+% removed spurious `?' in XMP packets; improved handling of Color Profiles;
+% ensure \texttt{\textbackslash Hy@pdfatrue} when building PDF/A, for link flags;
+% properly enables \texttt{xcolor} conversion of color models.}
+% \changes{v1.5.7}{2016/02/17}{Removed UTF-8 characters that appear in
% the documentation only, within comments in the package source,
% but result in a validation failure. Language support in XMP metadata.
% Added macros for Windows and Mac system color profile directories.}
% \changes{v1.5.8}{2016/05/03}{MediaBox, TrimBox, etc. derived from
-% the paperheight, paperwidth. Improved language support, incl. KOI8-R
+% the \texttt{\textbackslash paperheight}, \texttt{\textbackslash paperwidth}.
+% Improved language support, incl. KOI8-R
% encoded cyrillics, Armenian OT6, and LGR Greek encoding, incl. polytonic Greek.
% All the encodings Latin-1--9 are supported for upper 8-bit characters.
-% Fixed the quoted file-name problem, evident with LuaTeX.
+% Fixed the quoted file-name problem, evident with Lua\TeX.
% Method to generate correct bookmarks with non-active (transliterated) input.
-% Added support for XeLaTeX, improvements with LuaTeX. Updated documentation.}
+% Added support for Xe\LaTeX, improvements with Lua\TeX. Updated documentation.}
% \changes{v1.5.82}{2017/05/12}{%
-% Adjusted to changes in the LaTeX core, affecting macros for composite
+% Adjusted to changes in the \LaTeX\ core, affecting macros for composite
% commands; incl. \texttt{\textbackslash textsuperscript} and others.}%
-% \changes{v1.5.83}{2017/05/16}{Improved support for XeLaTeX and LuaLaTeX.}%
-% \changes{v1.5.84}{2017/05/18}{Fully expand options for hyperref. Better support
+% \changes{v1.5.83}{2017/05/16}{Improved support for Xe\LaTeX\ and Lua\LaTeX.}%
+% \changes{v1.5.84}{2017/05/18}{Fully expand options for \texttt{hyperref}. Better support
% for extended IPA letters and modifiers. Adjusted release versions and dates.}%
-% \changes{v1.5.85}{2017/06/23}{Fixed bugs, and fully implemented L8U as
-% a pseudo-encoding; renamed L8U files into the form *-penc.def }%
-% \changes{v1.6}{2018/11/18}{Added XMP support for PDF/UA-1.
-% Added more Metadata fields and Language support.
-% Default RGB and CMYK profiles now require the colorprofiles.sty package.
-% Added file CallasColorProfiles.tex .
-% Revised glyphtounicode.sty to use variation selectors, altered maps to PUA
-% codepoints; added more glyphs via glyphtounicode-ntx.tex .
+% \changes{v1.5.85}{2017/06/23}{Fixed bugs, and fully implemented L8U as
+% a pseudo-encoding; renamed L8U files into the form \texttt{*-penc.def}.}%
+% \changes{v1.6}{2018/11/18}{Added XMP support for PDF/UA-1.
+% Added more Metadata fields and Language support.
+% Default RGB and CMYK profiles now require the \texttt{colorprofiles.sty} package.
+% Added file \texttt{CallasColorProfiles.tex}.
+% Revised \texttt{glyphtounicode.sty} to use variation selectors, altered maps to PUA
+% codepoints; added more glyphs via \texttt{glyphtounicode-ntx.tex}.
% Support for 8-bit Hebrew encodings, some Arabic and Devanagari.
-% Updated documentation, incl. for LaTeX changes.
+% Updated documentation, incl. for \LaTeX\ changes.
% }%
-% \changes{v1.6.1}{2018/12/22}{Fixed issue with ifthen package;
-% improved Metadata with LuaTeX and XeTeX. Flexibility with page boxes for PDF/X.}%
-% \changes{v1.6.2}{2019/01/04}{Fixed passing of options to xcolor, and some glyphtounicode values.}%
-% \changes{v1.6.3}{2019/02/27}{Fixed encoding issues; support for new pdfomitcharset primitive;
-% reference to veraPDF validation software; additions to glyphtounicode-ntx.tex.}%
+% \changes{v1.6.1}{2018/12/22}{Fixed issue with \texttt{ifthen} package;
+% improved Metadata with Lua\TeX\ and Xe\TeX. Flexibility with page boxes for PDF/X.}%
+% \changes{v1.6.2}{2019/01/04}{Fixed passing of options to \texttt{xcolor}, and some \texttt{glyphtounicode} values.}%
+% \changes{v1.6.3}{2019/02/27}{Fixed encoding issues; support for new \texttt{\textbackslash pdfomitcharset} primitive;
+% reference to \textsf{veraPDF} validation software; additions to \texttt{glyphtounicode-ntx.tex}.}%
+% \changes{v1.6.4}{2019/09/26}{Added check and warning with \texttt{luatex} for whether \texttt{\textbackslash pdfminorversion} can be changed;
+% ensure correct \texttt{\textbackslash catcode} for input characters up to 31, when reading \texttt{.xmpdata} file;
+% disabled patched \texttt{\textbackslash mathaccentV} due to incompatibility with wide base expressions.}
+% \changes{v1.6.5}{2021/07/06}{Support for \texttt{\textbackslash Nickname} as Metadata command;
+% ensure \texttt{\textbackslash par} is unexpandable when processing XMP metadata.}
+% \changes{v1.6.5a}{2023/10/17}{Added option \texttt{pdf20} for future need with PDF 2.0; support for \texttt{\textbackslash pdfmajorversion};
+% support for Memoir's \texttt{\textbackslash stockwidth} and \texttt{\textbackslash stockheight} dimen registers.}
+% \changes{v1.6.5b}{2024/04/05}{Avoid loading \texttt{xmpincl} package from within a \TeX\ grouping.}
+% \changes{v1.6.5c}{2024/05/23}{Avoid loading \texttt{stringenc} package from within a \TeX\ grouping.}
+% \changes{v1.6.5d}{2024/05/29}{Adjust for non-zero \texttt{\textbackslash stockwidth} only; prevent changes to \texttt{xcolor} options after use.}
+% \changes{v1.6.5e}{2024/06/22}{Ensure \texttt{\textbackslash pdfmajorversion} and \texttt{\textbackslash pdfminorversion}
+% are both defined and set correctly. Updated documentation; added new Bibliography entries and revised URL links.}
+% \changes{v1.6.5f}{2024/06/24}{Reset \texttt{\textbackslash ifpdf} properly; support \texttt{\textbackslash creationdate} with Xe\TeX. Revised Glossary layout.}
% \title{Generation of PDF/X- and PDF/A-\penalty-200 compliant PDFs with \pdftex --- \texttt{pdfx.sty}}
-% \date{2019/02/27}
-% \version{1.6.3}
+% \date{2024/07/01}
+% \version{1.6.5f}
% \keywords{PDF, PDF/A, PDF/X, pdf\TeX, \LaTeX, Multilingual Metadata}
% \author{C.\,V.\,Radhakrishnan, \Thanh, Ross Moore {\upshape\small
% and} Peter Selinger}
% \contact{\texttt{[cvr,thanh]@river-valley.org},\\%
-% \texttt{ross.moore@mq.edu.au}, \texttt{selinger@mathstat.dal.ca}\hss}
-%
+% \texttt{ozross@icloud.com}, \texttt{selinger@mathstat.dal.ca}\hss}
+%
% \maketitle
%
% \StopEventually{}
%
% \section[Introduction]{Introduction}
%
-% This package\footnote{An earlier version of this documentation
+% This package\footnote{An earlier version of this documentation
% was published as \cite{pdfx}. All the changes since then have been developed
% and coded by the 3rd-listed author.}
-% currently supports generation of PDF/X-, PDF/A- and PDF/E-compliant
+% currently supports generation of PDF/X-, PDF/A- and PDF/E-compliant
% documents, using \pdftex, in most of their variants;
% see the complete list in Section~\ref{ssec-options} below.
% As of \TeX\,Live 2016 it now also works with Lua\LaTeX\ and Xe\LaTeX,
% when using appropriate command-line options\footnote{%
-% The required invokation is:\quad
+% The required invocation is:\quad
% |xelatex --shell-escape -output-driver="xdvipdfmx -z 0" <filename>.tex |}, but
% with some limitations --- see Sections~\ref{sssec-xetex} and \ref{sssec-luatex}.
-% By `supports', we mean that the package provides correct and sufficient
+% By `supports', we mean that the package provides correct and sufficient
% means to declare that a document conforms with a stated PDF variant
-% (PDF/X, PDF/A, PDF/E, PDF/VT, PDF/UA, etc.) along with the version and/or
+% (PDF/X, PDF/A, PDF/E, PDF/VT, PDF/UA, etc.) along with the version and/or
% level of conformance.
% This package also allows appropriate Metadata and Color Profile
% to be specified, according to the requirements of the PDF variant.
@@ -216,7 +243,7 @@
% information as well as a large range of optional data, a fully validating
% PDF file cannot be achieved. The PDF can be created, having the correct
% visual appearance on all pages, but it will not pass validation checks.
-% Sections~\ref{ssec-metadata} and \ref{ssec-multi} describe
+% Sections~\ref{ssec-metadata} and \ref{ssec-multi} describe
% how this file should be constructed.
%
% \medskip
@@ -224,23 +251,24 @@
% of document structure and type of content that may be required
% (or restricted) within a PDF variant. For example, PDF/VT \cite{PDFVT} requires
% well-structured parts, using Form XObject sections tagged as `/DPart'.
-% Similarly PDF/A-1a (and 2a and 3a) \cite{PDFA,PDFA2,PDFA3} require
-% a fully `Tagged PDF', including a detailed structure tagging which
+% Similarly PDF/A-1a (and 2a and 3a) \cite{PDFA,PDFA2,PDFA3} require
+% a fully `Tagged PDF', including a detailed structure tagging which
% envelops the complete contents of the document, as does also PDF/UA \cite{PDF-UA}.
-% This is beyond the current version of \LaTeX\ engines, as commonly shipped.
+% This is beyond the current version of \LaTeX\ engines as commonly shipped;
+% though see Section~\ref{sec-pdf20} for recent developments.
% So while this package provides enough to meet the declaration,
-% metadata and font-handling aspects for these PDF/A variants,
-% it is not sufficient to produce fully conforming PDFs.
-% However, with extra \pdftex-based software or macro coding that \emph{is} capable
-% of producing `Tagged PDF', this package can be used as part of
-% the overall workflow to produce fully conforming documents.
+% Metadata and font-handling aspects for these PDF/A variants,
+% it is not sufficient to produce fully-conforming PDFs.
+% However, with extra \pdftex-based software or macro coding that \emph{is} capable
+% of producing `Tagged PDF', this package can be used as part of
+% the overall workflow to produce fully-conforming documents; see \cite{tpdf}.
%
%
% \subsection{PDF standards}\label{ssec-standards}
%
% PDF/X and PDF/A are umbrella terms used to denote several ISO
-% standards \cite{PDFX,PDFX3,PDFX1a,PDFX4,PDFX5,PDFA,PDFA2,PDFA3}
-% that define different subsets of the PDF standard \cite{PDF17,ISO32000}.
+% standards \cite{PDFX,PDFX3,PDFX1a,PDFX4,PDFX5,PDFA,PDFA2,PDFA3}
+% that define different subsets of the PDF standard \cite{PDF17,ISO32000}.
% The objective of PDF/X is to facilitate graphics exchange between
% document creator and printer and therefore, has all requirements
% related to printing. For instance, in PDF/X, all fonts need to be
@@ -249,28 +277,28 @@
% specifications of PDF/X.
% Since 2005 other variants of PDF/X have emerged, as extra effects
% (such as layering and transparency) have been supported within the PDF
-% standard itself. The full range of versions and conformance supported
+% standard itself. The full range of versions and conformance supported
% in this package is discussed below in Section~\ref{ssec-options}.
%
% PDF/A defines a profile for archiving PDF documents, which ensures
% the documents can be reproduced in the exact same way in years to
% come. A key element to achieving this is that PDF/A documents
% are 100\% self-contained. All the information needed to display the
-% document in the same manner every time is embedded in the file.
+% document in the same manner every time is embedded in the file.
% A PDF/A document is not permitted to be reliant on information from
% external sources. Other restrictions include avoidance of
-% audio/video content, JavaScript and encryption.
-% Mandatory inclusion of fonts, color profile and standards-based metadata
+% audio/video content, JavaScript and encryption.
+% Mandatory inclusion of fonts, color profile and standards-based metadata
% are absolutely essential for PDF/A.
% Later versions allow for use of image compression and file attachments.
%
-% PDF/E is an ISO standard \cite{PDFE} intended for documents used in engineering workflows.
+% PDF/E is an ISO standard \cite{PDFE} intended for documents used in engineering workflows.
% PDF/VT \cite{PDFVT} allows for high-volume customised form printing, such as utility bills.
% PDF/UA (`Universal Accessibility') has emerged as a standard \cite{PDF-UA,PDFUA1,PDFUABSI}
-% supporting Assistive Technologies, incorporating web-accessibility guidelines (WCAG)
-% for electronic documents.
+% supporting Assistive Technologies, incorporating web-accessibility guidelines (WCAG)
+% for electronic documents.
% In future, PDF/H may emerge for health records and medical-related
-% documents. Other applications can be envisaged.
+% documents. Other applications can be envisaged.
% Declarations and Metadata are supported for the first three of these.
% The others are the subject of further work; revised versions of this
% package can be expected in later years.
@@ -281,6 +309,30 @@
% and whatever else is relevant to how the standards have been established
% and how they can be used.
%
+% \subsection{Later \LaTeX\ changes, support for newer PDF standards}\label{sec-pdf20}
+%
+% Although PDF 2.0~\cite{PDF20} was first published in 2017 and revised in 2020, it has taken
+% a long time for it to become a target format for documents built using \LaTeX.
+% This is because the requirement of using `Tagged PDF' is stringent, requiring
+% a reworking of almost every aspect of \LaTeX's document production model \cite{LaTeXPDF}.
+% Work to this end is going on, via the PDF Association's `\LaTeX\ Project LWG'\cite{PDF-LaTeX},
+% the experimental |tagpdf| package \cite{tagpdf}, and Ross Moore's |tpdf| package and macro suite \cite{tpdf}.
+% Significant internal changes have been made to \LaTeX\ itself, which in turn have
+% required the |v1.6.5x| updates in 2024 to this |pdfx| package. We thank the following users for reporting
+% issues arising from such changes: Sergio Zenoni, Takehiko Tanabe, Tom\'a\v s Nov\'a\v cek.
+%
+% In early 2024 the PDF Association published several documents for new and updated standards
+% based upon PDF 2.0~\cite{PDF20}. These include PDF/UA-2 \cite{PDFUA2}, PDF `Declarations' \cite{PDFDecl},
+% `Well-Tagged PDF' (WTPDF) \cite{WTPDF} with declarations for `Accessibility' and `Reuse',
+% adding to PDF/A-4 \cite{PDFA4}, PDF/X-6 \cite{PDFX6} and PDF/VT-3 \cite{PDFVT3}, each with various flavours.
+% To support these, there will be released in late 2024 a variant named |pdfx2| as an extension of |pdfx|,
+% with separate documentation detailing how to specify appropriate XMP metadata \cite{XMP-ISO}.
+%
+% Once |pdfx2| becomes available, this will take on the role of handling new developments for
+% \LaTeX\ support of PDF 2.0-based software solutions. The |pdfx| package will remain under
+% active development, primarily to ensure compatibility of existing documents with PDF 1.7-based
+% requirements (tagged or otherwise), following any further changes in \LaTeX\ or other packages.
+%
% \section[Usage]{Usage}\label{sec-usage}
%
% The package can be loaded with the command:
@@ -292,7 +344,7 @@
% \subsection{Package options}\label{ssec-options}
%
% \subsubsection{PDF/A options}
-%
+%
% PDF/A is an ISO standard~\cite{PDFA,PDFA2,PDFA3} intended for long-term archiving of
% electronic documents. It therefore emphasizes self-containedness and
% reproducibility, as well as machine-readable metadata. The PDF/A
@@ -307,7 +359,7 @@
% versions contain a subset of the features of later versions, so for
% maximum portability, it is preferable to use a lower-numbered
% version, when the extra features allowed in higher versions are not used.
-% There is no conformance level `u' in version 1 of the standard.
+% There is no conformance level `u' in version 1 of the standard.
% Thus for many typical uses of PDF/A, it is sufficient to use PDF/A-1b.
%
% \begin{itemize}
@@ -320,28 +372,28 @@
% \item |a-3b|: generate PDF/A-3b.
% \item |a-3u|: generate PDF/A-3u.
% \end{itemize}
-% By `Experimental, not fully implemented' here we mean primarily that
+% By `Experimental, not fully implemented' here we mean primarily that
% the document structure, as required for `Tagged PDF', is not handled
-% by this package. Using other \pdftex-based software that \emph{is}
+% by this package. Using other \pdftex-based software that \emph{is}
% capable of producing such complete tagging, conforming documents
% can indeed be produced.
%
% \subsubsection{PDF/E options}
-%
+%
% PDF/E is an ISO standard~\cite{PDFE} intended for documents used in engineering
% workflows. There is only one version of the PDF/E standard so far,
% and it is called PDF/E-1.
-%
+%
% \begin{itemize}
% \item |e-1|: generate PDF/E-1.
% \item |e|: same as |e-1|.
% \end{itemize}
%
% \subsubsection{PDF/UA options}
-%
-% PDF/UA is an ISO and ANSI standard~\cite{PDF-UA,PDFUABSI} intended for making
-% structured documents readable and navigable using Assistive Technology;
-% e.g., screen-readers, Braille keyboards and such-like.
+%
+% PDF/UA is an ISO and ANSI standard~\cite{PDF-UA,PDFUABSI} intended for making
+% structured documents readable and navigable using Assistive Technology;
+% e.g., screen-readers, Braille keyboards and such-like.
% Documents prepared this way can be easily saved in other formats which
% preserve the structure, such as XML, HTML, and (Microsoft) Word-based formats.
%
@@ -359,20 +411,20 @@
% multi-file exchange, and level 2s is for streamed delivery.
% Currently, none of the PDF/VT conformance levels are fully
% implemented by the |pdfx| package.
-%
+%
% \begin{itemize}
% \item |vt-1|: generate PDF/VT-1, based on PDF/X-4. Experimental, not fully implemented
% \item |vt-2|: generate PDF/VT-2, based on PDF/X-5pg. Experimental, not fully implemented.
% \item |vt-2s|: generate PDF/VT-2s. Experimental, not fully implemented.
% \end{itemize}
-% By `Experimental, not fully implemented' here we mean primarily that
+% By `Experimental, not fully implemented' here we mean primarily that
% the structuring of a document into `/DPart' sections, as Form XObjects,
-% is not handled by this package.
-% This \emph{is} possible with current \pdftex\ software,
+% is not handled by this package.
+% This \emph{is} possible with current \pdftex\ software,
% but not yet in a way that lends itself easily to full automation, due to
% requirements of knowing the internal object number of certain internal
-% PDF constructs. All the other aspects: PDFInfo declaration, Metadata
-% and Color Profile, of the PDF/VT variants are correctly handled.
+% PDF constructs. All the other aspects: PDFInfo declaration, Metadata
+% and Color Profile, of the PDF/VT variants are correctly handled.
%
% \subsubsection{PDF/X options}
%
@@ -380,13 +432,13 @@
% emphasizes printing-related requirements, such as embedded fonts and
% color profiles. The PDF/X standard has a large number of variants
% and conformance levels. The basic variants are X-1, X-1a,
-% X-3, X-4, and X-5. (Note that a revised version of the X-2 standard
-% was published in 2003 but withdrawn as an ISO standard in 2011,
-% basically due to lack of interest in using it).
-% The PDF/X-1a standard exists in revisions of 2001 and 2003,
-% the PDF/X-3 standard exists in revisions of 2002 and 2003,
-% and the PDF/X-4 and PDF/X-5 standards exist in revisions of 2008 and 2010.
-% Moreover, some of these standards have a `p' version, which permits the
+% X-3, X-4, and X-5. (Note that a revised version of the X-2 standard
+% was published in 2003 but withdrawn as an ISO standard in 2011,
+% basically due to lack of interest in using it).
+% The PDF/X-1a standard exists in revisions of 2001 and 2003,
+% the PDF/X-3 standard exists in revisions of 2002 and 2003,
+% and the PDF/X-4 and PDF/X-5 standards exist in revisions of 2008 and 2010.
+% Moreover, some of these standards have a `p' version, which permits the
% use of an externally supplied color profile (instead of an embedded one),
% and/or a `g' version, which permits the use of external graphical
% content. Moreover, PDF/X-5 has an `n' version, which extends
@@ -401,14 +453,14 @@
% \item |x-2|: generate PDF/X-2; unpublished, doesn't validate.
% \item |x-3|: generate PDF/X-3. Options |x-302| and |x-303| are
% also available to specify PDF/X-3:2002 or PDF/X-3:2003 explicitly.
-% \item |x-4|: generate PDF/X-4. Options |x-408| and |x-410| are
+% \item |x-4|: generate PDF/X-4. Options |x-408| and |x-410| are
% also available to specify PDF/X-4:2008 or PDF/X-4:2010 explicitly.
% \item |x-4p|: generate PDF/X-4p. Options |x-4p08| and |x-4p10| are
% also available to specify PDF/X-4p:2008 or PDF/X-4p:2010 explicitly.
% \item |x-5g|: generate PDF/X-5g. Options |x-5g08| and |x-5g10| are
% also available to specify PDF/X-5g:2008 or PDF/X-5g:2010 explicitly.
% \item |x-5n|: generate PDF/X-5n. Options |x-5n08| and |x-5n10| are
-% also available to specify PDF/X-5n:2008 or PDF/X-5n:2010 explicitly.
+% also available to specify PDF/X-5n:2008 or PDF/X-5n:2010 explicitly.
% Experimental, not fully implemented.
% \item |x-5pg|: generate PDF/X-5pg. Options |x-5pg08| and |x-5pg10| are
% also available to specify PDF/X-5pg:2008 or PDF/X-5pg:2010 explicitly.
@@ -441,9 +493,11 @@
% applicable standard.\\This may produce a non-standard-conforming PDF file.
% \item |pdf17|: use PDF 1.7, overriding the version specified by the
% applicable standard.\\This may produce a non-standard-conforming PDF file.
+% \item |pdf20|: use PDF 2.0, experimental in preparation for use with future
+% software, under development. This may produce a non-standard-conforming PDF file.
% \item |nocharset|: do not generate the Charset entry for fonts (\pdftex\ only).
% \item |usecharset|: generate the Charset entry for fonts (\pdftex\ only).
-% \end{itemize}
+% \end{itemize}
% The latter two options affect the value of the |\pdfomitcharset| primitive,
% added to \pdftex\ in 2019, due to differing requirements for PDF/A-1
% and other PDF/A versions. Indeed use of the |/Charset| entry for a font
@@ -451,14 +505,14 @@
%
% \subsubsection{XMP language options}\label{ssec-xmplang}
%
-% These options allow for characters in alphabets other than those
-% used for English and Western European languages to be used
-% within the |.xmpdata| file (see Section~\ref{ssec-metadata}),
+% These options allow for characters in alphabets other than those
+% used for English and Western European languages to be used
+% within the |.xmpdata| file (see Section~\ref{ssec-metadata}),
% supported through \LaTeX\ character representation macros.
% \begin{itemize}
-% \item |latxmp|: extended Latin blocks, |Ux0180|--|Ux024F|
-% and |Ux1E00|--|Ux1EFF|
-% \item |armxmp|: armenian letters and ligatures, |Ux0530|--|Ux058F|,
+% \item |latxmp|: extended Latin blocks, |Ux0180|--|Ux024F|
+% and |Ux1E00|--|Ux1EFF|
+% \item |armxmp|: armenian letters and ligatures, |Ux0530|--|Ux058F|,
% via macros |\armyba|, |\armfe|, |\armcomma|, etc.
% \item |cyrxmp|: cyrillic letters and accents, |Ux0400|--|Ux04FF|
% and |Ux0500|--|Ux0527| via macros |\cyra|, |\CYRN|, etc.
@@ -472,8 +526,8 @@
% via macros |\abreve|, |\uhorn|, |\ECIRCUMFLEX|, etc.
% \item |ipaxmp|: phonetic extensions, |Ux0250|--|Ux02AF|
% and |Ux1D00|--|Ux1DFF|
-% \item |mathxmp|: mathematical letters, symbols, operators
-% arrows, alphanumeric forms.
+% \item |mathxmp|: mathematical letters, symbols, operators
+% arrows, alphanumeric forms.
% \item |allxmp|: all of the above, as well as those listed next;
% used primarily for testing compatibility with other packages.
% \end{itemize}
@@ -486,13 +540,13 @@
% Further options allow direct (enclosed) input of upper 8-bit
% characters, from encodings such as Latin-1--Latin-9, KOI8-R,
% LGR (Greek), ArmSSCI8, and a few more.
-% Use of these requires a carefully controlled parsing regime.
+% Use of these requires a carefully controlled parsing regime.
% Here we list the package options that declare such content
% may be present in the |.xmpdata| file.
-% A detailed account of how these are used is given
+% A detailed account of how these are used is given
% in~Section~\ref{ssec-multi} (``Multilingual Metadata'').
% \begin{itemize}
-% \item |LATxmp|: support for direct use of the upper-range characters
+% \item |LATxmp|: support for direct use of the upper-range characters
% (byte codes 160--255) for input encodings Latin1--Latin9, for
% Latin-based alphabets as used in European countries and elsewhere.
% This defines parser macros |\textLAT|, |\textLII|, \dots, |\textLIX|.
@@ -501,7 +555,7 @@
% of upper-range characters (byte codes 148--255) under input
% encodings KOI8-R and KOIR8-RU, using |\textKOI| as parser macro.
% All support from |cyrxmp| is loaded also.
-% \item |LGRxmp|: support for greek letters entered using either
+% \item |LGRxmp|: support for greek letters entered using either
% the LGR input transliteration of ASCII characters, or the ISO-8859-7
% encoding of upper-range characters (byte codes 160--255),
% or a combination of both, using |\textLGR| as parser macro.
@@ -509,25 +563,25 @@
% \item |AR8xmp|: support for armenian letters entered using the
% Arm\TeX~2.0 input transliteration of ASCII characters, or the
% ArmSCII8 encoding of upper-range characters (byte codes 160--255),
-% or a combination of both, using |\textARM| as parser macro.
+% or a combination of both, using |\textARM| as parser macro.
% All support from |armxmp| is loaded also.
-% \item |HEBxmp|: support for hebrew letters entered using either
-% LHE input transliteration of ASCII characters, or the CP1255, CP862
+% \item |HEBxmp|: support for hebrew letters entered using either
+% LHE input transliteration of ASCII characters, or the CP1255, CP862
% or ISO-8859-8 (HE8) encoding of upper-range characters (byte codes 160--255),
% or a combination of these using |\textLHE|, |\textHEBO|, |\textHEB| as parser macros.
% All support from |hebxmp| is loaded also.
% \end{itemize}
-% These `parser' options have received limited testing, so please
+% These `parser' options have received limited testing, so please
% report any mistakes in the UTF-8 output that you may encounter.
%
% \subsection{Data file for metadata}\label{ssec-metadata}
%
-% As mentioned above, standards-compliant PDF documents require
-% document-level metadata to be included.
-% This, known as an `XMP packet'~\cite{XMP-spec,XMP-ISO},
+% As mentioned above, standards-compliant PDF documents require
+% document-level metadata to be included.
+% This, known as an `XMP packet'~\cite{XMP-spec,XMP-ISO},
% is like having a library catalog card included within the PDF itself. It is an unencrypted
% portion of the PDF file, with data expressed in Extensible Markup Language (XML),
-% using Resource Description Format (RDF~\cite{RDF}) syntax, encoded as UTF-8
+% using Resource Description Format (RDF~\cite{RDF}) syntax, encoded as UTF-8
% so readable by any text editing software on any modern computing platform.
%
% Some advantages of doing this are clear.
@@ -539,12 +593,12 @@
% \item For the author(s): who can specify the kind of information most appropriate
% to help readers understand the nature and purpose of the document.
% \end{itemize}
-%
-% The |pdfx| package builds the XMP metadata from information supplied via a special data file
-% called |\jobname.xmpdata|. Here, |\jobname| is usually the basename of the document's main
-% |.tex| file. For example, if your document source is in the file |main.tex|,
-% then the metadata must be in a file called |main.xmpdata|.
-% None of the individual metadata fields are mandatory, but for most documents, it makes sense
+%
+% The |pdfx| package builds the XMP metadata from information supplied via a special data file
+% called |\jobname.xmpdata|. Here, |\jobname| is usually the basename of the document's main
+% |.tex| file. For example, if your document source is in the file |main.tex|,
+% then the metadata must be in a file called |main.xmpdata|.
+% None of the individual metadata fields are mandatory, but for most documents, it makes sense
% to specify at least the title and the author. For more technical aspects of metadata
% and its uses, consult the work of the Dublin Core Initiative~\cite{DC} and PRISM~\cite{PRISM}.
%
@@ -557,72 +611,73 @@
% |\Publisher{Baking International}|
% \end{decl}
% You should note that multiple authors and keywords have been separated
-% by |\sep|. This |\sep| macro serves a technical purpose and is
+% by |\sep|. This |\sep| macro serves a technical purpose and is
% permitted within the |\Author|, |\Keywords|, and |\Publisher| fields,
-% as well as some others. See \S\ref{mdfields} below for a complete listing
+% as well as some others. See \S\ref{mdfields} below for a complete listing
% of the supported author-supplied metadata fields.
%
% After processing, the local directory contains a file named such as
% |pdfa.xmpi| or |pdfe.xmpi| or |pdfx.xmpi| according to the PDF variant desired.
-% This file is the complete XMP Metadata packet.
-% It can be checked for validity, using an online validator, such as at
+% This file is the complete XMP Metadata packet.
+% It can be checked for validity, using an online validator, such as at
% \href{http://www.pdflib.com/knowledge-base/xmp-metadata/free-xmp-validator/}{www.pdflib.com}.
-% \textsf{veraPDF}~\cite{veraPDF} is Open Source software providing validation for PDF/A,
+% \textsf{veraPDF}~\cite{veraPDF} is Open Source software providing validation for PDF/A,
% and other checkers useful in a PDF/A production setting.
-%
+%
% \textbf{Warning}: The |\jobname.xmpdata| file may be included in the
-% main document source, within a |{filecontents*}| environment,
+% main document source, within a |{filecontents}| environment,
% provided this comes \emph{before} the |\documentclass| command, as follows.
+% The |force| option ensures overwriting a previous file to catch recent edits.
% \begin{decl}[]
-% |\begin{filecontents*}{\jobname.xmpdata}|\\
+% |\begin{filecontents}[force]{\jobname.xmpdata}|\\
% | \Title{Baking through the ages}|\\
% | \Author{A. Baker\sep C. Kneader}|\\
% | \Language{en-GB}|\\
% | \Keywords{cookies\sep muffins\sep cakes}|\\
% | \Publisher{Baking International}|\\
-% |\end{filecontents*}|\\
+% |\end{filecontents}|\\
% |\documentclass[11pt,a4paper]{article}|\\
% |...|
% \end{decl}
% Including the metadata with the \LaTeX\ source is very convenient.
-% Having it at the top of the file also brings attention to it, placing emphasis on
-% the desirability of including metadata, and keeping it accurate while the main
-% content of the document is subject to changes or revision.
-% Macro definitions can also occur prior to the |\documentclass| command,
-% including any that may be needed within the metadata.
+% Having it at the top of the file also brings attention to it, placing emphasis on
+% the desirability of including metadata, and keeping it accurate while the main
+% content of the document is subject to changes or revision.
+% Macro definitions can also occur prior to the |\documentclass| command,
+% including any that may be needed within the metadata.
% An example of this is apparent in Figure~\ref{koi8-code} occurring later.
%
-% However, this ordering is also extremely important, else any non-ascii UTF-8 byte
-% sequences can become active characters and expand upon data being written out,
+% However, this ordering is also extremely important, else any non-ascii UTF-8 byte
+% sequences can become active characters and expand upon data being written out,
% rather than remaining as inactive bytes.
% If you edit the metadata supplied this way, remember to remove the
% existing copy of |\jobname.xmpdata| file before the next processing run,
-% as \LaTeX\ does not write a new copy of the file when it exists on disk already,
+% as \LaTeX\ does not write a new copy of the file when it exists on disk already,
% within the current working directory or elsewhere that \LaTeX\ may find.
% In development or testing situations the filename may need to be given as
% |./\jobname.xmpdata|, else an older version may be loaded in error.
-%
+%
% Experienced users/programmers can employ the \verb|\write18| mechanism%
-% \footnote{If you don't already know what this is, they you probably
-% should not try using it |:-)|.}, together with the |--shell-escape| command-line
-% option, to automatically execute a shell command that removes |\jobname.xmpdata|
-% on every (or on selected) processing runs.
+% \footnote{If you don't already know what this is, they you probably
+% should not try using it |:-)|.}, together with the |--shell-escape| command-line
+% option, to automatically execute a shell command that removes |\jobname.xmpdata|
+% on every (or on selected) processing runs.
% This is only useful when the metadata changes, for whatever reason.
%
% \medskip
-% Other places for the |{filecontents*}| environment can work,
+% Other places for the |{filecontents}| environment can work,
% but \emph{only} when it contains \emph{no} non-ascii UTF-8 byte sequences.
-% Since 2018, with default
+% Since 2018, with default
% See Section~\ref{ssec-symbols} below for more information on the macros
% that can be safely used within |.xmpdata| metadata files.
-%
+%
% \subsection{List of supported metadata fields}\label{mdfields}
-%
+%
% Following is a complete list of user-definable metadata fields currently supported,
% separated into particular groupings.
-% Each command is accompanied by the specific XML tagged field name (with namespace)
-% that is placed into the document-level Metadata packet, as well as the kind of information
-% being conveyed.
+% Each command is accompanied by the specific XML tagged field name (with namespace)
+% that is placed into the document-level Metadata packet, as well as the kind of information
+% being conveyed.
% More may be added in the future.
% These commands can \emph{only} be used within the |.xmpdata| file.
%
@@ -630,13 +685,13 @@
% using RFC5646 (BCP 47)~\cite{BCP47} codes, in which the metadata field is given.
% Languages for multiple entries can use e.g., |\sep[de] ...|.
% Only those fields requiring a specific format (e.g. dates) do \emph{not}
-% support language specifiers; these are indicated with \fixmd.
+% support language specifiers; these are indicated with \fixmd.
% Fields allowing more than one value are indicated with \starmd.
% Multiple values may be given as separate instances of the macro, or as a single
-% instance with the values delimited by |\sep|, as in the example above.
-%
+% instance with the values delimited by |\sep|, as in the example above.
+%
% \subsubsection{General information:}
-%
+%
% \begin{itemize}
% \item \starmd|\Author|: \hfill (|dc:creator|)\\
% the document's human author(s). Separate multiple authors with |\sep|.
@@ -661,10 +716,10 @@
% location of a web page describing the owner
% and/or rights statement for this document.
% \item \fixmd|\Copyrighted|: \hfill (|xmpRights:Marked|)\\
-% `True' if the document is copyrighted, and `False' if it isn't.
-% This is automatically set to `True' if either |\Copyright| or |\CopyrightURL| is specified,
-% but this can be overridden.
-% For example, if the copyright statement is `Public Domain',
+% `True' if the document is copyrighted, and `False' if it isn't.
+% This is automatically set to `True' if either |\Copyright| or |\CopyrightURL| is specified,
+% but this can be overridden.
+% For example, if the copyright statement is `Public Domain',
% then specify also |\Copyrighted{False}|.
% \item \starmd|\Owner|: \hfill (|xmpRights:Owner|)\\
% specifies the owner(s) of the document or resource.
@@ -673,18 +728,18 @@
% \end{itemize}
%
% \subsubsection{more Dublin Core metadata:}\label{sssec-dc}
-% From version 1.6 of |pdfx.sty|, the following fields can be used to provide a greater
-% range of information to be specified as metadata.
+% From version 1.6 of |pdfx.sty|, the following fields can be used to provide a greater
+% range of information to be specified as metadata.
% \begin{itemize}
% \item \starmd|\Contributor|: \hfill (|dc:contributor|)\\
% contributor(s) other than author(s) of the PDF document.
% \item |\Coverage|: \hfill (|dc:coverage|)\\
% statement about the extent or scope of the document's contents.
% \item \starmd\fixmd|\Date|: \hfill (|dc:date|)\\
-% date(s) when something significant occurred relating to the resource (e.g., version changes);
+% date(s) when something significant occurred relating to the resource (e.g., version changes);
% must be in ISO date format |YYYY-MM-DD| or |YYYY-MM|.
% \item \fixmd|\PublicationType|: \hfill (|dc:type|)\\
-% The type of publication. If specified, must be one of `book', `catalog', `feed', `journal',
+% The type of publication. If specified, must be one of `book', `catalog', `feed', `journal',
% `magazine', `manual', `newsletter', `pamphlet'. This is automatically set to `journal'
% if |\Journaltitle| is specified (see below), but can be overridden.
% \item \starmd|\Relation|: \hfill (|dc:relation|)\\
@@ -700,10 +755,10 @@
% \end{itemize}
%
% The remaining Dublin Core field |(dc:format)| is always set to `|application/pdf|'.
-%
+%
% \subsubsection{Publication information:}\label{sssec-publ}
-% The following macros allow for inclusion of publication related metadata fields,
-% as specified by PRISM~\cite{PRISM} to meet publishing requirements.
+% The following macros allow for inclusion of publication related metadata fields,
+% as specified by PRISM~\cite{PRISM} to meet publishing requirements.
% \begin{itemize}
% \item |\Journaltitle|: \hfill (|prism:issueName|)\\
% The title of the journal in which the document was published.
@@ -720,7 +775,7 @@
% \item |\CoverDisplayDate|: \hfill (|prism:coverDisplayDate|)\\
% Date on the cover of the journal issue, as a human-readable text string.
% \item \fixmd|\CoverDate|: \hfill (|prism:coverDate|)\\
-% Date on the cover of the journal issue, in a format suitable for storing in a database
+% Date on the cover of the journal issue, in a format suitable for storing in a database
% field with a `date' data type; e.g. |YYYY-MM|, or |YYYY-MM-DD|.
% \end{itemize}
% This is an area which can be expanded, to deal with more kinds
@@ -729,20 +784,20 @@
% Examples of this can be found in the template files |pdfx.xmp|, |pdfa.xmp|, |pdfe.xmp|.
%
% \subsubsection{Backward Compatibility}
-% The following macros are also recognised, for backward compatibility
+% The following macros are also recognised, for backward compatibility
% with earlier versions of the package.
% \begin{itemize}
% \item \starmd|\AuthoritativeDomain|: \hfill (|pdfx:AuthoritativeDomain|)\\
% specifies extra names (e.g., of companies) associated to the existence of the PDF or resource.
% \item |\Creator|: \hfill (|xmp:CreatorTool|)\\
-% synonymous with |\CreatorTool| which is usually handled automatically anyway,
+% synonymous with |\CreatorTool| which is usually handled automatically anyway,
% but can be over-ridden.
% \item |\Org|: synonymous with |\Publisher|.
% \item |\WebStatement|: synonymous with |\CopyrightURL|.
% \end{itemize}
-%
+%
% \subsubsection{more XMP metadata:}\label{sssec-xmp}
-%
+%
% \begin{itemize}
% \item \starmd|\Advisory|: \hfill (|xmp:Advisory|)\\
% noteworthy information; e.g., revision data or changes.
@@ -763,7 +818,7 @@
% with a PDF standard, and level of conformance.
% There are no separate user-macros to alter these.
% The first three dates are usually set to be identical.
-%
+%
% \begin{itemize}
% \item (|xmp:CreateDate|) : creation date\&time of the PDF.
% \item (|xmp:MetadataDate|) : creation date\&time of the Metadata for the PDF.
@@ -776,7 +831,7 @@
% \item (|pdfaid:conformance|) : |a|, |b| or |u| for PDF/A-??
% \item (|pdfuaid:part|) : currently |1| for PDF/UA-1
% \item (|pdfe:ISO_PDFEVersion|) : currently |1| for PDF/E-1
-% \item (|pdf:Version|) : |PDF/X-1|, |PDF/X-2| or |PDF/X-3|
+% \item (|pdf:Version|) : |PDF/X-1|, |PDF/X-2| or |PDF/X-3|
% \item (|pdfx:GTS_PDFXVersion|) : e.g., |PDF/X-1a:2003| up to PDF/X-3 ;
% but no year for PDF/X-4 and PDF/X-5 variants
% \item (|pdfx:GTS_PDFXConformance|) : e.g., |PDF/X-1a:2003| up to PDF/X-2
@@ -788,13 +843,13 @@
% \subsection{Symbols permitted in metadata}\label{ssec-symbols}
%
% Within the metadata, all printable ASCII characters except
-% |\|, |{|, |}| and |%| represent themselves. Also, all printable Unicode characters
-% from the basic multilingual plane (i.e., up to code point U+FFFF)
+% |\|, |{|, |}| and |%| represent themselves. Also, all printable Unicode characters
+% from the basic multilingual plane (i.e., up to code point U+FFFF)
% can be used directly with the UTF-8 encoding.
-% (Please note: encodings other than UTF-8 are not supported in the metadata,
-% except as arguments to `parser-macros'; see Section~\ref{ssec-xmplang}).
-% Consecutive whitespace characters are combined into a single space.
-% Whitespace after a macro such as |\copyright|, |\backslash|, or |\sep| is ignored.
+% (Please note: encodings other than UTF-8 are not supported in the metadata,
+% except as arguments to `parser-macros'; see Section~\ref{ssec-xmplang}).
+% Consecutive whitespace characters are combined into a single space.
+% Whitespace after a macro such as |\copyright|, |\backslash|, or |\sep| is ignored.
% Blank lines are not permitted.
% Moreover, the following markup can be used:
%
@@ -807,32 +862,32 @@
% \item |\copyright|: the copyright symbol \textcopyright
% \end{itemize}
% The macro |\sep| is permitted within |\Author|, |\Keywords|,
-% |\Publisher|, and other macros marked with \starmd\ above.
-% It's purpose is to separate multiple authors, keywords, etc.
-% to appear as separate list items appropriately and consistently
-% in the different ways that such information is represented
-% within the PDF file.
+% |\Publisher|, and other macros marked with \starmd\ above.
+% It's purpose is to separate multiple authors, keywords, etc.
+% to appear as separate list items appropriately and consistently
+% in the different ways that such information is represented
+% within the PDF file.
% The package takes care of this when |\sep| is used.
% For example, in the XMP metadata, it expands as |</rdf:li><rdf:li>| tagging.
%
% \subsubsection{PDF Info strings}\label{sssec-info}
-% When |\sep| is not used within its argument, the metadata from |\Title|,
-% |\Author| and |\Keywords| is also included in the PDF |/Info| dictionary.
+% When |\sep| is not used within its argument, the metadata from |\Title|,
+% |\Author| and |\Keywords| is also included in the PDF |/Info| dictionary.
% When this is the case, validation for the declared standard
% will occur only if the corresponding |/Info| item and XMP metadata field
-% convert to exactly the same Unicode string.
+% convert to exactly the same Unicode string.
% This cannot happen when |\sep| is used, so the |/Info| items are then not populated.
%
% Unfortunately not all PDF browsers (in particular, older ones and much Apple software)
% give ready access to the XMP metadata packet. Some authors want to see everything
-% using e.g., the Unix/Linux command: |pdfinfo -enc UTF-8 |. In fact there is the |-meta|
-% option to get the complete metadata packet (in UTF-8 encoding).
+% using e.g., the Unix/Linux command: |pdfinfo -enc UTF-8 |. In fact there is the |-meta|
+% option to get the complete metadata packet (in UTF-8 encoding).
% This can give more than what one wants, so use it as follows:
% \begin{decl}[]
% pdfinfo -meta <filename>.pdf \textbar\ grep 'dc:'
% \end{decl}
% to extract just the Dublin Core metadata fields.
-%
+%
% Another possibility is to \emph{not} use |\sep| with multiple authors and/or keywords.
% Instead replace it with simply `|, |'. We do not recommend doing this, as more sophisticated
% metadata tools will see the result as a single value, rather than multiple authors, say.
@@ -842,21 +897,21 @@
%
% \subsection{Macros permitted in metadata}\label{ssec-macros}
%
-% Other \TeX\ macros actually can be used, provided the author is very
+% Other \TeX\ macros actually can be used, provided the author is very
% careful and not ask for too-complicated \TeX\ or \LaTeX\ expansions
% into internal commands or non-character primitives; basically just accents,
% macros for Latin-based special characters, and simple textual replacements,
-% perhaps with a simple parameter. A special macro |\pdfxEnableCommands{...}|
+% perhaps with a simple parameter. A special macro |\pdfxEnableCommands{...}|
% is provided to help resolve difficulties that may arise.
%
% Here is an example\footnote{ Other use cases are discussed with regard to
-% Figures~\ref{arm-code} and \ref{math-wflow}.} of the use of |\pdfxEnableCommands|,
-% which occurs with the name of one of our authors {(H\`an Th\'{\^e} Thanh)}
+% Figures~\ref{arm-code} and \ref{math-wflow}.} of the use of |\pdfxEnableCommands|,
+% which occurs with the name of one of our authors {(H\`an Th\'{\^e} Thanh)}
% due to the doubly-accented letter \'{\^e}.
% It is usual to define a macro such as: |\def\thanh{H\`an Th\'{\^e} Thanh}|.
-% In previous versions of the |pdfx| package, use of such a macro
+% In previous versions of the |pdfx| package, use of such a macro
% within the |.xmpdata| file, in the |Copyright| information say,
-% could result in the accent macros expanding into internal primitives, such as
+% could result in the accent macros expanding into internal primitives, such as
% \begin{decl}[]
% | H\unhbox \voidb@x \bgroup \let \unhbox \voidb@x \setbox \@tempboxa ... |
% \end{decl}
@@ -867,7 +922,7 @@
% | \def\`#1{#1^^cc^80}\def\'#1{#1^^cc^81}\def\^#1{#1^^cc^82}}|
% \end{decl}
% \removelastskip\noindent
-% where the |^^cc^80|, |^^cc^81|, |^^cc^82| cause \TeX\ to generate the correct
+% where the |^^cc^80|, |^^cc^81|, |^^cc^82| cause \TeX\ to generate the correct
% UTF-8 bytes for `combining accent' characters.
%
% This works fine for metadata fields that appear just in the XMP packet.
@@ -878,22 +933,22 @@
% | \def\thanh{H^^c3^^a0n Th\eee Thanh}\def\eee{^^c3^^aa^^cc^^81 }}|
% \end{decl}
% \removelastskip\noindent
-% or the above with `\`a' typed directly as UTF-8 instead of |^^c3^^a0|
+% or the above with `\`a' typed directly as UTF-8 instead of |^^c3^^a0|
% and `\^e' in UTF-8 for |^^c3^^aa|.
% The reason for this is due to the |\pdfstringdef| command, which constructs
-% the accented latin letters as single combined characters \`a and \^e,
+% the accented latin letters as single combined characters \`a and \^e,
% without resorting to combining accents, wherever possible.
-% If the Metadata does not have the same, irrespective of Unicode normalisation,
+% If the Metadata does not have the same, irrespective of Unicode normalisation,
% then validation fails.
%
% With version (1.5.6) of the |pdfx| package, such difficulties
-% have been overcome, at least for characters used in Western European,
-% Latin-based languages. The input encoding used when reading the |.xmpdata|
-% file now includes interpretations of \TeX's usual accent commands to
+% have been overcome, at least for characters used in Western European,
+% Latin-based languages. The input encoding used when reading the |.xmpdata|
+% file now includes interpretations of \TeX's usual accent commands to
% produce the required UTF-8 byte sequences.
%
% \medskip
-% Since version (1.5.8) this input encoding was extended to include
+% Since version (1.5.8) this input encoding was extended to include
% macro definitions covering \LaTeX's internal character representation
% of other alphabets (e.g., extended Latin, Cyrillic, Greek, etc.).
% However this can become memory intensive, requiring a large number of
@@ -902,12 +957,12 @@
% be relevant. Currently these are as in Section~\ref{ssec-xmplang}.
%
% A significant portion of the Unicode Basic Plane characters can be covered
-% this way. Modules could even be provided for CJK character sets and
+% this way. Modules could even be provided for CJK character sets and
% mathematical symbols, etc. However, as this can become memory intensive,
% significant testing will be required before these become a standard
-% part of the |pdfx| package.
+% part of the |pdfx| package.
+%
%
-%
% \subsection{Color profiles}\label{sec-profiles}
%
% Most standards compliant PDF documents require a \emph{color
@@ -915,26 +970,26 @@
% determines precisely how the colors used in the document will be
% rendered when printed to a physical medium. This can be used to
% ensure that the document will look exactly the same, even when it is
-% printed on different printers, with different paper types, etc.
-% The inclusion of a color profile is necessary to make the document
+% printed on different printers, with different paper types, etc.
+% The inclusion of a color profile is necessary to make the document
% completely self-contained.
%
% Since most \LaTeX\ users are not graphics professionals and are not
% particularly picky about colors, the |pdfx| package includes default
-% profiles that will be included when nothing else is specified.
+% profiles that will be included when nothing else is specified.
% Therefore, the average user doesn't have to do anything
% special about color.
%
% For users who have a specific color profile they wish to use, it is
% possible to do so by including a |\setRGBcolorprofile| or
% |\setCMYKcolorprofile| command in the |.xmpdata| file. Note that
-% PDF/A and PDF/E require a profile of type `|mnrt|' (monitor) which
-% is usually an RGB color profile, while PDF/X and PDF/VT require type `|prtr|'
+% PDF/A and PDF/E require a profile of type `|mnrt|' (monitor) which
+% is usually an RGB color profile, while PDF/X and PDF/VT require type `|prtr|'
% (printer) which is usually a CMYK color profile; but valid documents
% can be created with the correct type designed for the other color space.
-% Use the following commands to specify an RGB or CMYK color profile,
+% Use the following commands to specify an RGB or CMYK color profile,
% respectively:
-%
+%
% \begin{decl}
% \defmacro{setRGBcolorprofile}\marg{filename}\marg{identifier}\marg{info
% string}\marg{registry URL}
@@ -944,7 +999,7 @@
% \end{decl}
% Within the arguments of these macros, the characters |<|, |>|, |&|,
% |^|, |_|, |#|, |$|, and |~| can be used as themselves, but
-% |%| must be escaped as |\%|.
+% |%| must be escaped as |\%|.
%
% From version (1.6) the default RGB and CMYK color profiles are now supplied
% using the |colorprofiles| package by Norbert Preining and Ross Moore~\cite{colorp}.
@@ -966,7 +1021,7 @@
% \url{http://www.color.org/iccprofile.xalter}.
%
% Alternatively, color profiles are shipped with many Adobe software
-% applications; these are then available for use also with non-Adobe
+% applications; these are then available for use also with non-Adobe
% software. Now the |pdfx| package includes coding to streamline
% inclusion of these profiles in PDF documents, or to specify
% them as `external' profiles, with PDF/X-4p and PDF/X-5pg variants.
@@ -977,17 +1032,17 @@
% Both define commands to use Color Profiles as follows.
% \begin{decl}[]
% \begin{tabular}{ll}
-% \texttt{\string\FOGRAXXXIX} & Coated FOGRA39 (ISO 12647-2:2004)\\
+% \texttt{\string\FOGRAXXXIX} & Coated FOGRA39 (ISO 12647-2:2004)\\
% \texttt{\string\SWOPCGATSI} & U.S. Web Coated (SWOP) v2\\
-% \texttt{\string\JapanColorMMICoated} & Japan Color 2001 Coated\\
-% \texttt{\string\JapanColorMMIUncoated} & Japan Color 2001 Uncoated\\
-% \texttt{\string\JapanColorMMIINewspaper} & Japan Color 2002 Newspaper\\
-% \texttt{\string\JapanWebCoatedAd} & Japan Web Coated (Ad)\\
-% \texttt{\string\CoatedGRACoL} & Coated GRACoL 2006 (ISO 12647-2:2004)\\
+% \texttt{\string\JapanColorMMICoated} & Japan Color 2001 Coated\\
+% \texttt{\string\JapanColorMMIUncoated} & Japan Color 2001 Uncoated\\
+% \texttt{\string\JapanColorMMIINewspaper} & Japan Color 2002 Newspaper\\
+% \texttt{\string\JapanWebCoatedAd} & Japan Web Coated (Ad)\\
+% \texttt{\string\CoatedGRACoL} & Coated GRACoL 2006 (ISO 12647-2:2004)\\
% \texttt{\string\SNAPCGATSII} & CGATS TR 002\\
% \texttt{\string\SWOPCGATSIII} & CGATS TR 003\\
% \texttt{\string\SWOPCGATSV} & CGATS TR 005\\
-% \texttt{\string\ISOWebCoated} & Web Coated FOGRA28 (ISO 12647-2:2004)\\
+% \texttt{\string\ISOWebCoated} & Web Coated FOGRA28 (ISO 12647-2:2004)\\
% \texttt{\string\ISOCoatedECI} & ISO Coated v2 (ECI)\\
% \texttt{\string\CoatedFOGRA} & Coated FOGRA27 (ISO 12647-2:2004)\\
% \texttt{\string\WebCoatedFOGRA} & Web Coated FOGRA28 (ISO 12647-2:2004)\\
@@ -999,18 +1054,18 @@
% As of the time of first compiling this list, only the first six of these result in PDFs
% which can validate with external profiles (i.e., for PDF/X-4p and PDF/X-5pg)
% using the then-current versions of Adobe Acrobat Pro software. It is unclear
-% whether the others (incl.\,\verb|\IFRAXXVI| and \verb|\IFRAXXX|) failed due
-% to incorrect data or problems in the validation software.
+% whether the others (incl.\,\verb|\IFRAXXVI| and \verb|\IFRAXXX|) failed due
+% to incorrect data or problems in the validation software.
% Since then, with updates to Acrobat Pro, almost all the others have been verified
% to work, except \verb|\IFRAXXX| which seems no longer available.
-% Thus these commands come with a `use at own risk' clause.
+% Thus these commands come with a `use at own risk' clause.
%
-% For `external' profiles, there is a command |\setEXTERNALprofile|, taking 9 arguments,
+% For `external' profiles, there is a command |\setEXTERNALprofile|, taking 9 arguments,
% that must be used. Consult |AdobeExternalProfiles.tex| for examples of its use.
-%
-% All but the last of the macros listed above can also be used for valid embedded profiles,
-% providing the corresponding files can be found.
-% The following macros are used to set the (absolute or relative) path,
+%
+% All but the last of the macros listed above can also be used for valid embedded profiles,
+% providing the corresponding files can be found.
+% The following macros are used to set the (absolute or relative) path,
% on the local operating system, to the location of color profile files.
% \begin{decl}
% \defmacro{pdfxSetRGBcolorProfileDir}\marg{path to RGB color profiles}\\
@@ -1020,7 +1075,7 @@
% One can use either a macro |\MacOSColordir| which expands
% into the path for system-provided profiles:
% \begin{decl}[]
-% |/System/Library/ColorSync/Profiles/|
+% |/System/Library/ColorSync/Profiles/|
% \end{decl}
% or the macro |\MacOSLibraryColordir| expanding to:
% \begin{decl}[]
@@ -1030,23 +1085,23 @@
% \begin{decl}[]
% |/Library/Application Support/Adobe/Color/Profiles/Recommended/|
% \end{decl}
-% Under Windows an available macro is |\WindowsColordir| which expands to:
+% Under Windows an available macro is |\WindowsColordir| which expands to:
% \begin{decl}[]
% |C:\Windows\System32\Spool\Drivers\Color/|
% \end{decl}
% being the common location for color profiles.
-% Use these within the \verb|.xmpdata| file as, e.g.,
+% Use these within the \verb|.xmpdata| file as, e.g.,
% \begin{decl}[]
% |\pdfxSetCMYKcolorProfileDir{\AdobeMacOSdir}|
% \end{decl}
% Authors may change the paths to suit their own circumstances, either
-% \emph{before} loading |pdfx.sty| or within the \verb|.xmpdata| file.
+% \emph{before} loading |pdfx.sty| or within the \verb|.xmpdata| file.
%
% PDF/A and PDF/E usually need an RGB profile, while PDF/X and PDF/VT
-% require a CMYK profile. It is possible to use a CMYK profile with PDF/A
+% require a CMYK profile. It is possible to use a CMYK profile with PDF/A
% or PDF/E by specifying |\setRGBcolorprofile{}{}{}{}| in the \verb|.xmpdata| file.
% Beware however, that with PDF/A any coloured hyperlink annotations can
-% cause a validation problem, as these are interpreted as RGB colours
+% cause a validation problem, as these are interpreted as RGB colours
% even when 4 components are given. This may be a bug in validators,
% as PDF specifies that the number of components should match the color space.
%
@@ -1070,44 +1125,44 @@
% \end{decl}
% which uses a profile that accompanies the \texttt{pdfaPilot} software from
% Callas Software Gmbh~\cite{pdfaPilot}.
-% The macro |\CallasMacOSpdfaPilotdir|, defined in the file \texttt{CallasColorProfiles.tex},
+% The macro |\CallasMacOSpdfaPilotdir|, defined in the file \texttt{CallasColorProfiles.tex},
% specifies the directory where this Custom profile is located, when installed under MacOS.
% One needs to |\input CallasColorProfiles.tex| \emph{before} loading the |pdfx| package.
-% Macros for other directories are also defined in this file.
+% Macros for other directories are also defined in this file.
%
% \subsection{Notes on the internal representation of metadata}
-%
+%
% Within the PDF file, metadata is deposited in two places: some data
% goes into the native PDF |/Info| dictionary, and some data goes into
% an XMP packet stored separately within the file. XMP is Adobe's
-% Extensible Metadata Platform~\cite{XMP-spec,XMP-ISO}, and is an XML-based format.
+% Extensible Metadata Platform~\cite{XMP-spec,XMP-ISO}, and is an XML-based format.
% See \href{http://www.adobe.com/devnet/xmp/}{Adobe XMP Development Center}
-% for more exhaustive information about XMP.
+% for more exhaustive information about XMP.
% An XMP Toolkit SDK which supports the GNU/Linux, Macintosh and Windows operating
% systems is also available under modified BSD licence.
%
% Some of the metadata, such as the author, title, and keywords, can be
-% stored \emph{both} in the XMP packet and in the |/Info| dictionary.
-% For the resulting file to be standards-compliant, the two copies of the data
+% stored \emph{both} in the XMP packet and in the |/Info| dictionary.
+% For the resulting file to be standards-compliant, the two copies of the data
% must be identical. This is taken care of automatically by the |pdfx| package,
% except when |\sep| is used to handle multiple entries, as discussed above
-% in \S\ref{sssec-info}. In such cases the string is not included within the |/Info|
+% in \S\ref{sssec-info}. In such cases the string is not included within the |/Info|
% dictionary. Note that this is in accordance with the PDF 2.0 specification~\cite{PDF20},
% which deprecates use of the |/Info| dictionary for such metadata.
-%
-% In principle, users can resort to alternate ways to create an XMP file
-% for inclusion in PDF. In this case, one should create a customised template
+%
+% In principle, users can resort to alternate ways to create an XMP file
+% for inclusion in PDF. In this case, one should create a customised template
% file |pdfa.xmp| or |pdfx.xmp| or |pdfe.xmp| (etc., depending on the PDF flavor)
-% containing the pre-defined data. This can be done by modifying the ones supplied
-% with the |pdfx| package. However, this is an error-prone process and is
-% \emph{not} recommended for most users.
+% containing the pre-defined data. This can be done by modifying the ones supplied
+% with the |pdfx| package. However, this is an error-prone process and is
+% \emph{not} recommended for most users.
% If there is a particular field of metadata that you need and that is not currently
% supported, please contact the package authors.
%
% |pdfx| makes use of the |xmpincl| package to include XMP data into
% the PDF. The documentation of |xmpincl| package may help interested
% users to understand the process of XMP data inclusion.
-%
+%
% \subsection{Tutorials and technical notes}
%
% A tutorial with step-by-step instructions for generating PDF/A files
@@ -1120,7 +1175,7 @@
% \url{http://support.river-valley.com/wiki/index.php?title=Generating_PDF/A_compliant_PDFs_from_pdftex}.
% Be aware that this is based on use of an earlier version of the |pdfx| package,
% so some of the advice may have been superseded.
-%
+%
%
% \section[Installing]{Installing}
% The |pdfx.dtx| package is available on CTAN as usual, via
@@ -1131,24 +1186,24 @@
% For those wishing to do a manual installation, here are some notes.
% The file |pdfx.dtx| is a composite document of program code and
% documentation in \LaTeX{} format, in the tradition of \emph{literate
-% programming}. After having installed the package,
+% programming}. After having installed the package,
% to get the documentation that you are reading now,
-% run (\textsc{pdf})\LaTeX{} on the file |pdfx.dtx|.
+% run (\textsc{pdf})\LaTeX{} on the file |pdfx.dtx|.
% The resulting PDF should be valid as PDF/A-2u.
% Or better, use the included |Makefile|, which will also regenerate the index.
%
% To install the package, first extract the program code; i.e., the
-% file |pdfx.sty|, by running \LaTeX{} or \TeX{} on the file |pdfx.ins|.
+% file |pdfx.sty|, by running \LaTeX{} or \TeX{} on the file |pdfx.ins|.
% Create a directory named |pdfx| under |$TEXMF/tex/latex| and copy the files
-% |pdfx.sty|, |8bit.def|, |glyphtounicode-cmr.tex|, |glyphtounicode-ntx.tex| as well
+% |pdfx.sty|, |8bit.def|, |glyphtounicode-cmr.tex|, |glyphtounicode-ntx.tex| as well
% as the other |*.tex|, |l8u*-penc.def| and |*.xmp| files, into it. Then update
% \TeX's file database using the appropriate command for your distribution
% and operating system (such as |texhash| or |mktexlsr|, or similar).
-%
+%
% \subsection{Limitations and dependencies}
-%
-% The |pdfx.sty| package works with \pdftex\ and also Lua\TeX\ and Xe\TeX\
-% with some minor limitations.
+%
+% The |pdfx.sty| package works with \pdftex\ and also Lua\TeX\ and Xe\TeX\
+% with some minor limitations.
% It further depends on the following other packages.
% \begin{enumerate}
% \item |xmpincl| for insertion of metadata into PDF.
@@ -1159,28 +1214,28 @@
% hyperlinking, bookmarks, etc.
% \item |xcolor| for ensuring consistent use of the color model
% appropriate the PDF variant, within text and hyperlinks (when allowed).
-% \item |glyphtounicode.tex| (not Xe\LaTeX) maps glyph names
+% \item |glyphtounicode.tex| (not Xe\LaTeX) maps glyph names
% to corresponding Unicode code-points.
% \item |ifluatex| allowing coding specific to Lua\LaTeX.
% \item |ifxetex| allowing coding specific to Xe\LaTeX.
-% \item |luatex85| or |pdftexcmds| (Lua\TeX\ only) for access
+% \item |luatex85| or |pdftexcmds| (Lua\TeX\ only) for access
% to primitive commands using \pdftex\ macro names.
-% \item |stringenc| used to help generate proper bookmarks with transliterated input;
+% \item |stringenc| used to help generate proper bookmarks with transliterated input;
% e.g., with |\textLGR| or |\textARM| --- see Section~\ref{sssec-arm}.
% \end{enumerate}
% Other files and packages are loaded as sub-packages or as
-% configuration files for these. Since some of these packages
-% may be loaded by existing documents we provide here advice on
+% configuration files for these. Since some of these packages
+% may be loaded by existing documents we provide here advice on
% how to deal with potential loading and option conflicts.
%
% Firstly, it is best if |pdfx| is the first package loaded; e.g.,
-% directly after the |\documentclass| line. This is not a strict requirement,
+% directly after the |\documentclass| line. This is not a strict requirement,
% but it is worthwhile to deal with the metadata at the top of your \LaTeX\ source,
% allowing correct options to be loaded to cope with validation aspects.
%
% Secondly, replace |\usepackage[<options>]{hyperref}| with |\hypersetup{<options>}|.
-% This deals with most loading issues with the |hyperref| package.
-% Note that PDF/X is a format intended for printing.
+% This deals with most loading issues with the |hyperref| package.
+% Note that PDF/X is a format intended for printing.
% It forbids inclusion of hyperlinks and other actions, including via bookmarks.
% To produce a validating PDF/X document, |pdfx| overrides internal macros
% while keeping colors associated with link anchors.
@@ -1191,53 +1246,53 @@
% Furthermore, options to set metadata components (such as |pdfauthor|,
% |pdftitle|, |pdfsubject|, |pdfkeywords|, etc.) are disabled, since
% |pdfx| has already taken care of this information.
-%
+%
% Thirdly, conflicts with other packages may be dealt with by simply
% changing |\usepackage| to |\RequirePackage| within the document's
-% preamble. But this may not be possible when the |\usepackage|
+% preamble. But this may not be possible when the |\usepackage|
% or |\RequirePackage| command occurs within another package, or with
-% a specific set of options, thereby causing processing to stop.
-% Few packages have a command analogous to |\hypersetup|.
+% a specific set of options, thereby causing processing to stop.
+% Few packages have a command analogous to |\hypersetup|.
% Instead |\PassOptionsToPackage{<options>}{<package>}| can help.
% For |<options>| specify the ones associated with the loading yet to come.
% This can give a smooth processing run, but you'll need to check whether
% the results from those options have actually taken effect.
-% Some examples of this can be seen later, in Figures~\ref{koi8-code}
+% Some examples of this can be seen later, in Figures~\ref{koi8-code}
% and \ref{tldoc-pol}.
%
% \subsubsection{Limitations using Xe\LaTeX}\label{sssec-xetex}
%
-% To process a file using Xe\LaTeX, to produce a document that can
+% To process a file using Xe\LaTeX, to produce a document that can
% validate to a particular PDF standard, one need to use a command
% to run the \TeX\ engine, as follows.
% \begin{decl}[]
% |xelatex -shell-escape -output-driver="xdvipdfmx -z 0" <filename>.tex |
% \end{decl}
% The |-shell-escape| option allows a command-line task to be run,
-% which writes the creation-date \& time of the running job into
-% a small file on disk. This data, written in a specific format, is then
+% which writes the creation-date \& time of the running job into
+% a small file on disk. This data, written in a specific format, is then
% read by the job for inclusion into several metadata fields.
% This emulates the result of \pdftex's |\pdfcreationdate| primitive.
% As there are security implications in allowing arbitrary commands to be run,
-% this need for |-shell-escape| must be viewed as imposing a limitation on the
+% this need for |-shell-escape| must be viewed as imposing a limitation on the
% work-flows in which this can be safely used.
%
-% The |-output-driver="xdvipdfmx -z 0"| suppresses compression, which
+% The |-output-driver="xdvipdfmx -z 0"| suppresses compression, which
% is not allowed for the XMP metadata packet. Without this, the resulting PDF
-% may fail to pass validation tests.
+% may fail to pass validation tests.
%
% Xe\TeX\ is designed for processing UTF-8 input only. When presented
-% with \LaTeX\ source using a legacy encoding, such as |latin2| or |koi8-r|,
-% the input is accepted and a PDF produced. Yet there will be garbage
+% with \LaTeX\ source using a legacy encoding, such as |latin2| or |koi8-r|,
+% the input is accepted and a PDF produced. Yet there will be garbage
% characters corresponding to each character entered from the upper range
-% (128--255). This is evident in the PDF content and bookmarks;
+% (128--255). This is evident in the PDF content and bookmarks;
% yet |pdfx| produces the correct XMP metadata packet.
% So while the techniques explained later in Section~\ref{ssec-multi} are
% valid, the PDF itself does not contain correct content.
%
% Not all fonts, in particular Open-Type fonts (OTF), naturally come with
% mappings of the glyphs to Unicode code points. This is a requirement
-% with PDF/A, PDF/E and PDF/UA standards.
+% with PDF/A, PDF/E and PDF/UA standards.
% Use of such fonts can result in validation errors, such as:
% \begin{itemize}
% \item
@@ -1245,7 +1300,7 @@
% \item
% Type 2 CID font: CIDToGID map is invalid or missing.
% \end{itemize}
-%
+%
% If one has access to Adobe's |Acrobat Pro| software, then its |Preflight|
% utility can rewrite the uncompressed output from Xe\LaTeX\ into a valid
% PDF standard, using compression of the contents but not of the XMP packet.
@@ -1256,7 +1311,7 @@
%
% Lua\LaTeX\ can handle the OTF font issues mentioned for Xe\LaTeX,
% so can produce valid PDF/A documents where Xe\LaTeX\ fails.
-% However, since Lua\TeX\ expects all input source to be UTF8-encoded,
+% However, since Lua\TeX\ expects all input source to be UTF8-encoded,
% it cannot work at all with documents using older legacy encodings.
% Instead one gets error messages such as:
%\begin{decl}
@@ -1299,15 +1354,15 @@
% \item |l8uheb-penc.def| --- input macro declarations for Hebrew alphabet.
% \item |l8ulat-penc.def| --- input macro declarations for Latin 1--9 encodings.
% \item |l8umath-penc.def| --- input macro declarations for mathematical symbols.
-% \item |glyphtounicode-cmr.tex|, |glyphtounicode-ntx.tex| --- maps glyph names
+% \item |glyphtounicode-cmr.tex|, |glyphtounicode-ntx.tex| --- maps glyph names
% to corresponding Unicode for Computer Modern and other \TeX-specific fonts.
% \item |AdobeColorProfiles.tex| --- macros for inclusion of Adobe-supplied color profiles.
% \item |AdobeExternalProfiles.tex| --- macros for use of external color profiles.
% \item |CallasColorProfiles.tex| --- macros for profiles included with Callas pdfaPilot software.
% \end{itemize}
-%
+%
% \subsubsection{Documentation \& Examples}
-%
+%
% \begin{itemize}
% \item |README| --- usual top-level information.
% \item |manifest.txt| --- file list.
@@ -1315,9 +1370,9 @@
% \item |sample.tex|, |sample.xmpdata| --- a sample file with sample metadata.
% \item |small2e-pdfx.tex| --- sample file with included metadata.
% \end{itemize}
-%
+%
% \subsubsection{Sources}
-%
+%
% \begin{itemize}
% \item |src/pdfx.dtx| --- composite package and documentation.
% \item |src/pdfx.ins| --- installer batch file.
@@ -1326,10 +1381,10 @@
% \item |src/Makefile| --- a Makefile for building the documentation.
% \item |src/MANIFEST| --- list of files in this directory.
% \item |src/text89.def| --- used with Figure\,\ref{ex-arm} in the documentation.
-% \item |src/{arm-start,koi8-example,koi8-example2,latin2-example}.tex|
+% \item |src/{arm-start,koi8-example,koi8-example2,latin2-example}.tex|
% --- used in the documentation with figures showing example coding.
% \item |src/{TL-POL-meta,TL-RU-LICRs,TL-RU-metadata,TL-RU-toc,Armenian-example-UTF8,|\\
-% |armtex-meta,usage-meta,math-assign5}.png| --- screenshot images showing multilingual
+% |armtex-meta,usage-meta,math-assign5}.png| --- screenshot images showing multilingual
% and other metadata.
% \end{itemize}
%
@@ -1337,9 +1392,9 @@
%
% The package is released under the \LaTeX{} Project Public
% Licence. Bug reports, suggestions, feature requests, etc., may be
-% sent to the original authors at
+% sent to the original authors at
% \href{mailto:cvr@river-valley.org}{\ttfamily cvr@river-valley.org}
-% and/or
+% and/or
% \href{mailto:thanh@river-valley.org}{\ttfamily thanh@river-valley.org},
% or to the more recent contributors at
% \href{mailto:ross.moore@mq.edu.au}{\ttfamily ross.moore@mq.edu.au}
@@ -1348,9 +1403,9 @@
%
%
% \section[Multilingual and Technical Considerations]{Multilingual and Technical Considerations}\label{sec-meta}
-%
-% \TeX\ and \LaTeX\ have an on-going practice of including metadata within
-% the source files and package documentation. Usually this is done as comments
+%
+% \TeX\ and \LaTeX\ have an on-going practice of including metadata within
+% the source files and package documentation. Usually this is done as comments
% at the beginning of the file; such as the following from the English
% language version of the 2015 \TeX\ Live documentation\footnote{%
% found at |/usr/local/texlive/2016/texmf-dist/doc/texlive/texlive-en/|.}.
@@ -1360,10 +1415,10 @@
% |Michel Goossens, now maintained by Karl Berry and others.|\\
% |Public domain.|
% \end{decl}
-% This provides information, ideally suited for copyright metadata
-% fields, as in Section~\ref{sssec-copy}, as well as for |\Subject|
-% and |\CoverDate| from Section~\ref{sssec-publ}.
-%
+% This provides information, ideally suited for copyright metadata
+% fields, as in Section~\ref{sssec-copy}, as well as for |\Subject|
+% and |\CoverDate| from Section~\ref{sssec-publ}.
+%
% Also near the top of the file one finds front-matter content
% \begin{decl}[]
% |\title{%|\\
@@ -1374,7 +1429,7 @@
% | }|\\
% |\date{May 2015}|
% \end{decl}
-% which supplies metadata information for the commands |\Title|, |\Author|,
+% which supplies metadata information for the commands |\Title|, |\Author|,
% |\CoverDisplayDate| also from Section~\ref{sssec-publ}, and |\CopyrightURL|.
%
% Most of the hundreds of thousands, if not millions of documents prepared
@@ -1384,14 +1439,14 @@
% requirement, for PDFs to satisfy a standard that requires inclusion
% of metadata. This is especially so for government agencies and institutions
% receiving government funding, in several countries around the world.
-%
+%
% It is an aim of the |pdfx| to simplify the process of capturing and
-% including metadata within \LaTeX-produced PDFs, from both the author's
-% view and that of archivists. The extra features introduced with version
-% 1.5.8 take a large step in that direction.
+% including metadata within \LaTeX-produced PDFs, from both the author's
+% view and that of archivists. The extra features introduced with version
+% 1.5.8 take a large step in that direction.
% This includes the ability, described in the next subsection, to reliably
% include data presented in different text encodings, rather than being
-% restricted to UTF-8 only. It is a role of the software to make the
+% restricted to UTF-8 only. It is a role of the software to make the
% conversion, rather than rely on some 3rd party for a translation.
%
%
@@ -1400,40 +1455,40 @@
% A cursory search of the documentation (|.../texmf-dist/doc|) subtree
% of the forthcoming \TeX\,Live 2016 release reveals more than 730 different
% |.tex| or |.dtx| document sources which specify an input encoding,
-% via the |\usepackage[...]{inputenc}| command. Roughly 380 (a bit more
-% than half) declare UTF-8 as the input encoding.
-% Of the remainder there are $\approx 20$ other encodings specified,
-% covering a range of languages for at least part of their content.
+% via the |\usepackage[...]{inputenc}| command. Roughly 380 (a bit more
+% than half) declare UTF-8 as the input encoding.
+% Of the remainder there are $\approx 20$ other encodings specified,
+% covering a range of languages for at least part of their content.
% At some point in time, these documents may be required to have accurate
-% accompanying metadata, as part of conformance to a designated PDF
-% (or other) standard. There are libraries and archives that already must
+% accompanying metadata, as part of conformance to a designated PDF
+% (or other) standard. There are libraries and archives that already must
% meet such standards.
%
-% We have shown above, in Section~\ref{ssec-metadata}, how the |.xmpdata|
-% file can be inserted into the document source, which then ensures that
+% We have shown above, in Section~\ref{ssec-metadata}, how the |.xmpdata|
+% file can be inserted into the document source, which then ensures that
% metadata is reliably transferred along with the source itself.
% This seems a good strategy, but are there any problems with it,
% especially in a multi-lingual context?
-%
-% Modern editing software can require an encoding to be associated
-% with each file. This is what allows the correct characters to be shown,
-% from what is otherwise just a sequence of 8-bit bytes. The flip-side
-% is that arbitrary editing is not permitted. Add some UTF-8 data into
-% a file that is encoded as Latin-2 then try to save it. You may be asked
+%
+% Modern editing software can require an encoding to be associated
+% with each file. This is what allows the correct characters to be shown,
+% from what is otherwise just a sequence of 8-bit bytes. The flip-side
+% is that arbitrary editing is not permitted. Add some UTF-8 data into
+% a file that is encoded as Latin-2 then try to save it. You may be asked
% to specify a new encoding, or the application may even crash out entirely.
-% Maybe this happens \emph{accidentally}. It is not hard for a curly quote
-% (`) or endash (--) to be included; many editors have settings which can
+% Maybe this happens \emph{accidentally}. It is not hard for a curly quote
+% (`) or endash (--) to be included; many editors have settings which can
% do this with normal ascii input. Turn \emph{off} such settings.
%
% The approach that we advocate is that when editing to add metadata,
-% best is to:
+% best is to:
% \begin{enumerate}
-% \item
-% use the \emph{same encoding} as is specified for the file itself,
+% \item
+% use the \emph{same encoding} as is specified for the file itself,
% if known (as is usually the case);
-% \item
-% even if 1. is not possible, use Copy/Paste \emph{within} the document source
-% (e.g., for authors' names, addresses, affiliations, etc.) and from comments,
+% \item
+% even if 1. is not possible, use Copy/Paste \emph{within} the document source
+% (e.g., for authors' names, addresses, affiliations, etc.) and from comments,
% as in Section~\ref{sec-meta} above;
% \item
% avoid typing new characters, especially quotes and dashes, and be extra
@@ -1470,7 +1525,7 @@
% as could be produced for the Russian language version of the \TeX\ Live documentation,
% from coding as shown in Figure\,\ref{koi8-code}.
% The source file itself is actually encoded for KOI8-R, as indicated by the presence
-% of the code line |\usepackage[koi8-r]{inputenc}|,
+% of the code line |\usepackage[koi8-r]{inputenc}|,
% but is deliberately shown here encoded as |T1|~\cite[p.\,449]{LC2}.
% This difference is immaterial for checking the validity of the metadata.
% For example, the stream of upper (accents, etc.) characters within
@@ -1480,17 +1535,17 @@
% in the document, and from early subsection titles.
%
% It is the `parser' command/macro |\textKOI{ ... }| that indicates that the upper range
-% characters (having byte codes 128--255) are to be treated as KOI8-R characters,
+% characters (having byte codes 128--255) are to be treated as KOI8-R characters,
% rather than as part of UTF-8 byte sequences. It works by examining each byte in sequence,
-% and returning the appropriate UTF-8 2-byte sequence for the required cyrillic character.
-% This happens during the processing of data from |\jobname.xmpdata| for fleshing-out
+% and returning the appropriate UTF-8 2-byte sequence for the required cyrillic character.
+% This happens during the processing of data from |\jobname.xmpdata| for fleshing-out
% the XMP metadata packet to be included within the final PDF/A document.
%
% The `parser' macros defined for various encodings, are given in Figure\,\ref{parsers}.
-% In Section\,\ref{ssec-xmplang} the package options are given
+% In Section\,\ref{ssec-xmplang} the package options are given
% for loading the appropriate support for desired languages or alphabets.
% Support for other encodings can be added, if there proves to be a need.
-%
+%
%\begin{figure}[ht]
% \centering
% \begin{tabular}{lll}\hline
@@ -1519,13 +1574,13 @@
% \caption{How to see LICRs in the \texttt{.log} window.}\label{koi8-LICR}
% \end{figure}
%
-% With encoded characters marked in this way with a `parser' macro,
+% With encoded characters marked in this way with a `parser' macro,
% it is actually possible to mix UTF-8 metadata with other bytes;
% provided, of course, you have an editor that allows such a file
% to be created and saved. On the other hand, if you are unhappy with mixing
% content having different encodings, then there is another way, based upon
-% \LaTeX's LICR macros~\cite[\S\,7.11]{LC2} for representing accented
-% and non-latin characters.
+% \LaTeX's LICR macros~\cite[\S\,7.11]{LC2} for representing accented
+% and non-latin characters.
% These are normally hidden away (`I $=$ Internal') but in fact can be seen
% within auxiliary files, such as |.aux| and |.toc|, |.lof| and |.lot|.
% This is how \LaTeX\ stores the knowledge of such characters for use in
@@ -1548,20 +1603,20 @@
% \caption{How to get desired LICRs into the \texttt{.toc} file.}\label{koi8-toc}
% \end{figure}
%
-% Figure~\ref{koi8-LICR} shows how to see this.
+% Figure~\ref{koi8-LICR} shows how to see this.
% The document source in the lower portion clearly shows the cyrillic
% input, whereas the |.log| messages in a command-line window above
% reveal the LICR representation. A command |\showLICRs| is available
% with |pdfx.sty| version 1.5.8, specifically to allow this.
-% Now the LICR representation can be copied directly from the |.log| file,
+% Now the LICR representation can be copied directly from the |.log| file,
% modulo slight difficulties due to the way long lines are broken.
% As this representation is entirely with ASCII characters, it should not
% cause any conflict with any UTF-8 metadata that you want within the same file.
% The |.xmpdata| file might now look as in Figure~\ref{koi8-code2}.
% Although very verbose, this should be resistant to any corruption due to
-% character encodings, and produces the same result within the PDF,
+% character encodings, and produces the same result within the PDF,
% as in Figure~\ref{koi8-meta}.
-%
+%
% Alternatively one can exploit the |.toc| file, using \LaTeX's command
% |\addtocontents|, as shown in Figure~\ref{koi8-toc}.
% After processing the file, you can copy the LICR representations out
@@ -1570,24 +1625,24 @@
%
% Of course once you have harvested the metadata in this format, remove
% or comment-out those extra |\showLICRs| to get uninterrupted processing.
-% Similarly comment-out the extra |\addtocontents| lines, else the real
+% Similarly comment-out the extra |\addtocontents| lines, else the real
% Table-of-Contents will become corrupted with unwanted entries.
% A couple more \LaTeX\ processing runs should restore the PDF to the
% way you want it.
%
% \subsubsection[Metadata with Polish]{Metadata with Polish}\label{sssec-pol}
-%
-% The next example has upper-range bytes intended to represent Latin-2 encoded
-% characters, as used in Polish.
-% With the \LaTeX\ source starting as in Figure~\ref{tldoc-pol},
+%
+% The next example has upper-range bytes intended to represent Latin-2 encoded
+% characters, as used in Polish.
+% With the \LaTeX\ source starting as in Figure~\ref{tldoc-pol},
% the resulting metadata is shown in Figure~\ref{tlmeta-pol}.
-%
+%
%\begin{figure}[htb]
% \centering
% \includegraphics[scale=.45]{TL-POL-meta}
%\caption{Metadata generated from the coding shown in Figure~\ref{tldoc-pol}
-% for the Polish version of \TeX\ Live 2015 documentation, showing Latin-2 encoded
-% characters. The document is valid for PDF/A-2, after having been processed with
+% for the Polish version of \TeX\ Live 2015 documentation, showing Latin-2 encoded
+% characters. The document is valid for PDF/A-2, after having been processed with
% pdf-\LaTeX.}\label{tlmeta-pol}
%\end{figure}
%
@@ -1597,13 +1652,13 @@
% \input{latin2-example}
%\end{decl}
% }%
-%\caption{Start of the \LaTeX\ source for the Polish version of \TeX\ Live
-% documentation. Although Latin-2 encoded, the bytes are shown here using
+%\caption{Start of the \LaTeX\ source for the Polish version of \TeX\ Live
+% documentation. Although Latin-2 encoded, the bytes are shown here using
% \LaTeX's \texttt{T1} encoding \cite[p.\,449]{LC2}.}\label{tldoc-pol}
%\end{figure}
%
% Here the `parser macro' is |\textLII|, which can be seen in Figure~\ref{tldoc-pol}
-% to surround either complete metadata entries, or just those parts containing
+% to surround either complete metadata entries, or just those parts containing
% polish accented (or other) characters in entries that also contain english words.
% The macro |\textLF| provides a line-feed character for the UTF-8 output.
%
@@ -1619,38 +1674,38 @@
% Let's understand better how this example was created. There are three files involved.
%\begin{itemize}
% \item |pdfx.dtx|, the source for this documentation, open in an editor with
-% encoding declared as UTF-8;
+% encoding declared as UTF-8;
% \item |texlive-pl.tex| the Polish documentation for \TeX\ Live, open in the
% same editor with Latin-2 encoding;
% \item |latin2-example.tex| which starts life as an empty file on disk.
%\end{itemize}
% \noindent
-% This latter file must be opened in the editor, with encoding declared as
+% This latter file must be opened in the editor, with encoding declared as
% Latin-2 (ISO-8859-2).
% Next the preamble is copied from |texlive-pl.tex| and pasted into |latin2-example.tex|
% which is then saved to disk. Further editing is done to |latin2-example.tex| to
% add verbatim markers (\texttt{$\vert$...$\vert$}) and adjust line lengths for display
-% within Figure~\ref{tldoc-pol}. This file's contents is included as part of the
-% documentation via |\input{latin2-example}| within an environment that handles
+% within Figure~\ref{tldoc-pol}. This file's contents is included as part of the
+% documentation via |\input{latin2-example}| within an environment that handles
% presentation aspects, and (since 2018) declares |\UseRawInputEncoding|.
%
% What \emph{cannot} be done is to paste the preamble content directly into |pdfx.dtx|.
-% Consider what would then happen, using `t{\l}umaczy' (`translators', on line 10
-% following `UWAGA'). This word shows correctly in the Latin-2 encoded files.
-% It was typeset here using |\l| for the `\l' letter, having Unicode code-point
-% |Ux0142| (so UTF-8 byte pair |"C5|\,|"82|).
-% However, it occurs at slot |"B3| within Latin-2 encoding.
-% In the |T1| font encoding \cite[p.\,449]{LC2} the character glyph name
-% for slot |"B3| is |/scedilla|, which is what shows in Figure~\ref{tldoc-pol}.
-% When the `\l' is pasted directly into a UTF-8 file and shown verbatim,
-% the result is the pair of glyphs |"C5| (|/Aring|) and |"82| (|/Cacute|);
+% Consider what would then happen, using `t{\l}umaczy' (`translators', on line 10
+% following `UWAGA'). This word shows correctly in the Latin-2 encoded files.
+% It was typeset here using |\l| for the `\l' letter, having Unicode code-point
+% |Ux0142| (so UTF-8 byte pair |"C5|\,|"82|).
+% However, it occurs at slot |"B3| within Latin-2 encoding.
+% In the |T1| font encoding \cite[p.\,449]{LC2} the character glyph name
+% for slot |"B3| is |/scedilla|, which is what shows in Figure~\ref{tldoc-pol}.
+% When the `\l' is pasted directly into a UTF-8 file and shown verbatim,
+% the result is the pair of glyphs |"C5| (|/Aring|) and |"82| (|/Cacute|);
% \emph{viz.} {\UseRawInputEncoding |tłumaczy|}.
%
% As with Figure~\ref{koi8-code} it is not important that the correct characters
% are shown here, but that the metadata in |\jobname.xmpdata| corresponds to what
% is used on the titlepage of the PDF; e.g., the contents of |\Title| and |\title|,
% |\Author| and |\author|, etc.
-%
+%
%
% \subsubsection[Metadata with Greek]{Metadata with Greek}\label{sssec-grk}
%
@@ -1674,7 +1729,7 @@
%|% ... |\\
%| |\\
%|\providecommand{\pdfxopts}{a-2u,LGRxmp,LATxmp}|\\
-%|\begin{filecontents*}{\jobname.xmpdata}|\\
+%|\begin{filecontents}[force]{\jobname.xmpdata}|\\
%|\Title{Writing Greek with the "greek" option of the "babel" package}|\\
%{\color{verbcolor}\texttt{\string\Author\{Apostolos Syropoulos\string\sep\ G\"unter Milde\}}}\\
%|\Subject{This document describes the use of the Latin transliteration for Greek that is |\\
@@ -1690,11 +1745,11 @@
%| \textaristerikeraia\textAlpha\textSampi\textQoppa\textZeta\textdexiakeraia}}|\\
%|\CoverDate{1997-10-15}|\\
%|\CoverDisplayDate{October 15, 1997}|\\
-%|\Copyright{This file is part of the Babel system.\textLF This file may be distributed and/or|\\
+%|\Copyright{This file is part of the Babel system.\textLF This file may be distributed and/or|\\
%| modified under the conditions of the LaTeX Project Public License, either version 1.3 |\\
%| of this license or (at your option) any later version.}|\\
%|\CopyrightURL{http://www.latex-project.org/lppl.txt}|\\
-%|\end{filecontents*}|\\
+%|\end{filecontents}|\\
%|%|\\
%|\documentclass[11pt]{article}|\\
%|\usepackage[\pdfxopts]{pdfx}[2016/04/13]|\\
@@ -1725,70 +1780,70 @@
%
% Prior to proper support for UTF-8 input, a method for preparing document source
% for the modern Greek language (and also for polytonic Greek), involved the use
-% of LGR encoded fonts. Such a font has Greek (instead of Latin) letters in the
+% of LGR encoded fonts. Such a font has Greek (instead of Latin) letters in the
% slots for |a-zA-Z|, see~\cite[\S9.4.2]{LC2}. Thus ordinary ASCII letters are used
% to produce the Greek characters; the mapping of ASCII to Greek is referred to as
-% a `transliteration' scheme. It serves as \emph{both} an input encoding, and as
-% a font encoding. Accents and diacritic marks are provided through ligatures
-% built-in to the fonts. Various documents can be found on the web\footnote{e.g.,
+% a `transliteration' scheme. It serves as \emph{both} an input encoding, and as
+% a font encoding. Accents and diacritic marks are provided through ligatures
+% built-in to the fonts. Various documents can be found on the web\footnote{e.g.,
% \url{http://milde.users.sourceforge.net/LGR/}} and
% within \TeX\ Live distributions\footnote{%
-% TeXLive: \textcolor{urlcolor}{\texttt{.../2016/texmf-dist/doc/generic/babel-greek/}}}.
+% TeXLive: \textcolor{urlcolor}{\texttt{.../2016/texmf-dist/doc/generic/babel-greek/}}}.
%
% Indeed the current maintainer G\"unther Milde states
% ``The LGR transliteration does not work for PDF metadata''.
% This is because there is no translation of LGR input into \LaTeX\ LICRs,
% as happens with say |\usepackage[utf8]{inputenc}| for UTF-8 input,
-% or when upper 8-bit characters are present using |\usepackage[iso-8859-7]{inputenc}|.
-% With these, LICRs such as |\textAlpha|, |\textOmicron|, \dots, |\textomega|
+% or when upper 8-bit characters are present using |\usepackage[iso-8859-7]{inputenc}|.
+% With these, LICRs such as |\textAlpha|, |\textOmicron|, \dots, |\textomega|
% are produced, which result in the correct characters for metadata and bookmarks,
% perhaps employing Unicode `combining' characters for accented letters.
% Using |pdfx| the UTF-8 characters can be put directly into the |.xmpdata| file;
% LICRs are interpreted provided the |grkxmp| loading option has been specified.
-%
-% Using the methods of |pdfx| the metadata difficulty is remedied, as can be seen in
-% Figure~\ref{greek-meta} using coding as shown in Figure~\ref{greek-code}. This requires
-% the |LGRxmp| option and |\textLGR| `parser' macro. The original document source,
+%
+% Using the methods of |pdfx| the metadata difficulty is remedied, as can be seen in
+% Figure~\ref{greek-meta} using coding as shown in Figure~\ref{greek-code}. This requires
+% the |LGRxmp| option and |\textLGR| `parser' macro. The original document source,
% called |usage.tex|, can be found in the directory specified in the footnote below.
% As this document is essentially an English description of how to use LGR for Greek,
-% we have used the `Keywords' field to provide examples of such usage.
-% Since a macro |\textgreek| can be used for greek portions within such documents,
+% we have used the `Keywords' field to provide examples of such usage.
+% Since a macro |\textgreek| can be used for greek portions within such documents,
% this macro name is aliased to |\textLGR| within the context where metadata is processed.
-% Furthermore, parsing using |\textLGR| generates correct pre-composed characters
+% Furthermore, parsing using |\textLGR| generates correct pre-composed characters
% for letters with accents or diacritics. Bookmarks can also be generated from
% LGR input, using a technique described in Section~\ref{sssec-arm}.
%
% \bigskip\noindent
% The features available with different loading options are summarised here.
% \begin{itemize}
-% \item
+% \item
% no option: all metadata in |.xmpdata| file is in UTF-8 (incl. ASCII)
% \item
-% |grkxmp|: LICRs can be present; e.g. |\textAlpha|, |\textOmega|, etc.
+% |grkxmp|: LICRs can be present; e.g. |\textAlpha|, |\textOmega|, etc.
% \item
% |LGRxmp|: supports LGR-encoded input and |ISO-8859-7| upper range characters,
-% using the |\textLGR| `parser' macro.
+% using the |\textLGR| `parser' macro.
% \end{itemize}
-% With |LGRxmp| specified, the features of |grkxmp| are also available; so any
+% With |LGRxmp| specified, the features of |grkxmp| are also available; so any
% lower-listed option allows data to be mixed with that for higher-listed ones.
%
%
% The final piece to get validation for PDF/A from LGR input, is to specify
-% a Unicode point for the `|v|' used only in the strong `|sv|' ligature to obtain
-% a non-final `sigma' typeset in isolation.
+% a Unicode point for the `|v|' used only in the strong `|sv|' ligature to obtain
+% a non-final `sigma' typeset in isolation.
%\begin{decl}[]
% |\pdfglyphtounicode{internalchar2}{200D}|
%\end{decl}
% This gives an interpretation as `zero-width joiner'.
% There are two instances of this within |usage.tex|. Copy/Paste works as desired.
-% Using \pdftex\ the above command is done automatically.
-% Drivers, such as Xe\LaTeX\ lacking an implementation of |\pdfglyphtounicode|,
+% Using \pdftex\ the above command is done automatically.
+% Drivers, such as Xe\LaTeX\ lacking an implementation of |\pdfglyphtounicode|,
% can fail to produce a valid PDF due to this rather minor deficiency.
-%
+%
% Greek numerals, using |\greeknumeral| or |\Greeknumeral| cannot work directly within
% a |.xmpdata| file. However if such is desired, the following technique allows
-% correct LICRs to be found for use in the metadata.
-% At any convenient place within the \LaTeX\ source; e.g., near where the required
+% correct LICRs to be found for use in the metadata.
+% At any convenient place within the \LaTeX\ source; e.g., near where the required
% number is used, insert coding such as:
% \begin{decl}[]
% |{\pdfxGreeknumeralsHack \textgreek{\edef\num{\greeknumeral{1997}}\show\num}}%|
@@ -1820,7 +1875,7 @@
%
% \def\ArmTeX{Arm\kern -0.15em\TeX}%
% \subsubsection[Metadata with Armenian]{Metadata with Armenian}\label{sssec-arm}
-%
+%
% \begin{figure}[!htbp]
% \centering
% \includegraphics[scale=.42]{armtex-meta}
@@ -1840,20 +1895,20 @@
% \caption{Enriched \LaTeX\ source for the Armenian version of the \ArmTeX\ manual,
% with added metadata demonstrating the \ArmTeX\ transliteration scheme for \texttt{OT6} encoding.
% Also shown is coding used to produce bookmarks from the transliteration.}\label{arm-code}
-% \end{figure}
-%
+% \end{figure}
+%
% The \ArmTeX\ package\footnote{documentation: %
% TeXLive: \textcolor{urlcolor}{\texttt{.../2016/texmf-dist/doc/generic/armenian/}}}
-% provides the method to typeset Armenian, with input being specified in various ways
-% including a transliteration scheme from ASCII input. This transliteration is directed
+% provides the method to typeset Armenian, with input being specified in various ways
+% including a transliteration scheme from ASCII input. This transliteration is directed
% at the use of the |OT6| encoding, developed for this purpose.
% Each way is supported by |pdfx.sty| with appropriate loading options, similar
-% to the support for Greek~(see Section~\ref{sssec-grk}).
+% to the support for Greek~(see Section~\ref{sssec-grk}).
% \begin{itemize}
-% \item
-% no option: all metadata in |.xmpdata| file is in UTF-8 (incl. ASCII)
% \item
-% |armxmp|: using LICR-like macro names; e.g. |\armAyb|, |\armsha|, |\armfe| etc.
+% no option: all metadata in |.xmpdata| file is in UTF-8 (incl. ASCII)
+% \item
+% |armxmp|: using LICR-like macro names; e.g. |\armAyb|, |\armsha|, |\armfe| etc.
% \item
% |AR8xmp|: using the \ArmTeX\ (|OT6|) transliteration scheme or with upper-range
% characters in |ArmSCII8| encoding, using the `parser' macro |\textARM|.
@@ -1866,9 +1921,9 @@
% implemented in the |OT6|-encoded font, or careful parsing of the input into
% LICR-like macros.
% \LaTeX\ source\footnote{TeXLive: %
-% \textcolor{urlcolor}{\texttt{.../2016/texmf-dist/doc/generic/armenian/examples/latex/}}}
-% for the \ArmTeX\ documentation is available in both English and Armenian.
-% Figure~\ref{arm-meta} shows the result of enriching the Armenian version with relevant
+% \textcolor{urlcolor}{\texttt{.../2016/texmf-dist/doc/generic/armenian/examples/latex/}}}
+% for the \ArmTeX\ documentation is available in both English and Armenian.
+% Figure~\ref{arm-meta} shows the result of enriching the Armenian version with relevant
% metadata, using coding as shown in Figure~\ref{arm-code}.
%
% As in earlier examples, that metadata has come from the extensive comments at the head
@@ -1883,18 +1938,18 @@
% process, as follows.
% \begin{enumerate}
% \item
-% conversion of transliterated source into UTF-8.
+% conversion of transliterated source into UTF-8.
% This is done as the |.xmpdata| file is processed, using |\pdfxEnableCommands|
-% to make global definitions; e.g,
+% to make global definitions; e.g,
%\begin{decl}[]
-% |\xdef\sectAtitle{\textARM{Nerac'uthyun}}|
+% |\xdef\sectAtitle{\textARM{Nerac'uthyun}}|
%\end{decl}
% capturing the section title in the form supplied in the \LaTeX\ source.
-% This can be seen in Figure~\ref{arm-code}, near the end of the |{filecontents*}|
+% This can be seen in Figure~\ref{arm-code}, near the end of the |{filecontents}|
% environment, and at the bottom where the |\section| command would occur.
% \item
% conversion of the UTF-8 representation into |UTF16-be|, suitable for bookmark
-% strings within the PDF file. With \pdftex\ thishis is done using
+% strings within the PDF file. With \pdftex\ this is done using
% |\StringEncodingConvert| from Heiko Oberdiek's |stringenc.sty| package.
% Lua\LaTeX\ and Xe\LaTeX\ can use the UTF-8 representation directly.
% \item
@@ -1909,8 +1964,8 @@
% \end{decl}
% Now |\pdfxBookmark| first checks that the macro passed as the 2nd argument
% actually exists. If it does not, an error message is given and upon continuation
-% would just do |\section{Nerac'uthyun}| as normal.
-% When it does exist, then step 2 is done (by \pdftex) storing the result as |\pdfx@temp|.
+% would just do |\section{Nerac'uthyun}| as normal.
+% When it does exist, then step 2 is done (by \pdftex) storing the result as |\pdfx@temp|.
% With Lua\TeX\ and Xe\TeX, |\pdfx@temp| stores a copy of the UTF-8 data.
% Then the commands needing to be executed are essentially
%\begin{decl}[]
@@ -1921,9 +1976,9 @@
% so that the correct section heading is displayed on the page,
% but when |\sectAtitle| is processed to create a bookmark it is replaced
% by the pre-prepared contents of |\pdfx@temp|.
-% There are some technicalities\footnote{In fact a small change is made
-% to how \textcolor{verbcolor}{\texttt{\string\@@writetorep}} is used.}
-% to make this work cleanly,
+% There are some technicalities\footnote{In fact a small change is made
+% to how \textcolor{verbcolor}{\texttt{\string\@@writetorep}} is used.}
+% to make this work cleanly,
% as just doing these commands would interfere with other uses of |\pdfstringdef|.
% In case a long sectioning command has an optional argument, or a $*$-variant
% is needed, then include it this way.
@@ -1933,32 +1988,32 @@
%
%
% \subsubsection[Other Languages]{Other Languages}\label{sssec-other}
-%
+%
% There is support for Metadata using characters from other languages,
-% with corresponding loading options, as follows.
+% with corresponding loading options, as follows.
% \begin{itemize}
-% \item |arbxmp| : Arabic;
+% \item |arbxmp| : Arabic;
% via LICRs |\textarabicalef|, |\textarabicqaf|,\\ |\textarabicaleflowerhamza|, etc.
-% \item |devxmp| : Devanagari;
+% \item |devxmp| : Devanagari;
% via LICRs |\textdevanagaria|, |\textdevanagarivocalicr|,\\ |\textdevanagaricandrabindu|, etc.
% \item |hebxmp| : Hebrew;
% via LICRs |\hebalef|, |\hebsamekh|, |\hebfinalpe| and accent marks |\segol|, |\qubuts|, etc.
-% \item |vnmxmp| : Vietnamese;
+% \item |vnmxmp| : Vietnamese;
% via LICRs |\ABREVE|, |\OCIRCUMFLEX|, |\uhorn| etc. and the combinations of multiple accents
% applied as usual via |\'|, |\`|, |\^|, etc.
% \end{itemize}
% The LICRs include support mapping accented letters to precomposed glyphs, falling back on
% `combining characters' only in unusual situations. Special input conventions or methods,
-% such as transliteration schemes, are \emph{not yet} supported.
-% Indeed, these options are largely untested, so any difficulties encountered should
+% such as transliteration schemes, are \emph{not yet} supported.
+% Indeed, these options are largely untested, so any difficulties encountered should
% be reported to the package authors. Requests to support extra input methods or other
% language blocks should also be directed to the authors, along with pointers to where
-% the desired input methods are fully described.
+% the desired input methods are fully described.
% Sample `real-world' documents would be greatly appreciated.
%
%
% \subsection[L8U pseudo-encoding]{L8U pseudo-encoding}\label{ssec-L8U}
-%
+%
% To understand how |pdfx| handles the translation into UTF-8 of input that is not already
% in that format, we'll briefly discuss \LaTeX's font-encoding mechanism, which is the
% basis for LICR macros~\cite[\S\,7.11]{LC2}. As an example, consider the macro |\textgamma|
@@ -1973,32 +2028,32 @@
% |ucs/data/uni-3.def:\uc@dclc{947}{default}{\textgamma}%|
% \end{decl}
% Here the |\uc@dclc| commands associate UTF-8 input of |Ux0263| (IPA small letter gamma)
-% and |Ux03B3| (Greek small letter gamma) internally with |\textgamma|,
+% and |Ux03B3| (Greek small letter gamma) internally with |\textgamma|,
% whereas the others deal with output formats\footnote{Whereas {\color{verbcolor}\texttt{ucs.sty}}
-% handles UTF-8 input, mapping it to LICRs, with {\color{verbcolor}\texttt{pdfx.sty}}
+% handles UTF-8 input, mapping it to LICRs, with {\color{verbcolor}\texttt{pdfx.sty}}
% we need the reverse mapping into UTF-8, not just from LICRs but also from legacy
-% 8-bit encodings and transliteration schemes.}.
-% In four of these examples there is a number, which refers to a position in an `encoding vector'
+% 8-bit encodings and transliteration schemes.}.
+% In four of these examples there is a number, which refers to a position in an `encoding vector'
% for the particular font used to place the character onto the printable page.
% For example |LGR| refers to greek fonts, encoded as explained in Section~\ref{sssec-grk}.
% IPA phonetics use the |T3| encoding, so |\textgamma| refers to a character
% from a different Unicode block.
%
% With two of these cases there is no specific font.
-% For example, |PU| is used to create bookmark strings,
-% and other PDF string inclusions, using |\pdfstringdef| from the |hyperref| package.
-% With |greek-euenc.def| designed for Xe\TeX\ and Lua\TeX, the encoding can be variable,
-% with the output bytes being those for the UTF-8 encoding of $\gamma$, namely |^^ce^^b3|,
-% shown here as the |T1|-encoded pair |γ|.
-% The term `pseudo-encoding' has been coined by the \LaTeX\ team.
-% Although there is no actual font to determine the encoding, to an author there is essentially
-% no difference in how corresponding macros can be used to get a character placed into
-% an appropriate structure within the PDF.
+% For example, |PU| is used to create bookmark strings,
+% and other PDF string inclusions, using |\pdfstringdef| from the |hyperref| package.
+% With |greek-euenc.def| designed for Xe\TeX\ and Lua\TeX, the encoding can be variable,
+% with the output bytes being those for the UTF-8 encoding of $\gamma$, namely |^^ce^^b3|,
+% shown here as the |T1|-encoded pair |γ|.
+% The term `pseudo-encoding' has been coined by the \LaTeX\ team.
+% Although there is no actual font to determine the encoding, to an author there is essentially
+% no difference in how corresponding macros can be used to get a character placed into
+% an appropriate structure within the PDF.
%
% Thus there are 4 output forms for this character,
% and we've not even considered how $\gamma$ is used in mathematics!
% To handle these concurrently, one has internally-defined control-sequence names
-% \begin{decl}[]
+% \begin{decl}[]
% |\LGR\textgamma=\char"67| \qquad where $6\times 16 + 7 = 103$\\
% |\T3\textgamma=\char"47| \qquad where $4\times 16 + 7 = 71$\\
% |\PU\textgamma=\long macro:->\83\263|\\
@@ -2006,12 +2061,12 @@
% \end{decl}
% where the 2nd `\textbackslash' is part of the name\footnote{%
% obtained using {\color{verbcolor}%
-% \texttt{\string\csname\space LGR\string\string\string\textgamma\string\endcsname}}.}.
+% \texttt{\string\csname\space LGR\string\string\string\textgamma\string\endcsname}}.}.
% The latter macro is explained below.
% To use the specific version of the macro, \LaTeX\ maintains a `font-encoding'
% parameter, set using |\fontencoding{...}| local to the surrounding environment grouping.
%
-% To the above declarations of |\textgamma|, to deal with conversion to UTF-8,
+% To the above declarations of |\textgamma|, to deal with conversion to UTF-8,
% the |pdfx| package adds the following declarations when the |LGRxmp| option is used.
% \begin{decl}[]
% |pdfx/l8ugrk.def:\DeclareTextCommand{\textgamma}{L8U}{γ}|\\
@@ -2019,11 +2074,11 @@
% |pdfx/l8ugrk.def:\DeclareTextCompositeCommand{\textLGRenc}{L8U}{g}{γ} |\\
% |pdfx/l8ugrk.def:\DeclareTextCompositeCommand{\textLGRenc}{L8U}{^^e3}{γ}|
% \end{decl}
-% The pseudo-encoding name |L8U| indicates \textbf{L}ocal conversion into UTF-\textbf{8} \textbf{U}nicode,
-% as required for metadata, using |pdfx.sty|. Currently this pseudo-encoding is used in one place only;
+% The pseudo-encoding name |L8U| indicates \textbf{L}ocal conversion into UTF-\textbf{8} \textbf{U}nicode,
+% as required for metadata, using |pdfx.sty|. Currently this pseudo-encoding is used in one place only;
% during the interpretation of information supplied through the |\jobname.xmpdata| file.
% This happens as part of the |pdfx| package, \emph{before} it uses |xmpincl.sty|.
-% Such specificity justifies being called a `Local' encoding.
+% Such specificity justifies being called a `Local' encoding.
% However, other tasks may emerge requiring on-the-fly conversion to UTF-8.
% In this case all the functionality of this pseudo-encoding could be shifted into a separate package,
% and the name changed to reflect this more general usage.
@@ -2031,7 +2086,7 @@
% is possibly a sufficient reason to have a separate package. Another possibility is to
% generate on-the-fly creation of UTF-8 strings, to be sent to Xe\TeX\ or Lua\TeX\ running
% as a slave process to generate images of string using OTF fonts, which \pdftex\ currently
-% cannot handle. The result would then be imported back into the running job as an image.
+% cannot handle. The result would then be imported back into the running job as an image.
% The authors invite suggestions of how this |L8U| pseudo-encoding functionality can be put to
% good use.
%
@@ -2041,7 +2096,7 @@
% |\DeclareTextComposite{\`}{T1}{A}{192}|
%\end{decl}
% to get the pre-composed `\`A', rather than a composite built from \`{} and `A'.
-% The last parameter is an index into a font; however the |\DeclareTextCompositeCommand|
+% The last parameter is an index into a font; however the |\DeclareTextCompositeCommand|
% variant allows arbitrary coding as that final parameter, so can be the bytes for the
% UTF-8 representation of a character.
% In the above code lines, macros are defined as follows
@@ -2067,18 +2122,18 @@
% | ... \textLGRenc{#1}\textgreekLGR@i #2\@empty | \quad if |#2| has more tokens\\
% |\textgreekLGR@i #1->\textgreekLGR@ii #1|
%\end{decl}
-% Thus |\textLGRenc| is called on each token in the argument of |\textLGR|.
+% Thus |\textLGRenc| is called on each token in the argument of |\textLGR|.
% Now |\textLGRenc|, which is applicable only when |L8U| pseudo-encoding is in effect,
% has a default expansion of just passing the character through unchanged; \emph{viz.}
%\begin{decl}[]
% |\DeclareTextCommand{\textLGRenc}{L8U}[1]{#1}|
%\end{decl}
% but by using |\DeclareTextCompositeCommand{\textLGRenc}{L8U}{...}{...}|,
-% alternate expansions apply with specific arguments, as shown above.
+% alternate expansions apply with specific arguments, as shown above.
% In particular, that final argument can include coding that `looks ahead' to find the next
% character. This is used, for example, with diacritics in Greek, multi-letter sequences
% for Armenian letters, and other special cases related to ligatures and punctuation symbols.
-% To illustrate this Figure~\ref{ex-arm} (below) follows the conversion of a specific word,
+% To illustrate this Figure~\ref{ex-arm} (below) follows the conversion of a specific word,
% given in the transliteration for Armenian~(see Section~\ref{sssec-arm}).
% This conversion occurs using only \TeX's macro-expansion ability.
% Some details relevant to this example are explained there.
@@ -2117,26 +2172,26 @@
%\end{decl}
% The macro |\armen@en| (named for \textbf{e}mpty or \textbf{n}ext),
% looks ahead to see if the 5th-next argument token is |\@empty|,
-% signifying that there is nothing left of the original input.
-% (A closed bracing |{...}| counts as a single argument.) If |\@empty| the tokens in
+% signifying that there is nothing left of the original input.
+% (A closed bracing |{...}| counts as a single argument.) If |\@empty| the tokens in
% the 2nd bracing are substituted, otherwise those in the 3rd bracing.
-% Similarly |\armen@nc| (named for \textbf{n}ext \textbf{c}haracter)
+% Similarly |\armen@nc| (named for \textbf{n}ext \textbf{c}haracter)
% looks to see whether that 5th argument token matches with the character in the
% 1st bracing. If so, the 2nd bracing's tokens are substituted, else those of the 3rd bracing.
-% This is how to cope with `Sh' or `SH', implemented as ligatures in an |OT6| encoded font,
-% denoting a different letter from a single `S'. The macro |\armuh| is used here
+% This is how to cope with `Sh' or `SH', implemented as ligatures in an |OT6| encoded font,
+% denoting a different letter from a single `S'. The macro |\armuh| is used here
% to \emph{prevent} a ligature from |ev| that would otherwise occur.
-% One writes |e\armuh v| to get the separate letters. As the space becomes an active token,
-% we need |\textarmgobblespace| to restart parsing appropriately.
-% Of course |\textarmenARM@i| behaves like |\textgreekLGR@i|
-% as explained earlier, with a test for |\@empty| as the 2nd token.
+% One writes |e\armuh v| to get the separate letters. As the space becomes an active token,
+% we need |\textarmgobblespace| to restart parsing appropriately.
+% Of course |\textarmenARM@i| behaves like |\textgreekLGR@i|
+% as explained earlier, with a test for |\@empty| as the 2nd token.
% At the end, any remaining |\@empty| expand into nothing.
%
% \caption{Partial tracing of the conversion of an Armenian word, indicated by the red oval
% in Figure~\ref{arm-meta}, from {\color{verbcolor}\texttt{OT6}} transliterated form into UTF-8 bytes.
-% In each line, \TeX\ expansion occurs at the position of the left-most `\textbackslash'.
-% The resulting bytes are shown here in {\color{verbcolor}\texttt{T1}} encoding,
-% as in previous examples, with {\color{verbcolor}\texttt{?}} indicating an invisible character
+% In each line, \TeX\ expansion occurs at the position of the left-most `\textbackslash'.
+% The resulting bytes are shown here in {\color{verbcolor}\texttt{T1}} encoding,
+% as in previous examples, with {\color{verbcolor}\texttt{?}} indicating an invisible character
% in the byte range {\color{verbcolor}\texttt{Ox80}--\texttt{Ox9f}}.
% See Figure\,\ref{src-arm} for how this source appears with UTF-8 encoding.
% }\label{ex-arm}
@@ -2147,8 +2202,8 @@
% to an LICR called |\textarmuh|. Since |\armuh| is already defined, not as an LICR,
% it cannot be declared to be one without creating problems.
% Instead, within the environment grouping where |L8U| pseudo-encoding is specified,
-% one uses |\let\armuh\textarmuh| within a `rebinding' macro command
-% |\LIIXUmaparmenianletters|\footnote{The start of the macro name is derived from pseudo-Roman
+% one uses |\let\armuh\textarmuh| within a `rebinding' macro command
+% |\LIIXUmaparmenianletters|\footnote{The start of the macro name is derived from pseudo-Roman
% numerals: IX = 9, IIX = 8}
% to get LICR functionality from user-commands.
%\begin{decl}[]
@@ -2161,7 +2216,7 @@
% | \def\armbf{}%|\\
% | ... }|
%\end{decl}
-% As well as rebinding each command for a letter, the font style-switching commands
+% As well as rebinding each command for a letter, the font style-switching commands
% are aliased to do nothing, as these are not relevant to creating UTF-8 output.
% Being localised by the |L8U| grouping, this causes no problem elsewhere within the document.
% These are similar to macros |\psdaliasnames| and |\psdmapshortnames| from |hyperref.sty|,
@@ -2169,7 +2224,7 @@
%
% \begin{figure}[htb]
% \includegraphics[scale=.625]{Armenian-example-UTF8.png}
-% \caption{Image of part of the source coding for Figure~\ref{ex-arm},
+% \caption{Image of part of the source coding for Figure~\ref{ex-arm},
% viewed as UTF-8 encoded, within editing software.}\label{src-arm}
% \end{figure}
%
@@ -2186,10 +2241,10 @@
% \item |\LIIXUmaplatinchars| and |\LIIXUcancelfontswitches| with |LATxmp|
% \item |\LIIXUmapmathletterlikes| always defined
% \item |\LIIXUmapmathspaces| always defined
-% \item |\LIIXUmapmath...| with |mathxmp| --- see Section~\ref{ssec-math} below.
+% \item |\LIIXUmapmath...| with |mathxmp| --- see Section~\ref{ssec-math} below.
%\end{itemize}
% It may well be that more macro names can be added to some of these commands,
-% to allow macro usage within the metadata.
+% to allow macro usage within the metadata.
% Suggestions for such additions should be sent to the |pdfx| package authors, along
% with example documents. Similarly support for more languages can be requested.
%
@@ -2199,9 +2254,9 @@
% Macro commands for many mathematical symbols can be used directly in metadata without extra
% support; e.g., basic arithmetic operations, letter-like symbols, spacing commands.
% Super- and subscripted letters and numerals can use |\textsuperscript| and |\textsubscript|
-% when there is an appropriate Unicode character (digits, comma, $+$/$-$/$=$, parentheses,
+% when there is an appropriate Unicode character (digits, comma, $+$/$-$/$=$, parentheses,
% many letters but not all).
-%
+%
% When the |mathxmp| loading option is specified, many more symbols become available,
% using `rebinding' macros. These are necessary, as the macros for mathematical symbols
% are generally \emph{not} defined as LICRs, but use |\mathchar|. Thus new LICRs are needed,
@@ -2243,8 +2298,8 @@
% where |\liixu@mathreorder| uses some \TeX\ pattern-matching to allow the |\textmathrmstring|
% parser macro to work on the argument to |\mathrm| before allowing |\textmathnormal| parsing
% to continue afterwards. We refer to this as `nested parsing'.
-%
-% Similarly `nested parsing' can be used with superscripts and subscripts using |^{...}| and |_{...}|
+%
+% Similarly `nested parsing' can be used with superscripts and subscripts using |^{...}| and |_{...}|
% and to specify linebreaks, and even super-/subscripts within styles; viz.
%\begin{decl}[]
% |\Declar...CompositeCommand{\textmathnormal}{L8U}{^}{\liixu@mathreorder\textsuperstring}|\\
@@ -2259,7 +2314,7 @@
% is required to uncover cases which may require special handling.
% An ultimate aim is to be able to just copy the \LaTeX\ source for the `Abstract' of a technical
% paper into the |\Subject{...}| field of the |.xmpdata| file, with a large expectation that
-% it will `just work', or need only trivial edits to make it so.
+% it will `just work', or need only trivial edits to make it so.
%
%
% \subsection[Metadata in a Production Workflow]{Metadata in a Production Workflow}\label{ssec-wflow}
@@ -2273,8 +2328,8 @@
% \noindent
% At Macquarie University, the Mathematics Department produces personalised topmatter
% or coversheets for student assignments and tutorial papers using \LaTeX, incorporating
-% information that has been stored in a database. This is done by writing extra definitions
-% at the top of a copy of the \LaTeX\ source as prepared by the lecturers.
+% information that has been stored in a database. This is done by writing extra definitions
+% at the top of a copy of the \LaTeX\ source as prepared by the lecturers.
% For example information analogous to the following
%\begin{decl}[]
% |\def\thestudentname{\utext{Moore} Ross}|\\
@@ -2286,7 +2341,7 @@
% |\def\theduedate{09/05 2016}|\\
% |...|
%\end{decl}
-% is prepended to the file shown in Figure~\ref{math-wflow},
+% is prepended to the file shown in Figure~\ref{math-wflow},
% for each student downloading their personalised assignment paper.
% The \LaTeX\ source makes use of this information, including recording some of it
% within the Metadata.
@@ -2301,7 +2356,7 @@
% |\def\assigntopics{orbits, stabilisers, groups of matrices}|\\
% |\providecommand{\pdfxopts}{a-1b}|\\
% |%% XMP metadata for PDF/A conformance|\\
-% |\begin{filecontents*}{\jobname.xmpdata}|\\
+% |\begin{filecontents}[force]{\jobname.xmpdata}|\\
% |\Title{\theunitcode\ \theoffering: Assignment \theassignmentnumber}|\\
% |\Author{\assignLecturer}|\\
% |\Copyright{Macquarie University, Mathematics Department}|\\
@@ -2310,7 +2365,7 @@
% |\Keywords{\assigntopics}|\\
% |\Creator{pdfTeX + pdfx.sty with \pdfxopts\space option}|\\
% |\pdfxEnableCommands{\def\utext#1{#1,}}|\\
-% |\end{filecontents*}|\\
+% |\end{filecontents}|\\
% ||\\
% |\documentclass[a4paper,11pt]{article}|\\
% |\RequirePackage{assignments}|\\
@@ -2332,7 +2387,7 @@
% Another way that jobs can be customised using essentially the same \LaTeX\ source,
% is via the command used to initiate the job. For example the file |sample.tex|,
% accompanying the |pdfx| distribution, can be used to test the loading options to create
-% PDFs conforming to the various flavours of PDF/A, PDF/E and PDF/X.
+% PDFs conforming to the various flavours of PDF/A, PDF/E and PDF/X.
% Consider a shell script containing the following (Unix/Linux) commands.
%\begin{decl}[]
% |pdflatex "\def\pdfxopt{a-2b}\input sample.tex"|\\
@@ -2348,11 +2403,11 @@
% from the same \LaTeX\ source, named according to each particular variant.
% A default |\providecommand{\pdfxopt}{a-1b}| at the start of |sample.tex| catches the case
% of normal typesetting, doing nothing when |\pdfxopt| already has an expansion value.
-%
+%
% \goodbreak
% \subsection[Further Developments]{Further Developments}\label{ssec-further}
%
-% Prospects for further development of the |pdfx| package are as follows,
+% Prospects for further development of the |pdfx| package are as follows,
% listed not necessarily in order of perceived importance.
% \begin{itemize}
% \item
@@ -2363,7 +2418,7 @@
% Conformance to multiple PDF standards; e.g. both PDF/A and PDF/E,
% both PDF/A and PDF/X with RGB or CMYK color profile, other combinations.
% \item
-% Explore delaying the processing of metadata until |\begin{document}|,
+% Explore delaying the processing of metadata until |\begin{document}|,
% thereby allowing some fields to be set automatically from other information
% supplied within the document preamble.
% \item
@@ -2384,7 +2439,6 @@
% Support emerging standards based on PDF 2.0~\cite{PDF20}.
% \end{itemize}
%
-%
% \section[Bibliography]{Bibliography}%
% {\let\newpage\relax
% \begin{thebibliography}{999}
@@ -2396,28 +2450,35 @@
%
% \bibitem{XMP-spec}Adobe Systems Inc.;
% XMP Specification, Adding Intelligence to Media. September 2005.
-% Also available as ISO 16684-1:2012\,\cite{XMP-ISO}.\\
+% Also available as ISO 16684-1:2012\,\cite{XMP-ISO}. %\\
% \url{http://www.adobe.com/devnet/xmp/}.
%
% \bibitem{PDFUA1} ANSI\,/\,AIIM\,/\,ISO\,14289-1:2012;
% Document management applications --- Electronic document file format enhancement for accessibility
% --- Part 1: Use of ISO\,32000-1\,(PDF/UA-1);
-% Technical Committee ISO/TC\,171/SC\,2 (July 2012).
-% \url{http://www.iso.org/iso/home/store/catalogue_tc/catalogue_detail.htm?csnumber=54564}.\\
-% Revised as ISO\,14289-1:2014 (December 2014):
-% \url{http://www.iso.org/iso/home/store/catalogue_tc/catalogue_detail.htm?csnumber=64599}.\\
-% Available from ANSI at \url{https://webstore.ansi.org/Standards/ISO/ISO142892014}.
+% Technical Committee ISO/TC\,171/SC\,2 (July 2012 -- withdrawn). %\\
+% Revised as ISO\,14289-1:2014 (Dec. 2014):
+% \url{https://www.iso.org/standard/64599.html}.\\
+% Available from ANSI at \url{https://webstore.ansi.org/standards/iso/iso142892014}.
%
-% \bibitem{PDFUABSI} BS,/\,ISO\,14289-1:2014; Document Management Applications.
-% Electronic Document File Format Enhancement For Accessibility. Use Of ISO 32000-1 (PDF/UA-1) (British Standard)
-% \url{https://webstore.ansi.org/Standards/BSI/BSISO142892014}.
+% \bibitem{PDFUA2} ISO\,14289-2:2024;
+% Document management applications --- Electronic document file format enhancement for accessibility
+% --- Part 2: Use of ISO\,32000-2\,(PDF/UA-2);\\
+% Technical Committee ISO/TC\,171/SC\,2 WG9 (March 2024).
+% \href{https://pdfa.org/iso-14289-2-pdfua-2/}%
+% {\UrlFont https://pdfa.org/iso-\penalty-20 14289-2-pdfua-2/}
+%
+% \bibitem{PDFUABSI} BS,/\,ISO\,14289-1:2014; Document Management Applications.
+% Electronic Document File Format Enhancement For Accessibility.
+% Use Of ISO 32000-1 (PDF/UA-1) (British Standard)
+% \url{https://webstore.ansi.org/standards/bsi/bsiso142892014}.
%
-% \bibitem{pdfaPilot} Callas Software Gmbh.;
+% \bibitem{pdfaPilot} Callas Software Gmbh.;
% \texttt{pdfaPilot}, plug-in or desktop software for PDF/A versions.
% \url{https://www.callassoftware.com/en/products/pdfapilot}.
%
% \bibitem{DC}
-% Dublin Core Metadata Element Set, Version 1.1, October 2010\\
+% Dublin Core Metadata Element Set, Version 1.1, October 2010\\
% \url{http://dublincore.org/documents/dces/}.
%
% \bibitem{BCP47}IETF; Best Current Practice \#47: Tags for Identifying Languages.
@@ -2425,115 +2486,157 @@
% \url{https://tools.ietf.org/pdf/bcp47.pdf}.
%
% \bibitem{PDFX}ISO\,15930-1:2001;
-% Graphic technology --- Prepress digital data exchange --- Use of PDF --- Part 1:
+% Graphic technology --- Prepress digital data exchange --- Use of PDF --- Part 1:
% Complete exchange using CMYK data (PDF/X-1 and PDF/X-1a).
% Technical Committee ISO/TC\,130 (December 2001).
-% \url{http://www.iso.org/iso/home/store/catalogue_tc/catalogue_detail.htm?csnumber=29061}.
+% \url{https://www.iso.org/standard/29061.html}.
%
% \bibitem{PDFX3}ISO\,15930-3:2002;
-% Graphic technology --- Prepress digital data exchange --- Use of PDF --- Part 3:
+% Graphic technology --- Prepress digital data exchange --- Use of PDF --- Part 3:
% Complete exchange suitable for colour-managed workflows (PDF/X-3).
% Technical Committee ISO/TC\,130 (September 2002).
-% \url{http://www.iso.org/iso/home/store/catalogue_tc/catalogue_detail.htm?csnumber=34941}.
+% \url{https://www.iso.org/standard/34941.html}.
%
% \bibitem{PDFX1a}ISO\,15930-4:2003;
-% Graphic technology --- Prepress digital data exchange --- Use of PDF --- Part 4:
+% Graphic technology --- Prepress digital data exchange --- Use of PDF --- Part 4:
% Complete exchange of CMYK and spot colour printing data using PDF 1.4 (PDF/X-1a).
% Technical Committee ISO/TC\,130 (December 2003).
-% \url{http://www.iso.org/iso/home/store/catalogue_tc/catalogue_detail.htm?csnumber=39938}.
+% \url{https://www.iso.org/standard/39938.html}.
%
% \bibitem{PDFX3a}ISO\,15930-6:2003;
-% Graphic technology --- Prepress digital data exchange --- Use of PDF --- Part 6:
+% Graphic technology --- Prepress digital data exchange --- Use of PDF --- Part 6:
% Complete exchange of printing data suitable for colour-managed workflows using PDF 1.4 (PDF/X-3).
% Technical Committee ISO/TC\,130 (December 2003).
-% \url{http://www.iso.org/iso/home/store/catalogue_tc/catalogue_detail.htm?csnumber=39940}.
+% \url{https://www.iso.org/standard/39940.html}.
%
% \bibitem{PDFX4}ISO\,15930-7:2010;
-% Graphic technology --- Prepress digital data exchange --- Use of PDF --- Part 7:
+% Graphic technology --- Prepress digital data exchange --- Use of PDF --- Part 7:
% Complete exchange of printing data (PDF/X-4) and partial exchange of printing data with external profile reference (PDF/X-4p) using PDF 1.6.
% Technical Committee ISO/TC\,130 (July 2010).
-% \url{http://www.iso.org/iso/home/store/catalogue_tc/catalogue_detail.htm?csnumber=55843}.
+% \url{https://www.iso.org/standard/55843.html}.
%
% \bibitem{PDFX5}ISO\,15930-8:2010;
-% Graphic technology --- Prepress digital data exchange --- Use of PDF --- Part 8:
-% Partial exchange of printing data using PDF 1.6 (PDF/X-5). \hfil
-% Technical Committee ISO/TC\,130 (July 2010). \hfil
-% \url{http://www.iso.org/iso/home/store/catalogue_tc/catalogue_detail.htm?csnumber=55844}.
+% Graphic technology --- Prepress digital data exchange --- Use of PDF --- Part 8:
+% Partial exchange of printing data using PDF 1.6 (PDF/X-5).
+% Technical Committee ISO/TC\,130 (July 2010).
+% \url{https://www.iso.org/standard/55844.html}.
% Revision via Corrigendum: ISO\,15930-8:2010/Cor\,1:2011 (August 2011);
-% \url{http://www.iso.org/iso/home/store/catalogue_tc/catalogue_detail.htm?csnumber=60210}.
+% \url{https://www.iso.org/standard/60210.html}.
+%
+% \bibitem{PDFX6}ISO\,15930-9:2020;
+% Graphic technology --- Prepress digital data exchange --- Use of PDF --- Part 9:
+% Complete exchange of printing data (PDF/X-6) and partial exchange of printing data
+% with external profile reference (PDF/X-6p and PDF/X-6n) using PDF 2.0
+% Technical Committee ISO/TC\,130 (November 2020).
+% \url{https://www.iso.org/standard/77103.html}.
+%
%
% \bibitem{PDFVT}ISO\,16612-2:2010;
-% Graphic technology\,---\,Variable data exchange\,---\,Part 2:\hfil
-% Using PDF/X-4 \penalty-5000 and PDF/X-5 (PDF/VT-1 and PDF/VT-2).
-% Technical Committee ISO/TC\,130 (December 2005). \hfil
-% \href{http://www.iso.org/iso/home/store/catalogue_tc/catalogue_detail.htm?csnumber=38013}%
-% {{\small\tt http://www.iso.org/iso/home/store/catalogue\_tc/catalogue\_detail.htm?\penalty-200csnumber=38013}}.
+% Graphic technology\,---\,Variable data exchange---Part\,2:
+% Using PDF/X-4\penalty-5000\ and PDF/X-5 (PDF/VT-1 and PDF/VT-2).
+% Technical Committee ISO/TC\,130 (December 2005).
+% \url{https://www.iso.org/standard/38013.html}.%
+%
+%
+% \bibitem{PDFVT3}ISO\,16612-3:2020;
+% Graphic technology\,---\,Variable data exchange---Part\,3:
+% Using PDF/X-6\penalty-5000\ (PDF/VT-3).
+% Technical Committee ISO/TC\,130 (Edition1, 2020).
+% \url{https://www.iso.org/standard/75218.html}.%
%
% \bibitem{XMP-ISO}ISO\,16684-1:2012;
-% Graphic technology --- Extensible metadata platform (XMP) specification --- Part 1:
+% Graphic technology --- Extensible metadata platform (XMP) specification --- Part 1:
% Data model, serialization and core properties.
-% Technical Committee ISO/TC\,130 (February 2012).
-% \url{http://www.iso.org/iso/home/store/catalogue_tc/catalogue_detail.htm?csnumber=57421}.
+% Technical Committee ISO/TC\,130 (February 2012 -- withdrawn).
+% Revised as ISO\,16684-1:2019; (Edition 2, 2019).
+% \url{https://www.iso.org/standard/75163.html}.
%
-% \bibitem{PDFA}ISO\,19005-1:2005;
+% \bibitem{PDFA}ISO\,19005-1:2005;
% Document Management --- Electronic document file format for long term preservation
% --- Part 1: Use of PDF\,1.4\,(PDF/A-1);
% Technical Committee ISO/TC\,171/SC\,2 (Sept. 2005).
-% Revisions via Corrigenda: ISO\,19005-1:2005/Cor\,1:2007 (March 2007);
-% ISO\,19005-1:2005/Cor\,2:2011 (Dec. 2011). \\
-% \url{http://www.iso.org/iso/catalogue_detail?csnumber=38920}.
+% Revisions via Corrigenda: ISO\,19005-1:2005/Cor\,1:2007 (March 2007);
+% ISO\,19005-1:2005/Cor\,2:2011 (Dec. 2011).
+% \url{https://www.iso.org/standard/38920.html}.
%
% \bibitem{PDFA2}ISO\,19005-2:2011;
% Document Management --- Electronic document file format for long term preservation
% --- Part 2: Use of ISO\,32000-1\,(PDF/A-2); \hfill
-% Technical Committee ISO/\penalty-200 TC\,171/SC\,2 (June 2011).\\
-% \url{http://www.iso.org/iso/catalogue_detail?csnumber=50655}.
+% Technical Committee ISO/\penalty-200 TC\,171/SC\,2 (June 2011).
+% \url{https://www.iso.org/standard/50655.html}.
%
% \bibitem{PDFA3}ISO\,19005-3:2012;
% Document Management --- Electronic document file format for long term preservation
% --- Part 3: Use of ISO\,32000-1 with support for embedded files (PDF/A-3);
-% Technical Committee ISO/TC\,171/SC\,2 (October 2012).\\
-% \url{http://www.iso.org/iso/catalogue_detail?csnumber=57229}.
+% Technical Committee ISO/TC\,171/SC\,2 (October 2012).
+% \url{https://www.iso.org/standard/57229.html}.
+%
+% \bibitem{PDFA4}ISO\,19005-4:2020;
+% Document Management --- Electronic document file format for long term preservation
+% --- Part 4: Use of ISO\,32000-2 (PDF/A-4);
+% Technical Committee ISO/TC\,171/SC\,2 (Edition 1, 2020).
+% \url{https://www.iso.org/standard/71832.html}.
+%
+% \bibitem{PDFDecl} PDF Declarations. A use of ISO\,32000.
+% PDF Association, Berlin, Germany (2019).
+% \url{https://pdfa.org/resource/pdf-declarations/}
%
% \bibitem{PDFE}ISO\,24517-1:2008;
-% Document Management --- Engineering document format using PDF --- Part 1:
+% Document Management --- Engineering document format using PDF --- Part 1:
% Use of PDF 1.6 (PDF/E-1);
% Technical Committee ISO/TC\,171/SC\,2 (May 2008).\\
-% \url{http://www.iso.org/iso/catalogue_detail?csnumber=42274}.
+% \url{https://www.iso.org/standard/42274.html}.
%
% \bibitem{ISO32000}ISO\,32000-1:2008;
% Document management\,---\,Portable document format\,(PDF\,1.7);
-% Technical Committee ISO/TC\,171/SC\,2 (July 2008).
+% Technical Committee ISO/TC\,171/SC\,2 (July 2008).
% Also available as \cite{PDF17}.\\
-% \url{http://www.iso.org/iso/catalogue_detail?csnumber=51502}.
+% \url{https://www.iso.org/standard/51502.html}.
%
% \bibitem{PDF20}ISO\,32000-2:2017;
% Document management --- Portable document format --- Part~2: PDF\,2.0;
-% Technical Committee ISO/TC\,171/SC\,2 Document file formats, EDMS systems
-% and authenticity of information. (July 2017)\\
-% \url{https://www.iso.org/standard/63534.html}.
+% Technical Committee ISO/TC\,171/SC\,2 Document file formats, EDMS systems
+% and authenticity of information. (July 2017 --- withdrawn)
+% Revised as ISO\,32000-2:2020; (Edition 2, 2020)
+% \url{https://www.iso.org/standard/75839.html}.\\
+% Sponsored access available since 5 April 2023, from
+% \href{https://www.pdfa-inc.org/product/iso-32000-2-pdf-2-0-bundle-sponsored-access/}{PDF Association}.
%
% \bibitem{LC2} F.\,Mittelbach, M.\,Goossens with J.\,Braams, D.\,Carlisle, C.\,Rowley;
% The \LaTeX\ Companion --- 2nd edition. Addison--Wesley (now Pearson Education Inc.), 2004.
% ISBN 0-201-36299-6 (paperback).
%
-% \bibitem{TN0009}PDF/A Competence Centre;
-% TechNote 0009: XMP Extension Schemas in PDF/A-1. (March 2008)
+% \bibitem{PDF-LaTeX} \LaTeX\ Project Working Group, PDF Association.
+% \url{https://pdfa.org/community/latex-project-lwg/}
+%
+% \bibitem{LaTeXPDF} \LaTeX\ Tagged PDF\,---\,A blueprint for a large project.
+% Frank Mittelbach, Chris Rowley; TUGboat, Volume 41 (2020), No 3.
+% \url{https://tug.org/TUGboat/tb41-3/tb129mitt-tagpdf.pdf}.
+% Project website \url{https://www.latex-project.org/};
+% \href{https://www.latex-project.org/publications/2020-FMi-TUB-tb129mitt-tagpdf.pdf}{Preprint}.
+%
+% \bibitem{TN0009}PDF/A Competence Centre;\,
+% TechNote\,0009: XMP Extension Schemas in PDF/A-1.\penalty-2000\ (March 2008) \ \
% \href{https://www.pdfa.org/publication/technical-note-tn-0009-xmp-extension-schemas-in-pdfa-1/}%
-% {\small\tt https://www.pdfa.org/publication/technical-note-tn-0009-xmp-extension\penalty-200 -schemas-in-pdfa-1/}.
+% {\UrlFont https://www.pdfa.org/publication/technical-note-tn-0009-xmp-\penalty-20 extension-schemas-in-pdfa-1/}.
%
% \bibitem{PDF-UA}
-% PDF/UA Technical Implementation Guide: Understanding ISO\,14289-1 (PDF/UA-1). \penalty-200
-% AIIM Global Community of Information Professionals. \hfil
+% PDF/UA Technical Implementation Guide: Understanding ISO\,14289-1\penalty-2000\ (PDF/UA-1).
+% AIIM Global Community of Information Professionals.
% \href{http://www.aiim.org/Research-and-Publications/standards/committees/PDFUA/Technical-Implementation-Guide}%
-% {\small\tt http://www.aiim.org/Re\penalty-200 search-and-Publications/standards/committees/PDFUA/Technical-Implementation\penalty-200 -Guide}.
+% {\UrlFont http://\penalty-20 www.aiim.org/Research-and-Publications/standards/committees/PDFUA/Technical\penalty-200 -Implementation-Guide}.
+%
+% \bibitem{WTPDF} Well-Tagged PDF (WTPDF);
+% Using Tagged PDF for Accessibility and Reuse in PDF 2.0.
+% PDF Association; PDF Reuse TWG \& PDF/UA TWG. Version 1.0.0, February 2024.
+% \url{https://pdfa.org/wtpdf/}
%
-% \bibitem{colorp} N.\,Preining;
+% \bibitem{colorp} N.\,Preining;
% \texttt{colorprofiles} \textemdash\ Collection of free ICC profiles.
-% \TeX\ and \LaTeX\ package (by R.\,Moore), distributed with \TeX{}Live. (November 2018)\\
+% \TeX\ and \LaTeX\ package (by R.\,Moore), distributed with \TeX{}Live. (Nov. 2018)
% \url{https://ctan.org/pkg/colorprofiles}.
%
-% \bibitem{PRISM}PRISM; Publishing Requirements for Industry Standard Metadata.
+% \bibitem{PRISM}PRISM; Publishing Requirements for Industry Standard Metadata.
% PRISM Metadata Initiative; Idealliance Working Group.
% \url{http://www.idealliance.org/specifications/prism-metadata-initiative/prism}
%
@@ -2541,16 +2644,24 @@
% Generation of PDF/X- and PDF/A-compliant PDFs with \pdftex --- \texttt{pdfx.sty}.
% TUGboat Vol.\,36, No.\,2; TUG 2015 Conference Proceedings. \TeX\ Users Group, 2015; pp.\,136--142.
%
-% \bibitem{veraPDF} veraPDF. Industry Supported PDF/A Validation.
-% Software, dual-licensed under the GNU General Public License v3 or later (GPLv3+)
+% \bibitem{tagpdf} |tagpdf| -- Tools for experimenting with tagging using pdf\LaTeX\ and Lua\LaTeX.
+% Ulrike Fischer. Available via CTAN repository.
+% \url{https://ctan.org/pkg/tagpdf}.
+%
+% \bibitem{tpdf} |tpdf|; Ross Moore. Unpublished.
+% \LaTeX\ package and macro suite for producing `real-world' standards-conforming PDF documents.
+% Examples available at \url{http://maths.mq.edu.au/~ross/TaggedPDF/}.
+%
+% \bibitem{veraPDF} veraPDF. Industry Supported PDF/A Validation.
+% Software, dual-licensed under the GNU General Public License v3 or later (GPLv3+)
% and Mozilla Public License v2 or later (MPLv2+). \url{https://verapdf.org}.
% Wiki: \url{https://github.com/veraPDF/veraPDF-validation-profiles/wiki}
%
-% \bibitem{RDF} World Wide Web Consortium (W3C);
+% \bibitem{RDF} World Wide Web Consortium (W3C);
% Resource Description Format: RDF 1.1 XML Syntax. W3C Recommendation. (February 2014)
% \url{https://www.w3.org/TR/rdf-syntax-grammar/}.
-%
-% \bibitem{wikiPDF}Wikipedia;
+%
+% \bibitem{wikiPDF}Wikipedia;
% PDF/A: \url{https://en.wikipedia.org/wiki/PDF/A}\newline
% PDF/E: \url{https://en.wikipedia.org/wiki/PDF/E}\newline
% PDF/VT: \url{https://en.wikipedia.org/wiki/PDF/VT}\newline
@@ -2560,7 +2671,7 @@
% \end{thebibliography}
% }\goodbreak
% \section[Implementation]{Implementation}
-%
+%
% \iffalse
%<*package>
% \fi \hfuzz=2.5pt%
@@ -2575,7 +2686,7 @@
}{}%
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{pdfx}
- [2019/02/27 v1.6.3 PDF/X and PDF/A support (CVR/HTH/RRM/PS)]
+ [2024/06/24 v1.6.5f PDF/X and PDF/A support (CVR/HTH/RRM/PS)]
\newif\ifpdfx@noBOM \pdfx@noBOMfalse % use a BOM in the XMP packet
\newif\ifpdfx@x \pdfx@xfalse % PDF/X mode
@@ -2594,13 +2705,28 @@
\def\xmp@ReleaseDate{2005} % 2001 for PDF/X-1, 2005 for PDF/A-1,
% 2010 for PDF/A-2, 2012 for PDF/A-3.
+%% with Beamer pgf will have written Resource objects already
+\newif\ifpdfx@luacheck@needed
+\@ifpackageloaded{pgfcore}{\pdfx@luacheck@neededtrue}{}
+%% thanks to Ryutaroh Matsumoto for reporting this issue
+
\newcount\pdfx@minorversion
+\newcount\pdfx@majorversion
+\expandafter\ifx\csname pdfmajorversion\endcsname\relax
+%% RRM: 20240614 LuaLaTeX may not have this defined
+ \newcount\pdfmajorversion
+ \pdfmajorversion=1\relax
+\fi
\expandafter\ifx\csname pdfminorversion\endcsname\relax
-\else
- \global\pdfx@minorversion=\the\pdfminorversion
+%% RRM: 20240614 this could be set in luatex85 package
+ \newcount\pdfminorversion
+ \pdfminorversion=3\relax
\fi
+%% options can change these from the defaults
+\global\pdfx@majorversion=\the\pdfmajorversion
+\global\pdfx@minorversion=\the\pdfminorversion
-\def\pdfx@ErrorWarning#1#2#3#4{%
+\def\pdfx@ErrorWarning #1#2#3#4{%
\ifpdfx@noerr \PackageWarning{pdfx}{#1.^^J #2#3.^^J}%
\else \PackageError{pdfx}{#1}{#2#4.^^J
Use option 'noerr' to avoid this message.^^J}%
@@ -2781,6 +2907,9 @@
\DeclareOption{pdf15}{\global\pdfx@minorversion=5 }% 2005 Acrobat 6
\DeclareOption{pdf16}{\global\pdfx@minorversion=6 }% 2006 Acrobat 7 (ISBN 0-321-30474-8)
\DeclareOption{pdf17}{\global\pdfx@minorversion=7 }% 2008 ISO 32000-1:2008
+\DeclareOption{pdf20}{% 2020 ISO 32000-2:2020
+ \global\pdfx@majorversion=2 \relax
+ \global\pdfx@minorversion=0 }%
%% inhibits writing the XMP byte-order marker
\DeclareOption{noBOM}{\pdfx@noBOMtrue}
@@ -2845,6 +2974,13 @@
\ExecuteOptions{noBOM,a-1b}
\ProcessOptions
+\RequirePackage{ifluatex}
+\ifpdfx@luacheck@needed
+ \ifluatex
+ \RequirePackage{luatex85}
+ \fi
+\fi
+
\ifpdfx@ua\ifpdfx@x\else
\expandafter\if\xmp@Conformance A\else
\pdfx@ErrorWarning{PDF/UA requires 'Tagged PDF' for any structure.^^J
@@ -2857,19 +2993,23 @@
\expandafter\ifx\csname pdflastobj\endcsname\relax
\else
- \ifnum\pdflastobj >\z@ % pdftex has already written objects
+ \ifnum\pdflastobj >\z@ % pdf/luatex has already written objects
+ % e.g. by pgfcore , called from Beamer or other class
\ifnum\pdfx@minorversion=\pdfminorversion\else
\PackageError{pdfx}%
{^^J(pdfx) Cannot change the \string\pdfminorversion^^J%
- (pdfx) PDF version remains at 1.\the\pdfminorversion.^^J%
- (pdfx) Use \string\pdfminorversion=\the\pdfx@minorversion\space
+ (pdfx) PDF version remains at \the\pdfmajorversion.\the\pdfminorversion.^^J%
+ (pdfx) Use \string\pdfmajorversion=\the\pdfx@majorversion\space^^J%
+ and \string\pdfminorversion=\the\pdfx@minorversion\space
before \string\documentclass}%
{(pdfx) Another package or document-class has written objects into the PDF.^^J%
- (pdfx) Hit return to continue with PDF version 1.\the\pdfminorversion.%
- }%
+ (pdfx) Hit return to continue with PDF version %
+ \the\pdfmajorversion.\the\pdfminorversion.}%
+ \global\pdfx@majorversion=\the\pdfmajorversion
\global\pdfx@minorversion=\the\pdfminorversion
\fi
\else
+ \global\pdfmajorversion\pdfx@majorversion
\global\pdfminorversion\pdfx@minorversion
\fi
\fi
@@ -2877,6 +3017,7 @@
\expandafter\ifx\csname thepdfminorversion\endcsname\relax
\expandafter\ifx\csname pdfminorversion\endcsname\relax
\else
+ \xdef\thepdfmajorversion{\the\pdfmajorversion}
\xdef\thepdfminorversion{\the\pdfminorversion}
\fi\fi
@@ -2885,16 +3026,21 @@
\def\pdf@minorversion@xetex=#1{\gdef\thepdfminorversion{#1}}%
\let\pdfminorversion\pdf@minorversion@xetex
\else
- \ifnum\pdfminorversion < 4\relax
- \ifpdfx@x
- % more testing needed with PDF/X
- \else
- \pdfminorversion=4\relax % assumed for PDF/A ; options may change this for PDF/X
- \gdef\thepdfminorversion{4}%
- \fi
+ \ifnum\pdfmajorversion > 1\relax
+ \pdfminorversion=3\relax
+ %% else some JPG graphics with DCT encoding will fail
\else
- \ifnum\pdfminorversion<\thepdfminorversion\relax
- \global\pdfminorversion=\thepdfminorversion\relax
+ \ifnum\pdfminorversion < 4\relax
+ \ifpdfx@x
+ % more testing needed with PDF/X
+ \else
+ \pdfminorversion=4\relax % assumed for PDF/A ; options may change this for PDF/X
+ \gdef\thepdfminorversion{4}%
+ \fi
+ \else
+ \ifnum\pdfminorversion<\thepdfminorversion\relax
+ \global\pdfminorversion=\thepdfminorversion\relax
+ \fi
\fi
\fi
\fi
@@ -2902,7 +3048,8 @@
\pdfresetpageorigin=0
\fi
-\expandafter\ifx\csname pdfomitcharset\endcsname\relax\else
+\expandafter\ifx\csname pdfomitcharset\endcsname\relax
+\else
\ifpdfx@omitcharset
\pdfomitcharset = 1 %
%% do not create /Charset listings of font glyphs;
@@ -2940,8 +3087,10 @@
\RequirePackage{iftex}
\RequirePackage{ifpdf}
+%\expandafter\show\csname ifpdf\endcsname
%% Support for pdfTeX primitives when using XeTeX:
\RequirePackage{ifxetex}
+%\expandafter\show\csname ifpdf\endcsname
\ifxetex
\def\pdfx@pages@xetex#1{\special{pdf:put @pages <<#1>>}}
\def\pdfx@pageattr@xetex#1{\special{pdf:put @thispage <<#1>>}}
@@ -2971,7 +3120,10 @@
}%
\RequirePackage{pdftexcmds}%
\let\pdfx@mdfivesum\pdf@mdfivesum
- \let\pdfescapestring\pdf@escapestring
+% \let\pdfescapestring\pdf@escapestring
+ \long\def\pdf@escapestring@byte #1{%
+ \directlua {oberdiek.pdftexcmds.escapestring("\luaescapestring {#1}", "byte")}}%
+ %\let\pdf@escapestring\pdf@escapestring@byte
\else
\ifxetex
\expandafter\ifx\csname mdfivesum\endcsname\relax
@@ -3021,6 +3173,13 @@
\pdfgeninterwordspace=0 \relax
\fi
\begingroup
+ \expandafter\ifx\csname stockwidth\endcsname\relax\else
+ \ifdim\stockwidth=\z@ %% 20240528
+ \else
+ %% 20231023 support for memoir's stockwidth/height
+ \let\paperwidth\stockwidth
+ \let\paperheight\stockheight
+ \fi \fi
\dimen0=0.996264009963\paperwidth\relax
\edef\pdfx@mwidth{\strip@pt\dimen0}%
\advance\dimen0 -25\p@
@@ -3049,7 +3208,7 @@
\expandafter\immediate\pdfx@pageattr@xetex{\pdfx@everypage@xetex}}%
\EveryShipout{%
\expandafter\immediate\pdfx@pageattr@xetex{\pdfx@everypage@xetex}}%
- \else
+ \else
\EveryShipout{%
\expandafter\ifx\expandafter\relax\the\pdfpageattr\relax
\immediate\pdfpageattr\expandafter{\the\pdfpagesattr}%
@@ -3068,7 +3227,8 @@
\else
\ifnum\thepdfminorversion >3 \relax
\expandafter\ifx\csname pdfsuppresswarningdupmap\endcsname\relax
- \expandafter\ifx\csname pdfmapline\endcsname\relax\else
+ \expandafter\ifx\csname pdfmapline\endcsname\relax
+ \else
\pdfmapline{+dummy-space <dummy-space.pfb}
\fi
\else
@@ -3098,16 +3258,46 @@
\@namedef{M@L8U}{}%
%% adjust to LaTeX's 2018 change to the default encoding
+\def\pdfx@utfencodingname{utf8}%
+\def\pdfx@RawInputEncoding{%
+% \begingroup
+% \@tempcnta=0
+% % print out the catcodes of chars < 32
+% \loop
+% \typeout{\the\@tempcnta: \expandafter\the\catcode\@tempcnta}%
+% \advance\@tempcnta\@ne
+% \ifnum\@tempcnta<32
+% \repeat
+% \endgroup
+ \UseRawInputEncoding
+}
\expandafter\ifx\csname inputencodingname\endcsname\relax
\else
\def\pdfx@restoreencoding#1{%
- \@tempcnta=128
+ \@tempcnta=1\relax
+ \loop
+% \catcode\@tempcnta=13\relax
+ \advance\@tempcnta\@ne
+ \ifnum\@tempcnta<8\relax
+ \repeat
+ \catcode11=13 \relax
+ \@tempcnta=14\relax
+ \loop
+% \catcode\@tempcnta=13\relax
+ \advance\@tempcnta\@ne
+ \ifnum\@tempcnta<31 \relax
+ \repeat
+ \@tempcnta=128\relax
\loop
- \catcode\@tempcnta=13
+% \catcode\@tempcnta=13\relax
\advance\@tempcnta\@ne
\ifnum\@tempcnta<256
\repeat
- \inputencoding{#1}%
+% {\tracingall
+% \ifx\inputencodingname\pdfx@utfencodingname\else
+ \let\inputencodingname\relax %% kill previous
+% \fi
+ \inputencoding{#1}%}%
\let\LastDeclaredEncoding\pdfx@LastDeclaredEncoding
\let\DeclareFontEncoding@\pdfx@DeclareFontEncoding@
\let\DeclareUnicodeCharacter\pdfx@DeclareUnicodeCharacter
@@ -3116,7 +3306,18 @@
\let\pdfx@inputencodingname\inputencodingname
\global\let\pdfx@DeclareUnicodeCharacter\DeclareUnicodeCharacter
\global\let\pdfx@DeclareFontEncoding@\DeclareFontEncoding@
- \UseRawInputEncoding
+% \@tempcnta=0
+% \loop
+% \typeout{\the\@tempcnta: \expandafter\the\catcode\@tempcnta}%
+%% \expandafter\showthe\catcode\@tempcnta
+% \advance\@tempcnta\@ne
+% \ifnum\@tempcnta<32
+% \repeat
+%\show\UseRawInputEncoding
+%% if the encoding is utf8 then don't change it here – wrong!
+% \ifx\inputencodingname\pdfx@utfencodingname\else
+% \expandafter\expandafter
+ \expandafter\pdfx@RawInputEncoding %\fi
\fi
\InputIfFileExists{\pdfx@encodingfile}{}{}
\expandafter\ifx\csname pdfx@inputencodingname\endcsname\relax
@@ -3243,6 +3444,10 @@
\ifx\relax#1\relax\else\gdef\xmp@lang@Identifier{#1}\fi
\def\afterxmp@parse{\let\Identifier\pdfx@extraIdentifier}%
\xmp@parse{\global\let\xmp@Identifier\@this}}
+\newcommand{\pdfx@Nickname}[1][]{%
+ \ifx\relax#1\relax\else\gdef\xmp@lang@Nickname{#1}\fi
+% \def\afterxmp@parse{\let\Identifier\pdfx@extraNickname}%
+ \xmp@parse{\global\let\xmp@Nickname\@this}}
\newcommand{\pdfx@Thumbnails}{%
\def\afterxmp@parse{\let\Thumbnails\pdfx@extraThumbnails}%
\xmp@parse{\global\let\xmp@Thumbnails\@this}}
@@ -3443,6 +3648,28 @@
\xmp@parse{\global\let\xmp@extraIdentifier\@this}%
}%
+%% Nickname only supports a single usage, for PDF/X
+%\newcommand{\pdfx@extraNickname}[1][]{%
+% \ifx\relax#1\relax
+% \expandafter\expandafter\expandafter\gdef
+% \expandafter\expandafter\expandafter\xmp@Nickname
+% \expandafter\expandafter\expandafter{%
+% \expandafter\xmp@Nickname\pdfx@insert@sep}%
+% \else
+% \expandafter\expandafter\expandafter\gdef
+% \expandafter\expandafter\expandafter\xmp@Nickname
+% \expandafter\expandafter\expandafter{%
+% \expandafter\xmp@Nickname\pdfx@insert@sep[#1]}%
+% \fi
+% \def\afterxmp@parse{%
+% \expandafter\expandafter\expandafter\gdef
+% \expandafter\expandafter\expandafter\xmp@Nickname
+% \expandafter\expandafter\expandafter{%
+% \expandafter\xmp@Nickname\xmp@extraNickname}%
+% }%
+% \xmp@parse{\global\let\xmp@extraNickname\@this}%
+% }%
+
\newcommand{\pdfx@extraThumbnails}[1][]{%
\ifx\relax#1\relax
\expandafter\expandafter\expandafter\gdef
@@ -3737,7 +3964,7 @@
%\let\sep\pdfx@sep
%% Note: '\ ', \&, \copyright are already predefined by hyperref.
%% allow LICRs to expand into PDF strings
- \def\cf@encoding{PU}%
+ \def\cf@encoding{PU}%
\def\9##1{\ifcase##1\string\0\or\string\1\or\string\2\or\string\3\fi}%
\def\8{\string\00}%
\def\0{\string\0}\def\1{\string\1}\def\2{\string\2}\def\3{\string\3}%
@@ -3798,6 +4025,9 @@
%%----------------------------------------------------------------------
%% Alternative way to get the CreationDate using Lua for XeTeX
\ifdefined\pdfcreationdate\else
+ \ifdefined\creationdate %% added to XeTeX in 2019
+ \let\pdfcreationdate\creationdate
+ \else
\begingroup %% ensure correct catcodes, not done by \dospecials
\catcode`\:=12 \catcode`\.=12
\begin{filecontents*}{creationdate.lua}
@@ -3833,7 +4063,7 @@
\def\noexpand\pdfcreationdate{\string D:20181028075445+10'00'}}%
\x
\fi
-\fi
+\fi \fi
%%----------------------------------------------------------------------
\def\pdfx@findUUID#1{\edef\pdfx@tmpstring{\pdfx@mdfivesum{#1}}
@@ -4004,7 +4234,7 @@
\fi\fi
}%
\fi\fi
-\hypersetup{pdfencoding=auto}% unicode
+%\hypersetup{pdfencoding=auto}% 2019-12-08 No; this writes 8-bit bookmarks.
\expandafter\ifx\csname KV@Hyp@psdextra\endcsname\relax\else
\hypersetup{psdextra}
\fi
@@ -4370,7 +4600,7 @@
%% ----------------------------------------------------------------------
\begingroup
- \catcode`\_ 12 \catcode`\" 12 \catcode`\' 12
+ \catcode`\_ 12 \catcode`\" 12 \catcode`\' 12
\catcode`\< 12 \catcode`\> 12 \catcode`\/ 12 \catcode`\[ 12 \catcode`\] 12
\edef\@pctchar{\expandafter\@gobble\string\%}
\edef\@bchar{\expandafter\@gobble\string\\}
@@ -4733,22 +4963,24 @@
\fi
}% end of \catcode
+
%% ----------------------------------------------------------------------
%% \pdfx@topdfstring\toka\tokb: Convert the string in \tokb to a format
%% appropriate for PDF /Info strings, i.e., PDFDoc encoding or UTF-16
%% encoding, and store the result in \toka As a special case, if \tokb
%% is \@empty, set \toka to \@empty.
-\def\pdfx@topdfstring#1#2{%
- \ifx#2\@empty
+\RequirePackage{stringenc}% prevent it loading later inside a group
+\def\pdfx@topdfstring #1#2{%
+ \ifx #2\@empty
\global\let#1\empty
\else
\begingroup
\ifluatex\else\ifxetex\else
\inputencoding{utf8}%
\fi\fi
- \hypersetup{pdfencoding=auto}%
- \pdfstringdef#1{#2}%
+ \@ifl@t@r\fmtversion{2022/06/01}{}{\hypersetup{pdfencoding=auto}}%
+ \pdfstringdef #1{#2}%
\endgroup
\fi
}
@@ -4858,7 +5090,7 @@
\RequirePackage{stringenc}%
\begingroup
\catcode`\| 0
- \catcode `\\ 12
+ \catcode `\\ 12
|gdef |pdfx@parsebackslash#1{%
|begingroup
|def |pdfx@parsemacro{#1}%
@@ -4873,7 +5105,7 @@
|edef |pdfx@parseout{|pdfx@parseout \\}%
|def |next{|pdfx@doparsebackslash#2|pdfx@endparse}%
|fi |next
- }
+ }
|endgroup
\def\pdfx@parseend{%
\edef\next{\endgroup\def\expandafter\noexpand\pdfx@parsemacro{\pdfx@parseout}}%
@@ -5018,7 +5250,7 @@
\spacefactor\accent@spacefactor
}
%% same for named accents in math-mode
-\def\pdfx@mathaccentV#1#2#3#4#5{%
+\def\pdfx@mathaccentV #1#2#3#4#5{%
#5{\mathsurround=\z@\relax
\everymath{}%
\mathchoice
@@ -5027,12 +5259,74 @@
{\setbox\z@\hbox{$\scriptstyle #5$}\kern-\wd\z@}%
{\setbox\z@\hbox{$\scriptscriptstyle #5$}\kern-\wd\z@}%
}%
+% \pdfx@AMS@mathaccentV{#1}{#2}{#3}{#4}{#5}%
\AMS@mathaccentV{#1}{#2}{#3}{#4}{\phantom{#5}}%
}
+
+%%% the original AMS coding:
+%%\mathaccentV=macro: #1#2#3#4#5->\ifmmode
+%% \gdef \macc@tmp {\macc@depth \@ne }%
+%% \setbox \z@ \hbox {\let\mathaccentV \macc@test
+%% \let \use@mathgroup \@gobbletwo
+%% \let \select@group \@gobblethree \frozen@everymath {}$#5$}\macc@tmp
+%% \ifnum \macc@depth =\@ne
+%% \global \let \macc@nucleus \@empty
+%% \mathaccent "\accentclass@
+%% \else \@xp \macc@nested
+%% \fi #2#3#4{#5}\macc@nucleus
+%% \else
+%% \@xp \nonmatherr@ \csname #1\endcsname \fi .
+
+\def\pdfx@AMS@mathaccentV #1#2#3#4#5{%
+ \ifmmode
+ \gdef \macc@tmp {\macc@depth \@ne }%
+ \setbox \z@ \hbox {\let\mathaccentV \macc@test
+ \let \use@mathgroup \@gobbletwo
+ \let \select@group \@gobblethree \frozen@everymath {}$\phantom{#5}$}\macc@tmp
+ \ifnum \macc@depth =\@ne
+ \global \let \macc@nucleus \@empty
+ \mathaccent "\accentclass@
+ \else \@xp \macc@nested
+ \fi #2#3#4{#5}\macc@nucleus
+ \else
+ \@xp \nonmatherr@ \csname #1\endcsname
+ \fi
+}
+
+
+%% code supplied by Yuwsuke Kieda, 7 May 2019 :
+%% https://gist.github.com/yuw/a31936370647d0044eeb4e47f3ae913f
+%%
+\@ifpackageloaded{amsmath}{%
+ \def\pdfx@macc@a #1#2{%
+ \begingroup
+ \let\macc@style#1\relax
+ \def\macc@palette ##1{##1\macc@style}%
+ \advance\macc@depth\m@ne
+ \ifnum\macc@depth=\z@
+ \gdef\macc@nucleus{\phantom{#2}}%% <<< here
+ \setbox\z@\hbox{$#1#2\@empty{}\macc@skewchar$}%
+ \setbox\tw@\hbox{$#1#2\@empty\macc@skewchar$}%
+ \dimen@\tw@\wd\tw@ \advance\dimen@-\tw@\wd\z@
+ \xdef\macc@kerna{\the\dimen@\relax}%
+ \setbox4\hbox{$#1#2\acc@check\@empty$}%
+ \global\setbox\@ne\hbox to\wd4{}%
+ \ht\@ne\ht4 \dp\@ne\dp4
+ \xdef\macc@kernb{\the\wd4\relax}%
+ \mathaccent\macc@code{\box\@ne\kern\macc@kerna}%
+ \else
+ \mathaccent\macc@code{\let\macc@adjust\@empty #1#2\@empty}%
+ \macc@adjust
+ \fi
+ \endgroup
+ }}\relax
+%
\AtBeginDocument{%
\@ifpackageloaded{amsmath}{%
\let\AMS@mathaccentV\mathaccentV
- \let\mathaccentV\pdfx@mathaccentV}%
+% \let\mathaccentV\pdfx@mathaccentV
+% \let\macc@a\pdfx@macc@a
+ }%
}%
%% How to support XeTeX here ?
@@ -5284,10 +5578,25 @@
%% it should be loaded outside the grouping, else biblatex may barf
%%
\RequirePackage{ifthen}
-\begingroup
+
+%% 2024-04-05: from July 2024 LaTeX will not allow packages to load
+%% within a grouping, so reorganise a bit.
+%%
%% override the \ifpdf check of xmpincl package, inside the grouping
- \pdftrue
- \RequirePackage{xmpincl}
+%% after saving its current value:
+\let\pdfx@ifpdf\ifpdf
+\pdftrue
+%% now load the packages, then enter the grouping:
+\RequirePackage{xmpincl}
+%%
+\begingroup
+%%% 20240405 revert the value of \ifpdf ...
+\pdfx@ifpdf
+\else
+ %% 20240624 ... outside the grouping
+ \aftergroup\pdffalse
+\fi
+
%% combine coding from xmpincl and hyperxml to support XeTeX
\def\pdfx@xmpincl@xetex#1{%
\IfFileExists{#1.xmp}{%
@@ -5343,6 +5652,13 @@
%%----------------------------------------------------------------------
\begingroup
+%% 20210706 we need a pointer to unexpandable \par
+ \expandafter\ifx\csname tex_par:D\endcsname \relax
+ \let\pdfx@par\par
+ \else
+%% using LaTeX 2021-06 or later
+ \expandafter\let\expandafter\pdfx@par\csname tex_par:D\endcsname
+ \fi
\ifpdfx@x
\ifpdfx@vt
\def\xmp@template{pdfvt}%
@@ -5396,9 +5712,11 @@
%% beware 128 space characters -- for padding end of XMP packet
\gdef\paddingline{ }%
\typeout{Using XMP template file: \xmp@template.xmp}%
+ %% 20210706 ensure \par is unexpandable
+ \let\par\pdfx@par
\includexmp{\xmp@template}%
\endgroup
-
+%%%
%%
%% revert active characters to previous encoding
%%
@@ -5462,13 +5780,27 @@
%%
%% controls the color model and conversions with xcolor package
%%
+\def\pdfx@selectcolormodel@doing #1{%% Warning
+ \PackageWarning{pdfx}{Setting all color commands to #1,^^J%
+ consistent with the Color Model for PDF/%
+ \ifpdfx@x X \else \ifpdfx@e E \else A \fi\fi}%
+ }%% 20240528 inhibit any changes
+\def\pdfx@selectcolormodel@done #1{%% Warning
+ \PackageWarning{pdfx}{Color Model already set for PDF/%
+ \ifpdfx@x X\else \ifpdfx@e E\else A\fi\fi,^^Jcannot change to #1 }%
+ }%% 20240528 inhibit any changes
+%%
\ifpdfx@cmyk
%
% this will have been done already for PDF/X
%
\PassOptionsToPackage{cmyk,hyperref}{xcolor}
- \def\pdfx@handlexcolor{\def\@@mod{cmyk}\selectcolormodel{cmyk}%
- \convertcolorsUtrue\convertcolorsDtrue}
+ \def\pdfx@handlexcolor{\def\@@mod{cmyk}%
+ \pdfx@selectcolormodel@doing{cmyk}%
+ \selectcolormodel{cmyk}%
+ \convertcolorsUtrue\convertcolorsDtrue
+ \let\selectcolormodel\pdfx@selectcolormodel@done
+ }
\ifpdfx@x
\else
%% \AtBeginDocument{%
@@ -5491,8 +5823,12 @@
\fi
\else
\PassOptionsToPackage{rgb,hyperref}{xcolor}
- \def\pdfx@handlexcolor{\def\@@mod{rgb}\selectcolormodel{rgb}%
- \convertcolorsUtrue\convertcolorsDtrue}
+ \def\pdfx@handlexcolor{\def\@@mod{rgb}%
+ \pdfx@selectcolormodel@doing{rgb}%
+ \selectcolormodel{rgb}%
+ \convertcolorsUtrue\convertcolorsDtrue
+ \let\selectcolormodel\pdfx@selectcolormodel@done
+ }
\fi
\@ifpackageloaded{xcolor}{\pdfx@handlexcolor
\ifpdfx@cmyk\else\color{black}\fi}{%
@@ -5628,7 +5964,9 @@
%</package>
% \fi
% \Finale
-% \let\newpage\relax
% \PrintIndex
+% \let\realGlossaryParms\GlossaryParms \let\realsubitem\subitem
+% \long\def\GlossaryParms{\realGlossaryParms \def\hdpindex ##1##2{}%
+% \long\def\subitem ##1:\ ##2\pfill{\par\hangindent 30pt\hspace*{15pt}##2\hfil}}%
% \PrintChanges
% \endinput
diff --git a/Master/texmf-dist/source/latex/pdfx/pdfx.ins b/Master/texmf-dist/source/latex/pdfx/pdfx.ins
index afd943fbb59..88defbfee80 100644
--- a/Master/texmf-dist/source/latex/pdfx/pdfx.ins
+++ b/Master/texmf-dist/source/latex/pdfx/pdfx.ins
@@ -4,9 +4,9 @@
\preamble
- Copyright (c) 2019, CV Radhakrishnan <cvr@river-valley.org>,
+ Copyright (c) 2019-2024, CV Radhakrishnan <cvr@river-valley.org>,
Han The Thanh <thanh@river-valley.org>,
- Ross Moore <ross.moore@mq.edu.au>,
+ Ross Moore <ozross@icloud.com> - primary contact,
Peter Selinger <selinger@mathstat.dal.ca>
This file may be distributed and/or modified under the conditions
diff --git a/Master/texmf-dist/source/latex/polyglossia/polyglossia.dtx b/Master/texmf-dist/source/latex/polyglossia/polyglossia.dtx
index 09cac66703d..9e018afc668 100644
--- a/Master/texmf-dist/source/latex/polyglossia/polyglossia.dtx
+++ b/Master/texmf-dist/source/latex/polyglossia/polyglossia.dtx
@@ -8,7 +8,7 @@
\iffalse
%</internal>
%<*README>
-# THE POLYGLOSSIA PACKAGE v2.1
+# THE POLYGLOSSIA PACKAGE v2.2
## Multilingual typesetting with XeLaTeX and LuaLaTeX
This package provides an alternative to Babel for users of XeLaTeX and LuaLaTeX.
@@ -65,7 +65,8 @@ to track the issues and follow progress.
____________________________
The polyglossia package
- (C) 2008–2010 François Charette
+ (C) 2008–2010 François Charette
+ (C) 2023-2024 Udi Fogiel
(C) 2011–2024 Arthur Reutenauer
(C) 2013 Elie Roux
(C) 2019 Bastien Roucariès
@@ -76,19 +77,29 @@ to track the issues and follow progress.
\endpreamble
\postamble
- Copyright (C) 2024 by Arthur Reutenauer <arthur 'dot' reutenauer 'at' normalesup 'dot' org>
+ Copyright (C) 2024 by The Polyglossia Team http://github.com/reutenauer/polyglossia/
- This work may be distributed and/or modified under the
- conditions of the LaTeX Project Public License, either version 1.3
- of this license of (at your option) any later version.
- The latest version of this license is in
- http://www.latex-project.org/lppl.txt
- and version 1.3 or later is part of all distributions of LaTeX
- version 2005/12/01 or later.
-
- This work has the LPPL maintenance status `maintained'.
+ Except where otherwise noted, Polyglossia is placed under the terms of the
+ MIT licence (https://opensource.org/licenses/MIT).
+
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"),
+ to deal in the Software without restriction, including without limitation
+ the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ and/or sell copies of the Software, and to permit persons to whom the Software
+ is furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be included in
+ all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR
+ A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+ COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT
+ OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- The Current Maintainer of this work is Arthur Reutenauer.
+ Please report issues to http://github.com/reutenauer/polyglossia/issues
\endpostamble
@@ -98,8 +109,8 @@ to track the issues and follow progress.
\generate{\file{farsical.sty}{\from{polyglossia.dtx}{farsical.sty}}}
\generate{\file{hebrewcal.sty}{\from{polyglossia.dtx}{hebrewcal.sty}}}
\generate{\file{hijrical.sty}{\from{polyglossia.dtx}{hijrical.sty}}}
+\generate{\file{polyglossia-cjk-spacing.lua}{\from{polyglossia.dtx}{polyglossia-cjk-spacing.lua}}}
\generate{\file{polyglossia-french.lua}{\from{polyglossia.dtx}{polyglossia-french.lua}}}
-\generate{\file{polyglossia-korean.lua}{\from{polyglossia.dtx}{polyglossia-korean.lua}}}
\generate{\file{polyglossia-latin.lua}{\from{polyglossia.dtx}{polyglossia-latin.lua}}}
\generate{\file{polyglossia-punct.lua}{\from{polyglossia.dtx}{polyglossia-punct.lua}}}
\generate{\file{polyglossia-sanskrit.lua}{\from{polyglossia.dtx}{polyglossia-sanskrit.lua}}}
@@ -109,7 +120,7 @@ to track the issues and follow progress.
\generate{\file{babelsh.def}{\from{polyglossia.dtx}{babelsh.def}}}
\generate{\file{cal-util.def}{\from{polyglossia.dtx}{cal-util.def}}}
\generate{\file{xgreek-fixes.def}{\from{polyglossia.dtx}{xgreek-fixes.def}}}
-\generate{\file{gloss-acadien.ldf}{\from{polyglossia.dtx}{gloss-acadien.ldf}}}
+\generate{\file{gloss-acadian.ldf}{\from{polyglossia.dtx}{gloss-acadian.ldf}}}
\generate{\file{gloss-aeb.ldf}{\from{polyglossia.dtx}{gloss-aeb.ldf}}}
\generate{\file{gloss-af.ldf}{\from{polyglossia.dtx}{gloss-af.ldf}}}
\generate{\file{gloss-afb.ldf}{\from{polyglossia.dtx}{gloss-afb.ldf}}}
@@ -163,6 +174,7 @@ to track the issues and follow progress.
\generate{\file{gloss-ckb-Arab.ldf}{\from{polyglossia.dtx}{gloss-ckb-Arab.ldf}}}
\generate{\file{gloss-ckb-Latn.ldf}{\from{polyglossia.dtx}{gloss-ckb-Latn.ldf}}}
\generate{\file{gloss-ckb.ldf}{\from{polyglossia.dtx}{gloss-ckb.ldf}}}
+\generate{\file{gloss-classiclatin.ldf}{\from{polyglossia.dtx}{gloss-classiclatin.ldf}}}
\generate{\file{gloss-cop.ldf}{\from{polyglossia.dtx}{gloss-cop.ldf}}}
\generate{\file{gloss-coptic.ldf}{\from{polyglossia.dtx}{gloss-coptic.ldf}}}
\generate{\file{gloss-croatian.ldf}{\from{polyglossia.dtx}{gloss-croatian.ldf}}}
@@ -195,6 +207,7 @@ to track the issues and follow progress.
\generate{\file{gloss-dsb.ldf}{\from{polyglossia.dtx}{gloss-dsb.ldf}}}
\generate{\file{gloss-dutch.ldf}{\from{polyglossia.dtx}{gloss-dutch.ldf}}}
\generate{\file{gloss-dv.ldf}{\from{polyglossia.dtx}{gloss-dv.ldf}}}
+\generate{\file{gloss-ecclesiasticlatin.ldf}{\from{polyglossia.dtx}{gloss-ecclesiasticlatin.ldf}}}
\generate{\file{gloss-el-monoton.ldf}{\from{polyglossia.dtx}{gloss-el-monoton.ldf}}}
\generate{\file{gloss-el-polyton.ldf}{\from{polyglossia.dtx}{gloss-el-polyton.ldf}}}
\generate{\file{gloss-el.ldf}{\from{polyglossia.dtx}{gloss-el.ldf}}}
@@ -277,9 +290,6 @@ to track the issues and follow progress.
\generate{\file{gloss-lao.ldf}{\from{polyglossia.dtx}{gloss-lao.ldf}}}
\generate{\file{gloss-latex.ldf}{\from{polyglossia.dtx}{gloss-latex.ldf}}}
\generate{\file{gloss-latin.ldf}{\from{polyglossia.dtx}{gloss-latin.ldf}}}
-\generate{\file{gloss-latinclassic.ldf}{\from{polyglossia.dtx}{gloss-latinclassic.ldf}}}
-\generate{\file{gloss-latinecclesiastic.ldf}{\from{polyglossia.dtx}{gloss-latinecclesiastic.ldf}}}
-\generate{\file{gloss-latinmedieval.ldf}{\from{polyglossia.dtx}{gloss-latinmedieval.ldf}}}
\generate{\file{gloss-latvian.ldf}{\from{polyglossia.dtx}{gloss-latvian.ldf}}}
\generate{\file{gloss-lithuanian.ldf}{\from{polyglossia.dtx}{gloss-lithuanian.ldf}}}
\generate{\file{gloss-lo.ldf}{\from{polyglossia.dtx}{gloss-lo.ldf}}}
@@ -292,6 +302,7 @@ to track the issues and follow progress.
\generate{\file{gloss-malay.ldf}{\from{polyglossia.dtx}{gloss-malay.ldf}}}
\generate{\file{gloss-malayalam.ldf}{\from{polyglossia.dtx}{gloss-malayalam.ldf}}}
\generate{\file{gloss-marathi.ldf}{\from{polyglossia.dtx}{gloss-marathi.ldf}}}
+\generate{\file{gloss-medievallatin.ldf}{\from{polyglossia.dtx}{gloss-medievallatin.ldf}}}
\generate{\file{gloss-mk.ldf}{\from{polyglossia.dtx}{gloss-mk.ldf}}}
\generate{\file{gloss-ml.ldf}{\from{polyglossia.dtx}{gloss-ml.ldf}}}
\generate{\file{gloss-mn.ldf}{\from{polyglossia.dtx}{gloss-mn.ldf}}}
@@ -351,16 +362,9 @@ to track the issues and follow progress.
\generate{\file{gloss-welsh.ldf}{\from{polyglossia.dtx}{gloss-welsh.ldf}}}
\generate{\file{gloss-zh-CN.ldf}{\from{polyglossia.dtx}{gloss-zh-CN.ldf}}}
\generate{\file{gloss-zh-TW.ldf}{\from{polyglossia.dtx}{gloss-zh-TW.ldf}}}
-\generate{\file{arabicdigits.map}{\from{polyglossia.dtx}{arabicdigits.map}}}
-\generate{\file{bengalidigits.map}{\from{polyglossia.dtx}{bengalidigits.map}}}
-\generate{\file{devanagaridigits.map}{\from{polyglossia.dtx}{devanagaridigits.map}}}
-\generate{\file{farsidigits.map}{\from{polyglossia.dtx}{farsidigits.map}}}
-\generate{\file{gurmukhidigits.map}{\from{polyglossia.dtx}{gurmukhidigits.map}}}
-\generate{\file{odiadigits.map}{\from{polyglossia.dtx}{odiadigits.map}}}
-\generate{\file{thaidigits.map}{\from{polyglossia.dtx}{thaidigits.map}}}
\def\MetaPrefix{-- }
+\generate{\file{polyglossia-cjk-spacing.lua}{\from{polyglossia.dtx}{polyglossia-cjk-spacing.lua}}}
\generate{\file{polyglossia-french.lua}{\from{polyglossia.dtx}{polyglossia-french.lua}}}
-\generate{\file{polyglossia-korean.lua}{\from{polyglossia.dtx}{polyglossia-korean.lua}}}
\generate{\file{polyglossia-latin.lua}{\from{polyglossia.dtx}{polyglossia-latin.lua}}}
\generate{\file{polyglossia-punct.lua}{\from{polyglossia.dtx}{polyglossia-punct.lua}}}
\generate{\file{polyglossia-sanskrit.lua}{\from{polyglossia.dtx}{polyglossia-sanskrit.lua}}}
@@ -405,8 +409,10 @@ to track the issues and follow progress.
]{hyperref}
\usepackage{array}
\usepackage{metalogo}
-\let\XeTeX\undefined
-\let\XeLaTeX\undefined
+\ifxetex
+ \let\XeTeX\undefined
+ \let\XeLaTeX\undefined
+\fi
\usepackage[babelshorthands]{polyglossia}
\usepackage{farsical}
%
@@ -506,15 +512,23 @@ to track the issues and follow progress.
\usepackage[osf]{libertine}
% Monospace: Package dejavu-otf
\setmonofont[Scale=MatchLowercase]{DejaVuSansMono}
-% Libertine includes Hebrew, but we load it separately since
-% osf is not supported with this script and we want to avoid the
-% respective warnings
-\newfontfamily\hebrewfont[Script=Hebrew]{Linux Libertine O}
+% Package culmus
+\newfontfamily\hebrewfont[Script=Hebrew]{DavidCLM}[
+ UprightFont = *-Medium,
+ BoldFont = *-Bold,
+ Extension = .otf,
+ ItalicFont = *-MediumItalic,
+ BoldItalicFont = *-BoldItalic]
% Package dejavu-otf
\newfontfamily\armenianfont[Script=Armenian,Scale=MatchLowercase]{DejaVuSans}
\newfontfamily\georgianfont[Scale=MatchLowercase]{DejaVuSerif}
% Package amiri
-\newfontfamily\arabicfont[Script=Arabic]{Amiri-Regular}
+\newfontfamily\arabicfont[Script=Arabic]{Amiri}[%
+ UprightFont = *-Regular,
+ BoldFont = *-Bold,
+ Extension = .ttf,
+ ItalicFont = *-Italic,
+ BoldItalicFont = *-BoldItalic]
% No Syriac otf/ttf font seems available on CTAN
% This one, from the Syriac Institute, is included on Linux
% in the x11-fonts set and can be downloaded from
@@ -850,7 +864,7 @@ to track the issues and follow progress.
% dv & divehi & \tabularnewline
% el & greek & \tabularnewline
% el-monoton & greek & variant=monotonic [\emph{default}] \tabularnewline
-% el-polyton & greek & varant=polytonic \tabularnewline
+% el-polyton & greek & variant=polytonic \tabularnewline
% en & english & \tabularnewline
% en-AU & english & variant=australian \tabularnewline
% en-CA & english & variant=canadian \tabularnewline
@@ -1164,13 +1178,25 @@ to track the issues and follow progress.
%
% \section{Font setup}
%
-% With polyglossia it is possible to associate a specific font with any script or language
+% With \pkg{polyglossia} it is possible to associate a specific font with any script or language
% that occurs in the document. That font should always be defined as
-% \cmd{\⟨script⟩font}\ or \cmd{\⟨language⟩font}.
+% \cmd{\⟨script⟩font}\ or \cmd{\⟨language⟩font}. Note that ¦⟨language⟩¦ points to the \pkg{polyglossia}
+% language name, ¦⟨script⟩¦ might point either to an OpenType script name as defined by \pkg{fontspec}
+% (\eg ¦Latin¦) \new{2.2}or a BCP-47 script tag (\eg ¦Latn¦), though the script is fully lower-cased
+% in the \cmd{\⟨script⟩font}\ command.
+%
% For instance, if the default font defined by \cmd\setmainfont\
% does not support Greek, then one can define the font used to display Greek with:\\
-% \centerline{ \cmd\newfontfamily\cmd{\greekfont[Script=Greek,\meta{…}]\marg{font}}. }
-% Note that polyglossia will use the font defined as is, so assure to do all necessary settings
+% \centerline{\cmd\newfontfamily\cmd{\greekfont[Script=Greek,\meta{…}]\marg{font}}}
+% ^^A
+% If you want to setup a blackletter font specifically for the German blackletter script variant,
+% you might do so by:\\
+% \centerline{\cmd\newfontfamily\cmd{\latffont[\meta{…}]\marg{font}}}
+% ^^A
+% Setting up a font specifically for traditional Chinese is possible via:\\
+% \centerline{\cmd\newfontfamily\cmd{\hantfont[Script=CJK,\meta{…}]\marg{font}}}
+% ^^A
+% Note that \pkg{polyglossia} will use the font defined as is, so assure to do all necessary settings
% (please refer to the \pkg{fontspec} documentation for details).
% For instance, if \cmd\arabicfont\ is explicitly defined, then the option ¦Script=Arabic¦ should
% be included in that definition.
@@ -1180,10 +1206,12 @@ to track the issues and follow progress.
% \cmd{\⟨script⟩fontsf} or \cmd{\⟨language⟩fontsf} and \cmd{\⟨script⟩fonttt} or \cmd{\⟨language⟩fonttt}, respectively.
%
% Whenever a new language is activated, \pkg{polyglossia} will first check whether
-% a font has been defined for that language or – for languages in non-Latin scripts –
-% for the script it uses. If it is not defined, it will use the currently active font
-% and – in the case of OpenType fonts – will attempt to turn on the appropriate
-% OpenType tags for the script and language used, in case these are available in
+% a font has been defined for that language. If this is not the case, it will check whether a font associated
+% with the BCP-47 script tag of the current language is defined. If this also isn't the case, \pkg{polyglossia}
+% will finally check (but this only for languages in non-Latin scripts) whether there is a font associated
+% with the OpenType script tag. If none of these fonts is defined, \pkg{polyglossia} will use the currently
+% active font as defined by ¦\setmainfont¦, ¦\setsansfont¦ or ¦\setmonofont¦ and – in the case of OpenType fonts –
+% will attempt to turn on the appropriate OpenType tags for the script and language used, in case these are available in
% the font, by means of \pkg{fontspec}’s \cmd\addfontfeature. If the current font
% does not appear to support the script of that language, an error message is
% displayed.
@@ -1978,7 +2006,7 @@ to track the issues and follow progress.
% \end{table}
% \item \xpgchoicekey[1.46]{hyphenation}{\xpgvalue{classic}, \xpgvalue{modern}, or \xpgvalue{liturgical}}
% There are three different sets of hyphenation patterns for Latin. Separate
-% documention for them is available on the
+% documentation for them is available on the
% Internet.\footnote{Refer to \url{https://github.com/gregorio-project/hyphen-la/blob/master/doc/README.md\#hyphenation-styles}}
% Each of the four variants mentioned above has its default set of hyphenation
% patterns as indicated by table \ref{tab:latin-hyphenation}. Use the
@@ -2050,7 +2078,7 @@ to track the issues and follow progress.
% \item[¦'AE¦] for Ǽ (AE ligature with acute), also available for \'Œ
% \end{shorthands}
% \item \xpgboolkeyfalse[1.46]{prosodicshorthands}
-% Enable shorthands for prosodic marks (macrons and breves) very similiar to
+% Enable shorthands for prosodic marks (macrons and breves) very similar to
% those provided by \pkg{babel-latin} using the ¦withprosodicmarks¦
% modifier.
% Note that the active ¦=¦ character used for macrons will cause problems with
@@ -2956,7 +2984,7 @@ to track the issues and follow progress.
% \subsection{Islamic calendar (hijrical.sty)}\label{sec:hijrical}
% This package computes dates in the lunar Islamic (Hijra) calendar.\footnote{ %
% It makes use of the arithmetical algorithm in chapter 6 of
-% Reingold \& Gershowitz, \textit{Calendrical calculation: the Millenium edition}
+% Reingold \& Gershowitz, \textit{Calendrical calculation: the Millennium edition}
% (Cambridge University Press, 2001).\label{reingold}}
% It provides two macros for the end-user.
% The command
@@ -3091,6 +3119,31 @@ to track the issues and follow progress.
%
% \bgroup\footnotesize
%
+% \subsection*{2.2 (2024/07/15)}
+%
+% \subsubsection*{Bug fixes}
+% \begin{itemize}
+% \item Fix \texttt{lang} environment (\TXI{633}).
+% \item Fix first number of Maghrib abjad numbering for Algeria, Morocco and
+% Tunisia (\TXI{640}).
+% \item Fix some captions strings in Bulgarian, Chinese, Esperanto, Estonian, Hindi,
+% Latvian, and Slovak (\TXP{651})
+% \item Improve performance with multilingual documents that have a TOC (\TXI{641}).
+% \end{itemize}
+%
+% \subsubsection*{New Features}
+% \begin{itemize}
+% \item Add possibility to associate a font to a language/variant with reference to
+% a BCP-47 script tag (\TXI{636}).
+% \end{itemize}
+%
+% \subsubsection*{Internal work}
+% \begin{itemize}
+% \item The major rewrite of the package code has been finished. More code has been cleaned up,
+% and \pkg{polyglossia} employs modern concepts (\pkg{latex3} and modern \LaTeXe).
+% All key-val handling uses \pkg{l3keys} now rather than \pkg{xkeyval}.
+% \end{itemize}
+%
% \subsection*{2.1 (2024/03/07)}
%
% \subsubsection*{Bug fixes}
@@ -4149,7 +4202,7 @@ to track the issues and follow progress.
% \section{Acknowledgements (by François Charette)}
% \pkg{Polyglossia} is notable for being a recycle box of previous contributions
% by other people. I take this opportunity to thank the following individuals,
-% whose splendid work has made my task almost trivial in comparision: \TA{Johannes
+% whose splendid work has made my task almost trivial in comparison: \TA{Johannes
% Braams} and the numerous contributors to the \pkg{babel} package (in particular
% \TA{Boris Lavva} and others for its Hebrew support), \TA{Alexej Kryukov} (\pkg{antomega}),
% \TA{Will Robertson} (\pkg{fontspec}), \TA{Apostolos Syropoulos} (\pkg{xgreek}), \TA{Youssef Jabri}
@@ -4176,7 +4229,7 @@ to track the issues and follow progress.
% since we took over.
% In alphabetical order: \TA{Ignas Anikevicius}, \TA{Sina Ahmadi}, \TA{Matthew Bertucci}, \TA{Wouter Bolsterlee}, \TA{Christian Buhtz},
% \TA{Ashok Das}, \TA{Oleg Domanov}, user \TA{fakhriaunur}, \TA{Philipp Gesang}, \TA{Kevin Godby},
-% \TA{Enrico Gregorio}, \TA{Khaled Hosny}, \TA{Najib Idrissi}, user \TA{julroy67}, \TA{Dohyun Kim}, \TA{Phil Kime},
+% \TA{Enrico Gregorio}, \TA{Khaled Hosny}, \TA{Stephen Huan}, \TA{Najib Idrissi}, user \TA{julroy67}, \TA{Dohyun Kim}, \TA{Phil Kime},
% \TA{Mike Kroutikov}, \TA{Ivan Kokan}, \TA{Caleb Maclennan}, \TA{Gyula Magyarkuti}, \TA{José Mancera}, \TA{Miquel Ortega},
% \TA{Yevgen Pogribnyi}, \TA{Will Robertson}, \TA{Maïeul Rouquette}, \TA{Elie Roux}, \TA{Hugo Roy}, \TA{Guy Rutenberg},
% \TA{Marcin Serwin}, \TA{Arvinder Singh}, \TA{Avisek Jena}, \TA{Philipp Stephani}, \TA{Niranjan Tambe}, \TA{Takuji Tanaka},
@@ -4208,33 +4261,28 @@ to track the issues and follow progress.
% \begin{macrocode}
\NeedsTeXFormat{LaTeX2e}
\ProvidesExplPackage
- {polyglossia} {2024/03/07} {v2.1}
+ {polyglossia} {2024/07/15} {v2.2}
{Modern multilingual typesetting with XeLaTeX and LuaLaTeX}
+% TODO Handle remaining uses in the gloss files (\patchcmd)
+% and remove package call afterwards
\RequirePackage{etoolbox}
-\RequirePackage{xkeyval}[2008/08/13]
% Will raise error if used with anything else than XeTeX or LuaTeX
\RequirePackage{fontspec}[2010/06/08]% v2.0
\RequirePackage{iftex}
\prg_generate_conditional_variant:Nnn \clist_if_in:Nn {Ne} {TF, T, F} % check if needed
-% correct a bug in tracklang
-\AddToHook{package/tracklang/after}{%
- \IfPackageAtLeastTF{tracklang}{2019/08/30}
- {}
- {\cs_gset_eq:NN \AddTrackedLangage \AddTrackedLanguage}
-}
-
%% The following is for compatibility with Babel-aware package:
% \languageshorthands is provided by babelsh.def, which is
% only loaded by some glosses, but some classes presuppose
% it is there generally. So let's provide a stub:
\ProvideDocumentCommand \languageshorthands { m } {}
% These have to be provided at the end of the preamble
-\AddToHook{begindocument/before}{
- \cs_gset_eq:NN \bbl@set@language \xpg@set@language@aux % for biblatex
- \cs_gset_eq:NN \bbl@main@language \xpg@main@language % for biblatex
+\hook_gput_code:nnn {begindocument/before} {.}
+{
+ \cs_gset_eq:NN \bbl@set@language \xpg_set_language_aux:nn % for biblatex
+ \cs_gset_eq:NN \bbl@main@language \xpg_main_language_tl % for biblatex
\ProvideDocumentCommand \texorpdfstring { m m } { #1 } % dummy command if hyperref is not loaded
}
@@ -4243,16 +4291,15 @@ to track the issues and follow progress.
%% \l@nohyphenation is defined in polyglossia.lua
\sys_if_engine_luatex:TF
{
- \RequirePackage{luatexbase} % already included by fontspec, but needed here
- \RequireLuaModule{polyglossia}
+ \lua_load_module:n{polyglossia}
}{
\cs_if_free:cT { l@nohyphenation }
{ \chardef\l@nohyphenation=255 }
}
-% Which version of XeTeX do we use? What is the boudary class? 4095 or 255
+% Which version of XeTeX do we use? What is the boundary class? 4095 or 255
\cs_if_exist:cTF { e@alloc@intercharclass@top }
- { \let\xpg@boundaryclass=\e@alloc@intercharclass@top }
+ { \cs_gset_eq:NN \xpg@boundaryclass \e@alloc@intercharclass@top }
{ \chardef\xpg@boundaryclass=\@cclv }
% Useful for getting list of loaded languages and variants. Like babel's bbl@loaded
@@ -4288,18 +4335,18 @@ to track the issues and follow progress.
\cs_new_nopar:Nn \__xpg_at_begin_document:
{
% save various command
- \let\latin@alph\@alph % TODO rename when we have the C locale
- \let\latin@Alph\@Alph % TODO rename when we have the C locale
+ \cs_gset_eq:cc{latin@alph}{@alph}% TODO rename when we have the C locale
+ \cs_gset_eq:cc{latin@Alph}{@Alph}% TODO rename when we have the C locale
% push to C language gloss
- \let\polyglossia@Clang@@arabic\@arabic
- \let\polyglossia@Clang@arabic\arabic
+ \cs_gset_eq:cc{xpg_Clang_arabic}{@arabic}
\xpg_initial_setup:
% apply \familydefault changes
- \xpg@set@familydefault
+ \xpg_set_familydefault:
}
-\AddToHook{begindocument}{
+\hook_gput_code:nnn {begindocument} {.}
+{
\__xpg_at_begin_document:
}
@@ -4307,7 +4354,8 @@ to track the issues and follow progress.
% loaded after \set[main|other]language
% Track whether the main language has been set
\bool_new:N \g_xpg_main_lang_set_bool
-\AddToHook{begindocument/end}{
+\hook_gput_code:nnn {begindocument/end} {.}
+{
% now we have the C locale definition: select the language
\__xpg_at_begin_document_selectlanguage:
\bool_gset_true:N \g_xpg_main_lang_set_bool
@@ -4315,99 +4363,177 @@ to track the issues and follow progress.
\__xpg_at_begin_document_hyphenation:
}
-%% custom message macros
-\providecommand*{\xpg@error}[1]{
- \PackageError{polyglossia}{#1}{}
+%
+% MESSAGES
+%
+
+% message templates
+\msg_new:nnn { polyglossia } { general } { #1 }
+
+\msg_new:nnn { polyglossia } { languagenotloaded }
+{
+ The~ language~ #1~ is~ not~ loaded.~ You~ must~ load~ it~ in~ order~ to~ use~ it.
}
+\msg_redirect_name:nnn { polyglossia } { languagenotloaded } { critical }
-\providecommand*{\xpg@warning}[1]{
- \PackageWarning{polyglossia}{#1}
+\msg_new:nnn { polyglossia } { languagenolongerloaded }
+{
+ The~ language~ #1~ is~ no~ longer~ loaded.~ Please~ rerun~ LaTeX.
}
+\msg_redirect_name:nnn { polyglossia } { languagenolongerloaded } { warning }
-\providecommand*{\xpg@info}[1]{
- \PackageInfo{polyglossia}
- {#1\@gobble}
-} %% the \@gobble is to prevent displaying the line nr
+\msg_new:nnn { polyglossia } { unknownlocalnumeral }
+{
+ Unknown~ key~ "#1"~ in~ \string\localnumeral.
+}
-%TODO change all instances of \xpg@nopatterns in gloss-*.ldf files
-\providecommand*{\xpg@nopatterns@fallback}[2][nohyphenation]{
- \xpg@warning{No~ hyphenation~ patterns~ were~ loaded~ for~ `#2'\MessageBreak
- I~ will~ use~ \string\language=\string\l@ #1\space instead}
- \expandafter\adddialect\csname l@#2\expandafter\endcsname\csname l@#1\endcsname\relax}
+\msg_new:nnn { polyglossia } { localnumeralemptyvalue }
+{
+ Keys~ of~ \string\localnumeral~ must~ have~ a~ value.
+}
-\providecommand*{\xpg@nopatterns}[1]{
- \xpg@warning{No~ hyphenation~ patterns~ were~ loaded~ for~ `#1'\MessageBreak
- I~ will~ use~ \string\language=\string\l@nohyphenation\space instead}
- %%TODO? \expandafter\adddialect\csname l@#1\endcsname\l@nohyphenation\relax
- }
+\msg_new:nnn { polyglossia } { illvalue }
+{
+ Illegal~ value~ (#1)~ for~ #2!
+}
-\def\xpg@ill@value#1#2{
- \xpg@warning{Illegal~ value~ (#1)~ for~ #2}}
+\msg_new:nnn { polyglossia } { illarg }
+{
+ Invalid~ argument~ (#1)~ for~ #2!
+}
-% error out if lang is not loaded
-\cs_new_nopar:Nn \xpg_error_if_lang_not_loaded:n
+\msg_new:nnn { polyglossia } { nopatterns }
{
- \seq_if_in:NeF \__xpg_langs_loaded {#1}
- {
- \xpg@error{language~ #1~ is~ not~ loaded.~ Please~ load~ it~ before~ using~ it.}
- }
+ No~ hyphenation~ patterns~ were~ loaded~ for~ `#2' \iow_newline:
+ I~ will~ use~ \string\language=\string\l@ #1\space instead.
}
-\msg_new:nnn { polyglossia } { languagenotloaded }
+\msg_new:nnn { polyglossia } { undefcmd }
{
- The~ language~ #1~ is~ not~ loaded.~ You~ should~ load~ it.
+ \tl_to_str:N {#1} ~ is~ not~ defined!
}
-\msg_redirect_name:nnn { polyglossia } { languagenotloaded } { critical }
-\msg_new:nnn { polyglossia } { languagenolongerloaded }
+%% custom message macros
+\cs_new_nopar:Nn \xpg_error_msg:n
{
- The~ language~ #1~ is~ no~ longer~ loaded.~ Please~ rerun~ LaTeX.
+ \exp_args:Nnne \msg_error:nnn { polyglossia } { general } { #1 }
}
-\msg_redirect_name:nnn { polyglossia } { languagenolongerloaded } { warning }
-\msg_new:nnn { polyglossia } { unknownlocalnumeral }
+\cs_new_nopar:Nn \xpg_warning_msg:n
{
- Unknown~ key~ "#1"~ in~ \string\localnumeral.
+ \exp_args:Nnne \msg_warning:nnn { polyglossia } { general } { #1 }
}
-\msg_new:nnn { polyglossia } { localnumeralemptyvalue }
+\cs_new_nopar:Nn \xpg_info_msg:n
+{
+ \exp_args:Nnne \msg_info:nnn { polyglossia } { general } { #1 }
+}
+
+\cs_new_nopar:Nn \xpg_no_patterns_msg:n
{
- Keys~ of~ \string\localnumeral~ must~ have~ value.
+ \msg_warning:nnnn { polyglossia } { nopatterns } { nohyphenation } { #1 }
}
+\cs_new_nopar:Nn \xpg_ill_value_msg:nn
+{
+ \msg_warning:nnnn { polyglossia } { illvalue } { #1 } { #2 }
+}
+
+\cs_new_nopar:Nn \xpg_ill_arg_msg:nn
+{
+ \msg_error:nnnn { polyglossia } { illarg } { #1 } { #2 }
+}
+
+% error out if lang is not loaded
+\cs_new_nopar:Nn \xpg_error_if_lang_not_loaded:n
+{
+ \seq_if_in:NeF \__xpg_langs_loaded {#1}
+ {
+ \msg_error:nnn { polyglossia } { languagenotloaded } { #1 }
+ }
+}
%% use macro if defined, else warn that it is not
\cs_new_nopar:Nn \__xpg_use_or_warn:N
{
\cs_if_exist_use:NF {#1}
{
- \xpg@warning { \tl_to_str:N {#1} ~ is~ not~ defined }
+ \msg_error:nnn { polyglossia } { undefcmd } { #1 }
}
}
\cs_generate_variant:Nn \__xpg_use_or_warn:N {c}
+% gloss message interface
+\cs_set_eq:cc { xpg@error } { xpg_error_msg:n }
+\cs_set_eq:cc { xpg@warning } { xpg_warning_msg:n }
+\cs_set_eq:cc { xpg@info } { xpg_info_msg:n }
+\cs_set_eq:cc { xpg@ill@value } { xpg_ill_value_msg:nn }
+
+
+\NewDocumentCommand \XPGNoPatternsFallback { O{ nohyphenation } m }
+{
+ \msg_warning:nnnn { polyglossia } { nopatterns } { #1 } { #2 }
+ \exp_args:Ncc \adddialect {l@#2} {l@#1}
+}
+
+\NewDocumentCommand \CheckHyphenationPatterns { m }
+{
+ \xpg_if_language_defined:nF {#1}
+ {
+ \XPGNoPatternsFallback{#1}
+ }
+}
+
+%
+% END MESSAGES
+
%% ensure directionality if bidi is loaded, else ignore
-\def\@@ensure@dir#1{\ifcsundef{@ensure@dir}{#1}{\@ensure@dir{#1}}}
-\def\@@ensure@maindir#1{\ifcsundef{@ensure@maindir}{#1}{\@ensure@maindir{#1}}}
+%%% FIXME still used?
+\cs_new_nopar:Npn \@@ensure@dir #1
+{
+ \cs_if_exist_use:c{@ensure@dir}{#1}
+}
-%% Used by the language definitions files for right-to-left languages
-\NewDocumentCommand \RequireBidi {}
+\cs_new_nopar:Npn \@@ensure@maindir #1
{
- \sys_if_engine_luatex:TF
- {\ifx\@onlypreamble\@notprerr\else\RequirePackage{luabidi}\fi}
- {\ifx\@onlypreamble\@notprerr\else\RequirePackage{bidi}\fi}
+ \cs_if_exist_use:c{@ensure@maindir}{#1}
}
-% if #1 is LR run #2 else #3
+% if we are in the document preamble run T else F
+\prg_set_conditional:Nnn \xpg_if_in_preamble: {T, F, TF}
+{
+ \cs_if_eq:NNTF { \@onlypreamble } { \@notprerr }
+ {
+ \prg_return_false:
+ }
+ {
+ \prg_return_true:
+ }
+}
+
+%% Used by the language definitions files for right-to-left languages
+\DeclareDocumentCommand \RequireBidi {}
+ {
+ \xpg_if_in_preamble:T
+ {
+ \sys_if_engine_luatex:TF
+ { \RequirePackage{luabidi} }
+ { \RequirePackage{bidi} }
+ }
+ \DeclareDocumentCommand \RequireBidi {} {}
+ }
+
+% if #1 is LR run T else F
\prg_set_conditional:Nnn \__xpg_if_LR_str:n {p, T, F, TF}
{
- \str_case_e:nnF{#1}{
+ \str_case_e:nnF{#1}
+ {
{LR}{\prg_return_true:}
{RL}{\prg_return_false:}
}
{
- \xpg@error{Unknown~ direction~#1}
+ \xpg_error_msg:n {Unknown~ direction~#1}
\prg_return_false:
}
}
@@ -4420,17 +4546,18 @@ to track the issues and follow progress.
{
\__xpg_if_LR_str:nF {#1}
{
- \xpg@error{right-to-left,~ but~ (lua)bidi~ package~ was~ not~ loaded!}
+ \xpg_error_msg:n {right-to-left,~ but~ (lua)bidi~ package~ was~ not~ loaded!}
}
}
\cs_new_nopar:Nn \__xpg_set_text_direction:n
{
\__xpg_if_LR_str:nF {#1}
{
- \xpg@error{right-to-left,~ but~ (lua)bidi~ package~ was~ not~ loaded!}
+ \xpg_error_msg:n {right-to-left,~ but~ (lua)bidi~ package~ was~ not~ loaded!}
}
}
-\AddToHook{package/bidi/after}{
+\hook_gput_code:nnn {package/bidi/after} {.}
+{
\cs_gset_nopar:Nn \__xpg_set_par_direction:n
{
\__xpg_if_LR_str:nTF{#1}
@@ -4452,7 +4579,8 @@ to track the issues and follow progress.
}
}
}
-\AddToHook{package/luabidi/after}{
+\hook_gput_code:nnn {package/luabidi/after} {.}
+{
\cs_gset_nopar:Nn \__xpg_set_par_direction:n
{
\__xpg_if_LR_str:nTF{#1}
@@ -4481,13 +4609,21 @@ to track the issues and follow progress.
{ \cs_new_nopar:Nn \__xpg_setRTLmain: { \@RTLmaintrue\setnonlatin } }
%% compatibility with babel
-\let\addto\gappto % gappto is defined in etoolbox
+\cs_set:Npn \addto #1 #2
+{
+ \cs_if_exist:NF { #1 }
+ { \cs_new:Npn { #1 } {} }
+ \tl_gput_right:Nn { #1 } { #2 }
+}
-%% NEW EXPERIMENTAL SETUP INTERFACE FOR GLOSS FILES
+%% SETUP INTERFACE FOR GLOSS FILES
%% options currently available:
%% language : the name of the language (as understood by fontspec)
%% hyphennames : the different hyphenation patterns to try (comma separated list)
-%%% TODO: if pattern is prefixed by !, then it should be loaded as a fallback, with \xpg@nopatterns@fallback - i.e. with a warning: e.g. sanskrit for hindi, or catalan for asturian. – Also for languages with variants! (English and German, etc.)
+%%% TODO: if pattern is prefixed by !, then it should be loaded as a fallback,
+%%%% with \CheckHyphenationPatterns - i.e. with a warning: e.g. sanskrit for hindi,
+%%%% or catalan for asturian. – Also for languages with variants!
+%%%% (English and German, etc.)
%% script : the name of the script (as understood by fontspec) – default is Latin
%% scripttag : the OpenType tag for the script
%% langtag : the OpenType tag for the language
@@ -4495,19 +4631,20 @@ to track the issues and follow progress.
%% frenchspacing : boolean
%% indentfirst : boolean
%% fontsetup : boolean
-%% TODO: nouppercase : boolean (for scripts like Arabic, Devanagari, etc which have no concept of uppercase/lowercase)
+%% TODO: nouppercase : boolean (for scripts like Arabic, Devanagari, etc which have
+%% no concept of uppercase/lowercase)
%% TODO: localalph = {<alph_csname>,<Alph_csname>}
%% TODO: localnumeral = <csname>
%% or even better localdigits = {0123456789} for fully automatic setup
-\newcommand*\PolyglossiaSetup[2]{
+\NewDocumentCommand \PolyglossiaSetup { m m }
+{
\__xpg_keys_define_lang:n{#1}
\keys_set:nn { polyglossia / #1 } { #2 }
\__xpg_setup_hyphen:n {#1}
%define booleans etoolbox style and set defaults
%% TODO ? \providetoggle{#1@setup@done}%
- % we initialize these so that we can use \gappto below
- \csgdef{init@extras@#1}{}
- \csgdef{init@noextras@#1}{} % we don't use this yet: remove?
+ % we initialize this so that we can append below
+ \cs_gset:cpn {init@extras@#1} {}
% here we do the fontsetup:
\__xpg_auto_setupfont:n { #1 }
%% TODO? \toggletrue{#1@setup@done}
@@ -4526,35 +4663,41 @@ to track the issues and follow progress.
\clist_map_inline:nn { #1 } { \keys_set:nn { polyglossia / ##1 } { #2 } }
}
-
+\bool_new:N \l__xpg_have_hyphen_bool
% setup hyphennames from a str list of hyphen
\cs_new:Nn \__xpg_setup_hyphen:n
{
- \clist_set:Ne{\l_tmpa_clist}{\prop_item:Nn \g_xpg_langsetup_prop {#1 / hyphennames}}
- \providebool{havehyphen}
- \boolfalse{havehyphen}
+ \clist_set:Ne{\l_tmpa_clist}{\prop_item:Nn \l_xpg_langsetup_prop {#1 / hyphennames}}
+ \bool_set_false:N \l__xpg_have_hyphen_bool
% for each hyphen in the set until we find one that works
- \clist_map_inline:Nn \l_tmpa_clist {
- \ifbool{havehyphen}{}{
+ \clist_map_inline:Nn \l_tmpa_clist
+ {
+ \bool_if:NF \l__xpg_have_hyphen_bool
+ {
% check if language hyphenname is defined
- \__xpg_check_if_exist_l@:nF{#1}{
+ \__xpg_pattern_check_if_exists:nF{#1}
+ {
% if not, first consider nohyphenation
\str_if_eq:nnTF{##1}{nohyphenation}
{
\cs_gset_eq:cc{l@#1}{l@##1}
- \global\booltrue{havehyphen}
- }{
+ \bool_gset_true:N \l__xpg_have_hyphen_bool
+ }
+ {
% then test if hyphenation is defined
- \xpg@ifdefined{##1}{
+ \xpg_if_language_defined:nT {##1}
+ {
% test if language hyphenation is nohyphenation
- \cs_if_eq:cNF{l@#1}{\l@nohyphenation}{\global\booltrue{havehyphen}}{%
+ \cs_if_eq:cNTF{l@#1}{\l@nohyphenation}
+ { \bool_gset_true:N \l__xpg_have_hyphen_bool }
+ {
% if false define language to hyphenation if it is not equal...
\str_if_eq:nnF{#1}{##1}{\cs_gset_eq:cc{l@#1}{l@##1}}
% ...and load
- \xpg@set@hyphenation@patterns{##1}
- \global\booltrue{havehyphen}
- }
- }{}
+ \xpg_set_hyphenation_patterns:n {##1}
+ \bool_gset_true:N \l__xpg_have_hyphen_bool
+ }
+ }
}
}
}
@@ -4562,19 +4705,17 @@ to track the issues and follow progress.
% if l@#1 does not yet exist,
% we assign it to nohyphenation
% we do this here in case and if the hyphennames key was omitted
- \ifbool{havehyphen}{}{
- \xpg@ifdefined{#1}{}
- {
- \xpg@nopatterns{#1}
- \expandafter\adddialect\csname l@#1\endcsname\l@nohyphenation\relax
- }
+ \bool_if:NF \l__xpg_have_hyphen_bool
+ {
+ \CheckHyphenationPatterns{#1}
}
- \csdef{#1@language}{
- \polyglossia@setup@language@patterns{#1}
+ \cs_gset:cpn {#1@language}
+ {
+ \SetupPolyglossiaLangPatterns{#1}
}
% setup hyphenmins
\clist_set:Ne \l_tmpa_clist
- { \prop_item:Nn \g_xpg_langsetup_prop {#1 / hyphenmins} }
+ { \prop_item:Nn \l_xpg_langsetup_prop {#1 / hyphenmins} }
\cs_if_eq:cNF {l@#1} \l@nohyphenation
{
\use:x
@@ -4586,7 +4727,8 @@ to track the issues and follow progress.
}
}
-\newcommand*\polyglossia@setup@language@patterns[1]{
+\NewDocumentCommand \SetupPolyglossiaLangPatterns { m }
+{
\bool_if:NTF \g__xpg_hyphenation_disabled_bool
{
\tl_gset:Ne \g__xpg_lastlanguage_tl {\the\csname l@#1\endcsname}
@@ -4600,32 +4742,29 @@ to track the issues and follow progress.
\language=\l@nohyphenation
}
{
- \xpg@set@hyphenation@patterns{#1}
+ \xpg_set_hyphenation_patterns:n {#1}
}
}
{
% Since this function is sometimes called from the gloss files
% directly, we need to check whether the requested hyphenname exists.
- \xpg@ifdefined{#1}{}
- {
- \xpg@nopatterns{#1}
- \expandafter\adddialect\csname l@#1\endcsname\l@nohyphenation\relax%
- }
- \xpg@set@hyphenation@patterns{#1}
+ \CheckHyphenationPatterns{#1}
+ \xpg_set_hyphenation_patterns:n {#1}
}
}
}
-\prop_new:N \g_xpg_langsetup_prop
+\prop_new_linked:N \l_xpg_langsetup_prop
\cs_new_protected:Npn \__xpg_keys_define_lang:n #1
{
- \keys_define:nn {polyglossia}{
+ \keys_define:nn {polyglossia}
+ {
% the script font
#1 / script
.code:n = {
- \prop_gput:Nnn{\g_xpg_langsetup_prop}{#1/script}{##1}
- \prop_gput:Nne{\g_xpg_langsetup_prop}{#1/lcscript}
+ \prop_put:Nnn \l_xpg_langsetup_prop {#1/script}{##1}
+ \prop_put:Nne \l_xpg_langsetup_prop {#1/lcscript}
{\tl_if_empty:nF{##1}{\str_lowercase:n{##1}}}
},
#1 / script
@@ -4634,84 +4773,89 @@ to track the issues and follow progress.
.initial:n = latin,
% the opentype script tag
#1 / scripttag
- .code:n = {\prop_gput:Nnn{\g_xpg_langsetup_prop}{#1/scripttag}{##1}},
+ .code:n = {\prop_put:Nnn \l_xpg_langsetup_prop {#1/scripttag}{##1}},
#1 / scripttag
.default:n = {},
#1 / scripttag
.initial:n = {},
% the language full name
#1 / language
- .code:n = {\prop_gput:Nnn{\g_xpg_langsetup_prop}{#1/language}{##1}},
+ .code:n = {\prop_put:Nnn \l_xpg_langsetup_prop {#1/language}{##1}},
#1 / language
.value_required:n = true,
#1 / language
.initial:x = {\str_uppercase:n#1},
% the language tag
#1 / langtag
- .code:n = {\prop_gput:Nnn{\g_xpg_langsetup_prop}{#1/langtag}{##1}},
+ .code:n = {\prop_put:Nnn \l_xpg_langsetup_prop {#1/langtag}{##1}},
#1 / langtag
.value_required:n = true,
#1 / langtag
.initial:n = {},
% the BCP-47 tag
#1 / bcp47
- .code:n = {\prop_gput:Nnn{\g_xpg_langsetup_prop}{#1/bcp47}{##1}},
+ .code:n = {\prop_put:Nnn \l_xpg_langsetup_prop {#1/bcp47}{##1}},
#1 / bcp47
.value_required:n = true,
#1 / bcp47
.initial:n = {},
% the BCP-47 language tag
#1 / bcp47-language
- .code:n = {\prop_gput:Nnn{\g_xpg_langsetup_prop}{#1/bcp47-language}{##1}},
+ .code:n = {\prop_put:Nnn \l_xpg_langsetup_prop {#1/bcp47-language}{##1}},
#1 / bcp47-language
.value_required:n = true,
#1 / bcp47-language
.initial:n = {},
% the BCP-47 region tag
#1 / bcp47-region
- .code:n = {\prop_gput:Nnn{\g_xpg_langsetup_prop}{#1/bcp47-region}{##1}},
+ .code:n = {\prop_put:Nnn \l_xpg_langsetup_prop {#1/bcp47-region}{##1}},
#1 / bcp47-region
.value_required:n = false,
#1 / bcp47-region
.initial:n = {},
% the BCP-47 script tag
#1 / bcp47-script
- .code:n = {\prop_gput:Nnn{\g_xpg_langsetup_prop}{#1/bcp47-script}{##1}},
+ .code:n =
+ {
+ \prop_put:Nnn \l_xpg_langsetup_prop {#1/bcp47-script}{##1}
+ \prop_put:Nne \l_xpg_langsetup_prop {#1/lc-bcp47-script}
+ {\tl_if_empty:nF{##1}{\str_lowercase:n{##1}}}
+ },
#1 / bcp47-script
.value_required:n = true,
#1 / bcp47-script
- .initial:n = {},
+ .initial:n = {Latn},
% the BCP-47 variant tag
#1 / bcp47-variant
- .code:n = {\prop_gput:Nnn{\g_xpg_langsetup_prop}{#1/bcp47-variant}{##1}},
+ .code:n = {\prop_put:Nnn \l_xpg_langsetup_prop {#1/bcp47-variant}{##1}},
#1 / bcp47-variant
.value_required:n = false,
#1 / bcp47-variant
.initial:n = {},
% the BCP-47 extension-t tag
#1 / bcp47-extension-t
- .code:n = {\prop_gput:Nnn{\g_xpg_langsetup_prop}{#1/bcp47-extension-t}{##1}},
+ .code:n = {\prop_put:Nnn \l_xpg_langsetup_prop {#1/bcp47-extension-t}{##1}},
#1 / bcp47-extension-t
.value_required:n = false,
#1 / bcp47-extension-t
.initial:n = {},
% the BCP-47 extension-u tag
#1 / bcp47-extension-u
- .code:n = {\prop_gput:Nnn{\g_xpg_langsetup_prop}{#1/bcp47-extension-u}{##1}},
+ .code:n = {\prop_put:Nnn \l_xpg_langsetup_prop {#1/bcp47-extension-u}{##1}},
#1 / bcp47-extension-u
.value_required:n = false,
#1 / bcp47-extension-u
.initial:n = {},
% the BCP-47 extension-x tag
#1 / bcp47-extension-x
- .code:n = {\prop_gput:Nnn{\g_xpg_langsetup_prop}{#1/bcp47-extension-x}{##1}},
+ .code:n = {\prop_put:Nnn \l_xpg_langsetup_prop {#1/bcp47-extension-x}{##1}},
#1 / bcp47-extension-x
.value_required:n = false,
#1 / bcp47-extension-x
.initial:n = {},
% the BCP-47 casing alias
#1 / bcp47-casing
- .code:n = {\prop_gput:Nnn{\g_xpg_langsetup_prop}{#1/bcp47-casing}{##1}},
+ .code:n = {\prop_put:Nnn \l_xpg_langsetup_prop {#1/bcp47-casing}{##1}},
#1 / bcp47-casing
.value_required:n = false,
#1 / bcp47-casing
@@ -4720,7 +4864,7 @@ to track the issues and follow progress.
#1 / hyphennames
.code:n = {
\clist_set:Nn{\l_tmpa_clist}{##1}
- \prop_gput:Nne{\g_xpg_langsetup_prop}{#1/hyphennames}{\clist_use:Nn \l_tmpa_clist {,}}
+ \prop_put:Nne \l_xpg_langsetup_prop {#1/hyphennames}{\clist_use:Nn \l_tmpa_clist {,}}
},
#1 / hyphennames
.value_required:n = true,
@@ -4733,8 +4877,8 @@ to track the issues and follow progress.
{LR}{}
{RL}{\RequireBidi}
}
- {\prop_gput:Nnn{\g_xpg_langsetup_prop}{#1/direction}{##1}}
- {\xpg@error{Unknown~ direction~ "##1"~ for~ language~ "#1"}}
+ { \prop_put:Nnn \l_xpg_langsetup_prop {#1/direction}{##1} }
+ { \xpg_error_msg:n {Unknown~ direction~ "##1"~ for~ language~ "#1"} }
},
#1 / direction
.value_required:n = true,
@@ -4745,9 +4889,9 @@ to track the issues and follow progress.
.code:n = {
% check syntax
\int_compare:nNnF { \clist_count:n {##1} } = {2}
- {\xpg@error{hypenmins~should~be~a~list~of~two~entries,~got~"##1"}}
+ { \xpg_error_msg:n {hypenmins~should~be~a~list~of~two~entries,~got~"##1"} }
% set prop
- \prop_gput:Nnn \g_xpg_langsetup_prop {#1/hyphenmins} {##1}
+ \prop_put:Nnn \l_xpg_langsetup_prop {#1/hyphenmins} {##1}
},
#1 / hyphenmins
.value_required:n = true,
@@ -4758,9 +4902,9 @@ to track the issues and follow progress.
.code:n = {
% check syntax
\int_compare:nNnF { \clist_count:n {##1} } = {1}
- {\xpg@error{totalhyphenhypenmin~should~be~a~single~entry,~got~"##1"}}
+ { \xpg_error_msg:n {totalhyphenhypenmin~should~be~a~single~entry,~got~"##1"} }
% set prop
- \prop_gput:Nnn \g_xpg_langsetup_prop {#1/totalhyphenmin} {##1}
+ \prop_put:Nnn \l_xpg_langsetup_prop {#1/totalhyphenmin} {##1}
},
#1 / totalhyphenmin
.value_required:n = false,
@@ -4779,35 +4923,35 @@ to track the issues and follow progress.
% environment name
#1 / envname
.code:n = {
- \prop_gput:Nnn{\g_xpg_langsetup_prop}{#1/envname}{##1}
+ \prop_put:Nnn \l_xpg_langsetup_prop {#1/envname}{##1}
},
#1/ envname.value_required:n = true,
#1/ envname.initial:n = {#1},
% babel name
#1 / babelname
.code:n = {
- \prop_gput:Nnn{\g_xpg_langsetup_prop}{#1/babelname}{##1}
+ \prop_put:Nnn \l_xpg_langsetup_prop {#1/babelname}{##1}
},
#1/ babelname.value_required:n = true,
#1/ babelname.initial:n = {#1},
% default numerals
#1 / localnumeral
. code:n = {
- \prop_gput:Nnn{\g_xpg_langsetup_prop}{#1/localnumeral}{##1}
- \prop_gput:Nnn{\g_xpg_langsetup_prop}{#1/Localnumeral}{##1}
+ \prop_put:Nnn \l_xpg_langsetup_prop {#1/localnumeral}{##1}
+ \prop_put:Nnn \l_xpg_langsetup_prop {#1/Localnumeral}{##1}
},
#1 / localnumeral.value_required:n = true,
- #1 / localnumeral.initial:n = {polyglossia@C@localnumeral},
+ #1 / localnumeral.initial:n = {xpg_C_localnumeral:nn},
% uppercased
#1 / Localnumeral
. code:n = {
- \prop_gput:Nnn{\g_xpg_langsetup_prop}{#1/Localnumeral}{##1}
+ \prop_put:Nnn \l_xpg_langsetup_prop {#1/Localnumeral}{##1}
},
#1 / Localnumeral.value_required:n = true,
- #1 / Localnumeral.initial:n = {polyglossia@C@localnumeral},
+ #1 / Localnumeral.initial:n = {xpg_C_localnumeral:nn},
% environment define command (by default create the environment)
#1 / DefineCommandsCmd
- .code:n = {\prop_gput:Nnn{\g_xpg_langsetup_prop}{#1/DefineCommandsCmd}{##1}},
+ .code:n = {\prop_put:Nnn \l_xpg_langsetup_prop {#1/DefineCommandsCmd}{##1}},
#1 / DefineCommandsCmd
.value_required:n = true,
#1 / DefineCommandsCmd
@@ -4815,9 +4959,20 @@ to track the issues and follow progress.
}
}
+\DeclareExpandableDocumentCommand \babelname { }
+ {
+ \prop_item:Ne \l_xpg_langsetup_prop { \languagename / babelname }
+ }
+
+\DeclareExpandableDocumentCommand \mainbabelname { }
+ {
+ \prop_item:Ne \l_xpg_langsetup_prop { \mainlanguagename / babelname }
+ }
+
% TODO move to C module
-\newcommand*{\polyglossia@C@localnumeral}[2]{
- \polyglossia@Clang@@arabic{#2}
+\cs_new:Nn \xpg_C_localnumeral:nn
+{
+ \xpg_Clang_arabic{#2}
}
\cs_new:Npn \__xpg_localnumeral_parse:nn #1 #2
@@ -4841,7 +4996,7 @@ to track the issues and follow progress.
\__xpg_localnumeral_parse:nn
} { #2 }
}
- { \use:c { \prop_item:Ne \g_xpg_langsetup_prop
+ { \use:c { \prop_item:Ne \l_xpg_langsetup_prop
{ \languagename / #3 } } { } { #1 } }
}
@@ -4876,31 +5031,31 @@ to track the issues and follow progress.
\cs_new_nopar:Npn \__xpg_indent_first:n #1
{
\bool_if:cTF { g__xpg_#1_if_bool }
- { \french@indent } { \nofrench@indent }
+ { \__xpg_french_indent: } { \__xpg_no_french_indent: }
}
\cs_new:Nn \__xpg_lang_set_par_direction:n
{
- \prop_get:NeNTF \g_xpg_langsetup_prop {#1/direction} \l_tmpa_tl
+ \prop_get:NeNTF \l_xpg_langsetup_prop {#1/direction} \l_tmpa_tl
{
\__xpg_set_par_direction:n{\l_tmpa_tl}
}
{
- \xpg@error{Could~ not~ retrieve~ key~ direction~ for~ language~ "#1"}
- \prop_show:N{\g_xpg_langsetup_prop}
+ \xpg_error_msg:n {Could~ not~ retrieve~ key~ direction~ for~ language~ "#1"}
+ \prop_show:N{\l_xpg_langsetup_prop}
}
}
\cs_new:Nn \__xpg_lang_set_text_direction:nn
{
- \prop_get:NeNTF \g_xpg_langsetup_prop {#1/direction} \l_tmpa_tl
+ \prop_get:NeNTF \l_xpg_langsetup_prop {#1/direction} \l_tmpa_tl
{
\__xpg_set_text_direction:n{\l_tmpa_tl}{#2}
}
{
- \xpg@error{Could~ not~ retrieve~ key~ direction~ for~ language~ "#1"}
- \prop_show:N{\g_xpg_langsetup_prop}
+ \xpg_error_msg:n {Could~ not~ retrieve~ key~ direction~ for~ language~ "#1"}
+ \prop_show:N{\l_xpg_langsetup_prop}
}
}
@@ -4931,7 +5086,7 @@ to track the issues and follow progress.
{
\bool_gset_true:N \g__xpg_hyphenation_disabled_bool
\tl_gset:Ne \g__xpg_lastlanguage_tl { \the\language }
- % We do not call \xpg@set@hyphenation@patterns here to avoid a warning message.
+ % We do not call \xpg_set_hyphenation_patterns:n here to avoid a warning message.
% "nohyphenation" is not listed in language.dat.lua.
\language=\l@nohyphenation
}
@@ -4943,19 +5098,19 @@ to track the issues and follow progress.
{
\bool_gset_false:N \g__xpg_hyphenation_disabled_bool
\language=\tl_use:N{\g__xpg_lastlanguage_tl}
- }%
+ }
}
\cs_new:Npn \__xpg_auto_setupfont:n #1
{
\bool_if:cTF { g__xpg_#1_fontsetup_bool }
{
- \str_if_eq:eeTF{\prop_item:Nn{\g_xpg_langsetup_prop}{#1/lcscript}}{latin}
- {\xpg@fontsetup@latin{#1}}
- {\xpg@fontsetup@nonlatin{#1}}
+ \str_if_eq:eeTF{\prop_item:Nn{\l_xpg_langsetup_prop}{#1/lcscript}}{latin}
+ {\SetupLatinPolyglossiaFont{#1}}
+ {\SetupNonLatinPolyglossiaFont{#1}}
}
{
- \xpg@info{Skipping~ automatic~ font~ setup~ for~ language~ #1}
+ \xpg_info_msg:n{Skipping~ automatic~ font~ setup~ for~ language~ #1}
}
}
@@ -4967,40 +5122,40 @@ to track the issues and follow progress.
\bool_if:nTF{\tl_if_empty_p:n{#1} || \tl_if_empty_p:n{#2}}
{
% maybe an error ?
- \xpg@warning{Asking~ to~ add~ empty~ feature~to~ main~ font~
+ \xpg_warning_msg:n{Asking~ to~ add~ empty~ feature~to~ main~ font~
(Language="#2"~ to~ langtag~ "#1")}
}
{
- \str_if_eq:nnTF{#2}{Turkish}{
+ \str_if_eq:nnTF{#2}{Turkish}
+ {
\fontspec_if_language:nTF {TRK}
{
\addfontfeature{Language=Turkish}
}
{
- \fontspec_if_language:nTF {TUR}
+ \fontspec_if_language:nT {TUR}
{
\addfontfeature{Language=Turkish}
- }{}
+ }
}
}{
- \fontspec_if_language:nTF{#1}
+ \fontspec_if_language:nT{#1}
{
\addfontfeature{Language=#2}
}
- {}
}
}
}
-\cs_generate_variant:Nn \__xpg_add_font_feature_language:nn { on , no, oo , Vn, nV, VV , xn, nx, xx}
+\cs_generate_variant:Nn \__xpg_add_font_feature_language:nn { ee }
-% add fontfeature Script=#2 to scripttag #1
-% do nothing if #1 or #2 is empty
+% add fontfeature Script=#3 to scripttag #2 for family #1
+% do nothing if #2 or #3 is empty
\cs_new:Nn \__xpg_add_font_feature_script:nnn
{
\bool_if:nTF{\tl_if_empty_p:n{#2} || \tl_if_empty_p:n{#3}}
{
% maybe an error ?
- \xpg@warning{Asking~ to~ add~ empty~ feature~to~ main~ font
+ \xpg_warning_msg:n{Asking~ to~ add~ empty~ feature~to~ main~ font
(Script="#3"~ to~ scripttag~ "#2")}
}
{
@@ -5036,118 +5191,58 @@ to track the issues and follow progress.
\regex_replace_once:nnN { \.[^\.]* \Z } { } \xpg_fname_str
% ... and, finally, quotation marks
\regex_replace_once:nnN { " } { } \xpg_fname_str
- \xpg@error{
- The~ current~ main ~ \xpg_ffamily_tl\space font,~ \xpg_fname_str,~ does~ not~ contain~ the~"#3"~ script!\MessageBreak
- Please~ define~\csname\tl_if_empty:nF{#3}{\str_lowercase:n{#3}}font\xpg_ffamilysh_tl\endcsname~
- with~ \string\newfontfamily\space command
+ \xpg_error_msg:n
+ {
+ The~ current~ main ~ \xpg_ffamily_tl\space font,~ \xpg_fname_str,~ does~ not~ contain~ the~"#3"~ script! \iow_newline:
+ Please~ define~\csname\tl_if_empty:nF{#3}{\str_lowercase:n{#3}}font\xpg_ffamilysh_tl\endcsname~
+ with~ \string\newfontfamily\space command
}
}
}
}
-\cs_generate_variant:Nn \__xpg_add_font_feature_script:nnn { non , nno, noo , nVn, nnV, nVV , nxn, nnx, nxx}
-
-\def\xpg@fontsetup@latin#1{
- \begingroup
- \csgdef{#1@font@rm}{
- \cs_if_exist_use:cF{#1font}{
- \rmfamilylatin
- \__xpg_add_font_feature_language:xx{\prop_item:Nn{\g_xpg_langsetup_prop}{#1/langtag}}
- {\prop_item:Nn{\g_xpg_langsetup_prop}{#1/language}}
- }
- }
- \csgdef{#1@font@sf}{
- \cs_if_exist_use:cF{#1fontsf}{
- \sffamilylatin
- \__xpg_add_font_feature_language:xx{\prop_item:Nn{\g_xpg_langsetup_prop}{#1/langtag}}
- {\prop_item:Nn{\g_xpg_langsetup_prop}{#1/language}}
- }
- }
- \csgdef{#1@font@tt}{
- \cs_if_exist_use:cF{#1fonttt}{
- \ttfamilylatin
- \__xpg_add_font_feature_language:xx{\prop_item:Nn{\g_xpg_langsetup_prop}{#1/langtag}}
- {\prop_item:Nn{\g_xpg_langsetup_prop}{#1/language}}
- }
- }
- \endgroup
-}
+\cs_generate_variant:Nn \__xpg_add_font_feature_script:nnn { nee }
-\def\xpg@fontsetup@nonlatin#1{
- \begingroup
- \csgdef{#1@font@rm}{
- \cs_if_exist_use:cF{#1font}
- {
- \providetoggle{#1@use@script@font}
- \str_if_eq:nnTF{\prop_item:Nn{\g_xpg_langsetup_prop}{#1/script}}{\prop_item:Nn{\g_xpg_langsetup_prop}{#1/language}}
- {\rmfamilylatin}
- {\cs_if_exist_use:cTF{\prop_item:Nn{\g_xpg_langsetup_prop}{#1/lcscript} font}
- {
- \toggletrue{#1@use@script@font}
- }
- {
- \rmfamilylatin
- }
- }
- \iftoggle{#1@use@script@font}{}{
- \__xpg_add_font_feature_script:nxx{rm}
- {\prop_item:Nn{\g_xpg_langsetup_prop}{#1/scripttag}}
- {\prop_item:Nn{\g_xpg_langsetup_prop}{#1/script}}
- }%
- \__xpg_add_font_feature_language:xx{\prop_item:Nn{\g_xpg_langsetup_prop}{#1/langtag}}
- {\prop_item:Nn{\g_xpg_langsetup_prop}{#1/language}}
- }%
- \def\familytype{rm}
- }%
- \csgdef{#1@font@sf}{
- \cs_if_exist_use:cF{#1fontsf}
+%% TODO: probably can be cleaned a little more
+\cs_new_protected:Npn \__xpg_setup_font:nnnnn #1 #2 #3 #4 #5 % #1 = lang, #2 = family, #3 = family, #4 = gobble, #5 gobble
+ {
+ \cs_set_protected_nopar:cpn { #1@font@#2 }
{
- \providetoggle{#1@use@script@fontsf}
- \str_if_eq:nnTF{\prop_item:Nn{\g_xpg_langsetup_prop}{#1/script}}{\prop_item:Nn{\g_xpg_langsetup_prop}{#1/language}}
- {\sffamilylatin}
- {\cs_if_exist_use:cTF{\prop_item:Nn{\g_xpg_langsetup_prop}{#1/lcscript} fontsf}
+ \cs_if_exist_use:cF{ #1font#3 }
{
- \toggletrue{#1@use@script@fontsf}
- }
- {
- \sffamilylatin
- }
- }
- \iftoggle{#1@use@script@fontsf}{}{
- \__xpg_add_font_feature_script:nxx{sf}
- {\prop_item:Nn{\g_xpg_langsetup_prop}{#1/scripttag}}
- {\prop_item:Nn{\g_xpg_langsetup_prop}{#1/script}}
- }%
- \__xpg_add_font_feature_language:xx{\prop_item:Nn{\g_xpg_langsetup_prop}{#1/langtag}}
- {\prop_item:Nn{\g_xpg_langsetup_prop}{#1/language}}
- }%
- \def\familytype{sf}
- }%
- \csgdef{#1@font@tt}{
- \cs_if_exist_use:cF{#1fonttt}
- {
- \providetoggle{#1@use@script@fonttt}
- \str_if_eq:nnTF{\prop_item:Nn{\g_xpg_langsetup_prop}{#1/script}}{\prop_item:Nn{\g_xpg_langsetup_prop}{#1/language}}
- {\ttfamilylatin}
- {\cs_if_exist_use:cTF{\prop_item:Nn{\g_xpg_langsetup_prop}{#1/lcscript} fonttt}
- {
- \toggletrue{#1@use@script@fonttt}
- }
- {
- \ttfamilylatin
- }
- }
- \iftoggle{#1@use@script@fonttt}{}{
- \__xpg_add_font_feature_script:nxx{tt}
- {\prop_item:Nn{\g_xpg_langsetup_prop}{#1/scripttag}}
- {\prop_item:Nn{\g_xpg_langsetup_prop}{#1/script}}
- }
- \__xpg_add_font_feature_language:xx{\prop_item:Nn{\g_xpg_langsetup_prop}{#1/langtag}}
- {\prop_item:Nn{\g_xpg_langsetup_prop}{#1/language}}
+ \cs_if_exist_use:cF { \prop_item:Nn \l_xpg_langsetup_prop { #1 / lc-bcp47-script } font#3 }
+ {
+ #4 { \prop_item:Nn \l_xpg_langsetup_prop { #1 / lcscript } font#3 }
+ {
+ \use:c { #2familylatin }
+ #5
+ {
+ \__xpg_add_font_feature_script:nee { #2 }
+ { \prop_item:Nn \l_xpg_langsetup_prop { #1 / scripttag } }
+ { \prop_item:Nn \l_xpg_langsetup_prop { #1 / script } }
+ }
+ }
+ }
+ \__xpg_add_font_feature_language:ee
+ { \prop_item:Nn \l_xpg_langsetup_prop { #1 / langtag } }
+ { \prop_item:Nn \l_xpg_langsetup_prop { #1 / language } }
+ }
+ \tl_set:Nn \familytype { #2 }
}
- \def\familytype{tt}
}
- \endgroup
-}
+
+\NewDocumentCommand \SetupLatinPolyglossiaFont { m }
+ {
+ \__xpg_setup_font:nnnnn { #1 } { rm } { } { \use_ii:nn } { \use_none:n }
+ \__xpg_setup_font:nnnnn { #1 } { sf } { sf } { \use_ii:nn } { \use_none:n }
+ \__xpg_setup_font:nnnnn { #1 } { tt } { tt } { \use_ii:nn } { \use_none:n }
+ }
+
+\NewDocumentCommand \SetupNonLatinPolyglossiaFont { m }
+ {
+ \__xpg_setup_font:nnnnn { #1 } { rm } { } { \cs_if_exist_use:cF } { \use:n }
+ \__xpg_setup_font:nnnnn { #1 } { sf } { sf } { \cs_if_exist_use:cF } { \use:n }
+ \__xpg_setup_font:nnnnn { #1 } { tt } { tt } { \cs_if_exist_use:cF } { \use:n }
+ }
%%% END OF PolyglossiaSetup
@@ -5156,40 +5251,53 @@ to track the issues and follow progress.
\cs_new_nopar:Nn \__xpg_local_marks:n { }
\cs_new_nopar:Nn \__xpg_enable_local_marks:
{
- \xpg@info{Option:~ localmarks}
+ \xpg_info_msg:n{Option:~ localmarks}
\cs_gset_nopar:Nn \__xpg_local_marks:n
{
- \def\xpg@tmp@lang{##1}
- \DeclareRobustCommand\markboth[2]{
- \begingroup
- \let\label\relax \let\index\relax \let\glossary\relax
- \unrestored@protected@xdef\@themark
- {
- {\lowercase{\foreignlanguage{\xpg@tmp@lang}}{\protect\@@ensure@maindir{####1}}}
- {\lowercase{\foreignlanguage{\xpg@tmp@lang}}{\protect\@@ensure@maindir{####2}}}
- }
- \@temptokena \expandafter{\@themark}
- \mark{\the\@temptokena}
- \endgroup
- \if@nobreak\ifvmode\nobreak\fi\fi
- }
- \DeclareRobustCommand\markright[1]{
- \begingroup
- \let\label\relax \let\index\relax \let\glossary\relax
- \expandafter\@markright\@themark
- {\lowercase{\foreignlanguage{\xpg@tmp@lang}}{\protect\@@ensure@maindir{####1}}}
- \@temptokena \expandafter{\@themark}
- \mark{\the\@temptokena}
- \endgroup
- \if@nobreak\ifvmode\nobreak\fi\fi
- }
+ \DeclareDocumentCommand \markboth { m m }
+ {
+ \group_begin:
+ \cs_set_eq:cc { label } { relax }
+ \cs_set_eq:cc { index } { relax }
+ \cs_set_eq:cc { glossary } { relax }
+ \unrestored@protected@xdef\@themark
+ {
+ {\foreignlanguage{##1}{\protect\@@ensure@maindir{####1}}}
+ {\foreignlanguage{##1}{\protect\@@ensure@maindir{####2}}}
+ }
+ \@temptokena \expandafter{\@themark}
+ \mark_insert:nn{2e-left}{####1}
+ \mark_insert:nn{2e-right}{####2}
+ \tl_if_empty:nF{####2}{ \mark_insert:nn{2e-right-nonempty}{####2} }
+ \mark{\the\@temptokena}
+ \group_end:
+ \if@nobreak\ifvmode\nobreak\fi\fi
+ }
+ \DeclareDocumentCommand \markright { m }
+ {
+ \group_begin:
+ \cs_set_eq:cc { label } { relax }
+ \cs_set_eq:cc { index } { relax }
+ \cs_set_eq:cc { glossary } { relax }
+ \expandafter\@markright\@themark
+ {\foreignlanguage{##1}{\protect\@@ensure@maindir{####1}}}
+ \@temptokena \expandafter{\@themark}
+ \mark_insert:nn{2e-right}{####1}
+ \tl_if_empty:nF{####1}{ \mark_insert:nn{2e-right-nonempty}{####1} }
+ \mark{\the\@temptokena}
+ \group_end:
+ \if@nobreak\ifvmode\nobreak\fi\fi
+ }
}
}
%we call this macro when a gloss file is not found for a given language
-\def\xpg@nogloss#1{
- \xpg@warning{File~ gloss-#1.ldf~ do~ not~ exists!\MessageBreak
- I~ will~ nevertheless~ try~ to~ use~ hyphenation~ patterns~ for~ #1.}
+\cs_new_nopar:Nn \__xpg_no_gloss:n
+{
+ \xpg_warning_msg:n
+ {File~ gloss-#1.ldf~ do~ not~ exists! \iow_newline:
+ I~ will~ nevertheless~ try~ to~ use~ hyphenation~ patterns~ for~ #1.}
+
\PolyglossiaSetup{#1}{hyphenmins={2,3},hyphennames={#1},fontsetup=true}
% the above amounts to:
%\ifcsundef{l@#1}%
@@ -5198,59 +5306,64 @@ to track the issues and follow progress.
%\csdef{#1@language}{\language=\csname l@#1\endcsname}%
}
-\newcommand{\xpg@input}[1]{
+\cs_new_nopar:Nn \xpg_input:n
+{
% Store catcode of @ before making at letter
- \chardef\xpg@saved@at@catcode\catcode`\@
- \makeatletter
- \input{#1}
+ \cs_set_protected_nopar:Npx \__xpg_restore_at_catcode:
+ { \char_set_catcode:nn { `@ } { \char_value_catcode:n {`\@ } } }
+ \char_set_catcode_letter:N @
+ \file_input:n { #1 }
% restore former @ catcode
- \catcode`\@=\xpg@saved@at@catcode
+ \__xpg_restore_at_catcode:
}
% try to load a language file
-\cs_new:Nn \__xpg_load_lang_definition:nn {
- \file_if_exist:nTF{gloss-#2.ldf}
+\cs_new:Nn \__xpg_load_lang_definition:nn
+{
+ \file_if_exist:nTF{gloss-#2.ldf}
{
- % Temporarily force catcode of ~ to 13 since babelsh.def
+ \tl_set:Nn \xpg__tmp_default_options_tl { #1 }
+ % Temporarily force catcode of ~ to 13 (active) since babelsh.def
% requires it. This is needed particularly with LaTeX3
% packages which force \ExplSyntaxOn (#425)
- \protected\edef\xpg@restore@tilde@catcode{\catcode 126 = \the\catcode 126\relax}
- \catcode 126 = 13
- \xpg@input{gloss-#2.ldf}
- \setkeys{#2}{#1}
+ \cs_gset_protected:Npx \__xpg_restore_tilde_catcode:
+ { \char_set_catcode:nn { 126 } { \char_value_catcode:n { 126 } } }
+ \char_set_catcode_active:n { 126 }
+ \xpg_input:n {gloss-#2.ldf}
% restore former ~ catcode
- \xpg@restore@tilde@catcode
+ \__xpg_restore_tilde_catcode:
}
{
- \xpg@nogloss{#2}
+ \__xpg_no_gloss:n {#2}
}
}
\cs_generate_variant:Nn \__xpg_load_lang_definition:nn { ee }
% load a master language from an alias file
-\newcommand*\xpg@load@master@language[1] {
- \xpg@input{gloss-#1.ldf}
+\NewDocumentCommand \InheritGlossFile { m }
+{
\seq_if_in:NeF \__xpg_langs_loaded {#1}
{
+ \xpg_input:n {gloss-#1.ldf}
% define environment and command if not alias
\str_if_eq:eeT {\prop_item:Ne \__xpg_alias {#1/target}} {#1} {
- \use:c{\prop_item:Nn{\g_xpg_langsetup_prop}
+ \use:c{\prop_item:Nn{\l_xpg_langsetup_prop}
{#1/DefineCommandsCmd}}
{#1}
}
+ \seq_gput_right:Nn \__xpg_langs_loaded {#1}
}
\__xpg_register_language:nn{}{#1}
- \seq_gput_right:Nn \__xpg_langs_loaded {#1}
}
-\prop_new:N \__xpg_alias
+\prop_new_linked:N \__xpg_alias
% define environment and command if not alias
\cs_new:Nn \xpg_define_language_commands:n {
\str_if_eq:eeT {\prop_item:Ne \__xpg_alias {#1/target}} {#1}
{
\exp_args:Ne
- \NewDocumentEnvironment {\prop_item:Nn{\g_xpg_langsetup_prop}{#1/envname}} { O{} }
+ \NewDocumentEnvironment {\prop_item:Nn{\l_xpg_langsetup_prop}{#1/envname}} { O{} }
{
\otherlanguage [ ##1 ] { #1 }
}
@@ -5278,7 +5391,7 @@ to track the issues and follow progress.
% target to self fall back to language table
\str_if_eq:eeTF { \prop_item:Ne \__xpg_alias {#1/target} } { #1 }
{
- \prop_item:Nn{\g_xpg_langsetup_prop} {#1/#2}
+ \prop_item:Nn{\l_xpg_langsetup_prop} {#1/#2}
}
% load alias by recursion
{
@@ -5401,20 +5514,29 @@ to track the issues and follow progress.
\clist_if_in:NeF \xpg@loaded {#2}{
\clist_gput_right:Ne \xpg@loaded {#2}
}
- % Register the language options
- \__xpg_set_language_options:nnn {#2} {#1} {@xpg@set@langvariant}
+ \group_begin:
+ % set language options
+ \__xpg_set_language_options:nn {#2} {#1}
% register babelname
- \prop_get:NeN \g_xpg_langsetup_prop {#2/babelname} \l_tmpa_tl
+ \prop_get:NeN \l_xpg_langsetup_prop {#2/babelname} \l_tmpa_tl
\clist_if_in:NeF \xpg@bloaded {\l_tmpa_tl}{
\clist_gput_right:Ne \xpg@bloaded {\l_tmpa_tl}
}
% register BCP-47 ID
- \prop_get:NeN \g_xpg_langsetup_prop {#2/bcp47} \l_tmpa_tl
+ \prop_get:NeN \l_xpg_langsetup_prop {#2/bcp47} \l_tmpa_tl
\clist_if_in:NeF \xpg@bcp@loaded {\l_tmpa_tl}{
\clist_gput_right:Ne \xpg@bcp@loaded {\l_tmpa_tl}
}
+ % register variant
+ \prop_get:NnNT \l_xpg_curropt_prop {#2/variant} \l_tmpa_tl {
+ \clist_if_in:NeF \xpg@vloaded {\l_tmpa_tl}{
+ \clist_gput_right:Ne \xpg@vloaded {\l_tmpa_tl}
+ }}
+ \group_end:
}
+\prop_new_linked:N \l_xpg_curropt_prop
+
\DeclareDocumentCommand \setdefaultlanguage { O{} m }
{
% latex is an internal language, so do not record
@@ -5429,12 +5551,13 @@ to track the issues and follow progress.
\__xpg_load_lang_definition:nn{#1}{#2}
% define environment and command if not alias
\str_if_eq:eeT {\prop_item:Ne \__xpg_alias {#2/target}} {#2} {
- \use:c{\prop_item:Ne{\g_xpg_langsetup_prop}
+ \use:c{\prop_item:Ne{\l_xpg_langsetup_prop}
{#2/DefineCommandsCmd}}
{#2}
}
\seq_gput_right:Ne \__xpg_langs_loaded {#2}
}
+ \cs_set_nopar:Npe \mainlanguagevariant { \prop_item:Ne \l_xpg_curropt_prop { \xpg_alias_base_lang:n{#2} / variant } }
\exp_args:Nee \__xpg_set_default_language:nn {\xpg_alias_add_to_option_i:nn{#2}{#1}}
{\xpg_alias_base_lang:n{#2}}
}
@@ -5442,70 +5565,22 @@ to track the issues and follow progress.
\cs_new:Nn \__xpg_set_default_language:nn
{
- \gdef\xpg@main@language{#2}
- \tl_if_blank:nTF {#1}
- {
- \cs_gset_nopar:Npn \mainlanguagevariant {}
- }
- {
- % Register the language options
- \__xpg_set_language_options:nnn {#2} {#1} {@xpg@main@langvariant}
- }
- \csgdef{#2@gvar}{\mainlanguagevariant}
+ \tl_gset:Nn \xpg_main_language_tl {#2}
%% The following settings are for the default language and script
% this tells bidi.sty or luabidi.sty that the document is RTL
- \__xpg_if_LR_str:eF{\prop_item:Nn{\g_xpg_langsetup_prop}{#2/direction}}
+ \__xpg_if_LR_str:eF{\prop_item:Nn{\l_xpg_langsetup_prop}{#2/direction}}
{
\__xpg_setRTLmain:
}
\cs_gset_nopar:Nn \__xpg_at_begin_document_selectlanguage: {
\selectbackgroundlanguage{#2}
- \selectlanguage[#1]{#2}%
+ \selectlanguage[#1]{#2}
}
- \xpg@info{Default~ language~ is~ #2}
- \polyglossia@set@language@name[#1]{#2}
+ \str_if_eq:eeF { #2 } { latex }
+ { \xpg_info_msg:n{Default~ language~ is~ #2} }
+ \xpg_set_language_name:n { #2 }
\cs_gset_nopar:Npn \mainlanguagename {#2}
- % Store babelname of main language (for external packages such as biblatex)
- \cs_gset_nopar:Npe \mainbabelname { \prop_item:Nn \g_xpg_langsetup_prop {#2/babelname} }
- % Store babelname of current language (for external packages such as biblatex)
- \cs_gset_eq:NN \babelname \mainbabelname
- \cs_gset_eq:cc{#2@gbabelname}{babelname}%
- % Store BCP-47 ID and subtags of main language:
- % 1. store main.* (sub)tags
- \cs_gset_nopar:cpe {bcp47.main.tag} { \prop_item:Nn \g_xpg_langsetup_prop { #2 / bcp47 } }
- \cs_gset_nopar:cpe {bcp47.main.language} { \prop_item:Nn \g_xpg_langsetup_prop { #2 / bcp47-language } }
- \cs_gset_nopar:cpe {bcp47.main.region} { \prop_item:Nn \g_xpg_langsetup_prop { #2 / bcp47-region } }
- \cs_gset_nopar:cpe {bcp47.main.script} { \prop_item:Nn \g_xpg_langsetup_prop { #2 / bcp47-script } }
- \cs_gset_nopar:cpe {bcp47.main.variant} { \prop_item:Nn \g_xpg_langsetup_prop { #2 / bcp47-variant } }
- \cs_gset_nopar:cpe {bcp47.main.extension.t} { \prop_item:Nn \g_xpg_langsetup_prop { #2 / bcp47extension-t } }
- \cs_gset_nopar:cpe {bcp47.main.extension.u} { \prop_item:Nn \g_xpg_langsetup_prop { #2 / bcp47-extension-u } }
- \cs_gset_nopar:cpe {bcp47.main.extension.x} { \prop_item:Nn \g_xpg_langsetup_prop { #2 / bcp47-extension-x } }
- % For casing, we fall back to language if bcp47-casing is not explicitly set
- \cs_set_nopar:cpx {tmpcasing} { \prop_item:Ne \g_xpg_langsetup_prop { #2 / bcp47-casing } }
- \str_if_empty:NTF \tmpcasing
- { \cs_gset_nopar:cpe {bcp47.main.casing} { \prop_item:Nn \g_xpg_langsetup_prop {#2 / bcp47-language} } }
- { \cs_gset_nopar:cpe {bcp47.main.casing} { \tmpcasing } }
- % 2. Store lang (sub)tags
- \cs_gset_eq:cc {bcp47.tag} {bcp47.main.tag}
- \cs_gset_eq:cc {bcp47.language} {bcp47.main.language}
- \cs_gset_eq:cc {bcp47.region} {bcp47.main.region}
- \cs_gset_eq:cc {bcp47.script} {bcp47.main.script}
- \cs_gset_eq:cc {bcp47.variant} {bcp47.main.variant}
- \cs_gset_eq:cc {bcp47.extension.t} {bcp47.main.extension.t}
- \cs_gset_eq:cc {bcp47.extension.u} {bcp47.main.extension.u}
- \cs_gset_eq:cc {bcp47.extension.x} {bcp47.main.extension.x}
- \cs_gset_eq:cc {bcp47.casing} {bcp47.main.casing}
- % 3. Store global language BCP47 settings (with default subtags as set by main language options)
- \cs_gset_eq:cc{#2@g.bcp47.tag}{bcp47.tag}
- \cs_gset_eq:cc{#2@g.bcp47.language}{bcp47.language}
- \cs_gset_eq:cc{#2@g.bcp47.region}{bcp47.region}
- \cs_gset_eq:cc{#2@g.bcp47.script}{bcp47.script}
- \cs_gset_eq:cc{#2@g.bcp47.variant}{bcp47.variant}
- \cs_gset_eq:cc{#2@g.bcp47.extension.t}{bcp47.extension.t}
- \cs_gset_eq:cc{#2@g.bcp47.extension.u}{bcp47.extension.u}
- \cs_gset_eq:cc{#2@g.bcp47.extension.x}{bcp47.extension.x}
- \cs_gset_eq:cc{#2@g.bcp47.casing}{bcp47.casing}
}
\DeclareCommandCopy \setmainlanguage \setdefaultlanguage
@@ -5516,11 +5591,11 @@ to track the issues and follow progress.
{
\str_case:nnF {#1}
{
- {bcp-47} { \csuse{bcp47.tag} }
- {bcp47} { \csuse{bcp47.tag} }
+ {bcp-47} { \use:c{bcp47.tag} }
+ {bcp47} { \use:c{bcp47.tag} }
}
{
- \xpg@error{Invalid~ \string\languageid\space argument:~ #1}
+ \xpg_ill_arg_msg:nn { #1 } { \languageid }
}
}
@@ -5530,11 +5605,11 @@ to track the issues and follow progress.
{
\str_case:nnF {#1}
{
- {bcp-47} { \csuse{bcp47.main.tag} }
- {bcp47} { \csuse{bcp47.main.tag} }
+ {bcp-47} { \use:c{bcp47.main.tag} }
+ {bcp47} { \use:c{bcp47.main.tag} }
}
{
- \xpg@error{Invalid~ \string\mainlanguageid\space argument:~ #1}
+ \xpg_ill_arg_msg:nn { #1 } { \mainlanguageid }
}
}
% Kernel command to access to BCP-47 data.
@@ -5554,281 +5629,205 @@ to track the issues and follow progress.
% and main.* variants thereof
% See https://github.com/latex3/latex2e/issues/1035
\DeclareExpandableDocumentCommand \BCPdata {m}
+ {
+ \cs_if_exist_use:cF{bcp47.#1}
+ { \xpg_ill_arg_msg:nn { #1 } { \BCPdata } }
+ }
+
+\clist_map_inline:nn
+ {
+ language, region, script, variant,
+ extension.t, extension.u, extension.x
+ }{
+ \tl_set:Nn \l_tmpa_tl { #1 }
+ \tl_replace_once:Nnn \l_tmpa_tl { . } { - }
+ \cs_gset_nopar:cpe { bcp47.#1 }
+ {
+ \exp_not:n { \prop_item:Ne \l_xpg_langsetup_prop } { \exp_not:N \languagename / bcp47-\l_tmpa_tl }
+ }
+ \cs_gset_nopar:cpe { bcp47.main.#1 }
+ {
+ \exp_not:n { \prop_item:Ne \l_xpg_langsetup_prop } { \exp_not:N \mainlanguagename / bcp47-\l_tmpa_tl }
+ }
+ }
+\cs_gset_nopar:cpn { bcp47.casing }
+ {
+ \tl_if_empty:eTF { \prop_item:Ne \l_xpg_langsetup_prop { \languagename / bcp47-casing } }
+ {
+ \prop_item:Ne \l_xpg_langsetup_prop { \languagename / bcp47-language }
+ }{
+ \prop_item:Ne \l_xpg_langsetup_prop { \languagename / bcp47-casing }
+ }
+ }
+\cs_gset_nopar:cpn { bcp47.main.casing }
+ {
+ \tl_if_empty:eTF { \prop_item:Ne \l_xpg_langsetup_prop { \mainlanguagename / bcp47-casing } }
+ {
+ \prop_item:Ne \l_xpg_langsetup_prop { \mainlanguagename / bcp47-language }
+ }{
+ \prop_item:Ne \l_xpg_langsetup_prop { \mainlanguagename / bcp47-casing }
+ }
+ }
+\cs_gset_nopar:cpn { bcp47.tag }
+ {
+ \prop_item:Ne \l_xpg_langsetup_prop { \languagename / bcp47 }
+ }
+\cs_gset_nopar:cpn { bcp47.main.tag }
+ {
+ \prop_item:Ne \l_xpg_langsetup_prop { \mainlanguagename / bcp47 }
+ }
+
+\cs_new_nopar:Npn \languagevariant
+ {
+ \prop_item:Ne \l_xpg_curropt_prop { \languagename / variant }
+ }
+
+\cs_new:Nn \xpg_set_language_name:n
{
- \cs_if_exist_use:cF{bcp47.#1}
- { \xpg@error{Invalid~ \string\BCPdata\space argument:~ #1} }
-}
-
-% main babel name
-\cs_new_nopar:Npn \mainlanguagename {}
-\cs_new_nopar:Npn \mainbabelname {}
-\cs_new_nopar:cpn {bcp47.main.tag} {}
-\cs_new_nopar:cpn {bcp47.main.language} {}
-\cs_new_nopar:cpn {bcp47.main.region} {}
-\cs_new_nopar:cpn {bcp47.main.script} {}
-\cs_new_nopar:cpn {bcp47.main.variant} {}
-\cs_new_nopar:cpn {bcp47.main.extension.t} {}
-\cs_new_nopar:cpn {bcp47.main.extension.u} {}
-\cs_new_nopar:cpn {bcp47.main.extension.x} {}
-\cs_new_nopar:cpn {bcp47.main.casing} {}
-\cs_new_nopar:Npn \mainlanguagevariant {}%
-% Store main language variant for external packages
-\define@key{xpg@main@langvariant}{variant}{
- \cs_gset_nopar:Npn \mainlanguagevariant {#1}
-}
-
-\cs_new_nopar:Npn \babelname {}
-\def\languagevariant{}
-% Store current language variant for external packages
-\define@key{xpg@set@langvariant}{variant}{
- \def\languagevariant{#1}
-}
-
-\newcommand*\polyglossia@set@language@name[2][]{
- \def\languagename{#2}
- \tl_if_blank:nTF {#1}{
- \ifcsundef{#2@gvar}{\def\languagevariant{}}{\def\languagevariant{\csuse{#2@gvar}}}
- }{
- % Register the language options
- \__xpg_set_language_options:nnn {#2} {#1} {@xpg@set@langvariant}
- \cs_set_eq:cc{#2@var}{languagevariant}
- }%
+ \cs_set:Npn \languagename { #1 }
}
-
-\newcommand*{\resetdefaultlanguage}[2][]{
+\NewDocumentCommand \resetdefaultlanguage { O{} m }
+{
\__xpg_reset_default_language:nn
{\xpg_alias_add_to_option_i:nn{#2}{#1}}
{\xpg_alias_base_lang:n{#2}}
}
-\cs_new:Nn \__xpg_store_bcp_info:nn
-{
- % Store BCP-47 ID and subtags of current language
- \tl_if_blank:nTF {#1}{
- % tag (e.g., en-US)
- \ifcsundef{#2@g.bcp47.tag}{
- \csedef{bcp47.tag}{ \prop_item:Nn{ \g_xpg_langsetup_prop}{ #2 / bcp47 } }
- }{
- \csedef{bcp47.tag}{\csuse{#2@g.bcp47.tag}}
- }
- % language (e.g., en)
- \ifcsundef{#2@g.bcp47.language}{
- \csedef{bcp47.language}{ \prop_item:Nn{ \g_xpg_langsetup_prop}{ #2 / bcp47-language } }
- }{
- \csedef{bcp47.language}{\csuse{#2@g.bcp47.language}}
- }
- % region (e.g., US)
- \ifcsundef{#2@g.bcp47.region}{%
- \csedef{bcp47.region}{ \prop_item:Nn{ \g_xpg_langsetup_prop}{ #2 / bcp47-region } }
- }{
- \csedef{bcp47.region}{\csuse{#2@g.bcp47.region}}%
- }
- % script (e.g., Latn)
- \ifcsundef{#2@g.bcp47.script}{
- \csedef{bcp47.script}{ \prop_item:Nn{ \g_xpg_langsetup_prop}{ #2 / bcp47-script } }
- }{
- \csedef{bcp47.script}{\csuse{#2@g.bcp47.script}}
- }
- % variant (e.g., 1996)
- \ifcsundef{#2@g.bcp47.variant}{
- \csedef{bcp47.variant}{ \prop_item:Nn{ \g_xpg_langsetup_prop}{ #2 / bcp47-variant } }
- }{
- \csedef{bcp47.variant}{\csuse{#2@g.bcp47.variant}}
- }
- % extension.t (tranformation)
- \ifcsundef{#2@g.bcp47.extension.t}{%
- \csedef{bcp47.extension.t}{ \prop_item:Nn{ \g_xpg_langsetup_prop}{ #2 / bcp47-extension-t } }
- }{
- \csedef{bcp47.extension.t}{\csuse{#2@g.bcp47.extension.t}}
- }
- % extension.u (additional locale information)
- \ifcsundef{#2@g.bcp47.extension.u}{%
- \csedef{bcp47.extension.u}{ \prop_item:Nn{ \g_xpg_langsetup_prop}{ #2 / bcp47-extension-u } }
- }{
- \csedef{bcp47.extension.u}{\csuse{#2@g.bcp47.extension.u}}
- }
- % extension.x (private use area)
- \ifcsundef{#2@g.bcp47.extension.x}{
- \csedef{bcp47.extension.x}{ \prop_item:Nn{ \g_xpg_langsetup_prop}{ #2 / bcp47-extension-x } }
- }{
- \csedef{bcp47.extension.x}{\csuse{#2@g.bcp47.extension.x}}
- }
- % casing
- \ifcsundef{#2@g.bcp47.casing}{
- % For casing, we fall back to language if bcp47-casing is not explicitly set
- \cs_set_nopar:cpx {tmpcasing} { \prop_item:Ne \g_xpg_langsetup_prop { #2 / bcp47-casing } }
- \str_if_empty:NTF \tmpcasing
- { \cs_gset_eq:cc {bcp47.casing} {bcp47.language} }
- { \csedef{bcp47.casing}{ \tmpcasing } }
- }{
- \csedef{bcp47.casing}{\csuse{#2@g.bcp47.casing}}
- }
- }{
- \csedef{bcp47.tag}{ \prop_item:Nn{ \g_xpg_langsetup_prop}{ #2 / bcp47 } }
- \csedef{bcp47.language}{ \prop_item:Nn{ \g_xpg_langsetup_prop}{ #2 / bcp47-language } }
- \csedef{bcp47.region}{ \prop_item:Nn{ \g_xpg_langsetup_prop}{ #2 / bcp47-region } }
- \csedef{bcp47.script}{ \prop_item:Nn{ \g_xpg_langsetup_prop}{ #2 / bcp47-script } }
- \csedef{bcp47.variant}{ \prop_item:Nn{ \g_xpg_langsetup_prop}{ #2 / bcp47-variant } }
- \csedef{bcp47.extension.t}{ \prop_item:Nn{ \g_xpg_langsetup_prop}{ #2 / bcp47-extension-t } }
- \csedef{bcp47.extension.u}{ \prop_item:Nn{ \g_xpg_langsetup_prop}{ #2 / bcp47-extension-u } }
- \csedef{bcp47.extension.x}{ \prop_item:Nn{ \g_xpg_langsetup_prop}{ #2 / bcp47-extension-x } }
- % For casing, we fall back to language if bcp47-casing is not explicitly set
- \cs_set_nopar:cpx {tmpcasing} { \prop_item:Ne \g_xpg_langsetup_prop { #2 / bcp47-casing } }
- \str_if_empty:NTF \tmpcasing
- { \cs_gset_eq:cc {bcp47.casing} {bcp47.language} }
- { \csedef{bcp47.casing}{ \tmpcasing } }
- }
-}
-
\cs_new:Nn \__xpg_reset_default_language:nn
{
\xpg_error_if_lang_not_loaded:n{#2}
% disable globalnumbers of previously defined default language
- \csuse{no\xpg@main@language @globalnumbers}
- \csuse{noextras@\xpg@main@language}%
+ \use:c{no\xpg_main_language_tl @globalnumbers}
+ \use:c{noextras@\xpg_main_language_tl}
% This is a hook for external packages which want to access variants
% via babelname (such as biblatex)
- \cs_if_exist_use:c{noextras@bbl@\mainbabelname}%
- \csuse{init@noextras@\xpg@main@language}%
- \polyglossia@set@language@name[#1]{#2}%
- \__xpg_if_LR_str:eF{\prop_item:Ne{\g_xpg_langsetup_prop}{#2/direction}}
+ \cs_if_exist_use:c{noextras@bbl@\mainbabelname}
+ \use:c{init@noextras@\xpg_main_language_tl}
+ \xpg_set_language_name:n { #2 }
+ \__xpg_if_LR_str:eF{\prop_item:Ne{\l_xpg_langsetup_prop}{#2/direction}}
{
\@rlmaintrue\@rl@footnotetrue
}
- \selectlanguage[#1]{#2}%
- \selectbackgroundlanguage{#2}%
- % Store babelname of current language (for external packages such as biblatex)
- \tl_if_blank:nTF {#1}{%
- \ifcsundef{#2@gbabelname}{
- \edef\babelname{\prop_item:Nn{\g_xpg_langsetup_prop}{#2/babelname}}
- }{
- \edef\babelname{\csuse{#2@gbabelname}}
- }
- }{
- \edef\babelname{\prop_item:Nn{\g_xpg_langsetup_prop}{#2/babelname}}
- }
- % Store variant
- \tl_if_blank:nTF {#1}
- {
- \cs_gset_nopar:Npn \mainlanguagevariant {}
- }
- {
- % Register the language options
- \__xpg_set_language_options:nnn {#2} {#1} {@xpg@main@langvariant}
- }
- \csgdef{#2@gvar}{\mainlanguagevariant}
- % Store BCP-47 id of current language
- \__xpg_store_bcp_info:nn {#1}{#2}
+ \selectlanguage[#1]{#2}
+ \selectbackgroundlanguage{#2}
+ \cs_set_nopar:Npe \mainlanguagevariant { \prop_item:Ne \l_xpg_curropt_prop { \xpg_alias_base_lang:n{#2} / variant } }
}
% This saves the normalfont for the latin script since we may change normalfont in other scripts
-\let\normalfontlatin=\normalfont
+\cs_set_eq:cc { normalfontlatin } { normalfont }
% Provide default fonts (as set with \setmainfont, \setsansfont and \setmonofont)
% for Latin scripts and as a fallback for non-Latin scripts.
-\DeclareRobustCommand\xpg@defaultfont@rm{
+\cs_set_protected:Nn \xpg_defaultfont_rm:
+{
\tl_if_empty:NF{\g__fontspec_nfss_enc_tl}{\fontencoding{\g__fontspec_nfss_enc_tl}}
\fontfamily\rmdefault
- \ifdefined\UseHook\UseHook{rmfamily}\fi
+ \hook_use:n { rmfamily }
\selectfont
}
-\DeclareRobustCommand\xpg@defaultfont@sf{
+
+\cs_set_protected:Nn \xpg_defaultfont_sf:
+{
\tl_if_empty:NF{\g__fontspec_nfss_enc_tl}{\fontencoding{\g__fontspec_nfss_enc_tl}}
\fontfamily\sfdefault
- \ifdefined\UseHook\UseHook{sffamily}\fi
+ \hook_use:n { sffamily }
\selectfont
}
-\DeclareRobustCommand\xpg@defaultfont@tt{
+
+\cs_set_protected:Nn \xpg_defaultfont_tt:
+{
\tl_if_empty:NF{\g__fontspec_nfss_enc_tl}{\fontencoding{\g__fontspec_nfss_enc_tl}}
\fontfamily\ttdefault
- \ifdefined\UseHook\UseHook{ttfamily}\fi
+ \hook_use:n { ttfamily }
\selectfont
}
-\def\xpg@patch@fontfamilies{
+\cs_new:Nn \__xpg_patch_fontfamilies:
+{
% This robustifies the redefinitions of \<xx>family (suggestion by Enrico Gregorio)
% e.g. to prevent expansion of the \familytype redefinition in auxiliary files
- \csgappto{rmfamily~}{\def\familytype{rm}}
- \csgappto{sffamily~}{\def\familytype{sf}}
- \csgappto{ttfamily~}{\def\familytype{tt}}
+ \tl_put_right:cn {rmfamily~} {\tl_set:Nn \familytype {rm}}
+ \tl_put_right:cn {sffamily~} {\tl_set:Nn \familytype {sf}}
+ \tl_put_right:cn {ttfamily~} {\tl_set:Nn \familytype {tt}}
}
% These switches activate the default fonts
% Note that a simple \let\rmfamilylatin=\rmfamily
% does not work reliably (see #24)
-\cs_gset_eq:cc{rmfamilylatin}{xpg@defaultfont@rm}
-\cs_gset_eq:cc{sffamilylatin}{xpg@defaultfont@sf}
-\cs_gset_eq:cc{ttfamilylatin}{xpg@defaultfont@tt}
-
-\def\xpg@set@familydefault{
- % We need the \edef route here in order
- % to detect both \renewcommand and \let
- % changes.
- \edef\tempa{\familydefault}
- \edef\tempb{\sfdefault}
- \ifcsequal{tempa}{tempb}
- {\def\familytype{sf}}
- {\edef\tempb{\ttdefault}
- \ifcsequal{tempa}{tempb}
- {\def\familytype{tt}}
- {\def\familytype{rm}}}
- \xpg@patch@fontfamilies
+\cs_set_eq:cc{rmfamilylatin}{xpg_defaultfont_rm:}
+\cs_set_eq:cc{sffamilylatin}{xpg_defaultfont_sf:}
+\cs_set_eq:cc{ttfamilylatin}{xpg_defaultfont_tt:}
+
+\cs_new:Nn \xpg_set_familydefault:
+{
+ \tl_set:Ne \l_tmpa_tl { \familydefault }
+ \tl_set:Ne \l_tmpb_tl { \sfdefault }
+ \tl_if_eq:NNTF \l_tmpa_tl \l_tmpb_tl
+ { \tl_set:Nn \familytype {sf} }
+ { \tl_set_eq:NN \l_tmpb_tl \ttdefault
+ \tl_if_eq:NNTF \l_tmpa_tl \l_tmpb_tl
+ { \tl_set:Nn \familytype {tt} }
+ { \tl_set:Nn \familytype {rm} }
+ }
+ \__xpg_patch_fontfamilies:
% This (re-)saves the normalfont for the latin script since we may
% change normalfont in other scripts
- \let\normalfontlatin=\normalfont
+ \cs_set_eq:cc{ normalfontlatin }{ normalfont }
% And for all cases, we also reset \<xx>familylatin
- \cs_gset_eq:cc{rmfamilylatin}{xpg@defaultfont@rm}
- \cs_gset_eq:cc{sffamilylatin}{xpg@defaultfont@sf}
- \cs_gset_eq:cc{ttfamilylatin}{xpg@defaultfont@tt}
-}
-
-\def\resetfontlatin{
- \DeclareRobustCommand\rmfamily{\xpg@defaultfont@rm}
- \DeclareRobustCommand\sffamily{\xpg@defaultfont@sf}
- \DeclareRobustCommand\ttfamily{\xpg@defaultfont@tt}
- \xpg@patch@fontfamilies
- \global\let\normalfont=\normalfontlatin
-}
-
-\def\selectfontfamilylatin{
- \def\tmp@tt{tt}\def\tmp@sf{sf}
- \ifx\familytype\tmp@tt
- \ttfamilylatin
- \else\ifx\familytype\tmp@sf
- \sffamilylatin
- \else\rmfamilylatin\fi\fi}
-
-\def\xpg@select@fontfamily#1{
- \def\tmp@tt{tt}\def\tmp@sf{sf}
- \ifx\familytype\tmp@tt
- \__xpg_use_or_warn:c{#1@font@tt}
- \else\ifx\familytype\tmp@sf
- \__xpg_use_or_warn:c{#1@font@sf}
- \else\__xpg_use_or_warn:c{#1@font@rm}\fi\fi}
-
-\def\xpg@set@normalfont#1{
- \letcs{\rmfamily}{#1@font@rm}
- \letcs{\sffamily}{#1@font@sf}
- \letcs{\ttfamily}{#1@font@tt}
- \robustify\rmfamily
- \robustify\sffamily
- \robustify\ttfamily
- \gdef\normalfont{\protect\xpg@select@fontfamily{#1}
- \fontseries{\seriesdefault}\selectfont
- \fontshape{\shapedefault}
- \ifdefined\UseHook\UseHook{normalfont}\fi
- \selectfont}
- \gdef\reset@font{\protect\normalfont}
-}
-
-\let\@@fterindentfalse\@afterindentfalse
-\def\french@indent{
- \let\@afterindentfalse\@afterindenttrue
+ \cs_set_eq:cc{ rmfamilylatin }{ xpg_defaultfont_rm: }
+ \cs_set_eq:cc{ sffamilylatin }{ xpg_defaultfont_sf: }
+ \cs_set_eq:cc{ ttfamilylatin }{ xpg_defaultfont_tt: }
+}
+
+\cs_set_nopar:Nn \xpg_select_fontfamily:n
+{
+ \str_if_eq:VnTF \familytype { tt }
+ { \__xpg_use_or_warn:c { #1@font@tt } }
+ { \str_if_eq:VnTF \familytype { sf }
+ { \__xpg_use_or_warn:c { #1@font@sf } }
+ { \__xpg_use_or_warn:c { #1@font@rm } }
+ }
+}
+
+\cs_set_protected:Npn \xpg_select_default_fontfamily:n #1
+ {
+ \tl_set:Ne \l_tmpa_tl { \familydefault }
+ \tl_set:Ne \l_tmpb_tl { \sfdefault }
+ \tl_if_eq:NNTF \l_tmpa_tl \l_tmpb_tl
+ { \tl_set:Nn \familytype {sf} }
+ { \tl_set_eq:NN \l_tmpb_tl \ttdefault
+ \tl_if_eq:NNTF \l_tmpa_tl \l_tmpb_tl
+ { \tl_set:Nn \familytype {tt} }
+ { \tl_set:Nn \familytype {rm} }
+ }
+ \xpg_select_fontfamily:n{#1}
+ }
+
+\cs_new_nopar:Nn \xpg_set_normalfont:n
+{
+ \cs_set_eq:cc { rmfamily } { #1@font@rm }
+ \cs_set_eq:cc { sffamily } { #1@font@sf }
+ \cs_set_eq:cc { ttfamily } { #1@font@tt }
+ \cs_set_nopar:Npn \normalfont
+ { \xpg_select_default_fontfamily:n {#1}
+ \fontseries{\seriesdefault}\selectfont
+ \fontshape{\shapedefault}
+ \hook_use:n { normalfont }
+ \selectfont
+ }
+ \cs_set_nopar:Npn \reset@font {\protect\normalfont}
+}
+
+\cs_gset_eq:cc { @@fterindentfalse } { @afterindentfalse }
+\cs_new_nopar:Nn \__xpg_french_indent:
+{
+ \cs_set_eq:cc { @afterindentfalse } { @afterindenttrue }
\@afterindenttrue
}
-\def\nofrench@indent{
- \let\@afterindentfalse\@@fterindentfalse
+\cs_new_nopar:Nn \__xpg_no_french_indent:
+{
+ \cs_set_eq:cc { @afterindentfalse } { @@fterindentfalse }
\@afterindentfalse
}
@@ -5839,10 +5838,10 @@ to track the issues and follow progress.
\cs_new:Nn \__xpg_select_background_language:n
{
- \str_if_eq:eeTF{\prop_item:Nn{\g_xpg_langsetup_prop}{#1/lcscript}}{latin}
+ \str_if_eq:eeTF { \prop_item:Nn{\l_xpg_langsetup_prop}{#1/lcscript} } { latin }
{}
- {\xpg@set@normalfont{#1}}
- \csuse{#1@globalnumbers}
+ { \xpg_set_normalfont:n{#1} }
+ \use:c{#1@globalnumbers}
}
\cs_generate_variant:Nn \__xpg_select_background_language:n {e}
% Declare secondary language #2 with language options #1
@@ -5853,7 +5852,7 @@ to track the issues and follow progress.
\__xpg_load_lang_definition:ee {#1} {#2}
% define environment and command if not alias
\str_if_eq:eeT {\prop_item:Ne \__xpg_alias {#2/target}} {#2} {
- \use:c{\prop_item:Ne{\g_xpg_langsetup_prop}
+ \use:c{\prop_item:Ne{\l_xpg_langsetup_prop}
{#2/DefineCommandsCmd}}
{#2}
}
@@ -5866,28 +5865,13 @@ to track the issues and follow progress.
\cs_new:Nn \__xpg_set_otherlanguage:nn
{
\__xpg_register_language:nn{#1}{#2}
- % If a variant is set, store it.
- \gdef\otherlanguagevariant{}
- % Register the language options
- \__xpg_set_language_options:nnn {#2} {#1} {@xpg@other@langvariant}
-
- \csgdef{#2@gvar}{\otherlanguagevariant}
- \prop_get:NeNT \g_xpg_langsetup_prop {#2/babelname} \l_tmpa_tl
- { \xdef\otherlanguagebabelname{\l_tmpa_tl} }
- \cs_gset_eq:cc{#2@gbabelname}{otherlanguagebabelname}
}
\cs_generate_variant:Nn \__xpg_set_otherlanguage:nn { ee }
-
-% Store main language variant for external packages
-\define@key{xpg@other@langvariant}{variant}{
- \gdef\otherlanguagevariant{#1}
-}
-
\NewDocumentCommand \setotherlanguages { m }
- {
+{
\clist_map_function:eN { #1 } \setotherlanguage
- }
+}
\cs_set:Nn \xpg_common_language:
{% FIXME is this really needed???
@@ -5910,7 +5894,8 @@ to track the issues and follow progress.
% for specific (esp. tag-based) aliases
% where \text<alias> would cause clashes
% (e.g., \textit)
-\newcommand\textlang[3][]{
+\NewDocumentCommand \textlang { O{} m +m }
+{
\__xpg_textlanguage:een {#1} {#2} {#3}
}
@@ -5919,45 +5904,20 @@ to track the issues and follow progress.
% inside case changing commands (e.g. \MakeUppercase)
\tl_put_right:Nn \l_text_case_exclude_arg_tl { \textlang }
-% Alias to {<lang>}, but more suitable
-% for specific (esp. tag-based) aliases
-% where {<alias>} would cause clashes
-% (e.g., \fi)
-\DeclareEnvironmentCopy { lang } { otherlanguage }
-
% wrapper for foreignlanguage and otherlanguage*
-\newcommand*\polyglossia@setforeignlanguage[2][]{
- \select@@language[#1]{#2}
+\cs_new_nopar:Nn \xpg_set_foreign_language:nn
+{
+ \xpg_select_language:nn { #1 } { #2 }
\__xpg_register_language:nn{#1}{#2}
- % Store babelname of current language (for external packages such as biblatex)
- \tl_if_blank:nTF {#1}{
- \ifcsundef{#2@gbabelname}{
- \edef\babelname{\prop_item:Nn{\g_xpg_langsetup_prop}{#2/babelname}}
- }{
- \edef\babelname{\csuse{#2@gbabelname}}
- }
- }{
- \edef\babelname{\prop_item:Nn{\g_xpg_langsetup_prop}{#2/babelname}}
- }
- % Store BCP-47 id of current language
- \__xpg_store_bcp_info:nn {#1}{#2}
-}
-
-% Expandable lowercasing. We use this to assure keyval
-% options are lowercased (also when used in \MakeUppercase
-% contexts e.g. in headings)
-% Macro adapted from tudscr.sty
-\newcommand*\xpg@str@lowercase[2]{
- \protected@edef#1{
- \lowercase{\def\noexpand#1{#2}}
- }#1
}
% lowercase options before passing to setkeys
-\cs_new:Nn \__xpg_set_keys:nn
+\NewDocumentCommand \SetGlossOptions { m m }
{
- \xpg@str@lowercase{\xpg@tmp@opts}{#2}
- \exp_args:Nne \setkeys{#1}{\xpg@tmp@opts}
+ % \text_lowercase:n fully expands
+ % (as opposed to \str_lowercase:n)
+ \use:c { xpg_#1_default_options_tl }
+ \exp_args:Ne \keys_set:ne{ polyglossia / gloss / #1 }{ \text_lowercase:n {#2} }
}
% joint code of \foreignlanguage, otherlanguage*
@@ -5967,54 +5927,30 @@ to track the issues and follow progress.
\cs_new:Nn \xpg_otherlanguage:nn
{
\xpg_error_if_lang_not_loaded:n{#2}
- \__xpg_set_keys:nn{#2}{#1}
- \polyglossia@setforeignlanguage[#1]{#2}
+ \SetGlossOptions{#2}{#1}
+ \xpg_set_foreign_language:nn { #1 } { #2 }
% Hook for external packages such as biblatex
\polyglossia@language@switched
% buggy restoration heure
- \csuse{inlineextras@#2}
+ \use:c{inlineextras@#2}
% This is a hook for external packages which want to access variants
% via babelname (such as biblatex)
\cs_if_exist_use:c{inlineextras@bbl@\babelname}
}
\DeclareDocumentCommand { \foreignlanguage } { O{} m +m }
- {
+{
\__xpg_foreignlanguage:eeen {#1} {#2} {\xpg_alias_base_lang:n{#2}} {#3}
- }
+}
% prevent case changing of language name in \foreignlanguage
\tl_put_right:Nn \l_text_case_exclude_arg_tl { \foreignlanguage }
-% Direct access to polyglossia@setforeignlanguage
+% Direct access to \xpg_set_foreign_language:nn
% used in captions
-\newcommand{\setforeignlanguage}[2][]
+\NewDocumentCommand \setforeignlanguage { O{} m }
{
- \polyglossia@setforeignlanguage[#1]{#2}
-}
-
-% Stack to store matrix languages
-\seq_new:N \__xpg_current_matrixlang_stack
-
-% Store embedding language when an embedded language is switched to
-\cs_new_nopar:Nn \__xpg_store_matrixlang:
-{
- \seq_gput_left:Nn \__xpg_current_matrixlang_stack \languagename
-}
-
-% When an embedded language is closed, reset to the embedding language
-% and remove stored matrix language from stack
-\cs_new_nopar:Nn \__xpg_reset_to_matrixlang:
-{
- % if stack is empty, use main language
- \seq_gpop_left:NNTF \__xpg_current_matrixlang_stack \l_tmpa_tl
- { \cs_set_eq:NN \__xpg_current_matrixlang \l_tmpa_tl }
- { \cs_set_eq:NN \__xpg_current_matrixlang \mainlanguagename }
- % Reset the language's/script's font families if the embedding script is latin
- \str_if_eq:eeT{\prop_item:Ne{\g_xpg_langsetup_prop}{\__xpg_current_matrixlang/lcscript}}{latin}
- {\resetfontlatin}
- % In case a \<lang>font is defined, re-activate that
- \exp_args:Ne \xpg@set@normalfont{\__xpg_current_matrixlang}
+ \xpg_set_foreign_language:nn { #1 } { #2 }
}
% internal wrapper for foreign language
@@ -6028,12 +5964,10 @@ to track the issues and follow progress.
{
\msg_show:nnn { polyglossia } { languagenotloaded } {#2}
}{
- \__xpg_store_matrixlang:
\group_begin:
\xpg_otherlanguage:nn{ \xpg_alias_add_to_option_i:nn{#2}{#1} }{ #3 }
\__xpg_lang_set_text_direction:nn{#3}{#4}
\group_end:
- \__xpg_reset_to_matrixlang:
}
}
\cs_generate_variant:Nn \__xpg_foreignlanguage:nnnn {eeen}
@@ -6042,11 +5976,9 @@ to track the issues and follow progress.
% otherlanguage* is the environment equivalent of \foreignlanguage
\DeclareDocumentEnvironment { otherlanguage* } { O{} m }
{
- \__xpg_store_matrixlang:
\__xpg_otherlanguage:eee { #1 } { #2 } { \xpg_alias_base_lang:n { #2 } }
}{
- \egroup% \group_end: does not work here!
- \__xpg_reset_to_matrixlang:
+ \c_group_end_token% \group_end: does not work here!
}
% internal wrapper
@@ -6061,7 +5993,7 @@ to track the issues and follow progress.
}{
\xpg_otherlanguage:nn{ \xpg_alias_add_to_option_i:nn{#2}{#1} }{ #3 }
\__xpg_lang_set_text_direction:nn{#3}%
- \bgroup% \group_begin: does not work here!
+ \c_group_begin_token% \group_begin: does not work here!
}
}
\cs_generate_variant:Nn \__xpg_otherlanguage:nnn { eee }
@@ -6077,9 +6009,6 @@ to track the issues and follow progress.
}
\cs_generate_variant:Nn \__xpg_textlanguage:nnn {een}
-% Track whether we are in an inline lang (\text...) switch
-\bool_new:N \l__xpg_inline_lang_bool
-
% use by \text<lang> and \textlang. Equivalent to \foreignlanguage,
% except that dates are localized.
% #1: option
@@ -6093,41 +6022,43 @@ to track the issues and follow progress.
\msg_show:nnn { polyglossia } { languagenotloaded } {#2}
}
{
- \__xpg_store_matrixlang:
\group_begin:
- \bool_set_true:N \l__xpg_inline_lang_bool
\xpg_otherlanguage:nn{#1}{#3}
- \csuse{date#3}
+ \use:c{date#3}
% This is a hook for external packages which want to access variants
% via babelname (such as biblatex)
\cs_if_exist_use:c{date@bbl@\babelname}
\__xpg_lang_set_text_direction:nn{#3}{#4}
\group_end:
- \__xpg_reset_to_matrixlang:
}
}
\cs_generate_variant:Nn \__xpg_textlanguage:nnnn {nnen}
% Define language-specific hyphenation exceptions
-\newcommand\pghyphenation[3][]{
- \bgroup
- \xpg_error_if_lang_not_loaded:n{#2}
- \setkeys{#2}{#1}
- \select@@language[#1]{#2}
+\NewDocumentCommand \pghyphenation {O{} m m}
+{
+ \c_group_begin_token
+ \xpg_error_if_lang_not_loaded:n { #2 }
+ \SetGlossOptions{#2}{#1}
+ \xpg_select_language:nn { #1 } { #2 }
\hyphenation{#3}
- \egroup
+ \c_group_end_token
}
% Hook that other package authors can use
% (for instance biblatex):
% Do not rename!
-\newcommand*{\xpg@hook@setlanguage}{}
+\cs_set_nopar:Npn \xpg@hook@setlanguage {}
-\def\xpg@pop@language@i#1#2{
- \xpg@set@language@aux[#1]{#2}
+\cs_set_nopar:Nn \__xpg_pop_language:nn
+{
+ \xpg_set_language_aux:nn { #1 } { #2 }
\xpg@hook@setlanguage
- \let\emp@langname\@undefined}
+% FIXME This seems to be a very old relict.
+% The macro is nowhere used. Probably remove.
+% \let\emp@langname\@undefined
+}
\DeclareDocumentCommand \selectlanguage {s O{} m}
{
@@ -6146,131 +6077,124 @@ to track the issues and follow progress.
\cs_new:Nn \__xpg_select_language:nnn
{
% Register the language options
- \__xpg_set_language_options:nnn {#3} {#2} {@xpg@set@langvariant}
+ \__xpg_set_language_options:nn {#3} {#2}
\IfBooleanTF { #1 } % The starred variant does not write to the aux
{
- \xpg@set@language@nonaux[#2]{#3}
+ \xpg_set_language_nonaux:nn { #2 } { #3 }
}{
- \cs_set_nopar:Npe \xpg@pop@language { \exp_not:N \xpg@pop@language@i {#2} {#3} }
- \group_insert_after:N \xpg@pop@language
- \xpg@set@language@aux[#2]{#3}
+ \cs_set_nopar:Ne \xpg_pop_language: { \exp_not:N \__xpg_pop_language:nn { #2 } { #3 } }
+ \group_insert_after:N \xpg_pop_language:
+ \xpg_set_language_aux:nn { #2 } { #3 }
}
- \__xpg_register_language:nn{#2}{#3}
+ \__xpg_register_language:nn { #2 } { #3 }
}
\cs_generate_variant:Nn \__xpg_select_language:nnn { nee, nne }
-
% set lang option #2 for lang #1
-\cs_new:Nn \__xpg_set_language_options:nnn
+\cs_new:Nn \__xpg_set_language_options:nn
{
- \tl_if_blank:nF {#2}
+ \cs_if_exist:cT { xpg_#1_default_options_prop }
{
- % If the optional argument sets a value for the key “variantâ€, copy it to xpg@langvariant
- \clist_map_inline:nn { #2 } {
- \xpg@parsevariantkeyvalue##1=#3:#1\relax
- }%
- \__xpg_set_keys:nn{#1}{#2}
+ \prop_concat:ccc { l_xpg_curropt_prop } { l_xpg_curropt_prop }
+ { xpg_#1_default_options_prop }
}
+ \xpg__keyval_parser:eeN { #2 } { #1 } \l_xpg_curropt_prop
+ \SetGlossOptions{#1}{#2}
}
% Initialize default language options, so that
% \iflanguageoption has the info it needs also
% for default settings
-\newcommand*\xpg@initialize@gloss@options[2]{
- \__xpg_set_language_options:nnn {#1} {#2} {@xpg@set@langvariant}
-}
+\NewDocumentCommand \InitializeGlossOptions { m m }
+{
+ \tl_new:c { xpg_#1_default_options_tl }
+ \prop_new:c { xpg_#1_default_options_prop }
+ \keys_precompile:nec { polyglossia / gloss / #1 }
+ { \text_lowercase:n { #2, \xpg__tmp_default_options_tl } }
+ { xpg_#1_default_options_tl }
+ \xpg__keyval_parser:enc { #2, \xpg__tmp_default_options_tl } { #1 }
+ { xpg_#1_default_options_prop }
+ \prop_concat:ccc { l_xpg_curropt_prop } { l_xpg_curropt_prop }
+ { xpg_#1_default_options_prop }
+ \use:c { xpg_#1_default_options_tl }
+ \__xpg_set_language_options:nn {#1} {#2}
+}
+\tl_new:N \xpg__tmp_default_options_tl
+\cs_generate_variant:Nn \keys_precompile:nnN { nec }
% Record synonymous keyvals such as variant=us and variant=american
-% Syntax: \xpg@set@alias@values{<lang>}{<key>}{<val>}{<alias vals, comma-separated>}
-\newcommand*\xpg@set@alias@values[4]{%
- \prop_if_exist:cF { xpg@alias@keyvals@#1@#3 }
- { \prop_new:c {xpg@alias@keyvals@#1@#3} }
- \prop_put:cnn { xpg@alias@keyvals@#1@#3 }
- {#2}{#4}
- \prop_if_exist:cF { xpg@alias@keyvals@#1@#4 }
- { \prop_new:c {xpg@alias@keyvals@#1@#4} }
- \prop_put:cnn { xpg@alias@keyvals@#1@#4 }
- {#2}{#3}
-}
-
-% Patch xkeyval to record default values of keys
-\pretocmd{\XKV@define@default}{%
- \csgdef{xpg@default@opt@\XKV@header #1}{#2}
-}{}{\xpg@warning{Patching xkeyval failed!}}
-
-% Helper to get and register option keyvals
-\def\xpg@parsevariantkeyvalue#1=#2@#3:#4\relax{
- \def\@tmpa{#1}
- \def\@tmpb{variant}
- % variant values are stored in specific macros
- % (\xpg@main@langvariant, \xpg@other@langvariant
- % and \xpg@set@langvariant)
- \ifx\@tmpa\@tmpb\setkeys{#3}{#1=#2}\fi
- \tl_if_empty:nTF{#2}
- {
- \ifcsdef{xpg@default@opt@KV@#4@#1}
- {\xpg@store@opt@keyval#1:\csuse{xpg@default@opt@KV@#4@#1}=:#4\relax}
- {}%
- }
- { \xpg@store@opt@keyval#1:#2:#4\relax }
-}%
-
-% Store option keys and values
-% This strips trailing '=' from values.
-\def\xpg@store@opt@keyval#1:#2=:#3\relax{
- \prop_if_exist:cF { xpg@current@options@#3 }
- { \prop_new:c {xpg@current@options@#3} }
- \prop_put:cnn { xpg@current@options@#3 }
- {#1}{#2}
+% Syntax: \SetLanguageAliasValues{<lang>}{<key>}{<alias vals, comma-separated>}
+\int_new:N \l_xpg_alias_keyvals_int
+\int_set:Nn \l_xpg_alias_keyvals_int { 2 }
+\NewDocumentCommand \SetLanguageAliasValues { m m m }
+{
+ \clist_map_inline:nn { #3 }
+ {
+ \int_const:cn { c_xpg_alias_keyvals_#1_#2_##1_int } { \l_xpg_alias_keyvals_int }
+ }
+ \int_incr:N \l_xpg_alias_keyvals_int
}
+\cs_new:Npn \xpg__keyval_parser:nnN #1 #2 #3 % #1 = key-vals, #2 = language, #3 = prop
+ {
+ \keyval_parse:nnn
+ { \xpg__keyval_parser_default:nnn { #2 } { #3 } }
+ { \xpg__keyval_parser_nondefault:nnnn { #2 } { #3 } }
+ { #1 }
+ }
+\cs_generate_variant:Nn \xpg__keyval_parser:nnN { eeN, enc }
+
+\cs_new:Npn \xpg__keyval_parser_default:nnn #1 #2 #3 % #1 = lang, #2 = prop, #3 = key
+ {
+ \str_set:Nn \l_tempa_str { #1 / #3 }
+ \str_concat:NNN \l_tempa_str \c__keys_default_root_str \l_tempa_str
+ \prop_put:Nne #2 { #1 / #3 } { \use:c { \l_tempa_str } }
+ }
+
+\cs_new:Npn \xpg__keyval_parser_nondefault:nnnn #1 #2 #3 #4 % #1 = lang, #2 = prop, #3 = key, #4 = value
+ {
+ \prop_put:Nnn #2 { #1 / #3 } { #4 }
+ }
\prg_set_conditional:Npnn \__xpg_check_option_value:NNN #1#2#3 { p , T , F , TF }
-{
- \prop_get:cnNTF {xpg@current@options@#1} {#2} \l_tmpa_tl
- {
- \str_if_eq:eeTF{\l_tmpa_tl}{#3}
- {\prg_return_true:}
+ {
+ \bool_lazy_or:nnTF
+ {
+ \str_if_eq_p:ee { \prop_item:Nn \l_xpg_curropt_prop { #1 / #2 } } { #3 }
+ } {
+ \int_compare_p:nNn
{
- \prop_get:cnNTF {xpg@alias@keyvals@#1@#3} {#2} \l_tmpb_tl
- {
- \clist_set:Ne{\l_tmpa_clist}{\l_tmpb_tl}
- \providetoggle{xpgvalfound}
- \togglefalse{xpgvalfound}
- \clist_map_inline:Nn \l_tmpa_clist {
- \str_if_eq:eeT{##1}{\l_tmpa_tl}
- { \toggletrue{xpgvalfound} }
- }
- \iftoggle{xpgvalfound}{\prg_return_true:}{\prg_return_false:}
- }
- {
- \prg_return_false:
- }
- }
- }
- {
- \prg_return_false:
- }
+ \cs_if_exist_use:cF { c_xpg_alias_keyvals_#1_#2_#3_int } { 0 }
+ } = {
+ \cs_if_exist_use:cF { c_xpg_alias_keyvals_#1_#2_\prop_item:Nn \l_xpg_curropt_prop { #1 / #2 }_int } { 1 }
+ }
+ } { \prg_return_true: } { \prg_return_false: }
+ }
+
+\prg_set_conditional:Npnn \xpg_if_main_language:n #1 { T, F, TF }
+{
+ \str_if_eq:VnTF \xpg_main_language_tl { #1 }
+ { \prg_return_true: }
+ { \prg_return_false: }
}
+\cs_set_eq:NN \IfMainLanguageTF \xpg_if_main_language:nTF
+
+\cs_set_eq:NN \IfMainLanguageT \xpg_if_main_language:nT
+
+\cs_set_eq:NN \IfMainLanguageF \xpg_if_main_language:nF
+
% Test if option value is set
\DeclareDocumentCommand \iflanguageoption { m m m m m }
{
\__xpg_check_option_value:NNNTF{#1}{#2}{#3}{#4}{#5}
}
-
-% Append any variant to csv list of variants
-\define@key{xpg@langvariant}{variant}{
- \clist_if_in:NeF \xpg@vloaded {#1}{
- \clist_gput_right:Ne \xpg@vloaded {#1}
- }
-}
-
% Test if language is loaded
\DeclareDocumentCommand \iflanguageloaded { m m m }
{
- \AddToHook{begindocument/end}{
+ \hook_gput_code:nnn {begindocument/end} {.}
+ {
\clist_if_in:NeTF \xpg@loaded{#1}{#2}{#3}
}
}
@@ -6278,7 +6202,8 @@ to track the issues and follow progress.
% Same for babellanguage is loaded
\DeclareDocumentCommand \ifbabellanguageloaded { m m m }
{
- \AddToHook{begindocument/end}{
+ \hook_gput_code:nnn {begindocument/end} {.}
+ {
\clist_if_in:NeTF \xpg@bloaded{#1}{#2}{#3}
}
}
@@ -6286,7 +6211,8 @@ to track the issues and follow progress.
% Same for languageid
\DeclareDocumentCommand \iflanguageidloaded { m m m m }
{
- \AddToHook{begindocument/end}{
+ \hook_gput_code:nnn {begindocument/end} {.}
+ {
\str_case:nnTF {#1}
{
{bcp-47} { \clist_if_in:NeTF \xpg@bcp@loaded{#2}{#3}{#4} }
@@ -6294,7 +6220,7 @@ to track the issues and follow progress.
}
{}
{
- \xpg@error{Invalid~ \string\iflanguageidloaded\space argument:~ #1}
+ \xpg_ill_arg_msg:nn { #1 } { \iflanguageidloaded }
}
}%
}
@@ -6324,53 +6250,46 @@ to track the issues and follow progress.
}
-\newcommand*{\xpg@set@language@nonaux}[2][]{
- \@select@language[#1]{#2}
+\cs_new_nopar:Nn \xpg_set_language_nonaux:nn
+{
+ \__xpg_start_language:nn { #1 } { #2 }
}
-\newcommand*{\xpg@set@language@aux}[2][]{
- % Store babelname of current language (for external packages such as biblatex)
- \tl_if_blank:nTF {#1}{
- \ifcsundef{#2@gbabelname}{
- \edef\babelname{\prop_item:Nn{\g_xpg_langsetup_prop}{#2/babelname}}
- }{
- \edef\babelname{\csuse{#2@gbabelname}}
- }
- }{
- \edef\babelname{\prop_item:Nn{\g_xpg_langsetup_prop}{#2/babelname}}
- }
- % Store BCP-47 id of current language
- \__xpg_store_bcp_info:nn {#1}{#2}
- \@select@language[#1]{#2}
+\cs_new_nopar:Nn \xpg_set_language_aux:nn
+{
+ \__xpg_start_language:nn { #1 } { #2 }
% Write to the aux
- \xpg@set@language@only@aux[#1]{#2}
+ \xpg_set_language_only_aux:nn { #1 } { #2 }
}
-\newcommand*{\xpg@set@language@only@aux}[2][]{
+\cs_new_nopar:Nn \xpg_set_language_only_aux:nn
+{
% Write to the aux (toc files)
\if@filesw
\addtocontents{toc}{\selectlanguage*[#1]{#2}}
\fi
}
-\AtBeginDocument{
+\hook_gput_code:nnn {begindocument} {.}
+{
\if@filesw
- \immediate\write\@mainaux
- {\ProvideDocumentCommand\selectlanguage{sO{}m}{}}
+ \immediate\write\@mainaux
+ {\ProvideDocumentCommand\selectlanguage{sO{}m}{}}
\fi
}
% Since captions might float to other language regions,
% we need to change the language here (#542)
-\AddToHook{cmd/caption/before}{
+\hook_gput_code:nnn {cmd/caption/before} {.}
+{
\ifhmode\unskip\fi
\addtocontents{lof}{\protect\setforeignlanguage{\languagename}}
\addtocontents{lot}{\protect\setforeignlanguage{\languagename}}
}
% check if language is defined
-\prg_set_conditional:Npnn \__xpg_check_if_exist_l@:n #1 { F, TF }
+\prg_set_conditional:Npnn \__xpg_pattern_check_if_exists:n #1 { F, TF }
{
\bool_lazy_and:nnTF
{ \cs_if_exist_p:c { l@#1 } }
@@ -6379,82 +6298,125 @@ to track the issues and follow progress.
{ \prg_return_false: }
}
-\def\polyglossia@luatex@load@lang#1{
+\cs_new_nopar:Nn \__xpg_luatex_load_lang:n
+{
% if \l@#1 is not properly defined, call lua function newloader(#1),
% and assign the returned number to \l@#1
- \__xpg_check_if_exist_l@:nF {#1}
+ \__xpg_pattern_check_if_exists:nF {#1}
{
\directlua { token.set_char('l@#1', polyglossia.newloader'#1') }
}
}
-% This check is also used by biblatex, so don't
-% rename silently.
-\newcommand\xpg@ifdefined[3]{
+% check if language is defined
+\prg_set_conditional:Npnn \xpg_if_language_defined:n #1 { T, F, TF }
+{
% With luatex, we first need to define \l@#1.
\sys_if_engine_luatex:T
{
- \polyglossia@luatex@load@lang{#1}
+ \__xpg_luatex_load_lang:n {#1}
}
- \__xpg_check_if_exist_l@:nTF{#1}{#2}{#3}
+ \__xpg_pattern_check_if_exists:nTF{#1}
+ { \prg_return_true: }
+ { \prg_return_false: }
}
+% Aliases for gloss files
+\cs_gset_eq:cc { IfLanguageDefinedTF } { xpg_if_language_defined:nTF }
+\cs_gset_eq:cc { IfLanguageDefinedT } { xpg_if_language_defined:nT }
+\cs_gset_eq:cc { IfLanguageDefinedF } { xpg_if_language_defined:nF }
+
+% Check if patterns for language #1 is defined. If not, try
+% the comma-separated list of fallbacks in #2
+\NewDocumentCommand \TryPatternWithFallback { m m }
+{
+ \xpg_if_language_defined:nF { #1 }
+ {
+ \clist_clear_new:N \l_xpg_lang_patterns
+ \clist_set:Ne \l_xpg_lang_patterns { #2 }
+ \bool_set_false:N \l_tmpa_bool
+ \clist_map_inline:Nn \l_xpg_lang_patterns
+ {
+ \xpg_if_language_defined:nT { ##1 }
+ {
+ \cs_gset_eq:cc { l@#1 } { l@##1 }
+ \bool_set_true:N \l_tmpa_bool
+ \clist_map_break:
+ }
+ }
+ \bool_if:NF \l_tmpa_bool
+ {
+ \xpg_warning_msg:n
+ {No~ hyphenation~ patterns~ for~ #1~ found \iow_newline:
+ Falling~ back~ to~ the~ default~ patterns~ (=~English)!}
+ \exp_args:Nc \adddialect {l@#1} 0
+ }
+ }
+}
+
+% This old term is used by biblatex, so don't drop!
+\cs_gset_eq:cc { xpg@ifdefined } { xpg_if_language_defined:nTF }
+
% Set \bbl@hyphendata@\the\language, which is (lua)babel's
% hyphenation pattern hook
% FIXME Clarifiy why/when this is needed.
-\newcommand*\xpg@set@bbl@hyphendata[1]{
+\cs_new:Nn \xpg_set_bbl_hyphendata:n
+{
\sys_if_engine_luatex:T
{
- \ifcsdef{bbl@hyphendata@#1}{}{
- \global\@namedef{bbl@hyphendata@\the\language}{}
+ \cs_if_exist:cF {bbl@hyphendata@#1}
+ {
+ \cs_gset:cpn {bbl@hyphendata@\the\language} {}
}
}
}
% Set hyphenation patterns for a given language. This does the right
% thing both for XeTeX and LuaTeX
-\newcommand*\xpg@set@hyphenation@patterns[1]{
- \sys_if_engine_luatex:T { \polyglossia@luatex@load@lang{#1} }
+\cs_new:Nn \xpg_set_hyphenation_patterns:n
+{
+ \sys_if_engine_luatex:T { \__xpg_luatex_load_lang:n {#1} }
\language=\csname l@#1\endcsname
}
-\newcommand*\@select@language[2][]{
+\cs_new:Nn \__xpg_start_language:nn
+{
% hook for compatibility with biblatex
- \select@language{#2}
- \xpg@set@bbl@hyphendata{\the\language}
+ \select@language { #2 }
+ \xpg_set_bbl_hyphendata:n {\the\language}
\xpg_initial_setup:
- \select@@language[#1]{#2}%
+ \xpg_select_language:nn { #1 } { #2 }
% Hook for external packages such as biblatex
- \polyglossia@language@switched%
- \__xpg_lang_set_par_direction:n{#2}
- \csuse{captions#2}%
- \csuse{date#2}%
+ \polyglossia@language@switched
+ \__xpg_lang_set_par_direction:n {#2}
+ \use:c {captions#2}
+ \use:c {date#2}
% These are hooks for external packages which want to access variants
% via babelname (such as biblatex)
- \cs_if_exist_use:c{captions@bbl@\babelname}
- \cs_if_exist_use:c{date@bbl@\babelname}
- \__xpg_local_marks:n{#2}
- \csuse{init@extras@#2}%
+ \cs_if_exist_use:c {captions@bbl@\babelname}
+ \cs_if_exist_use:c {date@bbl@\babelname}
+ \__xpg_local_marks:n {#2}
+ \use:c {init@extras@#2}
\__xpg_indent_first:n { #2 }
- \csuse{blockextras@#2}%
+ \cs_if_exist_use:c {blockextras@#2}
% This is a hook for external packages which want to access variants
% via babelname (such as biblatex)
- \cs_if_exist_use:c{blockextras@bbl@\babelname}
- }
+ \cs_if_exist_use:c {blockextras@bbl@\babelname}
+}
% hook for compatibility with biblatex
% (probably no longer used due to the
% more general hook that follows, but
% we keep it for backwards comp.)
-\def\select@language#1{}
+\cs_set:Npn \select@language #1 {}
% Hook for external packages such as biblatex
% do not rename!
-\def\polyglossia@language@switched{}
+\cs_new:Npn \polyglossia@language@switched {}
-% remove all custumization for language #1
+% remove all customization for language #1
\cs_new:Npn \noextrascurrent #1
-{%
+{
\cs_if_exist_use:c{noextras@#1}%
% This is a hook for external packages which want to access variants
% via babelname (such as biblatex)
@@ -6462,160 +6424,105 @@ to track the issues and follow progress.
}
% Common code for `\select@language' and `\foreignlanguage'.
-\newcommand{\select@@language}[2][]{%
+\cs_new:Nn \xpg_select_language:nn
+{
% disable the extras and number settings of the previous language
\cs_if_exist:cT{languagename}
{
\noextrascurrent{\languagename}
\cs_if_exist_use:c{no\languagename @numbers}
\sys_if_engine_xetex:T{
- \__xpg_if_LR_str:eTF{\prop_item:Ne{\g_xpg_langsetup_prop}{\languagename/direction}}
+ \__xpg_if_LR_str:eTF{\prop_item:Ne{\l_xpg_langsetup_prop}{\languagename/direction}}
{
- \__xpg_if_LR_str:eF{\prop_item:Nn{\g_xpg_langsetup_prop}{#2/direction}}
+ \__xpg_if_LR_str:eF{\prop_item:Nn{\l_xpg_langsetup_prop}{#2/direction}}
{\setnonlatin} % LTR -> RTL
}
{
- \__xpg_if_LR_str:eT{\prop_item:Nn{\g_xpg_langsetup_prop}{#2/direction}}
+ \__xpg_if_LR_str:eT{\prop_item:Nn{\l_xpg_langsetup_prop}{#2/direction}}
{\setlatin} % RTL -> LTR
}
}
}
- \polyglossia@set@language@name[#1]{#2}
- % Set the language's/script's font families
- \str_if_eq:eeT{\prop_item:Nn{\g_xpg_langsetup_prop}{#2/lcscript}} {latin}
- {
- \resetfontlatin
- }
- \bool_if:NF \l__xpg_inline_lang_bool
- { % This for non-inline font switches
- % in case a \<lang>font is defined
- \xpg@set@normalfont{#2}
- }
- \xpg@select@fontfamily{#2}
+ \xpg_set_language_name:n { #2 }
+ \xpg_set_normalfont:n { #2 }
+ \xpg_select_fontfamily:n { #2 }
\__xpg_use_or_warn:c{#2@language}
\cs_if_exist_use:c{#2@numbers}
- \use@localhyphenmins[#1]{#2}
+ \__xpg_use_localhyphenmins:nn { #1 } { #2 }
\__xpg_french_spacing:n { #2 }
}
-\let\xpg@pop@language\relax
+\cs_undefine:N \xpg_pop_language:
-%
-% Keep track of the active (nested) languages and options
-%
-\clist_new:N \l_xpg_lang_stack
-
-\cs_new:Nn \__xpg_stack_language:nn
-{
- \clist_gpush:Nn \l_xpg_lang_stack {#1:#2}
-}
+\DeclareDocumentEnvironment { otherlanguage } { O{} m }
+ {
+ \selectlanguage[#1]{#2}
+ } { }
-\cs_generate_variant:Nn \__xpg_stack_language:nn {nx}
+% Alias to {<lang>}, but more suitable
+% for specific (esp. tag-based) aliases
+% where {<alias>} would cause clashes
+% (e.g., \fi)
+\DeclareEnvironmentCopy { lang } { otherlanguage }
-\cs_new:Nn \__xpg_unstack_language:n
+\NewDocumentCommand \setlocalhyphenmins { m m m }
{
- \clist_gpop:NNTF \l_xpg_lang_stack \l_tmpa_tl {
- % Stored format = options:language => split:
- \seq_set_split:Nne \l_tmpa_seq {:} \l_tmpa_tl
- \seq_get_left:NN \l_tmpa_seq \l_tmpb_tl
- \seq_get_right:NN \l_tmpa_seq \l_tmpc_tl
- % Execute passed command with language and maybe options
- % and re-set stored language's keys
- \tl_if_empty:NTF \l_tmpb_tl {\cs_if_exist_use:c{#1}{\l_tmpc_tl}}
- {\__xpg_set_keys:nn{\l_tmpc_tl}{\l_tmpb_tl}
- \cs_if_exist_use:c{#1}[\l_tmpb_tl]{\l_tmpc_tl}
- }
- }
- {}
-}
-
-\DeclareDocumentEnvironment { otherlanguage } { O{} m }
- {
- % Get real current (pre-switch) options (incl. defaults)
- \clist_clear_new:N \l_xpg_current_options
- \prop_if_exist:cF { xpg@current@options@\languagename }
- { \prop_new:c {xpg@current@options@\languagename} }
- \prop_map_inline:cn {xpg@current@options@\languagename}
+ \xpg_if_language_defined:nTF{#1}
+ {
+ \cs_if_eq:ccTF { l@#1 } { l@nohyphenation }
{
- \clist_put_right:Nn \l_xpg_current_options {##1=##2}
+ \xpg_warning_msg:n {\string\setlocalhyphenmin\space~ useless~ for~ unhyphenated~ language~ #1}
+ }{
+ \providehyphenmins{#1}{#2#3}
}
- % Store current (pre-switch) options and language on stack
- \__xpg_stack_language:nx{\clist_use:Nn \l_xpg_current_options {,}}{\languagename}
- \selectlanguage[#1]{#2}
- }
- {
- % restore previous language in aux file and remove closed one from stack
- \__xpg_unstack_language:n{xpg@set@language@only@aux}
- }
-
-\newcommand{\setlocalhyphenmins}[3]{
- \xpg@ifdefined{#1}{
- \expandafter\ifx\csname l@#1\endcsname\l@nohyphenation
- \xpg@warning{\string\setlocalhyphenmin\space~ useless~ for~ unhyphenated~ language~ #1}
- \else
- \providehyphenmins{#1}{#2#3}
- \fi
}{
- \xpg@warning{\string\setlocalhyphenmin\space~ useless~ for~ unknown~ language~ #1}
+ \xpg_warning_msg:n {\string\setlocalhyphenmin\space~ useless~ for~ unknown~ language~ #1}
}
}
% \setlanghyphenmins[options]{lang}{l}{r}
-\newcommand*\setlanghyphenmins[4][]{%
+\NewDocumentCommand \setlanghyphenmins { O{} m m m }
+{
% Check for real language name and options
- \edef\xpg@tmp@opts{\xpg_alias_add_to_option_i:nn{#2}{#1}}
- \edef\xpg@tmp@lang{\xpg_alias_base_lang:n{#2}}
- \bgroup
- \xpg_error_if_lang_not_loaded:n{\xpg@tmp@lang}
- \__xpg_set_keys:nn{\xpg@tmp@lang}{\xpg@tmp@opts}
+ \tl_set:Nx \l_tmp_opts_tl { \xpg_alias_add_to_option_i:nn{#2}{#1} }
+ \tl_set:Nx \l_tmp_lang_tl { \xpg_alias_base_lang:n{#2} }
+ \c_group_begin_token
+ \xpg_error_if_lang_not_loaded:n{\l_tmp_lang_tl}
+ \SetGlossOptions{\l_tmp_lang_tl}{ \l_tmp_opts_tl }
% Store bcp47.tag@hypenmins
- \tl_if_blank:nTF {\xpg@tmp@opts}{%
- \ifcsundef{\csname xpg@tmp@lang\endcsname @g.bcp47.tag}{
- \csedef{tmp@bcp47.tag}{\prop_item:Ne{\g_xpg_langsetup_prop}{ \xpg@tmp@lang / bcp47 }}
- }{
- \csedef{tmp@bcp47.tag}{\csuse{#2@g.bcp47.tag}}
- }
- }{
- \csedef{tmp@bcp47.tag}{\prop_item:Ne{\g_xpg_langsetup_prop}{ \xpg@tmp@lang / bcp47 }}
- }
- \csgdef{\csname tmp@bcp47.tag\endcsname @hyphenmins}{{#3}{#4}}
- \egroup
+ \cs_set_nopar:cpe {tmp@bcp47.tag} { \prop_item:Ne{\l_xpg_langsetup_prop}{ \l_tmp_lang_tl / bcp47 } }
+ \cs_gset:cpn {\csname tmp@bcp47.tag\endcsname @hyphenmins} {{#3}{#4}}
+ \c_group_end_token
}
-% \use@localhypenmins[options]{lang}
-\newcommand*\use@localhyphenmins[2][]{
- \bgroup
- \xpg_error_if_lang_not_loaded:n{#2}
- \__xpg_set_keys:nn{#2}{#1}
+% \__xpg_use_localhyphenmins:nn {options}{lang}
+\cs_new_nopar:Nn \__xpg_use_localhyphenmins:nn
+{
+ \c_group_begin_token
+ \xpg_error_if_lang_not_loaded:n {#2}
+ \SetGlossOptions {#2} {#1}
% Use bcp47.tag@hypenmins
- \tl_if_blank:nTF {#1}{
- \ifcsundef{#2@g.bcp47.tag}{
- \csxdef{tmp@bcp47.tag}{\prop_item:Nn{\g_xpg_langsetup_prop}{ #2 / bcp47 }}
- }{
- \csxdef{tmp@bcp47.tag}{\csuse{#2@g.bcp47.tag}}
- }
- }{
- \csxdef{tmp@bcp47.tag}{\prop_item:Nn{\g_xpg_langsetup_prop}{ #2 / bcp47 }}
- }
- \egroup
- \ifcsundef{\csname tmp@bcp47.tag\endcsname @hyphenmins}{
- \ifcsundef{#2hyphenmins}{}
+ \cs_gset_nopar:cpe {tmp@bcp47.tag} { \prop_item:Nn{\l_xpg_langsetup_prop}{ #2 / bcp47 } }
+ \c_group_end_token
+ \cs_if_exist:cTF {\csname tmp@bcp47.tag\endcsname @hyphenmins}
+ {
+ \tl_set:Ne \l_tmpa_tl { \use:c{\csname tmp@bcp47.tag\endcsname @hyphenmins} }
+ \expandafter \set@hyphenmins \l_tmpa_tl
+ }{
+ \cs_if_exist:cT{#2hyphenmins}
{
\expandafter\expandafter\expandafter\set@hyphenmins\csname #2hyphenmins\endcsname\relax
}
- }{
- \edef\tmpa{\csuse{\csname tmp@bcp47.tag\endcsname @hyphenmins}}
- \expandafter\expandafter\expandafter\set@hyphenmins\tmpa\relax
}
- \sys_if_engine_luatex:T{
+ \sys_if_engine_luatex:T
+ {
% Set \totalhyphenmin if specified
- \prop_get:NeNTF \g_xpg_langsetup_prop {#2/totalhyphenmin} \l_tmpa_tl
+ \prop_get:NeNT \l_xpg_langsetup_prop {#2/totalhyphenmin} \l_tmpb_tl
{
- \xpg@info{totalhyphenmin: '\l_tmpa_tl'}
- \expandafter\hyphenationmin \l_tmpa_tl
+ \xpg_info_msg:n {totalhyphenmin: '\l_tmpb_tl'}
+ \expandafter\hyphenationmin \l_tmpb_tl
}
- {}
}
}
@@ -6627,23 +6534,26 @@ to track the issues and follow progress.
\DeclareDocumentEnvironment { hyphenrules } { O{} m }
{
% Check for real language name and options
- \edef\xpg@tmp@opts{\xpg_alias_add_to_option_i:nn{#2}{#1}}
- \edef\xpg@tmp@lang{\xpg_alias_base_lang:n{#2}}
+ \tl_set:Nx \l_tmp_opts_tl { \xpg_alias_add_to_option_i:nn{#2}{#1} }
+ \tl_set:Nx \l_tmp_lang_tl { \xpg_alias_base_lang:n{#2} }
% Register the language options
- \__xpg_set_language_options:nnn {\xpg@tmp@lang} {\xpg@tmp@opts} {@xpg@set@langvariant}
+ \__xpg_set_language_options:nn { \l_tmp_lang_tl } { \l_tmp_opts_tl }
% Now switch patterns
- \__xpg_use_or_warn:c{\use:c{xpg@tmp@lang}@language}
+ \__xpg_use_or_warn:c{\use:c{l_tmp_lang_tl}@language}
% And activate hyphenmins
- \use@localhyphenmins[\xpg@tmp@opts]{\xpg@tmp@lang}
+ \__xpg_use_localhyphenmins:nn { \l_tmp_opts_tl } { \l_tmp_lang_tl }
}
{ }
-\AddToHook{begindocument/before}{
- \IfPackageLoadedTF{bidi}{
- \providecommand*{\aemph}[1]{$\overline{\hboxR{#1}}$}
+\hook_gput_code:nnn {begindocument/before} {.}
+{
+ \IfPackageLoadedTF{bidi}
+ {
+ \ProvideDocumentCommand \aemph { m } { $\overline{\hboxR{#1}}$ }
}{}
- \IfPackageLoadedTF{luabidi}{
- \providecommand*{\aemph}[1]{$\overline{\hbox{\RL{#1}}}$}
+ \IfPackageLoadedTF{luabidi}
+ {
+ \ProvideDocumentCommand \aemph { m } { $\overline{\hbox{\RL{#1}}}$ }
}{}
}
@@ -6677,7 +6587,8 @@ to track the issues and follow progress.
.value_required:n = true,
}
-\keys_set:nn { polyglossia } {
+\keys_set:nn { polyglossia }
+{
localmarks = false,
verbose = true,
babelshorthands = false,
@@ -6694,23 +6605,35 @@ to track the issues and follow progress.
\sys_if_engine_luatex:T{
\str_if_eq:eeF{\g_xpg_luatex_renderer_str}{none}
{
- \xpg@info{Setting~ LuaTeX~ font~ renderer~ to~ \g_xpg_luatex_renderer_str}
+ \xpg_info_msg:n{Setting~ LuaTeX~ font~ renderer~ to~ \g_xpg_luatex_renderer_str}
\exp_args:Ne \defaultfontfeatures{Renderer=\g_xpg_luatex_renderer_str}
}
}
-\bool_if:nF \g_xpg_verbose_bool {
- \gdef\@latex@info#1{\relax} % no latex info
- \gdef\@font@info#1{\relax} % no latex font info
- \gdef\@font@warning#1{\relax} % no latex font warnings
- \gdef\zf@PackageInfo#1{\relax} % no fontspec info
- \gdef\xpg@info#1{\relax} % no polyglossia info
+\bool_if:nF \g_xpg_verbose_bool
+{
+ \cs_gset_nopar:Npn \@latex@info #1 { \relax } % no latex info
+ \cs_gset_nopar:Npn \@font@info #1 { \relax } % no latex font info
+ \cs_gset_nopar:Npn \@font@warning #1 { \relax } % no latex font warnings
+ \msg_redirect_module:nnn { fontspec } { info } { none } % no fontspec info
+ \msg_redirect_module:nnn { polyglossia } { info } { none } % no polyglossia info
}
\bool_if:nT \g_xpg_localmarks_bool {
\__xpg_enable_local_marks:
}
+% common code to initiate babelshordhands in glosses
+\cs_new:Npn \InitializeBabelShorthands
+{
+ \cs_if_exist:cF {initiate@active@char}
+ {
+ \file_input:n {babelsh.def}
+ \initiate@active@char{"}
+ \shorthandoff{"}
+ }
+}
+
% Control shorthand (de-)activation
% This checks that the shorthand char is only deactivated
% if we have activated it ourselves and hence keeps
@@ -6738,21 +6661,22 @@ to track the issues and follow progress.
% Inherit shorthands in other languages
\NewDocumentCommand \inheritbabelshorthands { m m }
{
- \AddToHook{begindocument/before}{
+ \hook_gput_code:nnn {begindocument/before} {.}
+ {
% Load the involved languages if necessary
% Error if they do not exist
\tl_set:Nn \l__xpg_tmpa_lang_tl { \xpg_alias_base_lang:n{#1} }
\clist_if_in:NeF \xpg@loaded {\l__xpg_tmpa_lang_tl}{
\file_if_exist:nTF{gloss-\l__xpg_tmpa_lang_tl .ldf}
{ \setotherlanguage{#1} }
- { \xpg@error{ Source~ language~ #1,~ used~ in~
+ { \xpg_error_msg:n { Source~ language~ #1,~ used~ in~
\string\inheritbabelshorthands,~ does~ not~ exist } }
}
\tl_set:Nn \l__xpg_tmpb_lang_tl { \xpg_alias_base_lang:n{#2} }
\clist_if_in:NeF \xpg@loaded {\l__xpg_tmpb_lang_tl}{
\file_if_exist:nTF{gloss-\l__xpg_tmpb_lang_tl .ldf}
{ \setotherlanguage{#2} }
- { \xpg@error{ Target~ language~ #2,~ used~ in~
+ { \xpg_error_msg:n { Target~ language~ #2,~ used~ in~
\string\inheritbabelshorthands,~ does~ not~ exist } }
}
% Test whether the requested shorthands exist
@@ -6764,7 +6688,7 @@ to track the issues and follow progress.
{ \bool_set_true:N \l__xpg_no_shorthands_bool }
\bool_if:nT { \l__xpg_no_shorthands_bool }
{
- \xpg@error{ No~ babel~ shorthands~ exist~ for~ language~ #1 }
+ \xpg_error_msg:n { No~ babel~ shorthands~ exist~ for~ language~ #1 }
}
% If so, apply:
\bool_if:nF { \l__xpg_no_shorthands_bool }
@@ -6789,7 +6713,7 @@ to track the issues and follow progress.
\iflanguageloaded{\l__xpg_tmpa_lang_tl}{
\use:c{\l__xpg_tmpa_lang_tl @shorthands}
}{
- \xpg@error{ Language~ #1,~ requested~ in~
+ \xpg_error_msg:n { Language~ #1,~ requested~ in~
\string\startbabelshorthands,~ is~ not~ loaded }
}
}
@@ -7090,7 +7014,7 @@ to track the issues and follow progress.
\ifnum#1<5000
\Hebrewnumeral{#1}%
\else
- \ifnum#1<6000 % current millenium, print without thousands
+ \ifnum#1<6000 % current millennium, print without thousands
\@tempcnta=#1\relax
\if@xpg@hebrew@fullyear\else\advance\@tempcnta by -5000\fi
\Hebrewnumeral{\@tempcnta}%
@@ -7419,7 +7343,7 @@ l3calc. Please update expl3!
\@ifundefined{@Remainder}{\input{cal-util.def}}{}
%% The following functions are straightforward implementation
-%% of Reingold & Dershowitz, Calendrical Calculations, The Millenium Edition
+%% of Reingold & Dershowitz, Calendrical Calculations, The Millennium Edition
%%
\def\@FixedFromHijri#1#2#3#4{% year,month,day,counter
@@ -7494,82 +7418,15 @@ ShawwÄl\or DhÅ« ’l-QaÊ¿da\or DhÅ« ’l-Ḥijja\fi}
% \end{macrocode}
% \iffalse
%</hijrical.sty>
-%<*polyglossia-french.lua>
+%<*polyglossia-cjk-spacing.lua>
% \fi
% \clearpage
%
-% \subsection{polyglossia-french.lua}
+% \subsection{polyglossia-cjk-spacing.lua}
% \begin{macrocode}
--
--- polyglossia-punct.lua
--- part of polyglossia v2.1 -- 2024/03/07
---
-
-require('polyglossia-punct')
-
-local function set_left_space(lang, char, kern, rubber)
- polyglossia.add_left_spaced_character(lang, char, kern, "space", rubber)
-end
-
-local function set_right_space(lang, char, kern, rubber)
- polyglossia.add_right_spaced_character(lang, char, kern, "space", rubber)
-end
-
-local function activate_french_punct(thincolonspace, autospaceguillemets)
- -- We need different language tags here to make switching of options possible
- -- within a paragraph.
- local lang = "french"
- if thincolonspace then
- lang = lang.."-thincolon"
- end
- if autospaceguillemets then
- lang = lang.."-autospace"
- end
-
- polyglossia.activate_punct(lang)
- polyglossia.clear_spaced_characters(lang)
-
- if thincolonspace then
- set_left_space(lang, ':', 0.5)
- else
- set_left_space(lang, ':', 1, true) -- stretchable and shrinkable space
- end
-
- set_left_space(lang, '!', 0.5)
- set_left_space(lang, '?', 0.5)
- set_left_space(lang, ';', 0.5)
- set_left_space(lang, '‼', 0.5)
- set_left_space(lang, 'â‡', 0.5)
- set_left_space(lang, 'âˆ', 0.5)
- set_left_space(lang, 'â‰', 0.5)
- set_left_space(lang, '‽', 0.5) -- U+203D (interrobang)
-
- if autospaceguillemets then
- set_left_space(lang, '»', 0.5)
- set_left_space(lang, '›', 0.5)
- set_right_space(lang, '«', 0.5)
- set_right_space(lang, '‹', 0.5)
- end
-end
-
-local function deactivate_french_punct()
- polyglossia.deactivate_punct()
-end
-
-polyglossia.activate_french_punct = activate_french_punct
-polyglossia.deactivate_french_punct = deactivate_french_punct
-% \end{macrocode}
-% \iffalse
-%</polyglossia-french.lua>
-%<*polyglossia-korean.lua>
-% \fi
-% \clearpage
-%
-% \subsection{polyglossia-korean.lua}
-% \begin{macrocode}
---
--- polyglossia-korean.lua
--- part of polyglossia v2.1 -- 2024/03/07
+-- polyglossia-cjk-spacing.lua
+-- part of polyglossia v2.2 -- 2024/07/15
--
local glyph_id = node.id"glyph"
@@ -7577,13 +7434,17 @@ local hbox_id = node.id"hlist"
local vbox_id = node.id"vlist"
local glue_id = node.id"glue"
local penalty_id = node.id"penalty"
-local disc_id = node.id"disc"
+local whatsit_id = node.id"whatsit"
+local math_id = node.id"math"
--
--- attr_korean: variant = plain (0), classic (1), modern (2)
+-- attr_cjk: variant = plain: 0, JP/classic: 1, KR/modern: 2, SC: 3, TC: 4
+--
+local attr_cjk = luatexbase.attributes["xpg@attr@cjkspacing"]
+--
+-- attr_josa: ONLY For Korean. DO NOT declare \newattribute for other langs
--
-local attr_korean = luatexbase.attributes["xpg@attr@korean"]
-local attr_josa = luatexbase.attributes["xpg@attr@autojosa"]
+local attr_josa = luatexbase.attributes["xpg@attr@autojosa"]
--
-- characters after which linebreak is not allowed
@@ -7632,9 +7493,9 @@ local nobr_after = {
-- characters before which linebreak is not allowed
-- (currently, not much differences among the followings)
-- 1: normal chars
--- 2: hangul jamo vowels and trailing consonants
+-- 2: hangul jamo vowels and trailing consonants plus combinings
-- 3: kana small letters
--- 0: dashes (supress visible spacing)
+-- 0: dashes (suppress visible spacing after this char)
--
local nobr_before = setmetatable({
[0x21] = 1, -- ! EXCLAMATION MARK
@@ -7645,7 +7506,7 @@ local nobr_before = setmetatable({
[0x2D] = 0, -- - HYPHEN-MINUS
[0x2E] = 1, -- . FULL STOP
[0x2F] = 0, -- / SOLIDUS
- [0x3A] = 0, -- : COLON
+ [0x3A] = 1, -- : COLON
[0x3B] = 1, -- ; SEMICOLON
[0x3E] = 1, -- > GREATER-THAN SIGN
[0x3F] = 1, -- ? QUESTION MARK
@@ -7657,11 +7518,11 @@ local nobr_before = setmetatable({
[0xBB] = 1, -- » RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
[0x2013] = 0, -- – EN DASH
[0x2014] = 0, -- — EM DASH
- [0x2015] = 1, -- ― HORIZONTAL BAR
+ [0x2015] = 0, -- ― HORIZONTAL BAR
[0x2019] = 1, -- ’ RIGHT SINGLE QUOTATION MARK
[0x201D] = 1, -- †RIGHT DOUBLE QUOTATION MARK
- [0x2025] = 1, -- ‥ TWO DOT LEADER
- [0x2026] = 1, -- … HORIZONTAL ELLIPSIS
+ [0x2025] = 0, -- ‥ TWO DOT LEADER
+ [0x2026] = 0, -- … HORIZONTAL ELLIPSIS
[0x232A] = 1, -- 〉 RIGHT-POINTING ANGLE BRACKET
[0x3001] = 1, -- 〠IDEOGRAPHIC COMMA
[0x3002] = 1, -- 。 IDEOGRAPHIC FULL STOP
@@ -7693,10 +7554,10 @@ local nobr_before = setmetatable({
[0x308E] = 3, -- ã‚Ž HIRAGANA LETTER SMALL WA
[0x3095] = 3, -- ã‚• HIRAGANA LETTER SMALL KA
[0x3096] = 3, -- ã‚– HIRAGANA LETTER SMALL KE
- [0x3099] = 1, -- COMBINING KATAKANA-HIRAGANA VOICED SOUND MARK
- [0x309A] = 1, -- COMBINING KATAKANA-HIRAGANA SEMI-VOICED SOUND MARK
- [0x309B] = 1, -- ã‚› KATAKANA-HIRAGANA VOICED SOUND MARK
- [0x309C] = 1, -- ゜ KATAKANA-HIRAGANA SEMI-VOICED SOUND MARK
+ [0x3099] = 2, -- COMBINING KATAKANA-HIRAGANA VOICED SOUND MARK
+ [0x309A] = 2, -- COMBINING KATAKANA-HIRAGANA SEMI-VOICED SOUND MARK
+ [0x309B] = 2, -- ã‚› KATAKANA-HIRAGANA VOICED SOUND MARK
+ [0x309C] = 2, -- ゜ KATAKANA-HIRAGANA SEMI-VOICED SOUND MARK
[0x309D] = 1, -- ã‚ HIRAGANA ITERATION MARK
[0x309E] = 1, -- ã‚ž HIRAGANA VOICED ITERATION MARK
[0x30A0] = 1, -- ã‚  KATAKANA-HIRAGANA DOUBLE HYPHEN
@@ -7716,9 +7577,9 @@ local nobr_before = setmetatable({
[0x30FC] = 1, -- ー KATAKANA-HIRAGANA PROLONGED SOUND MARK
[0x30FD] = 1, -- ヽ KATAKANA ITERATION MARK
[0x30FE] = 1, -- ヾ KATAKANA VOICED ITERATION MARK
- [0xFE30] = 1, -- ︰ PRESENTATION FORM FOR VERTICAL TWO DOT LEADER
- [0xFE31] = 1, -- ︱ PRESENTATION FORM FOR VERTICAL EM DASH
- [0xFE32] = 1, -- ︲ PRESENTATION FORM FOR VERTICAL EN DASH
+ [0xFE30] = 0, -- ︰ PRESENTATION FORM FOR VERTICAL TWO DOT LEADER
+ [0xFE31] = 0, -- ︱ PRESENTATION FORM FOR VERTICAL EM DASH
+ [0xFE32] = 0, -- ︲ PRESENTATION FORM FOR VERTICAL EN DASH
[0xFE36] = 1, -- ︶ PRESENTATION FORM FOR VERTICAL RIGHT PARENTHESIS
[0xFE38] = 1, -- ︸ PRESENTATION FORM FOR VERTICAL RIGHT CURLY BRACKET
[0xFE3A] = 1, -- ︺ PRESENTATION FORM FOR VERTICAL RIGHT TORTOISE SHELL BRACKET
@@ -7745,18 +7606,18 @@ local nobr_before = setmetatable({
[0xFF63] = 1, -- ï½£ HALFWIDTH RIGHT CORNER BRACKET
[0xFF64] = 1, -- 、 HALFWIDTH IDEOGRAPHIC COMMA
[0xFF65] = 1, -- ï½¥ HALFWIDTH KATAKANA MIDDLE DOT
- [0xFF9E] = 1, -- ゙ HALFWIDTH KATAKANA VOICED SOUND MARK
- [0xFF9F] = 1, -- ゚ HALFWIDTH KATAKANA SEMI-VOICED SOUND MARK
+ [0xFF9E] = 2, -- ゙ HALFWIDTH KATAKANA VOICED SOUND MARK
+ [0xFF9F] = 2, -- ゚ HALFWIDTH KATAKANA SEMI-VOICED SOUND MARK
}, { __index = function(_,c)
if c >= 0x1160 and c <= 0x11FF then return 2 end
if c >= 0xD7B0 and c <= 0xD7FF then return 2 end
- if c >= 0x302A and c <= 0x302F then return 1 end
+ if c >= 0x302A and c <= 0x302F then return 2 end -- tone marks
if c >= 0x31F0 and c <= 0x31FF then return 3 end
if c >= 0xFF67 and c <= 0xFF70 then return 3 end
- if c >= 0xFE00 and c <= 0xFE0F then return 1 end
+ if c >= 0xFE00 and c <= 0xFE0F then return 2 end -- variation selectors
if c >= 0xFE10 and c <= 0xFE19 and not (c == 0xFE17) then return 1 end
if c >= 0xFE50 and c <= 0xFE58 then return 1 end
- if c >= 0xE0100 and c <= 0xE01EF then return 1 end
+ if c >= 0xE0100 and c <= 0xE01EF then return 2 end -- variation selecters
end
})
@@ -7774,6 +7635,7 @@ local function is_cjk (c)
or c >= 0xFF00 and c <= 0xFFEF
or c >= 0x1F100 and c <= 0x1F2FF
or c >= 0x20000 and c <= 0x2FA1F
+ or c >= 0x30000 and c <= 0x323AF
or nobr_after[c] and c > 0x2014
or nobr_before[c] and c > 0x2014
end
@@ -7813,8 +7675,28 @@ local charclass = setmetatable({
}, { __index = function() return 0 end })
--
+-- get character class
+-- var : variant = plain, JP/classic, KR/modern, SC, TC
+-- c : codepoint
+--
+local function get_charclass (var, c)
+ if var < 3 then
+ return charclass[c]
+ elseif var == 3 then
+ -- SC : these are left aligned
+ return (c == 0xFF01 or c == 0xFF1F) and 4 -- FULLWIDTH EXCLAMATION/QUESTION MARK
+ or (c == 0xFF1A or c == 0xFF1B) and 2 -- FULLWIDTH COLON/SEMICOLON
+ or charclass[c]
+ end
+ -- TC : these are center aligned
+ return (c == 0x3001 or c == 0xFF0C) and 3 -- IDEOGRAPHIC/FULLWIDTH COMMA
+ or (c == 0x3002 or c == 0xFF0E) and 3 -- IDEOGRAPHIC/FULLWIDTH FULL STOP -- 5 ?
+ or charclass[c]
+end
+
+--
-- table for spacing between char classes
--- 1 stands for 0.5*fontsize when variant=classic
+-- 1 stands for 0.5*fontsize when variant = JP/classic or SC or TC
--
local intercharclass = { [0] =
{ [0] = nil, {1,1}, nil, {.5,.5} },
@@ -7846,7 +7728,7 @@ end
--
-- return 0.5*fontsize of given fontid
--- space: true if variant=modern; then 0.5*interword_space
+-- space: true if variant=KR/modern; then 0.5*interword_space
--
local function get_font_size (fid, space)
local size = font.getparameters(fid)
@@ -7860,7 +7742,7 @@ end
--
-- charclass 1 thru 4 will be packed in \hbox to 0.5em{\hss? curr \hss?}
--- when variant=classic/modern
+-- when variant ~= plain
--
local function glyph_to_box (head, curr, class)
local g, h = curr
@@ -7889,7 +7771,7 @@ end
--
-- insert spacing defined as charclass[a][b] between a and b
-- f: fontid
--- var: variant = plain, classic, modern
+-- var: variant = plain, JP/classic, KR/modern, SC, TC
-- cc: charclass of current char
-- nc: charclass of next char
-- nobr: linebreak is not allowed
@@ -7908,12 +7790,16 @@ end
--
-- insert inter-character spacing in other normal cases
--- f: fontid
--- var: variant = plain, classic, modern
--- x: true between cjk and non-cjk (a little more spacing)
+-- f: fontid
+-- var: variant = plain, JP/classic, KR/modern, SC, TC
+-- nobr: no linebreak
+-- x: true between cjk and non-cjk (a little more spacing)
--
-local function insert_penalty_glue (head, curr, f, var, x)
- if var ~= 1 then
+local function insert_penalty_glue (head, curr, f, var, nobr, x)
+ if nobr then
+ local penalty = get_new_penalty(10000)
+ head, curr = node.insert_after(head, curr, penalty)
+ elseif var == 0 or var == 2 then
local penalty = get_new_penalty(50)
head, curr = node.insert_after(head, curr, penalty)
end
@@ -7929,53 +7815,64 @@ end
--
-- main process for linebreak and inter-character spacing
--- lb: true if pre_linebreak_filter
--
-local function korean_break (head, lb)
+local function cjk_break (head)
local curr = head
while curr do
- if curr.id == glyph_id then
- local var = node.has_attribute(curr, attr_korean)
+ if attr_cjk and (curr.id == glyph_id or curr.id == math_id and curr.subtype == 1) then
+ local var = node.has_attribute(curr, attr_cjk)
if var then
- local c, f = curr.char or 0, curr.font or 0
- local cc, cjkc = charclass[c], is_cjk(c)
+ local c, f = curr.char or 0, curr.font
+ local cc, cjkc = get_charclass(var, c), is_cjk(c)
-- compress cjk punctuations when charclass is 1 thru 4
if var > 0 and cc > 0 and cc < 5 then
head, curr = glyph_to_box(head, curr, cc)
end
- local next = curr.next
- if next and next.id == glyph_id then
+ local next = node.getnext(curr)
+ while next and next.id == whatsit_id do -- skip whatsit nodes
+ curr, next = next, node.getnext(next)
+ end
+
+ if next and (next.id == glyph_id or next.id == math_id and next.subtype == 0) then
local n = next.char or 0
- local nc = charclass[n]
+ f = f or next.font or 0 -- in case of curr == math_off
+
+ -- skip combining. or dash+dash case to suppress stretching
+ if nobr_before[n] == 2 or (nobr_before[c] == 0 and nobr_before[n] == 0) then
+ goto skip_combining
+ end
+
+ local nc = get_charclass(var, n)
local nobr = nobr_before[n] or nobr_after[c]
-- insert spacing as of intercharclass
if var > 0 and intercharclass[cc][nc] then
head, curr = insert_cjk_penalty_glue(head, curr, f, var, cc, nc, nobr)
- -- or insert spacing when linebreak is allowed
- elseif not nobr then
+ else
local cjkn = is_cjk(n)
-- if curr or next is cjk char
if cjkc or cjkn then
- -- if between cjk and non-cjk
- if var > 0 and not (cjkc and cjkn) and nobr_before[c] ~= 0 then
- head, curr = insert_penalty_glue(head, curr, f, var, true)
+ -- plain variant / cjk+cjk / nobr cjk+noncjk / after dash
+ -- : insert a 0pt glue
+ if var == 0 or (cjkc and cjkn) or nobr or nobr_before[c] == 0 then
+ head, curr = insert_penalty_glue(head, curr, f, var, nobr)
- -- or under pre_linebreak_filter
- elseif lb then
- head, curr = insert_penalty_glue(head, curr, f, var)
+ -- other cases: insert a small glue
+ else
+ head, curr = insert_penalty_glue(head, curr, f, var, nobr, true)
end
end
end
end
end
end
- curr = curr.next
+ ::skip_combining::
+ curr = node.getnext(curr)
end
return head
end
@@ -7989,7 +7886,7 @@ end
local function reorder_tm (head)
local curr, tone = node.slide(head)
while curr do
- if curr.id == glyph_id and node.has_attribute(curr, attr_korean) then
+ if curr.id == glyph_id and node.has_attribute(curr, attr_cjk) then
local f = font.getfont(curr.font) or font.fonts[curr.font]
if f and f.hb then -- harfbuzz do the right thing
tone = nil
@@ -8005,7 +7902,7 @@ local function reorder_tm (head)
end
end
end
- curr = curr.prev
+ curr = node.getprev(curr)
end
return head
end
@@ -8092,7 +7989,7 @@ local function get_prev_char (p)
local pc = get_prev_char(node.slide(p.head))
if pc then return pc end
end
- p = p.prev
+ p = node.getprev(p)
end
end
@@ -8107,10 +8004,10 @@ local function auto_josa (head)
if josa then
local cc = curr.char or 0
if josa == 0 then
- josa = josa_code[get_prev_char(curr.prev) or 0x30]
+ josa = josa_code[get_prev_char(node.getprev(curr)) or 0x30]
end
if cc == 0xC774 then
- local n = curr.next
+ local n = node.getnext(curr)
if n and n.char and n.char >= 0xAC00 and n.char <= 0xD7A3 then
else
cc = 0xAC00
@@ -8129,7 +8026,7 @@ local function auto_josa (head)
node.unset_attribute(curr, attr_josa)
end
end
- curr = curr.next
+ curr = node.getnext(curr)
end
for _,v in ipairs(tofree) do node.free(v) end
return head
@@ -8140,45 +8037,86 @@ end
-- As char value of glyphs can be changed by opentype GSUB process,
-- we have to occupy the first position among callback functions.
--
-local prepend_to_callback
-if luatexbase.base_add_to_callback then
- prepend_to_callback = function(name, func, desc)
- luatexbase.add_to_callback(name, func, desc, 1)
+luatexbase.add_to_callback( "pre_shaping_filter",
+function(head)
+ if attr_josa then head = auto_josa(head) end
+ head = cjk_break(head)
+ if attr_josa then head = reorder_tm(head) end
+ return head
+end,
+"polyglossia.lang_cjk_spacing")
+
+-- vim:ft=lua:tw=0:sw=4:ts=4:expandtab
+% \end{macrocode}
+% \iffalse
+%</polyglossia-cjk-spacing.lua>
+%<*polyglossia-french.lua>
+% \fi
+% \clearpage
+%
+% \subsection{polyglossia-french.lua}
+% \begin{macrocode}
+--
+-- polyglossia-punct.lua
+-- part of polyglossia v2.2 -- 2024/07/15
+--
+
+require('polyglossia-punct')
+
+local function set_left_space(lang, char, kern, rubber)
+ polyglossia.add_left_spaced_character(lang, char, kern, "space", rubber)
+end
+
+local function set_right_space(lang, char, kern, rubber)
+ polyglossia.add_right_spaced_character(lang, char, kern, "space", rubber)
+end
+
+local function activate_french_punct(thincolonspace, autospaceguillemets)
+ -- We need different language tags here to make switching of options possible
+ -- within a paragraph.
+ local lang = "french"
+ if thincolonspace then
+ lang = lang.."-thincolon"
end
-else
- prepend_to_callback = function(name, func, desc)
- local t = { {func, desc} }
- for _,v in ipairs(luatexbase.callback_descriptions(name)) do
- table.insert(t, {luatexbase.remove_from_callback(name, v)})
- end
- for _,v in ipairs(t) do
- luatexbase.add_to_callback(name, v[1], v[2])
- end
+ if autospaceguillemets then
+ lang = lang.."-autospace"
+ end
+
+ polyglossia.activate_punct(lang)
+ polyglossia.clear_spaced_characters(lang)
+
+ if thincolonspace then
+ set_left_space(lang, ':', 0.5)
+ else
+ set_left_space(lang, ':', 1, true) -- stretchable and shrinkable space
+ end
+
+ set_left_space(lang, '!', 0.5)
+ set_left_space(lang, '?', 0.5)
+ set_left_space(lang, ';', 0.5)
+ set_left_space(lang, '‼', 0.5)
+ set_left_space(lang, 'â‡', 0.5)
+ set_left_space(lang, 'âˆ', 0.5)
+ set_left_space(lang, 'â‰', 0.5)
+ set_left_space(lang, '‽', 0.5) -- U+203D (interrobang)
+
+ if autospaceguillemets then
+ set_left_space(lang, '»', 0.5)
+ set_left_space(lang, '›', 0.5)
+ set_right_space(lang, '«', 0.5)
+ set_right_space(lang, '‹', 0.5)
end
end
-prepend_to_callback ("pre_linebreak_filter",
- function(head)
- head = auto_josa(head)
- head = korean_break(head, true)
- head = reorder_tm(head)
- return head
- end,
- "polyglossia.lang_korean")
-
-prepend_to_callback ("hpack_filter",
- function(head)
- head = auto_josa(head)
- head = korean_break(head)
- head = reorder_tm(head)
- return head
- end,
- "polyglossia.lang_korean")
+local function deactivate_french_punct()
+ polyglossia.deactivate_punct()
+end
--- vim:ft=lua:tw=0:sw=4:ts=4:expandtab
+polyglossia.activate_french_punct = activate_french_punct
+polyglossia.deactivate_french_punct = deactivate_french_punct
% \end{macrocode}
% \iffalse
-%</polyglossia-korean.lua>
+%</polyglossia-french.lua>
%<*polyglossia-latin.lua>
% \fi
% \clearpage
@@ -8187,7 +8125,7 @@ prepend_to_callback ("hpack_filter",
% \begin{macrocode}
--
-- polyglossia-latin.lua
--- part of polyglossia v2.1 -- 2024/03/07
+-- part of polyglossia v2.2 -- 2024/07/15
--
require('polyglossia-punct')
@@ -8242,14 +8180,13 @@ polyglossia.deactivate_latin_punct = deactivate_latin_punct
% \begin{macrocode}
--
-- polyglossia-punct.lua
--- part of polyglossia v2.1 -- 2024/03/07
+-- part of polyglossia v2.2 -- 2024/07/15
--
require('polyglossia') -- just in case...
local add_to_callback = luatexbase.add_to_callback
-local remove_from_callback = luatexbase.remove_from_callback
-local priority_in_callback = luatexbase.priority_in_callback
+local declare_callback_rule = luatexbase.declare_callback_rule
local new_attribute = luatexbase.new_attribute
local node = node
@@ -8573,13 +8510,16 @@ local function activate(lang)
-- important to be able to intermix languages with different spacings
-- in one paragraph.
tex.setattribute(punct_attr, id)
- for _, callback_name in ipairs{ "pre_linebreak_filter", "hpack_filter" } do
- if not priority_in_callback(callback_name, "polyglossia-punct.process") then
- add_to_callback(callback_name, process, "polyglossia-punct.process", 1)
- end
- end
end
+add_to_callback("pre_linebreak_filter",process,"polyglossia-punct.process")
+add_to_callback("hpack_filter",process,"polyglossia-punct.process")
+declare_callback_rule("pre_linebreak_filter",
+ "polyglossia-punct.process", "before", "luaotfload.node_processor")
+declare_callback_rule("hpack_filter",
+ "polyglossia-punct.process", "before", "luaotfload.node_processor")
+
+
local function deactivate()
tex.setattribute(punct_attr, -0x7FFFFFFF) -- this value means "unset"
-- Though it would make compilation slightly faster, it is not possible to
@@ -8610,7 +8550,7 @@ polyglossia.clear_spaced_characters = clear_spaced_characters
% \begin{macrocode}
--
-- polyglossia-sanskrit.lua
--- part of polyglossia v2.1 -- 2024/03/07
+-- part of polyglossia v2.2 -- 2024/07/15
--
require('polyglossia-punct')
@@ -8660,31 +8600,29 @@ polyglossia.deactivate_sanskrit_punct = deactivate_sanskrit_punct
% \begin{macrocode}
--
-- polyglossia-tibt.lua
--- part of polyglossia v2.1 -- 2024/03/07
+-- part of polyglossia v2.2 -- 2024/07/15
--
require('polyglossia') -- just in case...
local add_to_callback = luatexbase.add_to_callback
local remove_from_callback = luatexbase.remove_from_callback
+local declare_callback_rule = luatexbase.declare_callback_rule
local priority_in_callback = luatexbase.priority_in_callback
local next, type = next, type
-
-local nodes, fonts, node = nodes, fonts, node
-
-local nodecodes = nodes.nodecodes --- <= preloaded node.types()
+local node = node
local insert_node_before = node.insert_before
local insert_node_after = node.insert_after
-local remove_node = nodes.remove
+local remove_node = node.remove
local copy_node = node.copy
local has_attribute = node.has_attribute
local end_of_math = node.end_of_math
if not end_of_math then -- luatex < .76
local traverse_nodes = node.traverse_id
- local math_code = nodecodes.math
+ local math_code = node.id('math_char')
local end_of_math = function (n)
for n in traverse_nodes(math_code, n.next) do
return n
@@ -8692,10 +8630,10 @@ if not end_of_math then -- luatex < .76
end
end
--- node types as of April 2013
-local glyph_code = nodecodes.glyph
-local penalty_code = nodecodes.penalty
-local kern_code = nodecodes.kern
+-- node types as of April 2024
+local glyph_code = node.id('glyph')
+local penalty_code = node.id('penalty')
+local kern_code = node.id('kern')
-- we make a new node, so that we can copy it later on
local penalty_node = node.new(penalty_code)
@@ -8726,7 +8664,6 @@ local function process(head)
end
end
elseif id == math_code then
- -- warning: this is a feature of luatex > 0.76
start = end_of_math(start) -- weird, can return nil .. no math end?
end
if start then
@@ -8739,15 +8676,13 @@ end
local callback_name = "pre_linebreak_filter"
local function activate()
- if not priority_in_callback (callback_name, "polyglossia-tibt.process") then
- add_to_callback(callback_name, process, "polyglossia-tibt.process", 1)
- end
+ add_to_callback(callback_name, process, "polyglossia-tibt.process")
+ declare_callback_rule(callback_name,
+ "polyglossia-tibt.process", "before", "luaotfload.node_processor")
end
local function desactivate()
- if priority_in_callback (callback_name, "polyglossia-tibt.process") then
- remove_from_callback(callback_name, "polyglossia-tibt.process")
- end
+ remove_from_callback(callback_name, "polyglossia-tibt.process")
end
polyglossia.activate_tibt_eol = activate
@@ -8763,7 +8698,7 @@ polyglossia.desactivate_tibt_eol = desactivate
% \begin{macrocode}
--
-- polyglossia.lua
--- part of polyglossia v2.1 -- 2024/03/07
+-- part of polyglossia v2.2 -- 2024/07/15
--
local module_name = "polyglossia"
@@ -8839,7 +8774,7 @@ local function newloader(langentry)
end
-- language info will be written into the .log file
- local s = { "Language data for " .. langentry }
+ local s = { }
for k, v in pairs(langdata) do
if type(v) == 'table' then -- for 'synonyms'
s[#s+1] = k .. "\t" .. table.concat(v,',')
@@ -8847,7 +8782,10 @@ local function newloader(langentry)
s[#s+1] = k .. "\t" .. tostring(v)
end
end
- log_info(table.concat(s,"\n"))
+ local a = {}
+ for _,n in pairs(s) do table.insert(a, n) end
+ table.sort(a)
+ log_info("Language data for " .. langentry .. "\n" .. table.concat(a,"\n"))
--
-- LaTeX's \newlanguage increases language register (count19),
@@ -8857,7 +8795,7 @@ local function newloader(langentry)
-- this possible situation, our newloader() function will
-- unfortunately overwrite the language \lang@xyz.
--
- -- Threfore here we will compare LaTeX's \newlanguage number with
+ -- Therefore here we will compare LaTeX's \newlanguage number with
-- LuaTeX's lang.new() id and select the bigger one for our new
-- language object. Also we will update LaTeX's language register
-- by this new id, so that another possible \newlanguage should not
@@ -8872,7 +8810,7 @@ local function newloader(langentry)
local newlangid = math.max(langcnt, langid)
-- set language register for possible \newlanguage
tex.setcount('global', lang_register, newlangid)
- -- get new lang object if needeed
+ -- get new lang object if needed
if langid ~= newlangid then
langobject = lang.new(newlangid)
end
@@ -9716,7 +9654,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%% This is an algorithm from Reingold & Dershowitz,
-%% Calendrical Calculations, The Millenium Edition
+%% Calendrical Calculations, The Millennium Edition
%%
\def\@FixedFromGregorian#1#2#3#4{%
\setcounter{tmpA}{(#1-1)*365}%
@@ -10069,36 +10007,36 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
% \end{macrocode}
% \iffalse
%</xgreek-fixes.def>
-%<*gloss-acadien.ldf>
+%<*gloss-acadian.ldf>
% \fi
% \clearpage
%
-% \subsection{gloss-acadien.ldf}
+% \subsection{gloss-acadian.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-acadien.ldf}[polyglossia: module for Canadian (Acadian) French]
% We provide this as a babel alias
-\xpg@load@master@language{french}
+\InheritGlossFile{french}
% \end{macrocode}
% \iffalse
-%</gloss-acadien.ldf>
+%</gloss-acadian.ldf>
%<*gloss-aeb.ldf>
% \fi
% \clearpage
%
% \subsection{gloss-aeb.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-aeb.ldf}[polyglossia: module for aeb (Arabic)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{arabic}
+\InheritGlossFile{arabic}
% \end{macrocode}
% \iffalse
@@ -10109,13 +10047,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-af.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-af.ldf}[polyglossia: module for af (Afrikaans)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{afrikaans}
+\InheritGlossFile{afrikaans}
% \end{macrocode}
% \iffalse
@@ -10126,13 +10064,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-afb.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-afb.ldf}[polyglossia: module for afb (Arabic)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{arabic}
+\InheritGlossFile{arabic}
% \end{macrocode}
% \iffalse
@@ -10143,7 +10081,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-afrikaans.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-afrikaans.ldf}[polyglossia: module for Afrikaans]
@@ -10161,22 +10099,21 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
% BCP-47 compliant aliases
\setlanguagealias*{afrikaans}{af}
-\define@boolkey{afrikaans}[afrikaans@]{babelshorthands}[true]{}
-
+\DeclareKeys[polyglossia/gloss/afrikaans]
+ {
+ babelshorthands.if = afrikaans@babelshorthands,
+ babelshorthands.default:n = true,
+ }
% Register default options
-\xpg@initialize@gloss@options{afrikaans}{babelshorthands=false}
+\InitializeGlossOptions{afrikaans}{babelshorthands=false}
\ifsystem@babelshorthands
- \setkeys{afrikaans}{babelshorthands=true}
+ \SetGlossOptions{afrikaans}{babelshorthands=true}
\else
- \setkeys{afrikaans}{babelshorthands=false}
+ \SetGlossOptions{afrikaans}{babelshorthands=false}
\fi
-\ifcsundef{initiate@active@char}{%
- \input{babelsh.def}%
- \initiate@active@char{"}%
- \shorthandoff{"}%
-}{}
+\InitializeBabelShorthands
\def\afrikaans@shorthands{%
\xpg@activate@shorthands%
@@ -10248,7 +10185,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-albanian.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-albanian.ldf}[polyglossia: module for Albanian]
@@ -10305,13 +10242,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-am.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-am.ldf}[polyglossia: module for am (Amharic)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{amharic}
+\InheritGlossFile{amharic}
% \end{macrocode}
% \iffalse
@@ -10322,13 +10259,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-american.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-american.ldf}[polyglossia: module for American English]
% We provide this as a babel alias
-\xpg@load@master@language{english}
+\InheritGlossFile{english}
% \end{macrocode}
% \iffalse
@@ -10339,7 +10276,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-amharic.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-amharic.ldf}[polyglossia: module for Amharic]
\PolyglossiaSetup{amharic}{
@@ -10559,13 +10496,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-apd.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-apd.ldf}[polyglossia: module for apd (Arabic)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{arabic}
+\InheritGlossFile{arabic}
% \end{macrocode}
% \iffalse
@@ -10576,13 +10513,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-ar-IQ.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-ar-IQ.ldf}[polyglossia: module for ar-IQ (Arabic)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{arabic}
+\InheritGlossFile{arabic}
\SetLanguageKeys{arabic}{bcp47=ar-IQ,bcp47-language=ar,bcp47-region=IQ}%
@@ -10595,13 +10532,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-ar-JO.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-ar-JO.ldf}[polyglossia: module for ar-JO (Arabic)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{arabic}
+\InheritGlossFile{arabic}
\SetLanguageKeys{arabic}{bcp47=ar-JO,bcp47-language=ar,bcp47-region=JO}%
@@ -10614,13 +10551,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-ar-LB.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-ar-LB.ldf}[polyglossia: module for ar-LB (Arabic)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{arabic}
+\InheritGlossFile{arabic}
\SetLanguageKeys{arabic}{bcp47=ar-LB,bcp47-language=ar,bcp47-region=LB}%
@@ -10633,13 +10570,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-ar-MR.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-ar-MR.ldf}[polyglossia: module for ar-MR (Arabic)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{arabic}
+\InheritGlossFile{arabic}
\SetLanguageKeys{arabic}{bcp47=ar-MR,bcp47-language=ar,bcp47-region=MR}%
@@ -10652,13 +10589,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-ar-PS.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-ar-PS.ldf}[polyglossia: module for ar-PS (Arabic)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{arabic}
+\InheritGlossFile{arabic}
\SetLanguageKeys{arabic}{bcp47=ar-PS,bcp47-language=ar,bcp47-region=PS}%
@@ -10671,13 +10608,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-ar-SY.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-ar-SY.ldf}[polyglossia: module for ar-SY (Arabic)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{arabic}
+\InheritGlossFile{arabic}
\SetLanguageKeys{arabic}{bcp47=ar-SY,bcp47-language=ar,bcp47-region=SY}%
@@ -10690,13 +10627,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-ar-YE.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-ar-YE.ldf}[polyglossia: module for ar-YE (Arabic)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{arabic}
+\InheritGlossFile{arabic}
\SetLanguageKeys{arabic}{bcp47=ar-YE,bcp47-language=ar,bcp47-region=YE}%
@@ -10709,13 +10646,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-ar.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-ar.ldf}[polyglossia: module for ar (Arabic)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{arabic}
+\InheritGlossFile{arabic}
% \end{macrocode}
% \iffalse
@@ -10726,7 +10663,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-arabic.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-arabic.ldf}[polyglossia: module for Arabic]
\RequireBidi
@@ -10766,104 +10703,112 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\setlanguagealias*[locale=default]{arabic}{apd}
\setlanguagealias*[locale=mashriq]{arabic}{ar-PS}
-\define@boolkey{arabic}[arabic@]{abjadalph}[true]{}
-
\newif\ifeastern@numerals
-\define@choicekey*+{arabic}{numerals}[\xpg@val\xpg@nr]{mashriq,maghrib,eastern,western}[mashriq]{%
- \ifcase\xpg@nr\relax
- % mashriq:
- \eastern@numeralstrue%
- \or
- % maghrib:
- \eastern@numeralsfalse
- \or
- % eastern:
- \eastern@numeralstrue%
- \or
- % western:
- \eastern@numeralsfalse
- \fi
- \xpg@info{Option: Arabic, numerals=\xpg@val}%
-}{\xpg@warning{Unknown Arabic numerals option `#1'}}
-
-%this is needed for \abjad in arabicnumbers.sty
-\define@boolkey{arabic}[arabic@]{abjadjimnotail}[true]{%
- \ifarabic@abjadjimnotail
- \abjad@jim@notailtrue%
- \else
- \abjad@jim@notailfalse
- \fi}
-
-\define@choicekey*+{arabic}{locale}[\xpg@val\xpg@nr]{default,mashriq,libya,algeria,tunisia,morocco,mauritania}[default]{%
- \ifcase\xpg@nr\relax
- % default:
- \eastern@numeralstrue%
- \SetLanguageKeys{arabic}{bcp47=ar-YE,bcp47-language=ar}%
- \xpg@info{Option: arabic, locale=default}%
- \or
- % mashriq:
- \eastern@numeralstrue%
- \SetLanguageKeys{arabic}{bcp47=ar-IQ,bcp47-language=ar}%
- \xpg@info{Option: arabic, locale=mashriq}%
- \or
- % libya:
- \eastern@numeralstrue%
- \SetLanguageKeys{arabic}{bcp47=ayl,bcp47-language=ar,bcp47-region=LY}%
- \xpg@info{Option: arabic, locale=libya}%
- \or
- % algeria:
- \eastern@numeralsfalse%
- \SetLanguageKeys{arabic}{bcp47=arq,bcp47-language=ar,bcp47-region=DZ,bcp47-extension-u=nu-latn}%
- \xpg@info{Option: arabic, locale=algeria}%
- \or
- % tunisia:
- \eastern@numeralsfalse%
- \SetLanguageKeys{arabic}{bcp47=aeb,bcp47-language=ar,bcp47-region=TN,bcp47-extension-u=nu-latn}%
- \xpg@info{Option: arabic, locale=tunisia}%
- \or
- % morocco:
- \eastern@numeralsfalse%
- \SetLanguageKeys{arabic}{bcp47=ary,bcp47-language=ar,bcp47-region=MA,bcp47-extension-u=nu-latn}%
- \xpg@info{Option: arabic, locale=morocco}%
- \or
- % mauritania:
- \eastern@numeralstrue%
- \SetLanguageKeys{arabic}{bcp47=ar-MR,bcp47-language=ar,bcp47-region=MR}%
- \xpg@info{Option: arabic, locale=mauritania}%
- \fi
- \gdef\@@arabic@month{\@arabic@month{#1}}
- }{\xpg@warning{Unknown Arabic locale `#1'}}
-
\newif\if@hijrical
-\define@choicekey*+{arabic}{calendar}[\xpg@val\xpg@nr]{gregorian,hijri,islamic}[gregorian]{%
- \ifcase\xpg@nr\relax
- % gregorian:
- \@hijricalfalse
- \or
- % hijri:
- \@hijricaltrue
- \or
- % islamic:
- \@hijricaltrue
- \fi
- \xpg@info{Option: Arabic, calendar=\xpg@val}%
-}{\xpg@warning{Unknown Arabic calendar option `#1'}}
-
-
-\define@key{arabic}{hijricorrection}[0]{%
- \gdef\arabic@hijri@correction{#1}}%
-
\newif\ifarabic@customsep\arabic@customsepfalse
-\def\xpg@sepmark{}
-\define@key{arabic}{sectionsep}[.]{%
- \arabic@customseptrue%
- \gdef\xpg@sepmark{#1}%
-}
+
+\DeclareKeys[polyglossia/gloss/arabic]
+ {
+ hijricorrection.code = \gdef\arabic@hijri@correction{#1},
+ hijricorrection.default:n = 0,
+ sectionsep.code = \gdef\xpg@sepmark{#1}\arabic@customseptrue,
+ sectionsep.default:n = .,
+ abjadalph.if = arabic@abjadalph,
+ abjadalph.default:n = true,
+ abjadjimnotail.if = abjad@jim@notail,
+ abjadjimnotail.default:n = true,
+ numerals.choice:,
+ numerals / mashriq.code =
+ {%
+ \eastern@numeralstrue
+ },
+ numerals / maghrib.code =
+ {%
+ \eastern@numeralsfalse
+ },
+ numerals / eastern.code =
+ {%
+ \eastern@numeralstrue
+ },
+ numerals / western.code =
+ {%
+ \eastern@numeralsfalse
+ },
+ numerals.default:n = mashriq,
+ numerals/unknown.code = \xpg@warning{Unknown Arabic numerals option `#1'},
+ locale.choice:,
+ locale / default.code =
+ {%
+ \eastern@numeralstrue
+ \def\abjad@one{ا}%
+ \SetLanguageKeys{arabic}{bcp47=ar-YE,bcp47-language=ar}%
+ \gdef\@@arabic@month{\@arabic@month{#1}}%
+ },
+ locale / mashriq.code =
+ {%
+ \eastern@numeralstrue
+ \def\abjad@one{ا}%
+ \SetLanguageKeys{arabic}{bcp47=ar-IQ,bcp47-language=ar}%
+ \gdef\@@arabic@month{\@arabic@month{#1}}%
+ },
+ locale / libya.code =
+ {%
+ \eastern@numeralstrue
+ \def\abjad@one{ا}%
+ \SetLanguageKeys{arabic}{bcp47=ayl,bcp47-language=ar,bcp47-region=LY}%
+ \gdef\@@arabic@month{\@arabic@month{#1}}%
+ },
+ locale / algeria.code =
+ {%
+ \eastern@numeralsfalse
+ \def\abjad@one{Ø£}%
+ \SetLanguageKeys{arabic}{bcp47=arq,bcp47-language=ar,bcp47-region=DZ,bcp47-extension-u=nu-latn}%
+ \gdef\@@arabic@month{\@arabic@month{#1}}%
+ },
+ locale / tunisia.code =
+ {%
+ \eastern@numeralsfalse
+ \def\abjad@one{Ø£}%
+ \SetLanguageKeys{arabic}{bcp47=aeb,bcp47-language=ar,bcp47-region=TN,bcp47-extension-u=nu-latn}%
+ \gdef\@@arabic@month{\@arabic@month{#1}}%
+ },
+ locale / morocco.code =
+ {%
+ \eastern@numeralsfalse
+ \def\abjad@one{Ø£}%
+ \SetLanguageKeys{arabic}{bcp47=ary,bcp47-language=ar,bcp47-region=MA,bcp47-extension-u=nu-latn}%
+ \gdef\@@arabic@month{\@arabic@month{#1}}%
+ },
+ locale / mauritania.code =
+ {%
+ \eastern@numeralstrue
+ \def\abjad@one{ا}%
+ \SetLanguageKeys{arabic}{bcp47=ar-MR,bcp47-language=ar,bcp47-region=MR}%
+ \gdef\@@arabic@month{\@arabic@month{#1}}%
+ },
+ locale.default:n = default,
+ locale/unknown.code = \xpg@warning{Unknown Arabic locale `#1'},
+ calendar.choice:,
+ calendar / gregorian.code =
+ {%
+ \@hijricalfalse
+ },
+ calendar / hijri.code =
+ {%
+ \@hijricaltrue
+ },
+ calendar / islamic.code =
+ {%
+ \@hijricaltrue
+ },
+ calendar.default:n = gregorian,
+ calendar/unknown.code = \xpg@warning{Unknown Arabic calendar option `#1'}
+ }
% Register default options
-\xpg@initialize@gloss@options{arabic}{locale=default,calendar=gregorian,numerals=mashriq,hijricorrection=0,abjadjimnotail=false}
+\InitializeGlossOptions{arabic}{locale=default,calendar=gregorian,numerals=mashriq,hijricorrection=0,abjadjimnotail=false}
% Register alias options
-\xpg@set@alias@values{arabic}{calendar}{islamic}{hijri}
+\SetLanguageAliasValues{arabic}{calendar}{islamic,hijri}
\def\arabicgregmonth@default#1{\ifcase#1%
% Egypt, Sudan, Yemen and Golf states
@@ -10883,9 +10828,12 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\def\arabicgregmonth@mauritania#1{\ifcase#1%
\or يناير\or Ùبراير\or مارس\or إبريل\or مايو\or يونيو\or يوليو\or أغشت\or شتمبر\or أكتوبر\or نوÙمبر\or دجمبر\fi}
-\def\@arabic@month#1{\ifcsdef{arabicgregmonth@#1}{\expandafter\csname arabicgregmonth@#1\endcsname}%
-{\xpg@warning{Option `locale=#1' is not defined for Arabic: using `default' instead}%
-\arabicgregmonth@default}}
+\def\@arabic@month#1{%
+ \@ifundefined{arabicgregmonth@#1}%
+ {\xpg@warning{Option `locale=#1' is not defined for Arabic: using `default' instead}%
+ \arabicgregmonth@default}%
+ {\expandafter\csname arabicgregmonth@#1\endcsname}%
+}
%\Hijritoday is now locale-aware and will format the date with this macro:
\DefineFormatHijriDate{arabic}{\@ensure@RTL{\arabicnumber{\value{Hijriday}}%
@@ -10917,18 +10865,18 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
}
\def\datearabic{%
\def\today{%
- \if@hijrical%
+ \if@hijrical
\Hijritoday[\arabic@hijri@correction]%
\else%
- \if@RTL%
+ \if@RTL
\arabicnumber\day\space\@@arabic@month{\month}%
\space\arabicnumber\year%
\else% in LR environment we format the gregorian date within \textenglish
- \ifcsdef{english@loaded}{\textenglish{\today}}%else US format
- {\normalfontlatin\ifcase\month\or January\or February\or March\or April\or May\or June\or%
- July\or August\or September\or October\or November\or December\fi%
+ \iflanguageloaded{english}{\textenglish{\today}}%else US format
+ {\normalfontlatin\ifcase\month\or January\or February\or March\or April\or May\or June\or
+ July\or August\or September\or October\or November\or December\fi
\space\number\day,\space\number\year}%
- \fi%
+ \fi
\fi}}
% Use \providecommand here as the ldf file might
@@ -10954,10 +10902,9 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\or Ø­\or Ø·\or ÙŠ\or Ùƒ\or Ù„\or Ù…\or Ù†%
\or س\or ع\or Ù\or ص\or Ù‚\or ر\or Ø´%
\or ت\or ث\or خ\or ذ\or ض\or ظ\or غ%
- \else\xpg@ill@value{#1}{arabic@abjad@alph}\fi%
+ \else\xpg@ill@value{#1}{arabic@abjad@alph}\fi
}
-
\def\abjadmaghribi#1{%
\ifnum#1>1999\xpg@ill@value{#1}{abjad}%
\else
@@ -10980,111 +10927,111 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%maghribi س -> ص ص -> ض ش -> س ض -> ظ ظ -> غ غ -> ش
\def\abj@maghribi@num@ii#1{%
- \ifcase#1\or ÙŠ\or Ùƒ\or Ù„\or Ù…\or Ù†%
+ \ifcase#1\abjad@zero\or ÙŠ\or Ùƒ\or Ù„\or Ù…\or Ù†%
\or ص\or ع\or Ù\or ض\fi
- \ifnum#1=\z@\abjad@zero\fi\abj@num@i}
+ \abj@num@i}
\def\abj@maghribi@num@iii#1{%
\ifcase#1\or ق\or ر\or س\or ت\or ث%
\or خ\or ذ\or ظ\or غ\fi
- \ifnum#1=\z@\fi\abj@maghribi@num@ii}
+ \abj@maghribi@num@ii}
\def\abj@maghribi@num@iv#1{%
\ifcase#1\or Ø´\fi
- \ifnum#1=\z@\fi\abj@maghribi@num@iii}
+ \abj@maghribi@num@iii}
\def\arabic@numbers{%
\ifarabic@abjadalph
- \let\@alph\abjadalph%
- \let\@Alph\abjadalph%
+ \let\@alph\abjadalph
+ \let\@Alph\abjadalph
\else
- \let\@alph\abjad%
- \let\@Alph\abjad%
+ \let\@alph\abjad
+ \let\@Alph\abjad
\fi
}
\def\noarabic@numbers{%
- \let\@alph\latin@alph%
- \let\@Alph\latin@Alph%
+ \let\@alph\latin@alph
+ \let\@Alph\latin@Alph
}
% Store original definition
\let\xpg@save@arabic\@arabic
\def\arabic@globalnumbers{%
- \let\@arabic\arabicnumber%
+ \let\@arabic\arabicnumber
\renewcommand\thefootnote{\localnumeral*{footnote}}%
\renewcommand\theequation{\localnumeral*{equation}}%
}
\def\noarabic@globalnumbers{%
- \let\@arabic\xpg@save@arabic%
+ \let\@arabic\xpg@save@arabic
}
\def\arabic@xetex@capsformat{%
- \let\xpg@save@sepmark\@SepMark%
+ \let\xpg@save@sepmark\@SepMark
\SepMark{\xpg@sepmark}
}
\def\noarabic@xetex@capsformat{%
- \ifcsdef{xpg@save@sepmark}{%
+ \ifcsname xpg@save@sepmark\endcsname
\SepMark{\xpg@save@sepmark}
- }{}%
+ \fi
}
\def\arabic@luatex@capsformat{%
%
% change chapter and part headings
\ifarabic@customsep
- \ifcsdef{chapter}{%
- \let\xpg@save@thesection\thesection%
+ \ifcsname chapter\endcsname
+ \let\xpg@save@thesection\thesection
\renewcommand*\thesection{\thechapter\xpg@sepmark\@arabic\c@section}
- \let\xpg@save@theequation\theequation%
+ \let\xpg@save@theequation\theequation
\renewcommand*\theequation{%
\ifnum \c@chapter>\z@ \thechapter\xpg@sepmark\fi\@arabic\c@equation}
- \let\xpg@save@thefigure\thefigure%
+ \let\xpg@save@thefigure\thefigure
\renewcommand*\thefigure{%
\ifnum\c@chapter>\z@\thechapter\xpg@sepmark\fi\@arabic\c@figure}
- \let\xpg@save@thetable\thetable%
+ \let\xpg@save@thetable\thetable
\renewcommand*\thetable{%
\ifnum\c@chapter>\z@\thechapter\xpg@sepmark\fi\@arabic\c@table}
- }{}
- \let\xpg@save@thesubsection\thesubsection%
+ \fi
+ \let\xpg@save@thesubsection\thesubsection
\renewcommand\thesubsection
{\thesection\xpg@sepmark\@arabic\c@subsection}
- \let\xpg@save@thesubsubsection\thesubsubsection%
+ \let\xpg@save@thesubsubsection\thesubsubsection
\renewcommand\thesubsubsection{\thesubsection\xpg@sepmark\@arabic\c@subsubsection}
- \let\xpg@save@theparagraph\theparagraph%
+ \let\xpg@save@theparagraph\theparagraph
\renewcommand\theparagraph
{\thesubsubsection\xpg@sepmark\@arabic\c@paragraph}
- \let\xpg@save@thesubparagraph\thesubparagraph%
+ \let\xpg@save@thesubparagraph\thesubparagraph
\renewcommand\thesubparagraph{\theparagraph\xpg@sepmark\@arabic\c@subparagraph}
- \fi% (end \ifarabic@customsep)
+ \fi % (end \ifarabic@customsep)
}
\def\noarabic@luatex@capsformat{%
- \ifcsdef{xpg@save@thesection}{%
- \let\thesection\xpg@save@thesection%
- }{}%
- \ifcsdef{xpg@save@theequation}{%
- \let\theequation\xpg@save@theequation%
- }{}%
- \ifcsdef{xpg@save@thefigure}{%
- \let\thefigure\xpg@save@thefigure%
- }{}%
- \ifcsdef{xpg@save@thetable}{%
- \let\thetable\xpg@save@thetable%
- }{}%
- \ifcsdef{xpg@save@thesubsection}{%
- \let\thesubsection\xpg@save@thesubsection%
- \ifcsdef{xpg@save@thesubsubsection}{%
- \let\thesubsubsection\xpg@save@thesubsubsection%
- }{}%
- }{}%
- \ifcsdef{xpg@save@theparagraph}{%
- \let\theparagraph\xpg@save@theparagraph%
- }{}%
- \ifcsdef{xpg@save@thesubparagraph}{%
- \let\thesubparagraph\xpg@save@thesubparagraph%
- }{}%
+ \ifcsname xpg@save@thesection\endcsname
+ \let\thesection\xpg@save@thesection
+ \fi
+ \ifcsname xpg@save@theequation\endcsname
+ \let\theequation\xpg@save@theequation
+ \fi
+ \ifcsname xpg@save@thefigure\endcsname
+ \let\thefigure\xpg@save@thefigure
+ \fi
+ \ifcsname xpg@save@thetable\endcsname
+ \let\thetable\xpg@save@thetable
+ \fi
+ \ifcsname xpg@save@thesubsection\endcsname
+ \let\thesubsection\xpg@save@thesubsection
+ \ifcsname xpg@save@thesubsubsection\endcsname
+ \let\thesubsubsection\xpg@save@thesubsubsection
+ \fi
+ \fi
+ \ifcsname xpg@save@theparagraph\endcsname
+ \let\theparagraph\xpg@save@theparagraph
+ \fi
+ \ifcsname xpg@save@thesubparagraph\endcsname
+ \let\thesubparagraph\xpg@save@thesubparagraph
+ \fi
}
\def\blockextras@arabic{%
@@ -11096,7 +11043,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\fi
\fi
}
-%
+
\def\noextras@arabic{%
\ifarabic@customsep
\ifxetex
@@ -11116,7 +11063,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-armenian.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-armenian.ldf}[polyglossia: module for Armenian]
@@ -11139,43 +11086,49 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\newif\if@eastern@armenian
\@eastern@armenianfalse
-\define@choicekey*+{armenian}{variant}[\xpg@val\xpg@nr]{western,eastern}[western]{%
- \ifcase\xpg@nr\relax
- % western:
- \@eastern@armenianfalse%
- \or
- % eastern:
- \@eastern@armeniantrue%
- \fi
- \xpg@info{Option: Armenian, variant=\xpg@val}%
-}{\xpg@warning{Unknown Armenian variant `#1'}}
\newif\if@armenian@numerals
\@armenian@numeralsfalse
-\define@key{armenian}{numerals}[armenian]{%
- \ifstrequal{#1}{arabic}{%
- \@armenian@numeralsfalse%
- \SetLanguageKeys{armenian}{bcp47-extension-u=nu-latn}%
- }{%
- \@armenian@numeralstrue%
- \SetLanguageKeys{armenian}{bcp47-extension-u={}}%
- }%
-}
-\define@boolkey{armenian}[armenian@]{capitalyiwn}[true]{%
- \ifarmenian@capitalyiwn
- % MakeUppercase capitalizes the ligature of letters ech and yiwn (U+0587)
- % to capital ech and yiwn (also the output if Armenian is not selected at all)
- \SetLanguageKeys{armenian}{bcp47-casing=hy-x-yiwn,bcp47-extension-x=yiwn}
- \else
- % Capitalize ech and yiwn ligature to capital ech and vew,
- % following Armenian spelling reform
- \SetLanguageKeys{armenian}{bcp47-casing=hy,bcp47-extension-x={}}
- \fi
-}
+\DeclareKeys[polyglossia/gloss/armenian]
+ {
+ variant.choice:,
+ variant / western.code =
+ {%
+ \@eastern@armenianfalse
+ },
+ variant / eastern.code =
+ {%
+ \@eastern@armeniantrue
+ },
+ variant.default:n = western,
+ variant/unknown.code = \xpg@warning{Unknown Armenian variant `#1'},
+ numerals.choice:,
+ numerals / armenian.code =
+ {%
+ \@armenian@numeralstrue
+ \SetLanguageKeys{armenian}{bcp47-extension-u={}}%
+ },
+ numerals / arabic.code =
+ {%
+ \@armenian@numeralsfalse
+ \SetLanguageKeys{armenian}{bcp47-extension-u=nu-latn}%
+ },
+ numerals.default:n = armenian,
+ capitalyiwn.choice:,
+ capitalyiwn / true.code =
+ {%
+ \SetLanguageKeys{armenian}{bcp47-casing=hy-x-yiwn,bcp47-extension-x=yiwn}%
+ },
+ capitalyiwn / false.code =
+ {%
+ \SetLanguageKeys{armenian}{bcp47-casing=hy,bcp47-extension-x={}}%
+ },
+ capitalyiwn.default:n = true
+ }
% Register default options
-\xpg@initialize@gloss@options{armenian}{numerals=armenian,variant=western}
+\InitializeGlossOptions{armenian}{numerals=armenian,variant=western}
% Taken from ArmTeX. Audit!
\def\captionsarmenian{%
@@ -11324,13 +11277,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-arq.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-arq.ldf}[polyglossia: module for arq (Arabic)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{arabic}
+\InheritGlossFile{arabic}
% \end{macrocode}
% \iffalse
@@ -11341,13 +11294,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-ary.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-ary.ldf}[polyglossia: module for ary (Arabic)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{arabic}
+\InheritGlossFile{arabic}
% \end{macrocode}
% \iffalse
@@ -11358,13 +11311,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-arz.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-arz.ldf}[polyglossia: module for arz (Arabic)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{arabic}
+\InheritGlossFile{arabic}
% \end{macrocode}
% \iffalse
@@ -11375,13 +11328,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-ast.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-ast.ldf}[polyglossia: module for ast (Asturian)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{asturian}
+\InheritGlossFile{asturian}
% \end{macrocode}
% \iffalse
@@ -11392,7 +11345,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-asturian.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
% Translated by Xuacu <xuacusk8 at gmail dot com>
% Contributed by Kevin Godby <godbyk at gmail dot com>
@@ -11452,13 +11405,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-australian.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-australian.ldf}[polyglossia: module for Australian English]
% We provide this as a babel alias
-\xpg@load@master@language{english}
+\InheritGlossFile{english}
% \end{macrocode}
% \iffalse
@@ -11469,13 +11422,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-austrian.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-austrian.ldf}[polyglossia: module for Austrian German (old spelling)]
% We provide this as a babel alias
-\xpg@load@master@language{german}
+\InheritGlossFile{german}
% \end{macrocode}
% \iffalse
@@ -11486,13 +11439,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-ayl.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-ayl.ldf}[polyglossia: module for ayl (Arabic)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{arabic}
+\InheritGlossFile{arabic}
% \end{macrocode}
% \iffalse
@@ -11503,13 +11456,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-bahasa.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-bahasa.ldf}[polyglossia: module for Bahasa Indonesia]
% We provide this as a babel alias
-\xpg@load@master@language{malay}
+\InheritGlossFile{malay}
% \end{macrocode}
% \iffalse
@@ -11520,14 +11473,14 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-bahasai.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-bahasai.ldf}[polyglossia: module for Bahasa Indonesia]
% We only provide this gloss for babel compatibility. Since bahasai is
% a malay variety, we use 'malay' with variant 'indonesian' now.
-\xpg@load@master@language{malay}
+\InheritGlossFile{malay}
% \end{macrocode}
% \iffalse
@@ -11538,14 +11491,14 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-bahasam.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-bahasam.ldf}[polyglossia: module for Bahasa Melayu]
% We only provide this gloss for babel compatibility. Since bahasam is
% a malay variety, we use 'malay' with variant 'malaysian' now.
-\xpg@load@master@language{malay}
+\InheritGlossFile{malay}
% \end{macrocode}
% \iffalse
@@ -11556,7 +11509,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-basque.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-basque.ldf}[polyglossia: module for Basque]
\PolyglossiaSetup{basque}{
@@ -11614,13 +11567,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-be-tarask.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-be-tarask.ldf}[polyglossia: module for be-tarask (Belarusian)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{belarusian}
+\InheritGlossFile{belarusian}
% \end{macrocode}
% \iffalse
@@ -11631,13 +11584,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-be.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-be.ldf}[polyglossia: module for be (Belarusian)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{belarusian}
+\InheritGlossFile{belarusian}
% \end{macrocode}
% \iffalse
@@ -11648,7 +11601,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-belarusian.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-belarusian.ldf}[polyglossia: module for Belarusian]
@@ -11676,63 +11629,68 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\setlanguagealias*{belarusian}{be}
\def\belarusian@spelling{modern}
-\define@choicekey*+{belarusian}{spelling}[\xpg@val\xpg@nr]{modern,classic,tarask}[modern]{%
- \ifcase\xpg@nr\relax
- % modern:
- \def\belarusian@spelling{modern}%
- \SetLanguageKeys{belarusian}{bcp47=be,bcp47-variant=1959acad}%
- \or
- % classic:
- \def\belarusian@spelling{tarask}%
- \SetLanguageKeys{belarusian}{bcp47=be-tarask,bcp47-variant=tarask}%
- \or
- % tarask:
- \def\belarusian@spelling{tarask}%
- \SetLanguageKeys{belarusian}{bcp47=be-tarask,bcp47-variant=tarask}%
- \fi
-}{\xpg@warning{Unknown Belarusian spelling `#1'}}
-
\newif\ifcyrillic@numerals
\newif\ifcyrillic@asbuk@numerals
-\define@choicekey*+{belarusian}{numerals}[\xpg@val\xpg@nr]{arabic,cyrillic,cyrillic-trad,cyrillic-alph}[arabic]{%
- \ifcase\xpg@nr\relax
- % arabic:
- \cyrillic@numeralsfalse%
- \cyrillic@asbuk@numeralsfalse%
- \or
- % cyrillic:
- \cyrillic@numeralstrue%
- \cyrillic@asbuk@numeralsfalse%
- \or
- % cyrillic-trad:
- \cyrillic@numeralstrue%
- \cyrillic@asbuk@numeralsfalse%
- \or
- % cyrillic-alph:
- \cyrillic@numeralstrue%
- \cyrillic@asbuk@numeralstrue%
- \fi
- \xpg@info{Option: Belarusian, numerals=\xpg@val}%
-}{\xpg@warning{Unknown Belarusian numerals value `#1'}}
-\define@boolkey{belarusian}[belarusian@]{babelshorthands}[true]{}
+\DeclareKeys[polyglossia/gloss/belarusian]
+ {
+ babelshorthands.if = belarusian@babelshorthands,
+ babelshorthands.default:n = true,
+ spelling.choice:,
+ spelling / modern.code =
+ {%
+ \def\belarusian@spelling{modern}%
+ \SetLanguageKeys{belarusian}{bcp47=be,bcp47-variant=1959acad}%
+ },
+ spelling / classic.code =
+ {%
+ \def\belarusian@spelling{tarask}%
+ \SetLanguageKeys{belarusian}{bcp47=be-tarask,bcp47-variant=tarask}%
+ },
+ spelling / tarask.code =
+ {%
+ \def\belarusian@spelling{tarask}%
+ \SetLanguageKeys{belarusian}{bcp47=be-tarask,bcp47-variant=tarask}%
+ },
+ spelling.default:n = modern,
+ spelling/unknown.code = \xpg@warning{Unknown Belarusian spelling `#1'},
+ numerals.choice:,
+ numerals / arabic.code =
+ {%
+ \cyrillic@numeralsfalse
+ \cyrillic@asbuk@numeralsfalse
+ },
+ numerals / cyrillic.code =
+ {%
+ \cyrillic@numeralstrue
+ \cyrillic@asbuk@numeralsfalse
+ },
+ numerals / cyrillic-trad.code =
+ {%
+ \cyrillic@numeralstrue
+ \cyrillic@asbuk@numeralsfalse
+ },
+ numerals / cyrillic-alph.code =
+ {%
+ \cyrillic@numeralstrue
+ \cyrillic@asbuk@numeralstrue
+ },
+ numerals.default:n = arabic,
+ numerals/unknown.code = \xpg@warning{Unknown Belarusian numerals value `#1'}
+ }
% Register default options
-\xpg@initialize@gloss@options{belarusian}{babelshorthands=false,numerals=arabic,spelling=modern}
+\InitializeGlossOptions{belarusian}{babelshorthands=false,numerals=arabic,spelling=modern}
% Register alias options
-\xpg@set@alias@values{belarusian}{spelling}{classic}{tarask}
+\SetLanguageAliasValues{belarusian}{spelling}{classic,tarask}
\ifsystem@babelshorthands
- \setkeys{belarusian}{babelshorthands=true}
+ \SetGlossOptions{belarusian}{babelshorthands=true}
\else
- \setkeys{belarusian}{babelshorthands=false}
+ \SetGlossOptions{belarusian}{babelshorthands=false}
\fi
-\ifcsundef{initiate@active@char}{%
- \input{babelsh.def}%
- \initiate@active@char{"}%
- \shorthandoff{"}%
-}{}
+\InitializeBabelShorthands
\def\belarusian@shorthands{%
\xpg@activate@shorthands%
@@ -11976,7 +11934,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-bengali.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
% Translations provided by সাজেদà§à¦° রহিম জোয়ারদার <toshazed@gmail.com>
% TODO implement Bengali calendar
@@ -12005,30 +11963,36 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\newif\ifbengali@devanagari@numerals
\newif\ifbengali@bengali@numerals
-\define@choicekey*+{bengali}{numerals}[\xpg@val\xpg@nr]{Devanagari,Bengali,Western}[Devanagari]{%
- \ifcase\xpg@nr\relax
- % Devanagari:
- \bengali@bengali@numeralsfalse%
- \bengali@devanagari@numeralstrue%
- \or
- % Bengali:
- \bengali@bengali@numeralstrue%
- \bengali@devanagari@numeralsfalse%
- \or
- % Western:
- \bengali@bengali@numeralsfalse%
- \bengali@devanagari@numeralsfalse%
- \fi
- \xpg@info{Option: Bengali, numerals=\xpg@val}%
-}{\xpg@warning{Unknown Bengali numeral `#1'}}
\def\extras@bengali{}
\def\noextras@bengali{}
-\define@boolkey{bengali}[bengali@]{changecounternumbering}[true]{}
+\DeclareKeys[polyglossia/gloss/bengali]
+ {
+ changecounternumbering.if = bengali@changecounternumbering,
+ changecounternumbering.default:n = true,
+ numerals.choice:,
+ numerals / devanagari.code =
+ {%
+ \bengali@bengali@numeralsfalse
+ \bengali@devanagari@numeralstrue
+ },
+ numerals / bengali.code =
+ {%
+ \bengali@bengali@numeralstrue
+ \bengali@devanagari@numeralsfalse
+ },
+ numerals / western.code =
+ {%
+ \bengali@bengali@numeralsfalse
+ \bengali@devanagari@numeralsfalse
+ },
+ numerals.default:n = devanagari,
+ numerals/unknown.code = \xpg@warning{Unknown Bengali numeral `#1'}
+ }
% Register default options
-\xpg@initialize@gloss@options{bengali}{changecounternumbering=false,numerals=Devanagari}
+\InitializeGlossOptions{bengali}{changecounternumbering=false,numerals=Devanagari}
\def\captionsbengali{%
\def\refname{তথà§à¦¯à¦¸à§‚তà§à¦°à¦¸à¦®à§‚হ}%
@@ -12117,13 +12081,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-bg.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-bg.ldf}[polyglossia: module for bg (Bulgarian)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{bulgarian}
+\InheritGlossFile{bulgarian}
% \end{macrocode}
% \iffalse
@@ -12134,13 +12098,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-bn.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-bn.ldf}[polyglossia: module for bn (Bengali)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{bengali}
+\InheritGlossFile{bengali}
% \end{macrocode}
% \iffalse
@@ -12151,13 +12115,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-bo.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-bo.ldf}[polyglossia: module for bo (Tibetan)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{tibetan}
+\InheritGlossFile{tibetan}
% \end{macrocode}
% \iffalse
@@ -12168,7 +12132,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-bosnian.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-bosnian.ldf}[polyglossia: module for Bosnian]
@@ -12232,13 +12196,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-br.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-br.ldf}[polyglossia: module for br (Breton)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{breton}
+\InheritGlossFile{breton}
% \end{macrocode}
% \iffalse
@@ -12249,7 +12213,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-brazil.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-brazil.ldf}[polyglossia: module for Brazilian Portuguese]
@@ -12257,7 +12221,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
% 'brazil' was selected in accordance with babel.
% Since brazil is a variety of portuguese, we use 'portuguese' now.
-\xpg@load@master@language{portuguese}
+\InheritGlossFile{portuguese}
% \end{macrocode}
% \iffalse
@@ -12268,7 +12232,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-breton.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-breton.ldf}[polyglossia: module for Breton]
\PolyglossiaSetup{breton}{
@@ -12376,13 +12340,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-british.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-british.ldf}[polyglossia: module for British English]
% We provide this as a babel alias
-\xpg@load@master@language{english}
+\InheritGlossFile{english}
% \end{macrocode}
% \iffalse
@@ -12393,13 +12357,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-bs.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-bs.ldf}[polyglossia: module for bs (Bosnian)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{bosnian}
+\InheritGlossFile{bosnian}
% \end{macrocode}
% \iffalse
@@ -12410,7 +12374,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-bulgarian.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-bulgarian.ldf}[polyglossia: module for Bulgarian]
\PolyglossiaSetup{bulgarian}{
@@ -12473,15 +12437,15 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\def\figurename{Фигура}%
\def\tablename{Таблица}%
%\def\thepart{}%
- %\def\partname{}%
+ \def\partname{ЧаÑÑ‚}%
\def\pagename{Стр.}%
\def\seename{вж.}%
\def\alsoname{вж.\ Ñъщо и}%
\def\enclname{ПриложениÑ}%
\def\ccname{копиÑ}%
- %\def\headtoname{}%
- \def\proofname{Proof}%
- \def\glossaryname{Glossary}%
+ \def\headtoname{За}%
+ \def\proofname{ДоказателÑтво}%
+ \def\glossaryname{Притурка}%
}
\def\datebulgarian{%
@@ -12512,13 +12476,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-ca.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-ca.ldf}[polyglossia: module for ca (Catalan)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{catalan}
+\InheritGlossFile{catalan}
% \end{macrocode}
% \iffalse
@@ -12529,13 +12493,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-canadian.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-canadian.ldf}[polyglossia: module for Canadian English]
% We provide this as a babel alias
-\xpg@load@master@language{english}
+\InheritGlossFile{english}
% \end{macrocode}
% \iffalse
@@ -12546,13 +12510,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-canadien.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-canadien.ldf}[polyglossia: module for Canadian French]
% We provide this as a babel alias
-\xpg@load@master@language{french}
+\InheritGlossFile{french}
% \end{macrocode}
% \iffalse
@@ -12563,7 +12527,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-catalan.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-catalan.ldf}[polyglossia: module for Catalan]
\PolyglossiaSetup{catalan}{
@@ -12581,21 +12545,21 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
% BCP-47 compliant aliases
\setlanguagealias*{catalan}{ca}
-\define@boolkey{catalan}[catalan@]{babelshorthands}[true]{}
+\DeclareKeys[polyglossia/gloss/catalan]
+ {
+ babelshorthands.if = catalan@babelshorthands,
+ babelshorthands.default:n = true,
+ }
\ifsystem@babelshorthands
- \setkeys{catalan}{babelshorthands=true}
+ \SetGlossOptions{catalan}{babelshorthands=true}
\else
- \setkeys{catalan}{babelshorthands=false}
+ \SetGlossOptions{catalan}{babelshorthands=false}
\fi
% Register default options
-\xpg@initialize@gloss@options{catalan}{babelshorthands=false}
+\InitializeGlossOptions{catalan}{babelshorthands=false}
-\ifcsundef{initiate@active@char}{%
- \input{babelsh.def}%
- \initiate@active@char{"}%
- \shorthandoff{"}%
-}{}
+\InitializeBabelShorthands
%%% adapted from Babel's catalan.ldf
\newdimen\leftllkern \newdimen\rightllkern \newdimen\raiselldim
@@ -12732,7 +12696,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-chinese.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-chinese.ldf}[polyglossia: module for Chinese]
@@ -12756,51 +12720,60 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\setlanguagealias*[variant=simplified]{chinese}{zh-CN}
\setlanguagealias*[variant=traditional]{chinese}{zh-TW}
-\providebool{chinese@traditional}
+\@ifundefined{ifchinese@traditional}%
+ {\newif\ifchinese@traditional}{}
-\def\chinese@variant{chinese}
-
-\newif\ifchinese@numerals
-\define@key{chinese}{numerals}[arabic]{%
- \ifstrequal{#1}{chinese}%
- {\chinese@numeralstrue%
- \SetLanguageKeys{chinese}{bcp47-extension-u=nu-hant}%
- }{\chinese@numeralsfalse%
- \SetLanguageKeys{chinese}{bcp47-extension-u=nu-latn}%
- }%
-}
+\@ifundefined{ifchinese@numerals}%
+ {\newif\ifchinese@numerals}{}
+\def\chinese@variant{chinese}
-\define@choicekey*+{chinese}{variant}[\xpg@val\xpg@nr]{cn,simplified,tw,traditional}[cn]{%
- \ifcase\xpg@nr\relax
- % cn:
- \chinese@traditionalfalse
- \SetLanguageKeys{chinese}{language={Chinese Simplified},langtag=ZHS,bcp47=zh-CN,bcp47-language=zh,bcp47-region=CN,bcp47-script=Hans}%
- \xpg@info{Option: Chinese, variant=simplified}%
- \or
- % simplified:
- \chinese@traditionalfalse
- \SetLanguageKeys{chinese}{language={Chinese Simplified},langtag=ZHS,bcp47=zh-CN,bcp47-language=zh,bcp47-region=CN,bcp47-script=Hans}%
- \xpg@info{Option: Chinese, variant=simplified}%
- \or
- % tw:
- \chinese@traditionaltrue
- \SetLanguageKeys{chinese}{language={Chinese Traditional},langtag=ZHT,bcp47=zh-TW,bcp47-language=zh,bcp47-region=TW,bcp47-script=Hant}%
- \xpg@info{Option: Chinese, variant=traditional}%
- \or
- % traditional:
- \chinese@traditionaltrue
- \SetLanguageKeys{chinese}{language={Chinese Traditional},langtag=ZHT,bcp47=zh-TW,bcp47-language=zh,bcp47-region=TW,bcp47-script=Hant}%
- \xpg@info{Option: Chinese, variant=traditional}%
- \fi
-}{\xpg@warning{Unknown Chinese variant `#1'}}
+\DeclareKeys[polyglossia/gloss/chinese]
+ {
+ variant.choice:,
+ variant / cn.code =
+ {%
+ \chinese@traditionalfalse
+ \SetLanguageKeys{chinese}{language={Chinese Simplified},langtag=ZHS,bcp47=zh-CN,bcp47-language=zh,bcp47-region=CN,bcp47-script=Hans}%
+ },
+ variant / simplified.code =
+ {%
+ \chinese@traditionalfalse
+ \SetLanguageKeys{chinese}{language={Chinese Simplified},langtag=ZHS,bcp47=zh-CN,bcp47-language=zh,bcp47-region=CN,bcp47-script=Hans}%
+ },
+ variant / tw.code =
+ {%
+ \chinese@traditionaltrue
+ \SetLanguageKeys{chinese}{language={Chinese Traditional},langtag=ZHT,bcp47=zh-TW,bcp47-language=zh,bcp47-region=TW,bcp47-script=Hant}%
+ },
+ variant / traditional.code =
+ {%
+ \chinese@traditionaltrue
+ \SetLanguageKeys{chinese}{language={Chinese Traditional},langtag=ZHT,bcp47=zh-TW,bcp47-language=zh,bcp47-region=TW,bcp47-script=Hant}%
+ },
+ variant.default:n = cn,
+ variant/unknown.code = \xpg@warning{Unknown Chinese variant `#1'},
+ numerals.choice:,
+ numerals / arabic.code =
+ {%
+ \chinese@numeralsfalse
+ \SetLanguageKeys{chinese}{bcp47-extension-u=nu-latn}%
+ },
+ numerals / chinese.code =
+ {%
+ \chinese@numeralstrue
+ \SetLanguageKeys{chinese}{bcp47-extension-u=nu-hant}%
+ },
+ numerals.default:n = arabic,
+ numerals/unknown.code = \xpg@warning{Unknown Chinese numerals value `#1'}
+ }
% Register default options
-\xpg@initialize@gloss@options{chinese}{variant=cn,numerals=arabic}
-%\xpg@initialize@gloss@options{chinese}{variant=tw,numerals=arabic}
+\InitializeGlossOptions{chinese}{variant=cn,numerals=arabic}
+%\InitializeGlossOptions{chinese}{variant=tw,numerals=arabic}
% Register alias options
-\xpg@set@alias@values{chinese}{variant}{cn}{simplified}
-\xpg@set@alias@values{chinese}{variant}{tw}{traditional}
+\SetLanguageAliasValues{chinese}{variant}{cn,simplified}
+\SetLanguageAliasValues{chinese}{variant}{tw,traditional}
\def\chinese@capsformat{%
@@ -12852,7 +12825,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\def\enclname{附件}%
\def\ccname{抄é€}%
\def\headtoname{收件人}%
- \def\\glossaryname{詞彙表}%
+ \def\glossaryname{詞彙表}%
}
\def\captions@chinese@simplified{%
\def\contentsname{目录}%
@@ -12875,7 +12848,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\def\enclname{附件}%
\def\ccname{抄é€}%
\def\headtoname{收件人}%
- \def\\glossaryname{è¯æ±‡è¡¨}%
+ \def\glossaryname{è¯æ±‡è¡¨}%
}
\newcount\c@TempJNum%
@@ -13023,13 +12996,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-ckb-Arab.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-ckb-Arab.ldf}[polyglossia: module for ckb-Arab (Kurdish)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{kurdish}
+\InheritGlossFile{kurdish}
% \end{macrocode}
% \iffalse
@@ -13040,13 +13013,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-ckb-Latn.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-ckb-Latn.ldf}[polyglossia: module for ckb-Latn (Kurdish)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{kurdish}
+\InheritGlossFile{kurdish}
% \end{macrocode}
% \iffalse
@@ -13057,30 +13030,47 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-ckb.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-ckb.ldf}[polyglossia: module for ckb (Kurdish)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{kurdish}
+\InheritGlossFile{kurdish}
% \end{macrocode}
% \iffalse
%</gloss-ckb.ldf>
+%<*gloss-classiclatin.ldf>
+% \fi
+% \clearpage
+%
+% \subsection{gloss-classiclatin.ldf}
+% \begin{macrocode}
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
+%
+\ProvidesFile{gloss-classiclatin.ldf}[polyglossia: module for classic Latin]
+
+% We provide this as a babel alias
+
+\InheritGlossFile{latin}
+
+% \end{macrocode}
+% \iffalse
+%</gloss-classiclatin.ldf>
%<*gloss-cop.ldf>
% \fi
% \clearpage
%
% \subsection{gloss-cop.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-cop.ldf}[polyglossia: module for cop (Coptic)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{coptic}
+\InheritGlossFile{coptic}
% \end{macrocode}
% \iffalse
@@ -13091,7 +13081,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-coptic.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-coptic.ldf}[polyglossia: module for Coptic]
\PolyglossiaSetup{coptic}{
@@ -13147,7 +13137,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-croatian.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-croatian.ldf}[polyglossia: module for Croatian]
\PolyglossiaSetup{croatian}{
@@ -13169,40 +13159,40 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\RequirePackage{luavlna}
\fi
-\define@boolkey{croatian}[croatian@]{babelshorthands}[true]{}
-
-\define@boolkey{croatian}[croatian@]{disabledigraphs}[true]{}
-
-% Alias kept for backwards compatibility. Please do not remove
-\define@boolkey{croatian}[croatian@]{disableligatures}[true]{%
- \xpg@warning{The option disableligatures is deprected.\MessageBreak
- Please use disabledigraphs instead}%
- \ifcroatian@disableligatures
- \croatian@disabledigraphstrue
- \else
- \croatian@disabledigraphsfalse
- \fi
-}
-
-\define@boolkey{croatian}[croatian@]{splithyphens}[true]{}
-
-\define@boolkey{croatian}[croatian@]{localalph}[true]{}
+\DeclareKeys[polyglossia/gloss/croatian]
+ {
+ babelshorthands.if = croatian@babelshorthands,
+ babelshorthands.default:n = true,
+ disabledigraphs.if = croatian@disabledigraphs,
+ disabledigraphs.default:n = true,
+ splithyphens.if = croatian@splithyphens,
+ splithyphens.default:n = true,
+ localalph.if = croatian@localalph,
+ localalph.default:n = true,
+ disableligatures.choices:nn = { true, false }
+ {%
+ \xpg@warning{The option disableligatures is deprecated.\MessageBreak
+ Please use disabledigraphs instead}%
+ \ifcase\UseName{l_keys_choice_int}\or
+ \croatian@disabledigraphstrue
+ \or
+ \croatian@disabledigraphsfalse
+ \fi
+ },
+ disableligatures.default:n = true,
+ }
% Register default options
-\xpg@initialize@gloss@options{croatian}{babelshorthands=false,disabledigraphs=false,
+\InitializeGlossOptions{croatian}{babelshorthands=false,disabledigraphs=false,
splithyphens=true,localalph=true}
\ifsystem@babelshorthands
- \setkeys{croatian}{babelshorthands=true}
+ \SetGlossOptions{croatian}{babelshorthands=true}
\else
- \setkeys{croatian}{babelshorthands=false}
+ \SetGlossOptions{croatian}{babelshorthands=false}
\fi
-\ifcsundef{initiate@active@char}{%
- \input{babelsh.def}%
- \initiate@active@char{"}%
- \shorthandoff{"}%
-}{}
+\InitializeBabelShorthands
\let\xpg@hyphen@char-
\def\croatian@@splhyphen#1{%
@@ -13423,13 +13413,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-cy.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-cy.ldf}[polyglossia: module for cy (Welsh)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{welsh}
+\InheritGlossFile{welsh}
% \end{macrocode}
% \iffalse
@@ -13440,13 +13430,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-cz.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-cz.ldf}[polyglossia: module for cz (Czech)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{czech}
+\InheritGlossFile{czech}
% \end{macrocode}
% \iffalse
@@ -13457,7 +13447,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-czech.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-czech.ldf}[polyglossia: module for Czech]
@@ -13480,26 +13470,26 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\RequirePackage{luavlna}
\fi
-\define@boolkey{czech}[czech@]{babelshorthands}[true]{}
-
-\define@boolkey{czech}[czech@]{splithyphens}[true]{}
-
-\define@boolkey{czech}[czech@]{vlna}[true]{}
+\DeclareKeys[polyglossia/gloss/czech]
+ {
+ babelshorthands.if = czech@babelshorthands,
+ babelshorthands.default:n = true,
+ splithyphens.if = czech@splithyphens,
+ splithyphens.default:n = true,
+ vlna.if = czech@vlna,
+ vlna.default:n = true
+ }
% Register default options
-\xpg@initialize@gloss@options{czech}{babelshorthands=false,splithyphens=true,vlna=true}
+\InitializeGlossOptions{czech}{babelshorthands=false,splithyphens=true,vlna=true}
\ifsystem@babelshorthands
- \setkeys{czech}{babelshorthands=true}
+ \SetGlossOptions{czech}{babelshorthands=true}
\else
- \setkeys{czech}{babelshorthands=false}
+ \SetGlossOptions{czech}{babelshorthands=false}
\fi
-\ifcsundef{initiate@active@char}{%
- \input{babelsh.def}%
- \initiate@active@char{"}%
- \shorthandoff{"}%
-}{}
+\InitializeBabelShorthands
\def\czech@@splithyphen#1{%
\def\czech@sh@tmp{%
@@ -13716,13 +13706,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-da.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-da.ldf}[polyglossia: module for da (Danish)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{danish}
+\InheritGlossFile{danish}
% \end{macrocode}
% \iffalse
@@ -13733,7 +13723,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-danish.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-danish.ldf}[polyglossia: module for Danish]
\PolyglossiaSetup{danish}{
@@ -13790,13 +13780,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-de-AT-1901.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-de-AT-1901.ldf}[polyglossia: module for de-AT-1901 (Austrian German, old spelling)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{german}
+\InheritGlossFile{german}
% \end{macrocode}
% \iffalse
@@ -13807,13 +13797,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-de-AT-1996.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-de-AT-1996.ldf}[polyglossia: module for de-AT-1996 (Austrian German)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{german}
+\InheritGlossFile{german}
% \end{macrocode}
% \iffalse
@@ -13824,13 +13814,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-de-AT.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-de-AT.ldf}[polyglossia: module for de-AT (Austrian German)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{german}
+\InheritGlossFile{german}
% \end{macrocode}
% \iffalse
@@ -13841,13 +13831,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-de-CH-1901.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-de-CH-1901.ldf}[polyglossia: module for de-CH-1901 (Swiss German, old spelling)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{german}
+\InheritGlossFile{german}
% \end{macrocode}
% \iffalse
@@ -13858,13 +13848,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-de-CH-1996.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-de-CH-1996.ldf}[polyglossia: module for de-CH-1996 (Swiss German)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{german}
+\InheritGlossFile{german}
% \end{macrocode}
% \iffalse
@@ -13875,13 +13865,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-de-CH.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-de-CH.ldf}[polyglossia: module for de-CH (Swiss German)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{german}
+\InheritGlossFile{german}
% \end{macrocode}
% \iffalse
@@ -13892,13 +13882,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-de-DE-1901.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-de-DE-1901.ldf}[polyglossia: module for de-DE-1901 (Germany's German, old spelling)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{german}
+\InheritGlossFile{german}
% \end{macrocode}
% \iffalse
@@ -13909,13 +13899,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-de-DE-1996.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-de-DE-1996.ldf}[polyglossia: module for de-DE-1996 (Germany's German)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{german}
+\InheritGlossFile{german}
% \end{macrocode}
% \iffalse
@@ -13926,13 +13916,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-de-DE.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-de-DE.ldf}[polyglossia: module for de-DE (Germany's German)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{german}
+\InheritGlossFile{german}
% \end{macrocode}
% \iffalse
@@ -13943,13 +13933,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-de-Latf-AT-1901.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-de-AT-1901-Latf.ldf}[polyglossia: module for de-AT-1901-Latf (Austrian German, old spelling)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{german}
+\InheritGlossFile{german}
% \end{macrocode}
% \iffalse
@@ -13960,13 +13950,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-de-Latf-AT-1996.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-de-AT-1996-Latf.ldf}[polyglossia: module for de-AT-1996-Latf (Austrian German)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{german}
+\InheritGlossFile{german}
% \end{macrocode}
% \iffalse
@@ -13977,13 +13967,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-de-Latf-AT.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-de-AT-Latf.ldf}[polyglossia: module for de-AT-Latf (Austrian German)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{german}
+\InheritGlossFile{german}
% \end{macrocode}
% \iffalse
@@ -13994,13 +13984,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-de-Latf-CH-1901.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-de-CH-1901-Latf.ldf}[polyglossia: module for de-CH-1901-Latf (Swiss German, old spelling)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{german}
+\InheritGlossFile{german}
% \end{macrocode}
% \iffalse
@@ -14011,13 +14001,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-de-Latf-CH-1996.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-de-CH-1996-Latf.ldf}[polyglossia: module for de-CH-1996-Latf (Swiss German)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{german}
+\InheritGlossFile{german}
% \end{macrocode}
% \iffalse
@@ -14028,13 +14018,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-de-Latf-CH.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-de-CH-Latf.ldf}[polyglossia: module for de-CH-Latf (Swiss German)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{german}
+\InheritGlossFile{german}
% \end{macrocode}
% \iffalse
@@ -14045,13 +14035,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-de-Latf-DE-1901.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-de-DE-1901-Latf.ldf}[polyglossia: module for de-DE-1901-Latf (Germany's German, old spelling)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{german}
+\InheritGlossFile{german}
% \end{macrocode}
% \iffalse
@@ -14062,13 +14052,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-de-Latf-DE-1996.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-de-DE-1996-Latf.ldf}[polyglossia: module for de-DE-1996-Latf (Germany's German)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{german}
+\InheritGlossFile{german}
% \end{macrocode}
% \iffalse
@@ -14079,13 +14069,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-de-Latf-DE.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-de-DE-Latf.ldf}[polyglossia: module for de-DE-Latf (Germany's German)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{german}
+\InheritGlossFile{german}
% \end{macrocode}
% \iffalse
@@ -14096,13 +14086,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-de-Latf.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-de-Latf.ldf}[polyglossia: module for de-Latf (German)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{german}
+\InheritGlossFile{german}
% \end{macrocode}
% \iffalse
@@ -14113,13 +14103,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-de.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-de.ldf}[polyglossia: module for de (German)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{german}
+\InheritGlossFile{german}
% \end{macrocode}
% \iffalse
@@ -14130,7 +14120,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-divehi.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-divehi.ldf}[polyglossia: module for Divehi]
@@ -14185,13 +14175,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-dsb.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-dsb.ldf}[polyglossia: module for dsb (Sorbian)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{sorbian}
+\InheritGlossFile{sorbian}
% \end{macrocode}
% \iffalse
@@ -14202,7 +14192,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-dutch.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-dutch.ldf}[polyglossia: module for Dutch]
\PolyglossiaSetup{dutch}{
@@ -14219,24 +14209,24 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
% BCP-47 compliant aliases
\setlanguagealias*{dutch}{nl}
-\define@boolkey{dutch}[dutch@]{babelshorthands}[true]{}
-
-\define@boolkey{dutch}[dutch@]{tremahyphenation}[true]{}
+\DeclareKeys[polyglossia/gloss/dutch]
+ {
+ babelshorthands.if = dutch@babelshorthands,
+ babelshorthands.default:n = true,
+ tremahyphenation.if = dutch@tremahyphenation,
+ tremahyphenation.default:n = true
+ }
% Register default options
-\xpg@initialize@gloss@options{dutch}{babelshorthands=false,tremahyphenation=true}
+\InitializeGlossOptions{dutch}{babelshorthands=false,tremahyphenation=true}
\ifsystem@babelshorthands
- \setkeys{dutch}{babelshorthands=true}
+ \SetGlossOptions{dutch}{babelshorthands=true}
\else
- \setkeys{dutch}{babelshorthands=false}
+ \SetGlossOptions{dutch}{babelshorthands=false}
\fi
-\ifcsundef{initiate@active@char}{%
- \input{babelsh.def}%
- \initiate@active@char{"}%
- \shorthandoff{"}%
-}{}
+\InitializeBabelShorthands
\def\xpg@trema#1{\allowhyphens\discretionary{-}{#1}{\"{#1}}\allowhyphens}
@@ -14412,30 +14402,47 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-dv.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-dv.ldf}[polyglossia: module for dv (Divehi)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{divehi}
+\InheritGlossFile{divehi}
% \end{macrocode}
% \iffalse
%</gloss-dv.ldf>
+%<*gloss-ecclesiasticlatin.ldf>
+% \fi
+% \clearpage
+%
+% \subsection{gloss-ecclesiasticlatin.ldf}
+% \begin{macrocode}
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
+%
+\ProvidesFile{gloss-ecclesiasticlatin.ldf}[polyglossia: module for ecclesiastic Latin]
+
+% We provide this as a babel alias
+
+\InheritGlossFile{latin}
+
+% \end{macrocode}
+% \iffalse
+%</gloss-ecclesiasticlatin.ldf>
%<*gloss-el-monoton.ldf>
% \fi
% \clearpage
%
% \subsection{gloss-el-monoton.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-el-monoton.ldf}[polyglossia: module for el-monoton (Greek)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{greek}
+\InheritGlossFile{greek}
% \end{macrocode}
% \iffalse
@@ -14446,13 +14453,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-el-polyton.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-el-polyton.ldf}[polyglossia: module for el-polyton (Greek)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{greek}
+\InheritGlossFile{greek}
% \end{macrocode}
% \iffalse
@@ -14463,13 +14470,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-el.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-el.ldf}[polyglossia: module for el (Greek)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{greek}
+\InheritGlossFile{greek}
% \end{macrocode}
% \iffalse
@@ -14480,13 +14487,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-en-AU.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-en-AU.ldf}[polyglossia: module for en-AU (Australian English)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{english}
+\InheritGlossFile{english}
% \end{macrocode}
% \iffalse
@@ -14497,13 +14504,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-en-CA.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
-\ProvidesFile{gloss-en-CA.ldf}[polyglossia: module for en-CA (Canadan English)]
+\ProvidesFile{gloss-en-CA.ldf}[polyglossia: module for en-CA (Canadian English)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{english}
+\InheritGlossFile{english}
% \end{macrocode}
% \iffalse
@@ -14514,13 +14521,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-en-GB.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-en-GB.ldf}[polyglossia: module for en-GB (British English)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{english}
+\InheritGlossFile{english}
% \end{macrocode}
% \iffalse
@@ -14531,13 +14538,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-en-NZ.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-en-NZ.ldf}[polyglossia: module for en-NZ (Newzealand English)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{english}
+\InheritGlossFile{english}
% \end{macrocode}
% \iffalse
@@ -14548,13 +14555,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-en-US.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-en-US.ldf}[polyglossia: module for en-US (American English)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{english}
+\InheritGlossFile{english}
% \end{macrocode}
% \iffalse
@@ -14565,13 +14572,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-en.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-en.ldf}[polyglossia: module for en (English)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{english}
+\InheritGlossFile{english}
% \end{macrocode}
% \iffalse
@@ -14582,7 +14589,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-english.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-english.ldf}[polyglossia: module for English]
@@ -14614,9 +14621,12 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\setlanguagealias[variant=canadian]{english}{canadian}
\setlanguagealias[variant=newzealand]{english}{newzealand}
-\providebool{british@hyphen}
-\providebool{english@ordinalmonthday}
-\providebool{british@dateformat}
+\@ifundefined{ifbritish@hyphen}%
+ {\newif\ifbritish@hyphen}{}
+\@ifundefined{ifenglish@ordinalmonthday}%
+ {\newif\ifenglish@ordinalmonthday}{}
+\@ifundefined{ifbritish@dateformat}%
+ {\newif\ifbritish@dateformat}{}
% US English (\l@english) is default
% Initialize its settings
@@ -14625,49 +14635,46 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\english@ordinalmonthdayfalse
\british@dateformatfalse
-% Option ordinalmonthday
-\define@boolkey{english}[english@]{ordinalmonthday}[true]{}
-
-\define@choicekey*+{english}{variant}[\xpg@val\xpg@nr]{uk,british,us,american,usmax,australian,newzealand,canadian}[us]{%
- \ifcase\xpg@nr\relax
+\DeclareKeys[polyglossia/gloss/english]
+ {
+ ordinalmonthday.if = english@ordinalmonthday,
+ ordinalmonthday.default:n = true,
+ variant.choices:nn = { uk, british, us, american, usmax, australian, newzealand, canadian }
+ {%
+ \ifcase\UseName{l_keys_choice_int}\or
% uk:
\british@hyphentrue
\british@dateformattrue
\english@ordinalmonthdaytrue
\SetLanguageKeys{english}{babelname=british,bcp47=en-GB,bcp47-language=en,bcp47-region=GB}%
- \xpg@info{Option: English, variant=british}%
\or
% british:
\british@hyphentrue
\british@dateformattrue
\english@ordinalmonthdaytrue
\SetLanguageKeys{english}{babelname=british,bcp47=en-GB,bcp47-language=en,bcp47-region=GB}%
- \xpg@info{Option: english variant=british}%
\or
% us:
\british@hyphenfalse
\british@dateformatfalse
\english@ordinalmonthdayfalse
\SetLanguageKeys{english}{babelname=american,bcp47=en-US,bcp47-language=en,bcp47-region=US}%
- \xpg@info{Option: English, variant=american}%
\or
% american:
\british@hyphenfalse
\british@dateformatfalse
\english@ordinalmonthdayfalse
\SetLanguageKeys{english}{babelname=american,bcp47=en-US,bcp47-language=en,bcp47-region=US}%
- \xpg@info{Option: English, variant=american}%
\or
% usmax:
\british@hyphenfalse
\british@dateformatfalse
\english@ordinalmonthdayfalse
\SetLanguageKeys{english}{babelname=american,bcp47=en-US,bcp47-language=en,bcp47-region=US}%
- \xpg@info{Option: english variant=american (with additional patterns)}%
- \xpg@ifdefined{usenglishmax}{}%
+ \IfLanguageDefinedF{usenglishmax}%
{\xpg@warning{No hyphenation patterns were loaded for "US English Max"\MessageBreak
I will use the standard patterns for US English instead}%
- \adddialect\l@usenglishmax\l@english\relax%
+ \adddialect\l@usenglishmax\l@english
}%
\def\english@variant{usenglishmax}%
\or
@@ -14678,8 +14685,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\british@dateformattrue
\english@ordinalmonthdayfalse
\SetLanguageKeys{english}{babelname=australian,bcp47=en-AU,bcp47-language=en,bcp47-region=AU}%
- \xpg@info{Option: English, variant=australian}%
- \adddialect\l@australian\l@english%
+ \adddialect\l@australian\l@english
\or
% newzealand:
% These use the british hyphenation patterns
@@ -14688,8 +14694,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\british@dateformattrue
\english@ordinalmonthdayfalse
\SetLanguageKeys{english}{babelname=newzealand,bcp47=en-NZ,bcp47-language=en,bcp47-region=NZ}%
- \xpg@info{Option: English, variant=newzealand}%
- \adddialect\l@newzealand\l@english%
+ \adddialect\l@newzealand\l@english
\or
% canadian:
% This is currently equivalent to usenglish (as in babel)
@@ -14697,45 +14702,35 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\british@dateformatfalse
\english@ordinalmonthdayfalse
\SetLanguageKeys{english}{babelname=canadian,bcp47=en-CA,bcp47-language=en,bcp47-region=CA}%
- \xpg@info{Option: English, variant=american}%
- \adddialect\l@canadian\l@english%
+ \adddialect\l@canadian\l@english
\fi
\ifbritish@hyphen
- \xpg@ifdefined{ukenglish}{}%
+ \IfLanguageDefinedF{ukenglish}%
{\xpg@warning{No hyphenation patterns were loaded for British English\MessageBreak
I will use the patterns for US English instead}%
- \adddialect\l@ukenglish\l@english\relax%
+ \adddialect\l@ukenglish\l@english
}%
\def\english@variant{ukenglish}%
\fi
-}{\xpg@warning{Unknown English variant `#1'}}
+ },
+ variant.default:n = us,
+ variant/unknown.code = \xpg@warning{Unknown English variant `#1'},
+ }
% Register default options
-\xpg@initialize@gloss@options{english}{variant=us,ordinalmonthday=false}
+\InitializeGlossOptions{english}{variant=us,ordinalmonthday=false}
% Register alias options
-\xpg@set@alias@values{english}{variant}{us}{american}
-\xpg@set@alias@values{english}{variant}{uk}{british}
+\SetLanguageAliasValues{english}{variant}{us,american}
+\SetLanguageAliasValues{english}{variant}{uk,british}
\ifxetex
% Check if \l@english is defined. If not, try to set it to some variety
- % (specific order as in the csv list below), or null language if everything fails
- \xpg@ifdefined{english}{}{%
- \def\do##1{%
- \xpg@ifdefined{#1}%
- {\csletcs{l@english}{l@#1}\listbreak}%
- {%
- \xpg@warning{No hyphenation patterns for English found"\MessageBreak
- I will use the 'null' language instead}%
- \adddialect\l@english0
- }%
- }%
- \docsvlist{british, american, usenglishmax, australian, newzealand}
- \xpg@ifdefined{english}{}{}
- }%
+ % (specific order as in the csv list), or null language if everything fails
+ \TryPatternWithFallback{english}{british, american, usenglishmax, australian, newzealand}
\fi
\def\english@language{%
- \polyglossia@setup@language@patterns{\english@variant}%
+ \SetupPolyglossiaLangPatterns{\english@variant}%
}%
\def\captionsenglish{%
@@ -14793,13 +14788,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-eo.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-eo.ldf}[polyglossia: module for eo (Esperanto)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{esperanto}
+\InheritGlossFile{esperanto}
% \end{macrocode}
% \iffalse
@@ -14810,13 +14805,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-es-ES.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-es-ES.ldf}[polyglossia: module for es-ES (Spain's Spanish)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{spanish}
+\InheritGlossFile{spanish}
% \end{macrocode}
% \iffalse
@@ -14827,13 +14822,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-es-MX.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-es-MX.ldf}[polyglossia: module for es-MX (Mexican Spanish)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{spanish}
+\InheritGlossFile{spanish}
% \end{macrocode}
% \iffalse
@@ -14844,13 +14839,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-es.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-es.ldf}[polyglossia: module for es (Spanish)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{spanish}
+\InheritGlossFile{spanish}
% \end{macrocode}
% \iffalse
@@ -14861,7 +14856,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-esperanto.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-esperanto.ldf}[polyglossia: module for Esperanto]
\PolyglossiaSetup{esperanto}{
@@ -14892,10 +14887,10 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\def\figurename{Figuro}%
\def\tablename{Tabelo}%
%\def\thepart{}%
- %\def\partname{}%
+ \def\partname{Parto}%
\def\pagename{PaÄo}%
\def\seename{vidu}%
- \def\alsoname{Parto}%
+ \def\alsoname{vidu ankaÅ­}%
\def\enclname{Aldono(j)}%
\def\ccname{Kopie al}%
\def\headtoname{Al}%
@@ -14941,7 +14936,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-estonian.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-estonian.ldf}[polyglossia: module for Estonian]
\PolyglossiaSetup{estonian}{
@@ -14981,7 +14976,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\def\ccname{Koopia(d)}%
%\def\headtoname{}%
\def\proofname{Korrektuur}%
- \def\glossaryname{Glossary}% <-- need translation
+ \def\glossaryname{Sõnastik}%
}
\def\dateestonian{%
\def\today{\number\day.\space\ifcase\month\or
@@ -14998,13 +14993,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-et.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-et.ldf}[polyglossia: module for et (Estonian)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{estonian}
+\InheritGlossFile{estonian}
% \end{macrocode}
% \iffalse
@@ -15015,13 +15010,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-eu.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-eu.ldf}[polyglossia: module for eu (Basque)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{basque}
+\InheritGlossFile{basque}
% \end{macrocode}
% \iffalse
@@ -15032,13 +15027,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-fa.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-fa.ldf}[polyglossia: module for fa (Persian)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{persian}
+\InheritGlossFile{persian}
% \end{macrocode}
% \iffalse
@@ -15049,14 +15044,14 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-farsi.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-farsi.ldf}[polyglossia: module for Farsi]
% We only provide this gloss for babel compatibility.
% The proper English language name is Persian.
-\xpg@load@master@language{persian}
+\InheritGlossFile{persian}
% \end{macrocode}
% \iffalse
@@ -15067,13 +15062,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-fi.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-fi.ldf}[polyglossia: module for fi (Finnish)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{finnish}
+\InheritGlossFile{finnish}
% \end{macrocode}
% \iffalse
@@ -15084,7 +15079,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-finnish.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-finnish.ldf}[polyglossia: module for Finnish]
\PolyglossiaSetup{finnish}{
@@ -15102,51 +15097,54 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
% BCP-47 compliant aliases
\setlanguagealias*{finnish}{fi}
-\define@boolkey{finnish}[finnish@]{babelshorthands}[true]{}
-
\newif\if@finnish@schoolhyphens
\newif\if@finnish@babelhyphens
-\define@choicekey*+{finnish}{hyphens}[\xpg@val\xpg@nr]{default,school,babel}[default]{%
- \ifcase\xpg@nr\relax
- % default:
- \@finnish@schoolhyphensfalse
- \@finnish@babelhyphensfalse
- \or
- % school:
- \@finnish@schoolhyphenstrue
- \@finnish@babelhyphensfalse
- \or
- % babel:
- \@finnish@schoolhyphensfalse
- \@finnish@babelhyphenstrue
- \fi
- \xpg@info{Option: Finnish, hyphens=\xpg@val}%
-}{\xpg@warning{Unknown Finnish hyphens `#1'}}
-
-% backwards compatibility
-\define@boolkey{finnish}[finnish@]{schoolhyphens}[true]{%
- \iffinnish@schoolhyphens
- \@finnish@schoolhyphenstrue
- \@finnish@babelhyphensfalse
- \else
- \@finnish@schoolhyphensfalse
- \fi
-}
+
+\DeclareKeys[polyglossia/gloss/finnish]
+ {
+ babelshorthands.if = finnish@babelshorthands,
+ babelshorthands.default:n = true,
+ hyphens.choice:,
+ hyphens / default.code =
+ {%
+ \@finnish@schoolhyphensfalse
+ \@finnish@babelhyphensfalse
+ },
+ hyphens / school.code =
+ {%
+ \@finnish@schoolhyphenstrue
+ \@finnish@babelhyphensfalse
+ },
+ hyphens / babel.code =
+ {%
+ \@finnish@schoolhyphensfalse
+ \@finnish@babelhyphenstrue
+ },
+ hyphens.default:n = default,
+ hyphens/unknown.code = \xpg@warning{Unknown Finnish hyphens `#1'},
+ schoolhyphens.choice:,
+ schoolhyphens / true.code =
+ {%
+ \@finnish@schoolhyphenstrue
+ \@finnish@babelhyphensfalse
+ },
+ schoolhyphens / false.code =
+ {%
+ \@finnish@schoolhyphensfalse
+ },
+ schoolhyphens.default:n = true
+ }
% Register default options
-\xpg@initialize@gloss@options{finnish}{babelshorthands=false,hyphens=default}
+\InitializeGlossOptions{finnish}{babelshorthands=false,hyphens=default}
\ifsystem@babelshorthands
- \setkeys{finnish}{babelshorthands=true}
+ \SetGlossOptions{finnish}{babelshorthands=true}
\else
- \setkeys{finnish}{babelshorthands=false}
+ \SetGlossOptions{finnish}{babelshorthands=false}
\fi
-\ifcsundef{initiate@active@char}{%
- \input{babelsh.def}%
- \initiate@active@char{"}%
- \shorthandoff{"}%
-}{}
+\InitializeBabelShorthands
\def\finnish@shorthands{%
\xpg@activate@shorthands%
@@ -15191,15 +15189,15 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\def\finnish@language{%
\if@finnish@schoolhyphens
- \xpg@ifdefined{schoolfinnish}{%
- \polyglossia@setup@language@patterns{schoolfinnish}%
+ \IfLanguageDefinedTF{schoolfinnish}{%
+ \SetupPolyglossiaLangPatterns{schoolfinnish}%
}{%
\xpg@warning{Finnish 'School' hyphenation patterns (schoolfinnish) not available.\MessageBreak
I will use the standard patterns for Finnish instead}%
- \polyglossia@setup@language@patterns{finnish}%
+ \SetupPolyglossiaLangPatterns{finnish}%
}%
\else
- \polyglossia@setup@language@patterns{finnish}%
+ \SetupPolyglossiaLangPatterns{finnish}%
\fi
}
@@ -15253,13 +15251,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-fr-CA-u-sd-canb.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-fr-CA-u-sd-canb.ldf}[polyglossia: module for fr-CA-u-sd-canb (Canadian French, Acadian subvariety)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{french}
+\InheritGlossFile{french}
% \end{macrocode}
% \iffalse
@@ -15270,13 +15268,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-fr-CA.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-fr-CA.ldf}[polyglossia: module for fr-CA (Canadian French)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{french}
+\InheritGlossFile{french}
% \end{macrocode}
% \iffalse
@@ -15287,13 +15285,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-fr-CH.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-fr-CH.ldf}[polyglossia: module for fr-CH (Swiss French)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{french}
+\InheritGlossFile{french}
% \end{macrocode}
% \iffalse
@@ -15304,13 +15302,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-fr-FR.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-fr-FR.ldf}[polyglossia: module for fr-FR (France's French)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{french}
+\InheritGlossFile{french}
% \end{macrocode}
% \iffalse
@@ -15321,13 +15319,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-fr.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-fr.ldf}[polyglossia: module for fr (French)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{french}
+\InheritGlossFile{french}
% \end{macrocode}
% \iffalse
@@ -15338,7 +15336,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-french.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-french.ldf}[polyglossia: module for French]
@@ -15368,43 +15366,9 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\setlanguagealias[variant=canadian]{french}{canadien}
\def\french@variant{french}
-\define@choicekey*+{french}{variant}[\xpg@val\xpg@nr]{french,canadian,acadian,swiss}[french]{%
- \ifcase\xpg@nr\relax
- % french:
- \def\french@variant{french}%
- \SetLanguageKeys{french}{babelname=french,bcp47=fr-FR,bcp47-language=fr,bcp47-region=FR}%
- \french@thincolonspacefalse
- \or
- % canadian:
- \def\french@variant{canadien}%
- \SetLanguageKeys{french}{babelname=canadien,bcp47=fr-CA,bcp47-language=fr,bcp47-region=CA,bcp47-extension-u=sd-caqc}%
- \xpg@ifdefined{canadien}{}%
- {\xpg@warning{No hyphenation patterns were loaded for "French (Canada)"\MessageBreak
- I will use the standard patterns for French instead}%
- \adddialect\l@canadien\l@french\relax}%
- \french@thincolonspacefalse
- \or
- % acadian:
- \def\french@variant{acadian}%
- \SetLanguageKeys{french}{babelname=acadian,bcp47=fr-CA-u-sd-canb,bcp47-language=fr,bcp47-region=CA,bcp47-extension-u=sd-canb}%
- \xpg@ifdefined{acadian}{}%
- {\xpg@warning{No hyphenation patterns were loaded for "French (Canada, Acadian)"\MessageBreak
- I will use the standard patterns for French instead}%
- \adddialect\l@acadian\l@french\relax}%
- \french@thincolonspacefalse
- \or
- % swiss:
- \def\french@variant{swissfrench}%
- \SetLanguageKeys{french}{babelname=french,bcp47=fr-CH,bcp47-language=fr,bcp47-region=CH}%
- \adddialect\l@swissfrench\l@french\relax%
- \french@thincolonspacetrue
- \fi
- \xpg@info{Option: French, variant=\xpg@val}%
-}{\xpg@warning{Unknown French variant `#1'}}
-
\def\french@language{%
- \polyglossia@setup@language@patterns{\french@variant}%
+ \SetupPolyglossiaLangPatterns{\french@variant}%
}%
\ifluatex
@@ -15424,91 +15388,103 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
% Save original footnote definition
% Do this at the end of the preamble to catch other
% packages' footnote changes (#391)
-\AtEndPreamble{%
+\AddToHook{begindocument/before}{%
\let\xpg@orig@makefntext\@makefntext
}
-\define@boolkey{french}[french@]{frenchfootnote}[true]{}
-
-\define@boolkey{french}[french@]{autospacing}[true]{}
-\french@autospacingtrue
-
-\define@boolkey{french}[french@]{frenchpart}[true]{}
-\french@frenchparttrue
-
-\newif\iffrench@autospaceguillemets
-\define@boolkey{french}[french@]{autospaceguillemets}[true]{}
-\french@autospaceguillemetstrue
-
-\newif\iffrench@thincolonspace
-\define@boolkey{french}[french@]{thincolonspace}[true]{}
-\french@thincolonspacefalse
-
-% Backwards compatibility
-\define@boolkey{french}[french@]{automaticspacesaroundguillemets}[true]{%
- \iffrench@automaticspacesaroundguillemets
- \setkeys{french}{autospaceguillemets=true}%
- \else
- \setkeys{french}{autospaceguillemets=false}%
- \fi
-}
-
% name is for compatibility with babel
\let\french@ttfamilyORI\ttfamily
\DeclareRobustCommand\french@ttfamilyFB{\nofrench@punctuation\french@ttfamilyORI}
-% Allow to switch on autospacing in ttfamily context
-\define@boolkey{french}[french@]{autospacetypewriter}[true]{}
-\french@autospacetypewriterfalse
-
-% This is how babel-french has it
-\define@boolkey{french}[french@]{OriginalTypewriter}[true]{%
- \iffrench@OriginalTypewriter
- \setkeys{french}{autospacetypewriter=false}%
- \else
- \setkeys{french}{autospacetypewriter=true}%
- \fi
-}
-
% Configuration of item labels
\def\french@itemi{\textemdash}
\def\french@itemii{\textemdash}
\def\french@itemiii{\textemdash}
\def\french@itemiv{\textemdash}
-\define@key{french}{itemlabels}[\textemdash]{%
- \def\french@itemi{#1}
- \def\french@itemii{#1}
- \def\french@itemiii{#1}
- \def\french@itemiv{#1}
-}
-
-\define@key{french}{itemlabeli}[\textemdash]{%
- \def\french@itemi{#1}
-}
-
-\define@key{french}{itemlabelii}[\textemdash]{%
- \def\french@itemii{#1}
-}
-
-\define@key{french}{itemlabeliii}[\textemdash]{%
- \def\french@itemiii{#1}
-}
-
-\define@key{french}{itemlabeliv}[\textemdash]{%
- \def\french@itemiv{#1}
-}
+\newif\iffrench@autospacetypewriter
+\french@autospacetypewriterfalse
+\newif\iffrench@autospacing
+\french@autospacingtrue
+\newif\iffrench@frenchpart
+\french@frenchparttrue
+\newif\iffrench@autospaceguillemets
+\french@autospaceguillemetstrue
-\define@boolkey{french}[french@]{frenchitemlabels}[true]{}
+\DeclareKeys[polyglossia/gloss/french]
+ {
+ variant.choice:,
+ variant / french.code =
+ {%
+ \def\french@variant{french}%
+ \SetLanguageKeys{french}{babelname=french,bcp47=fr-FR,bcp47-language=fr,bcp47-region=FR}%
+ \french@thincolonspacefalse
+ },
+ variant / canadian.code =
+ {%
+ \def\french@variant{canadien}%
+ \SetLanguageKeys{french}{babelname=canadien,bcp47=fr-CA,bcp47-language=fr,bcp47-region=CA,bcp47-extension-u=sd-caqc}%
+ \IfLanguageDefinedF{canadien}%
+ {\xpg@warning{No hyphenation patterns were loaded for "French (Canada)"\MessageBreak
+ I will use the standard patterns for French instead}%
+ \adddialect\l@canadien\l@french\relax}%
+ \french@thincolonspacefalse
+ },
+ variant / acadian.code =
+ {%
+ \def\french@variant{acadian}%
+ \SetLanguageKeys{french}{babelname=acadian,bcp47=fr-CA-u-sd-canb,bcp47-language=fr,bcp47-region=CA,bcp47-extension-u=sd-canb}%
+ \IfLanguageDefinedF{acadian}%
+ {\xpg@warning{No hyphenation patterns were loaded for "French (Canada, Acadian)"\MessageBreak
+ I will use the standard patterns for French instead}%
+ \adddialect\l@acadian\l@french\relax}%
+ \french@thincolonspacefalse
+ },
+ variant / swiss.code =
+ {%
+ \def\french@variant{swissfrench}%
+ \SetLanguageKeys{french}{babelname=french,bcp47=fr-CH,bcp47-language=fr,bcp47-region=CH}%
+ \adddialect\l@swissfrench\l@french\relax%
+ \french@thincolonspacetrue
+ },
+ variant.default:n = french,
+ variant/unknown.code = \xpg@warning{Unknown French variant `#1'},
+ frenchfootnote.if = french@frenchfootnote,
+ frenchfootnote.default:n = true,
+ autospacing.if = french@autospacing,
+ autospacing.default:n = true,
+ frenchpart.if = french@frenchpart,
+ frenchpart.default:n = true,
+ autospaceguillemets.if = french@autospaceguillemets,
+ autospaceguillemets.default:n = true,
+ thincolonspace.if = french@thincolonspace,
+ thincolonspace.default:n = true,
+ automaticspacesaroundguillemets.meta:n = {autospaceguillemets=#1},
+ autospacetypewriter.if = french@autospacetypewriter,
+ autospacetypewriter.default:n = true,
+ originaltypewriter.meta:n = {autospacetypewriter=#1},
+ itemlabeli.store = \french@itemi,
+ itemlabelii.store = \french@itemii,
+ itemlabeliii.store = \french@itemiii,
+ itemlabeliv.store = \french@itemiv,
+ frenchitemlabels.if = french@frenchitemlabels,
+ frenchitemlabels.default:n = true,
+ itemlabels.code =
+ \def\french@itemi{#1}%
+ \def\french@itemii{#1}%
+ \def\french@itemiii{#1}%
+ \def\french@itemiv{#1},
+ itemlabels.default:n = \textemdash
+ }
% Register default options
-\xpg@initialize@gloss@options{french}{variant=french,autospacing=true,thincolonspace=false,
+\InitializeGlossOptions{french}{variant=french,autospacing=true,thincolonspace=false,
autospaceguillemets=true,autospacetypewriter=false,
frenchfootnote=false,frenchitemlabels=false,
itemlabels=\textemdash,itemlabeli=\textemdash,itemlabelii=\textemdash,
itemlabeliii=\textemdash,itemlabeliv=\textemdash}
% Register alias options
-\xpg@set@alias@values{french}{variant}{canadian}{acadian}
+\SetLanguageAliasValues{french}{variant}{canadian,acadian}
\def\french@fontsetup{%
@@ -15679,100 +15655,100 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\def\french@capsformat{%
% Change part heading
% With titlesec
- \ifcsdef{titleformat}{%
- \ifcsdef{NR@part}{% Hyperref (nameref)
- \let\xpg@save@part@format\NR@part%
- \patchcmd{\NR@part}%
- {\partname\nobreakspace\thepart}%
- {\xpg@french@part\nobreakspace\partname}%
- {}%
- {\xpg@warning{Failed to patch part for French}}%
- }{% not hyperref
- \ifcsdef{@part}{%
- \let\xpg@save@part@format\@part%
- \patchcmd{\@part}%
+ \@ifundefined{titleformat}{%
+ % With KOMA
+ \@ifundefined{sectionformat}{%
+ % With memoir
+ \@ifundefined{@memptsize}{% (not \ifdefined\@memptsize)
+ % With standard classes
+ \@ifundefined{NR@part}{% not hyperref
+ \@ifundefined{@part}{}{%
+ \let\xpg@save@part@format\@part%
+ \patchcmd{\@part}%
+ {\partname\nobreakspace\thepart}%
+ {\xpg@french@part\nobreakspace\partname}%
+ {}%
+ {\@ifundefined{part}{}{\xpg@warning{Failed to patch part for French}}}%
+ }% (end \ifdefined \@part)
+ }{% Hyperref
+ \let\xpg@save@part@format\NR@part%
+ \patchcmd{\NR@part}%
{\partname\nobreakspace\thepart}%
{\xpg@french@part\nobreakspace\partname}%
{}%
{\xpg@warning{Failed to patch part for French}}%
- }{}%
- }%
- }{% (not \ifdefined\titleformat)
- % With KOMA
- \ifcsdef{sectionformat}{%
- \ifcsdef{partformat}{%
- \let\xpg@save@part@format\partformat%
- \renewcommand{\partformat}{\xpg@french@part~\partname}%
- }{}%
- }{% (not \ifdefined\sectionformat)
- % With memoir
- \ifcsdef{@memptsize}{%
- \ifcsdef{NR@part}{% Hyperref (nameref)
- \let\xpg@save@part@format\NR@part%
- \patchcmd{\NR@part}{\printpartname \partnamenum \printpartnum}%
- {\partnamefont\xpg@french@part\partnamenum\printpartname}%
- {}%
- {\xpg@warning{Failed to patch part for French}}%
- }{% not hyperref
- \ifcsdef{@part}{%
+ }% (end \ifdefined\NR@part)
+ }{%
+ \@ifundefined{NR@part}{% not hyperref
+ \@ifundefined{@part}{}{%
\let\xpg@save@part@format\@part%
\patchcmd{\@part}{\printpartname \partnamenum \printpartnum}%
{\partnamefont\xpg@french@part\partnamenum\printpartname}%
{}%
{\xpg@warning{Failed to patch part for French}}%
- }{}%
- }%
- }{% (not \ifdefined\@memptsize)
- % With standard classes
- \ifcsdef{NR@part}{% Hyperref
+ }%
+ }{% Hyperref (nameref)
\let\xpg@save@part@format\NR@part%
- \patchcmd{\NR@part}%
+ \patchcmd{\NR@part}{\printpartname \partnamenum \printpartnum}%
+ {\partnamefont\xpg@french@part\partnamenum\printpartname}%
+ {}%
+ {\xpg@warning{Failed to patch part for French}}%
+ }%
+ }% (end \ifdefined\@memptsize)
+ }{% (\ifdefined\sectionformat)
+ \@ifundefined{partformat}{}{%
+ \let\xpg@save@part@format\partformat%
+ \renewcommand{\partformat}{\xpg@french@part~\partname}%
+ }%
+ }% (end \ifdefined\sectionformat)
+ }{% (\ifdefined\titleformat)
+ \@ifundefined{NR@part}{% not hyperref
+ \@ifundefined{@part}{}{%
+ \let\xpg@save@part@format\@part%
+ \patchcmd{\@part}%
{\partname\nobreakspace\thepart}%
{\xpg@french@part\nobreakspace\partname}%
{}%
{\xpg@warning{Failed to patch part for French}}%
- }{% not hyperref
- \ifcsdef{@part}{%
- \let\xpg@save@part@format\@part%
- \patchcmd{\@part}%
- {\partname\nobreakspace\thepart}%
- {\xpg@french@part\nobreakspace\partname}%
- {}%
- {\ifcsdef{part}{\xpg@warning{Failed to patch part for French}}{}}%
- }{}% (end \ifdefined \NR@part)
- }% (end \ifdefined\@part)
- }% (end \ifdefined\@memptsize)
- }% (end \ifdefined\sectionformat)
+ }%
+ }{% Hyperref (nameref)
+ \let\xpg@save@part@format\NR@part%
+ \patchcmd{\NR@part}%
+ {\partname\nobreakspace\thepart}%
+ {\xpg@french@part\nobreakspace\partname}%
+ {}%
+ {\xpg@warning{Failed to patch part for French}}%
+ }%
}% (end \ifdefined\titleformat)
}
\def\nofrench@capsformat{%
% Reset chapter and part heading
- \ifcsdef{titleformat}{%
- % With titlesec
- \ifcsdef{xpg@save@part@format}{%
- \ifcsdef{NR@part}{%
- \let\NR@part\xpg@save@part@format%
- }{%
- \let\@part\xpg@save@part@format%
- }%
- }{}%
- }{% (not \ifdefined\titleformat)
- \ifcsdef{sectionformat}{%
- % With KOMA
- \ifcsdef{xpg@save@part@format}{%
- \let\partformat\xpg@save@part@format
- }{}%
- }{%
+ \@ifundefined{titleformat}{%
+ \@ifundefined{sectionformat}{%
% With memoir and standard classes
- \ifcsdef{xpg@save@part@format}{%
- \ifcsdef{NR@part}{%
- \let\NR@part\xpg@save@part@format%
- }{%
+ \@ifundefined{xpg@save@part@format}{}{%
+ \@ifundefined{NR@part}{%
\let\@part\xpg@save@part@format%
+ }{%
+ \let\NR@part\xpg@save@part@format%
}%
- }{}%
+ }%
+ }{%
+ % With KOMA
+ \@ifundefined{xpg@save@part@format}{}{%
+ \let\partformat\xpg@save@part@format
+ }%
}% (end \ifdefined\sectionformat)
+ }{% (\ifdefined\titleformat)
+ % With titlesec
+ \@ifundefined{xpg@save@part@format}{}{%
+ \@ifundefined{NR@part}{%
+ \let\@part\xpg@save@part@format%
+ }{%
+ \let\NR@part\xpg@save@part@format%
+ }%
+ }%
}% (end \ifdefined\titleformat)
}
@@ -15783,7 +15759,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\if@xpg@french@footnote@set%
\else%
\iffrench@frenchfootnote%
- \ifdefstring{\xpg@main@language}{french}{%
+ \IfMainLanguageTF{french}{%
\ifx\@makefntext\undefined\else%
\long\def\french@makefntext##1{%
\parindent1em \noindent\quad%
@@ -15807,7 +15783,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\if@xpg@french@itemlabels@set%
\else%
\iffrench@frenchitemlabels
- \ifdefstring{\xpg@main@language}{french}{%
+ \IfMainLanguageTF{french}{%
\renewcommand{\labelitemi}{\french@itemi}%
\renewcommand{\labelitemii}{\french@itemii}%
\renewcommand{\labelitemiii}{\french@itemiii}%
@@ -15882,13 +15858,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-friulan.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-friulan.ldf}[polyglossia: module for Friulian]
% We only provide this gloss for babel compatibility.
-\xpg@load@master@language{friulian}
+\InheritGlossFile{friulian}
% \end{macrocode}
% \iffalse
@@ -15899,7 +15875,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-friulian.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-friulian.ldf}[polyglossia: module for Friulian]
@@ -15953,7 +15929,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
Lui\or Avost\or Setembar\or Otobar\or Novembar\or Dicembar%
\fi\space dal\space\number\year}}
-\AtEndPreamble{% the user or the class might define different values
+\AddToHook{begindocument/before}{% the user or the class might define different values
\edef\xpgfu@savedvalues{%
\clubpenalty=\the\clubpenalty\space
\@clubpenalty=\the\@clubpenalty\space
@@ -15985,13 +15961,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-fur.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-fur.ldf}[polyglossia: module for fur (Friulian)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{friulian}
+\InheritGlossFile{friulian}
% \end{macrocode}
% \iffalse
@@ -16002,13 +15978,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-ga.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-ga.ldf}[polyglossia: module for ga (Gaelic)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{gaelic}
+\InheritGlossFile{gaelic}
% \end{macrocode}
% \iffalse
@@ -16019,7 +15995,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-gaelic.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-gaelic.ldf}[polyglossia: module for Gaelic]
@@ -16043,23 +16019,28 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\setlanguagealias[variant=scottish]{gaelic}{scottish}
\def\gaelic@variant{irish}
-\define@choicekey*+{gaelic}{variant}[\xpg@val\xpg@nr]{irish,scottish}[irish]{%
- \ifcase\xpg@nr\relax
- % irish:
- \gdef\gaelic@variant{irish}%
- \SetLanguageKeys{gaelic}{language=Irish,langtag=IRI,babelname=irish,bcp47=ga,bcp47-language=ga}%
- \xpg@fontsetup@latin{gaelic}%
- \or
- % scottish:
- \gdef\gaelic@variant{scottish}%
- \SetLanguageKeys{gaelic}{language=Gaelic,langtag=GAE,babelname=scottish,bcp47=gd,bcp47-language=gd}%
- \xpg@fontsetup@latin{gaelic}%
- \fi
- \xpg@info{Option: gaelic, variant=\xpg@val}%
-}{\xpg@warning{Unknown gaelic variant `#1'}}
+
+\DeclareKeys[polyglossia/gloss/gaelic]
+ {
+ variant.choice:,
+ variant / irish.code =
+ {%
+ \gdef\gaelic@variant{irish}%
+ \SetLanguageKeys{gaelic}{language=Irish,langtag=IRI,babelname=irish,bcp47=ga,bcp47-language=ga}%
+ \SetupLatinPolyglossiaFont{gaelic}%
+ },
+ variant / scottish.code =
+ {%
+ \gdef\gaelic@variant{scottish}%
+ \SetLanguageKeys{gaelic}{language=Gaelic,langtag=GAE,babelname=scottish,bcp47=gd,bcp47-language=gd}%
+ \SetupLatinPolyglossiaFont{gaelic}%
+ },
+ variant.default:n = irish,
+ variant/unknown.code = \xpg@warning{Unknown gaelic variant `#1'}
+ }
% Register default options
-\xpg@initialize@gloss@options{gaelic}{variant=irish}
+\InitializeGlossOptions{gaelic}{variant=irish}
\def\captionsgaelic@irish{%
\def\refname{Tagairtí}%
@@ -16149,7 +16130,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-galician.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-galician.ldf}[polyglossia: module for Galician]
\PolyglossiaSetup{galician}{
@@ -16206,13 +16187,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-gd.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-gd.ldf}[polyglossia: module for gd (Gaelic)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{gaelic}
+\InheritGlossFile{gaelic}
% \end{macrocode}
% \iffalse
@@ -16223,7 +16204,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-georgian.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-georgian.ldf}[polyglossia: module for Georgian]
@@ -16243,34 +16224,37 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\setlanguagealias*{georgian}{ka}
\newif\ifgeorgian@numerals
-\define@key{georgian}{numerals}[arabic]{%
- \ifstrequal{#1}{georgian}%
- {\georgian@numeralstrue%
- \SetLanguageKeys{georgian}{bcp47-extension-u=nu-geor}%
- }%
- {\georgian@numeralsfalse%
- \SetLanguageKeys{georgian}{bcp47-extension-u=nu-latn}%
- }%
-}
-
-\define@boolkey{georgian}[georgian@]{babelshorthands}[true]{}
-\define@boolkey{georgian}[georgian@]{oldmonthnames}[true]{}
+\DeclareKeys[polyglossia/gloss/georgian]
+ {
+ babelshorthands.if = georgian@babelshorthands,
+ babelshorthands.default:n = true,
+ oldmonthnames.if = georgian@oldmonthnames,
+ oldmonthnames.default:n = true,
+ numerals.choice:,
+ numerals / arabic.code =
+ {%
+ \georgian@numeralsfalse
+ \SetLanguageKeys{georgian}{bcp47-extension-u=nu-latn}%
+ },
+ numerals / georgian.code =
+ {%
+ \georgian@numeralstrue
+ \SetLanguageKeys{georgian}{bcp47-extension-u=nu-geor}%
+ },
+ numerals.default:n = arabic
+ }
% Register default options
-\xpg@initialize@gloss@options{georgian}{babelshorthands=false,oldmonthnames=false,numerals=arabic}
+\InitializeGlossOptions{georgian}{babelshorthands=false,oldmonthnames=false,numerals=arabic}
\ifsystem@babelshorthands
- \setkeys{georgian}{babelshorthands=true}
+ \SetGlossOptions{georgian}{babelshorthands=true}
\else
- \setkeys{georgian}{babelshorthands=false}
+ \SetGlossOptions{georgian}{babelshorthands=false}
\fi
-\ifcsundef{initiate@active@char}{%
- \input{babelsh.def}%
- \initiate@active@char{"}%
- \shorthandoff{"}%
-}{}
+\InitializeBabelShorthands
\def\georgian@shorthands{%
\xpg@activate@shorthands%
@@ -16471,7 +16455,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-german.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-german.ldf}[polyglossia: module for German]
@@ -16520,51 +16504,11 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\newif\if@german@oldspelling
\@german@oldspellingfalse
-\define@choicekey*+{german}{spelling}[\xpg@val\xpg@nr]{new,old,1901,1996}[new]{%
- \ifcase\xpg@nr\relax
- % new:
- \@german@oldspellingfalse
- \or
- % old:
- \@german@oldspellingtrue
- \or
- % 1901:
- \@german@oldspellingtrue
- \or
- % 1996:
- \@german@oldspellingfalse
- \fi
- \german@set@babelname%
- \xpg@info{Option: German, spelling=\xpg@val}%
-}{\xpg@warning{Unknown German spelling `#1'}}
\newif\if@austrian@locale
\@austrian@localefalse
\newif\if@swiss@locale
\@swiss@localefalse
-\define@choicekey*+{german}{variant}[\xpg@val\xpg@nr]{german,austrian,swiss}[german]{%
- \ifcase\xpg@nr\relax
- % german:
- \@swiss@localefalse%
- \@austrian@localefalse%
- \or
- % austrian:
- \@austrian@localetrue%
- \@swiss@localefalse%
- \or
- % swiss:
- \@swiss@localetrue%
- \@austrian@localefalse%
- \xpg@ifdefined{swissgerman}{}%
- {%
- \xpg@warning{No hyphenation patterns were loaded for "Swiss German (Old Spelling)"\MessageBreak
- I will use the standard patterns for German (old spelling) instead}%
- \adddialect\l@swissgerman\l@german\relax%
- }%
- \fi
- \german@set@babelname%
- \xpg@info{Option: German, variant=\xpg@val}%
-}{\xpg@warning{Unknown German variant `#1'}}
\def\german@set@babelname{%
\if@german@oldspelling
@@ -16613,58 +16557,110 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
}
\newif\if@german@blackletter
-\define@choicekey*+{german}{script}[\xpg@val\xpg@nr]{latin,blackletter,fraktur}[latin]{%
- \ifcase\xpg@nr\relax
- % latin:
- \@german@blackletterfalse%
- \or
- % blackletter:
- \@german@blacklettertrue%
- \or
- % fraktur:
- \@german@blacklettertrue%
- \fi
- \german@set@babelname%
- \xpg@info{Option: German, script=\xpg@val}%
-}{\xpg@warning{Unknown German script `#1'}}
-
-\define@boolkey{german}[german@]{capitaleszett}[true]{%
- \ifgerman@capitaleszett
- % MakeUppercase capitalizes the eszett (U+00DF) with U+1E9E
- \SetLanguageKeys{german}{bcp47-casing=de-x-eszett,bcp47-extension-x=eszett}
- \else
- % Capitalize eszett as <SS>
- \SetLanguageKeys{german}{bcp47-casing=de,bcp47-extension-x={}}
- \fi
-}
-
-
-% Option defunc'ed, as both XeTeX and LuaTeX meanwhile
-% use the experimental German hyphenation patterns by default.
-\define@boolkey{german}[german@]{latesthyphen}[true]{}
-\define@boolkey{german}[german@]{babelshorthands}[true]{}
+\DeclareKeys[polyglossia/gloss/german]
+ {
+ babelshorthands.if = german@babelshorthands,
+ babelshorthands.default:n = true,
+ latesthyphen.if = german@latesthyphen,
+ latesthyphen.default:n = true,
+ capitaleszett.choice:,
+ capitaleszett / true.code =
+ {% MakeUppercase capitalizes the eszett (U+00DF) with U+1E9E
+ \SetLanguageKeys{german}{bcp47-casing=de-x-eszett,bcp47-extension-x=eszett}%
+ },
+ capitaleszett / false.code =
+ {% Capitalize eszett as <SS>
+ \SetLanguageKeys{german}{bcp47-casing=de,bcp47-extension-x={}}%
+ },
+ capitaleszett.default:n = true,
+ script.choice:,
+ script / latin.code =
+ {%
+ \@german@blackletterfalse
+ \german@set@babelname
+ },
+ script / blackletter.code =
+ {%
+ \@german@blacklettertrue
+ \german@set@babelname
+ },
+ script / fraktur.code =
+ {%
+ \@german@blacklettertrue
+ \german@set@babelname
+ },
+ script.default:n = latin,
+ script/unknown.code = \xpg@warning{Unknown German script `#1'},
+ spelling.choice:,
+ spelling / new.code =
+ {%
+ \@german@oldspellingfalse
+ \german@set@babelname
+ },
+ spelling / old.code =
+ {%
+ \@german@oldspellingtrue
+ \german@set@babelname
+ },
+ spelling / 1901.code =
+ {%
+ \@german@oldspellingtrue
+ \german@set@babelname
+ },
+ spelling / 1996.code =
+ {%
+ \@german@oldspellingfalse
+ \german@set@babelname
+ },
+ spelling.default:n = new,
+ spelling/unknown.code = \xpg@warning{Unknown German spelling `#1'},
+ variant.choice:,
+ variant / german.code =
+ {%
+ \@swiss@localefalse
+ \@austrian@localefalse
+ \german@set@babelname
+ },
+ variant / austrian.code =
+ {%
+ \@austrian@localetrue
+ \@swiss@localefalse
+ \german@set@babelname
+ },
+ variant / swiss.code =
+ {%
+ \@swiss@localetrue
+ \@austrian@localefalse
+ \IfLanguageDefinedF{swissgerman}
+ {%
+ \xpg@warning{No hyphenation patterns were loaded for "Swiss German (Old Spelling)"\MessageBreak
+ I will use the standard patterns for German (old spelling) instead}%
+ \adddialect\l@swissgerman\l@german\relax
+ }%
+ \german@set@babelname
+ },
+ variant.default:n = german,
+ variant/unknown.code = \xpg@warning{Unknown German variant `#1'}
+ }
+
-\setkeys{german}{spelling,script,variant}
+\SetGlossOptions{german}{spelling,script,variant}
% Register default options
-\xpg@initialize@gloss@options{german}{variant=german,spelling=new,script=latin,babelshorthands=false}
+\InitializeGlossOptions{german}{variant=german,spelling=new,script=latin,babelshorthands=false}
% Register alias options
-\xpg@set@alias@values{german}{spelling}{new}{1996}
-\xpg@set@alias@values{german}{spelling}{old}{1901}
-\xpg@set@alias@values{german}{script}{blackletter}{fraktur}
+\SetLanguageAliasValues{german}{spelling}{new,1996}
+\SetLanguageAliasValues{german}{spelling}{old,1901}
+\SetLanguageAliasValues{german}{script}{blackletter,fraktur}
\ifsystem@babelshorthands
- \setkeys{german}{babelshorthands=true}
+ \SetGlossOptions{german}{babelshorthands=true}
\else
- \setkeys{german}{babelshorthands=false}
+ \SetGlossOptions{german}{babelshorthands=false}
\fi
-\ifcsundef{initiate@active@char}{%
- \input{babelsh.def}%
- \initiate@active@char{"}%
- \shorthandoff{"}%
-}{}
+\InitializeBabelShorthands
\def\german@shorthands{%
\xpg@activate@shorthands%
@@ -16786,15 +16782,15 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\def\german@language{%
\if@german@oldspelling
\if@swiss@locale
- \polyglossia@setup@language@patterns{swissgerman}%
+ \SetupPolyglossiaLangPatterns{swissgerman}%
\else
- \polyglossia@setup@language@patterns{german}%
+ \SetupPolyglossiaLangPatterns{german}%
\fi
\if@austrian@locale
\adddialect\l@austrian\l@german%
\fi
\else
- \polyglossia@setup@language@patterns{ngerman}%
+ \SetupPolyglossiaLangPatterns{ngerman}%
\if@austrian@locale
\adddialect\l@naustrian\l@ngerman%
\fi
@@ -16825,13 +16821,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-germanb.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-germanb.ldf}[polyglossia: module for German (old spelling)]
% We provide this as a babel alias
-\xpg@load@master@language{german}
+\InheritGlossFile{german}
% \end{macrocode}
% \iffalse
@@ -16842,13 +16838,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-gl.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-gl.ldf}[polyglossia: module for gl (Galician)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{galician}
+\InheritGlossFile{galician}
% \end{macrocode}
% \iffalse
@@ -16859,13 +16855,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-grc.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-grc.ldf}[polyglossia: module for grc (Greek)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{greek}
+\InheritGlossFile{greek}
% \end{macrocode}
% \iffalse
@@ -16876,7 +16872,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-greek.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-greek.ldf}[polyglossia: module for Greek]
@@ -16900,7 +16896,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
% BCP-47 compliant aliases
\setlanguagealias*[variant=ancient]{greek}{grc}
-\setlanguagealias*[varant=polytonic]{greek}{el-polyton}
+\setlanguagealias*[variant=polytonic]{greek}{el-polyton}
\setlanguagealias*[variant=monotonic]{greek}{el-monoton}
\setlanguagealias*{greek}{el}
@@ -16920,44 +16916,9 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\newif\if@greek@ancient\@greek@ancientfalse
\newif\if@greek@poly\@greek@polyfalse
-\define@choicekey*+{greek}{variant}[\xpg@val\xpg@nr]{monotonic,mono,polytonic,poly,ancient,ancientgreek}[monotonic]{%
- \xpg@ifdefined{greek}{}{%
- \xpg@nopatterns{greek}%
- \adddialect\l@greek\l@nohyphenation
- }%
- \ifcase\xpg@nr\relax
- % monotonic:
- \@greek@polyfalse
- \@greek@ancientfalse
- \or
- % mono:
- \@greek@polyfalse
- \@greek@ancientfalse
- \or
- % polytonic:
- \@greek@polytrue
- \@greek@ancientfalse
- \or
- % poly:
- \@greek@polytrue
- \@greek@ancientfalse
- \or
- % ancient:
- \@greek@polyfalse
- \@greek@ancienttrue
- \or
- % ancientgreek:
- \@greek@polyfalse
- \@greek@ancienttrue
- \fi
- \greek@set@langdata
- \xpg@info{Option: Greek, variant=\xpg@val}%
-}{\xpg@warning{Unknown Greek variant `#1'}}
-
-
\def\greek@set@langdata{%
\if@greek@ancient
- \xpg@ifdefined{ancientgreek}{}%
+ \IfLanguageDefinedF{ancientgreek}%
{\xpg@warning{No hyphenation patterns were loaded for Ancient Greek\MessageBreak
I will use the patterns loaded for \string\l@greek\space instead}%
\adddialect\l@ancientgreek\l@greek\relax}%
@@ -16967,7 +16928,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\SetLanguageKeys{greek}{babelname=greek,bcp47=grc,bcp47-language=grc,bcp47-variant={}}%
\else
\if@greek@poly
- \xpg@ifdefined{polygreek}{}%
+ \IfLanguageDefinedF{polygreek}%
{\xpg@warning{No hyphenation patterns were loaded for Polytonic Greek\MessageBreak
I will use the patterns loaded for \string\l@greek\space instead}%
\adddialect\l@polygreek\l@greek\relax}%
@@ -16976,7 +16937,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\def\dategreek{\datepolygreek}%
\SetLanguageKeys{greek}{babelname=polutonikogreek,bcp47=el-polyton,bcp47-language=el,bcp47-variant=polyton}%
\else% monotonic greek
- \xpg@ifdefined{monogreek}{}%
+ \IfLanguageDefinedF{monogreek}%
{\xpg@warning{No hyphenation patterns were loaded for Monotonic Greek\MessageBreak
I will use the patterns loaded for \string\l@greek\space instead}%
\adddialect\l@monogreek\l@greek\relax}%
@@ -16990,42 +16951,85 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\def\greek@language{%
- \polyglossia@setup@language@patterns{\greek@variant}%
+ \SetupPolyglossiaLangPatterns{\greek@variant}%
}
\newif\if@greek@numerals
-\define@choicekey*+{greek}{numerals}[\xpg@val\xpg@nr]{greek,arabic}[greek]{%
- \ifcase\xpg@nr\relax
- % greek:
- \@greek@numeralstrue%
- \SetLanguageKeys{greek}{bcp47-extension-u=nu-grek}%
- \or
- % arabic:
- \@greek@numeralsfalse%
- \SetLanguageKeys{greek}{bcp47-extension-u=nu-latn}%
- \fi
- \xpg@info{Option: Greek, numerals=\xpg@val}%
-}{\xpg@warning{Unknown Greek numerals value `#1'}}
-
-\define@boolkey{greek}[greek@]{capitaliota}[true]{%
- \ifgreek@capitaliota
- % \MakeUppercase converts the ypogegrammeni (subscript muted iota) to capital iota
- \SetLanguageKeys{greek}{bcp47-casing=el-x-iota,bcp47-extension-x=iota}
- \else
- % \MakeUppercase retains the subscript versions (default)
- \SetLanguageKeys{greek}{bcp47-casing=el,bcp47-extension-x={}}
- \fi
-}
-
-\define@boolkey{greek}{attic}[true]{\xpg@warning{Greek option `attic' is no longer required.}}
+\DeclareKeys[polyglossia/gloss/greek]
+ {
+ variant.choices:nn = { monotonic, mono,polytonic, poly,ancient, ancientgreek }
+ {%
+ \CheckHyphenationPatterns{greek}%
+ \ifcase\UseName{l_keys_choice_int}\or
+ % monotonic:
+ \@greek@polyfalse
+ \@greek@ancientfalse
+ \or
+ % mono:
+ \@greek@polyfalse
+ \@greek@ancientfalse
+ \or
+ % polytonic:
+ \@greek@polytrue
+ \@greek@ancientfalse
+ \or
+ % poly:
+ \@greek@polytrue
+ \@greek@ancientfalse
+ \or
+ % ancient:
+ \@greek@polyfalse
+ \@greek@ancienttrue
+ \or
+ % ancientgreek:
+ \@greek@polyfalse
+ \@greek@ancienttrue
+ \fi
+ \greek@set@langdata
+ },
+ variant.default:n = monotonic,
+ variant/unknown.code = \xpg@warning{Unknown Greek variant `#1'},
+ numerals.choice:,
+ numerals / greek.code =
+ {%
+ \@greek@numeralstrue
+ \SetLanguageKeys{greek}{bcp47-extension-u=nu-grek}%
+ },
+ numerals / arabic.code =
+ {%
+ \@greek@numeralsfalse
+ \SetLanguageKeys{greek}{bcp47-extension-u=nu-latn}%
+ },
+ numerals.default:n = greek,
+ numerals/unknown.code = \xpg@warning{Unknown Greek numerals value `#1'},
+ capitaliota.choice:,
+ capitaliota / true.code =
+ {%
+ \@greek@capitaliotatrue
+ % \MakeUppercase converts the ypogegrammeni (subscript muted iota) to capital iota
+ \SetLanguageKeys{greek}{bcp47-casing=el-x-iota,bcp47-extension-x=iota}%
+ },
+ capitaliota / false.code =
+ {%
+ \@greek@capitaliotafalse
+ % \MakeUppercase retains the subscript versions (default)
+ \SetLanguageKeys{greek}{bcp47-casing=el,bcp47-extension-x={}}%
+ },
+ capitaliota.default:n = true,
+ attic.choices:nn = { true, false }
+ {%
+ \xpg@warning{Greek option `attic' is no longer required.}
+ },
+ capitaliota.default:n = true,
+ }
% Register default options
-\xpg@initialize@gloss@options{greek}{variant=monotonic,numerals=greek}
+\InitializeGlossOptions{greek}{variant=monotonic,numerals=greek}
% Register alias options
-\xpg@set@alias@values{greek}{variant}{monotonic}{mono}
-\xpg@set@alias@values{greek}{variant}{polytonic}{poly}
+\SetLanguageAliasValues{greek}{variant}{monotonic,mono}
+\SetLanguageAliasValues{greek}{variant}{polytonic,poly}
\def\monogreekcaptions{%
\def\refname{ΑναφοÏές}%
@@ -17344,13 +17348,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-he.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-he.ldf}[polyglossia: module for he (Hebrew)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{hebrew}
+\InheritGlossFile{hebrew}
% \end{macrocode}
% \iffalse
@@ -17361,7 +17365,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-hebrew.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-hebrew.ldf}[polyglossia: module for Hebrew]
@@ -17387,41 +17391,48 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
% BCP-47 compliant aliases
\setlanguagealias*{hebrew}{he}
-% hebrewcal options
-\define@key{hebrew}{marcheshvan}[true]{\setkeys{hebrewcal}{marcheshvan=#1}}
-\define@key{hebrew}{transliteration}[alt]{\setkeys{hebrewcal}{transliteration=#1}}
-\define@key{hebrew}{fullyear}[true]{\setkeys{hebrewcal}{fullyear=#1}}
-
\newif\if@calendar@hebrew
-\define@choicekey*+{hebrew}{calendar}[\xpg@val\xpg@nr]{hebrew,gregorian}[gregorian]{%
- \ifcase\xpg@nr\relax
- % hebrew:
- \@calendar@hebrewtrue
- \or
- % gregorian:
- \@calendar@hebrewfalse
- \fi
- \xpg@info{Option: Hebrew, calendar=\xpg@val}%
-}{\xpg@warning{Unknown Hebrew calendar `#1'}}
-
\newif\if@hebrew@numerals
-\define@choicekey*+{hebrew}{numerals}[\xpg@val\xpg@nr]{hebrew,arabic}[arabic]{%
- \ifcase\xpg@nr\relax
- % hebrew:
- \@hebrew@numeralstrue
- \SetLanguageKeys{hebrew}{bcp47-extension-u=nu-hebr}%
- \or
- % arabic:
- \@hebrew@numeralsfalse
- \SetLanguageKeys{hebrew}{bcp47-extension-u=nu-latn}%
- \fi
- \xpg@info{Option: Hebrew, numerals=\xpg@val}%
-}{\xpg@warning{Unknown Hebrew numerals value `#1'}}
-\setkeys{hebrew}{numerals}
+\DeclareKeys[polyglossia/gloss/hebrew]
+ {
+ marcheshvan.code = \setkeys{hebrewcal}{marcheshvan=#1},
+ marcheshvan.default:n = true,
+ transliteration.code = \setkeys{hebrewcal}{transliteration=#1},
+ transliteration.default:n = alt,
+ fullyear.code = \setkeys{hebrewcal}{fullyear=#1},
+ fullyear.default:n = true,
+ calendar.choice:,
+ calendar / hebrew.code =
+ {%
+ \@calendar@hebrewtrue
+ },
+ calendar / gregorian.code =
+ {%
+ \@calendar@hebrewfalse
+ },
+ calendar.default:n = gregorian,
+ calendar/unknown.code = \xpg@warning{Unknown Hebrew calendar `#1'},
+ numerals.choice:,
+ numerals / hebrew.code =
+ {%
+ \@hebrew@numeralstrue
+ \SetLanguageKeys{hebrew}{bcp47-extension-u=nu-hebr}%
+ },
+ numerals / arabic.code =
+ {%
+ \@hebrew@numeralsfalse
+ \SetLanguageKeys{hebrew}{bcp47-extension-u=nu-latn}%
+ },
+ numerals.default:n = arabic,
+ numerals/unknown.code = \xpg@warning{Unknown Hebrew numerals value `#1'}
+ }
+
+
+\SetGlossOptions{hebrew}{numerals}
% Register default options
-\xpg@initialize@gloss@options{hebrew}{numerals=arabic,calendar=gregorian,marcheshvan=false,fullyear=false}
+\InitializeGlossOptions{hebrew}{numerals=arabic,calendar=gregorian,marcheshvan=false,fullyear=false}
\def\captionshebrew{%
\def\prefacename{מבו×}%
@@ -17535,13 +17546,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-hi.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-hi.ldf}[polyglossia: module for hi (Hindi)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{hindi}
+\InheritGlossFile{hindi}
% \end{macrocode}
% \iffalse
@@ -17552,7 +17563,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-hindi.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
% UTF-8 strings kindly provided by Zdenĕk Wagner, 10-03-2008
% with corrections and additional contributions by Anshuman Pandey
@@ -17579,8 +17590,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\ifx\l@hindi\@undefined%
\ifx\l@sanskrit\@undefined%
- \xpg@nopatterns{Hindi}%
- \adddialect\l@hindi\l@nohyphenation%
+ \XPGNoPatternsFallback{hindi}%
\else
\xpg@warning{No hyphenation patterns were loaded for Hindi\MessageBreak
I will use the patterns for Sanskrit instead}
@@ -17589,26 +17599,31 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\fi
\def\hindi@language{%
- \polyglossia@setup@language@patterns{hindi}%
+ \SetupPolyglossiaLangPatterns{hindi}%
}
\newif\ifhindi@devanagari@numerals
\hindi@devanagari@numeralstrue
-\define@choicekey*+{hindi}{numerals}[\xpg@val\xpg@nr]{Devanagari,Western}[Devanagari]{%
- \ifcase\xpg@nr\relax
- % Devanagari:
- \hindi@devanagari@numeralstrue%
- \SetLanguageKeys{hindi}{bcp47-extension-u=nu-deva}%
- \or
- % Western:
- \hindi@devanagari@numeralsfalse%
- \SetLanguageKeys{hindi}{bcp47-extension-u=nu-latn}%
- \fi
- \xpg@info{Option: Hindi, numerals=\xpg@val}%
-}{\xpg@warning{Unknown Hindi numeral `#1'}}
+
+\DeclareKeys[polyglossia/gloss/hindi]
+ {
+ numerals.choice:,
+ numerals / devanagari.code =
+ {%
+ \hindi@devanagari@numeralstrue
+ \SetLanguageKeys{hindi}{bcp47-extension-u=nu-deva}%
+ },
+ numerals / western.code =
+ {%
+ \hindi@devanagari@numeralsfalse
+ \SetLanguageKeys{hindi}{bcp47-extension-u=nu-latn}%
+ },
+ numerals.default:n = devanagari,
+ numerals/unknown.code = \xpg@warning{Unknown Hindi numeral `#1'}
+ }
% Register default options
-\xpg@initialize@gloss@options{hindi}{numerals=devanagari}
+\InitializeGlossOptions{hindi}{numerals=devanagari}
\newcommand{\hindinumerals}[2]{\hindinumber{#2}}
@@ -17628,6 +17643,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\def\contentsname{विषय सूची}%
\def\enclname{}%
\def\figurename{चितà¥à¤°}% रेखाचितà¥à¤°
+ \def\glossaryname{शबà¥à¤¦à¤¾à¤°à¥à¤¥ सूची}%
\def\headpagename{पृषà¥à¤ }%
\def\headtoname{}%
\def\indexname{सूची}%
@@ -17639,6 +17655,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\def\pagename{पृषà¥à¤ }%
\def\partname{खणà¥à¤¡}%
\def\prefacename{पà¥à¤°à¤¸à¥à¤¤à¤¾à¤µà¤¨à¤¾}% पà¥à¤°à¤¾à¤•à¥à¤•à¤¥à¤¨
+ \def\proofname{पà¥à¤°à¤®à¤¾à¤£}%
\def\refname{हवाले}%
\def\tablename{तालिका}%
\def\seename{देखिà¤}%
@@ -17671,13 +17688,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-hr.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-hr.ldf}[polyglossia: module for hr (Croatian)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{croatian}
+\InheritGlossFile{croatian}
% \end{macrocode}
% \iffalse
@@ -17688,13 +17705,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-hsb.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-hsb.ldf}[polyglossia: module for hsb (Higher Sorbian)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{sorbian}
+\InheritGlossFile{sorbian}
% \end{macrocode}
% \iffalse
@@ -17705,13 +17722,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-hu.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-hu.ldf}[polyglossia: module for hu (Hungarian)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{hungarian}
+\InheritGlossFile{hungarian}
% \end{macrocode}
% \iffalse
@@ -17722,7 +17739,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-hungarian.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-hungarian.ldf}[polyglossia: module for Hungarian]
@@ -17749,53 +17766,61 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\newif\if@hungarian@swapcaptions
\newif\if@hungarian@swapheadings
\newif\if@hungarian@swapheaders
-\define@choicekey*+{hungarian}{swapstrings}[\xpg@val\xpg@nr]{all,captions,headings,headers,hheaders,none}[all]{%
- \ifcase\xpg@nr\relax
- % all:
- \@hungarian@swapcaptionstrue%
- \@hungarian@swapheadingstrue%
- \@hungarian@swapheaderstrue%
- \or
- % captions:
- \@hungarian@swapcaptionstrue%
- \@hungarian@swapheadingsfalse%
- \@hungarian@swapheadersfalse%
- \or
- % headings:
- \@hungarian@swapcaptionsfalse%
- \@hungarian@swapheadingstrue%
- \@hungarian@swapheadersfalse%
- \or
- % headers:
- \@hungarian@swapcaptionsfalse%
- \@hungarian@swapheadingsfalse%
- \@hungarian@swapheaderstrue%
- \or
- % hheaders:
- \@hungarian@swapcaptionsfalse%
- \@hungarian@swapheadingstrue%
- \@hungarian@swapheaderstrue%
- \or
- % none:
- \@hungarian@swapcaptionsfalse%
- \@hungarian@swapheadingsfalse%
- \@hungarian@swapheadersfalse%
- \fi
- \xpg@info{Option: Hungarian, swapstrings=\xpg@val}%
-}{\xpg@warning{Unknown Hungarian swapstrings value `#1'}}
-% Force punctuation: 1) after section type counters; 2) after @chapapp in the running head
-\define@boolkey{hungarian}[hungarian@]{forceheadingpunctuation}[true]{}
+\DeclareKeys[polyglossia/gloss/hungarian]
+ {
+ forceheadingpunctuation.if = hungarian@forceheadingpunctuation,
+ forceheadingpunctuation.default:n = true,
+ swapstrings.choice:,
+ swapstrings / all.code =
+ {%
+ \@hungarian@swapcaptionstrue
+ \@hungarian@swapheadingstrue
+ \@hungarian@swapheaderstrue
+ },
+ swapstrings / captions.code =
+ {%
+ \@hungarian@swapcaptionstrue
+ \@hungarian@swapheadingsfalse
+ \@hungarian@swapheadersfalse
+ },
+ swapstrings / headings.code =
+ {%
+ \@hungarian@swapcaptionsfalse
+ \@hungarian@swapheadingstrue
+ \@hungarian@swapheadersfalse
+ },
+ swapstrings / headers.code =
+ {%
+ \@hungarian@swapcaptionsfalse
+ \@hungarian@swapheadingsfalse
+ \@hungarian@swapheaderstrue
+ },
+ swapstrings / hheaders.code =
+ {%
+ \@hungarian@swapcaptionsfalse
+ \@hungarian@swapheadingstrue
+ \@hungarian@swapheaderstrue
+ },
+ swapstrings / none.code =
+ {%
+ \@hungarian@swapcaptionsfalse
+ \@hungarian@swapheadingsfalse
+ \@hungarian@swapheadersfalse
+ },
+ swapstrings.default:n = all,
+ swapstrings/unknown.code = \xpg@warning{Unknown Hungarian swapstrings value `#1'}
+ }
% Register default options
% forceheadinpunctuatin is recommended, but the default value is false for compatibility reasons
-\xpg@initialize@gloss@options{hungarian}{swapstrings=all,
+\InitializeGlossOptions{hungarian}{swapstrings=all,
forceheadingpunctuation=false}
\def\hungarian@language{%
- \polyglossia@setup@language@patterns{hungarian}%
- \xpg@ifdefined{hungarian}{\adddialect\l@magyar\l@hungarian}{}%
+ \SetupPolyglossiaLangPatterns{hungarian}%
+ \IfLanguageDefinedT{hungarian}{\adddialect\l@magyar\l@hungarian}%
}%
\def\captionshungarian{%
@@ -17867,120 +17892,104 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
% change chapter and part headings
\if@hungarian@swapheadings
% With titlesec
- \ifcsdef{titleformat}{%
- \ifcsdef{NR@part}{% Hyperref (nameref)
- \let\xpg@save@part@format\NR@part%
- \patchcmd{\NR@part}%
- {\partname\nobreakspace\thepart}%
- {\thepart.\nobreakspace\partname}%
- {}%
- {\xpg@warning{Failed to patch part for Hungarian}}%
- }{% not hyperref
- \ifcsdef{@part}{%
- \let\xpg@save@part@format\@part%
- \patchcmd{\@part}%
- {\partname\nobreakspace\thepart}%
- {\thepart.\nobreakspace\partname}%
- {}%
- {\xpg@warning{Failed to patch part for Hungarian}}%
- }{}%
- }
- \ifcsdef{chapter}{%
- \titleformat\chapter[display]%
- {\@ifundefined{ttl@fil}{\raggedright}{\ttl@fil}\ttl@fonts\ttl@sizes6}
- {\thechapter.\space\@chapapp}{.8\baselineskip}{\ttl@sizes\z@\ttl@passexplicit}
- }{}%
- }{% (not \ifdefined\titleformat)
+ \@ifundefined{titleformat}{%
% With KOMA
- \ifcsdef{sectionformat}{%
- \ifcsdef{partformat}{%
- \let\xpg@save@part@format\partformat%
- \renewcommand{\partformat}{\thepart.~\partname}%
- }{}%
- \ifcsdef{chapterformat}{%
- \let\xpg@save@chap@format\chapterformat%
- \renewcommand{\chapterformat}{\mbox{\thechapter\autodot%
- \IfUsePrefixLine{\nobreakspace\chapapp}{\enskip}}}%
- }{}%
- }{% (not \ifdefined\sectionformat)
- % With memoir
- \ifcsdef{@memptsize}{%
- \ifcsdef{@makechapterhead}{%
- \let\xpg@save@chap@format\@makechapterhead%
- \patchcmd{\@makechapterhead}{\printchaptername \chapternamenum \printchapternum}%
- {\printchapternum.\chapternamenum\printchaptername}%
- {}%
- {\xpg@warning{Failed to patch chapter for Hungarian}}%
- }{}%
- \ifcsdef{NR@part}{% Hyperref (nameref)
- \let\xpg@save@part@format\NR@part%
- \patchcmd{\NR@part}{\printpartname \partnamenum \printpartnum}%
- {\printpartnum.\partnamenum\printpartname}%
- {}%
- {\xpg@warning{Failed to patch part for Hungarian}}%
- }{% not hyperref
- \ifcsdef{@part}{%
- \let\xpg@save@part@format\@part%
- \patchcmd{\@part}{\printpartname \partnamenum \printpartnum}%
- {\printpartnum.\partnamenum\printpartname}%
- {}%
- {\xpg@warning{Failed to patch part for Hungarian}}%
- }{}%
- }%
- }{% (not \ifdefined\@memptsize)
+ \@ifundefined{sectionformat}{%
+ % Memoir?
+ \@ifundefined{@memptsize}{%
% With standard classes
- \ifcsdef{@makechapterhead}{%
+ \@ifundefined{@makechapterhead}{}{%
\let\xpg@save@chap@format\@makechapterhead%
\patchcmd{\@makechapterhead}%
{\@chapapp\space \thechapter}%
{\thechapter.\space \@chapapp}%
{}%
{\xpg@warning{Failed to patch chapter for Hungarian}}%
- }{}%
- \ifcsdef{NR@part}{% Hyperref (nameref)
+ }%
+ \@ifundefined{NR@part}{% not hyperref
+ \@ifundefined{@part}{}{%
+ \let\xpg@save@part@format\@part%
+ \patchcmd{\@part}%
+ {\partname\nobreakspace\thepart}%
+ {\thepart.\nobreakspace\partname}%
+ {}%
+ {\@ifundefined{part}{}{\xpg@warning{Failed to patch part for Hungarian}}}%
+ }% (end \ifdefined\@part)
+ }{% Hyperref (nameref)
\let\xpg@save@part@format\NR@part%
\patchcmd{\NR@part}%
{\partname\nobreakspace\thepart}%
{\thepart.\nobreakspace\partname}%
{}%
{\xpg@warning{Failed to patch part for Hungarian}}%
- }{% not hyperref
- \ifcsdef{@part}{%
- \let\xpg@save@part@format\@part%
- \patchcmd{\@part}%
- {\partname\nobreakspace\thepart}%
- {\thepart.\nobreakspace\partname}%
- {}%
- {\ifcsdef{part}{\xpg@warning{Failed to patch part for Hungarian}}{}}%
- }{}% (end \ifdefined\@part)
}% (end not hyperref)
- }% (end \ifdefined\@memptsize)
- }% (end \ifdefined\sectionformat)
+ }{% with memoir (\ifdefined\@memptsize)
+ \@ifundefined{@makechapterhead}{}{%
+ \let\xpg@save@chap@format\@makechapterhead%
+ \patchcmd{\@makechapterhead}{\printchaptername \chapternamenum \printchapternum}%
+ {\printchapternum.\chapternamenum\printchaptername}%
+ {}%
+ {\xpg@warning{Failed to patch chapter for Hungarian}}%
+ }%
+ \@ifundefined{NR@part}{% not hyperref
+ \@ifundefined{@part}{}{%
+ \let\xpg@save@part@format\@part%
+ \patchcmd{\@part}{\printpartname \partnamenum \printpartnum}%
+ {\printpartnum.\partnamenum\printpartname}%
+ {}%
+ {\xpg@warning{Failed to patch part for Hungarian}}%
+ }%
+ }{% Hyperref (nameref)
+ \let\xpg@save@part@format\NR@part%
+ \patchcmd{\NR@part}{\printpartname \partnamenum \printpartnum}%
+ {\printpartnum.\partnamenum\printpartname}%
+ {}%
+ {\xpg@warning{Failed to patch part for Hungarian}}%
+ }%
+ }% (end \ifdefined\@memptsize)
+ }{% (\ifdefined\sectionformat)
+ \@ifundefined{partformat}{}{%
+ \let\xpg@save@part@format\partformat%
+ \renewcommand{\partformat}{\thepart.~\partname}%
+ }%
+ \@ifundefined{chapterformat}{}{%
+ \let\xpg@save@chap@format\chapterformat%
+ \renewcommand{\chapterformat}{\mbox{\thechapter\autodot%
+ \IfUsePrefixLine{\nobreakspace\chapapp}{\enskip}}}%
+ }%
+ }% (end \ifdefined\sectionformat)
+ }{% (\ifdefined\titleformat)
+ \@ifundefined{NR@part}{% not hyperref
+ \@ifundefined{@part}{}{%
+ \let\xpg@save@part@format\@part%
+ \patchcmd{\@part}%
+ {\partname\nobreakspace\thepart}%
+ {\thepart.\nobreakspace\partname}%
+ {}%
+ {\xpg@warning{Failed to patch part for Hungarian}}%
+ }%
+ }{% Hyperref (nameref)
+ \let\xpg@save@part@format\NR@part%
+ \patchcmd{\NR@part}%
+ {\partname\nobreakspace\thepart}%
+ {\thepart.\nobreakspace\partname}%
+ {}%
+ {\xpg@warning{Failed to patch part for Hungarian}}%
+ }%
+ \@ifundefined{chapter}{}{%
+ \titleformat\chapter[display]%
+ {\@ifundefined{ttl@fil}{\raggedright}{\ttl@fil}\ttl@fonts\ttl@sizes6}
+ {\thechapter.\space\@chapapp}{.8\baselineskip}{\ttl@sizes\z@\ttl@passexplicit}
+ }%
}% (end \ifdefined\titleformat)
\fi% (end \if@hungarian@swapheadings)
%
% Change running headers
\if@hungarian@swapheaders
- \ifcsdef{chapterformat}{%
- % With KOMA
- \let\xpg@save@chaptermark@format\chaptermarkformat%
- \renewcommand*\chaptermarkformat{%
- \thechapter\autodot\ \IfChapterUsesPrefixLine{\chapapp\@hungarian@forced@dot\enskip}{}}
- }{% (not \ifdefined\chapterformat)
- \ifcsdef{@memptsize}{%
- % With memoir
- \let\xpg@save@chaptermark@format\chaptermark%
- \renewcommand*\chaptermark[1]{%
- \markboth{\memUChead{%
- \ifnum \c@secnumdepth >\m@ne
- \ifbool{@mainmatter}{%
- \thechapter.\ \@chapapp\@hungarian@forced@dot\ %
- }{}%
- \fi
- ##1}}{}}%
- }{% (not \ifdefined\@memptsize)
+ \@ifundefined{chapterformat}{%
+ \@ifundefined{@memptsize}{%
% With standard classes
- \ifcsdef{chaptermark}{%
+ \@ifundefined{chaptermark}{}{%
\ifpatchable{\chaptermark}%
{\@chapapp\ \thechapter.}%
{\let\xpg@save@chaptermark@format\chaptermark%
@@ -17990,8 +17999,24 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
{}%
{\xpg@warning{Failed to patch chaptermark for Hungarian}}}%
{}%
- }{}% (end \ifdefined\chaptermark)
+ }% (end \ifdefined\chaptermark)
+ }{% (\ifdefined\@memptsize)
+ % With memoir
+ \let\xpg@save@chaptermark@format\chaptermark%
+ \renewcommand*\chaptermark[1]{%
+ \markboth{\memUChead{%
+ \ifnum \c@secnumdepth >\m@ne
+ \ifbool{@mainmatter}{%
+ \thechapter.\ \@chapapp\@hungarian@forced@dot\ %
+ }{}%
+ \fi
+ ##1}}{}}%
}% (end \ifdefined\@memptsize)
+ }{% (\ifdefined\chapterformat)
+ % With KOMA
+ \let\xpg@save@chaptermark@format\chaptermarkformat%
+ \renewcommand*\chaptermarkformat{%
+ \thechapter\autodot\ \IfChapterUsesPrefixLine{\chapapp\@hungarian@forced@dot\enskip}{}}
}% (end \ifdefined\chapterformat)
\fi% (end \if@hungarian@swapheaders)
}
@@ -18003,58 +18028,58 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\let\fnum@figure\xpg@save@fnum@figure%
%
% Reset chapter and part heading
- \ifcsdef{titleformat}{%
+ \@ifundefined{titleformat}{%
+ \@ifundefined{sectionformat}{%
+ % With memoir and standard classes
+ \@ifundefined{xpg@save@part@format}{}{%
+ \@ifundefined{NR@part}{%
+ \let\@part\xpg@save@part@format%
+ }{%
+ \let\NR@part\xpg@save@part@format%
+ }%
+ }%
+ \@ifundefined{xpg@save@chap@format}{}{%
+ \let\@makechapterhead\xpg@save@chap@format
+ }%
+ }{%
+ % With KOMA
+ \@ifundefined{xpg@save@part@format}{}{%
+ \let\partformat\xpg@save@part@format
+ }%
+ \@ifundefined{xpg@save@chap@format}{}{%
+ \let\chapterformat\xpg@save@chap@format
+ }%
+ }% (end \ifdefined\sectionformat)
+ }{% (\ifdefined\titleformat)
% With titlesec
- \ifcsdef{xpg@save@part@format}{%
- \ifcsdef{NR@part}{%
- \let\NR@part\xpg@save@part@format%
- }{%
+ \@ifundefined{xpg@save@part@format}{}{%
+ \@ifundefined{NR@part}{%
\let\@part\xpg@save@part@format%
+ }{%
+ \let\NR@part\xpg@save@part@format%
}%
- }{}%
- \ifcsdef{chapter}{%
+ }%
+ \@ifundefined{chapter}{}{%
\titleformat\chapter[display]%
{\@ifundefined{ttl@fil}{\raggedright}{\ttl@fil}\ttl@fonts\ttl@sizes6}
{\@chapapp\space\thechapter}{.8\baselineskip}{\ttl@sizes\z@\ttl@passexplicit}
- }{}%
- }{% (not \ifdefined\titleformat)
- \ifcsdef{sectionformat}{%
- % With KOMA
- \ifcsdef{xpg@save@part@format}{%
- \let\partformat\xpg@save@part@format
- }{}%
- \ifcsdef{xpg@save@chap@format}{%
- \let\chapterformat\xpg@save@chap@format
- }{}%
- }{%
- % With memoir and standard classes
- \ifcsdef{xpg@save@part@format}{%
- \ifcsdef{NR@part}{%
- \let\NR@part\xpg@save@part@format%
- }{%
- \let\@part\xpg@save@part@format%
- }%
- }{}%
- \ifcsdef{xpg@save@chap@format}{%
- \let\@makechapterhead\xpg@save@chap@format
- }{}%
- }% (end \ifdefined\sectionformat)
+ }%
}% (end \ifdefined\titleformat)
%
% Reset headers
- \ifcsdef{chaptermarkformat}{%
- % With KOMA
- \ifcsdef{xpg@save@chaptermark@format}{%
- \let\chaptermarkformat\xpg@save@chaptermark@format%
- }{}%
- }{%
- \ifcsdef{chaptermark}{%
+ \@ifundefined{chaptermarkformat}{%
+ \@ifundefined{chaptermark}{}{%
% With memoir and standard classes
- \ifcsdef{xpg@save@chaptermark@format}{%
+ \@ifundefined{xpg@save@chaptermark@format}{}{%
\let\chaptermark\xpg@save@chaptermark@format%
- }{}%
- }{}% (end \ifdefined\chaptermark)
- }% (end \ifdefined\chapterformat)
+ }%
+ }% (end \ifdefined\chaptermark)
+ }{%
+ % With KOMA
+ \@ifundefined{xpg@save@chaptermark@format}{}{%
+ \let\chaptermarkformat\xpg@save@chaptermark@format%
+ }%
+ }% (end \ifdefined\chaptermarkformat)
}
% Hungarian needs 1) trailing dots in chapter headings; 2) trailing dot in section, subsection, etc, counters
\def\@hungarian@forced@dot{}
@@ -18121,13 +18146,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-hy.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-hy.ldf}[polyglossia: module for hy (Armenian)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{armenian}
+\InheritGlossFile{armenian}
% \end{macrocode}
% \iffalse
@@ -18138,13 +18163,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-ia.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-ia.ldf}[polyglossia: module for ia (Interlingua)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{interlingua}
+\InheritGlossFile{interlingua}
% \end{macrocode}
% \iffalse
@@ -18155,7 +18180,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-icelandic.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-icelandic.ldf}[polyglossia: module for Icelandic]
\PolyglossiaSetup{icelandic}{
@@ -18213,13 +18238,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-id.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-id.ldf}[polyglossia: module for id (Malay)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{malay}
+\InheritGlossFile{malay}
% \end{macrocode}
% \iffalse
@@ -18230,7 +18255,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-interlingua.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-interlingua.ldf}[polyglossia: module for Interlingua]
\PolyglossiaSetup{interlingua}{
@@ -18288,14 +18313,14 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-irish.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-irish.ldf}[polyglossia: module for Irish]
% We only provide this gloss for babel compatibility. Since irish is
% a gaelic variety, we use 'gaelic' with variant 'irish' now.
-\xpg@load@master@language{gaelic}
+\InheritGlossFile{gaelic}
% \end{macrocode}
% \iffalse
@@ -18306,13 +18331,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-is.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-is.ldf}[polyglossia: module for is (Icelandic)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{icelandic}
+\InheritGlossFile{icelandic}
% \end{macrocode}
% \iffalse
@@ -18323,13 +18348,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-it.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-it.ldf}[polyglossia: module for it (Italian)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{italian}
+\InheritGlossFile{italian}
% \end{macrocode}
% \iffalse
@@ -18341,7 +18366,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
% \subsection{gloss-italian.ldf}
% \begin{macrocode}
% !TEX encoding = UTF-8 Unicode
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-italian.ldf}[polyglossia: module for Italian]
\PolyglossiaSetup{italian}{
@@ -18360,24 +18385,22 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
% BCP-47 compliant aliases
\setlanguagealias*{italian}{it}
-
-%%% CHANGES START %%% by Enrico Gregorio
-\define@boolkey{italian}[italian@]{babelshorthands}[true]{}
+\DeclareKeys[polyglossia/gloss/italian]
+ {
+ babelshorthands.if = italian@babelshorthands,
+ babelshorthands.default:n = true,
+ }
% Register default options
-\xpg@initialize@gloss@options{italian}{babelshorthands=false}
+\InitializeGlossOptions{italian}{babelshorthands=false}
\ifsystem@babelshorthands
- \setkeys{italian}{babelshorthands=true}
+ \SetGlossOptions{italian}{babelshorthands=true}
\else
- \setkeys{italian}{babelshorthands=false}
+ \SetGlossOptions{italian}{babelshorthands=false}
\fi
-\ifcsundef{initiate@active@char}{%
- \input{babelsh.def}%
- \initiate@active@char{"}%
- \shorthandoff{"}%
-}{}
+\InitializeBabelShorthands
\def\italian@shorthands{%
\xpg@activate@shorthands%
@@ -18457,7 +18480,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%%% CHANGES START %%% by Enrico Gregorio
\let\xpgit@savedvalues\empty
-\AtEndPreamble{% the user or the class might define different values
+\AddToHook{begindocument/before}{% the user or the class might define different values
\edef\xpgit@savedvalues{%
\clubpenalty=\the\clubpenalty\space
\@clubpenalty=\the\@clubpenalty\space
@@ -18493,13 +18516,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-ja.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-ja.ldf}[polyglossia: module for ja (Japanese)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{japanese}
+\InheritGlossFile{japanese}
% \end{macrocode}
% \iffalse
@@ -18510,7 +18533,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-japanese.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-japanese.ldf}[polyglossia: module for Japanese]
@@ -18749,13 +18772,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-ka.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-ka.ldf}[polyglossia: module for ka (Georgian)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{georgian}
+\InheritGlossFile{georgian}
% \end{macrocode}
% \iffalse
@@ -18767,7 +18790,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
% \subsection{gloss-kannada.ldf}
% \begin{macrocode}
%% gloss-kannada.ldf
-%% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+%% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%%
%% Copyright 2011 Aravinda VK <hallimanearavind AT gmail.com>,
%% Shankar Prasad <prasad.mvs AT gmail.com>,
@@ -18821,12 +18844,20 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\def\tmp@western{Western}
\newif\ifkannada@numerals
\kannada@numeralstrue
-
-\define@key{kannada}{numerals}[Kannada]{%
- \def\@tmpa{#1}%
- \ifx\@tmpa\tmp@western
- \kannada@numeralsfalse
- \fi}
+
+\DeclareKeys[polyglossia/gloss/kannada]
+ {
+ numerals.choice:,
+ numerals / kannada.code =
+ {%
+ \kannada@numeralstrue
+ },
+ numerals / western.code =
+ {%
+ \kannada@numeralsfalse
+ },
+ numerals.default:n = kannada
+ }
\def\captionskannada{%
@@ -18890,7 +18921,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-khmer.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-khmer.ldf}[polyglossia: module for Khmer]
\PolyglossiaSetup{khmer}{
@@ -18911,18 +18942,24 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\newif\if@khmer@numerals
\def\tmp@khmer{khmer}
-\define@key{khmer}{numerals}[arabic]{%
- \def\@tmpa{#1}%
- \ifx\@tmpa\tmp@khmer%
- \@khmer@numeralstrue%
- \SetLanguageKeys{khmer}{bcp47-extension-u=nu-khmr}%
- \else%
- \@khmer@numeralsfalse%
- \SetLanguageKeys{khmer}{bcp47-extension-u=nu-latn}%
- \fi%
-}
-\setkeys{khmer}{numerals}
+\DeclareKeys[polyglossia/gloss/khmer]
+ {
+ numerals.choice:,
+ numerals / khmer.code =
+ {%
+ \@khmer@numeralstrue
+ \SetLanguageKeys{khmer}{bcp47-extension-u=nu-khmr}%
+ },
+ numerals / arabic.code =
+ {%
+ \@khmer@numeralsfalse
+ \SetLanguageKeys{khmer}{bcp47-extension-u=nu-latn}%
+ },
+ numerals.default:n = arabic
+ }
+
+\SetGlossOptions{khmer}{numerals}
\def\captionskhmer{%
\def\prefacename{អារម្ភកážáž¶}%
@@ -19073,13 +19110,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-km.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-km.ldf}[polyglossia: module for km (Khmer)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{khmer}
+\InheritGlossFile{khmer}
% \end{macrocode}
% \iffalse
@@ -19090,13 +19127,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-kmr-Arab.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-kmr-Arab.ldf}[polyglossia: module for kmr-Arab (Kurdish)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{kurdish}
+\InheritGlossFile{kurdish}
% \end{macrocode}
% \iffalse
@@ -19107,13 +19144,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-kmr-Latn.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-kmr-Latn.ldf}[polyglossia: module for kmr-Latn (Kurdish)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{kurdish}
+\InheritGlossFile{kurdish}
% \end{macrocode}
% \iffalse
@@ -19124,13 +19161,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-kmr.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-kmr.ldf}[polyglossia: module for kmr (Kurdish)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{kurdish}
+\InheritGlossFile{kurdish}
% \end{macrocode}
% \iffalse
@@ -19141,13 +19178,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-kn.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-kn.ldf}[polyglossia: module for kn (Kannada)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{kannada}
+\InheritGlossFile{kannada}
% \end{macrocode}
% \iffalse
@@ -19158,13 +19195,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-ko.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-ko.ldf}[polyglossia: module for ko (Korean)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{korean}
+\InheritGlossFile{korean}
% \end{macrocode}
% \iffalse
@@ -19175,7 +19212,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-korean.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-korean.ldf}[polyglossia: module for Korean]
@@ -19195,40 +19232,48 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
% BCP-47 compliant aliases
\setlanguagealias*{korean}{ko}
-% variant : plain (0), classic (1), or modern (2)
-\define@choicekey{korean}{variant}[\xpg@val\xpg@nr]{plain,classic,modern}[plain]{%
- \let\xpg@korean@variant\xpg@nr
-}
-% captions : hangul (0) or hanja (1)
-\define@choicekey{korean}{captions}[\xpg@val\xpg@nr]{hangul,hanja}[hangul]{%
- \let\xpg@korean@captions\xpg@nr
-}
-% swapstrings: all (0), headings (1), headers (2), or none (3)
\newif\if@korean@swapheadings
\newif\if@korean@swapheaders
-\define@choicekey*+{korean}{swapstrings}[\xpg@val\xpg@nr]{all,headings,headers,none}[all]{%
- \ifcase\xpg@nr\relax
- % all:
- \@korean@swapheadingstrue%
- \@korean@swapheaderstrue%
- \or
- % headings:
- \@korean@swapheadingstrue%
- \@korean@swapheadersfalse%
- \or
- % headers:
- \@korean@swapheadingsfalse%
- \@korean@swapheaderstrue%
- \or
- % none:
- \@korean@swapheadingsfalse%
- \@korean@swapheadersfalse%
- \fi
- \xpg@info{Option: Korean, swapstrings=\xpg@val}%
-}{\xpg@warning{Unknown Korean swapstrings value `#1'}}
+
+\DeclareKeys[polyglossia/gloss/korean]
+ {
+ variant.choices:nn = { plain, classic, modern }
+ {%
+ \edef\xpg@korean@variant{\the\numexpr\UseName{l_keys_choice_int}-1\relax}
+ },
+ variant.default:n = plain,
+ captions.choices:nn = { hangul, hanja }
+ {%
+ \edef\xpg@korean@captions{\the\numexpr\UseName{l_keys_choice_int}-1\relax}
+ },
+ captions.default:n = hangul,
+ swapstrings.choice:,
+ swapstrings / all.code =
+ {%
+ \@korean@swapheadingstrue
+ \@korean@swapheaderstrue
+ },
+ swapstrings / headings.code =
+ {%
+ \@korean@swapheadingstrue
+ \@korean@swapheadersfalse
+ },
+ swapstrings / headers.code =
+ {%
+ \@korean@swapheadingsfalse
+ \@korean@swapheaderstrue
+ },
+ swapstrings / none.code =
+ {%
+ \@korean@swapheadingsfalse
+ \@korean@swapheadersfalse
+ },
+ swapstrings.default:n = all,
+ swapstrings/unknown.code = \xpg@warning{Unknown Korean swapstrings value `#1'}
+ }
% Register default options
-\xpg@initialize@gloss@options{korean}{variant=plain,swapstrings=all,captions=hangul}
+\InitializeGlossOptions{korean}{variant=plain,swapstrings=all,captions=hangul}
\def\captionskorean{%
\ifcase\xpg@korean@captions\relax
@@ -19290,60 +19335,48 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
% change chapter and part headings
\if@korean@swapheadings
% With titlesec
- \ifcsdef{titleformat}{%
- \ifcsdef{NR@part}{% Hyperref (nameref)
- \let\xpg@save@part@format\NR@part
- \patchcmd{\NR@part}%
- {\partname\nobreakspace\thepart}%
- {\koreanTHEname\nobreakspace \thepart\nobreakspace \partname}%
- {}%
- {\xpg@warning{Failed to patch part for Korean}}%
- }{% not hyperref
- \ifcsdef{@part}{%
- \let\xpg@save@part@format\@part
- \patchcmd{\@part}%
+ \@ifundefined{titleformat}{%
+ % With KOMA
+ \@ifundefined{sectionformat}{%
+ % With memoir
+ \@ifundefined{@memptsize}{%
+ % With standard classes
+ \@ifundefined{@makechapterhead}{}{%
+ \let\xpg@save@chap@format\@makechapterhead
+ \patchcmd{\@makechapterhead}%
+ {\@chapapp\space \thechapter}%
+ {%
+ \ifx\@chapapp\korean@appendix@chapapp
+ \appendixname\space \thechapter
+ \else
+ \koreanTHEname\space \thechapter\space \@chapapp
+ \fi
+ }%
+ {}%
+ {\xpg@warning{Failed to patch chapter for Korean}}%
+ }%
+ \@ifundefined{NR@part}{% not hyperref
+ \@ifundefined{@part}{}{%
+ \ifpatchable{\@part}%
+ {\partname\nobreakspace\thepart}%
+ {\let\xpg@save@part@format\@part
+ \patchcmd{\@part}%
+ {\partname\nobreakspace\thepart}%
+ {\koreanTHEname\nobreakspace \thepart\nobreakspace \partname}%
+ {}%
+ {\@ifundefined{part}{}{\xpg@warning{Failed to patch part for Korean}}}}%
+ {}%
+ }% (end \ifdefined\@part)
+ }{% Hyperref (nameref)
+ \let\xpg@save@part@format\NR@part
+ \patchcmd{\NR@part}%
{\partname\nobreakspace\thepart}%
{\koreanTHEname\nobreakspace \thepart\nobreakspace \partname}%
{}%
{\xpg@warning{Failed to patch part for Korean}}%
- }{}%
- }
- \ifcsdef{chapter}{%
- \titleformat\chapter[display]%
- {\@ifundefined{ttl@fil}{\raggedright}{\ttl@fil}\ttl@fonts\ttl@sizes6}%
- {%
- \ifx\@chapapp\korean@appendix@chapapp
- \appendixname\space \thechapter
- \else
- \koreanTHEname\space \thechapter\space \@chapapp
- \fi
- }{.8\baselineskip}{\ttl@sizes\z@\ttl@passexplicit}%
- }{}%
- }{% (not \ifdefined\titleformat)
- % With KOMA
- \ifcsdef{sectionformat}{%
- \ifcsdef{partformat}{%
- \let\xpg@save@part@format\partformat
- \renewcommand*{\partformat}{\koreanTHEname~\thepart~\partname}%
- }{}%
- \ifcsdef{chapterformat}{%
- \let\xpg@save@chap@format\chapterformat
- \renewcommand*{\chapterformat}{\mbox{%
- \IfChapterUsesPrefixLine
- {%
- \ifx\@chapapp\korean@appendix@chapapp
- \chapapp\nobreakspace \thechapter\autodot
- \else
- \koreanTHEname\nobreakspace \thechapter\nobreakspace \chapapp\autodot
- \fi
- }%
- {\thechapter\autodot\enskip}%
- }}%
- }{}%
- }{% (not \ifdefined\sectionformat)
- % With memoir
- \ifcsdef{@memptsize}{%
- \ifcsdef{@makechapterhead}{%
+ }% (end not hyperref)
+ }{% (\ifdefined\@memptsize)
+ \@ifundefined{@makechapterhead}{}{%
\let\xpg@save@chap@format\@makechapterhead
\patchcmd{\@makechapterhead}%
{\printchaptername \chapternamenum \printchapternum}%
@@ -19361,19 +19394,9 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\ifpatchable\printchaptername\@chapapp
{\chapnamefont\koreanTHEname\chapternamenum}{}}%
\fi
- }{}%
- \ifcsdef{NR@part}{% Hyperref (nameref)
- \let\xpg@save@part@format\NR@part
- \patchcmd{\NR@part}%
- {\printpartname \partnamenum \printpartnum}%
- {\printkoreanpartthe \printpartnum\partnamenum \printpartname}%
- {}%
- {\xpg@warning{Failed to patch part for Korean}}%
- \ifdefined\printkoreanpartthe\else
- \def\printkoreanpartthe{\partnamefont\koreanTHEname\partnamenum}%
- \fi
- }{% not hyperref
- \ifcsdef{@part}{%
+ }%
+ \@ifundefined{NR@part}{% not hyperref
+ \@ifundefined{@part}{}{%
\let\xpg@save@part@format\@part
\patchcmd{\@part}%
{\printpartname \partnamenum \printpartnum}%
@@ -19383,84 +19406,77 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\ifdefined\printkoreanpartthe\else
\def\printkoreanpartthe{\partnamefont\koreanTHEname\partnamenum}%
\fi
- }{}%
- }%
- }{% (not \ifdefined\@memptsize)
- % With standard classes
- \ifcsdef{@makechapterhead}{%
- \let\xpg@save@chap@format\@makechapterhead
- \patchcmd{\@makechapterhead}%
- {\@chapapp\space \thechapter}%
- {%
- \ifx\@chapapp\korean@appendix@chapapp
- \appendixname\space \thechapter
- \else
- \koreanTHEname\space \thechapter\space \@chapapp
- \fi
- }%
- {}%
- {\xpg@warning{Failed to patch chapter for Korean}}%
- }{}%
- \ifcsdef{NR@part}{% Hyperref (nameref)
+ }%
+ }{% Hyperref (nameref)
\let\xpg@save@part@format\NR@part
\patchcmd{\NR@part}%
- {\partname\nobreakspace\thepart}%
- {\koreanTHEname\nobreakspace \thepart\nobreakspace \partname}%
+ {\printpartname \partnamenum \printpartnum}%
+ {\printkoreanpartthe \printpartnum\partnamenum \printpartname}%
{}%
{\xpg@warning{Failed to patch part for Korean}}%
- }{% not hyperref
- \ifcsdef{@part}{%
- \ifpatchable{\@part}%
- {\partname\nobreakspace\thepart}%
- {\let\xpg@save@part@format\@part
- \patchcmd{\@part}%
- {\partname\nobreakspace\thepart}%
- {\koreanTHEname\nobreakspace \thepart\nobreakspace \partname}%
- {}%
- {\ifcsdef{part}{\xpg@warning{Failed to patch part for Korean}}{}}}%
- {}%
- }{}% (end \ifdefined\@part)
- }% (end not hyperref)
+ \ifdefined\printkoreanpartthe\else
+ \def\printkoreanpartthe{\partnamefont\koreanTHEname\partnamenum}%
+ \fi
+ }%
}% (end \ifdefined\@memptsize)
+ }{% (\ifdefined\sectionformat)
+ \@ifundefined{partformat}{}{%
+ \let\xpg@save@part@format\partformat
+ \renewcommand*{\partformat}{\koreanTHEname~\thepart~\partname}%
+ }%
+ \@ifundefined{chapterformat}{}{%
+ \let\xpg@save@chap@format\chapterformat
+ \renewcommand*{\chapterformat}{\mbox{%
+ \IfChapterUsesPrefixLine
+ {%
+ \ifx\@chapapp\korean@appendix@chapapp
+ \chapapp\nobreakspace \thechapter\autodot
+ \else
+ \koreanTHEname\nobreakspace \thechapter\nobreakspace \chapapp\autodot
+ \fi
+ }%
+ {\thechapter\autodot\enskip}%
+ }}%
+ }%
}% (end \ifdefined\sectionformat)
+ }{% (\ifdefined\titleformat)
+ \@ifundefined{NR@part}{% not hyperref
+ \@ifundefined{@part}{}{%
+ \let\xpg@save@part@format\@part
+ \patchcmd{\@part}%
+ {\partname\nobreakspace\thepart}%
+ {\koreanTHEname\nobreakspace \thepart\nobreakspace \partname}%
+ {}%
+ {\xpg@warning{Failed to patch part for Korean}}%
+ }%
+ }{% Hyperref (nameref)
+ \let\xpg@save@part@format\NR@part
+ \patchcmd{\NR@part}%
+ {\partname\nobreakspace\thepart}%
+ {\koreanTHEname\nobreakspace \thepart\nobreakspace \partname}%
+ {}%
+ {\xpg@warning{Failed to patch part for Korean}}%
+ }%
+ \@ifundefined{chapter}{}{%
+ \titleformat\chapter[display]%
+ {\@ifundefined{ttl@fil}{\raggedright}{\ttl@fil}\ttl@fonts\ttl@sizes6}%
+ {%
+ \ifx\@chapapp\korean@appendix@chapapp
+ \appendixname\space \thechapter
+ \else
+ \koreanTHEname\space \thechapter\space \@chapapp
+ \fi
+ }{.8\baselineskip}{\ttl@sizes\z@\ttl@passexplicit}%
+ }%
}% (end \ifdefined\titleformat)
\fi % (end \if@korean@swapheadings)
%
% Change running headers
\if@korean@swapheaders
- \ifcsdef{chapterformat}{%
- % With KOMA
- \let\xpg@save@chaptermark@format\chaptermarkformat
- \renewcommand*\chaptermarkformat{%
- \IfChapterUsesPrefixLine
- {%
- \ifx\@chapapp\korean@appendix@chapapp
- \chapapp\ \thechapter\autodot
- \else
- \koreanTHEname\ \thechapter\ \chapapp\autodot
- \fi
- }%
- {\thechapter\autodot}%
- \enskip
- }%
- }{% (not \ifdefined\chapterformat)
- \ifcsdef{@memptsize}{%
- % With memoir
- \let\xpg@save@chaptermark@format\chaptermark
- \patchcmd{\chaptermark}%
- {\@chapapp\ \@nameuse{thechapter}}%
- {%
- \ifx\@chapapp\korean@appendix@chapapp
- \appendixname\ \@nameuse{thechapter}%
- \else
- \koreanTHEname\ \@nameuse{thechapter}\ \@chapapp
- \fi
- }%
- {}%
- {\xpg@warning{Failed to patch chaptermark for Korean}}%
- }{% (not \ifdefined\@memptsize)
+ \@ifundefined{chapterformat}{%
+ \@ifundefined{@memptsize}{%
% With standard classes
- \ifcsdef{chaptermark}{%
+ \@ifundefined{chaptermark}{}{%
\ifpatchable{\chaptermark}%
{\@chapapp\ \thechapter}%
{\let\xpg@save@chaptermark@format\chaptermark
@@ -19476,65 +19492,94 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
{}%
{\xpg@warning{Failed to patch chaptermark for Korean}}}%
{}%
- }{}% (end \ifdefined\chaptermark)
+ }% (end \ifdefined\chaptermark)
+ }{% (\ifdefined\@memptsize)
+ % With memoir
+ \let\xpg@save@chaptermark@format\chaptermark
+ \patchcmd{\chaptermark}%
+ {\@chapapp\ \@nameuse{thechapter}}%
+ {%
+ \ifx\@chapapp\korean@appendix@chapapp
+ \appendixname\ \@nameuse{thechapter}%
+ \else
+ \koreanTHEname\ \@nameuse{thechapter}\ \@chapapp
+ \fi
+ }%
+ {}%
+ {\xpg@warning{Failed to patch chaptermark for Korean}}%
}% (end \ifdefined\@memptsize)
+ }{% (\ifdefined\chapterformat)
+ % With KOMA
+ \let\xpg@save@chaptermark@format\chaptermarkformat
+ \renewcommand*\chaptermarkformat{%
+ \IfChapterUsesPrefixLine
+ {%
+ \ifx\@chapapp\korean@appendix@chapapp
+ \chapapp\ \thechapter\autodot
+ \else
+ \koreanTHEname\ \thechapter\ \chapapp\autodot
+ \fi
+ }%
+ {\thechapter\autodot}%
+ \enskip
+ }%
}% (end \ifdefined\chapterformat)
\fi % (end \if@korean@swapheaders)
}
\def\nokorean@headingsformat{%
% Reset chapter and part heading
- \ifcsdef{titleformat}{%
+ \@ifundefined{titleformat}{%
+ \@ifundefined{sectionformat}{%
+ % With memoir and standard classes
+ \@ifundefined{xpg@save@part@format}{}{%
+ \@ifundefined{NR@part}{%
+ \let\@part\xpg@save@part@format
+ }{%
+ \let\NR@part\xpg@save@part@format
+ }%
+ }%
+ \@ifundefined{xpg@save@chap@format}{}{%
+ \let\@makechapterhead\xpg@save@chap@format
+ }%
+ }{%
+ % With KOMA
+ \@ifundefined{xpg@save@part@format}{}{%
+ \let\partformat\xpg@save@part@format
+ }%
+ \@ifundefined{xpg@save@chap@format}{}{%
+ \let\chapterformat\xpg@save@chap@format
+ }%
+ }% (end \ifdefined\sectionformat)
+ }{% (\ifdefined\titleformat)
% With titlesec
- \ifcsdef{xpg@save@part@format}{%
- \ifcsdef{NR@part}{%
- \let\NR@part\xpg@save@part@format
- }{%
+ \@ifundefined{xpg@save@part@format}{}{%
+ \@ifundefined{NR@part}{%
\let\@part\xpg@save@part@format
+ }{%
+ \let\NR@part\xpg@save@part@format
}%
- }{}%
- \ifcsdef{chapter}{%
+ }%
+ \@ifundefined{chapter}{}{%
\titleformat\chapter[display]%
{\@ifundefined{ttl@fil}{\raggedright}{\ttl@fil}\ttl@fonts\ttl@sizes6}%
{\@chapapp\space\thechapter}{.8\baselineskip}{\ttl@sizes\z@\ttl@passexplicit}%
- }{}%
- }{% (not \ifdefined\titleformat)
- \ifcsdef{sectionformat}{%
- % With KOMA
- \ifcsdef{xpg@save@part@format}{%
- \let\partformat\xpg@save@part@format
- }{}%
- \ifcsdef{xpg@save@chap@format}{%
- \let\chapterformat\xpg@save@chap@format
- }{}%
- }{%
- % With memoir and standard classes
- \ifcsdef{xpg@save@part@format}{%
- \ifcsdef{NR@part}{%
- \let\NR@part\xpg@save@part@format
- }{%
- \let\@part\xpg@save@part@format
- }%
- }{}%
- \ifcsdef{xpg@save@chap@format}{%
- \let\@makechapterhead\xpg@save@chap@format
- }{}%
- }% (end \ifdefined\sectionformat)
+ }%
}% (end \ifdefined\titleformat)
%
% Reset headers
- \ifcsdef{chaptermarkformat}{%
- % With KOMA
- \ifcsdef{xpg@save@chaptermark@format}{%
- \let\chaptermarkformat\xpg@save@chaptermark@format
- }{}%
- }{%
- \ifcsdef{chaptermark}{%
+ \@ifundefined{chaptermarkformat}{%
+ \@ifundefined{chaptermark}{}{%
% With memoir and standard classes
- \ifcsdef{xpg@save@chaptermark@format}{%
+ \@ifundefined{xpg@save@chaptermark@format}{}{%
\let\chaptermark\xpg@save@chaptermark@format
- }{}%
- }{}% (end \ifdefined\chaptermark)
+ }%
+ }% (end \ifdefined\chaptermark)
+ }{%
+ % With KOMA
+ \@ifundefined{xpg@save@chaptermark@format}{}{%
+ \let\chaptermarkformat\xpg@save@chaptermark@format
+ }%
}% (end \ifdefined\chapterformat)
}
@@ -19598,13 +19643,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\XeTeXinterchartokenstate\z@
\XeTeXlinebreakpenalty\z@
\XeTeXlinebreakskip\z@skip
- \XeTeXlinebreaklocale "en"
+ \XeTeXlinebreaklocale ""
\noextras@korean@common
}
\else % luatex
- \def\inlineextras@korean{\xpg@attr@korean\xpg@korean@variant\relax}
+ \def\inlineextras@korean{\xpg@attr@cjkspacing\xpg@korean@variant\relax}
\def\noextras@korean{%
- \unsetattribute\xpg@attr@korean
+ \unsetattribute\xpg@attr@cjkspacing
\noextras@korean@common
}
\fi
@@ -19624,7 +19669,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\let\newattribute\newluatexattribute
\let\unsetattribute\unsetluatexattribute
\fi
-\newattribute\xpg@attr@korean
+\newattribute\xpg@attr@cjkspacing
\newattribute\xpg@attr@autojosa
% user commands for Josa
% Josa : particles in Korean grammar that immediately follow a noun or pronoun.
@@ -19645,7 +19690,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\protected\def\로{\으 로}
\def\xpg@reset@josa {\global\let\xpg@josa@zwang\z@}\xpg@reset@josa
% load lua file for korean
-\directlua{ require "polyglossia-korean" }
+\directlua{ require "polyglossia-cjk-spacing" }
% \end{macrocode}
% \iffalse
%</gloss-korean.ldf>
@@ -19655,13 +19700,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-ku-Arab.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-ku-Arab.ldf}[polyglossia: module for ku-Arab (Kurdish)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{kurdish}
+\InheritGlossFile{kurdish}
% \end{macrocode}
% \iffalse
@@ -19672,13 +19717,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-ku-Latn.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-ku-Latn.ldf}[polyglossia: module for ku-Latn (Kurdish)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{kurdish}
+\InheritGlossFile{kurdish}
% \end{macrocode}
% \iffalse
@@ -19689,13 +19734,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-ku.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-ku.ldf}[polyglossia: module for ku (Kurdish)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{kurdish}
+\InheritGlossFile{kurdish}
% \end{macrocode}
% \iffalse
@@ -19706,7 +19751,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-kurdish.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
% Created on September 1, 2019
% Last updated on May 17, 2020
@@ -19749,36 +19794,9 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\newif\if@kurdish@kurmanji
\def\kurdish@variant{sorani}
-\define@choicekey*+{kurdish}{variant}[\xpg@val\xpg@nr]{sorani,kurmanji}[sorani]{%
- \ifcase\xpg@nr\relax
- % sorani:
- \def\kurdish@variant{sorani}%
- \@kurdish@kurmanjifalse%
- \or
- % kurmanji:
- \def\kurdish@variant{kurmanji}%
- \@kurdish@kurmanjitrue%
- \fi
- \kurdish@set@variety%
- \xpg@info{Option: kurdish, variant=\xpg@val}%
-}{\xpg@warning{Unknown Kurdish variant `#1'}}
\newif\if@kurdish@latin
\newif\if@kurdish@arabic
-\define@choicekey*+{kurdish}{script}[\xpg@val\xpg@nr]{arabic,latin}{%
- \ifcase\xpg@nr\relax
- % arabic:
- \@kurdish@latinfalse%
- \@kurdish@arabictrue%
- \or
- % latin:
- \@kurdish@latintrue%
- \@kurdish@arabicfalse%
- \fi
- \kurdish@set@variety%
- \xpg@info{Option: kurdish, script=\xpg@val}%
-}{\xpg@warning{Unknown Kurdish script `#1'}}
-
\newif\if@western@numerals
\newif\if@force@western@numerals
@@ -19795,7 +19813,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\SetLanguageKeys{kurdish}{script=Latin,direction=LR,scripttag=latn,babelname=kurdish,bcp47=ckb-Arab,bcp47-language=ckb,bcp47-script=Arab,bcp47-casing=ckb-Arab}%
\fi
\def\kurdish@script{latin}
- \xpg@fontsetup@latin{kurdish}%
+ \SetupLatinPolyglossiaFont{kurdish}%
\else
\if@kurdish@arabic% arabic explicitly set
\if@kurdish@kurmanji
@@ -19805,61 +19823,84 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\else
\SetLanguageKeys{kurdish}{script=Arabic,direction=RL,scripttag=arab,babelname=kurdish,bcp47=ckb-Arab,bcp47-language=ckb,bcp47-script=Arab,bcp47-casing=ckb-Arab}%
\fi
- \xpg@fontsetup@nonlatin{kurdish}%
+ \SetupNonLatinPolyglossiaFont{kurdish}%
\else% sorani=arabic, kurmanji=latin
\if@kurdish@kurmanji
\@western@numeralstrue%
\SetLanguageKeys{kurdish}{script=Latin,direction=LR,scripttag=latn,babelname=kurmanji,bcp47=kmr-Latn,bcp47-language=kmr,bcp47-script=Latn,bcp47-casing=kmr-Latn}%
- \xpg@fontsetup@latin{kurdish}%
+ \SetupLatinPolyglossiaFont{kurdish}%
\def\kurdish@script{latin}
\else
\SetLanguageKeys{kurdish}{script=Arabic,direction=RL,scripttag=arab,babelname=kurdish,bcp47=ckb-Arab,bcp47-language=ckb,bcp47-script=Arab,bcp47-casing=ckb-Arab}%
- \xpg@fontsetup@nonlatin{kurdish}%
+ \SetupNonLatinPolyglossiaFont{kurdish}%
\fi
\fi
\fi
}
\newif\if@western@numerals
-\define@choicekey*+{kurdish}{numerals}[\xpg@val\xpg@nr]{eastern,western}[eastern]{%
- \ifcase\xpg@nr\relax
- % eastern:
- \@western@numeralsfalse%
- \or
- % western:
- \@western@numeralstrue%
- \@force@western@numeralstrue%
- \fi
- \xpg@info{Option: Kurdish, numerals=\xpg@val}%
-}{\xpg@warning{Unknown Kurdish numerals option `#1'}}
\newif\ifkurdish@customsep\kurdish@customsepfalse
\def\xpg@sepmark{}
-\define@key{kurdish}{sectionsep}[.]{%
- \kurdish@customseptrue%
- \gdef\xpg@sepmark{#1}%
-}
-
-%this is needed for \abjad in arabicnumbers.sty
-\define@boolkey{kurdish}[kurdish@]{abjadjimnotail}[true]{%
- \ifkurdish@abjadjimnotail
- \abjad@jim@notailtrue%
- \else
- \abjad@jim@notailfalse
- \fi%
-}
-
-% NOT YET USED
-\define@key{kurdish}{locale}[default]{%
- \def\@kurdish@locale{#1}}
%TODO add option for CALENDAR
+\DeclareKeys[polyglossia/gloss/kurdish]
+ {
+ variant.choice:,
+ variant / sorani.code =
+ {%
+ \def\kurdish@variant{sorani}%
+ \@kurdish@kurmanjifalse
+ \kurdish@set@variety
+ },
+ variant / kurmanji.code =
+ {%
+ \def\kurdish@variant{kurmanji}%
+ \@kurdish@kurmanjitrue
+ \kurdish@set@variety
+ },
+ variant.default:n = sorani,
+ variant/unknown.code = \xpg@warning{Unknown Kurdish variant `#1'},
+ script.choice:,
+ script / arabic.code =
+ {%
+ \@kurdish@latinfalse
+ \@kurdish@arabictrue
+ \kurdish@set@variety
+ },
+ script / latin.code =
+ {%
+ \@kurdish@latintrue
+ \@kurdish@arabicfalse
+ \kurdish@set@variety
+ },
+ script.default:n = sorani,
+ script/unknown.code = \xpg@warning{Unknown Kurdish script `#1'},
+ numerals.choice:,
+ numerals / eastern.code =
+ {%
+ \@western@numeralsfalse
+ },
+ numerals / western.code =
+ {%
+ \@western@numeralstrue
+ \@force@western@numeralstrue
+ },
+ numerals.default:n = eastern,
+ numerals/unknown.code = \xpg@warning{Unknown Kurdish numerals value `#1'},
+ sectionsep.code = \gdef\xpg@sepmark{#1}\kurdish@customseptrue,
+ sectionsep.default:n = .,
+ abjadjimnotail.if = abjad@jim@notail,
+ abjadjimnotail.default:n = true,
+ locale.store = \@kurdish@locale
+ }
+
% Register default options
-\xpg@initialize@gloss@options{kurdish}{variant=sorani,locale=default,script=arabic,abjadjimnotail=false,numerals=eastern}
+\InitializeGlossOptions{kurdish}{variant=sorani,locale=default,script=arabic,abjadjimnotail=false,numerals=eastern}
\def\kurdish@language{%
- \polyglossia@setup@language@patterns{\kurdish@pattern}%
+ \SetupPolyglossiaLangPatterns{\kurdish@pattern}%
}%
\def\kurdishNativemonth#1{\ifcase#1%
@@ -20112,16 +20153,16 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
}
\def\nokurdish@xetex@capsformat{%
- \ifcsdef{xpg@save@sepmark}{%
+ \ifcsname xpg@save@sepmark\endcsname%
\SepMark{\xpg@save@sepmark}
- }{}%
+ \fi%
}
\def\kurdish@luatex@capsformat{%
%
% change chapter and part headings
\ifkurdish@customsep
- \ifcsdef{chapter}{%
+ \ifcsname chapter\endcsname%
\let\xpg@save@thesection\thesection%
\renewcommand*\thesection{\thechapter\xpg@sepmark\@arabic\c@section}
\let\xpg@save@theequation\theequation%
@@ -20133,7 +20174,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\let\xpg@save@thetable\thetable%
\renewcommand*\thetable{%
\ifnum\c@chapter>\z@\thechapter\xpg@sepmark\fi\@arabic\c@table}
- }{}
+ \fi%
\let\xpg@save@thesubsection\thesubsection%
\renewcommand\thesubsection
{\thesection\xpg@sepmark\@arabic\c@subsection}
@@ -20148,30 +20189,30 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
}
\def\nokurdish@luatex@capsformat{%
- \ifcsdef{xpg@save@thesection}{%
+ \ifcsname xpg@save@thesection\endcsname%
\let\thesection\xpg@save@thesection%
- }{}%
- \ifcsdef{xpg@save@theequation}{%
+ \fi%
+ \ifcsname xpg@save@theequation\endcsname%
\let\theequation\xpg@save@theequation%
- }{}%
- \ifcsdef{xpg@save@thefigure}{%
+ \fi%
+ \ifcsname xpg@save@thefigure\endcsname%
\let\thefigure\xpg@save@thefigure%
- }{}%
- \ifcsdef{xpg@save@thetable}{%
+ \fi%
+ \ifcsname xpg@save@thetable\endcsname%
\let\thetable\xpg@save@thetable%
- }{}%
- \ifcsdef{xpg@save@thesubsection}{%
+ \fi%
+ \ifcsname xpg@save@thesubsection\endcsname%
\let\thesubsection\xpg@save@thesubsection%
- \ifcsdef{xpg@save@thesubsubsection}{%
+ \ifcsname xpg@save@thesubsubsection\endcsname%
\let\thesubsubsection\xpg@save@thesubsubsection%
- }{}%
- }{}%
- \ifcsdef{xpg@save@theparagraph}{%
+ \fi%
+ \fi%
+ \ifcsname xpg@save@theparagraph\endcsname%
\let\theparagraph\xpg@save@theparagraph%
- }{}%
- \ifcsdef{xpg@save@thesubparagraph}{%
+ \fi%
+ \ifcsname xpg@save@thesubparagraph\endcsname%
\let\thesubparagraph\xpg@save@thesubparagraph%
- }{}%
+ \fi%
}
\def\blockextras@kurdish{%
@@ -20203,13 +20244,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-kurmanji.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-kurmanji.ldf}[polyglossia: module for Kurmanji Kurdish]
% We provide this gloss for babel compatibility.
-\xpg@load@master@language{kurdish}
+\InheritGlossFile{kurdish}
% \end{macrocode}
% \iffalse
@@ -20220,13 +20261,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-la-x-classic.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-la-xclassic.ldf}[polyglossia: module for la-xclassic (Latin)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{latin}
+\InheritGlossFile{latin}
% \end{macrocode}
% \iffalse
@@ -20237,13 +20278,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-la-x-ecclesia.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-la-xecclesiastic.ldf}[polyglossia: module for la-xecclesiastic (Latin)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{latin}
+\InheritGlossFile{latin}
% \end{macrocode}
% \iffalse
@@ -20254,13 +20295,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-la-x-medieval.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-la-xmedieval.ldf}[polyglossia: module for la-xmedieval (Latin)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{latin}
+\InheritGlossFile{latin}
% \end{macrocode}
% \iffalse
@@ -20271,13 +20312,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-la.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-la.ldf}[polyglossia: module for la (Latin)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{latin}
+\InheritGlossFile{latin}
% \end{macrocode}
% \iffalse
@@ -20288,7 +20329,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-lao.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-lao.ldf}[polyglossia: module for Lao]
@@ -20312,14 +20353,23 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\newif\if@lao@numerals
\def\tmp@lao{lao}
-\define@key{lao}{numerals}[arabic]{%
- \def\@tmpa{#1}%
- \ifx\@tmpa\tmp@lao\@lao@numeralstrue\else
- \@lao@numeralsfalse\fi
-}
+
+\DeclareKeys[polyglossia/gloss/lao]
+ {
+ numerals.choice:,
+ numerals / arabic.code =
+ {%
+ \@lao@numeralsfalse
+ },
+ numerals / lao.code =
+ {%
+ \@lao@numeralstrue
+ },
+ numerals.default:n = arabic
+ }
% Register default options
-\xpg@initialize@gloss@options{lao}{numerals=arabic}
+\InitializeGlossOptions{lao}{numerals=arabic}
% Translations provided by Brian Wilson <bountonw at gmail.com>
\def\captionslao{%
@@ -20399,7 +20449,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-latex.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-latex.ldf}[polyglossia: module for default language]
@@ -20449,7 +20499,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-latin.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-latin.ldf}[polyglossia: module for Latin]
@@ -20484,6 +20534,9 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\bool_new:N \l_polyglossia_latin_use_v_bool
\bool_new:N \l_polyglossia_latin_use_ligatures_bool
\bool_new:N \l_polyglossia_latin_capitalize_month_bool
+\bool_new:N \l_polyglossia_latin_babelshorthands_bool
+\bool_new:N \l_polyglossia_latin_prosodic_shorthands_bool
+\bool_new:N \l_polyglossia_latin_ecclesiastic_footnotes_bool
\cs_new:Npn \polyglossia_latin_classical_character_codes:
{
@@ -20519,11 +20572,11 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\cs_new:Npn \polyglossia_latin_use_modern_patterns:
{
- \xpg@ifdefined {latin}
+ \IfLanguageDefinedTF {latin}
{
\def \latin@language
{
- \polyglossia@setup@language@patterns {latin}
+ \SetupPolyglossiaLangPatterns {latin}
\str_case:Vn \l_polyglossia_latin_variant_str
{
{classic} { \adddialect \l@classiclatin \l@latin }
@@ -20547,11 +20600,11 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\cs_new:Npn \polyglossia_latin_set_patterns:n #1
% #1 may be "classiclatin" or "liturgicallatin"
{
- \xpg@ifdefined {#1}
+ \IfLanguageDefinedTF {#1}
{
\def \latin@language
{
- \polyglossia@setup@language@patterns {#1}
+ \SetupPolyglossiaLangPatterns {#1}
\str_case:Vn \l_polyglossia_latin_variant_str
{
{classic} {
@@ -20767,7 +20820,8 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
% Save original footnote definition
% Do this at the end of the preamble to catch other
% packages' footnote changes (#391)
-\AtEndPreamble{%
+\hook_gput_code:nnn { begindocument / before } {.}
+{
\cs_if_exist:NT \@makefntext
{
\cs_set_eq:NN \polyglossia_latin_original_footnote:n \@makefntext
@@ -20791,40 +20845,27 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\cs_new:Npn \polyglossia_latin_apply_footnote_option:
{
- \str_if_eq:VnTF \xpg@main@language {latin}
+ \IfMainLanguageTF {latin}
{
\cs_if_exist:NT \@makefntext
{
- \iflatin@ecclesiasticfootnotes
+ \bool_if:NTF \l_polyglossia_latin_ecclesiastic_footnotes_bool
+ {
\let \@makefntext \polyglossia_latin_variant_footnote:n
- \else
+ }
+ {
\let \@makefntext \polyglossia_latin_original_footnote:n
- \fi
+ }
}
}
{
- \iflatin@ecclesiasticfootnotes
- \msg_warning:nn {polyglossia} {latin / ineffective footnote option}
- \fi
- }
- }
-
-\define@boolkey {latin} [latin@] {ecclesiasticfootnotes} [true]
- {
- \token_if_eq_meaning:NNTF \@onlypreamble \@notprerr
- {
- % within the document
- \polyglossia_latin_apply_footnote_option:
- }
- {
- % within the preamble
- % The application of the option has to be postponed as the main
- % language may be undefined when the option is called.
- \AtBeginDocument { \polyglossia_latin_apply_footnote_option: }
+ \bool_if:NT \l_polyglossia_latin_ecclesiastic_footnotes_bool
+ {
+ \msg_warning:nn {polyglossia} {latin / ineffective footnote option}
+ }
}
}
-
%%%%% Language variants: classic, medieval, modern, and ecclesiastic
\str_new:N \l_polyglossia_latin_variant_str
@@ -20887,58 +20928,6 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\polyglossia_latin_use_modern_patterns:
}
-\define@key{latin}{variant}
- {
- \str_case:nnF {#1}
- {
- {classic}
- {
- \msg_info:nnn {polyglossia} {latin / language variant} {classic}
- \polyglossia_latin_classic_settings:
- }
- {medieval}
- {
- \msg_info:nnn {polyglossia} {latin / language variant} {medieval}
- \polyglossia_latin_medieval_settings:
- }
- {modern}
- {
- \msg_info:nnn {polyglossia} {latin / language variant} {modern}
- \polyglossia_latin_modern_settings:
- }
- {ecclesiastic}
- {
- \msg_info:nnn {polyglossia} {latin / language variant} {ecclesiastic}
- \polyglossia_latin_ecclesiastic_settings:
- }
- }
- {
- \msg_warning:nnn {polyglossia} {latin / illegal language variant} {#1}
- }
- }
-
-
-%%%%% Boolean options concerning spelling
-
-\define@boolkey{latin}[latin@]{usej}[true]
- {
- \iflatin@usej
- \bool_set_true:N \l_polyglossia_latin_use_j_bool
- \else
- \bool_set_false:N \l_polyglossia_latin_use_j_bool
- \fi
- }
-
-\define@boolkey{latin}[latin@]{capitalizemonth}[true]
- {
- \iflatin@capitalizemonth
- \bool_set_true:N \l_polyglossia_latin_capitalize_month_bool
- \else
- \bool_set_false:N \l_polyglossia_latin_capitalize_month_bool
- \fi
- }
-
-
%%%%% Hyphenation variants: classic, liturgical, and modern
\msg_new:nnn {polyglossia} {latin / hyphenation variant}
@@ -20951,23 +20940,6 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
The~Latin~hyphenation~variant~"#1"~is~undefined~\msg_line_context:.
}
-\define@key {latin} {hyphenation}
- {
- \str_case:nnTF {#1}
- {
- {classic} { \polyglossia_latin_set_patterns:n {classiclatin} }
- {liturgical} { \polyglossia_latin_set_patterns:n {liturgicallatin} }
- {modern} { \polyglossia_latin_use_modern_patterns: }
- }
- {
- \msg_info:nnn {polyglossia} {latin / hyphenation variant} {#1}
- }
- {
- \msg_warning:nnn {polyglossia} {latin / illegal hyphenation variant} {#1}
- }
- }
-
-
%%%%% Latin captions and date
\def \captionslatin
@@ -21039,30 +21011,89 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
}
}
-
-%%%%% Latin shorthands
-
-\define@boolkey{latin}[latin@]{babelshorthands}[true]
- {
- }
-
-\define@boolkey{latin}[latin@]{prosodicshorthands}[true]
+\DeclareKeys[polyglossia/gloss/latin]
{
+ babelshorthands.bool_set:N = \l_polyglossia_latin_babelshorthands_bool,
+ babelshorthands.default:n = true,
+ prosodicshorthands.bool_set:N = \l_polyglossia_latin_prosodic_shorthands_bool,
+ prosodicshorthands.default:n = true,
+ usej.bool_set:N = \l_polyglossia_latin_use_j_bool,
+ capitalizemonth.bool_set:N = \l_polyglossia_latin_capitalize_month_bool,
+ hyphenation.code =
+ \str_case:nnTF {#1}
+ {
+ {classic} { \polyglossia_latin_set_patterns:n {classiclatin} }
+ {liturgical} { \polyglossia_latin_set_patterns:n {liturgicallatin} }
+ {modern} { \polyglossia_latin_use_modern_patterns: }
+ }
+ {
+ \msg_info:nnn {polyglossia} {latin / hyphenation variant} {#1}
+ }
+ {
+ \msg_warning:nnn {polyglossia} {latin / illegal hyphenation variant} {#1}
+ },
+ variant.code =
+ \str_case:nnF {#1}
+ {
+ {classic}
+ {
+ \msg_info:nnn {polyglossia} {latin / language variant} {classic}
+ \polyglossia_latin_classic_settings:
+ }
+ {medieval}
+ {
+ \msg_info:nnn {polyglossia} {latin / language variant} {medieval}
+ \polyglossia_latin_medieval_settings:
+ }
+ {modern}
+ {
+ \msg_info:nnn {polyglossia} {latin / language variant} {modern}
+ \polyglossia_latin_modern_settings:
+ }
+ {ecclesiastic}
+ {
+ \msg_info:nnn {polyglossia} {latin / language variant} {ecclesiastic}
+ \polyglossia_latin_ecclesiastic_settings:
+ }
+ }
+ {
+ \msg_warning:nnn {polyglossia} {latin / illegal language variant} {#1}
+ },
+ ecclesiasticfootnotes.choices:nn = { true, false }
+ {
+ \ifcase\UseName{l_keys_choice_int}\or
+ \bool_set_true:N \l_polyglossia_latin_ecclesiastic_footnotes_bool
+ \else
+ \bool_set_false:N \l_polyglossia_latin_ecclesiastic_footnotes_bool
+ \fi
+ \xpg_if_in_preamble:TF
+ {
+ % within the preamble
+ % The application of the option has to be postponed as the main
+ % language may be undefined when the option is called.
+ \AtBeginDocument { \polyglossia_latin_apply_footnote_option: }
+ }
+ {
+ % within the document
+ \polyglossia_latin_apply_footnote_option:
+ }
+ },
+ ecclesiasticfootnotes.default:n = true
}
% Register default options
-\xpg@initialize@gloss@options{latin}{variant=modern,hyphenation=modern,babelshorthands=false,
+\InitializeGlossOptions{latin}{variant=modern,hyphenation=modern,babelshorthands=false,
prosodicshorthands=false,ecclesiasticfootnotes=false,
usej=false,capitalizemonth=true}
\ifsystem@babelshorthands
- \setkeys{latin}{babelshorthands=true}
+ \SetGlossOptions{latin}{babelshorthands=true}
\else
- \setkeys{latin}{babelshorthands=false}
+ \SetGlossOptions{latin}{babelshorthands=false}
\fi
\ExplSyntaxOff % babelsh.def does not support expl3 syntax
-\ifcsundef{initiate@active@char}{\input{babelsh.def}}{}
+\@ifundefined{initiate@active@char}{\input{babelsh.def}}{}
\ExplSyntaxOn
\initiate@active@char {"}
@@ -21094,13 +21125,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\AtBeginDocument
{
- \str_if_eq:VnTF \xpg@main@language {latin}
+ \IfMainLanguageTF {latin}
{
- \iflatin@prosodicshorthands
- \else
+ \bool_if:NF \l_polyglossia_latin_prosodic_shorthands_bool
+ {
\shorthandoff {=}
\shorthandoff* {^}
- \fi
+ }
}
{
% The following command should not be called if the main language
@@ -21462,7 +21493,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\let \xpgla@savedvalues \empty
-\AtEndPreamble
+\hook_gput_code:nnn { begindocument / before } {.}
{
\edef \xpgla@savedvalues
{
@@ -21475,12 +21506,14 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\def \noextras@latin
{
- \iflatin@babelshorthands
+ \bool_if:NT \l_polyglossia_latin_babelshorthands_bool
+ {
\polyglossia_latin_no_shorthands:
- \fi
- \iflatin@prosodicshorthands
+ }
+ \bool_if:NT \l_polyglossia_latin_prosodic_shorthands_bool
+ {
\polyglossia_latin_no_prosodic_shorthands:
- \fi
+ }
\xpgla@savedvalues
\polyglossia_latin_no_punctuation_spacing:
\polyglossia_latin_modern_character_codes:
@@ -21496,16 +21529,20 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
{
\polyglossia_latin_punctuation_spacing:
}
- \iflatin@babelshorthands
+ \bool_if:NTF \l_polyglossia_latin_babelshorthands_bool
+ {
\polyglossia_latin_shorthands:
- \else
+ }
+ {
\polyglossia_latin_no_shorthands:
- \fi
- \iflatin@prosodicshorthands
+ }
+ \bool_if:NTF \l_polyglossia_latin_prosodic_shorthands_bool
+ {
\polyglossia_latin_prosodic_shorthands:
- \else
+ }
+ {
\polyglossia_latin_no_prosodic_shorthands:
- \fi
+ }
}
\def \blockextras@latin
@@ -21558,64 +21595,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
% \end{macrocode}
% \iffalse
%</gloss-latin.ldf>
-%<*gloss-latinclassic.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-latinclassic.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-latinclassic.ldf}[polyglossia: module for classic Latin]
-
-% We provide this as a babel alias
-
-\xpg@load@master@language{latin}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-latinclassic.ldf>
-%<*gloss-latinecclesiastic.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-latinecclesiastic.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-latinecclesiastic.ldf}[polyglossia: module for ecclesiastic Latin]
-
-% We provide this as a babel alias
-
-\xpg@load@master@language{latin}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-latinecclesiastic.ldf>
-%<*gloss-latinmedieval.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-latinmedieval.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-latinmedieval.ldf}[polyglossia: module for medieval Latin]
-
-% We provide this as a babel alias
-
-\xpg@load@master@language{latin}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-latinmedieval.ldf>
%<*gloss-latvian.ldf>
% \fi
% \clearpage
%
% \subsection{gloss-latvian.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-latvian.ldf}[polyglossia: module for Latvian]
\PolyglossiaSetup{latvian}{
@@ -21642,12 +21628,12 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\def\contentsname{Saturs}%
\def\listfigurename{Attēlu saraksts}%
\def\listtablename{Tabulu saraksts}%
- \def\indexname{Index}%
+ \def\indexname{PriekÅ¡metu rÄdÄ«tÄjs}%
\def\figurename{Att.}%
\def\tablename{Tabula}%
\def\partname{Daļa}%
- \def\enclname{encl}%
- \def\ccname{cc}%
+ \def\enclname{PielikumÄ}%
+ \def\ccname{Kopija(s)}%
\def\headtoname{To}%
\def\pagename{lpp.}%
\def\seename{sk.}%
@@ -21673,7 +21659,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-lithuanian.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
% Translated by Paulius SladkeviÄius <komsas@gmail.com>
@@ -21755,13 +21741,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-lo.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-lo.ldf}[polyglossia: module for lo (Lao)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{lao}
+\InheritGlossFile{lao}
% \end{macrocode}
% \iffalse
@@ -21772,13 +21758,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-lowersorbian.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-lowersorbian.ldf}[polyglossia: module for Lower Sorbian]
% We provide this as a babel alias
-\xpg@load@master@language{sorbian}
+\InheritGlossFile{sorbian}
% \end{macrocode}
% \iffalse
@@ -21789,14 +21775,14 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-lsorbian.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-lsorbian.ldf}[polyglossia: module for Lower Sorbian]
% We only provide this gloss for babel compatibility. Since lsorbian is
% a sorbian variety, we use 'sorbian' with variant 'lower' now.
-\xpg@load@master@language{sorbian}
+\InheritGlossFile{sorbian}
% \end{macrocode}
% \iffalse
@@ -21807,13 +21793,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-lt.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-lt.ldf}[polyglossia: module for lt (Lithuanian)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{lithuanian}
+\InheritGlossFile{lithuanian}
% \end{macrocode}
% \iffalse
@@ -21824,13 +21810,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-lv.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-lv.ldf}[polyglossia: module for lv (Latvian)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{latvian}
+\InheritGlossFile{latvian}
% \end{macrocode}
% \iffalse
@@ -21841,7 +21827,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-macedonian.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-macedonian.ldf}[polyglossia: module for Macedonian]
\PolyglossiaSetup{macedonian}{
@@ -21940,13 +21926,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-magyar.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-magyar.ldf}[polyglossia: module for Hungarian (Magyar)]
% We only provide this gloss for babel compatibility.
-\xpg@load@master@language{hungarian}
+\InheritGlossFile{hungarian}
% \end{macrocode}
% \iffalse
@@ -21957,7 +21943,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-malay.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-malay.ldf}[polyglossia: module for Malay]
@@ -21985,65 +21971,44 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
% Backwards compat. alias
\setlanguagealias[variant=malaysian]{malay}{bahasam}
-\providebool{malay@melayu}
+\@ifundefined{ifmalay@melayu}%
+ {\newif\ifmalay@melayu}{}
\malay@melayufalse
\def\malay@variant{malay}
-\define@choicekey*+{malay}{variant}[\xpg@val\xpg@nr]{indonesian,malaysian}[malaysian]{%
- \ifcase\xpg@nr\relax
- % indonesian:
- \def\malay@variant{indonesian}%
- \malay@melayufalse
- \or
- % malaysian:
- \def\malay@variant{malay}%
- \malay@melayutrue
- \fi
- \ifmalay@melayu
- \SetLanguageKeys{malay}{language=Malay,langtag=MLY,babelname=bahasam,bcp47=zsm,bcp47-language=zsm}%
- \xpg@fontsetup@latin{malay}%
- % Check if \l@malay is defined. If not, try to set it to some variety
- % (specific order as in the csv list below), or null language if everything fails
- \xpg@ifdefined{malay}{}{%
- \def\do##1{%
- \xpg@ifdefined{##1}%
- {\csletcs{l@malay}{l@##1}\listbreak}%
- {}%
- }%
- \docsvlist{melayu,bahasam,bahasai,indonesian,indon,bahasa}
- \xpg@ifdefined{malay}{}{%
- \xpg@warning{No hyphenation patterns for Malay (Malaysian) found\MessageBreak
- I will use the 'null' language instead}%
- \adddialect\l@malay0%
- }%
- }%
- \else
- \SetLanguageKeys{malay}{language=Indonesian,langtag=IND,babelname=bahasa,bcp47=id,bcp47-language=id}%
- \xpg@fontsetup@latin{malay}%
- % Check if \l@indonesian is defined. If not, try to set it to some variety
- % (specific order as in the csv list below), or null language if everything fails
- \xpg@ifdefined{indonesian}{}{%
- \def\do##1{%
- \xpg@ifdefined{##1}%
- {\csletcs{l@indonesian}{l@##1}\listbreak}%
- {}%
- }%
- \docsvlist{indon,bahasai,bahasam,malay,melayu,bahasa}
- \xpg@ifdefined{indonesian}{}{%
- \xpg@warning{No hyphenation patterns for Malay (Indonesian) found\MessageBreak
- I will use the 'null' language instead}%
- \adddialect\l@indonesian0
- }%
- }%
- \fi
- \xpg@info{Option: malay, variant=\xpg@val}%
-}{\xpg@warning{Unknown malay variant `#1'}}
+
+\DeclareKeys[polyglossia/gloss/malay]
+ {
+ variant.choice:,
+ variant / indonesian.code =
+ {%
+ \def\malay@variant{indonesian}%
+ \malay@melayufalse
+ \SetLanguageKeys{malay}{language=Indonesian,langtag=IND,babelname=bahasa,bcp47=id,bcp47-language=id}%
+ \SetupLatinPolyglossiaFont{malay}%
+ % Check if \l@indonesian is defined. If not, try to set it to some variety
+ % (specific order as in the csv list), or null language if everything fails
+ \TryPatternWithFallback{indonesian}{indon,bahasai,bahasam,malay,melayu,bahasa}%
+ },
+ variant / malaysian.code =
+ {%
+ \def\malay@variant{malay}%
+ \malay@melayutrue
+ \SetLanguageKeys{malay}{language=Malay,langtag=MLY,babelname=bahasam,bcp47=zsm,bcp47-language=zsm}%
+ \SetupLatinPolyglossiaFont{malay}%
+ % Check if \l@malay is defined. If not, try to set it to some variety
+ % (specific order as in the csv list), or null language if everything fails
+ \TryPatternWithFallback{malay}{melayu,bahasam,bahasai,indonesian,indon,bahasa}%
+ },
+ variant.default:n = malaysian,
+ variant/unknown.code = \xpg@warning{Unknown malay variant `#1'},
+ }
% Register default options
-\xpg@initialize@gloss@options{malay}{variant=malaysian}
+\InitializeGlossOptions{malay}{variant=malaysian}
\def\malay@language{%
- \polyglossia@setup@language@patterns{\malay@variant}%
+ \SetupPolyglossiaLangPatterns{\malay@variant}%
}%
@@ -22156,7 +22121,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-malayalam.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-malayalam.ldf}[polyglossia: module for Malayalam]
@@ -22226,7 +22191,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-marathi.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
% Translations provided by Abhijit Navale <abhi_navale@live.in>
% Ordinals (1-100) added by Niranjan Tambe <niranjanvikastambe@gmail.com> on 14th December, 2019
@@ -22256,21 +22221,25 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\newif\ifmarathi@devanagari@numerals
\marathi@devanagari@numeralstrue
-\define@choicekey*+{marathi}{numerals}[\xpg@val\xpg@nr]{Western,Devanagari}[Devanagari]{%
- \ifcase\xpg@nr\relax
- % Western:
- \marathi@devanagari@numeralsfalse%
- \SetLanguageKeys{marathi}{bcp47-extension-u=nu-latn}%
- \or
- % Devanagari:
- \marathi@devanagari@numeralstrue%
- \SetLanguageKeys{marathi}{bcp47-extension-u=nu-deva}%
- \fi
- \xpg@info{Option: Marathi, numerals=\xpg@val}%
-}{\xpg@warning{Unknown Marathi numerals value `#1'}}
+\DeclareKeys[polyglossia/gloss/marathi]
+ {
+ numerals.choice:,
+ numerals / western.code =
+ {%
+ \marathi@devanagari@numeralsfalse
+ \SetLanguageKeys{marathi}{bcp47-extension-u=nu-latn}%
+ },
+ numerals / devanagari.code =
+ {%
+ \marathi@devanagari@numeralstrue
+ \SetLanguageKeys{marathi}{bcp47-extension-u=nu-deva}%
+ },
+ numerals.default:n = devanagari,
+ numerals/unknown.code = \xpg@warning{Unknown Marathi numerals value `#1'}
+ }
% Register default options
-\xpg@initialize@gloss@options{marathi}{numerals=Devanagari}
+\InitializeGlossOptions{marathi}{numerals=Devanagari}
\newcommand{\marathinumerals}[2]{\marathinumber{#2}}
@@ -22370,19 +22339,36 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
% \end{macrocode}
% \iffalse
%</gloss-marathi.ldf>
+%<*gloss-medievallatin.ldf>
+% \fi
+% \clearpage
+%
+% \subsection{gloss-medievallatin.ldf}
+% \begin{macrocode}
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
+%
+\ProvidesFile{gloss-medievallatin.ldf}[polyglossia: module for medieval Latin]
+
+% We provide this as a babel alias
+
+\InheritGlossFile{latin}
+
+% \end{macrocode}
+% \iffalse
+%</gloss-medievallatin.ldf>
%<*gloss-mk.ldf>
% \fi
% \clearpage
%
% \subsection{gloss-mk.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-mk.ldf}[polyglossia: module for mk (Macedonian)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{macedonian}
+\InheritGlossFile{macedonian}
% \end{macrocode}
% \iffalse
@@ -22393,13 +22379,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-ml.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-ml.ldf}[polyglossia: module for ml (Malayalam)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{malayalam}
+\InheritGlossFile{malayalam}
% \end{macrocode}
% \iffalse
@@ -22410,13 +22396,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-mn.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-mn.ldf}[polyglossia: module for mn (Mongolian)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{mongolian}
+\InheritGlossFile{mongolian}
% \end{macrocode}
% \iffalse
@@ -22427,7 +22413,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-mongolian.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-mongolian.ldf}[polyglossia: module for Mongolian]
@@ -22459,43 +22445,46 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\newif\ifcyrillic@numerals
\newif\ifcyrillic@asbuk@numerals
-\define@choicekey*+{mongolian}{numerals}[\xpg@val\xpg@nr]{arabic,cyrillic,cyrillic-trad,cyrillic-alph}[arabic]{%
- \ifcase\xpg@nr\relax
- % arabic:
- \cyrillic@numeralsfalse%
- \cyrillic@asbuk@numeralsfalse%
- \or
- % cyrillic:
- \cyrillic@numeralstrue%
- \cyrillic@asbuk@numeralsfalse%
- \or
- % cyrillic-trad:
- \cyrillic@numeralstrue%
- \cyrillic@asbuk@numeralsfalse%
- \or
- % cyrillic-alph:
- \cyrillic@numeralstrue%
- \cyrillic@asbuk@numeralstrue%
- \fi
- \xpg@info{Option: Mongolian, numerals=\xpg@val}%
-}{\xpg@warning{Unknown Mongolian numerals value `#1'}}
-\define@boolkey{mongolian}[mongolian@]{babelshorthands}[true]{}
+\DeclareKeys[polyglossia/gloss/mongolian]
+ {
+ babelshorthands.if = mongolian@babelshorthands,
+ babelshorthands.default:n = true,
+ numerals.choice:,
+ numerals / arabic.code =
+ {%
+ \cyrillic@numeralsfalse
+ \cyrillic@asbuk@numeralsfalse
+ },
+ numerals / cyrillic.code =
+ {%
+ \cyrillic@numeralstrue
+ \cyrillic@asbuk@numeralsfalse
+ },
+ numerals / cyrillic-trad.code =
+ {%
+ \cyrillic@numeralstrue
+ \cyrillic@asbuk@numeralsfalse
+ },
+ numerals / cyrillic-alph.code =
+ {%
+ \cyrillic@numeralstrue
+ \cyrillic@asbuk@numeralstrue
+ },
+ numerals.default:n = arabic,
+ numerals/unknown.code = \xpg@warning{Unknown Mongolian numerals value `#1'}
+ }
% Register default options
-\xpg@initialize@gloss@options{mongolian}{babelshorthands=false,numerals=arabic}
+\InitializeGlossOptions{mongolian}{babelshorthands=false,numerals=arabic}
\ifsystem@babelshorthands
- \setkeys{mongolian}{babelshorthands=true}
+ \SetGlossOptions{mongolian}{babelshorthands=true}
\else
- \setkeys{mongolian}{babelshorthands=false}
+ \SetGlossOptions{mongolian}{babelshorthands=false}
\fi
-\ifcsundef{initiate@active@char}{%
- \input{babelsh.def}%
- \initiate@active@char{"}%
- \shorthandoff{"}%
-}{}
+\InitializeBabelShorthands
\def\mongolian@shorthands{%
\xpg@activate@shorthands%
@@ -22548,7 +22537,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\def\bibname{Ðомзүй}%
\def\chaptername{БүлÑг}%
\def\appendixname{ХавÑралт}%
- \ifcsundef{thechapter}%
+ \@ifundefined{thechapter}%
{\def\contentsname{Ðгуулга}}%
{\def\contentsname{Гарчиг}}%
\def\listfigurename{Зургийн жагÑаалт}%
@@ -22666,13 +22655,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-mr.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-mr.ldf}[polyglossia: module for mr (Marathi)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{marathi}
+\InheritGlossFile{marathi}
% \end{macrocode}
% \iffalse
@@ -22683,13 +22672,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-naustrian.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-naustrian.ldf}[polyglossia: module for Austrian German (current spelling)]
% We provide this as a babel alias
-\xpg@load@master@language{german}
+\InheritGlossFile{german}
% \end{macrocode}
% \iffalse
@@ -22700,13 +22689,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-nb.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-nb.ldf}[polyglossia: module for nb (Norwegian)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{norwegian}
+\InheritGlossFile{norwegian}
% \end{macrocode}
% \iffalse
@@ -22717,13 +22706,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-newzealand.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-newzealand.ldf}[polyglossia: module for Newzealand English]
% We provide this as a babel alias
-\xpg@load@master@language{english}
+\InheritGlossFile{english}
% \end{macrocode}
% \iffalse
@@ -22734,13 +22723,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-ngerman.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-ngerman.ldf}[polyglossia: module for German (current spelling)]
% We provide this as a babel alias
-\xpg@load@master@language{german}
+\InheritGlossFile{german}
% \end{macrocode}
% \iffalse
@@ -22751,7 +22740,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-nko.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-nko.ldf}[Polyglossia: module for N’Ko]
\PolyglossiaSetup{nko}{%
@@ -22849,14 +22838,14 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-norsk.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-norsk.ldf}[polyglossia: module for Norwegian (Bokmal)]
% We only provide this gloss for babel compatibility. Since norsk is
% actually norwegian bokmal, we use 'norwegian' with variant 'bokmal' now.
-\xpg@load@master@language{norwegian}
+\InheritGlossFile{norwegian}
% \end{macrocode}
% \iffalse
@@ -22867,7 +22856,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-norwegian.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-norwegian.ldf}[polyglossia: module for Norwegian]
\PolyglossiaSetup{norwegian}{
@@ -22889,28 +22878,32 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\setlanguagealias[variant=nynorsk]{norwegian}{nynorsk}
\def\norwegian@variant{nynorsk}
-\define@choicekey*+{norwegian}{variant}[\xpg@val\xpg@nr]{nynorsk,bokmal}[nynorsk]{%
- \ifcase\xpg@nr\relax
- % nynorsk:
- \def\norwegian@variant{nynorsk}%
- \SetLanguageKeys{norwegian}{langtag=NYN,babelname=nynorsk,bcp47=nn,bcp47-language=nn}%
- \xpg@fontsetup@latin{norwegian}%
- \or
- % bokmal:
- \def\norwegian@variant{norsk}%
- \SetLanguageKeys{norwegian}{langtag=NOR,babelname=norsk,bcp47=nb,bcp47-language=nb}%
- \xpg@fontsetup@latin{norwegian}%
- \fi
- \xpg@info{Option: norwegian, variant=\xpg@val}%
-}{\xpg@warning{Unknown norwegian variant `#1'}}
+\DeclareKeys[polyglossia/gloss/norwegian]
+ {
+ variant.choice:,
+ variant / nynorsk.code =
+ {%
+ \def\norwegian@variant{nynorsk}%
+ \SetLanguageKeys{norwegian}{langtag=NYN,babelname=nynorsk,bcp47=nn,bcp47-language=nn}%
+ \SetupLatinPolyglossiaFont{norwegian}%
+ },
+ variant / bokmal.code =
+ {%
+ \def\norwegian@variant{norsk}%
+ \SetLanguageKeys{norwegian}{langtag=NOR,babelname=norsk,bcp47=nb,bcp47-language=nb}%
+ \SetupLatinPolyglossiaFont{norwegian}%
+ },
+ variant.default:n = nynorsk,
+ variant/unknown.code = \xpg@warning{Unknown norwegian variant `#1'}
+ }
% Register default options
-\xpg@initialize@gloss@options{norwegian}{variant=nynorsk}
+\InitializeGlossOptions{norwegian}{variant=nynorsk}
\def\norwegian@language{%
- \polyglossia@setup@language@patterns{\norwegian@variant}%
+ \SetupPolyglossiaLangPatterns{\norwegian@variant}%
}%
\def\captionsnorwegian@nynorsk{%
@@ -22994,13 +22987,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-nswissgerman.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-nswissgerman.ldf}[polyglossia: module for Swiss German (current spelling)]
% We provide this as a babel alias
-\xpg@load@master@language{german}
+\InheritGlossFile{german}
% \end{macrocode}
% \iffalse
@@ -23011,14 +23004,14 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-nynorsk.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-nynorsk.ldf}[polyglossia: module for Norwegian (Nynorsk)]
% We only provide this gloss for babel compatibility. Since nynorsk is
% a norwegian variety, we use 'norwegian' with variant 'nynorsk' now.
-\xpg@load@master@language{norwegian}
+\InheritGlossFile{norwegian}
% \end{macrocode}
% \iffalse
@@ -23029,7 +23022,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-occitan.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
%%
%% This is file `gloss-occitan.ldf',
@@ -23065,19 +23058,19 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
% BCP-47 compliant aliases
\setlanguagealias*{occitan}{oc}
-\define@boolkey{occitan}[occitan@]{babelshorthands}[true]{}
+\DeclareKeys[polyglossia/gloss/occitan]
+ {
+ babelshorthands.if = occitan@babelshorthands,
+ babelshorthands.default:n = true
+ }
\ifsystem@babelshorthands
- \setkeys{occitan}{babelshorthands=true}
+ \SetGlossOptions{occitan}{babelshorthands=true}
\else
- \setkeys{occitan}{babelshorthands=false}
+ \SetGlossOptions{occitan}{babelshorthands=false}
\fi
-\ifcsundef{initiate@active@char}{%
- \input{babelsh.def}%
- \initiate@active@char{"}%
- \shorthandoff{"}%
-}{}
+\InitializeBabelShorthands
\def\occitan@shorthands{%
\xpg@activate@shorthands%
@@ -23169,7 +23162,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\def\today{\occitanday\space \occitanmonth\space de~\number\year}%
}
\let\xpgoc@savedvalues\empty
-\AtEndPreamble{% the user or the class might define different values
+\AddToHook{begindocument/before}{% the user or the class might define different values
\edef\xpgoc@savedvalues{%
\clubpenalty=\the\clubpenalty\space
\@clubpenalty=\the\@clubpenalty\space
@@ -23210,7 +23203,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-odia.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
% Translations provided by ଅଶୋକ ଦାସୠ<das@pas.rochester.edu> and ଅଭିଷେକ ଜେନା <avisekjena@gmail.com>
% TODO implement Odia calendar
@@ -23242,32 +23235,37 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\newif\ifodia@devanagari@numerals
\newif\ifodia@odia@numerals
-\define@choicekey*+{odia}{numerals}[\xpg@val\xpg@nr]{Devanagari,Odia,Western}[Devanagari]{%
- \ifcase\xpg@nr\relax
- % Devanagari:
- \odia@odia@numeralsfalse%
- \odia@devanagari@numeralstrue%
- \SetLanguageKeys{odia}{bcp47=or,bcp47-language=or,bcp47-extension-u=nu-deva}%
- \or
- % Odia:
- \odia@odia@numeralstrue%
- \odia@devanagari@numeralsfalse%
- \or
- % Western:
- \odia@odia@numeralsfalse%
- \odia@devanagari@numeralsfalse%
- \SetLanguageKeys{odia}{bcp47=or,bcp47-language=or,bcp47-extension-u=nu-latn}%
- \fi
- \xpg@info{Option: Odia, numerals=\xpg@val}%
-}{\xpg@warning{Unknown Odia numeral `#1'}}
-
\def\extras@odia{}
\def\noextras@odia{}
-\define@boolkey{odia}[odia@]{changecounternumbering}[true]{}
+\DeclareKeys[polyglossia/gloss/odia]
+ {
+ changecounternumbering.if = odia@changecounternumbering,
+ changecounternumbering.default:n = true,
+ numerals.choice:,
+ numerals / devanagari.code =
+ {%
+ \odia@odia@numeralsfalse
+ \odia@devanagari@numeralstrue
+ \SetLanguageKeys{odia}{bcp47=or,bcp47-language=or,bcp47-extension-u=nu-deva}%
+ },
+ numerals / odia.code =
+ {%
+ \odia@odia@numeralstrue
+ \odia@devanagari@numeralsfalse
+ },
+ numerals / western.code =
+ {%
+ \odia@odia@numeralsfalse
+ \odia@devanagari@numeralsfalse
+ \SetLanguageKeys{odia}{bcp47=or,bcp47-language=or,bcp47-extension-u=nu-latn}%
+ },
+ numerals.default:n = devanagari,
+ numerals/unknown.code = \xpg@warning{Unknown Odia numeral `#1'}
+ }
% Register default options
-\xpg@initialize@gloss@options{odia}{changecounternumbering=false,numerals=Devanagari}
+\InitializeGlossOptions{odia}{changecounternumbering=false,numerals=Devanagari}
\def\captionsodia{%
\def\refname{ସନà­à¬¦à¬°à­à¬­}%
@@ -23370,13 +23368,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-or.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-odia.ldf}[polyglossia: module for or (Odia)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{odia}
+\InheritGlossFile{odia}
% \end{macrocode}
% \iffalse
@@ -23387,13 +23385,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-pa.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-pa.ldf}[polyglossia: module for pa (Punjabi)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{punjabi}
+\InheritGlossFile{punjabi}
% \end{macrocode}
% \iffalse
@@ -23404,7 +23402,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-persian.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-persian.ldf}[polyglossia: module for Persian]
@@ -23433,42 +23431,36 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\setlanguagealias{persian}{farsi}
\newif\if@western@numerals
-\define@choicekey*+{persian}{numerals}[\xpg@val\xpg@nr]{eastern,western}[eastern]{%
- \ifcase\xpg@nr\relax
- % eastern:
- \@western@numeralsfalse%
- \SetLanguageKeys{persian}{bcp47-extension-u=nu-arab}%
- \or
- % western:
- \@western@numeralstrue%
- \SetLanguageKeys{persian}{bcp47-extension-u=nu-latn}%
- \fi
- \xpg@info{Option: Persian, numerals=\xpg@val}%
-}{\xpg@warning{Unknown Persian numerals option `#1'}}
-
\newif\ifpersian@customsep\persian@customsepfalse
\def\xpg@sepmark{}
-\define@key{persian}{sectionsep}[.]{%
- \persian@customseptrue%
- \gdef\xpg@sepmark{#1}%
-}
-
-%this is needed for \abjad in arabicnumbers.sty
-\define@boolkey{persian}[persian@]{abjadjimnotail}[true]{%
- \ifpersian@abjadjimnotail
- \abjad@jim@notailtrue%
- \else
- \abjad@jim@notailfalse
- \fi}
-
-% NOT YET USED
-\define@key{persian}{locale}[default]{%
- \def\@persian@locale{#1}}
%TODO add option for CALENDAR
+\DeclareKeys[polyglossia/gloss/persian]
+ {
+ sectionsep.code = \gdef\xpg@sepmark{#1}\persian@customseptrue,
+ sectionsep.default:n = .,
+ abjadjimnotail.if = abjad@jim@notail,
+ abjadjimnotail.default:n = true,
+ locale.store = \@persian@locale,
+ locale.default:n = default,
+ numerals.choice:,
+ numerals / eastern.code =
+ {%
+ \@western@numeralsfalse
+ \SetLanguageKeys{persian}{bcp47-extension-u=nu-arab}%
+ },
+ numerals / western.code =
+ {%
+ \@western@numeralstrue
+ \SetLanguageKeys{persian}{bcp47-extension-u=nu-latn}%
+ },
+ numerals.default:n = eastern,
+ numerals/unknown.code = \xpg@warning{Unknown Persian numerals option `#1'}
+ }
+
% Register default options
-\xpg@initialize@gloss@options{persian}{locale=default,numerals=eastern,abjadjimnotail=false}
+\InitializeGlossOptions{persian}{locale=default,numerals=eastern,abjadjimnotail=false}
\def\farsigregmonth#1{\ifcase#1%
\or ژانویه\or Ùوریه\or مارس\or آوریل\or مه\or ژوئن\or ژوئیه\or اوت\or سپتامبر\or اکتبر\or نوامبر\or دسامبر\fi}
@@ -23553,16 +23545,16 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
}
\def\nopersian@xetex@capsformat{%
- \ifcsdef{xpg@save@sepmark}{%
+ \ifcsname xpg@save@sepmark\endcsname%
\SepMark{\xpg@save@sepmark}
- }{}%
+ \fi%
}
\def\persian@luatex@capsformat{%
%
% change chapter and part headings
\ifpersian@customsep
- \ifcsdef{chapter}{%
+ \ifcsname chapter\endcsname%
\let\xpg@save@thesection\thesection%
\renewcommand*\thesection{\thechapter\xpg@sepmark\@arabic\c@section}
\let\xpg@save@theequation\theequation%
@@ -23574,7 +23566,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\let\xpg@save@thetable\thetable%
\renewcommand*\thetable{%
\ifnum\c@chapter>\z@\thechapter\xpg@sepmark\fi\@arabic\c@table}
- }{}
+ \fi%
\let\xpg@save@thesubsection\thesubsection%
\renewcommand\thesubsection
{\thesection\xpg@sepmark\@arabic\c@subsection}
@@ -23589,30 +23581,30 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
}
\def\nopersian@luatex@capsformat{%
- \ifcsdef{xpg@save@thesection}{%
+ \ifcsname xpg@save@thesection\endcsname%
\let\thesection\xpg@save@thesection%
- }{}%
- \ifcsdef{xpg@save@theequation}{%
+ \fi%
+ \ifcsname xpg@save@theequation\endcsname%
\let\theequation\xpg@save@theequation%
- }{}%
- \ifcsdef{xpg@save@thefigure}{%
+ \fi%
+ \ifcsname xpg@save@thefigure\endcsname%
\let\thefigure\xpg@save@thefigure%
- }{}%
- \ifcsdef{xpg@save@thetable}{%
+ \fi%
+ \ifcsname xpg@save@thetable\endcsname%
\let\thetable\xpg@save@thetable%
- }{}%
- \ifcsdef{xpg@save@thesubsection}{%
+ \fi%
+ \ifcsname xpg@save@thesubsection\endcsname%
\let\thesubsection\xpg@save@thesubsection%
- \ifcsdef{xpg@save@thesubsubsection}{%
+ \ifcsname xpg@save@thesubsubsection\endcsname%
\let\thesubsubsection\xpg@save@thesubsubsection%
- }{}%
- }{}%
- \ifcsdef{xpg@save@theparagraph}{%
+ \fi%
+ \fi%
+ \ifcsname xpg@save@theparagraph\endcsname%
\let\theparagraph\xpg@save@theparagraph%
- }{}%
- \ifcsdef{xpg@save@thesubparagraph}{%
+ \fi%
+ \ifcsname xpg@save@thesubparagraph\endcsname%
\let\thesubparagraph\xpg@save@thesubparagraph%
- }{}%
+ \fi%
}
\def\blockextras@persian{%
@@ -23645,7 +23637,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
% \subsection{gloss-piedmontese.ldf}
% \begin{macrocode}
% !TEX encoding = UTF-8 Unicode
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-piedmontese.ldf}[2013/02/12 v1.0 polyglossia: module for Piedmontese]
\makeatletter
@@ -23663,19 +23655,19 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
% BCP-47 compliant aliases
\setlanguagealias*{piedmontese}{pms}
-\define@boolkey{piedmontese}[piedmontese@]{babelshorthands}[true]{}
+\DeclareKeys[polyglossia/gloss/piedmontese]
+ {
+ babelshorthands.if = piedmontese@babelshorthands,
+ babelshorthands.default:n = true
+ }
\ifsystem@babelshorthands
- \setkeys{piedmontese}{babelshorthands=true}
+ \SetGlossOptions{piedmontese}{babelshorthands=true}
\else
- \setkeys{piedmontese}{babelshorthands=false}
+ \SetGlossOptions{piedmontese}{babelshorthands=false}
\fi
-\ifcsundef{initiate@active@char}{%
- \input{babelsh.def}%
- \initiate@active@char{"}%
- \shorthandoff{"}%
-}{}
+\InitializeBabelShorthands
\def\piedmontese@shorthands{%
\xpg@activate@shorthands%
@@ -23739,7 +23731,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
ëd luj\or d'agost\or dë stèmber\or d'otóber\or ëd novèmber\or dë dzèmber%
\fi\space dal\space\number\year}}
-\AtEndPreamble{%
+\AddToHook{begindocument/before}{%
\edef\xpgpms@savedvalues{%
\clubpenalty=\the\clubpenalty\space
\@clubpenalty=\the\@clubpenalty\space
@@ -23775,7 +23767,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-polish.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-polish.ldf}[polyglossia: module for Polish]
@@ -23797,26 +23789,26 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\RequirePackage{luavlna}
\fi
-\define@boolkey{polish}[polish@]{babelshorthands}[true]{}
-
-\define@boolkey{polish}[polish@]{splithyphens}[true]{}
-
-\define@boolkey{polish}[polish@]{vlna}[true]{}
+\DeclareKeys[polyglossia/gloss/polish]
+ {
+ babelshorthands.if = polish@babelshorthands,
+ babelshorthands.default:n = true,
+ splithyphens.if = polish@splithyphens,
+ splithyphens.default:n = true,
+ vlna.if = polish@vlna,
+ vlna.default:n = true,
+ }
% Register default options
-\xpg@initialize@gloss@options{polish}{babelshorthands=false,splithyphens=true,vlna=true}
+\InitializeGlossOptions{polish}{babelshorthands=false,splithyphens=true,vlna=true}
\ifsystem@babelshorthands
- \setkeys{polish}{babelshorthands=true}
+ \SetGlossOptions{polish}{babelshorthands=true}
\else
- \setkeys{polish}{babelshorthands=false}
+ \SetGlossOptions{polish}{babelshorthands=false}
\fi
-\ifcsundef{initiate@active@char}{%
- \input{babelsh.def}%
- \initiate@active@char{"}%
- \shorthandoff{"}%
-}{}
+\InitializeBabelShorthands
\let\xpg@hyphen@char-
\def\polish@@splhyphen#1{%
@@ -24034,13 +24026,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-polutonikogreek.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-polutonikogreek.ldf}[polyglossia: module for polytonic Greek]
% We provide this as a babel alias
-\xpg@load@master@language{greek}
+\InheritGlossFile{greek}
% \end{macrocode}
% \iffalse
@@ -24051,7 +24043,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-portuges.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-portuges.ldf}[polyglossia: module for Portuguese]
@@ -24060,7 +24052,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
% introduced it in 8.3 filename times). Since polyglossia uses full
% English language names, we use 'portuguese' now.
-\xpg@load@master@language{portuguese}
+\InheritGlossFile{portuguese}
% \end{macrocode}
% \iffalse
@@ -24071,7 +24063,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-portuguese.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-portuguese.ldf}[polyglossia: module for Portuguese]
@@ -24101,41 +24093,42 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\fi
\def\portuguese@variant{portuges}
-\define@choicekey*+{portuguese}{variant}[\xpg@val\xpg@nr]{portuguese,brazilian}[portuguese]{%
- \ifcase\xpg@nr\relax
- % portuguese:
- \def\portuguese@variant{portuges}%
- \SetLanguageKeys{portuguese}{babelname=portuges,bcp47=pt-PT,bcp47-language=pt,bcp47-region=PT}%
- \or
- % brazilian:
- \def\portuguese@variant{brazil}%
- \SetLanguageKeys{portuguese}{babelname=brazil,bcp47=pt-BR,bcp47-language=pt,bcp47-region=BR}%
- % There are no specific brazil patterns
- \adddialect\l@brazil\l@portuges\relax%
- \fi
- \xpg@info{Option: portuguese, variant=\xpg@val}%
-}{\xpg@warning{Unknown portuguese variant `#1'}}
-
-\define@boolkey{portuguese}[portuguese@]{babelshorthands}[true]{}
-\define@boolkey{portuguese}[portuguese@]{splithyphens}[true]{}
+\DeclareKeys[polyglossia/gloss/portuguese]
+ {
+ babelshorthands.if = portuguese@babelshorthands,
+ babelshorthands.default:n = true,
+ splithyphens.if = portuguese@splithyphens,
+ splithyphens.default:n = true,
+ variant.choice:,
+ variant / portuguese.code =
+ {%
+ \def\portuguese@variant{portuges}%
+ \SetLanguageKeys{portuguese}{babelname=portuges,bcp47=pt-PT,bcp47-language=pt,bcp47-region=PT}%
+ },
+ variant / brazilian.code =
+ {%
+ \def\portuguese@variant{brazil}%
+ \SetLanguageKeys{portuguese}{babelname=brazil,bcp47=pt-BR,bcp47-language=pt,bcp47-region=BR}%
+ % There are no specific brazil patterns
+ \adddialect\l@brazil\l@portuges\relax
+ },
+ variant.default:n = portuguese,
+ variant/unknown.code = \xpg@warning{Unknown portuguese variant `#1'},
+ }
% Register default options
-\xpg@initialize@gloss@options{portuguese}{variant=portuguese,
+\InitializeGlossOptions{portuguese}{variant=portuguese,
babelshorthands=false,
splithyphens=true}
\ifsystem@babelshorthands
- \setkeys{portuguese}{babelshorthands=true}
+ \SetGlossOptions{portuguese}{babelshorthands=true}
\else
- \setkeys{portuguese}{babelshorthands=false}
+ \SetGlossOptions{portuguese}{babelshorthands=false}
\fi
-\ifcsundef{initiate@active@char}{%
- \input{babelsh.def}%
- \initiate@active@char{"}%
- \shorthandoff{"}%
-}{}
+\InitializeBabelShorthands
\let\xpg@hyphen@char-
\def\portuguese@@splhyphen#1{%
@@ -24204,7 +24197,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
}
\def\portuguese@language{%
- \polyglossia@setup@language@patterns{\portuguese@variant}%
+ \SetupPolyglossiaLangPatterns{\portuguese@variant}%
}%
\def\captionsportuguese@portuges{%
@@ -24302,7 +24295,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-punjabi.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
% UTF-8 strings kindly provided by
% Arvinder Singh Kang, <17-11-2022>
@@ -24329,26 +24322,31 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\def\punjabi@language{%
% patterns are spelled panjabi
- \polyglossia@setup@language@patterns{panjabi}%
+ \SetupPolyglossiaLangPatterns{panjabi}%
}
\newif\ifpunjabi@gurmukhi@numerals
\punjabi@gurmukhi@numeralstrue
-\define@choicekey*+{punjabi}{numerals}[\xpg@val\xpg@nr]{Gurmukhi,Western}[Gurmukhi]{%
- \ifcase\xpg@nr\relax
- % Gurmukhi:
- \punjabi@gurmukhi@numeralstrue%
- \SetLanguageKeys{punjabi}{bcp47-extension-u=nu-guru}%
- \or
- % Western:
- \punjabi@gurmukhi@numeralsfalse%
- \SetLanguageKeys{punjabi}{bcp47-extension-u=nu-latn}%
- \fi
- \xpg@info{Option: Punjabi, numerals=\xpg@val}%
-}{\xpg@warning{Unknown Punjabi numeral `#1'}}
+
+\DeclareKeys[polyglossia/gloss/punjabi]
+ {
+ numerals.choice:,
+ numerals / gurmukhi.code =
+ {%
+ \punjabi@gurmukhi@numeralstrue
+ \SetLanguageKeys{punjabi}{bcp47-extension-u=nu-guru}%
+ },
+ numerals / western.code =
+ {%
+ \punjabi@gurmukhi@numeralsfalse
+ \SetLanguageKeys{punjabi}{bcp47-extension-u=nu-latn}%
+ },
+ numerals.default:n = gurmukhi,
+ numerals/unknown.code = \xpg@warning{Unknown Punjabi numeral `#1'}
+ }
% Register default options
-\xpg@initialize@gloss@options{punjabi}{numerals=gurmukhi}
+\InitializeGlossOptions{punjabi}{numerals=gurmukhi}
\newcommand{\punjabinumerals}[2]{\punjabinumber{#2}}
@@ -24410,7 +24408,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-romanian.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-romanian.ldf}[polyglossia: module for Romanian]
@@ -24469,7 +24467,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-romansh.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-romansh.ldf}[polyglossia: module for Romansh]
\makeatletter
@@ -24527,7 +24525,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-russian.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-russian.ldf}[polyglossia: module for Russian]
@@ -24556,11 +24554,6 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\setlanguagealias*[spelling=old]{russian}{ru-petr1708}
\newif\if@russian@modern
-\define@key{russian}{spelling}[modern]{%
- \ifstrequal{#1}{old}%
- {\@russian@modernfalse\SetLanguageKeys{russian}{bcp47=ru-petr1708,bcp47-variant=petr1708}}%
- {\@russian@moderntrue\SetLanguageKeys{russian}{bcp47=ru,bcp47-variant=luna1918}}%
-}
\def\captionsrussian{%
\if@russian@modern\captionsrussian@modern\else\captionsrussian@old\fi%
@@ -24572,49 +24565,68 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\newif\ifcyrillic@numerals
\newif\ifcyrillic@asbuk@numerals
-\define@choicekey*+{russian}{numerals}[\xpg@val\xpg@nr]{arabic,cyrillic,cyrillic-trad,cyrillic-alph}[arabic]{%
- \ifcase\xpg@nr\relax
- % arabic:
- \cyrillic@numeralsfalse%
- \cyrillic@asbuk@numeralsfalse%
- \SetLanguageKeys{russian}{bcp47-extension-u=nu-latn}%
- \or
- % cyrillic:
- \cyrillic@numeralstrue%
- \cyrillic@asbuk@numeralsfalse%
- \SetLanguageKeys{russian}{bcp47-extension-u=nu-cyrl}%
- \or
- % cyrillic-trad:
- \cyrillic@numeralstrue%
- \cyrillic@asbuk@numeralsfalse%
- \SetLanguageKeys{russian}{bcp47-extension-u=nu-cyrl}%
- \or
- % cyrillic-alph:
- \cyrillic@numeralstrue%
- \cyrillic@asbuk@numeralstrue%
- \SetLanguageKeys{russian}{bcp47-extension-u=nu-cyrl}%
- \fi
- \xpg@info{Option: Russian, numerals=\xpg@val}%
-}{\xpg@warning{Unknown Russian numerals value `#1'}}
-\define@boolkey{russian}[russian@]{indentfirst}[true]{%
- \ifrussian@indentfirst
- \SetLanguageKeys{russian}{indentfirst=true}%
- \else
- \SetLanguageKeys{russian}{indentfirst=false}%
- \fi%
-}
-
-\define@boolkey{russian}[russian@]{babelshorthands}[true]{}
-
-% Force punctuation after heading number
-\define@boolkey{russian}[russian@]{forceheadingpunctuation}[true]{}
-
-% Define some math functions
-\define@boolkey{russian}[russian@]{mathfunctions}[true]{}
+\DeclareKeys[polyglossia/gloss/russian]
+ {
+ babelshorthands.if = russian@babelshorthands,
+ babelshorthands.default:n = true,
+ forceheadingpunctuation.if = russian@forceheadingpunctuation,
+ forceheadingpunctuation.default:n = true,
+ mathfunctions.if = russian@mathfunctions,
+ mathfunctions.default:n = true,
+ spelling.choice:,
+ spelling / modern.code =
+ {%
+ \@russian@moderntrue
+ \SetLanguageKeys{russian}{bcp47=ru,bcp47-variant=luna1918}%
+ },
+ spelling / old.code =
+ {%
+ \@russian@modernfalse
+ \SetLanguageKeys{russian}{bcp47=ru-petr1708,bcp47-variant=petr1708}%
+ },
+ spelling.default:n = modern,
+ numerals.choice:,
+ numerals / arabic.code =
+ {%
+ \cyrillic@numeralsfalse
+ \cyrillic@asbuk@numeralsfalse
+ \SetLanguageKeys{russian}{bcp47-extension-u=nu-latn}%
+ },
+ numerals / cyrillic.code =
+ {%
+ \cyrillic@numeralstrue
+ \cyrillic@asbuk@numeralsfalse
+ \SetLanguageKeys{russian}{bcp47-extension-u=nu-cyrl}%
+ },
+ numerals / cyrillic-trad.code =
+ {%
+ \cyrillic@numeralstrue
+ \cyrillic@asbuk@numeralsfalse
+ \SetLanguageKeys{russian}{bcp47-extension-u=nu-cyrl}%
+ },
+ numerals / cyrillic-alph.code =
+ {%
+ \cyrillic@numeralstrue
+ \cyrillic@asbuk@numeralstrue
+ \SetLanguageKeys{russian}{bcp47-extension-u=nu-cyrl}%
+ },
+ numerals.default:n = arabic,
+ numerals/unknown.code = \xpg@warning{Unknown Russian numerals value `#1'},
+ indentfirst.choice:,
+ indentfirst / true.code =
+ {%
+ \SetLanguageKeys{russian}{indentfirst=true}%
+ },
+ indentfirst / false.code =
+ {%
+ \SetLanguageKeys{russian}{indentfirst=false}%
+ },
+ indentfirst.default:n = true,
+ }
% Register default options
-\xpg@initialize@gloss@options{russian}{babelshorthands=false,
+\InitializeGlossOptions{russian}{babelshorthands=false,
spelling=modern,
numerals=arabic,
indentfirst=true,
@@ -24623,16 +24635,12 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\ifsystem@babelshorthands
- \setkeys{russian}{babelshorthands=true}
+ \SetGlossOptions{russian}{babelshorthands=true}
\else
- \setkeys{russian}{babelshorthands=false}
+ \SetGlossOptions{russian}{babelshorthands=false}
\fi
-\ifcsundef{initiate@active@char}{%
- \input{babelsh.def}%
- \initiate@active@char{"}%
- \shorthandoff{"}%
-}{}
+\InitializeBabelShorthands
\def\russian@shorthands{%
\xpg@activate@shorthands%
@@ -24684,7 +24692,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\def\bibname{Литература}%
\def\chaptername{Глава}%
\def\appendixname{Приложение}%
- \ifcsundef{thechapter}%
+ \@ifundefined{thechapter}%
{\def\contentsname{Содержание}}%
{\def\contentsname{Оглавление}}%
\def\listfigurename{СпиÑок иллюÑтраций}%
@@ -24727,7 +24735,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\def\bibname{БибліографіÑ}%
\def\chaptername{Глава}%
\def\appendixname{Приложеніе}%
- \ifcsundef{thechapter}%
+ \@ifundefined{thechapter}%
{\def\contentsname{Содержаніе}}%
{\def\contentsname{Оглавленіе}}%
\def\listfigurename{СпиÑокъ иллюÑтрацій}%
@@ -24926,7 +24934,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-sami.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-sami.ldf}[polyglossia: module for Sami]
@@ -24956,19 +24964,19 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
% % northern:
% \def\sami@variant{samin}%
% \SetLanguageKeys{sami}{language=Northern Sami,langtag=NSM}%
-% \xpg@fontsetup@latin{sami}%
+% \SetupLatinPolyglossiaFont{sami}%
% \or
% % other:
% \def\sami@variant{}%
% \SetLanguageKeys{sami}{language= Sami,langtag=}%
-% \xpg@fontsetup@latin{sami}%
+% \SetupLatinPolyglossiaFont{sami}%
% \fi
% \xpg@info{Option: sami, variant=\xpg@val}%
%}{\xpg@warning{Unknown sami variant `#1'}}
%\def\sami@language{%
-% \polyglossia@setup@language@patterns{\sami@variant}%
+% \SetupPolyglossiaLangPatterns{\sami@variant}%
%}%
\def\captionssami@northern{%
@@ -25030,14 +25038,14 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-samin.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-samin.ldf}[polyglossia: module for Northern Sami]
% We only provide this gloss for babel compatibility. Since samin is
% a sami variety, we use 'sami' with variant 'northern' now.
-\xpg@load@master@language{sami}
+\InheritGlossFile{sami}
% \end{macrocode}
% \iffalse
@@ -25048,7 +25056,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-sanskrit.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-sanskrit.ldf}[polyglossia: module for Sanskrit]
@@ -25077,56 +25085,55 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\setlanguagealias*[script=gujarati]{sanskrit}{sa-Gujr}
\setlanguagealias*[script=latin]{sanskrit}{sa-Latn}
-\define@key{sanskrit}{Script}[devanagari]{%
- \ifcsdef{fontsetup@sanskrit@#1}%
- {\csname fontsetup@sanskrit@#1\endcsname}%
- {\xpg@error{`#1' is not a valid script for Sanskrit}%
- }%
-}
-
-\define@key{sanskrit}{script}[devanagari]{\setkeys{sanskrit}{Script=#1}}
-
\def\fontsetup@sanskrit@devanagari{%
\SetLanguageKeys{sanskrit}{scripttag=deva,script=Devanagari,bcp47=sa-Deva,bcp47-language=sa,bcp47-script=Deva,bcp47-casing=sa-Deva}
- \xpg@fontsetup@nonlatin{sanskrit}}
+ \SetupNonLatinPolyglossiaFont{sanskrit}}
\def\fontsetup@sanskrit@gujarati{%
\SetLanguageKeys{sanskrit}{scripttag=gujr,script=Gujarati,bcp47=sa-Gujr,bcp47-language=sa,bcp47-script=Gujr,bcp47-casing=sa-Gujr}
- \xpg@fontsetup@nonlatin{sanskrit}}
+ \SetupNonLatinPolyglossiaFont{sanskrit}}
\def\fontsetup@sanskrit@malayalam{%
\SetLanguageKeys{sanskrit}{scripttag=mlym,script=Malayalam,bcp47=sa-Mlym,bcp47-language=sa,bcp47-script=Mlym,bcp47-casing=sa-Mlym}
- \xpg@fontsetup@nonlatin{sanskrit}}
+ \SetupNonLatinPolyglossiaFont{sanskrit}}
\def\fontsetup@sanskrit@bengali{%
\SetLanguageKeys{sanskrit}{scripttag=beng,script=Bengali,bcp47=sa-Beng,bcp47-language=sa,bcp47-script=Beng,bcp47-casing=sa-Beng}
- \xpg@fontsetup@nonlatin{sanskrit}}
+ \SetupNonLatinPolyglossiaFont{sanskrit}}
\def\fontsetup@sanskrit@kannada{%
\SetLanguageKeys{sanskrit}{scripttag=knda,script=Kannada,bcp47=sa-Knda,bcp47-language=sa,bcp47-script=Knda,bcp47-casing=sa-Knda}
- \xpg@fontsetup@nonlatin{sanskrit}}
+ \SetupNonLatinPolyglossiaFont{sanskrit}}
\def\fontsetup@sanskrit@telugu{%
\SetLanguageKeys{sanskrit}{scripttag=telu,script=Telugu,bcp47=sa-Relu,bcp47-language=sa,bcp47-script=Relu,bcp47-casing=sa-Relu}
- \xpg@fontsetup@nonlatin{sanskrit}}
+ \SetupNonLatinPolyglossiaFont{sanskrit}}
\def\fontsetup@sanskrit@latin{%
\SetLanguageKeys{sanskrit}{scripttag=latn,script=Latin,bcp47=sa-Latn,bcp47-language=sa,bcp47-script=Latn,bcp47-casing=sa-Latn}
- \xpg@fontsetup@latin{sanskrit}}
+ \SetupLatinPolyglossiaFont{sanskrit}}
\newif\ifsanskrit@devanagari@numerals
\sanskrit@devanagari@numeralstrue
-\define@choicekey*+{sanskrit}{numerals}[\xpg@val\xpg@nr]{devanagari,western}[devanagari]{%
- \ifcase\xpg@nr\relax
- % devanagari:
- \sanskrit@devanagari@numeralstrue%
- \SetLanguageKeys{sanskrit}{bcp47-extension-u=nu-deva}%
- \or
- % western:
- \sanskrit@devanagari@numeralsfalse%
- \SetLanguageKeys{sanskrit}{bcp47-extension-u=nu-latn}%
- \fi
- \xpg@info{Option: Sanskrit, numerals=\xpg@val}%
-}{\xpg@warning{Unknown Sanskrit numeral `#1'}}
+\DeclareKeys[polyglossia/gloss/sanskrit]
+ {
+ script.code = \@ifundefined{fontsetup@sanskrit@#1}%
+ {\xpg@error{`#1' is not a valid script for Sanskrit}}%
+ {\csname fontsetup@sanskrit@#1\endcsname},
+ script.default:n = devanagari,
+ numerals.choice:,
+ numerals / devanagari.code =
+ {%
+ \sanskrit@devanagari@numeralstrue
+ \SetLanguageKeys{sanskrit}{bcp47-extension-u=nu-deva}%
+ },
+ numerals / western.code =
+ {%
+ \sanskrit@devanagari@numeralsfalse
+ \SetLanguageKeys{sanskrit}{bcp47-extension-u=nu-latn}%
+ },
+ numerals.default:n = devanagari,
+ numerals/unknown.code = \xpg@warning{Unknown Sanskrit numeral `#1'}
+ }
% Register default options
-\xpg@initialize@gloss@options{sanskrit}{script=devanagari,numerals=devanagari}
+\InitializeGlossOptions{sanskrit}{script=devanagari,numerals=devanagari}
% Use \providecommand here as the ldf file might
% be reloaded via BCP.
@@ -25207,14 +25214,14 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-scottish.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-scottish.ldf}[polyglossia: module for Scottish Gaelic]
% We only provide this gloss for babel compatibility. Since scottish is
% a gaelic variety, we use 'gaelic' with variant 'scottish' now.
-\xpg@load@master@language{gaelic}
+\InheritGlossFile{gaelic}
% \end{macrocode}
% \iffalse
@@ -25225,7 +25232,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-serbian.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-serbian.ldf}[polyglossia: module for Serbian]
%TODO split into gloss-serbiancyr.ldf and gloss-serbianlat.ldf
@@ -25266,67 +25273,10 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\fi
\newif\if@serbian@cyr
-\define@choicekey*+{serbian}{Script}[\xpg@val\xpg@nr]{cyrillic,latin}[cyrillic]{%
- \ifcase\xpg@nr\relax
- % cyrillic:
- \@serbian@cyrtrue
- \xpg@fontsetup@nonlatin{serbian}%
- \or
- % latin:
- \@serbian@cyrfalse
- \xpg@fontsetup@latin{serbian}%
- %TODO \def\serbian@language{\language=\l@serbianlat}%
- % or should we use Croatian patterns as a fallback for the time being???
- \fi
- \serbian@set@languagekeys%
- \xpg@info{Option: Serbian, script=\xpg@val}%
-}{\xpg@warning{Unknown Serbian script `#1'}}
-
-\define@key{serbian}{script}[cyrillic]{\setkeys{serbian}{Script=#1}}
-
\newif\if@serbian@ijekavian
-\define@choicekey*+{serbian}{variant}[\xpg@val\xpg@nr]{ekavian,ijekavian}[ekavian]{%
- \ifcase\xpg@nr\relax
- % ekavian:
- \@serbian@ijekavianfalse%
- \or
- % ijekavian:
- \@serbian@ijekaviantrue%
- \fi
- \serbian@set@languagekeys%
- \xpg@info{Option: Serbian, variant=\xpg@val}%
-}{\xpg@warning{Unknown Serbian variant `#1'}}
\newif\ifcyrillic@numerals
\newif\ifcyrillic@asbuk@numerals
-\define@choicekey*+{serbian}{numerals}[\xpg@val\xpg@nr]{arabic,cyrillic,cyrillic-trad,cyrillic-alph}[arabic]{%
- \ifcase\xpg@nr\relax
- % arabic:
- \cyrillic@numeralsfalse%
- \cyrillic@asbuk@numeralsfalse%
- \SetLanguageKeys{serbian}{bcp47-extension-u=nu-latn}%
- \or
- % cyrillic:
- \cyrillic@numeralstrue%
- \cyrillic@asbuk@numeralsfalse%
- \SetLanguageKeys{serbian}{bcp47-extension-u=nu-cyrl}%
- \or
- % cyrillic-trad:
- \cyrillic@numeralstrue%
- \cyrillic@asbuk@numeralsfalse%
- \SetLanguageKeys{serbian}{bcp47-extension-u=nu-cyrl}%
- \or
- % cyrillic-alph:
- \cyrillic@numeralstrue%
- \cyrillic@asbuk@numeralstrue%
- \SetLanguageKeys{serbian}{bcp47-extension-u=nu-cyrl}%
- \fi
- \xpg@info{Option: Serbian, numerals=\xpg@val}%
-}{\xpg@warning{Unknown Serbian numerals value `#1'}}
-
-\define@boolkey{serbian}[serbian@]{splithyphens}[true]{}
-
-\define@boolkey{serbian}[serbian@]{datei}[true]{}
\def\serbian@set@languagekeys{%
\if@serbian@cyr
@@ -25344,10 +25294,75 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\fi%
}
-\setkeys{serbian}{Script,numerals}
+\DeclareKeys[polyglossia/gloss/serbian]
+ {
+ splithyphens.if = serbian@splithyphens,
+ splithyphens.default:n = true,
+ datei.if = serbian@datei,
+ datei.default:n = true,
+ variant.choice:,
+ variant / ekavian.code =
+ {%
+ \@serbian@ijekavianfalse
+ \serbian@set@languagekeys
+ },
+ variant / ijekavian.code =
+ {%
+ \@serbian@ijekaviantrue
+ \serbian@set@languagekeys
+ },
+ variant.default:n = ekavian,
+ variant/unknown.code = \xpg@warning{Unknown Serbian variant `#1'},
+ script.choice:,
+ script / cyrillic.code =
+ {%
+ \@serbian@cyrtrue
+ \SetupNonLatinPolyglossiaFont{serbian}%
+ \serbian@set@languagekeys
+ },
+ script / latin.code =
+ {%
+ \@serbian@cyrfalse
+ \SetupLatinPolyglossiaFont{serbian}%
+ %TODO \def\serbian@language{\language=\l@serbianlat}%
+ % or should we use Croatian patterns as a fallback for the time being???
+ \serbian@set@languagekeys
+ },
+ script.default:n = cyrillic,
+ script/unknown.code = \xpg@warning{Unknown Serbian script `#1'},
+ numerals.choice:,
+ numerals / arabic.code =
+ {%
+ \cyrillic@numeralsfalse
+ \cyrillic@asbuk@numeralsfalse
+ \SetLanguageKeys{serbian}{bcp47-extension-u=nu-latn}%
+ },
+ numerals / cyrillic.code =
+ {%
+ \cyrillic@numeralstrue
+ \cyrillic@asbuk@numeralsfalse
+ \SetLanguageKeys{serbian}{bcp47-extension-u=nu-cyrl}%
+ },
+ numerals / cyrillic-trad.code =
+ {%
+ \cyrillic@numeralstrue
+ \cyrillic@asbuk@numeralsfalse
+ \SetLanguageKeys{serbian}{bcp47-extension-u=nu-cyrl}%
+ },
+ numerals / cyrillic-alph.code =
+ {%
+ \cyrillic@numeralstrue
+ \cyrillic@asbuk@numeralstrue
+ \SetLanguageKeys{serbian}{bcp47-extension-u=nu-cyrl}%
+ },
+ numerals.default:n = arabic,
+ numerals/unknown.code = \xpg@warning{Unknown Serbian numerals value `#1'}
+ }
+
+\SetGlossOptions{serbian}{script,numerals}
% Register default options
-\xpg@initialize@gloss@options{serbian}{script=cyrillic,numerals=arabic,splithyphens=true}
+\InitializeGlossOptions{serbian}{script=cyrillic,numerals=arabic,splithyphens=true}
\def\captionsserbian{%
\if@serbian@cyr\captionsserbian@cyr\else\captionsserbian@lat\fi
@@ -25648,13 +25663,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-serbianc.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-serbianc.ldf}[polyglossia: module for Serbian (cyrillic)]
% We provide this as a babel alias
-\xpg@load@master@language{serbian}
+\InheritGlossFile{serbian}
% \end{macrocode}
% \iffalse
@@ -25665,7 +25680,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-slovak.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-slovak.ldf}[polyglossia: module for Slovak]
@@ -25686,26 +25701,26 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\RequirePackage{luavlna}
\fi
-\define@boolkey{slovak}[slovak@]{babelshorthands}[true]{}
-
-\define@boolkey{slovak}[slovak@]{splithyphens}[true]{}
-
-\define@boolkey{slovak}[slovak@]{vlna}[true]{}
+\DeclareKeys[polyglossia/gloss/slovak]
+ {
+ babelshorthands.if = slovak@babelshorthands,
+ babelshorthands.default:n = true,
+ splithyphens.if = slovak@splithyphens,
+ splithyphens.default:n = true,
+ vlna.if = slovak@vlna,
+ vlna.default:n = true,
+ }
% Register default options
-\xpg@initialize@gloss@options{slovak}{babelshorthands=false,splithyphens=true,vlna=true}
+\InitializeGlossOptions{slovak}{babelshorthands=false,splithyphens=true,vlna=true}
\ifsystem@babelshorthands
- \setkeys{slovak}{babelshorthands=true}
+ \SetGlossOptions{slovak}{babelshorthands=true}
\else
- \setkeys{slovak}{babelshorthands=false}
+ \SetGlossOptions{slovak}{babelshorthands=false}
\fi
-\ifcsundef{initiate@active@char}{%
- \input{babelsh.def}%
- \initiate@active@char{"}%
- \shorthandoff{"}%
-}{}
+\InitializeBabelShorthands
\let\xpg@hyphen@char-
\def\slovak@@splhyphen#1{%
@@ -25881,7 +25896,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\def\contentsname{Obsah}%
\def\listfigurename{Zoznam obrázkov}%
\def\listtablename{Zoznam tabuliek}%
- \def\indexname{Index}%
+ \def\indexname{Register}%
\def\figurename{Obrázok}%
\def\tablename{Tabuľka}%
%\def\thepart{}%
@@ -25932,13 +25947,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-slovene.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-slovene.ldf}[polyglossia: module for Slovenian]
% We provide this as a babel alias
-\xpg@load@master@language{slovenian}
+\InheritGlossFile{slovenian}
% \end{macrocode}
% \iffalse
@@ -25949,7 +25964,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-slovenian.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-slovenian.ldf}[polyglossia: module for Slovenian]
@@ -25970,10 +25985,14 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
% Babel aliases
\setlanguagealias{slovenian}{slovene}
-\define@boolkey{slovenian}[slovenian@]{localalph}[true]{}
+\DeclareKeys[polyglossia/gloss/slovenian]
+ {
+ localalph.if = slovenian@localalph,
+ localalph.default:n = true
+ }
% Register default options
-\xpg@initialize@gloss@options{slovenian}{localalph=false}
+\InitializeGlossOptions{slovenian}{localalph=false}
\def\captionsslovenian{%
@@ -26041,7 +26060,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-sorbian.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-sorbian.ldf}[polyglossia: module for Sorbian]
@@ -26069,60 +26088,40 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\setlanguagealias[variant=upper]{sorbian}{uppersorbian}
\def\sorbian@variant{usorbian}
-\define@choicekey*+{sorbian}{variant}[\xpg@val\xpg@nr]{upper,lower}[upper]{%
- \ifcase\xpg@nr\relax
- % upper:
- \def\sorbian@variant{usorbian}%
- \SetLanguageKeys{sorbian}{language=Upper Sorbian,langtag=USB,babelname=uppersorbian,bcp47=hsb,bcp47-language=hsb}%
- \xpg@fontsetup@latin{sorbian}%
- % Check if \l@usorbian is defined. If not, try to set it to some variety
- % (specific order as in the csv list below), or null language if everything fails
- \xpg@ifdefined{usorbian}{}{%
- \def\do##1{%
- \xpg@ifdefined{##1}%
- {\csletcs{l@usorbian}{l@##1}\listbreak}%
- {}%
- }%
- \docsvlist{uppersorbian}
- \xpg@ifdefined{usorbian}{}{%
- \xpg@warning{No hyphenation patterns for Upper Sorbian found\MessageBreak
- I will use the 'null' language instead}%
- \adddialect\l@usorbian0%
- }
- }%
- \or
- % lower:
- \def\sorbian@variant{lsorbian}%
- \SetLanguageKeys{sorbian}{language=Lower Sorbian,langtag=LSB,babelname=lowersorbian,bcp47=dsb,bcp47-language=dsb}%
- \xpg@fontsetup@latin{sorbian}%
- % Check if \l@lsorbian is defined. If not, try to set it to some variety
- % (specific order as in the csv list below), or null language if everything fails
- \xpg@ifdefined{lsorbian}{}{%
- \def\do##1{%
- \xpg@ifdefined{##1}%
- {\csletcs{l@lsorbian}{l@##1}\listbreak}%
- {}%
- }%
- \docsvlist{lowersorbian,Lsorbian,usorbian,uppersorbian}
- \xpg@ifdefined{lsorbian}{}{%
- \xpg@warning{No hyphenation patterns for Lower Sorbian found\MessageBreak
- I will use the 'null' language instead}%
- \adddialect\l@lsorbian0%
- }
- }%
- \fi
- \xpg@info{Option: sorbian, variant=\xpg@val}%
-}{\xpg@warning{Unknown sorbian variant `#1'}}
-
-\define@boolkey{sorbian}[sorbian@]{olddate}[true]{}
+\DeclareKeys[polyglossia/gloss/sorbian]
+ {
+ olddate.if = sorbian@olddate,
+ olddate.default:n = true,
+ variant.choice:,
+ variant / upper.code =
+ {%
+ \def\sorbian@variant{usorbian}%
+ \SetLanguageKeys{sorbian}{language=Upper Sorbian,langtag=USB,babelname=uppersorbian,bcp47=hsb,bcp47-language=hsb}%
+ \SetupLatinPolyglossiaFont{sorbian}%
+ % Check if \l@usorbian is defined. If not, try to set it to some variety
+ % (specific order as in the csv list), or null language if everything fails
+ \TryPatternWithFallback{usorbian}{uppersorbian}%
+ },
+ variant / lower.code =
+ {%
+ \def\sorbian@variant{lsorbian}%
+ \SetLanguageKeys{sorbian}{language=Lower Sorbian,langtag=LSB,babelname=lowersorbian,bcp47=dsb,bcp47-language=dsb}%
+ \SetupLatinPolyglossiaFont{sorbian}%
+ % Check if \l@lsorbian is defined. If not, try to set it to some variety
+ % (specific order as in the csv list), or null language if everything fails
+ \TryPatternWithFallback{lsorbian}{lowersorbian,Lsorbian,usorbian,uppersorbian}%
+ },
+ variant.default:n = upper,
+ variant/unknown.code = \xpg@warning{Unknown sorbian variant `#1'}
+ }
% Register default options
-\xpg@initialize@gloss@options{sorbian}{variant=upper,olddate=false}
+\InitializeGlossOptions{sorbian}{variant=upper,olddate=false}
\def\sorbian@language{%
- \polyglossia@setup@language@patterns{\sorbian@variant}%
+ \SetupPolyglossiaLangPatterns{\sorbian@variant}%
}%
@@ -26232,7 +26231,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-spanish.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-spanish.ldf}[polyglossia: module for Spanish]
@@ -26261,52 +26260,58 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\newif\if@spanish@mexico
\@spanish@mexicofalse
-\define@choicekey*+{spanish}{variant}[\xpg@val\xpg@nr]{spanish,mexican}[spanish]{%
- \ifcase\xpg@nr\relax
- % spanish:
- \@spanish@mexicofalse%
- \SetLanguageKeys{spanish}{babelname=spanish,bcp47=es-ES,bcp47-region=ES}%
- \or
- % mexican:
- \@spanish@mexicotrue%
- \SetLanguageKeys{spanish}{babelname=spanishmx,bcp47=es-MX,bcp47-region=MX}%
- \fi
- \xpg@info{Option: spanish, variant=\xpg@val}%
-}{\xpg@warning{Unknown spanish variant `#1'}}
% Localized math operators à la babel
\newif\ifspanish@accentedoperators
\newif\ifspanish@spacedoperators
\newif\ifspanish@locoperators
-\define@choicekey*+{spanish}{spanishoperators}[\xpg@val\xpg@nr]{all,accented,spaced,none}[all]{%
- \ifcase\xpg@nr\relax
- % all:
- \spanish@locoperatorstrue%
- \spanish@accentedoperatorstrue%
- \spanish@spacedoperatorstrue%
- \or
- % accented:
- \spanish@locoperatorsfalse%
- \spanish@accentedoperatorstrue%
- \spanish@spacedoperatorsfalse%
- \or
- % spaced:
- \spanish@locoperatorsfalse%
- \spanish@accentedoperatorsfalse%
- \spanish@spacedoperatorstrue%
- \or
- % none:
- \spanish@locoperatorsfalse%
- \spanish@accentedoperatorsfalse%
- \spanish@spacedoperatorsfalse%
- \fi
- \xpg@info{Option: Spanish, spanishoperators=\xpg@val}%
-}{\xpg@warning{Unknown spanishoperators value `#1'}}
-
+\DeclareKeys[polyglossia/gloss/spanish]
+ {
+ variant.choice:,
+ variant / spanish.code =
+ {%
+ \@spanish@mexicofalse
+ \SetLanguageKeys{spanish}{babelname=spanish,bcp47=es-ES,bcp47-region=ES}%
+ },
+ variant / mexican.code =
+ {%
+ \@spanish@mexicotrue
+ \SetLanguageKeys{spanish}{babelname=spanishmx,bcp47=es-MX,bcp47-region=MX}%
+ },
+ variant.default:n = spanish,
+ variant/unknown.code = \xpg@warning{Unknown spanish variant `#1'},
+ spanishoperators.choice:,
+ spanishoperators / all.code =
+ {%
+ \spanish@locoperatorstrue
+ \spanish@accentedoperatorstrue
+ \spanish@spacedoperatorstrue
+ },
+ spanishoperators / accented.code =
+ {%
+ \spanish@locoperatorsfalse
+ \spanish@accentedoperatorstrue
+ \spanish@spacedoperatorsfalse
+ },
+ spanishoperators / spaced.code =
+ {%
+ \spanish@locoperatorsfalse
+ \spanish@accentedoperatorsfalse
+ \spanish@spacedoperatorstrue
+ },
+ spanishoperators / none.code =
+ {%
+ \spanish@locoperatorsfalse
+ \spanish@accentedoperatorsfalse
+ \spanish@spacedoperatorsfalse
+ },
+ spanishoperators.default:n = all,
+ spanishoperators/unknown.code = \xpg@warning{Unknown spanishoperators value `#1'}
+ }
% Register default options
-\xpg@initialize@gloss@options{spanish}{variant=spanish,spanishoperators=none}
+\InitializeGlossOptions{spanish}{variant=spanish,spanishoperators=none}
\let\xpg@save@lim\lim
\let\xpg@save@limsup\limsup
@@ -26472,13 +26477,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-spanishmx.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-spanishmx.ldf}[polyglossia: module for Mexican Spanish]
% We provide this as a babel alias
-\xpg@load@master@language{spanish}
+\InheritGlossFile{spanish}
% \end{macrocode}
% \iffalse
@@ -26489,7 +26494,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-swedish.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-swedish.ldf}[polyglossia: module for Swedish]
@@ -26554,13 +26559,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-swissgerman.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-swissgerman.ldf}[polyglossia: module for Swiss German (old spelling)]
% We provide this as a babel alias
-\xpg@load@master@language{german}
+\InheritGlossFile{german}
% \end{macrocode}
% \iffalse
@@ -26571,7 +26576,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-syriac.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-syriac.ldf}[polyglossia: module for Syriac]
@@ -26595,34 +26600,37 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
% BCP-47 compliant aliases
\setlanguagealias*{syriac}{syr}
-\def\syriacnumber#1{\@syriacnumber{#1}}%
+\def\syriacnumber#1{\@syriacnumber{#1}}
\newif\if@eastern@numerals
-\define@choicekey*+{syriac}{numerals}[\xpg@val\xpg@nr]{eastern,western,abjad}[eastern]{%
- \ifcase\xpg@nr\relax
- % eastern:
- \@eastern@numeralstrue
- \SetLanguageKeys{syriac}{bcp47-extension-u=nu-syrc}%
- \or
- % western:
- \@eastern@numeralsfalse
- \SetLanguageKeys{syriac}{bcp47-extension-u=nu-latn}%
- \or
- % abjad:
- \let\syriacnumber\abjadsyriac%
- \fi
- \xpg@info{Option: Syriac, numerals=\xpg@val}%
-}{\xpg@warning{Unknown Syriac numerals option `#1'}}
-
\newif\ifsyriac@customsep\syriac@customsepfalse
\def\xpg@sepmark{}
-\define@key{syriac}{sectionsep}[.]{%
- \syriac@customseptrue%
- \gdef\xpg@sepmark{#1}%
-}
+
+\DeclareKeys[polyglossia/gloss/syriac]
+ {
+ sectionsep.code = \gdef\xpg@sepmark{#1}\syriac@customseptrue,
+ sectionsep.default:n = .,
+ numerals.choice:,
+ numerals / eastern.code =
+ {%
+ \@eastern@numeralstrue
+ \SetLanguageKeys{syriac}{bcp47-extension-u=nu-syrc}%
+ },
+ numerals / western.code =
+ {%
+ \@eastern@numeralsfalse
+ \SetLanguageKeys{syriac}{bcp47-extension-u=nu-latn}%
+ },
+ numerals / abjad.code =
+ {%
+ \let\syriacnumber\abjadsyriac
+ },
+ numerals.default:n = eastern,
+ numerals/unknown.code = \xpg@warning{Unknown Syriac numerals option `#1'}
+ }
% Register default options
-\xpg@initialize@gloss@options{syriac}{numerals=western}
+\InitializeGlossOptions{syriac}{numerals=western}
%\define@key{polyglossia}{syriaclocale}[default]{%
% \def\@syriac@locale{#1}}
@@ -26709,13 +26717,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\IfCharIsAvailableTF{0661}%
{\@ensure@LTR{\protect\arabicdigits{\number#1}}}%
{\@ensure@LTR{\arabicdigits{\number#1}}
- \ifcsdef{arabicfont}%
- {\@ensure@LTR{\protect\arabicdigits{\number#1}}%
- \xpg@warning{You have specified the option numerals=eastern for Syriac, but the Syriac font does not contain the appropriate glyphs:
- I am using \string\arabicfont instead}}%
+ \@ifundefined{arabicfont}%
{\number#1%%% <---changed from \RL{\protect\reset@font\protect\number#1}%
\xpg@warning{You have specified the option numerals=eastern for Syriac, but the Syriac font does not contain the appropriate glyphs:
since \string\arabicfont is not defined, we'll use Western numerals instead}}%
+ {\@ensure@LTR{\protect\arabicdigits{\number#1}}%
+ \xpg@warning{You have specified the option numerals=eastern for Syriac, but the Syriac font does not contain the appropriate glyphs:
+ I am using \string\arabicfont instead}}%
}%
\else
%%\RL{\protect\reset@font\number#1}%
@@ -26753,16 +26761,16 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
}
\def\nosyriac@xetex@capsformat{%
- \ifcsdef{xpg@save@sepmark}{%
+ \ifcsname xpg@save@sepmark\endcsname%
\SepMark{\xpg@save@sepmark}
- }{}%
+ \fi%
}
\def\syriac@luatex@capsformat{%
%
% change chapter and part headings
\ifsyriac@customsep
- \ifcsdef{chapter}{%
+ \ifcsname chapter\endcsname%
\let\xpg@save@thesection\thesection%
\renewcommand*\thesection{\thechapter\xpg@sepmark\@arabic\c@section}
\let\xpg@save@theequation\theequation%
@@ -26774,7 +26782,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\let\xpg@save@thetable\thetable%
\renewcommand*\thetable{%
\ifnum\c@chapter>\z@\thechapter\xpg@sepmark\fi\@arabic\c@table}
- }{}
+ \fi%
\let\xpg@save@thesubsection\thesubsection%
\renewcommand\thesubsection
{\thesection\xpg@sepmark\@arabic\c@subsection}
@@ -26789,30 +26797,30 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
}
\def\nosyriac@luatex@capsformat{%
- \ifcsdef{xpg@save@thesection}{%
+ \ifcsname xpg@save@thesection\endcsname%
\let\thesection\xpg@save@thesection%
- }{}%
- \ifcsdef{xpg@save@theequation}{%
+ \fi%
+ \ifcsname xpg@save@theequation\endcsname%
\let\theequation\xpg@save@theequation%
- }{}%
- \ifcsdef{xpg@save@thefigure}{%
+ \fi%
+ \ifcsname xpg@save@thefigure\endcsname%
\let\thefigure\xpg@save@thefigure%
- }{}%
- \ifcsdef{xpg@save@thetable}{%
+ \fi%
+ \ifcsname xpg@save@thetable\endcsname%
\let\thetable\xpg@save@thetable%
- }{}%
- \ifcsdef{xpg@save@thesubsection}{%
+ \fi%
+ \ifcsname xpg@save@thesubsection\endcsname%
\let\thesubsection\xpg@save@thesubsection%
- \ifcsdef{xpg@save@thesubsubsection}{%
+ \ifcsname xpg@save@thesubsubsection\endcsname%
\let\thesubsubsection\xpg@save@thesubsubsection%
- }{}%
- }{}%
- \ifcsdef{xpg@save@theparagraph}{%
+ \fi%
+ \fi%
+ \ifcsname xpg@save@theparagraph\endcsname%
\let\theparagraph\xpg@save@theparagraph%
- }{}%
- \ifcsdef{xpg@save@thesubparagraph}{%
+ \fi%
+ \ifcsname xpg@save@thesubparagraph\endcsname%
\let\thesubparagraph\xpg@save@thesubparagraph%
- }{}%
+ \fi%
}
\def\blockextras@syriac{%
@@ -26844,7 +26852,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-tamil.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-tamil.ldf}[polyglossia: module for Tamil]
@@ -26914,7 +26922,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-telugu.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-telugu.ldf}[polyglossia: module for Telugu]
@@ -26987,7 +26995,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-thai.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-thai.ldf}[polyglossia: module for Thai]
%% This is partly based on thai-latex for Babel:
@@ -27018,19 +27026,25 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\newif\if@thai@numerals
\def\tmp@thai{thai}
-\define@key{thai}{numerals}[arabic]{%
- \def\@tmpa{#1}%
- \ifx\@tmpa\tmp@thai
- \@thai@numeralstrue%
- \SetLanguageKeys{thai}{bcp47-extension-u=nu-thai}%
- \else
- \@thai@numeralsfalse%
- \SetLanguageKeys{thai}{bcp47-extension-u=nu-latn}%
- \fi
-}
+
+\DeclareKeys[polyglossia/gloss/thai]
+ {
+ numerals.choice:,
+ numerals / arabic.code =
+ {%
+ \@thai@numeralsfalse
+ \SetLanguageKeys{thai}{bcp47-extension-u=nu-latn}%
+ },
+ numerals / thai.code =
+ {%
+ \@thai@numeralstrue
+ \SetLanguageKeys{thai}{bcp47-extension-u=nu-thai}%
+ },
+ numerals.default:n = arabic,
+ }
% Register default options
-\xpg@initialize@gloss@options{thai}{numerals=arabic}
+\InitializeGlossOptions{thai}{numerals=arabic}
\def\captionsthai{%
\def\refname{หนังสืออ้างอิง}%
@@ -27145,7 +27159,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-tibetan.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-tibetan.ldf}[polyglossia: module for Tibetan]
%% Copyright 2013 Elie Roux
@@ -27171,20 +27185,18 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\setlanguagealias*{tibetan}{bo}
\newif\if@tibetan@numerals
-\def\tmp@tibetan{tibetan}
-\define@key{tibetan}{numerals}[tibetan]{%
- \def\@tmpa{#1}%
- \ifx\@tmpa\tmp@tibetan
- \@tibetan@numeralstrue%
- \SetLanguageKeys{tibetan}{bcp47-extension-u=nu-tibt}%
- \else
- \@tibetan@numeralsfalse%
- \SetLanguageKeys{tibetan}{bcp47-extension-u=nu-latn}%
- \fi%
-}
+\DeclareKeys[polyglossia/gloss/tibetan]
+ {
+ numerals.choice:,
+ numerals/tibetan.code = \@tibetan@numeralstrue
+ \SetLanguageKeys{tibetan}{bcp47-extension-u=nu-tibt},
+ numerals/arabic.code = \@tibetan@numeralsfalse
+ \SetLanguageKeys{tibetan}{bcp47-extension-u=nu-latn},
+ numerals.default:n = tibetan
+ }
\ifluatex
- \newluatexattribute\xpg@tibteol %
+ \newattribute\xpg@tibteol %
\directlua{polyglossia.load_tibt_eol()}%
\fi
@@ -27209,7 +27221,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
}
% Register default options
-\xpg@initialize@gloss@options{tibetan}{numerals=tibetan}
+\InitializeGlossOptions{tibetan}{numerals=tibetan}
% some are known, but very few
% a few come from "Standardizing Tibetan Terms of Information Technology"
@@ -27371,7 +27383,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-turkish.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-turkish.ldf}[polyglossia: module for Turkish]
\RequirePackage{hijrical}
@@ -27489,7 +27501,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-turkmen.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-turkmen.ldf}[polyglossia: module for Turkmen]
%% Translations provided by Nazar Annagurban <nazartm at gmail dot com>
@@ -27547,12 +27559,12 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-ug.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-ug.ldf}[polyglossia: module for ug (Uyghur)]
% BCP 47 tag for Uyghur
-\xpg@load@master@language{uyghur}
+\InheritGlossFile{uyghur}
% \end{macrocode}
% \iffalse
@@ -27563,7 +27575,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-ukrainian.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-ukrainian.ldf}[polyglossia: module for Ukrainian]
% Strings taken from Babel
@@ -27591,51 +27603,52 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\newif\ifcyrillic@numerals
\newif\ifcyrillic@asbuk@numerals
-\define@choicekey*+{ukrainian}{numerals}[\xpg@val\xpg@nr]{arabic,cyrillic,cyrillic-trad,cyrillic-alph}[arabic]{%
- \ifcase\xpg@nr\relax
- % arabic:
- \cyrillic@numeralsfalse%
- \cyrillic@asbuk@numeralsfalse%
- \SetLanguageKeys{ukrainian}{bcp47-extension-u=nu-latn}%
- \or
- % cyrillic:
- \cyrillic@numeralstrue%
- \cyrillic@asbuk@numeralsfalse%
- \SetLanguageKeys{ukrainian}{bcp47-extension-u=nu-cyrl}%
- \or
- % cyrillic-trad:
- \cyrillic@numeralstrue%
- \cyrillic@asbuk@numeralsfalse%
- \SetLanguageKeys{ukrainian}{bcp47-extension-u=nu-cyrl}%
- \or
- % cyrillic-alph:
- \cyrillic@numeralstrue%
- \cyrillic@asbuk@numeralstrue%
- \SetLanguageKeys{ukrainian}{bcp47-extension-u=nu-cyrl}%
- \fi
- \xpg@info{Option: Ukrainian, numerals=\xpg@val}%
-}{\xpg@warning{Unknown Ukrainian numerals value `#1'}}
-
-% Define some math functions
-\define@boolkey{ukrainian}[ukrainian@]{mathfunctions}[true]{}
+\DeclareKeys[polyglossia/gloss/ukrainian]
+ {
+ babelshorthands.if = ukrainian@babelshorthands,
+ babelshorthands.default:n = true,
+ mathfunctions.if = ukrainian@mathfunctions,
+ mathfunctions.default:n = true,
+ numerals.choice:,
+ numerals / arabic.code =
+ {%
+ \cyrillic@numeralsfalse
+ \cyrillic@asbuk@numeralsfalse
+ \SetLanguageKeys{ukrainian}{bcp47-extension-u=nu-latn}%
+ },
+ numerals / cyrillic.code =
+ {%
+ \cyrillic@numeralstrue
+ \cyrillic@asbuk@numeralsfalse
+ \SetLanguageKeys{ukrainian}{bcp47-extension-u=nu-cyrl}%
+ },
+ numerals / cyrillic-trad.code =
+ {%
+ \cyrillic@numeralstrue
+ \cyrillic@asbuk@numeralsfalse
+ \SetLanguageKeys{ukrainian}{bcp47-extension-u=nu-cyrl}%
+ },
+ numerals / cyrillic-alph.code =
+ {%
+ \cyrillic@numeralstrue
+ \cyrillic@asbuk@numeralstrue
+ \SetLanguageKeys{ukrainian}{bcp47-extension-u=nu-cyrl}%
+ },
+ numerals.default:n = arabic,
+ numerals/unknown.code = \xpg@warning{Unknown Ukrainian numerals value `#1'}
+ }
% Register default options
-\xpg@initialize@gloss@options{ukrainian}{numerals=arabic,mathfunctions=true}
-
-\define@boolkey{ukrainian}[ukrainian@]{babelshorthands}[true]{}
+\InitializeGlossOptions{ukrainian}{numerals=arabic,mathfunctions=true}
\ifsystem@babelshorthands
- \setkeys{ukrainian}{babelshorthands=true}
+ \SetGlossOptions{ukrainian}{babelshorthands=true}
\else
- \setkeys{ukrainian}{babelshorthands=false}
+ \SetGlossOptions{ukrainian}{babelshorthands=false}
\fi
-\ifcsundef{initiate@active@char}{%
- \input{babelsh.def}%
- \initiate@active@char{"}%
- \shorthandoff{"}%
-}{}
+\InitializeBabelShorthands
\def\ukrainian@shorthands{%
\xpg@activate@shorthands%
@@ -27862,13 +27875,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-uppersorbian.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-uppersorbian.ldf}[polyglossia: module for Upper Sorbian]
% We provide this as a babel alias
-\xpg@load@master@language{sorbian}
+\InheritGlossFile{sorbian}
% \end{macrocode}
% \iffalse
@@ -27879,7 +27892,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-urdu.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
%%% Adapted from a file contributed by Kamal Abdali
\ProvidesFile{gloss-urdu.ldf}[polyglossia: module for Urdu]
@@ -27906,52 +27919,46 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\setlanguagealias*{urdu}{ur}
\newif\if@western@numerals
-\define@choicekey*+{urdu}{numerals}[\xpg@val\xpg@nr]{eastern,western}[eastern]{%
- \ifcase\xpg@nr\relax
- % eastern:
- \@western@numeralsfalse%
- \SetLanguageKeys{urdu}{bcp47-extension-u=nu-arab}%
- \or
- % western:
- \@western@numeralstrue%
- \SetLanguageKeys{urdu}{bcp47-extension-u=nu-latn}%
- \fi
- \xpg@info{Option: Urdu, numerals=\xpg@val}%
-}{\xpg@warning{Unknown Urdu numerals option `#1'}}
-
\newif\ifurdu@customsep\urdu@customsepfalse
\def\xpg@sepmark{}
-\define@key{urdu}{sectionsep}[.]{%
- \urdu@customseptrue%
- \gdef\xpg@sepmark{#1}%
-}
-
-%this is needed for \abjad in arabicnumbers.sty
-\define@boolkey{urdu}[urdu@]{abjadjimnotail}[true]{%
- \ifurdu@abjadjimnotail
- \abjad@jim@notailtrue%
- \else
- \abjad@jim@notailfalse
- \fi%
-}
-
\newif\if@hijrical
-\define@choicekey*+{urdu}{calendar}[\xpg@val\xpg@nr]{gregorian,hijri}[gregorian]{%
- \ifcase\xpg@nr\relax
- % gregorian:
- \@hijricalfalse
- \or
- % hijri:
- \@hijricaltrue
- \fi
- \xpg@info{Option: Urdu, calendar=\xpg@val}%
-}{\xpg@warning{Unknown Urdu calendar option `#1'}}
-\define@key{urdu}{hijricorrection}[0]{%
- \gdef\urdu@hijri@correction{#1}}%
+\DeclareKeys[polyglossia/gloss/urdu]
+ {
+ abjadjimnotail.if = abjad@jim@notail,
+ abjadjimnotail.default:n = true,
+ sectionsep.code = \gdef\xpg@sepmark{#1}\urdu@customseptrue,
+ sectionsep.default:n = .,
+ hijricorrection.code = \gdef\urdu@hijri@correction{#1},
+ hijricorrection.default:n = 0,
+ calendar.choice:,
+ calendar / gregorian.code =
+ {%
+ \@hijricalfalse
+ },
+ calendar / hijri.code =
+ {%
+ \@hijricaltrue
+ },
+ calendar.default:n = gregorian,
+ calendar/unknown.code = \xpg@warning{Unknown Urdu calendar option `#1'},
+ numerals.choice:,
+ numerals / eastern.code =
+ {%
+ \@western@numeralsfalse
+ \SetLanguageKeys{urdu}{bcp47-extension-u=nu-arab}%
+ },
+ numerals / western.code =
+ {%
+ \@western@numeralstrue
+ \SetLanguageKeys{urdu}{bcp47-extension-u=nu-latn}%
+ },
+ numerals.default:n = eastern,
+ numerals/unknown.code = \xpg@warning{Unknown Urdu numerals option `#1'}
+ }
% This should set the defaults
-\setkeys{urdu}{calendar,numerals,hijricorrection}
+\SetGlossOptions{urdu}{calendar,numerals,hijricorrection}
\def\urdugregmonth#1{\ifcase#1%
\or جنوری\or Ùروری\or مارچ\or اپریل\or مئی\or جون\or جولائی\or اگست\or ستمبر\or اکتوبر\or نومبر\or دسمبر\fi}
@@ -28038,16 +28045,16 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
}
\def\nourdu@xetex@capsformat{%
- \ifcsdef{xpg@save@sepmark}{%
+ \ifcsname xpg@save@sepmark\endcsname%
\SepMark{\xpg@save@sepmark}
- }{}%
+ \fi%
}
\def\urdu@luatex@capsformat{%
%
% change chapter and part headings
\ifurdu@customsep
- \ifcsdef{chapter}{%
+ \ifcsname chapter\endcsname%
\let\xpg@save@thesection\thesection%
\renewcommand*\thesection{\thechapter\xpg@sepmark\@arabic\c@section}
\let\xpg@save@theequation\theequation%
@@ -28059,7 +28066,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\let\xpg@save@thetable\thetable%
\renewcommand*\thetable{%
\ifnum\c@chapter>\z@\thechapter\xpg@sepmark\fi\@arabic\c@table}
- }{}
+ \fi%
\let\xpg@save@thesubsection\thesubsection%
\renewcommand\thesubsection
{\thesection\xpg@sepmark\@arabic\c@subsection}
@@ -28074,30 +28081,30 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
}
\def\nourdu@luatex@capsformat{%
- \ifcsdef{xpg@save@thesection}{%
+ \ifcsname xpg@save@thesection\endcsname%
\let\thesection\xpg@save@thesection%
- }{}%
- \ifcsdef{xpg@save@theequation}{%
+ \fi%
+ \ifcsname xpg@save@theequation\endcsname%
\let\theequation\xpg@save@theequation%
- }{}%
- \ifcsdef{xpg@save@thefigure}{%
+ \fi%
+ \ifcsname xpg@save@thefigure\endcsname%
\let\thefigure\xpg@save@thefigure%
- }{}%
- \ifcsdef{xpg@save@thetable}{%
+ \fi%
+ \ifcsname xpg@save@thetable\endcsname%
\let\thetable\xpg@save@thetable%
- }{}%
- \ifcsdef{xpg@save@thesubsection}{%
+ \fi%
+ \ifcsname xpg@save@thesubsection\endcsname%
\let\thesubsection\xpg@save@thesubsection%
- \ifcsdef{xpg@save@thesubsubsection}{%
+ \ifcsname xpg@save@thesubsubsection\endcsname%
\let\thesubsubsection\xpg@save@thesubsubsection%
- }{}%
- }{}%
- \ifcsdef{xpg@save@theparagraph}{%
+ \fi%
+ \fi%
+ \ifcsname xpg@save@theparagraph\endcsname%
\let\theparagraph\xpg@save@theparagraph%
- }{}%
- \ifcsdef{xpg@save@thesubparagraph}{%
+ \fi%
+ \ifcsname xpg@save@thesubparagraph\endcsname%
\let\thesubparagraph\xpg@save@thesubparagraph%
- }{}%
+ \fi%
}
\def\blockextras@urdu{%
@@ -28129,14 +28136,14 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-usorbian.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-usorbian.ldf}[polyglossia: module for Upper Sorbian]
% We only provide this gloss for babel compatibility. Since usorbian is
% a sorbian variety, we use 'sorbian' with variant 'upper' now.
-\xpg@load@master@language{sorbian}
+\InheritGlossFile{sorbian}
% \end{macrocode}
% \iffalse
@@ -28147,7 +28154,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-uyghur.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-uyghur.ldf}[polyglossia: module for Uyghur]
%% Translations provided by Osman Tursun (Github Account: neouyghur)
@@ -28171,62 +28178,72 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\newif\if@uyghur@swapcaptions
\newif\if@uyghur@swapheadings
\newif\if@uyghur@swapheaders
-\define@choicekey*+{uyghur}{swapstrings}[\xpg@val\xpg@nr]{all,captions,headings,headers,hheaders,none}[all]{%
- \ifcase\xpg@nr\relax
- % all:
- \@uyghur@swapcaptionstrue%
- \@uyghur@swapheadingstrue%
- \@uyghur@swapheaderstrue%
- \or
- % captions:
- \@uyghur@swapcaptionstrue%
- \@uyghur@swapheadingsfalse%
- \@uyghur@swapheadersfalse%
- \or
- % headings:
- \@uyghur@swapcaptionsfalse%
- \@uyghur@swapheadingstrue%
- \@uyghur@swapheadersfalse%
- \or
- % headers:
- \@uyghur@swapcaptionsfalse%
- \@uyghur@swapheadingsfalse%
- \@uyghur@swapheaderstrue%
- \or
- % hheaders:
- \@uyghur@swapcaptionsfalse%
- \@uyghur@swapheadingstrue%
- \@uyghur@swapheaderstrue%
- \or
- % none:
- \@uyghur@swapcaptionsfalse%
- \@uyghur@swapheadingsfalse%
- \@uyghur@swapheadersfalse%
- \fi
- \xpg@info{Option: Uyghur, swapstrings=\xpg@val}%
-}{\xpg@warning{Unknown Uyghur swapstrings value `#1'}}
-
\newif\if@uyghur@ordchapter
\newif\if@uyghur@romchapter
-\define@choicekey*+{uyghur}{chapterformat}[\xpg@val\xpg@nr]{ordinal,roman,arabic}[ordinal]{%
- \ifcase\xpg@nr\relax
- % ordinal:
- \@uyghur@ordchaptertrue%
- \@uyghur@romchapterfalse%
- \or
- % roman:
- \@uyghur@ordchapterfalse%
- \@uyghur@romchaptertrue%
- \or
- % arabic:
- \@uyghur@ordchapterfalse%
- \@uyghur@romchapterfalse%
- \fi
- \xpg@info{Option: Uyghur, chapterformat=\xpg@val}%
-}{\xpg@warning{Unknown Uyghur chapterformat value `#1'}}
+
+\DeclareKeys[polyglossia/gloss/uyghur]
+ {
+ chapterformat.choice:,
+ chapterformat / ordinal.code =
+ {%
+ \@uyghur@ordchaptertrue
+ \@uyghur@romchapterfalse
+ },
+ chapterformat / roman.code =
+ {%
+ \@uyghur@ordchapterfalse
+ \@uyghur@romchaptertrue
+ },
+ chapterformat / arabic.code =
+ {%
+ \@uyghur@ordchapterfalse
+ \@uyghur@romchapterfalse
+ },
+ chapterformat.default:n = ordinal,
+ chapterformat/unknown.code = \xpg@warning{Unknown Uyghur chapterformat value `#1'},
+ swapstrings.choice:,
+ swapstrings / all.code =
+ {%
+ \@uyghur@swapcaptionstrue
+ \@uyghur@swapheadingstrue
+ \@uyghur@swapheaderstrue
+ },
+ swapstrings / captions.code =
+ {%
+ \@uyghur@swapcaptionstrue
+ \@uyghur@swapheadingsfalse
+ \@uyghur@swapheadersfalse
+ },
+ swapstrings / headings.code =
+ {%
+ \@uyghur@swapcaptionsfalse
+ \@uyghur@swapheadingstrue
+ \@uyghur@swapheadersfalse
+ },
+ swapstrings / headers.code =
+ {%
+ \@uyghur@swapcaptionsfalse
+ \@uyghur@swapheadingsfalse
+ \@uyghur@swapheaderstrue
+ },
+ swapstrings / hheaders.code =
+ {%
+ \@uyghur@swapcaptionsfalse
+ \@uyghur@swapheadingstrue
+ \@uyghur@swapheaderstrue
+ },
+ swapstrings / none.code =
+ {%
+ \@uyghur@swapcaptionsfalse
+ \@uyghur@swapheadingsfalse
+ \@uyghur@swapheadersfalse
+ },
+ swapstrings.default:n = all,
+ swapstrings/unknown.code = \xpg@warning{Unknown Uyghur swapstrings value `#1'}
+ }
% Register default options
-\xpg@initialize@gloss@options{uyghur}{swapstrings=all,chapterformat=ordinal}
+\InitializeGlossOptions{uyghur}{swapstrings=all,chapterformat=ordinal}
\def\captionsuyghur{%
@@ -28274,120 +28291,104 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
% change chapter and part headings
\if@uyghur@swapheadings
% With titlesec
- \ifcsdef{titleformat}{%
- \ifcsdef{H@old@part}{% Hyperref
- \let\xpg@save@part@format\H@old@part%
- \patchcmd{\H@old@part}%
- {\partname\nobreakspace\thepart}%
- {\the@uyghur@part\nobreakspace\partname}%
- {}%
- {\xpg@warning{Failed to patch part for Uyghur}}%
- }{% not hyperref
- \ifcsdef{@part}{%
- \let\xpg@save@part@format\@part%
- \patchcmd{\@part}%
- {\partname\nobreakspace\thepart}%
- {\the@uyghur@part\nobreakspace\partname}%
- {}%
- {\xpg@warning{Failed to patch part for Uyghur}}%
- }{}%
- }
- \ifcsdef{chapter}{%
- \titleformat\chapter[display]%
- {\@ifundefined{ttl@fil}{\raggedright}{\ttl@fil}\ttl@fonts\ttl@sizes6}
- {\the@uyghur@chapter\space\@chapapp}{.8\baselineskip}{\ttl@sizes\z@\ttl@passexplicit}
- }{}%
- }{% (not \ifdefined\titleformat)
+ \@ifundefined{titleformat}{%
% With KOMA
- \ifcsdef{sectionformat}{%
- \ifcsdef{partformat}{%
- \let\xpg@save@part@format\partformat%
- \renewcommand{\partformat}{\the@uyghur@part~\partname}%
- }{}%
- \ifcsdef{chapterformat}{%
- \let\xpg@save@chap@format\chapterformat%
- \renewcommand{\chapterformat}{\mbox{\the@uyghur@chapter%
- \IfUsePrefixLine{\nobreakspace\chapapp}{\enskip}}}%
- }{}%
- }{% (not \ifdefined\sectionformat)
+ \@ifundefined{sectionformat}{%
% With memoir
- \ifcsdef{@memptsize}{%
- \ifcsdef{@makechapterhead}{%
- \let\xpg@save@chap@format\@makechapterhead%
- \patchcmd{\@makechapterhead}{\printchaptername \chapternamenum \printchapternum}%
- {\chapnumfont\the@uyghur@chapter\chapternamenum\printchaptername}%
- {}%
- {\xpg@warning{Failed to patch chapter for Uyghur}}%
- }{}%
- \ifcsdef{H@old@part}{% Hyperref
- \let\xpg@save@part@format\H@old@part%
- \patchcmd{\H@old@part}{\printpartname \partnamenum \printpartnum}%
- {\chapnumfont\the@uyghur@part\partnamenum\printpartname}%
- {}%
- {\xpg@warning{Failed to patch part for Uyghur}}%
- }{% not hyperref
- \ifcsdef{@part}{%
- \let\xpg@save@part@format\@part%
- \patchcmd{\@part}{\printpartname \partnamenum \printpartnum}%
- {\chapnumfont\the@uyghur@part\partnamenum\printpartname}%
- {}%
- {\xpg@warning{Failed to patch part for Uyghur}}%
- }{}%
- }%
- }{% (not \ifdefined\@memptsize)
+ \@ifundefined{@memptsize}{%
% With standard classes
- \ifcsdef{@makechapterhead}{%
+ \@ifundefined{@makechapterhead}{}{%
\let\xpg@save@chap@format\@makechapterhead%
\patchcmd{\@makechapterhead}%
{\@chapapp\space \thechapter}%
{\the@uyghur@chapter\space \@chapapp}%
{}%
{\xpg@warning{Failed to patch chapter for Uyghur}}%
- }{}%
- \ifcsdef{H@old@part}{% Hyperref
+ }%
+ \@ifundefined{H@old@part}{% not hyperref
+ \@ifundefined{@part}{}{%
+ \let\xpg@save@part@format\@part%
+ \patchcmd{\@part}%
+ {\partname\nobreakspace\thepart}%
+ {\the@uyghur@part\nobreakspace\partname}%
+ {}%
+ {\@ifundefined{part}{}{\xpg@warning{Failed to patch part for Uyghur}}}%
+ }% (end \ifdefined\@part)
+ }{% Hyperref
\let\xpg@save@part@format\H@old@part%
\patchcmd{\H@old@part}%
{\partname\nobreakspace\thepart}%
{\the@uyghur@part\nobreakspace\partname}%
{}%
{\xpg@warning{Failed to patch part for Uyghur}}%
- }{% not hyperref
- \ifcsdef{@part}{%
- \let\xpg@save@part@format\@part%
- \patchcmd{\@part}%
- {\partname\nobreakspace\thepart}%
- {\the@uyghur@part\nobreakspace\partname}%
- {}%
- {\ifcsdef{part}{\xpg@warning{Failed to patch part for Uyghur}}{}}%
- }{}% (end \ifdefined\@part)
}% (end not hyperref)
- }% (end \ifdefined\@memptsize)
- }% (end \ifdefined\sectionformat)
+ }{% (\ifdefined\@memptsize)
+ \@ifundefined{@makechapterhead}{}{%
+ \let\xpg@save@chap@format\@makechapterhead%
+ \patchcmd{\@makechapterhead}{\printchaptername \chapternamenum \printchapternum}%
+ {\chapnumfont\the@uyghur@chapter\chapternamenum\printchaptername}%
+ {}%
+ {\xpg@warning{Failed to patch chapter for Uyghur}}%
+ }%
+ \@ifundefined{H@old@part}{% not hyperref
+ \@ifundefined{@part}{}{%
+ \let\xpg@save@part@format\@part%
+ \patchcmd{\@part}{\printpartname \partnamenum \printpartnum}%
+ {\chapnumfont\the@uyghur@part\partnamenum\printpartname}%
+ {}%
+ {\xpg@warning{Failed to patch part for Uyghur}}%
+ }%
+ }{% Hyperref
+ \let\xpg@save@part@format\H@old@part%
+ \patchcmd{\H@old@part}{\printpartname \partnamenum \printpartnum}%
+ {\chapnumfont\the@uyghur@part\partnamenum\printpartname}%
+ {}%
+ {\xpg@warning{Failed to patch part for Uyghur}}%
+ }%
+ }% (end \ifdefined\@memptsize)
+ }{% (\ifdefined\sectionformat)
+ \@ifundefined{partformat}{}{%
+ \let\xpg@save@part@format\partformat%
+ \renewcommand{\partformat}{\the@uyghur@part~\partname}%
+ }%
+ \@ifundefined{chapterformat}{}{%
+ \let\xpg@save@chap@format\chapterformat%
+ \renewcommand{\chapterformat}{\mbox{\the@uyghur@chapter%
+ \IfUsePrefixLine{\nobreakspace\chapapp}{\enskip}}}%
+ }%
+ }% (end \ifdefined\sectionformat)
+ }{% (\ifdefined\titleformat)
+ \@ifundefined{H@old@part}{% not hyperref
+ \@ifundefined{@part}{}{%
+ \let\xpg@save@part@format\@part%
+ \patchcmd{\@part}%
+ {\partname\nobreakspace\thepart}%
+ {\the@uyghur@part\nobreakspace\partname}%
+ {}%
+ {\xpg@warning{Failed to patch part for Uyghur}}%
+ }%
+ }{% Hyperref
+ \let\xpg@save@part@format\H@old@part%
+ \patchcmd{\H@old@part}%
+ {\partname\nobreakspace\thepart}%
+ {\the@uyghur@part\nobreakspace\partname}%
+ {}%
+ {\xpg@warning{Failed to patch part for Uyghur}}%
+ }%
+ \@ifundefined{chapter}{}{%
+ \titleformat\chapter[display]%
+ {\@ifundefined{ttl@fil}{\raggedright}{\ttl@fil}\ttl@fonts\ttl@sizes6}
+ {\the@uyghur@chapter\space\@chapapp}{.8\baselineskip}{\ttl@sizes\z@\ttl@passexplicit}
+ }%
}% (end \ifdefined\titleformat)
\fi% (end \if@uyghur@swapheadings)
%
% Change running headers
\if@uyghur@swapheaders
- \ifcsdef{chapterformat}{%
- % With KOMA
- \let\xpg@save@chaptermark@format\chaptermarkformat%
- \renewcommand*\chaptermarkformat{%
- \the@uyghur@chapter\ \IfChapterUsesPrefixLine{\chapapp\enskip}{}}
- }{% (not \ifdefined\chapterformat)
- \ifcsdef{@memptsize}{%
- % With memoir
- \let\xpg@save@chaptermark@format\chaptermark%
- \renewcommand*\chaptermark[1]{%
- \markboth{\memUChead{%
- \ifnum \c@secnumdepth >\m@ne
- \ifbool{@mainmatter}{%
- \the@uyghur@chapter\ \@chapapp\ %
- }{}%
- \fi
- ##1}}{}}%
- }{% (not \ifdefined\@memptsize)
+ \@ifundefined{chapterformat}{%
+ \@ifundefined{@memptsize}{%
% With standard classes
- \ifcsdef{chaptermark}{%
+ \@ifundefined{chaptermark}{}{%
\ifpatchable{\chaptermark}%
{\@chapapp\ \thechapter.}%
{\let\xpg@save@chaptermark@format\chaptermark%
@@ -28397,21 +28398,38 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
{}%
{\xpg@warning{Failed to patch chaptermark for Uyghur}}}%
{}%
- }{}% (end \ifdefined\sectionmark)
- \ifcsdef{sectionmark}{%
- \ifpatchable{\sectionmark}%
- {\thesection.}%
- {\let\xpg@save@sectionmark@format\sectionmark%
- \patchcmd{\sectionmark}%
- {\thesection.}%
- {\thesection}%
- {}%
- {\xpg@warning{Failed to patch sectionmark for Uyghur}}}%
- {}%
- }{}% (end \ifdefined\chaptermark)
+ }% (end \ifdefined\sectionmark)
+ \@ifundefined{sectionmark}{}{%
+ \ifpatchable{\sectionmark}%
+ {\thesection.}%
+ {\let\xpg@save@sectionmark@format\sectionmark%
+ \patchcmd{\sectionmark}%
+ {\thesection.}%
+ {\thesection}%
+ {}%
+ {\xpg@warning{Failed to patch sectionmark for Uyghur}}%
+ }%
+ {}%
+ }% (end \ifdefined\chaptermark)
+ }{% (\ifdefined\@memptsize)
+ % With memoir
+ \let\xpg@save@chaptermark@format\chaptermark%
+ \renewcommand*\chaptermark[1]{%
+ \markboth{\memUChead{%
+ \ifnum \c@secnumdepth >\m@ne
+ \ifbool{@mainmatter}{%
+ \the@uyghur@chapter\ \@chapapp\ %
+ }{}%
+ \fi
+ ##1}}{}}%
}% (end \ifdefined\@memptsize)
+ }{% (\ifdefined\chapterformat)
+ % With KOMA
+ \let\xpg@save@chaptermark@format\chaptermarkformat%
+ \renewcommand*\chaptermarkformat{%
+ \the@uyghur@chapter\ \IfChapterUsesPrefixLine{\chapapp\enskip}{}}
}% (end \ifdefined\chapterformat)
- \fi% (end \if@uyghur@swapheaders)
+ \fi% (end \if@uyghur@swapheaders)
}
\def\nouyghur@capsformat{%
@@ -28421,62 +28439,62 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\let\fnum@figure\xpg@save@fnum@figure%
%
% Reset chapter and part heading
- \ifcsdef{titleformat}{%
+ \@ifundefined{titleformat}{%
+ \@ifundefined{sectionformat}{%
+ % With memoir and standard classes
+ \@ifundefined{xpg@save@part@format}{}{%
+ \@ifundefined{H@old@part}{%
+ \let\@part\xpg@save@part@format%
+ }{%
+ \let\H@old@part\xpg@save@part@format%
+ }%
+ }%
+ \@ifundefined{xpg@save@chap@format}{}{%
+ \let\@makechapterhead\xpg@save@chap@format
+ }%
+ }{%
+ % With KOMA
+ \@ifundefined{xpg@save@part@format}{}{%
+ \let\partformat\xpg@save@part@format
+ }%
+ \@ifundefined{xpg@save@chap@format}{}{%
+ \let\chapterformat\xpg@save@chap@format
+ }%
+ }% (end \ifdefined\sectionformat)
+ }{% (\ifdefined\titleformat)
% With titlesec
- \ifcsdef{xpg@save@part@format}{%
- \ifcsdef{H@old@part}{%
- \let\H@old@part\xpg@save@part@format%
- }{%
+ \@ifundefined{xpg@save@part@format}{}{%
+ \@ifundefined{H@old@part}{%
\let\@part\xpg@save@part@format%
+ }{%
+ \let\H@old@part\xpg@save@part@format%
}%
- }{}%
- \ifcsdef{chapter}{%
+ }%
+ \@ifundefined{chapter}{}{%
\titleformat\chapter[display]%
{\@ifundefined{ttl@fil}{\raggedright}{\ttl@fil}\ttl@fonts\ttl@sizes6}
{\@chapapp\space\thechapter}{.8\baselineskip}{\ttl@sizes\z@\ttl@passexplicit}
- }{}%
- }{% (not \ifdefined\titleformat)
- \ifcsdef{sectionformat}{%
- % With KOMA
- \ifcsdef{xpg@save@part@format}{%
- \let\partformat\xpg@save@part@format
- }{}%
- \ifcsdef{xpg@save@chap@format}{%
- \let\chapterformat\xpg@save@chap@format
- }{}%
- }{%
- % With memoir and standard classes
- \ifcsdef{xpg@save@part@format}{%
- \ifcsdef{H@old@part}{%
- \let\H@old@part\xpg@save@part@format%
- }{%
- \let\@part\xpg@save@part@format%
- }%
- }{}%
- \ifcsdef{xpg@save@chap@format}{%
- \let\@makechapterhead\xpg@save@chap@format
- }{}%
- }% (end \ifdefined\sectionformat)
+ }%
}% (end \ifdefined\titleformat)
%
% Reset headers
- \ifcsdef{chaptermarkformat}{%
- % With KOMA
- \ifcsdef{xpg@save@chaptermark@format}{%
- \let\chaptermarkformat\xpg@save@chaptermark@format%
- }{}%
- }{%
- \ifcsdef{chaptermark}{%
+ \@ifundefined{chaptermarkformat}{%
+ \@ifundefined{chaptermark}{}{%
% With memoir and standard classes
- \ifcsdef{xpg@save@chaptermark@format}{%
+ \@ifundefined{xpg@save@chaptermark@format}{}{%
\let\chaptermark\xpg@save@chaptermark@format%
- }{}%
- }{}% (end \ifdefined\chaptermark)
- \ifcsdef{sectionmark}{%
- \ifcsdef{xpg@save@sectionmark@format}{%
+ }%
+ }% (end \ifdefined\chaptermark)
+ \@ifundefined{sectionmark}{}{%
+ \@ifundefined{xpg@save@sectionmark@format}{}{%
\let\sectionmark\xpg@save@sectionmark@format%
- }{}%
- }{}% (end \ifdefined\sectionmark)
+ }%
+ }% (end \ifdefined\sectionmark)
+ }{%
+ % With KOMA
+ \@ifundefined{xpg@save@chaptermark@format}{}{%
+ \let\chaptermarkformat\xpg@save@chaptermark@format%
+ }%
}% (end \ifdefined\chapterformat)
}
@@ -28512,22 +28530,22 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\let\the@uyghur@chapter\thechapter
\def\uyghur@chapterformat{%
- \ifcsdef{part}{%
+ \@ifundefined{part}{}{%
\if@uyghur@ordchapter%
\renewcommand{\the@uyghur@part}{\uyghurord{part}}%
\fi%
\if@uyghur@romchapter%
\renewcommand{\the@uyghur@part}{\Roman{part}}%
\fi%
- }{}%
- \ifcsdef{chapter}{%
+ }%
+ \@ifundefined{chapter}{}{%
\if@uyghur@ordchapter%
\renewcommand{\the@uyghur@chapter}{\uyghurord{chapter}}%
\fi%
\if@uyghur@romchapter%
\renewcommand{\the@uyghur@chapter}{\Roman{chapter}}%
\fi%
- }{}%
+ }%
}
\def\uyghur@numbers{%
@@ -28588,7 +28606,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-vietnamese.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-vietnamese.ldf}[polyglossia: module for Vietnamese]
%% Strings contributed by Daniel Owens < dhowens . pmbx . net >
@@ -28647,7 +28665,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-welsh.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-welsh.ldf}[polyglossia: module for Welsh]
@@ -28664,21 +28682,26 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
% BCP-47 compliant aliases
\setlanguagealias*{welsh}{cy}
-\providebool{welsh@formaldate}
+\@ifundefined{ifwelsh@formaldate}%
+ {\newif\ifwelsh@formaldate}{}
-\define@choicekey*+{welsh}{date}[\xpg@val\xpg@nr]{long,short}[short]{%
- \ifcase\xpg@nr\relax
- % long:
- \welsh@formaldatetrue
- \or
- % accented:
- \welsh@formaldatefalse
- \fi
- \xpg@info{Option: Welsh, date=\xpg@val}%
-}{\xpg@warning{Unknown date value `#1'}}
+\DeclareKeys[polyglossia/gloss/welsh]
+ {
+ date.choice:,
+ date / long.code =
+ {%
+ \welsh@formaldatetrue
+ },
+ date / short.code =
+ {%
+ \welsh@formaldatefalse
+ },
+ date.default:n = short,
+ date/unknown.code = \xpg@warning{Unknown date value `#1'},
+ }
% Register default options
-\xpg@initialize@gloss@options{welsh}{date=short}
+\InitializeGlossOptions{welsh}{date=short}
\def\captionswelsh{%
\def\refname{Cyfeiriadau}%
@@ -28747,13 +28770,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-zh-CN.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-zh-CN.ldf}[polyglossia: module for zh-CN (Chinese)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{chinese}
+\InheritGlossFile{chinese}
% \end{macrocode}
% \iffalse
@@ -28764,268 +28787,26 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-zh-TW.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-zh-TW.ldf}[polyglossia: module for zh-TW (Chinese)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{chinese}
+\InheritGlossFile{chinese}
% \end{macrocode}
% \iffalse
%</gloss-zh-TW.ldf>
-%<*arabicdigits.map>
-% \fi
-% \clearpage
-%
-% \subsection{arabicdigits.map}
-% \begin{macrocode}
-; FC ...
-LHSName "Digits"
-RHSName "ArabicDigits"
-
-pass(Unicode)
-U+0030 <> U+0660 ;
-U+0031 <> U+0661 ;
-U+0032 <> U+0662 ;
-U+0033 <> U+0663 ;
-U+0034 <> U+0664 ;
-U+0035 <> U+0665 ;
-U+0036 <> U+0666 ;
-U+0037 <> U+0667 ;
-U+0038 <> U+0668 ;
-U+0039 <> U+0669 ;
-
-% \end{macrocode}
-% \iffalse
-%</arabicdigits.map>
-%<*bengalidigits.map>
-% \fi
-% \clearpage
-%
-% \subsection{bengalidigits.map}
-% \begin{macrocode}
-; FC ...
-LHSName "Digits"
-RHSName "BengaliDigits"
-
-pass(Unicode)
-U+0030 <> U+09E6 ;
-U+0031 <> U+09E7 ;
-U+0032 <> U+09E8 ;
-U+0033 <> U+09E9 ;
-U+0034 <> U+09EA ;
-U+0035 <> U+09EB ;
-U+0036 <> U+09EC ;
-U+0037 <> U+09ED ;
-U+0038 <> U+09EE ;
-U+0039 <> U+09EF ;
-
-% \end{macrocode}
-% \iffalse
-%</bengalidigits.map>
-%<*devanagaridigits.map>
-% \fi
-% \clearpage
-%
-% \subsection{devanagaridigits.map}
-% \begin{macrocode}
-; FC ...
-LHSName "Digits"
-RHSName "DevanagariDigits"
-
-pass(Unicode)
-U+0030 <> U+0966 ;
-U+0031 <> U+0967 ;
-U+0032 <> U+0968 ;
-U+0033 <> U+0969 ;
-U+0034 <> U+096A ;
-U+0035 <> U+096B ;
-U+0036 <> U+096C ;
-U+0037 <> U+096D ;
-U+0038 <> U+096E ;
-U+0039 <> U+096F ;
-
-% \end{macrocode}
-% \iffalse
-%</devanagaridigits.map>
-%<*farsidigits.map>
-% \fi
-% \clearpage
-%
-% \subsection{farsidigits.map}
-% \begin{macrocode}
-; FC ...
-LHSName "Digits"
-RHSName "FarsiDigits"
-
-pass(Unicode)
-U+0030 <> U+06F0 ;
-U+0031 <> U+06F1 ;
-U+0032 <> U+06F2 ;
-U+0033 <> U+06F3 ;
-U+0034 <> U+06F4 ;
-U+0035 <> U+06F5 ;
-U+0036 <> U+06F6 ;
-U+0037 <> U+06F7 ;
-U+0038 <> U+06F8 ;
-U+0039 <> U+06F9 ;
-
-% \end{macrocode}
-% \iffalse
-%</farsidigits.map>
-%<*gurmukhidigits.map>
-% \fi
-% \clearpage
-%
-% \subsection{gurmukhidigits.map}
-% \begin{macrocode}
-; FC ...
-LHSName "Digits"
-RHSName "GurmukhiDigits"
-
-pass(Unicode)
-U+0030 <> U+0A66 ;
-U+0031 <> U+0A67 ;
-U+0032 <> U+0A68 ;
-U+0033 <> U+0A69 ;
-U+0034 <> U+0A6A ;
-U+0035 <> U+0A6B ;
-U+0036 <> U+0A6C ;
-U+0037 <> U+0A6D ;
-U+0038 <> U+0A6E ;
-U+0039 <> U+0A6F ;
-
-% \end{macrocode}
-% \iffalse
-%</gurmukhidigits.map>
-%<*odiadigits.map>
-% \fi
-% \clearpage
-%
-% \subsection{odiadigits.map}
-% \begin{macrocode}
-; FC ...
-LHSName "Digits"
-RHSName "OdiaDigits"
-
-pass(Unicode)
-U+0030 <> U+0B66 ;
-U+0031 <> U+0B67 ;
-U+0032 <> U+0B68 ;
-U+0033 <> U+0B69 ;
-U+0034 <> U+0B6A ;
-U+0035 <> U+0B6B ;
-U+0036 <> U+0B6C ;
-U+0037 <> U+0B6D ;
-U+0038 <> U+0B6E ;
-U+0039 <> U+0B6F ;
-
-% \end{macrocode}
-% \iffalse
-%</odiadigits.map>
-%<*thaidigits.map>
-% \fi
-% \clearpage
-%
-% \subsection{thaidigits.map}
-% \begin{macrocode}
-; FC ...
-LHSName "Digits"
-RHSName "ThaiDigits"
-
-pass(Unicode)
-U+0030 <> U+0E50 ;
-U+0031 <> U+0E51 ;
-U+0032 <> U+0E52 ;
-U+0033 <> U+0E53 ;
-U+0034 <> U+0E54 ;
-U+0035 <> U+0E55 ;
-U+0036 <> U+0E56 ;
-U+0037 <> U+0E57 ;
-U+0038 <> U+0E58 ;
-U+0039 <> U+0E59 ;
-
-% \end{macrocode}
-% \iffalse
-%</thaidigits.map>
-%<*polyglossia-french.lua>
-% \fi
-% \clearpage
-%
-% \subsection{polyglossia-french.lua}
-% \begin{macrocode}
---
--- polyglossia-punct.lua
--- part of polyglossia v2.1 -- 2024/03/07
---
-
-require('polyglossia-punct')
-
-local function set_left_space(lang, char, kern, rubber)
- polyglossia.add_left_spaced_character(lang, char, kern, "space", rubber)
-end
-
-local function set_right_space(lang, char, kern, rubber)
- polyglossia.add_right_spaced_character(lang, char, kern, "space", rubber)
-end
-
-local function activate_french_punct(thincolonspace, autospaceguillemets)
- -- We need different language tags here to make switching of options possible
- -- within a paragraph.
- local lang = "french"
- if thincolonspace then
- lang = lang.."-thincolon"
- end
- if autospaceguillemets then
- lang = lang.."-autospace"
- end
-
- polyglossia.activate_punct(lang)
- polyglossia.clear_spaced_characters(lang)
-
- if thincolonspace then
- set_left_space(lang, ':', 0.5)
- else
- set_left_space(lang, ':', 1, true) -- stretchable and shrinkable space
- end
-
- set_left_space(lang, '!', 0.5)
- set_left_space(lang, '?', 0.5)
- set_left_space(lang, ';', 0.5)
- set_left_space(lang, '‼', 0.5)
- set_left_space(lang, 'â‡', 0.5)
- set_left_space(lang, 'âˆ', 0.5)
- set_left_space(lang, 'â‰', 0.5)
- set_left_space(lang, '‽', 0.5) -- U+203D (interrobang)
-
- if autospaceguillemets then
- set_left_space(lang, '»', 0.5)
- set_left_space(lang, '›', 0.5)
- set_right_space(lang, '«', 0.5)
- set_right_space(lang, '‹', 0.5)
- end
-end
-
-local function deactivate_french_punct()
- polyglossia.deactivate_punct()
-end
-
-polyglossia.activate_french_punct = activate_french_punct
-polyglossia.deactivate_french_punct = deactivate_french_punct
-% \end{macrocode}
-% \iffalse
-%</polyglossia-french.lua>
-%<*polyglossia-korean.lua>
+%<*polyglossia-cjk-spacing.lua>
% \fi
% \clearpage
%
-% \subsection{polyglossia-korean.lua}
+% \subsection{polyglossia-cjk-spacing.lua}
% \begin{macrocode}
--
--- polyglossia-korean.lua
--- part of polyglossia v2.1 -- 2024/03/07
+-- polyglossia-cjk-spacing.lua
+-- part of polyglossia v2.2 -- 2024/07/15
--
local glyph_id = node.id"glyph"
@@ -29033,13 +28814,17 @@ local hbox_id = node.id"hlist"
local vbox_id = node.id"vlist"
local glue_id = node.id"glue"
local penalty_id = node.id"penalty"
-local disc_id = node.id"disc"
+local whatsit_id = node.id"whatsit"
+local math_id = node.id"math"
--
--- attr_korean: variant = plain (0), classic (1), modern (2)
+-- attr_cjk: variant = plain: 0, JP/classic: 1, KR/modern: 2, SC: 3, TC: 4
+--
+local attr_cjk = luatexbase.attributes["xpg@attr@cjkspacing"]
+--
+-- attr_josa: ONLY For Korean. DO NOT declare \newattribute for other langs
--
-local attr_korean = luatexbase.attributes["xpg@attr@korean"]
-local attr_josa = luatexbase.attributes["xpg@attr@autojosa"]
+local attr_josa = luatexbase.attributes["xpg@attr@autojosa"]
--
-- characters after which linebreak is not allowed
@@ -29088,9 +28873,9 @@ local nobr_after = {
-- characters before which linebreak is not allowed
-- (currently, not much differences among the followings)
-- 1: normal chars
--- 2: hangul jamo vowels and trailing consonants
+-- 2: hangul jamo vowels and trailing consonants plus combinings
-- 3: kana small letters
--- 0: dashes (supress visible spacing)
+-- 0: dashes (suppress visible spacing after this char)
--
local nobr_before = setmetatable({
[0x21] = 1, -- ! EXCLAMATION MARK
@@ -29101,7 +28886,7 @@ local nobr_before = setmetatable({
[0x2D] = 0, -- - HYPHEN-MINUS
[0x2E] = 1, -- . FULL STOP
[0x2F] = 0, -- / SOLIDUS
- [0x3A] = 0, -- : COLON
+ [0x3A] = 1, -- : COLON
[0x3B] = 1, -- ; SEMICOLON
[0x3E] = 1, -- > GREATER-THAN SIGN
[0x3F] = 1, -- ? QUESTION MARK
@@ -29113,11 +28898,11 @@ local nobr_before = setmetatable({
[0xBB] = 1, -- » RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
[0x2013] = 0, -- – EN DASH
[0x2014] = 0, -- — EM DASH
- [0x2015] = 1, -- ― HORIZONTAL BAR
+ [0x2015] = 0, -- ― HORIZONTAL BAR
[0x2019] = 1, -- ’ RIGHT SINGLE QUOTATION MARK
[0x201D] = 1, -- †RIGHT DOUBLE QUOTATION MARK
- [0x2025] = 1, -- ‥ TWO DOT LEADER
- [0x2026] = 1, -- … HORIZONTAL ELLIPSIS
+ [0x2025] = 0, -- ‥ TWO DOT LEADER
+ [0x2026] = 0, -- … HORIZONTAL ELLIPSIS
[0x232A] = 1, -- 〉 RIGHT-POINTING ANGLE BRACKET
[0x3001] = 1, -- 〠IDEOGRAPHIC COMMA
[0x3002] = 1, -- 。 IDEOGRAPHIC FULL STOP
@@ -29149,10 +28934,10 @@ local nobr_before = setmetatable({
[0x308E] = 3, -- ã‚Ž HIRAGANA LETTER SMALL WA
[0x3095] = 3, -- ã‚• HIRAGANA LETTER SMALL KA
[0x3096] = 3, -- ã‚– HIRAGANA LETTER SMALL KE
- [0x3099] = 1, -- COMBINING KATAKANA-HIRAGANA VOICED SOUND MARK
- [0x309A] = 1, -- COMBINING KATAKANA-HIRAGANA SEMI-VOICED SOUND MARK
- [0x309B] = 1, -- ã‚› KATAKANA-HIRAGANA VOICED SOUND MARK
- [0x309C] = 1, -- ゜ KATAKANA-HIRAGANA SEMI-VOICED SOUND MARK
+ [0x3099] = 2, -- COMBINING KATAKANA-HIRAGANA VOICED SOUND MARK
+ [0x309A] = 2, -- COMBINING KATAKANA-HIRAGANA SEMI-VOICED SOUND MARK
+ [0x309B] = 2, -- ã‚› KATAKANA-HIRAGANA VOICED SOUND MARK
+ [0x309C] = 2, -- ゜ KATAKANA-HIRAGANA SEMI-VOICED SOUND MARK
[0x309D] = 1, -- ã‚ HIRAGANA ITERATION MARK
[0x309E] = 1, -- ã‚ž HIRAGANA VOICED ITERATION MARK
[0x30A0] = 1, -- ã‚  KATAKANA-HIRAGANA DOUBLE HYPHEN
@@ -29172,9 +28957,9 @@ local nobr_before = setmetatable({
[0x30FC] = 1, -- ー KATAKANA-HIRAGANA PROLONGED SOUND MARK
[0x30FD] = 1, -- ヽ KATAKANA ITERATION MARK
[0x30FE] = 1, -- ヾ KATAKANA VOICED ITERATION MARK
- [0xFE30] = 1, -- ︰ PRESENTATION FORM FOR VERTICAL TWO DOT LEADER
- [0xFE31] = 1, -- ︱ PRESENTATION FORM FOR VERTICAL EM DASH
- [0xFE32] = 1, -- ︲ PRESENTATION FORM FOR VERTICAL EN DASH
+ [0xFE30] = 0, -- ︰ PRESENTATION FORM FOR VERTICAL TWO DOT LEADER
+ [0xFE31] = 0, -- ︱ PRESENTATION FORM FOR VERTICAL EM DASH
+ [0xFE32] = 0, -- ︲ PRESENTATION FORM FOR VERTICAL EN DASH
[0xFE36] = 1, -- ︶ PRESENTATION FORM FOR VERTICAL RIGHT PARENTHESIS
[0xFE38] = 1, -- ︸ PRESENTATION FORM FOR VERTICAL RIGHT CURLY BRACKET
[0xFE3A] = 1, -- ︺ PRESENTATION FORM FOR VERTICAL RIGHT TORTOISE SHELL BRACKET
@@ -29201,18 +28986,18 @@ local nobr_before = setmetatable({
[0xFF63] = 1, -- ï½£ HALFWIDTH RIGHT CORNER BRACKET
[0xFF64] = 1, -- 、 HALFWIDTH IDEOGRAPHIC COMMA
[0xFF65] = 1, -- ï½¥ HALFWIDTH KATAKANA MIDDLE DOT
- [0xFF9E] = 1, -- ゙ HALFWIDTH KATAKANA VOICED SOUND MARK
- [0xFF9F] = 1, -- ゚ HALFWIDTH KATAKANA SEMI-VOICED SOUND MARK
+ [0xFF9E] = 2, -- ゙ HALFWIDTH KATAKANA VOICED SOUND MARK
+ [0xFF9F] = 2, -- ゚ HALFWIDTH KATAKANA SEMI-VOICED SOUND MARK
}, { __index = function(_,c)
if c >= 0x1160 and c <= 0x11FF then return 2 end
if c >= 0xD7B0 and c <= 0xD7FF then return 2 end
- if c >= 0x302A and c <= 0x302F then return 1 end
+ if c >= 0x302A and c <= 0x302F then return 2 end -- tone marks
if c >= 0x31F0 and c <= 0x31FF then return 3 end
if c >= 0xFF67 and c <= 0xFF70 then return 3 end
- if c >= 0xFE00 and c <= 0xFE0F then return 1 end
+ if c >= 0xFE00 and c <= 0xFE0F then return 2 end -- variation selectors
if c >= 0xFE10 and c <= 0xFE19 and not (c == 0xFE17) then return 1 end
if c >= 0xFE50 and c <= 0xFE58 then return 1 end
- if c >= 0xE0100 and c <= 0xE01EF then return 1 end
+ if c >= 0xE0100 and c <= 0xE01EF then return 2 end -- variation selecters
end
})
@@ -29230,6 +29015,7 @@ local function is_cjk (c)
or c >= 0xFF00 and c <= 0xFFEF
or c >= 0x1F100 and c <= 0x1F2FF
or c >= 0x20000 and c <= 0x2FA1F
+ or c >= 0x30000 and c <= 0x323AF
or nobr_after[c] and c > 0x2014
or nobr_before[c] and c > 0x2014
end
@@ -29269,8 +29055,28 @@ local charclass = setmetatable({
}, { __index = function() return 0 end })
--
+-- get character class
+-- var : variant = plain, JP/classic, KR/modern, SC, TC
+-- c : codepoint
+--
+local function get_charclass (var, c)
+ if var < 3 then
+ return charclass[c]
+ elseif var == 3 then
+ -- SC : these are left aligned
+ return (c == 0xFF01 or c == 0xFF1F) and 4 -- FULLWIDTH EXCLAMATION/QUESTION MARK
+ or (c == 0xFF1A or c == 0xFF1B) and 2 -- FULLWIDTH COLON/SEMICOLON
+ or charclass[c]
+ end
+ -- TC : these are center aligned
+ return (c == 0x3001 or c == 0xFF0C) and 3 -- IDEOGRAPHIC/FULLWIDTH COMMA
+ or (c == 0x3002 or c == 0xFF0E) and 3 -- IDEOGRAPHIC/FULLWIDTH FULL STOP -- 5 ?
+ or charclass[c]
+end
+
+--
-- table for spacing between char classes
--- 1 stands for 0.5*fontsize when variant=classic
+-- 1 stands for 0.5*fontsize when variant = JP/classic or SC or TC
--
local intercharclass = { [0] =
{ [0] = nil, {1,1}, nil, {.5,.5} },
@@ -29302,7 +29108,7 @@ end
--
-- return 0.5*fontsize of given fontid
--- space: true if variant=modern; then 0.5*interword_space
+-- space: true if variant=KR/modern; then 0.5*interword_space
--
local function get_font_size (fid, space)
local size = font.getparameters(fid)
@@ -29316,7 +29122,7 @@ end
--
-- charclass 1 thru 4 will be packed in \hbox to 0.5em{\hss? curr \hss?}
--- when variant=classic/modern
+-- when variant ~= plain
--
local function glyph_to_box (head, curr, class)
local g, h = curr
@@ -29345,7 +29151,7 @@ end
--
-- insert spacing defined as charclass[a][b] between a and b
-- f: fontid
--- var: variant = plain, classic, modern
+-- var: variant = plain, JP/classic, KR/modern, SC, TC
-- cc: charclass of current char
-- nc: charclass of next char
-- nobr: linebreak is not allowed
@@ -29364,12 +29170,16 @@ end
--
-- insert inter-character spacing in other normal cases
--- f: fontid
--- var: variant = plain, classic, modern
--- x: true between cjk and non-cjk (a little more spacing)
+-- f: fontid
+-- var: variant = plain, JP/classic, KR/modern, SC, TC
+-- nobr: no linebreak
+-- x: true between cjk and non-cjk (a little more spacing)
--
-local function insert_penalty_glue (head, curr, f, var, x)
- if var ~= 1 then
+local function insert_penalty_glue (head, curr, f, var, nobr, x)
+ if nobr then
+ local penalty = get_new_penalty(10000)
+ head, curr = node.insert_after(head, curr, penalty)
+ elseif var == 0 or var == 2 then
local penalty = get_new_penalty(50)
head, curr = node.insert_after(head, curr, penalty)
end
@@ -29385,53 +29195,64 @@ end
--
-- main process for linebreak and inter-character spacing
--- lb: true if pre_linebreak_filter
--
-local function korean_break (head, lb)
+local function cjk_break (head)
local curr = head
while curr do
- if curr.id == glyph_id then
- local var = node.has_attribute(curr, attr_korean)
+ if attr_cjk and (curr.id == glyph_id or curr.id == math_id and curr.subtype == 1) then
+ local var = node.has_attribute(curr, attr_cjk)
if var then
- local c, f = curr.char or 0, curr.font or 0
- local cc, cjkc = charclass[c], is_cjk(c)
+ local c, f = curr.char or 0, curr.font
+ local cc, cjkc = get_charclass(var, c), is_cjk(c)
-- compress cjk punctuations when charclass is 1 thru 4
if var > 0 and cc > 0 and cc < 5 then
head, curr = glyph_to_box(head, curr, cc)
end
- local next = curr.next
- if next and next.id == glyph_id then
+ local next = node.getnext(curr)
+ while next and next.id == whatsit_id do -- skip whatsit nodes
+ curr, next = next, node.getnext(next)
+ end
+
+ if next and (next.id == glyph_id or next.id == math_id and next.subtype == 0) then
local n = next.char or 0
- local nc = charclass[n]
+ f = f or next.font or 0 -- in case of curr == math_off
+
+ -- skip combining. or dash+dash case to suppress stretching
+ if nobr_before[n] == 2 or (nobr_before[c] == 0 and nobr_before[n] == 0) then
+ goto skip_combining
+ end
+
+ local nc = get_charclass(var, n)
local nobr = nobr_before[n] or nobr_after[c]
-- insert spacing as of intercharclass
if var > 0 and intercharclass[cc][nc] then
head, curr = insert_cjk_penalty_glue(head, curr, f, var, cc, nc, nobr)
- -- or insert spacing when linebreak is allowed
- elseif not nobr then
+ else
local cjkn = is_cjk(n)
-- if curr or next is cjk char
if cjkc or cjkn then
- -- if between cjk and non-cjk
- if var > 0 and not (cjkc and cjkn) and nobr_before[c] ~= 0 then
- head, curr = insert_penalty_glue(head, curr, f, var, true)
+ -- plain variant / cjk+cjk / nobr cjk+noncjk / after dash
+ -- : insert a 0pt glue
+ if var == 0 or (cjkc and cjkn) or nobr or nobr_before[c] == 0 then
+ head, curr = insert_penalty_glue(head, curr, f, var, nobr)
- -- or under pre_linebreak_filter
- elseif lb then
- head, curr = insert_penalty_glue(head, curr, f, var)
+ -- other cases: insert a small glue
+ else
+ head, curr = insert_penalty_glue(head, curr, f, var, nobr, true)
end
end
end
end
end
end
- curr = curr.next
+ ::skip_combining::
+ curr = node.getnext(curr)
end
return head
end
@@ -29445,7 +29266,7 @@ end
local function reorder_tm (head)
local curr, tone = node.slide(head)
while curr do
- if curr.id == glyph_id and node.has_attribute(curr, attr_korean) then
+ if curr.id == glyph_id and node.has_attribute(curr, attr_cjk) then
local f = font.getfont(curr.font) or font.fonts[curr.font]
if f and f.hb then -- harfbuzz do the right thing
tone = nil
@@ -29461,7 +29282,7 @@ local function reorder_tm (head)
end
end
end
- curr = curr.prev
+ curr = node.getprev(curr)
end
return head
end
@@ -29548,7 +29369,7 @@ local function get_prev_char (p)
local pc = get_prev_char(node.slide(p.head))
if pc then return pc end
end
- p = p.prev
+ p = node.getprev(p)
end
end
@@ -29563,10 +29384,10 @@ local function auto_josa (head)
if josa then
local cc = curr.char or 0
if josa == 0 then
- josa = josa_code[get_prev_char(curr.prev) or 0x30]
+ josa = josa_code[get_prev_char(node.getprev(curr)) or 0x30]
end
if cc == 0xC774 then
- local n = curr.next
+ local n = node.getnext(curr)
if n and n.char and n.char >= 0xAC00 and n.char <= 0xD7A3 then
else
cc = 0xAC00
@@ -29585,7 +29406,7 @@ local function auto_josa (head)
node.unset_attribute(curr, attr_josa)
end
end
- curr = curr.next
+ curr = node.getnext(curr)
end
for _,v in ipairs(tofree) do node.free(v) end
return head
@@ -29596,45 +29417,86 @@ end
-- As char value of glyphs can be changed by opentype GSUB process,
-- we have to occupy the first position among callback functions.
--
-local prepend_to_callback
-if luatexbase.base_add_to_callback then
- prepend_to_callback = function(name, func, desc)
- luatexbase.add_to_callback(name, func, desc, 1)
+luatexbase.add_to_callback( "pre_shaping_filter",
+function(head)
+ if attr_josa then head = auto_josa(head) end
+ head = cjk_break(head)
+ if attr_josa then head = reorder_tm(head) end
+ return head
+end,
+"polyglossia.lang_cjk_spacing")
+
+-- vim:ft=lua:tw=0:sw=4:ts=4:expandtab
+% \end{macrocode}
+% \iffalse
+%</polyglossia-cjk-spacing.lua>
+%<*polyglossia-french.lua>
+% \fi
+% \clearpage
+%
+% \subsection{polyglossia-french.lua}
+% \begin{macrocode}
+--
+-- polyglossia-punct.lua
+-- part of polyglossia v2.2 -- 2024/07/15
+--
+
+require('polyglossia-punct')
+
+local function set_left_space(lang, char, kern, rubber)
+ polyglossia.add_left_spaced_character(lang, char, kern, "space", rubber)
+end
+
+local function set_right_space(lang, char, kern, rubber)
+ polyglossia.add_right_spaced_character(lang, char, kern, "space", rubber)
+end
+
+local function activate_french_punct(thincolonspace, autospaceguillemets)
+ -- We need different language tags here to make switching of options possible
+ -- within a paragraph.
+ local lang = "french"
+ if thincolonspace then
+ lang = lang.."-thincolon"
end
-else
- prepend_to_callback = function(name, func, desc)
- local t = { {func, desc} }
- for _,v in ipairs(luatexbase.callback_descriptions(name)) do
- table.insert(t, {luatexbase.remove_from_callback(name, v)})
- end
- for _,v in ipairs(t) do
- luatexbase.add_to_callback(name, v[1], v[2])
- end
+ if autospaceguillemets then
+ lang = lang.."-autospace"
+ end
+
+ polyglossia.activate_punct(lang)
+ polyglossia.clear_spaced_characters(lang)
+
+ if thincolonspace then
+ set_left_space(lang, ':', 0.5)
+ else
+ set_left_space(lang, ':', 1, true) -- stretchable and shrinkable space
+ end
+
+ set_left_space(lang, '!', 0.5)
+ set_left_space(lang, '?', 0.5)
+ set_left_space(lang, ';', 0.5)
+ set_left_space(lang, '‼', 0.5)
+ set_left_space(lang, 'â‡', 0.5)
+ set_left_space(lang, 'âˆ', 0.5)
+ set_left_space(lang, 'â‰', 0.5)
+ set_left_space(lang, '‽', 0.5) -- U+203D (interrobang)
+
+ if autospaceguillemets then
+ set_left_space(lang, '»', 0.5)
+ set_left_space(lang, '›', 0.5)
+ set_right_space(lang, '«', 0.5)
+ set_right_space(lang, '‹', 0.5)
end
end
-prepend_to_callback ("pre_linebreak_filter",
- function(head)
- head = auto_josa(head)
- head = korean_break(head, true)
- head = reorder_tm(head)
- return head
- end,
- "polyglossia.lang_korean")
-
-prepend_to_callback ("hpack_filter",
- function(head)
- head = auto_josa(head)
- head = korean_break(head)
- head = reorder_tm(head)
- return head
- end,
- "polyglossia.lang_korean")
+local function deactivate_french_punct()
+ polyglossia.deactivate_punct()
+end
--- vim:ft=lua:tw=0:sw=4:ts=4:expandtab
+polyglossia.activate_french_punct = activate_french_punct
+polyglossia.deactivate_french_punct = deactivate_french_punct
% \end{macrocode}
% \iffalse
-%</polyglossia-korean.lua>
+%</polyglossia-french.lua>
%<*polyglossia-latin.lua>
% \fi
% \clearpage
@@ -29643,7 +29505,7 @@ prepend_to_callback ("hpack_filter",
% \begin{macrocode}
--
-- polyglossia-latin.lua
--- part of polyglossia v2.1 -- 2024/03/07
+-- part of polyglossia v2.2 -- 2024/07/15
--
require('polyglossia-punct')
@@ -29698,14 +29560,13 @@ polyglossia.deactivate_latin_punct = deactivate_latin_punct
% \begin{macrocode}
--
-- polyglossia-punct.lua
--- part of polyglossia v2.1 -- 2024/03/07
+-- part of polyglossia v2.2 -- 2024/07/15
--
require('polyglossia') -- just in case...
local add_to_callback = luatexbase.add_to_callback
-local remove_from_callback = luatexbase.remove_from_callback
-local priority_in_callback = luatexbase.priority_in_callback
+local declare_callback_rule = luatexbase.declare_callback_rule
local new_attribute = luatexbase.new_attribute
local node = node
@@ -30029,13 +29890,16 @@ local function activate(lang)
-- important to be able to intermix languages with different spacings
-- in one paragraph.
tex.setattribute(punct_attr, id)
- for _, callback_name in ipairs{ "pre_linebreak_filter", "hpack_filter" } do
- if not priority_in_callback(callback_name, "polyglossia-punct.process") then
- add_to_callback(callback_name, process, "polyglossia-punct.process", 1)
- end
- end
end
+add_to_callback("pre_linebreak_filter",process,"polyglossia-punct.process")
+add_to_callback("hpack_filter",process,"polyglossia-punct.process")
+declare_callback_rule("pre_linebreak_filter",
+ "polyglossia-punct.process", "before", "luaotfload.node_processor")
+declare_callback_rule("hpack_filter",
+ "polyglossia-punct.process", "before", "luaotfload.node_processor")
+
+
local function deactivate()
tex.setattribute(punct_attr, -0x7FFFFFFF) -- this value means "unset"
-- Though it would make compilation slightly faster, it is not possible to
@@ -30066,7 +29930,7 @@ polyglossia.clear_spaced_characters = clear_spaced_characters
% \begin{macrocode}
--
-- polyglossia-sanskrit.lua
--- part of polyglossia v2.1 -- 2024/03/07
+-- part of polyglossia v2.2 -- 2024/07/15
--
require('polyglossia-punct')
@@ -30116,31 +29980,29 @@ polyglossia.deactivate_sanskrit_punct = deactivate_sanskrit_punct
% \begin{macrocode}
--
-- polyglossia-tibt.lua
--- part of polyglossia v2.1 -- 2024/03/07
+-- part of polyglossia v2.2 -- 2024/07/15
--
require('polyglossia') -- just in case...
local add_to_callback = luatexbase.add_to_callback
local remove_from_callback = luatexbase.remove_from_callback
+local declare_callback_rule = luatexbase.declare_callback_rule
local priority_in_callback = luatexbase.priority_in_callback
local next, type = next, type
-
-local nodes, fonts, node = nodes, fonts, node
-
-local nodecodes = nodes.nodecodes --- <= preloaded node.types()
+local node = node
local insert_node_before = node.insert_before
local insert_node_after = node.insert_after
-local remove_node = nodes.remove
+local remove_node = node.remove
local copy_node = node.copy
local has_attribute = node.has_attribute
local end_of_math = node.end_of_math
if not end_of_math then -- luatex < .76
local traverse_nodes = node.traverse_id
- local math_code = nodecodes.math
+ local math_code = node.id('math_char')
local end_of_math = function (n)
for n in traverse_nodes(math_code, n.next) do
return n
@@ -30148,10 +30010,10 @@ if not end_of_math then -- luatex < .76
end
end
--- node types as of April 2013
-local glyph_code = nodecodes.glyph
-local penalty_code = nodecodes.penalty
-local kern_code = nodecodes.kern
+-- node types as of April 2024
+local glyph_code = node.id('glyph')
+local penalty_code = node.id('penalty')
+local kern_code = node.id('kern')
-- we make a new node, so that we can copy it later on
local penalty_node = node.new(penalty_code)
@@ -30182,7 +30044,6 @@ local function process(head)
end
end
elseif id == math_code then
- -- warning: this is a feature of luatex > 0.76
start = end_of_math(start) -- weird, can return nil .. no math end?
end
if start then
@@ -30195,15 +30056,13 @@ end
local callback_name = "pre_linebreak_filter"
local function activate()
- if not priority_in_callback (callback_name, "polyglossia-tibt.process") then
- add_to_callback(callback_name, process, "polyglossia-tibt.process", 1)
- end
+ add_to_callback(callback_name, process, "polyglossia-tibt.process")
+ declare_callback_rule(callback_name,
+ "polyglossia-tibt.process", "before", "luaotfload.node_processor")
end
local function desactivate()
- if priority_in_callback (callback_name, "polyglossia-tibt.process") then
- remove_from_callback(callback_name, "polyglossia-tibt.process")
- end
+ remove_from_callback(callback_name, "polyglossia-tibt.process")
end
polyglossia.activate_tibt_eol = activate
@@ -30219,7 +30078,7 @@ polyglossia.desactivate_tibt_eol = desactivate
% \begin{macrocode}
--
-- polyglossia.lua
--- part of polyglossia v2.1 -- 2024/03/07
+-- part of polyglossia v2.2 -- 2024/07/15
--
local module_name = "polyglossia"
@@ -30295,7 +30154,7 @@ local function newloader(langentry)
end
-- language info will be written into the .log file
- local s = { "Language data for " .. langentry }
+ local s = { }
for k, v in pairs(langdata) do
if type(v) == 'table' then -- for 'synonyms'
s[#s+1] = k .. "\t" .. table.concat(v,',')
@@ -30303,7 +30162,10 @@ local function newloader(langentry)
s[#s+1] = k .. "\t" .. tostring(v)
end
end
- log_info(table.concat(s,"\n"))
+ local a = {}
+ for _,n in pairs(s) do table.insert(a, n) end
+ table.sort(a)
+ log_info("Language data for " .. langentry .. "\n" .. table.concat(a,"\n"))
--
-- LaTeX's \newlanguage increases language register (count19),
@@ -30313,7 +30175,7 @@ local function newloader(langentry)
-- this possible situation, our newloader() function will
-- unfortunately overwrite the language \lang@xyz.
--
- -- Threfore here we will compare LaTeX's \newlanguage number with
+ -- Therefore here we will compare LaTeX's \newlanguage number with
-- LuaTeX's lang.new() id and select the bigger one for our new
-- language object. Also we will update LaTeX's language register
-- by this new id, so that another possible \newlanguage should not
@@ -30328,7 +30190,7 @@ local function newloader(langentry)
local newlangid = math.max(langcnt, langid)
-- set language register for possible \newlanguage
tex.setcount('global', lang_register, newlangid)
- -- get new lang object if needeed
+ -- get new lang object if needed
if langid ~= newlangid then
langobject = lang.new(newlangid)
end
@@ -30394,7 +30256,12 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\setmainfont{Linux Libertine O}
\defaultfontfeatures{Scale=MatchLowercase}
\setmonofont{Inconsolata}
-\newfontfamily\arabicfont[Script=Arabic]{Amiri}
+\newfontfamily\arabicfont[Script=Arabic]{Amiri}[%
+ UprightFont = *-Regular,
+ BoldFont = *-Bold,
+ Extension = .ttf,
+ ItalicFont = *-Italic,
+ BoldItalicFont = *-BoldItalic]
\newfontfamily\syriacfont[Script=Syriac]{Serto Jerusalem}
\newfontfamily\hebrewfont[Script=Hebrew]{Ezra SIL}
\newfontfamily\sanskritfont[Script=Devanagari]{Sanskrit 2003}
@@ -30530,7 +30397,12 @@ Quamquam sermone nativo fungi desinit, cumque nostris diebus perpauci Latine loq
\usepackage{xltxtra,url,amsmath}
\setmainfont{Linux Libertine O}
\defaultfontfeatures{Scale=MatchLowercase}
-\newfontfamily\arabicfont[Script=Arabic]{Amiri}
+\newfontfamily\arabicfont[Script=Arabic]{Amiri}[%
+ UprightFont = *-Regular,
+ BoldFont = *-Bold,
+ Extension = .ttf,
+ ItalicFont = *-Italic,
+ BoldItalicFont = *-BoldItalic]
\newfontfamily\arabicfonttt[Script=Arabic,Scale=.75]{DejaVu Sans Mono}
\newfontfamily\farsifont[Script=Arabic,Scale=1.1,WordSpace=2]{IranNastaliq}
\let\XeTeX\undefined
@@ -30700,7 +30572,7 @@ This is today: \today
% \typeout{* To finish the installation you have to move the following}
% \typeout{* file into a directory searched by TeX:}
% \typeout{*}
-% \typeout{* \space\space all *.sty, *.lua, *.def, *.lde and *.ldf files}
+% \typeout{* \space\space\space all *.sty, *.lua, *.def and *.ldf files}
% \typeout{*}
% \typeout{* You also need to compile the *.map files with teckit_compile}
% \typeout{* and place the resulting *.tec files under}
diff --git a/Master/texmf-dist/source/latex/preview/preview.dtx b/Master/texmf-dist/source/latex/preview/preview.dtx
index f8b72e05220..cafb03636d0 100644
--- a/Master/texmf-dist/source/latex/preview/preview.dtx
+++ b/Master/texmf-dist/source/latex/preview/preview.dtx
@@ -20,7 +20,7 @@
% Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
% Boston, MA 02110-1301 USA
% \fi
-% \CheckSum{1758}
+% \CheckSum{1770}
% \GetFileInfo{preview.sty}
% \date{\filedate}
% \author{David Kastrup\thanks{\texttt{bug-auctex@gnu.org}}}
@@ -437,8 +437,8 @@
%<*style>
%<*!active>
\NeedsTeXFormat{LaTeX2e}
-\def\pr@version{13.3}
-\def\pr@date{2024/01/17}
+\def\pr@version{14.0.6}
+\def\pr@date{2024/06/30}
\ProvidesPackage{preview}[\pr@date\space \pr@version\space (AUCTeX/preview-latex)]
% \end{macrocode}
% \end{macro}
@@ -1427,11 +1427,17 @@ Please complain to your document class author}%
%<auccfg>\PreviewMacro*[?[{@{[]}}{}][#1]\item
%<auccfg>\PreviewMacro*\emph
%<auccfg>\PreviewMacro*\textrm
+%<auccfg>\PreviewMacro*\textbf
%<auccfg>\PreviewMacro*\textit
%<auccfg>\PreviewMacro*\textsc
%<auccfg>\PreviewMacro*\textsf
%<auccfg>\PreviewMacro*\textsl
%<auccfg>\PreviewMacro*\texttt
+%<auccfg>\PreviewMacro*\textulc
+%<auccfg>\PreviewMacro*\textmd
+%<auccfg>\PreviewMacro*\textnormal
+%<auccfg>\PreviewMacro*\textup
+%<auccfg>\PreviewMacro*\textsw
%<auccfg>\PreviewMacro*\textcolor
%<auccfg>\PreviewMacro*\mbox
%<auccfg>\PreviewMacro*[][#1{}]\author
@@ -1891,7 +1897,7 @@ Please complain to your document class author}%
% \Finale{}
% \iffalse
% Local Variables:
-% mode: doctex
+% mode: docTeX
% TeX-master: "preview.drv"
% End:
% \fi
diff --git a/Master/texmf-dist/source/latex/reledmac/reledmac.dtx b/Master/texmf-dist/source/latex/reledmac/reledmac.dtx
index 2109ca38b5d..8b43d5b6bef 100644
--- a/Master/texmf-dist/source/latex/reledmac/reledmac.dtx
+++ b/Master/texmf-dist/source/latex/reledmac/reledmac.dtx
@@ -786,7 +786,7 @@
% Briefe}, series {\sc I, III, VII,} being edited by Dr.\ H.\
% Breger\index{Breger, Herbert}, Dr.~N. G\"adeke\index{G\"adeke, Nora} and
% others at the Leibniz-Archiv, Nieders\"achsische Landesbibliothek, Hannover.
-% (see \url{http://www.nlb-hannover.de/Leibniz})}
+% (see \url{https://www.gwlb.de/leibniz/digitale-ressourcen/repositorium-des-leibniz-archivs})}
% Theodosius's\index{Theodosius} {\em Spherics}, the German {\em
% Algorismus} of Sacrobosco,\index{Sacrobosco} the Sanskrit text of the
% {\em K\={a}\'{s}ik\={a}\-v\d{r}tti\/} of V\={a}mana\index{Vamana} and
@@ -3962,7 +3962,7 @@
% & It makes the peas taste funny \\
% & And get my tummy gummy.\edindex{gummy} &
% & But it keeps them on the knife.
-% \end{edtabularr}
+% \end{edtabularl}
% \pend
% \endnumbering
% \end{verbatim}
diff --git a/Master/texmf-dist/source/latex/reledmac/reledpar.dtx b/Master/texmf-dist/source/latex/reledmac/reledpar.dtx
index aff1d03da13..1d09e9c4eff 100644
--- a/Master/texmf-dist/source/latex/reledmac/reledpar.dtx
+++ b/Master/texmf-dist/source/latex/reledmac/reledpar.dtx
@@ -354,6 +354,7 @@
% \changes{v2.25.4}{2023/07/04}{Fix bug with \protect\cs{linenumOnlyPagesForColumnsR} and multiple numbered sections}
% \changes{v2.25.5}{2023/07/20}{Fix bug with hyperlink when using \protect\cs{footnoteXnomk}}
% \changes{v2.25.6}{2024/02/26}{Make \protect\cs{doinsidethislinehook} working on right side}
+% \changes{v2.25.7}{2024/07/23}{Fix compatibility with \protect\package{polyglossia} 2.2}
% ^^A PW added following as the definitions are at some unknown elsewhere
%
% \newcommand{\egstart}{%
@@ -1410,7 +1411,7 @@
% \begin{macrocode}
%<*code>
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{reledpar}[2024/05/11 v2.25.6a reledmac extension for parallel texts]%
+\ProvidesPackage{reledpar}[2024/07/23 v2.25.7 reledmac extension for parallel texts]%
% \end{macrocode}
% \subsection{Package's requirement}
@@ -5543,17 +5544,6 @@
% To counter this, we have to make sure that the correct language is
% used at the proper times.
%
-% \begin{macro}{\ifl@dusedbabel}
-% \begin{macro}{\l@dusedbabelfalse}
-% \begin{macro}{\l@dusedbabeltrue}
-% A flag for checking if \verb?babel? has been used as a package.
-% \begin{macrocode}
-\newif\ifl@dusedbabel
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-%
% \changes{v1.8.0}{2014/08/05}{Suppress \protect\cs{ifl@dsamelang} which did not work and was not logical, because both columns could have the same language but not the main language of the document.}
%
% \begin{macro}{\l@dchecklang}
@@ -5598,20 +5588,18 @@
% Now do the \protect\package{babel} or \protect\package{polyglossia} fix or, if necessary.
% \begin{macrocode}
\AtBeginDocument{%
- \@ifundefined{xpg@main@language}{%
+ \@ifpackageloaded{babel}{%
\@ifundefined{bbl@main@language}{%
% \end{macrocode}
% Either \protect\package{babel} has not been used or it has been used with no
% specified language.
% \begin{macrocode}
- \l@dusedbabelfalse
}{%
% \end{macrocode}
% Here we deal with the case where babel has been used. \protect\cs{selectlanguage}
% has to be redefined to use our version of \protect\cs{bbl@set@language} and to
% store the left or right language.
% \begin{macrocode}
- \l@dusedbabeltrue
\let\l@doldselectlanguage\selectlanguage
\let\l@doldbbl@set@language\bbl@set@language
\renewcommand{\selectlanguage}[1]{%
@@ -5635,7 +5623,7 @@
\gdef\theledlanguageL{\bbl@main@language}%
\gdef\theledlanguageR{\bbl@main@language}%
}%
- }
+ }{}%
% \end{macrocode}
% If use \protect\package{polyglossia}
% \changes{v1.8.0}{2014/08/05}{Correct left/right language setting with polyglossia.}
@@ -5643,25 +5631,28 @@
% \changes{v2.22.4}{2019/11/04}{Provide compatibility with the latest version of polyglossia (v1.45).}
% \changes{v2.23.0}{2020/03/08}{Restore compatibility with versions of polyglossia prior to v1.45.}
% \begin{macrocode}
- {%
- \@ifpackagelater{polyglossia}{2022/04/10}{}{\led@err@polyglossiaTooOld}%
- \let\old@otherlanguage\otherlanguage%
- \renewcommand{\otherlanguage}[2][]{%
- \selectlanguage[#1]{#2}%
- \xpg@set@language@only@aux[#1]{#2}%
- \ifledRcol \gdef\theledlanguageR{#2}%
- \else \gdef\theledlanguageL{#2}%
- \fi}%
+ \@ifpackageloaded{polyglossia}{%
+ \@ifpackagelater{polyglossia}{2024/07/15}{}{\led@err@polyglossiaTooOld}%
\renewcommand{\l@duselanguage}[1]{%
\csuse{no\languagename @numbers}%
- \expandafter\@select@language\expandafter{#1}%
+ \selectlanguage*{#1}%
+ }%
+ \AddToHook{env/Leftside/begin}{%
+ \AddToHookNext{cmd/polyglossia@language@switched/after}{%
+ \xdef\theledlanguageL{\languagename}%
+ }%
}%
- \xdef\theledlanguageL{\xpg@main@language}%
- \xdef\theledlanguageR{\xpg@main@language}%
+ \AddToHook{env/Rightside/begin}{%
+ \AddToHookNext{cmd/polyglossia@language@switched/after}{%
+ \xdef\theledlanguageR{\languagename}%
+ }%
+ }%
+ \xdef\theledlanguageL{\mainlanguagename}%
+ \xdef\theledlanguageR{\mainlanguagename}%
% \end{macrocode}
% That is it.
% \begin{macrocode}
- }%
+ }{}%
}%
% \end{macrocode}
% \end{macro}
diff --git a/Master/texmf-dist/source/latex/reptheorem/reptheorem.dtx b/Master/texmf-dist/source/latex/reptheorem/reptheorem.dtx
index d96f740fecb..b0f537af972 100644
--- a/Master/texmf-dist/source/latex/reptheorem/reptheorem.dtx
+++ b/Master/texmf-dist/source/latex/reptheorem/reptheorem.dtx
@@ -12,7 +12,7 @@
%
% This work has the LPPL maintenance status `maintained'.
%
-% The Current Maintainer of this work is Jesse Sraat.
+% The Current Maintainer of this work is Jesse Straat.
%
% This work consists of the main file reptheorem.dtx
% and the derived files
@@ -89,7 +89,7 @@ License: [LPPL1.3c](https://www.latex-project.org/lppl.txt)
\input docstrip.tex
\Msg{************************************************************************}
\Msg{* Installation}
-\Msg{* Package: reptheorem 2024-03-27 v1.0}
+\Msg{* Package: reptheorem 2024-08-12 v1.1}
\Msg{************************************************************************}
\keepsilent
@@ -109,7 +109,7 @@ version 2008 or later.
This work has the LPPL maintenance status `maintained'.
-The Current Maintainer of this work is Jesse Sraat.
+The Current Maintainer of this work is Jesse Straat.
This work consists of the main file reptheorem.dtx
and the derived files
@@ -246,9 +246,9 @@ colorlinks,
% environment \DescribeEnv{makethm} |makethm| is
% used for.
% \begin{verbatim}
-% \begin{makethm}{theorem}{thm:Yoneda}[Yoneda Lemma]{
+% \begin{makethm}{theorem}{thm:Yoneda}[Yoneda Lemma]
% For \(F\colon \mathcal{C}\to \mathbf{Set}\) a functor,
-% \([\mathcal{C}^\mathrm{op},\mathbf{Set}](YA, F) \cong F(A)\)%
+% \([\mathcal{C}^\mathrm{op},\mathbf{Set}](YA, F) \cong F(A)\)
% for all objects \(A\) in \(\mathcal{C}\).
% \end{makethm}
% \end{verbatim}
@@ -271,33 +271,33 @@ colorlinks,
% the theorem is proven at a later point, or we want to
% ``tease'' the reader with a powerful theorem that will be
% proven later in the chapter. To do this, we use the
-% \DescribeMacro{repthm} command, as follows.
+% \DescribeMacro{\repthm} command, as follows.
% \begin{verbatim}
-% \repthm{theorem}{thm:Yoneda}
+% \repthm{thm:Yoneda}
% \end{verbatim}
% This outputs the theorem again.
-% \repthm{theorem}{thm:Yoneda}
+% \repthm{thm:Yoneda}
% The label of this theorem is a |\ref|, and automatically
% links to the original theorem statement.\par
% If the original theorem statement exists in a different
% file, or has not been created yet, we can add a placeholder
% alt text to the |\repthm| as an optional argument, which
% only displays if the theorem is undefined. For example,
-% |\repthm{theorem}{thm:foo}[bar]| returns
-% \repthm{theorem}{thm:foo}[bar]
+% |\repthm{thm:foo}[bar]| returns
+% \repthm{thm:foo}[bar]
% If we do the same without providing an alt text, we get
-% \repthm{theorem}{thm:foo}
+% \repthm{thm:foo}
% together with a warning.\par
% Since we're using the |.aux| file, it is possible
% to replicate a theorem before it is stated. For example,
% \begin{verbatim}
-% \repthm{theorem}{thm:later}
+% \repthm{thm:later}
% \begin{makethm}{theorem}{thm:later}[Later]
% Alligator!
% \end{makethm}
% \end{verbatim}
% returns
-% \repthm{theorem}{thm:later}
+% \repthm{thm:later}
% \begin{makethm}{theorem}{thm:later}[Later]
% Alligator
% \end{makethm}
@@ -352,7 +352,7 @@ colorlinks,
% \section{Source code}
% \begin{macrocode}
%<*package>
-\ProvidesPackage{reptheorem}[2024-03-27 v1.0 Reptheorem package]
+\ProvidesPackage{reptheorem}[2024-08-12 v1.1 Reptheorem package]
% \end{macrocode}
%
% \begin{macro}{\theoremfile}
@@ -387,6 +387,7 @@ colorlinks,
% \end{macro}
%
% \begin{environment}{makethm}
+% \changes{v1.1}{2024/05/03}{Now saves theorem environment type, breaking backwards compatibility}
% On to defining the actual theorems to be saved.
% \begin{macrocode}
\NewDocumentEnvironment{makethm}{ m m o +b }
@@ -403,15 +404,19 @@ colorlinks,
}
#4
\end{#1}
+ \expandafter\gdef\csname thmtype@#2\endcsname{#1}
\expandafter\long\expandafter\gdef\csname thm@#2\endcsname{#4}%
\expandafter\gdef\csname thmdesc@#2\endcsname{#3}%
% Saving parameters to aux file
\long\gdef\@thmoutput{%
+ \string\expandafter\string\gdef\noexpand%
+ \csname thmtype@#2\string\endcsname{#1}%
+ ^^J%
\string\expandafter\string\long\string\expandafter%
\string\gdef\noexpand\csname thm@#2\string\endcsname{#4}%
^^J%
- \string\expandafter\string\expandafter%
- \string\gdef\noexpand\csname thmdesc@#2\string\endcsname{#3}%
+ \string\expandafter\string\gdef\noexpand%
+ \csname thmdesc@#2\string\endcsname{#3}%
}
\write\@auxout{\@thmoutput}
\if\reptheorem@theoremfile\relax
@@ -426,53 +431,60 @@ colorlinks,
% \end{environment}
%
% \begin{macro}{\repthm}
+% \changes{v1.1}{2024/05/03}{Now saves theorem environment type, breaking backwards compatibility}
% To repeat a theorem, use the |\repthm| command.
% The type of theorem is not saved, so it is necessary to
% respecify it each time a theorem is repeated.
% \begin{macrocode}
\newcounter{old@counter}
-\NewDocumentCommand{\repthm}{ m m +o }{
- % m: the type of theorem environment
+\NewDocumentCommand{\repthm}{ m +o }{
% m: the name of the theorem
% o: alt text
\begingroup
- \setcounter{old@counter}{\value{#1}}
+ % Check if thmtype is given
+ \ifcsname thmtype@#1\endcsname%
+ \expandafter\let\expandafter\@@thmtype\csname thmtype@#1\endcsname%
+ \else%
+ \def\@@thmtype{theorem}%
+ \fi%
+ %
% Save theorem counter so we don't increase it
- \def\thetheorem{\ref{#2}}
+ \setcounter{old@counter}{\value{\@@thmtype}}
+ \def\thetheorem{\ref{#1}}
\let\@@theoremnotdefined\relax
%
- \ifcsname thm@#2\endcsname% Check if theorem is even defined
+ \ifcsname thm@#1\endcsname% Check if theorem is even defined
% Theorem is defined
- \expandafter\edef\expandafter\@@thmdesc{\csname thmdesc@#2\endcsname}%
- \expandafter\let\expandafter\@@thm\csname thm@#2\endcsname
+ \expandafter\edef\expandafter\@@thmdesc{\csname thmdesc@#1\endcsname}%
+ \expandafter\let\expandafter\@@thm\csname thm@#1\endcsname
% Output theorem
\IfValueTF{\@@thmdesc}{% Check if theorem has name
- \begin{#1}[\@@thmdesc]
+ \begin{\@@thmtype}[\@@thmdesc]
\@@thm
- \end{#1}
+ \end{\@@thmtype}
}{% No optionals
- \begin{#1}
+ \begin{\@@thmtype}
\@@thm
- \end{#1}
+ \end{\@@thmtype}
}
\else
% Theorem undefined
- \IfValueTF{#3}{
- \begin{#1}
- #3
- \end{#1}
+ \IfValueTF{#2}{
+ \begin{\@@thmtype}
+ #2
+ \end{\@@thmtype}
}{% No theorem or alt text provided: throw warning
- \begin{#1}
- \end{#1}
+ \begin{\@@thmtype}
+ \end{\@@thmtype}
\PackageWarning{reptheorem}{%
- Theorem #2 not defined; rebuild your project.
+ Theorem #1 not defined; rebuild your project.
If the issue persists, create the theorem using
\begin{makethm} or consider adding alt text to \repthm
using the optional parameter%
}
}
\fi
- \setcounter{#1}{\value{old@counter}}
+ \setcounter{\@@thmtype}{\value{old@counter}}
% Reset theorem counter back to original
\endgroup
}
@@ -483,4 +495,4 @@ colorlinks,
% \begin{macrocode}
%</package>
% \end{macrocode}
-%\Finale
+%\Finale \ No newline at end of file
diff --git a/Master/texmf-dist/source/latex/reptheorem/reptheorem.ins b/Master/texmf-dist/source/latex/reptheorem/reptheorem.ins
index c85a0d2ff38..be179b4d9a1 100644
--- a/Master/texmf-dist/source/latex/reptheorem/reptheorem.ins
+++ b/Master/texmf-dist/source/latex/reptheorem/reptheorem.ins
@@ -27,7 +27,7 @@
\input docstrip.tex
\Msg{************************************************************************}
\Msg{* Installation}
-\Msg{* Package: reptheorem 2024-03-27 v1.0}
+\Msg{* Package: reptheorem 2024-08-12 v1.1}
\Msg{************************************************************************}
\keepsilent
diff --git a/Master/texmf-dist/source/latex/se2thesis/se2colors.dtx b/Master/texmf-dist/source/latex/se2thesis/se2colors.dtx
index dd4b9da06cb..7b0b5d81f71 100644
--- a/Master/texmf-dist/source/latex/se2thesis/se2colors.dtx
+++ b/Master/texmf-dist/source/latex/se2thesis/se2colors.dtx
@@ -231,7 +231,7 @@
%
% Identify the package and give the overall version information.
% \begin{macrocode}
-\ProvidesExplPackage {se2colors} {2024-06-07} {4.1.0}
+\ProvidesExplPackage {se2colors} {2024-08-12} {4.3.2}
{A colour support package for the se2thesis bundle}
% \end{macrocode}
%
diff --git a/Master/texmf-dist/source/latex/se2thesis/se2fonts.dtx b/Master/texmf-dist/source/latex/se2thesis/se2fonts.dtx
index 6915bcd2a81..5ede585b755 100644
--- a/Master/texmf-dist/source/latex/se2thesis/se2fonts.dtx
+++ b/Master/texmf-dist/source/latex/se2thesis/se2fonts.dtx
@@ -151,7 +151,7 @@
%
% Identify the package and give the overall version information.
% \begin{macrocode}
-\ProvidesExplPackage {se2fonts} {2024-06-07} {4.1.0}
+\ProvidesExplPackage {se2fonts} {2024-08-12} {4.3.2}
{A font-selection support package for the se2thesis bundle}
% \end{macrocode}
%
diff --git a/Master/texmf-dist/source/latex/se2thesis/se2packages.dtx b/Master/texmf-dist/source/latex/se2thesis/se2packages.dtx
index 8d3baeed708..3ad8d99b0af 100644
--- a/Master/texmf-dist/source/latex/se2thesis/se2packages.dtx
+++ b/Master/texmf-dist/source/latex/se2thesis/se2packages.dtx
@@ -446,6 +446,8 @@
% \bibitem{DBLP:journals/sttt/BeyerLW19} Dirk Beyer, Stefan Löwe, and Philipp
% Wendler: \emph{Reliable benchmarking: requirements and solutions}. STTT
% 21(1): 1--29 (2019)
+% \bibitem{Knu86} Donald E. Knuth: \emph{The \TeX{}book}. Addison-Wesley
+% (1986)
% \end{thebibliography}
%
%
@@ -470,7 +472,7 @@
%
% Identify the package and give the overall version information.
% \begin{macrocode}
-\ProvidesExplPackage {se2packages} {2024-06-07} {4.1.0}
+\ProvidesExplPackage {se2packages} {2024-08-12} {4.3.2}
{Supporting packages for the se2thesis bundle}
% \end{macrocode}
%
diff --git a/Master/texmf-dist/source/latex/se2thesis/se2thesis.dtx b/Master/texmf-dist/source/latex/se2thesis/se2thesis.dtx
index 7764429e06f..6d29f974822 100644
--- a/Master/texmf-dist/source/latex/se2thesis/se2thesis.dtx
+++ b/Master/texmf-dist/source/latex/se2thesis/se2thesis.dtx
@@ -62,7 +62,7 @@
% internet, causing each thesis looking differently.
%
% The author of this package provided a template,
-% which he initially created for his bachelor and master thesis,
+% which he initially created for his bachelor's and master's thesis,
% that was recommended and used by many students.
% The implementation of that template, however, was very hacky and required
% some changes over time.
@@ -74,7 +74,7 @@
% The bundle itself consists of several \LaTeX{} classes and packages
% that also allow reuse of various parts of it.
% Its main class is the \pkg{se2thesis} document class,
-% an extension of the \KOMAScript{} |scrreprt| document class.
+% an extension of the \KOMAScript{} |scrbook| document class.
% The packages \pkg{se2colors} and \pkg{se2fonts} provide necessary
% colour and font settings for the \pkg{se2thesis} class;
% the \pkg{se2packages} allows to load several recommended packages~(see
@@ -186,9 +186,9 @@
% \pkg{expl3}, \pkg{l3keys2e} in case one uses a \LaTeX{} kernel from before
% 2022--06--01, \pkg{graphicx}, \pkg{translations}, \KOMAScript, \pkg{xcolor},
% \pkg{ifthen}, as well as \pkg{fontspec}, \pkg{unicode-math},
-% and \pkg{libertinus-otf} if one uses \LuaTeX{};
+% \pkg{inconsolata-nerd-font} and \pkg{libertinus-otf} if one uses \LuaTeX{};
% for \pdfLaTeX{} we load \pkg{fontenc}, \pkg{libertinus-type1}, and
-% \pkg{AnonymousPro} instead of the latter three.
+% \pkg{inconsolata} instead of the latter three.
% Furthermore, we load \pkg{microtype};
% when using \LuaTeX{}, we also load \pkg{lua-widow-control} and \pkg{selnolig}.
%
@@ -220,6 +220,11 @@
% \emph{Note:} you cannot use \cls{scrartcl} because it does not provide
% the required |chapter| sectioning.
% Default is |scrbook|.
+%
+% Please note that if you want to have the bibliography numbered or use an
+% appendix with alpha-numbering (A, B, \dots), you want to explicitly use
+% |scrreprt| as the base class; for some (currently unknown) reason this does
+% not work with the default |scrbook|.
% \end{function}
% \begin{function}{paper}
% \begin{syntax}
@@ -243,11 +248,11 @@
% \end{syntax}
% Defines the type of the thesis.
% Possible values are:
-% |bachelor| for a bachelor thesis, |bachelorproposal| for a proposal to
-% a bachelor thesis, |master| for a master thesis, |masterproposal| for
-% a proposal to a master thesis, |phdproposal| for a proposal to a PhD thesis,
+% |bachelor| for a bachelor's thesis, |bachelorproposal| for a proposal to
+% a bachelor's thesis, |master| for a master's thesis, |masterproposal| for
+% a proposal to a master's thesis, |phdproposal| for a proposal to a PhD thesis,
% |phd| for a PhD thesis in the natural sciences, |phdeng| for a PhD thesis
-% in engineering, and |phdphil| for a PhD thesis in philosophy.
+% in engineering, and |phdphil| for a PhD thesis in natural philosophy.
% \end{function}
%
% \begin{function}{colormode}
@@ -307,7 +312,7 @@
% \cmd{\matrnumber} \marg{matriculation-number}
% \end{syntax}
% Specify the matriculation number of the student writing the thesis.
-% This is required for Bachelor and Master theses.
+% This is required for bachelor's and master's theses.
% \end{function}
%
% \begin{function}{\supervisor, \cosupervisor}
@@ -437,7 +442,7 @@
% We provide the \env{acknowledgements} environment to typeset acknowledgements
% for your thesis.
% Using this environment is optional.
-% Usually, bachelor and master thesis do not contain such an acknowledgements
+% Usually, bachelor's and master's thesis do not contain such an acknowledgements
% section, however, there is no general rule to this.
% \begin{verbatim}
% \begin{acknowledgements}[language]
@@ -540,6 +545,48 @@
% question;
% however, this can also be arbitrary text.
%
+% \subsection{Language Support and Hyphenation}\label{sec:doct-se2thesis-lang}
+%
+% The study regulations of the University of Passau require students to write
+% their thesis in either German or English. For both cases it is recommended
+% to load a package for the correct hyphenation patters. Usually, one can
+% either choose between the \pkg{babel} and \pkg{polyglossia} package. For a
+% detailed discussion in the differences and which to choose, please use the
+% search engine of your choice.
+%
+% For this documentation we stick with the \pkg{babel} package, which is often
+% considered to be the standard package.
+%
+% If you write your thesis in German, load \pkg{babel} in your preamble like
+% follows
+% \begin{verbatim}
+% \usepackage[ngerman]{babel}
+% \end{verbatim}
+% For a thesis in English, you have to also load the German variant plus the
+% English one as the default (see \cref{sec:doc-se2thesis-authorship} for an
+% explanation)
+% \begin{verbatim}
+% \usepackage[ngerman,main=UKenglish]{babel}
+% \end{verbatim}
+%
+% Note that by default, \LaTeX{} does not provide hyphenation for compound
+% words, which is explained in the \TeX{} Book~\cite[p.~454]{Knu86} and a
+% StackExchange post\footnote{\href{https://tex.stackexchange.com/a/63234/14622}{https://tex.stackexchange.com/a/63234/14622}}. The \pkg{babel} package
+% provides a way (called shorthands) for German, which allows to reenable
+% hyphenation for compound words (as they are common on German). These
+% shorthands are by default not available for English, but they can easily be
+% added by adding
+% \begin{verbatim}
+% \useshorthands{"}
+% \addto\extrasUKenglish{\languageshorthands{ngerman}}
+% \end{verbatim}
+% after loading \pkg{babel} with the aforementioned \cmd{\usepackage}
+% macro\footnote{see https://tex.stackexchange.com/a/298844/14622}.
+%
+% \emph{Please note:} loading the \pkg{hyphenat} package is strongly discouraged
+% by the \pkg{se2thesis} maintainer because it conflicts with the \env{hyp}
+% environment provided by \pkg{se2thesis} (see \cref{sec:doc-se2thesis-summaries}).
+%
% \end{documentation}
%
% \clearpage
@@ -607,7 +654,7 @@
%
% Identify the class and give the overall version number.
% \begin{macrocode}
-\ProvidesExplClass {se2thesis} {2024-06-07} {4.1.0}
+\ProvidesExplClass {se2thesis} {2024-08-12} {4.3.2}
{A thesis class for the Chair of Software Engineering II}
% \end{macrocode}
%
@@ -1246,7 +1293,7 @@
% \end{macrocode}
% The next block generates the text that describes the thesis.
% In case of a PhD thesis, this text is predefined to match the requirements.
-% In case of a bachelor or master thesis, or a proposal thereof, we generate
+% In case of a bachelor's or master's thesis, or a proposal thereof, we generate
% a text based on the values of the |thesistype| load-time option and the
% values of the \cmd{\degreeprogramme}, \cmd{\department}, and
% \cmd{\institute} variables.
@@ -1283,7 +1330,7 @@
\tl_if_eq:NnTF \l_@@_thesis_type_tl { phdphil }
{
Dissertation~ zur~ Erlangung~ des~ Doktorgrades\\
- der~ Philosophie~ (Dr.\,phil.)\\
+ der~ Naturphilosophie~ (Dr.\,phil.\,nat.)\\
eingereicht~ an~ der~ Fakultät~ für~ Informatik~ und~ Mathematik\\
der~ Universität~ Passau\\
\rule{\textwidth}{.1pt}\\
@@ -1291,7 +1338,7 @@
the~ Faculty~ of~ Computer~ Science~ and~ Mathematics\\
of~ the~ University~ of~ Passau\\
in~ partial~ fulfillment~ of~ obtaining\\
- the~ degree~ of~ a~ Doctor~ of~ Philosophy
+ the~ degree~ of~ a~ Doctor~ of~ Natural~ Philosophy
} {
\tl_if_eq:NnT \l_@@_thesis_type_tl { bachelor }
{ \GetTranslation{Bachelor-thesis} }
@@ -1362,12 +1409,18 @@
% \end{macrocode}
%
% \begin{macro}{\@lowertitleback}
-% Afterwards, override the definition of \cs{@lowertitleback}.
+% Afterwards, override the definition of \cs{@lowertitleback}. To prevent
+% line breaks in the title (that might be necessary to layout it properly on
+% the front title page), we place a group around \cs{@title} and temporarily
+% redefine \cmd{\\} to do nothing.
% \begin{macrocode}
\renewcommand*{\@lowertitleback}{%
\group_begin:
\noindent\textbf{\@author}:\\
- \emph{\@title}\\
+ \group_begin:
+ \let\\\relax
+ \emph{\@title}
+ \group_end:\\
\tl_if_eq:NnT \l_@@_thesis_type_tl { bachelor }
{ \GetTranslation{Bachelor-thesis},~ }
\tl_if_eq:NnT \l_@@_thesis_type_tl { master }
@@ -1678,7 +1731,7 @@
% We provide the following English translations.
%
% \begin{macrocode}
-\ProvideDictionaryFor{English}{se2translations}[2024/06/07]
+\ProvideDictionaryFor{English}{se2translations}[2024/08/12]
\ProvideDictTranslation{abstract}{abstract}
\ProvideDictTranslation{Abstract}{Abstract}
\ProvideDictTranslation{acknowledgement}{acknowledgement}
@@ -1703,10 +1756,10 @@
\ProvideDictTranslation{External}{External Examiner}
\ProvideDictTranslation{degreeprogramme}{programme}
\ProvideDictTranslation{Degreeprogramme}{Programme}
-\ProvideDictTranslation{Bachelor-thesis}{Bachelor Thesis}
-\ProvideDictTranslation{Bachelor-thesis-proposal}{Bachelor Thesis Proposal}
-\ProvideDictTranslation{Master-thesis}{Master Thesis}
-\ProvideDictTranslation{Master-thesis-proposal}{Master Thesis Proposal}
+\ProvideDictTranslation{Bachelor-thesis}{Bachelor's Thesis}
+\ProvideDictTranslation{Bachelor-thesis-proposal}{Bachelor's Thesis Proposal}
+\ProvideDictTranslation{Master-thesis}{Master's Thesis}
+\ProvideDictTranslation{Master-thesis-proposal}{Master's Thesis Proposal}
\ProvideDictTranslation{PhD-thesis}{PhD Thesis}
\ProvideDictTranslation{PhD-thesis-proposal}{PhD Thesis Proposal}
\ProvideDictTranslation{date}{date}
@@ -1729,7 +1782,7 @@
% We provide the following German translations.
%
% \begin{macrocode}
-\ProvideDictionaryFor{German}{se2translations}[2024/06/07]
+\ProvideDictionaryFor{German}{se2translations}[2024/08/12]
\ProvideDictTranslation{abstract}{Zusammenfassung}
\ProvideDictTranslation{Abstract}{Zusammenfassung}
\ProvideDictTranslation{acknowledgement}{Danksagung}
diff --git a/Master/texmf-dist/source/latex/sillypage/sillypage.dtx b/Master/texmf-dist/source/latex/sillypage/sillypage.dtx
index 86982db30db..922d8b6a669 100644
--- a/Master/texmf-dist/source/latex/sillypage/sillypage.dtx
+++ b/Master/texmf-dist/source/latex/sillypage/sillypage.dtx
@@ -19,8 +19,8 @@
% by Phelype Oleinik, Paulo Cereda, samcarter and Ulrike Fischer.
%
%<*package>
-\def\sillypageDate{2023-03-04}
-\def\sillypageVersion{1.6}
+\def\sillypageDate{2024-07-23}
+\def\sillypageVersion{1.7}
%</package>
%<*driver>
\documentclass[a4paper,full]{l3doc}
@@ -261,9 +261,13 @@
\newcommand*\@silly { \@@_step:n }
\cs_new:Npn \@@_step:n #1
{
+ \UseTaggingSocket{@@/begin}{#1}
+ \SuspendTagging{@@}
\@@_step_aux:eN
{ \int_eval:n { \int_mod:nn { #1-1 } { \silly@steps } +1 } }
\c_false_bool
+ \ResumeTagging{@@}
+ \UseTaggingSocket{@@/end}
}
% \end{macrocode}
% \end{macro}
@@ -280,8 +284,12 @@
\newcommand*\@sillynumeral { \@@_numeral:n }
\cs_new:Npn \@@_numeral:n #1
{
+ \UseTaggingSocket{@@/begin}{#1}
+ \SuspendTagging{@@}
\exp_args:Ne \str_map_function:nN
{ \int_to_base:nn {#1} { 12 } } \@@_numeral_aux:n
+ \ResumeTagging{@@}
+ \UseTaggingSocket{@@/end}
}
\cs_new:Npn \@@_numeral_aux:n #1
{ \@@_step_aux:eN { "\char_uppercase:N #1+1 } \c_true_bool }
@@ -289,6 +297,28 @@
% \end{macro}
% \end{macro}
% \end{macro}
+%
+% \subsection{Tagging Support}
+
+% \begin{macrocode}
+\NewSocket{tagsupport/@@/begin}{1}
+\NewSocket{tagsupport/@@/end}{0}
+\NewSocketPlug{tagsupport/@@/begin}{tagged}
+ {
+ \mode_leave_vertical:
+ \tag_mc_end_push:
+ \tag_struct_begin:n {tag=Span}
+ \tag_mc_begin:n {actualtext=#1}
+ }
+\NewSocketPlug{tagsupport/@@/end}{tagged}
+ {
+ \tag_mc_end:
+ \tag_struct_end:
+ \tag_mc_begin_pop:n{}
+ }
+\AssignSocketPlug{tagsupport/@@/begin}{tagged}
+\AssignSocketPlug{tagsupport/@@/end}{tagged}
+% \end{macrocode}
%
% \subsection{Internals}
%
diff --git a/Master/texmf-dist/source/latex/siunitx/siunitx-angle.dtx b/Master/texmf-dist/source/latex/siunitx/siunitx-angle.dtx
index ac933f46364..91d67690f02 100644
--- a/Master/texmf-dist/source/latex/siunitx/siunitx-angle.dtx
+++ b/Master/texmf-dist/source/latex/siunitx/siunitx-angle.dtx
@@ -303,18 +303,23 @@
}
}
\cs_generate_variant:Nn \siunitx_angle:nnn { eee , xxx }
+% \end{macrocode}
+% Here, the need for absolute values is to handle conversion of negative
+% values: the result should be exactly one sign in the integer part.
+% \begin{macrocode}
\cs_new_protected:Npn \@@_arc_convert:n #1
{
\siunitx_angle:eee
{ \fp_eval:n { trunc(#1,0) } }
- { \fp_eval:n { trunc((#1 - trunc(#1,0)) * 60,0) } }
+ { \fp_eval:n { abs(trunc((#1 - trunc(#1,0)) * 60,0)) } }
{
\fp_eval:n
{
- (
- (#1 - trunc(#1,0)) * 60
- - trunc((#1 - trunc(#1,0)) * 60,0)
- )
+ abs
+ (
+ (#1 - trunc(#1,0)) * 60
+ - trunc((#1 - trunc(#1,0)) * 60,0)
+ )
* 60
}
}
@@ -325,6 +330,13 @@
% \end{macro}
% \end{macro}
%
+% \begin{variable}{\c_@@_parts_tl}
+% For mappings.
+% \begin{macrocode}
+\clist_const:Nn \c_@@_parts_tl { degrees , minutes , seconds }
+% \end{macrocode}
+% \end{variable}
+%
% \begin{variable}{\l_@@_degrees_tl, \l_@@_minutes_tl, \l_@@_seconds_tl}
% Space for formatting parsed numbers.
% \begin{macrocode}
@@ -341,7 +353,14 @@
% \end{macrocode}
% \end{variable}
%
-% \begin{macro}{\@@_suppress_exp_uncert:, \@@_suppress_comp_sign:}
+% \begin{variable}{\l_@@_signed_bool}
+% To check that only one sign is seen in arc mode.
+% \begin{macrocode}
+\tl_new:N \l_@@_signed_bool
+% \end{macrocode}
+% \end{variable}
+%
+% \begin{macro}{\@@_suppress_exp_uncert:, \@@_suppress_comp:}
% Pre-compilation of keys to suppress uncertainties and exponents,
% and
% \begin{macrocode}
@@ -358,60 +377,45 @@
{ \exp_not:V \l_@@_tmp_tl }
\keys_precompile:nnN
{ siunitx }
- { input-comparators = , input-signs = }
+ { input-comparators = }
\l_@@_tmp_tl
-\cs_set_protected:Npx \@@_suppress_comp_sign:
+\cs_set_protected:Npx \@@_suppress_comp:
{ \exp_not:V \l_@@_tmp_tl }
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@@_arc_sign:nnn}
% \begin{macro}{\@@_arc_sign:nn}
+% \begin{macro}{\@@_arc_sign_auxi:, \@@_arc_sign_auxii:}
% \begin{macro}{\@@_extract_sign:nnnnnnnn}
% \begin{macro}[EXP]{\@@_sign:nnnnnnn}
% To get the sign in the right place whilst dealing with zero filling
% means doing some shuffling. That means doing processing of each number
-% manually.
+% manually. For degrees, auto-conversion can give |-0|, which needs to be
+% picked up early to set the sign.
% \begin{macrocode}
\cs_new_protected:Npn \@@_arc_sign:nnn #1#2#3
{
\group_begin:
\@@_suppress_exp_uncert:
\tl_clear:N \l_@@_sign_tl
- \@@_arc_sign:nn {#1} { degrees }
+ \bool_set_false:N \l_@@_signed_bool
+ \str_if_eq:nnTF {#1} { -0 }
+ {
+ \@@_arc_sign:nn { } { degrees }
+ \@@_suppress_comp:
+ \tl_set:Nn \l_@@_sign_tl { - }
+ \bool_set_true:N \l_@@_signed_bool
+ }
+ { \@@_arc_sign:nn {#1} { degrees } }
\@@_arc_sign:nn {#2} { minutes }
\@@_arc_sign:nn {#3} { seconds }
\tl_if_empty:NF \l_@@_sign_tl
{
- \clist_map_inline:nn { degrees , minutes , seconds }
- {
- \tl_if_empty:cF { l_@@_ ##1 _tl }
- {
- \tl_set:cx { l_@@_ ##1 _tl }
- {
- { }
- { \exp_not:V \l_@@_sign_tl }
- \exp_after:wN \exp_after:wN \exp_after:wN
- \@@_sign:nnnnnnn
- \cs:w l_@@_ ##1 _tl \cs_end:
- }
- \clist_map_break:
- }
- }
- }
- \clist_map_inline:nn { degrees , minutes , seconds }
- {
- \tl_if_empty:cF { l_@@_ ##1 _tl }
- {
- \siunitx_number_process:cc
- { l_@@_ ##1 _tl } { l_@@_ ##1 _tl }
- \tl_set:cx { l_@@_ ##1 _tl }
- {
- \siunitx_number_output:cN
- { l_@@_ ##1 _tl } \q_nil
- }
- }
+ \clist_map_function:NN \c_@@_parts_tl
+ \@@_arc_sign_auxi:n
}
+ \clist_map_function:NN \c_@@_parts_tl \@@_arc_sign_auxii:n
\@@_arc_print:VVV
\l_@@_degrees_tl
\l_@@_minutes_tl
@@ -432,6 +436,40 @@
{
\siunitx_number_parse:nN {#1} \l_@@_tmp_tl
\exp_after:wN \@@_extract_sign:nnnnnnnn \l_@@_tmp_tl {#2}
+ \bool_set_true:N \l_@@_signed_bool
+ }
+ }
+\cs_new_protected:Npn \@@_arc_sign_auxi:n #1
+ {
+ \tl_if_empty:cF { l_@@_ #1 _tl }
+ {
+ \tl_set:cx { l_@@_ #1 _tl }
+ {
+ { }
+ { \exp_not:V \l_@@_sign_tl }
+ \exp_after:wN \exp_after:wN \exp_after:wN
+ \@@_sign:nnnnnnn
+ \cs:w l_@@_ #1 _tl \cs_end:
+ }
+ \clist_map_break:
+ }
+ }
+\cs_new_protected:Npn \@@_arc_sign_auxii:n #1
+ {
+ \tl_if_empty:cF { l_@@_ #1 _tl }
+ {
+ \bool_lazy_and:nnF
+ { \l_@@_force_arc_bool }
+ { ! \str_if_eq_p:nn {#1} { seconds } }
+ {
+ \siunitx_number_process:cc
+ { l_@@_ #1 _tl } { l_@@_ #1 _tl }
+ }
+ \tl_set:cx { l_@@_ #1 _tl }
+ {
+ \siunitx_number_output:cN
+ { l_@@_ #1 _tl } \q_nil
+ }
}
}
\cs_new_protected:Npn \@@_extract_sign:nnnnnnnn #1#2#3#4#5#6#7#8
@@ -439,10 +477,12 @@
\tl_if_blank:nTF {#2}
{ \tl_set_eq:cN { l_@@_ #8 _tl } \l_@@_tmp_tl }
{
+ \bool_if:NTF \l_@@_signed_bool
+ { \msg_error:nnn { siunitx } { arc-multi-sign } }
+ { \tl_set:Nn \l_@@_sign_tl {#2} }
\tl_set:cn { l_@@_ #8 _tl }
{ {#1} { } {#3} {#4} {#5} {#6} {#7} }
- \tl_set:Nn \l_@@_sign_tl {#2}
- \@@_suppress_comp_sign:
+ \@@_suppress_comp:
}
}
\cs_new:Npn \@@_sign:nnnnnnn #1#2#3#4#5#6#7
@@ -452,6 +492,7 @@
% \end{macro}
% \end{macro}
% \end{macro}
+% \end{macro}
%
% \begin{variable}{\l_@@_marker_box, \l_@@_unit_box}
% For \enquote{astronomy style} angles.
@@ -602,6 +643,15 @@
% \end{macro}
%
% \begin{macrocode}
+\msg_new:nnnn { siunitx } { arc-multi-sign }
+ { Multiple~signs~given~for~arc~angle! }
+ {
+ An~angle~given~as~an~arc~should~have~at~most~one~sign:~
+ only~the~first~sign~will~be~used.
+ }
+% \end{macrocode}
+%
+% \begin{macrocode}
\keys_set:nn { siunitx }
{
angle-mode = input ,
diff --git a/Master/texmf-dist/source/latex/siunitx/siunitx-complex.dtx b/Master/texmf-dist/source/latex/siunitx/siunitx-complex.dtx
index 2ff86391c2a..200fd15f158 100644
--- a/Master/texmf-dist/source/latex/siunitx/siunitx-complex.dtx
+++ b/Master/texmf-dist/source/latex/siunitx/siunitx-complex.dtx
@@ -1143,11 +1143,12 @@
% \begin{macro}[EXP]{\@@_convert_polar_auxiii:nnw}
% \begin{macro}[EXP]{\@@_convert_polar_auxiv:nnw}
% \begin{macro}[EXP]{\@@_convert_polar_auxv:nnw}
-% \begin{macro}[EXP]{\@@_convert_polar_auxvi:nnn}
+% \begin{macro}[EXP]{\@@_convert_polar_auxvi:nnn, \@@_convert_polar_auxvi:enn}
+% \begin{macro}[EXP]{\@@_convert_polar_auxvii:nnn}
% \begin{macro}[EXP]
-% {\@@_convert_polar_auxvii:nnn, \@@_convert_polar_auxvii:eee}
+% {\@@_convert_polar_auxviii:nnn, \@@_convert_polar_auxviii:eee}
% \begin{macro}[EXP]
-% {\@@_convert_polar_auxviii:nn, \@@_convert_polar_auxviii:ee}
+% {\@@_convert_polar_auxix:nn, \@@_convert_polar_auxix:ee}
% A simplified parser for complex numbers which works by expansion,
% then converts to polar form.
% \begin{macrocode}
@@ -1160,10 +1161,10 @@
\bool_lazy_or:nnTF
{ \str_if_eq_p:nn {#2} { i } }
{ \str_if_eq_p:nn {#2#3} { +i } }
- { \@@_convert_polar_auxvi:nnn { } { 1 } {#1} }
+ { \@@_convert_polar_auxvii:nnn { } { 1 } {#1} }
{
\str_if_eq:nnTF {#2#3} { -i }
- { \@@_convert_polar_auxvi:nnn { } { -1 } {#1} }
+ { \@@_convert_polar_auxvii:nnn { } { -1 } {#1} }
{ \@@_convert_polar_auxiii:nnw {#1} {#2} #3 + + \q_stop }
}
}
@@ -1173,7 +1174,7 @@
{ \@@_convert_polar_auxiv:nnw {#1} {#2} #3 - - \q_stop }
{
\str_if_eq:nnTF {#4} { i }
- { \@@_convert_polar_auxvi:nnn {#2#3} { 1 } {#1} }
+ { \@@_convert_polar_auxvii:nnn {#2#3} { 1 } {#1} }
{ \@@_convert_polar_auxv:nnw {#2#3} {#1} #4 i \q_nil i \q_stop }
}
}
@@ -1183,35 +1184,48 @@
{ \@@_convert_polar_auxv:nnw { } {#1} #2#3 i \q_nil i \q_stop }
{
\str_if_eq:nnTF {#4} { i }
- { \@@_convert_polar_auxvi:nnn { } { -1 } {#1} }
+ { \@@_convert_polar_auxvii:nnn { } { -1 } {#1} }
{ \@@_convert_polar_auxv:nnw {#2#3} {#1} -#4 i \q_nil i \q_stop }
}
}
+% \end{macrocode}
+% Negative real values are special-cased here for efficiency.
+% \begin{macrocode}
\cs_new:Npn \@@_convert_polar_auxv:nnw #1#2#3 i #4 i #5 \q_stop
{
\quark_if_nil:nTF {#4}
- { { #3 \tl_if_blank:nF {#2} { e#2 } } { 0 } }
- { \@@_convert_polar_auxvi:nnn {#1} {#3} {#2} }
+ {
+ \tl_if_head_eq_meaning:nNTF {#3} -
+ { \@@_convert_polar_auxvi:enn { \use_none:n #3 } { 180 } }
+ { \@@_convert_polar_auxvi:nnn {#3} { 0 } }
+ {#2}
+ }
+ { \@@_convert_polar_auxvii:nnn {#1} {#3} {#2} }
}
\cs_new:Npn \@@_convert_polar_auxvi:nnn #1#2#3
{
- \@@_convert_polar_auxvii:eee
+ { #1 \tl_if_blank:nF {#3} { e#3 } } {#2}
+ }
+\cs_generate_variant:Nn \@@_convert_polar_auxvi:nnn { e }
+\cs_new:Npn \@@_convert_polar_auxvii:nnn #1#2#3
+ {
+ \@@_convert_polar_auxviii:eee
{ \tl_if_blank:nTF {#1} { 0 } {#1} }
{ \tl_if_blank:nTF {#2} { 0 } {#2} }
{ \tl_if_blank:nF {#3} { e#3 } }
}
-\cs_new:Npn \@@_convert_polar_auxvii:nnn #1#2#3
+\cs_new:Npn \@@_convert_polar_auxviii:nnn #1#2#3
{
- \@@_format_polar_auxviii:ee
+ \@@_format_polar_auxix:ee
{ \fp_eval:n { sqrt ( (#1#3)^2 + (#2#3)^2 ) } }
{
\fp_eval:n
{ atan \bool_if:NT \l_@@_polar_degree_bool { d } (#2 , #1) }
}
}
-\cs_generate_variant:Nn \@@_convert_polar_auxvii:nnn { eee }
-\cs_new:Npn \@@_format_polar_auxviii:nn #1#2 { {#1} {#2} }
-\cs_generate_variant:Nn \@@_format_polar_auxviii:nn { ee }
+\cs_generate_variant:Nn \@@_convert_polar_auxviii:nnn { eee }
+\cs_new:Npn \@@_format_polar_auxix:nn #1#2 { {#1} {#2} }
+\cs_generate_variant:Nn \@@_format_polar_auxix:nn { ee }
% \end{macrocode}
% \end{macro}
% \end{macro}
@@ -1222,6 +1236,7 @@
% \end{macro}
% \end{macro}
% \end{macro}
+% \end{macro}
%
% \subsection{Messages}
%
diff --git a/Master/texmf-dist/source/latex/siunitx/siunitx-number.dtx b/Master/texmf-dist/source/latex/siunitx/siunitx-number.dtx
index 2b875143759..4a7e2eb7057 100644
--- a/Master/texmf-dist/source/latex/siunitx/siunitx-number.dtx
+++ b/Master/texmf-dist/source/latex/siunitx/siunitx-number.dtx
@@ -2980,7 +2980,13 @@
\str_case:nnF {#1}
{
{ down } { \use_i:nn }
- { up } { \use_ii:nn }
+ { up }
+ {
+ \str_if_eq:eeTF
+ {#2} { \prg_replicate:nn { \tl_count:n {#2} } { 0 } }
+ { \use_i:nn }
+ { \use_ii:nn }
+ }
}
{
\bool_lazy_or:nnTF
diff --git a/Master/texmf-dist/source/latex/siunitx/siunitx-table.dtx b/Master/texmf-dist/source/latex/siunitx/siunitx-table.dtx
index b4791ce47bc..4dd14ff826d 100644
--- a/Master/texmf-dist/source/latex/siunitx/siunitx-table.dtx
+++ b/Master/texmf-dist/source/latex/siunitx/siunitx-table.dtx
@@ -297,13 +297,10 @@
% Collecting a tabular cell means doing a token-by-token collection.
% In previous versions of \pkg{siunitx} that was done along with picking
% out the numerical part, but the code flow ends up very tricky. Here,
-% therefore, we just collect up the unchanged tokens first. The definition of
-% \cs{cr} is used to allow collection of any tokens
-% inserted after the main content when dealing with the last cell of a row:
-% the \enquote{group} around it is needed to avoid issues with the underlying
-% |\halign|. (The approach is based on that in \pkg{collcell}.) Whilst the
-% group formed by a cell will normally tidy up |\cr|, we add an extra one as
-% the collected material could be a tabular in itself. We use an auxiliary to
+% therefore, we just collect up the unchanged tokens first. Whilst each
+% cell forms a group, as we require definitions to say local
+% to the collections code, an additional group is required.
+% We use an auxiliary to
% fish out the |\ignorespaces| from the template: that has to go to avoid
% issues with the peek-ahead code (everything before the |#| needs to be
% read \emph{before} the Appendix~D trick gets applied). Some packages
@@ -314,13 +311,6 @@
{
\group_begin:
\tl_clear:N \l_@@_collect_tl
- \if_false: { \fi:
- \cs_set_protected:Npn \cr
- {
- \@@_collect_loop:
- \tex_cr:D
- }
- \if_false: } \fi:
\@@_collect_begin:w
}
\cs_new_protected:Npn \@@_collect_begin:w #1 \ignorespaces
@@ -364,9 +354,10 @@
\@@_collect_search:NnF #1
{
\unskip { \@@_collect_loop: }
- \end { \tabularnewline \end }
+ \textonly@unskip { \@@_collect_loop: }
+ \end { \@@_collect_pre_cr: \tabularnewline \end }
\relax { \@@_collect_relax:N #1 }
- \tabularnewline { \tabularnewline }
+ \tabularnewline { \@@_collect_pre_cr: \tabularnewline }
\siunitx_cell_end: { \siunitx_cell_end: }
}
{ \@@_collect_token_aux:N #1 }
@@ -393,9 +384,9 @@
\@maybe@unskip { \@@_collect_loop: }
\tab@setcr { \@@_collect_loop: }
\unskip { \@@_collect_loop: }
- \end { \tabularnewline \end }
+ \end { \@@_collect_pre_cr: \tabularnewline \end }
\relax { \@@_collect_relax:N #1 }
- \tabularnewline { \tabularnewline }
+ \tabularnewline { \@@_collect_pre_cr: \tabularnewline }
\siunitx_cell_end: { \siunitx_cell_end: }
}
{ \@@_collect_token_aux:N #1 }
@@ -424,6 +415,30 @@
% \end{macro}
% \end{macro}
%
+% \begin{macro}{\@@_collect_pre_cr:}
+% The definition of \cs{cr} is used to allow collection of any tokens
+% from the \tn{halign} template after |#| when we are in the last cell of
+% the row. (The approach is based on that in \pkg{collcell}.) Note that
+% \TeX{} inserts these tokens when it sees the \tn{cr} primitive, so
+% there is no expansion to consider. Whilst in most cases the group formed
+% by each cell will tidy up, nested tabulars (for example in a header row)
+% will break if \tn{cr} is redefined too widely. Thus we use a targetted
+% approach: only apply when needed, and use the additional group inside the
+% cell to keep control.
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_collect_pre_cr:
+ {
+ \if_false: { \fi:
+ \cs_set_protected:Npn \cr
+ {
+ \@@_collect_loop:
+ \tex_cr:D
+ }
+ \if_false: } \fi:
+ }
+% \end{macrocode}
+% \end{macro}
+%
% \subsection{Separating collected material}
%
% The input needs to be divided into numerical tokens and those which appear
diff --git a/Master/texmf-dist/source/latex/siunitx/siunitx.dtx b/Master/texmf-dist/source/latex/siunitx/siunitx.dtx
index ca2b7822aa8..eda108df6d1 100644
--- a/Master/texmf-dist/source/latex/siunitx/siunitx.dtx
+++ b/Master/texmf-dist/source/latex/siunitx/siunitx.dtx
@@ -59,6 +59,9 @@
%
% \begin{documentation}
%
+% ^^A API documentation is given on a per-module basis:
+% ^^A see the siunitx-<module>.dtx files
+%
% \end{documentation}
%
% \begin{implementation}
@@ -121,7 +124,7 @@
%
% Identify the package and give the over all version information.
% \begin{macrocode}
-\ProvidesExplPackage {siunitx} {2024-06-14} {3.3.18}
+\ProvidesExplPackage {siunitx} {2024-08-20} {3.3.21}
{A comprehensive (SI) units package}
% \end{macrocode}
%
diff --git a/Master/texmf-dist/source/latex/siunitx/siunitx.tex b/Master/texmf-dist/source/latex/siunitx/siunitx.tex
index 7c6e147f007..90189978b12 100644
--- a/Master/texmf-dist/source/latex/siunitx/siunitx.tex
+++ b/Master/texmf-dist/source/latex/siunitx/siunitx.tex
@@ -414,7 +414,7 @@ mode.
\end{LaTeXdemo}
The second operation mode for the \cs{unit} macro is an \enquote{interpreted}
-system, Here, each unit, \acro{SI} multiple prefix and power is given a macro
+system. Here each unit, \acro{SI} multiple prefix and power is given a macro
name. These are entered in a method very similar to the reading of the unit
name in English.
\begin{LaTeXdemo}
@@ -1252,7 +1252,7 @@ font variant which does not feature them.
\DescribeOption{text-subscript-command}
\DescribeOption{text-superscript-command}
In most cases, the commands \cs{textsubscript} and \cs{textsuperscript} are
-appropriagte for creating sub- and superscript material in text mode. However,
+appropriate for creating sub- and superscript material in text mode. However,
when the \pkg{realscripts} package is loaded, it is possible that the output is
not as desired. These two commands are therefore available to allow tuning of
the results. They can also be used for non-standard effects, for example as
@@ -1911,7 +1911,7 @@ by the \opt{bracket-ambiguous-numbers} switch. This option only applies to pure
numbers: when formatting quantities, the need for brackets also depends on the
placement of units, so is controlled by \opt{separate-uncertainty-units}.
\begin{LaTeXdemo}
- \sisetup{separate-uncertainty}
+ \sisetup{uncertainty-mode = separate}
\num{1.2(3)e4} \\
\num[bracket-ambiguous-numbers = false]{1.2(3)e4}
\end{LaTeXdemo}
@@ -2760,7 +2760,7 @@ a single unit symbol. Alternative options are \opt{repeat} (print the unit for
each part of the number) and \opt{single} (print only one unit symbol:
mathematically incorrect).
\begin{LaTeXdemo}
- \sisetup{separate-uncertainty}
+ \sisetup{uncertainty-mode = separate}
\qty{12.3(4)}{\kilo\gram} \\
\qty[separate-uncertainty-units = bracket]{12.3(4)}{\kilo\gram} \\
\qty[separate-uncertainty-units = repeat]{12.3(4)}{\kilo\gram} \\
@@ -2887,7 +2887,7 @@ given in Table~\ref{tab:S:format}.
S[table-format = 2.2]
S[table-format = 2.2, table-number-alignment = right]
S[table-format = 2.2(1)]
- S[table-format = 2.2(1), separate-uncertainty]
+ S[table-format = 2.2(1), uncertainty-mode = separate]
S[table-format = +2.2]
S[table-format = 2.2e1]
@{}}
@@ -2970,7 +2970,7 @@ comparator with the \opt{table-align-comparator} option
\caption{The \opt{table-align-uncertainty} option.%
\label{tab:align:uncert}}
\sisetup{
- separate-uncertainty,
+ uncertainty-mode = separate,
table-format = 1.3(1),
}
\begin{tabular}{@{}SS[table-align-uncertainty = false]@{}}
diff --git a/Master/texmf-dist/source/latex/sjtutex/sjtutex.dtx b/Master/texmf-dist/source/latex/sjtutex/sjtutex.dtx
index ab429d6850d..bcf46b7fbec 100644
--- a/Master/texmf-dist/source/latex/sjtutex/sjtutex.dtx
+++ b/Master/texmf-dist/source/latex/sjtutex/sjtutex.dtx
@@ -216,7 +216,7 @@
Please update your TeX distribution}{}}
%</class>
%<*!(driver|install)>
-%<+!driver>\GetIdInfo$Id: sjtutex.dtx 6d52363 2024-04-05 19:40:30 +0800 Alexara Wu <alexarawu@outlook.com> $
+%<+!driver>\GetIdInfo$Id: sjtutex.dtx 78f11bc 2024-06-29 23:01:32 +0800 Alexara Wu <alexarawu@outlook.com> $
%<class&thesis> {Thesis document class for Shanghai Jiao Tong University (SJTUTeX)}
%<class&thesis>\ProvidesExplClass{sjtuthesis}
%<class&report> {Report document class for Shanghai Jiao Tong University (SJTUTeX)}
@@ -335,7 +335,7 @@
%<font&cjk&founder&zh>\ProvidesExplFile{sjtu-cjk-font-founder-zh.def}
%<font&cjk&founder&ja> {Founder CJK fonts definition for Japanese (SJTUTeX)}
%<font&cjk&founder&ja>\ProvidesExplFile{sjtu-cjk-font-founder-ja.def}
-%<!driver> {\ExplFileDate}{2.1.2}{\ExplFileDescription}
+%<!driver> {\ExplFileDate}{2.1.3}{\ExplFileDescription}
%</!(driver|install)>
%
%<*driver>
@@ -343,7 +343,7 @@
\documentclass{ctxdoc}
\newcommand{\sjtutex}{SJTU\TeX}
\expandafter\def\csname ver@\jobname.dtx\endcsname
- {2024/04/05 v2.1.2 SJTUTeX}
+ {2024/06/29 v2.1.3 SJTUTeX}
\usepackage{float}
\usepackage{multirow}
\usepackage{longtable}
@@ -1638,6 +1638,14 @@
% \urlprefix\url{https://ctan.org/pkg/ctex}
% \urlprefix\CTANurl[文档åŠæºä»£ç ï¼š]{language/chinese/ctex/ctex.pdf}
%
+% \bibitem{zhlineskip}
+% 张瑞熹.
+% \newblock \textit{zhlineskip å®åŒ…}\allowbreak[EB/OL].
+% \newblock version 1.0e,
+% \newblock (2019-05-15).
+% \urlprefix\url{https://ctan.org/pkg/zhlineskip}
+% \urlprefix\CTANurl[文档:]{language/chinese/zhlineskip/zhlineskip.pdf}
+%
% \bibitem{fduthesis}
% 曾祥东.
% \newblock \textit{fduthesis: å¤æ—¦å¤§å­¦è®ºæ–‡æ¨¡æ¿}\allowbreak[EB/OL].
@@ -4076,6 +4084,11 @@
%<thesis> \exp_not:N \zihao { \g_@@_zihao_tl }
%<!thesis> equation-font .initial:V = \c_empty_tl
}
+% \end{macrocode}
+% \end{macro}
+%
+% 借用 \pkg{zhlineskip} å®åŒ…的代ç è®¾ç½®è¡Œé—´å…¬å¼å­—体。
+% \begin{macrocode}
\clist_map_inline:nn
{
array, matrix, pmatrix, bmatrix, Bmatrix, vmatrix, Vmatrix,
@@ -4101,7 +4114,6 @@
\spread@equation
}
% \end{macrocode}
-% \end{macro}
%
% \subsection{数学环境}
%
@@ -5318,23 +5330,24 @@
% \end{macro}
%
% \changes{v2.1.2}{2024/03/31}{改用 \pkg{titletoc} 设置目录格å¼ã€‚}
+% \changes{v2.1.3}{2024/06/28}{更新目录样å¼ã€‚}
% \begin{macrocode}
\tl_set:Nn \SJTU@leaders { \titlerule* [ 4bp ] { . } }
\contentsmargin [ 2.55 em ] { 0 pt }
%<article>\titlecontents { section }
%<!article>\titlecontents { chapter }
[ 0 pt ] { \addvspace { 6 bp } \bfseries }
- { \contentspush { \thecontentslabel \quad } } { }
+ { \contentspush { \thecontentslabel \enskip } } { }
{ \SJTU@leaders \thecontentspage }
%<article>\titlecontents { subsection }
%<!article>\titlecontents { section }
[ 2 em ] { }
- { \contentspush { \thecontentslabel \quad } } { }
+ { \contentspush { \thecontentslabel \enskip } } { }
{ \SJTU@leaders \thecontentspage }
%<article>\titlecontents { subsubsection }
%<!article>\titlecontents { subsection }
[ 4 em ] { }
- { \contentspush { \thecontentslabel \quad } } { }
+ { \contentspush { \thecontentslabel \enskip } } { }
{ \SJTU@leaders \thecontentspage }
% \end{macrocode}
%
@@ -5357,7 +5370,7 @@
{ \SJTU@listof {#4} {#2} }
\titlecontents {#2}
[ 0 pt ] { }
- { \contentspush { #3 \space \thecontentslabel \quad } } { }
+ { \contentspush { #3 \space \thecontentslabel \enskip } } { }
{ \SJTU@leaders \thecontentspage }
\exp_args:Nnv \contentsuse {#2} { ext@ #2 }
}
@@ -6044,7 +6057,7 @@
{ address } { Shanghai,~ P.R.~ China } ,
{ author } { Author } ,
{ supervisor } { Supervisor } ,
- { assoc_supervisor } { Assoc.~ Supervisor } ,
+ { assoc_supervisor } { Assoc.\ Supervisor } ,
{ co_supervisor } { Co-supervisor } ,
{ title_page } { Title~ Page } ,
{ declaration } { Statutory~ Declaration } ,
diff --git a/Master/texmf-dist/source/latex/spelatex/spelatex.dtx b/Master/texmf-dist/source/latex/spelatex/spelatex.dtx
index b906fd628b8..bdedc84d70b 100644
--- a/Master/texmf-dist/source/latex/spelatex/spelatex.dtx
+++ b/Master/texmf-dist/source/latex/spelatex/spelatex.dtx
@@ -1,6 +1,5 @@
% \iffalse meta-comment
%
-%
% Copyright (C) 2024 by Walter Daems <walter.daems@uantwerpen.be>
% and Paul Levrie
%
@@ -34,10 +33,10 @@
\ProvidesFile{spelatex.dtx}
%</driver>
%<*package>
- [2024/06/12 v0.9 SpeLaTeX - Speech-enabled LaTeX (DMW and LVP)]
+ [2024/06/21 v0.91 SpeLaTeX - Speech-enabled LaTeX (DMW and LVP)]
%</package>
-\def\fileversion{0.9}
-\def\filedate{2024/06/12}
+\def\fileversion{0.91}
+\def\filedate{2024/06/21}
%<*driver>
\documentclass[10pt]{ltxdoc}
\usepackage{makeidx}
@@ -79,7 +78,11 @@
% Right brace \} Tilde \~}
%
%
-% \changes{v0.9}{2024/06/12}{. Birth}
+% \changes{v0.90}{2024/05/31}{. Birth}
+% \changes{v0.91}{2024/06/21}{. First overhaul:\\
+% - avoided big active link areas\\
+% - sketched bigger picture, leading to
+% the three project phases.}
%
% \GetFileInfo{spelatex.dtx}
%
@@ -104,14 +107,14 @@
% \spelmacad{CPAN}{see-pan}
% \newrobustcmd\POD{POD}
% \spelmacad{POD}{pod}
-% \newrobustcmd\spelwizardmodule{\texttt{SpeL::Wizard}}
-% \spelmacad{spelwizardmodule}{spel double colon wizard}
%
% \maketitle
% \fvset{gobble=2}
%
% \section{Preface}
%
+% \subsection{Background}
+%
% \begin{spelchunk}
% At our institute, the University of Antwerp in Belgium, the number
% of students with reading and/or writing disorders (or at least
@@ -138,46 +141,152 @@
% group of students. Yes, economic laws also govern teaching!
% \end{spelchunk}
%
+% \subsection{State of the art}
+%
+% \subsubsection{In general}
+%
% \begin{spelchunk}
% Therefore, reverting to readily available text-to-speech software
-% os an obvious choice. Nowadays, special software exists that
+% is an obvious choice. Nowadays, special software exists that
% provides the functionality of reading out loud the contents of
-% electronic documents. For nontechnical subjects,
-% this works fine. However, when it comes to technical course
-% syllabi that are loaded with non-trivial mathematics, the standard
-% text-to-speech packages fail to meet our expectations. In
-% addition, they cannot read a sensible textual description of
-% figures or tables.
+% electronic documents, e.g. NVDA \cite{NVDA} or
+% SprintPlus~\cite{SPRINT}. Moreover, more and more standard PDF
+% readers (such
+% as Acrobat Reader~\cite{ADOBEREADER} have the facility of
+% performing text-to-speech). For nontechnical subjects, this works
+% fine. However, when it comes to technical course syllabi that are
+% loaded with non-trivial mathematics, the standard text-to-speech
+% packages fail to meet our expectations. In addition, they cannot
+% read a sensible textual description of figures or tables.
+% \end{spelchunk}
+%
+% \begin{spelchunk}
+% The issue with reading mathematics will be solved in the future,
+% by enforcing mathematical equations to follow a specific standard
+% that can be parsed and converted, not only into a visual
+% representation, but also into proper text. MathML will be one of
+% the candidates for that format.
+% \end{spelchunk}
+%
+% \begin{spelchunk}
+% The issue with figures and tables can be solved by using the tag
+% infrastructure of PDF. The format provides a system of tags that
+% allow you to provide extra information about the content of a
+% document, in much the same way as you can specify an 'alt' key for
+% an image in HTML. This tag could contain a proper textual
+% description of the figure or the table.
% \end{spelchunk}
%
+% \subsubsection{For \LaTeX}
+%
+% \begin{spelchunk}
+% Currently, the \LaTeX project is investing in enabling \LaTeX{} to
+% partially automate the tagging of PDFs with the \texttt{tagpdf}
+% package~\cite{TAGPDF}, such that the user only has to do a minimal
+% job (adding tags for figures and tables). The goal is to maximize
+% the accessibility of \LaTeX-produced documents.
+% \end{spelchunk}
+%
% \begin{spelchunk}
-% \LaTeX{} is one of the better choices when it comes to typesetting
-% technical subjects, so why not extend \LaTeX{} to provide
-% mathematics-capable text-to-speech facilities? Our \spelatex{}
-% prototype does exactly that. Admittedly, using it causes a
-% significant overhead in writing your text. Therefore we also
-% provide you the \spelbox{} extension for the Org-mode
+% So all is well? Not quite. Though I'm confident that with enough
+% time the community will solve the issue completely, there are
+% still some gaps:
+% \end{spelchunk}
+% \begin{itemize}
+% \spelitem{The tagpdf package is still not a part of the mainstream
+% \LaTeX{}-kernel.}
+% \spelitem{MathML reading support in PDF readers is still in its
+% infancy.}
+% \spelitem{Many PDF readers do not fully support tags yet.}
+% \end{itemize}
+%
+% \subsection{This package}
+%
+% \begin{spelchunk}
+% This package aims to overcome these problems in the meantime and
+% also to contribute to the longterm goal: making perfectly tagged
+% PDFs that are read by any PDF-reader.
+% \end{spelchunk}
+%
+% \begin{spelchunk}
+% In the \emph{first phase} of this package (i.e. the version you are
+% looking at right now), this package reads your \LaTeX{} source,
+% converts the text and the formulas to audio files and equips your
+% PDF with hyperlinks to these files, such that with a few clicks
+% you can listen to your document.
+% The audio files are external files that should be packaged with
+% your PDF to allow a reader to use the document with the available
+% audio.
+% How does it read the formulas? It parses your \LaTeX{} constructs and
+% makes the best of it. This will probably be the part that might
+% survive up until the very last phase of this package.
+% \end{spelchunk}
+%
+% \begin{spelchunk}
+% In a \emph{second phase} of this package, the audio files will be embedded
+% into the PDF. Currently, there are not enough PDF readers that
+% support this feature. Therefore, we decided to keep using the
+% external audio files for now.
+% \end{spelchunk}
+%
+% \begin{spelchunk}
+% In a \emph{third phase}, the audio files \emph{may be} abandoned
+% alltogether, fully switching to tags. And we do think that this
+% should be the end goal. The reasons why we say
+% \emph{'may be'}, are:
+% \end{spelchunk}
+% \begin{itemize}
+% \spelitem{The voices of the current PDF-readers are still not of the
+% same quality as the ones available online. And quality does matter.}
+% \spelitem{The better voices may require cloud access, and probably
+% will not be free, therefore (me) paying for them at document creation
+% time, makes more sense to me than having my students pay
+% for these voices whenever they read the document.}
+% \spelitem{The industry standard Adobe reader is not easily available
+% on open-source operating systems (like UNIX/BSD/Linux-derived
+% platforms). You might consider using emulation using
+% wine~\cite{WINE}, but in that case you can forget about audio. Free
+% access to software is something we consider to be a must-have,
+% rather than a nice-to-have. In addition, Walter feels miserable when
+% he's forced to use anything else than GNU/Linux, because then he
+% keeps moaning that his productivity is ruined.}
+% \end{itemize}
+%
+% \begin{spelchunk}
+% Admittedly, in this first phase, using the \spelatex{} package
+% causes a significant overhead in writing your text. Therefore we
+% also provide you the \spelbox{} extension for the Org-mode
% \cite{ORGMODE} of \GNU{} Emacs \cite{EMACS}. To satisfy your
% curiosity: \spelbox{} stands for ``Speech-Enabled \LaTeX{} By
% Org-mode eXport''.
% \end{spelchunk}
%
% \begin{spelchunk}
-% Will AI take over the role of this package in the future?
-% Undoubtedly so. But for the time being, and also to avoid wasting
-% the enormous amount of energy AI costs us, we hope that you enjoy
+% Will \spelatex{} become obsolete in the future?
+% Undoubtedly so. But for the time being, it answers our desire to
+% provide our students with good audio support when studying their
+% engineering courses. That is now, not only in five years time.
+% \end{spelchunk}
+
+% \begin{spelchunk}
+% We hope that you enjoy
% using our software, or that --- if you are not pleased with it ---
% it triggers you to give us feedback or to come up with a better
-% solution.
+% solution. We especially would like to thank Ulrike Fischer (of the
+% \LaTeX-project and the maintainer of the tagpdf package) for
+% trying to use this package and reaching out to give us feedback.
+% One of her suggestions (not to use big hyperlink-areas) was almost
+% instantly implemented and has been adopted as the standard way of
+% linking.
% \end{spelchunk}
%
% \begin{spelchunk}
% You are free to use our software but kindly ask you to provide a
% mention ``The audio materials of this text have been prepared with
% \spelatex{}/\spelbox{}'' in the section treating copyrights,
-% bibliographic data or any other spot that is suited. I'd also
+% bibliographic data or any other spot that is suited. We'd also
% welcome a short mail of yours telling that you make use of the
-% package. The pleasure of receiving such an e-mail makes my day.
+% package. The pleasure of receiving such an e-mail makes our day.
% \end{spelchunk}
%
% \begin{spelchunk}
@@ -215,8 +324,8 @@
% \spelatex{}.\footnote{Note that multitasking is not reserved for persons
% without visual impairment. Also visually impaired persons can
% benefit from listening to an audiobook while doing other
-% things.} Personally, I often use \spelatex{} to proofread texts as I
-% hear language errors more easily than I spot them while reading.
+% things.} Personally, we often use \spelatex{} to proofread texts as we
+% hear language errors more easily than we spot them while reading.
% \end{spelchunk}
%
% \subsection{The magic under the hood}
@@ -228,9 +337,9 @@
% ecosystem. It consists of three components:
% \end{spelchunk}
% \begin{itemize}
-% \spelitem{An Org-mode exporter called \texttt{ox-spelatex} \cite{OXSPELATEX}}
+% \spelitem{An Org-mode exporter called \texttt{ox-spel} \cite{OXSPELATEX}}
% \spelitem{This \LaTeX{}-package \spelatex{} \cite{SPEL}}
-% \spelitem{A script embeded in the Perl module \spelwizardmodule~\cite{SPELWIZARD}}
+% \spelitem{A script embeded in the Perl module \texttt{SpeL::Wizard} \cite{SPELWIZARD}}
% \end{itemize}
%
% \subsubsection{The overall picture}
@@ -249,7 +358,7 @@
% \end{spelchunk}
%
% \begin{spelchunk}
-% By loading the |spelatex.sty| package in your source
+% By loading the |spel.sty| package in your source
% document, \LaTeX{} will produce a PDF file that references audio
% files that will be generated later (see below). In
% addition, it generates text chunks (i.e. small portions of
@@ -294,11 +403,11 @@
% tool/.style={rectangle,draw,align=center}]
% \node [doc] (utext) at (0,9) {text.org\\\footnotesize(unprepped
% source)};
-% \node [tool] (instrument) at (0,6) {Org-mode exporter\\\footnotesize(\texttt{ox-spelatex})};
+% \node [tool] (instrument) at (0,6) {Org-mode exporter\\\footnotesize(\spelbox)};
% \node [doc] (text) at (0,3) {text.tex\\\footnotesize(prepped source)};
% \draw[->] (utext) -- (instrument);
% \draw[->] (instrument) -- (text);
-% \node [doc] (R) at (-3,0) {spelatex.sty\\\footnotesize(package)};
+% \node [doc] (R) at (-3,0) {spel.sty\\\footnotesize(package)};
% \node [tool] (latex) at (0,0) {\LaTeX\\\footnotesize(compiler)};
% \node [doc] (pdf) at (0,-3) {text.pdf\\\footnotesize(PDF with\\\footnotesize hyperlinks)};
% \node [doc] (spelidx) at (6,-3) {text.spelidx\\\footnotesize(index file)};
@@ -313,7 +422,7 @@
% \draw[->] (latex) edge[out=10,in=90] (aux);
% \draw[->] (latex) edge[out=-10,in=90] (files);
% \node [tool] (engine) at (6,-6) {\spelpl{}\\
-% \footnotesize(\spelwizardmodule{} engine)};
+% \footnotesize(\spelatex{} engine)};
% \node [tool] (t2s) at (1.5,-6) {text-to-speech\\engine};
% \draw[->] (files) -- (engine);
% \draw[->] (spelidx) -- (engine);
@@ -339,13 +448,13 @@
% unprepped source. Read the Orgmode
% documentation on \LaTeX{} and \spelatex{}-exporting to get to know
% the format. The Orgmode \spelatex{} exporter, creates a fully
-% equipped \LaTeX{} file of your text. We call this the prepped source. You can
+% equiped \LaTeX{} file of your text. We call this the prepped source. You can
% also start by composing this file yourself.
-% If your prepped source file uses the \spelatex{} style file, then
+% If you prepped source file uses the \spelatex{} style file, than
% your compiler will generate a PDF file with hyperlinks, a
% dot aawks-file and a dot spellindex-file together with a directory full of
-% dot tech files containing the text chunks to be processed by
-% \spelpl. This is a perl script that converts the chunks into
+% dot tex files containing the text chunks to be processed by the
+% \spelpl-engine. This is a perl script that converts the chunks into
% plain text readable spel files. The script is called spel dash
% wizard dot pl. It also creates a playlist and audio files using a
% text-to-speech engine. In this case, these are
@@ -363,6 +472,28 @@
% \label{fig:setup}
% \end{figure}
%
+% \begin{spelchunk}
+% You might wonder: where are the links? Well, there are three
+% variants:
+% \end{spelchunk}
+% \begin{itemize}
+% \spelitem{\emph{area links}, which are almost exclusively
+% used for equations, tables or figures. These links make an entire
+% rectangle active, linking to the corresponding audio file.}
+% \spelitem{\emph{group links}, indicated by small right-pointing
+% triangles next to section headers. These cause all blocks in the
+% section to be read one by one.}
+% \spelitem{\emph{hidden links}, wich are, as the name suggests,
+% hidden to avoid visual disturbance of the text; every
+% paragraph, footnote and list is activated by a link on the
+% whitespace before the first line of the chunk. Try it! Once you
+% are aware that these regions are active, you'll find them
+% easily. In addition, not using the full paragraph as an active
+% region, allows existing hyperlinks (like for citations, references
+% or URLs) to still function.}
+% \end{itemize}
+%
+%
% \subsubsection{Implicit spelchunks}
% \spelmacad{usepackage}[1]{the usepackage #1 macro}
% \spelmacad{title}{the title macro}
@@ -390,7 +521,7 @@
% that follows as a first explicit argument, i.e. |\item blabla|
% should be replaced by |\spelitem{blabla}|.
% We call these \LaTeX-fragments \emph{defunct implicit
-% spelchunks}. They should have been implicit, but I could not get
+% spelchunks}. They should have been implicit, but we could not get
% that to work without problems. Therefore you need to mark them
% explicitly as |\spelitem| constructs.
% \end{spelchunk}
@@ -400,7 +531,7 @@
% One would hope that displaymath environments are also implicit
% spelchunks. However, overriding environments in \LaTeX{} is a tricky
% business. In view of this, the \spelatex{} package keeps away from
-% this, and I've chosen to treat displaymath environments (like
+% this, and we've chosen to treat displaymath environments (like
% |equation|, |eqnarray|, |gather|, |align|, |alignat|) the same way
% as tables or figures, i.e. you need to embed the in a |spelchunk|
% environment. The only difference between math environments and
@@ -472,7 +603,7 @@
% This brings us to the two top boxes in the diagram of
% Fig.~\ref{fig:setup}. If you prepare your manuscript in Org-mode,
% and use the Org-mode exporter, you don't have to worry about explicit
-% spelchunks, or defunct implicit spelchunks. Therefore, I encourage
+% spelchunks, or defunct implicit spelchunks. Therefore, we encourage
% you to use Emacs as your editor. The learning
% curve is steep, but the rewards regarding ease-of-use are huge.
% In that way, you can focus on providing textual descriptions for
@@ -485,7 +616,7 @@
% independent of Org-mode. It also shows that if you don't
% want to use Emacs and Org-mode, you will suffer some considerable
% pain in equipping your manuscript with an overload of |spelchunk|
-% environments. I have only one advice: don't use the \spelatex{}
+% environments. We have only one advice: don't use the \spelatex{}
% outside \spelbox{}. Outside a proper boxed confinement,
% spells easily become curses\ldots
% \end{spelchunk}
@@ -518,8 +649,8 @@
% \subsection{Added value}
%
% \begin{spelchunk}
-% Why would it make sense to use \spelatex? I think there are many
-% selling points. I can mention a few:
+% Why would it make sense to use \spelatex? We think there are many
+% selling points. We can mention a few:
% \end{spelchunk}
% \begin{description}
% \spelitem[Minimal overhead]{
@@ -533,7 +664,7 @@
% the effort of preparing your manuscript. There are no license
% costs involved.\\
% You could also consider to use an online paying text-to-speech
-% service. As an example, I incorporated a connection to Amazon's
+% service. As an example, We incorporated a connection to Amazon's
% Polly \cite{AWSPOLLY}.\\
% In addition, if your user has a better-quality (maybe
% commercial) text-to-speech system, he/she can reconvert the text
@@ -553,15 +684,27 @@
% \section{Installation}
%
% \subsection{The \spelatex{} package}
-
% \begin{spelchunk}
-% Most \LaTeX{} distributions use \CTAN{} as their main package source
-% and therefore will include \spelatex.
+% If you are a package manager then you'll know how to
+% prepare an installation package for \spelatex.
+% \end{spelchunk}
+%
+% \begin{spelchunk}
+% If you are a normal user then you have two options. First,
+% check if there is a package that your favorite \LaTeX{}
+% distributor has prepared for you. Most of the major distributions
+% (like e.g. \TexLive{} or \MikTeX{}) do so.\\
+% Second, grab the TDS package
+% from \CTAN{} \cite{CTAN} (spel.TDS.zip) and unzip it somewhere in your
+% own TDS tree, regenerate your filename database and off you go.
+% In any case, make sure that \LaTeX{} finds the file |spel.sty|.
% \end{spelchunk}
%
-% %\begin{spelchunk}
-% If this is not the case, contact me. I'll be glad to provide you
-% with TDS file that you can unpack in your local TDS tree.
+% \begin{spelchunk}
+% The \spelatex{} package uses a number of auxiliary packages, fetch them
+% from \CTAN{} \cite{CTAN} if your \TeX{} distributor does not provide
+% them. The ones used are: |expl3|, |hyperref|, |ifthen|,
+% |fancyvrb|, |newfile|, |rotating|, |babel|, |kvoptions|.
% \end{spelchunk}
%
% \subsection{The \spelpl{} speech generator}
@@ -576,9 +719,9 @@
% \end{spelchunk}
%
% \begin{spelchunk}
-% The only thing to do is to install the
-% \spelwizardmodule~module. You can do this with the perl pacakge
-% manager for your interpreter.
+% The only thing to do is to install the |SpeL::Wizard|
+% module. You can do this with the perl pacakge manager for your
+% interpreter.
% \end{spelchunk}
%
% \begin{spelchunk}
@@ -588,8 +731,8 @@
%
% \begin{spelchunk}
% On \GNU/Linux and MAC: |$ cpanm SpeL::Wizard|\\
-% When using Strawberry perl: |$ cpan SpeL::Wizard|\\
-% When using ActiveState perl: |$ ppm install SpeL-Wizard|
+% On Strawberry perl: |$ cpan SpeL::Wizard|\\
+% On ActiveState perl: |$ ppm install SpeL-Wizard|
% \end{spelchunk}
%
% \begin{spelchunk}
@@ -600,7 +743,7 @@
% \subsubsection{The configuration file}
% \begin{spelchunk}
% Finally, you need to provide \spelpl{} with an appropriate
-% config-file that sets up the text-to-speech conversion.
+% config-file, named |tts.conf| that sets up the text-to-speech conversion.
% Below you can find a setup for Festival \cite{FESTIVAL}:
% \begin{Verbatim}
% [engine]
@@ -615,6 +758,21 @@
% english=en1_mbrola
% \end{Verbatim}
% \end{spelchunk}
+%
+% \begin{spelchunk}
+% And additionally, for the Microsoft users a setup for Balabolka \cite{BALABOLKA}:
+% \begin{Verbatim}
+% [engine]
+% tts=balabolka
+%
+% [languagetags]
+% english=en-us
+%
+% [voices]
+% english=Zira
+% \end{Verbatim}
+% \end{spelchunk}
+%
% \begin{spelchunk}
% The tts configuration parameter defines the speech engine to use.
% The languagetags section defines how the babel languages are mapped to
@@ -630,20 +788,28 @@
% \end{Verbatim}
% \end{spelchunk}
% \begin{spelchunk}
+% If that variable is not set, the script will look in a subdirectory
+% |.spel_wizard| of your home-folder (or |%userprofile%| in
+% MS-Windows), or it will take the default that came with the
+% |SpeL::Wizard| module.
+% \end{spelchunk}
+%
+% \begin{spelchunk}
% Be aware that you need to install your text-to-speech tool yourself
-% according to the documentation provided by the tool provider. In
+% according to the documentation provided by the tool provider.
+% In addition, make sure it the executable is in your search path. In
% case you are using an online text-to-speech service provider you
% will need to get an account on their cloud platform and setup
% credentials and whatever is needed to get going. Providing
-% assistance for this is beyond the aim of this manual.%
+% assistance for this is beyond the aim of this manual.
% \end{spelchunk}
%
% \subsection{The PDF viewer}
%
% \begin{spelchunk}
% You need to make sure you have a PDF-viewer that supports links
-% containing 'run:' tags. E.g., xpdf does not \cite{XPDF}, evince
-% complains about security risks \cite{EVINCE}, but okular
+% containing 'run' tags. E.g., xpdf \cite{XPDF} does not, evince
+% \cite{EVINCE} complains about security risks, but okular
% \cite{OKULAR} and Adobe Reader \cite{ADOBEREADER} do. So does
% PDF-XChange Viewer \cite{PDFXCHANGE}.
% \end{spelchunk}
@@ -652,13 +818,16 @@
% \begin{spelchunk}
% When clicking a \spelatex-enabled item in your PDF-file, your media
-% player is started to play the |.ogg| or |.m3u|-file. On \GNU/Linux
-% most media players work fine (SoX, totem, vlc, \ldots).\\
-% On windows, I'd recommend using vlc. It works out of the box.
+% player is started to play the |.ogg| or |.m3u|-file. On GNU/Linux
+% most media players work fine (SoX, totem, vlc, \ldots).
+% \end{spelchunk}
+%
+% \begin{spelchunk}
+% On windows, we recommend using vlc. It works out of the box.
% When usign the stock Windows Media Player, you will need to add
% every folder that contains a PDF you'd like to have read, to your
% Media Player library. Search the internet to find instructions on
-% that and be prepared: in line with Microsoft standard practice it
+% that and be prepared: in line with Microsoft's standard practice it
% is well hidden in the interface.
% \end{spelchunk}
%
@@ -691,7 +860,7 @@
% required macros.
% \end{spelchunk}
%
-% \subsubsection{Treating the implicit spelchunks}
+% \subsubsection{Treat the implicit spelchunks}
% \begin{spelchunk}
% The texts of chapter, (sub)section titles, a.s.o. will be formatted
% automatically such that they are hyperlinked to the appropriate
@@ -710,7 +879,7 @@
% \begin{spelchunk}
% Example:
% \begin{Verbatim}
-% I like
+% We like
% \begin{itemize}
% \spelitem{apples,}
% \spelitem{pears, and}
@@ -732,12 +901,15 @@
% boilerplate work.
% \end{spelchunk}
%
-% \subsubsection{Treating the explicit spelchunks}
+% \subsubsection{Treat the explicit spelchunks}
%
% \begin{spelchunk}
% \DescribeEnv{spelchunk}
% Use this environment to embed the chunks of text in that you want
-% to generate audio for.
+% to generate audio for. In case the content is an equation, a
+% figure or a table, we recommend specifying |arealink| as the
+% optional argument to the |spelchunk| environment. It makes the
+% entire equation an active hyperlink.
% \end{spelchunk}
%
% \begin{spelchunk}
@@ -748,10 +920,12 @@
% \begin{Verbatim}
% \begin{spelchunk}
% An orderinary paragraph must be embedded in this environment.
-% The same holds for equations!
+% The same holds for equations! However, then we recommend using
+% the |arealink| option, as that makes the full area of the
+% equation clickable and avoids an empty white line before the
+% equation.
% \end{spelchunk}
-%
-% \begin{spelchunk}
+% \begin{spelchunk}[arealink]
% \begin{align}
% E &= m c^2\\
% e^{j\pi} &= -1
@@ -760,7 +934,7 @@
% \end{Verbatim}
%
%
-% \subsubsection{Manually providing text to read when needed}
+% \subsubsection{Manually provide text to read when needed}
% \begin{spelchunk}
% \DescribeEnv{spelchunkad}
% If you want a different text to be used for the previous
@@ -778,7 +952,7 @@
%
% \begin{spelchunk}
% Example:\\
-% {\footnotesize (note: the example below is not \spelatex{}-enabled because it also
+% {\footnotesize (note: the example below is not \spelatex{}-enabled because it
% generates internal package problems)}
% \end{spelchunk}
% \begin{Verbatim}
@@ -802,7 +976,7 @@
% \begin{spelchunk}
% Example:\\
% {\footnotesize (note: the example below is not \spelatex{}-enabled because it
-% generates internal package problems also)}
+% generates internal package problems)}
% \end{spelchunk}
% \begin{Verbatim}
% \begin{spelchunk}
@@ -874,9 +1048,9 @@
% \begin{spelchunk}
% This allows easy specification of an illustration as:
% \begin{Verbatim}
-% \begin{proof}[Illustration]{solving a quadratic equation}
-% blabla
-% \end{proof}
+% \begin{proof}[Illustration]{solving a quadratic equation}
+% blabla
+% \end{proof}
% \end{Verbatim}
% \end{spelchunk}
% \begin{spelchunk}
@@ -943,15 +1117,17 @@
% This macro typesets an enumeration set and makes sure \spelpl{}
% can read it properly.
% \end{spelchunk}
+% \begin{spelchunk}
% \begin{Verbatim}
% \begin{equation}
% P = \setenum{ 2, 3, 5, 7, 11, 13, \ldots }
% \end{equation}
% \end{Verbatim}
+% \end{spelchunk}
%
% \DescribeMacro{\setdesc}
% \begin{spelchunk}
-% This macro typesets a descriptive set and makes sure \spelpl{}
+% This macro typesets an enumeration set and makes sure \spelpl{}
% can read it properly.
% \end{spelchunk}
% \begin{spelchunk}
@@ -1043,8 +1219,7 @@
% Consider the following simple definition of a polynomial function and
% check its spoken version by clicking on it.
% \end{spelchunk}
-%
-% \begin{spelchunk}
+% \begin{spelchunk}[arealink]
% \begin{equation}
% f(x) = x^{5}- x^4 + 7 x^3 + 3 x^2 - 8 x + 23
% \end{equation}
@@ -1066,7 +1241,7 @@
% equal to $\tan\alpha = -\frac{t}{2}$, the equation of the
% reflected ray is given by
% \end{spelchunk}
-% \begin{spelchunk}
+% \begin{spelchunk}[arealink]
% \[
% y-9+\frac{t^2}{4} = -\frac{4t}{4-t^2} \cdot (x-t)
% \]
@@ -1079,9 +1254,9 @@
% voorleesstem de geselecteerde taal zal volgen.
% \end{spelchunk}
%
-% \begin{spelchunk}
+% \begin{spelchunk}[arealink]
% \[
-% y-9+\frac{t^2}{4} = -(x-t) \cdot \frac{4t}{4-t^2}
+% y-9+\frac{t^2}{4} = -\frac{4t}{4-t^2} \cdot (x-t)
% \]
% \end{spelchunk}
@@ -1113,7 +1288,7 @@
% \newblock \url{http://www.cpan.org}.
% \newblock online, accessed in August 2021.
%
-% \end{thebibliography}{99}
+% \end{thebibliography}
%
% \end{document}
% \end{VerbatimOut}
@@ -1134,8 +1309,7 @@
% \end{spelchunk}
%
% \subsection{Numbers}
-%
-% \begin{spelchunk}
+% \begin{spelchunk}[arealink]
% \begin{align}
% \pi\\
% -31415\\
@@ -1149,7 +1323,7 @@
%
% \subsection{Fractions}
% \subsubsection{A fraction only containg numbers}
-% \begin{spelchunk}
+% \begin{spelchunk}[arealink]
% \begin{align}
% x &= - \frac{1}{2} \\
% y &= - \sqrt{\frac{\pi}{2}}
@@ -1157,7 +1331,7 @@
% \end{spelchunk}
%
% \subsubsection{A fraction with a little more under the hood}
-% \begin{spelchunk}
+% \begin{spelchunk}[arealink]
% \begin{align}
% u &= - \frac{x^2+35}{\sqrt{12}} \\
% v &= - \frac{\sqrt{\frac{\pi}{2}}}{-3x^2+3}
@@ -1166,8 +1340,8 @@
%
%
% \subsection{Simple expressions}
-% \subsubsection{A polynomial function}
-% \begin{spelchunk}
+% \subsubsection{A polynomial function}%
+% \begin{spelchunk}[arealink]
% \begin{equation}
% f(x) = x^{5}- x^4 + 7 x^3 + 3 x^2 - 8 x + 23
% \end{equation}
@@ -1177,7 +1351,7 @@
% \begin{spelchunk}
% Here's de Moivre's formula:
% \end{spelchunk}
-% \begin{spelchunk}
+% \begin{spelchunk}[arealink]
% \begin{equation}
% \left(\cos x+j\sin x\right)^n=\cos(nx)+j\sin(nx)
% \end{equation}
@@ -1186,7 +1360,7 @@
% \begin{spelchunk}
% Euler's relationship:
% \end{spelchunk}
-% \begin{spelchunk}
+% \begin{spelchunk}[arealink]
% \begin{equation}
% e^{j \phi} = \cos \phi + j \sin \phi
% \end{equation}
@@ -1214,7 +1388,7 @@
% \texttt{\textbackslash{}setenum} and
% \texttt{\textbackslash{}setdesc}:
% \end{spelchunk}
-% \begin{spelchunk}
+% \begin{spelchunk}[arealink]
% \begin{align}
% P &= \setenum{ 2, 3, 5, 7, 11, 13, \ldots }\\
% P &= \setdesc{ n \in N \mid n \text{~is prime}}
@@ -1224,6 +1398,8 @@
% \subsection{Matrices}
% \begin{spelchunk}
% How about some linear algebra?
+% \end{spelchunk}
+% \begin{spelchunk}[arealink]
% \begin{align}
% \begin{bmatrix}
% 3 & 4 \\
@@ -1372,7 +1548,7 @@
% \section{Implementation}
% \begin{spelchunk}
% To ease the implementation work and because raw \LaTeX{} code is
-% difficult to read on itself, I took the liberty of not providing
+% difficult to read on itself, We took the liberty of not providing
% this section with speech chunks (except for this introduction
% text).
% \end{spelchunk}
@@ -1425,6 +1601,8 @@
bookmarksopen=true,
urlcolor=black}
\RequirePackage{kvoptions}
+\RequirePackage{xkeyval}
+\RequirePackage{marginnote}
% \end{macrocode}
%
% \subsection{Options}
@@ -1633,9 +1811,6 @@
\spel@registerelement{author}
% \end{macrocode}
%
-% \subsubsection{Boxed material}
-% by redefining the makebox, mbox and usebox commands, we can create
-%
% \subsubsection{Table of contents}
% \begin{macrocode}
\ifspel@disabled\else
@@ -1748,7 +1923,7 @@
\setcounter{spel@chunk}{0}% need this because counter resetting fails
\spel@@sect{#1}{#2}{#3}{#4}{#5}{#6}[#7]{%
\href{run:\audiodir/\spel@@optpart\thesubparagraph.\spel@format}{#8}\hfill%
- \href{run:\audiodir/\spel@@optpart\thesubparagraph.m3u}{\textcolor{black!50}{\triangleright}}}%
+ \href{run:\audiodir/\spel@@optpart\thesubparagraph.m3u}{\textcolor{black!25}{$\triangleright$}}}%
\def\spel@@label{\ifnum #2>\c@secnumdepth\else#1 \csname the#1\endcsname\fi}
\spel@idxwrite{\spel@@label}{\spel@@optpart\thesubparagraph}%
\spel@chunkwrite{\spel@@optpart\thesubparagraph}{#8}%
@@ -1786,8 +1961,9 @@
\let\spel@@fntext\@footnotetext
\long\def\@footnotetext#1{%
\stepcounter{spel@footnote}%
+ \settowidth\spel@mptboxwidth{\usebox\spel@mptbox}%
\spel@@fntext{%
- \href{run:\audiodir/footnote-\thespel@footnote.\spel@format}{#1}}
+ \hspace*{-\spel@mptboxwidth}\href{run:\audiodir/footnote-\thespel@footnote.\spel@format}{\usebox\spel@mptbox}#1}%
\spel@idxwrite{footnote}{footnote-\thespel@footnote}%
\spel@chunkwrite{footnote-\thespel@footnote}{#1}%
}
@@ -1825,10 +2001,10 @@
% \begin{macrocode}
\def\spelitem@intone#1{%
\stepcounter{spel@chunk}%
+ \settowidth\spel@mptboxwidth{\usebox\spel@mptbox}%
\spel@idxwrite{item}{\spel@@optpart\thesubparagraph-\thespel@chunk}%
\spel@chunkwrite{\spel@@optpart\thesubparagraph-\thespel@chunk}{#1}%
- \item \href{run:\audiodir/\spel@@optpart\thesubparagraph-\thespel@chunk.\spel@format}{#1}
-}
+ \item \hspace*{-\spel@mptboxwidth}\href{run:\audiodir/\spel@@optpart\thesubparagraph-\thespel@chunk.\spel@format}{\usebox\spel@mptbox}#1}
% \end{macrocode}
% \end{macro}
%
@@ -1838,10 +2014,10 @@
% \begin{macrocode}
\def\spelitem@inttwo#1#2{%
\stepcounter{spel@chunk}%
+ \settowidth\spel@mptboxwidth{\usebox\spel@mptbox}%
\spel@idxwrite{item}{\spel@@optpart\thesubparagraph-\thespel@chunk}%
\spel@chunkwrite{\spel@@optpart\thesubparagraph-\thespel@chunk}{#1 . #2}%
- \item[#1] \href{run:\audiodir/\spel@@optpart\thesubparagraph-\thespel@chunk.\spel@format}{#2}
-}
+\item[#1] \hspace*{-\spel@mptboxwidth}\href{run:\audiodir/\spel@@optpart\thesubparagraph-\thespel@chunk.\spel@format}{\usebox\spel@mptbox}#2}
% \end{macrocode}
% \end{macro}
%
@@ -1868,6 +2044,11 @@
% \begin{environment}{spelchunk}
% The |spelchunk| environment is used to define explicit speech chunks.
% \begin{macrocode}
+\newlength\spel@mptboxwidth
+\newsavebox\spel@mptbox
+\savebox\spel@mptbox{\textcolor{black!25}{$\qquad$}}
+\newif\ifspel@chunkarealink
+\define@key{spelchunk}{arealink}[]{\spel@chunkarealinktrue}
\ifspel@disabled\def\spelchunk{}\else
\def\spelchunk{%
\catcode`\^^M=\active%
@@ -1879,7 +2060,13 @@
\def\endspelchunk{%
\end{VerbatimOut}%
\catcode`\^^M=5\relax%
- \href{run:\audiodir/\spel@@optpart\thesubparagraph-\thespel@chunk.\spel@format}{\input{./\chunkdir/\spel@@optpart\thesubparagraph-\thespel@chunk}\leavevmode}%
+ \ifspel@chunkarealink%
+ \href{run:\audiodir/\spel@@optpart\thesubparagraph-\thespel@chunk.\spel@format}{\input{./\chunkdir/\spel@@optpart\thesubparagraph-\thespel@chunk}}%
+ \else%
+ \settowidth\spel@mptboxwidth{\usebox\spel@mptbox}%
+ \hspace*{-\spel@mptboxwidth}\href{run:\audiodir/\spel@@optpart\thesubparagraph-\thespel@chunk.\spel@format}{\usebox\spel@mptbox}\input{./\chunkdir/\spel@@optpart\thesubparagraph-\thespel@chunk}%
+ \fi%
+ \spel@chunkarealinkfalse%
}%
\fi
% \end{macrocode}
@@ -1891,7 +2078,7 @@
% This is macro that deals with the optional arguments of the
% |spelchunk| envronment.
% \begin{macrocode}
-\def\spelchunk@opt[#1]{\fvset{#1}\spelchunk@int}
+\def\spelchunk@opt[#1]{\setkeys{spelchunk}{#1}\spelchunk@int}
% \end{macrocode}
% \end{macro}
%
@@ -1905,7 +2092,7 @@
% \end{macrocode}
% \end{macro}
%
-% \subsubsection{Provideing an explicit audiodescription for a spelchunk}
+% \subsubsection{Explicit spelchunks}
%
% \begin{environment}{spelchunkad}
% The |spelchunkad| environment is used to override a previous speech
@@ -2052,10 +2239,10 @@
% We immediately provide some standard constructs, which are to be
% ignored:
% \begin{macrocode}
-\spelmacad{spelatex}{spee-laytech}
+\spelmacad{spelatex}{spee-lay-tech}
\spelmacad{spelbox}{spel-box}
\spelmacad{spelpl}{spel wizzard dot pl}
-\spelmacad{LaTeX}{laytech}
+\spelmacad{LaTeX}{lay-tech}
\spelmacad{TeX}{tech}
\spelmacad{textsf}[1]{#1}
\spelmacad{texttt}[1]{#1}
@@ -2107,7 +2294,7 @@
\spelenvad{center}{}{}
% \end{macrocode}
%
-% \subsection{Implementing the extra math commands}
+% \subsection{Extra math commands}
%
% The commands are only loaded if the package option |extramath| is
% provided:
@@ -2145,35 +2332,71 @@
%</package>
% \end{macrocode}
% \fi
-
+%
+% \section{TODO}
+% \begin{spelchunk}[arealink]
+% As long as there are things on my todo list, We have a reason to
+% live.
+% \end{spelchunk}
+% \begin{itemize}
+% \spelitem{provide enable/disable switch to disable certain ranges in
+% text, e.g. the implementation range in this document}
+% \spelitem{enable bibliography and citation stuff}
+% \end{itemize}
%
% \bibliographystyle{alpha}
%
% \begin{thebibliography}{99}
%
-% \bibitem{EMACS}
-% The Emacs An extensible, customizable, free text editor --- and
-% more.
-% \newblock \url{https://www.gnu.org/software/emacs/}.
+% \bibitem{NVDA}
+% NVDA from NV Access, empowering lives through non-visual access to technology
+% \newblock \url{https://www.nvaccess.org}
+% \newblock online, accessed in June 2024.
+%
+% \bibitem{SPRINT}
+% SprintPlus, helping people with dyslexia
+% \newblock \url{https://www.sprintplus.be/en}
+% \newblock online, accessed in June 2024.
+%
+% \bibitem{ADOBEREADER}
+% Adobe Reader, a PDF reader from Adobe.
+% \newblock \url{https://get.adobe.com/}
% \newblock online, accessed in May 2024.
%
+% \bibitem{TAGPDF}
+% TagPDF - Tools for experimenting with tagging using pdfLaTeX and
+% LuaLaTeX.
+% \newblock \url{https://ctan.org/pkg/tagpdf}
+% \newblock online, accessed in June 2024.
+%
+% \bibitem{WINE}
+% Wine - Wine Is Not an Emulator - running windows applications on POSIX-compliant systems.
+% \newblock \url{https://www.winehq.org}
+% \newblock online, accessed in June 2024.
+%
% \bibitem{ORGMODE}
% Org Mode --- your life in plain text.
% \newblock \url{https://orgmode.org/}.
% \newblock online, accessed in May 2024.
%
+% \bibitem{EMACS}
+% The Emacs An extensible, customizable, free text editor --- and
+% more.
+% \newblock \url{https://www.gnu.org/software/emacs/}.
+% \newblock online, accessed in May 2024.
+%
% \bibitem{OXSPELATEX}
% Org Mode SpeLaTeX Exporter --- SpeLaTeX made easy.
% \newblock \url{https://www.melpa.org/#/ox-spelatex}
% \newblock (not yet online)
%
% \bibitem{SPEL}
-% SpeL --- Speech-enabled LaTeX.
+% SpeL --- Speech-enabled \LaTeX.
% \newblock \url{https://ctan.org/pkg/spel}
% \newblock online, accessed in June 2024.
%
% \bibitem{SPELWIZARD}
-% SpeL::Wizard --- Incantating LaTeX into natural lanuage
+% SpeL::Wizard --- Incantating \LaTeX{} into natural lanuage
% \newblock \url{https://metacpan.org/pod/SpeL::Wizard}
% \newblock online, accessed in June 2024.
%
@@ -2222,11 +2445,6 @@
% \newblock \url{https://okular.kde.org}.
% \newblock online, accessed in May 2024.
%
-% \bibitem{ADOBEREADER}
-% Adobe Reader, a PDF reader from Adobe.
-% \newblock \url{https://get.adobe.com/}
-% \newblock online, accessed in May 2024.
-%
% \bibitem{PDFXCHANGE}
% PDF XChange Viewer, a PDF reader from Tracker Software.
% \newblock \url{https://www.pdf-xchange.com/}
diff --git a/Master/texmf-dist/source/latex/subeqn/subeqn.dtx b/Master/texmf-dist/source/latex/subeqn/subeqn.dtx
index cc49b5f0b5a..b9ce8706822 100644
--- a/Master/texmf-dist/source/latex/subeqn/subeqn.dtx
+++ b/Master/texmf-dist/source/latex/subeqn/subeqn.dtx
@@ -1,48 +1,49 @@
% \iffalse meta-comment
%
-% Copyright 1994-2004 Johannes Braams. All rights reserved.
-%
+% Copyright 1999-2024 Johannes L. Braams. All rights reserved.
+%
% This file is part of the subeqn package.
% ----------------------------------------
-%
+%
% It may be distributed and/or modified under the
-% conditions of the LaTeX Project Public License, either version 1.3
+% 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
% http://www.latex-project.org/lppl.txt
-% and version 1.3 or later is part of all distributions of LaTeX
-% version 2003/12/01 or later.
-%
+% and version 1.3c or later is part of all distributions of LaTeX
+% version 2008 or later.
+%
% This work has the LPPL maintenance status "maintained".
-%
+%
% The Current Maintainer of this work is Johannes Braams.
-%
-% The list of all files belonging to the subeqn package is
-% given in the file `manifest.txt'.
-%
+%
+% The list of all files belonging to the supertabular package is
+% given in the file `MANIFEST.
+%
% 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
-% \CheckSum{76}
+%
+% \CheckSum{84}
% \iffalse
-%% File: `subeqn.dtx'
-%% Copyright (C) 1999-2004
-%% Donald Arsenau (asnd at reg.triumf.ca),
-%% Johannes Braams (TeXniek at braams.cistron.nl)
-%%
+% Copyright (C) 1999-2024
+% Donald Arsenau at reg.triumf.ca,
+% Johannes Braams texniek at texniek.nl
+%
%<*dtx>
\ProvidesFile{subeqn.dtx}
%</dtx>
%<package>\NeedsTeXFormat{LaTeX2e}[1998/06/01]
%<package>\ProvidesPackage{subeqn}
-%<sample>\ProvidesFile{subeqn.tex}
+%<sample>\ProvidesFile{subeqn-sample.tex}
%<driver>\ProvidesFile{subeqn.drv}
%\ProvidesFile{subeqn.dtx}
- [2004/04/15 v2.0b subnumbering of equations]
+ [2024/07/21 v2.0c subnumbering of equations]
%<*driver>
\documentclass{ltxdoc}
\begin{document}
+\pagestyle{myheadings}
\providecommand{\Lenv}[1]{\textsf{#1}}
\providecommand{\Lopt}[1]{\textsf{#1}}
\providecommand{\pkg}[1]{\texttt{#1}}
@@ -60,6 +61,10 @@
% \date{\filedate}
% \maketitle
%
+% \markboth
+% {subeqn package version \fileversion\space as of \filedate}
+% {subeqn package version \fileversion\space as of \filedate}
+%
% \section{Introduction}
%
% Sometimes it is necessary to be able to refer to subexpressions
@@ -165,7 +170,7 @@
\global\c@equation\z@
}{%
% \end{macrocode}
-% When the environment is finished we restore the value ot the
+% When the environment is finished we restore the value of the
% \texttt{equation} counter.
% \begin{macrocode}
\global\c@equation\c@mainequation
@@ -220,7 +225,14 @@
\usepackage{subeqn}
\begin{document}
-This is an example ot the use of the \texttt{subeqations} package.
+\title{Sample sub-equations}
+\author{Johannes L. Braams}
+\date{\today}
+\maketitle
+
+\noindent
+This is an example of the use of the \texttt{subeqations}
+package. First we have a normal \textsf{equation} environment.
\begin{equation}
\label{a}
a^2 + b^2 = c^2
@@ -247,6 +259,7 @@ Now we start sub-numbering.
and~\ref{c2}.
\end{subequations}
+\noindent
Now lets start a \textsf{subeqnarray} environment.
\begin{subeqnarray}
\label{d}
diff --git a/Master/texmf-dist/source/latex/subeqn/subeqn.ins b/Master/texmf-dist/source/latex/subeqn/subeqn.ins
index e9e8689856d..b3e295f28c4 100644
--- a/Master/texmf-dist/source/latex/subeqn/subeqn.ins
+++ b/Master/texmf-dist/source/latex/subeqn/subeqn.ins
@@ -3,50 +3,41 @@
%% driver files from the doc files in this package when run through
%% LaTeX or TeX.
%%
-%% Copyright 1989-2004 Johannes L. Braams. All rights reserved.
-%%
-%% This file is part of the subeqn package.
-%% ----------------------------------------
-%%
-%% It may be distributed and/or modified under the
-%% conditions of the LaTeX Project Public License, either version 1.3
-%% of this license or (at your option) any later version.
-%% The latest version of this license is in
-%% http://www.latex-project.org/lppl.txt
-%% and version 1.3 or later is part of all distributions of LaTeX
-%% version 2003/12/01 or later.
-%%
-%% This work has the LPPL maintenance status "maintained".
-%%
-%% The Current Maintainer of this work is Johannes Braams.
-%%
-%% The list of all files belonging to the subeqn package is
-%% given in the file `manifest.txt.
+%%
+%% This file is distributed in the hope that it will be useful,
+%% but WITHOUT ANY WARRANTY; without even the implied warranty of
+%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
%%
-%% 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.
+%% IMPORTANT NOTICE:
+%%
+%% Copyright (C) 1999-2024 Johannes L. Braams. All rights reserved.
+%%
+%% This program can be redistributed and/or modified under the terms
+%% of the LaTeX Project Public License Distributed from CTAN
+%% archives in directory macros/latex/base/lppl.txt; either
+%% version 1.3c of the License, or any later version.
%%
%% --------------- start of docstrip commands ------------------
%%
-\def\filedate{2004/04/15}
\def\batchfile{subeqn.ins}
\input docstrip.tex
+\keepsilent
\preamble
+This is a generated file.
-Copyright (C) 1999-2004 Johannes Braams. All rights reserved.
+Copyright (C) 1999-2024 Johannes Braams. All rights reserved.
This file was generated from file(s) of the subeqn package.
-----------------------------------------------------------
It may be distributed and/or modified under the
-conditions of the LaTeX Project Public License, either version 1.3
+conditions of the LaTeX Project Public License, either version 1.3Ñ
of this license or (at your option) any later version.
The latest version of this license is in
http://www.latex-project.org/lppl.txt
-and version 1.3 or later is part of all distributions of LaTeX
-version 2003/12/01 or later.
+and version 1.3Ñ or later is part of all distributions of LaTeX
+version 2008 or later.
This work has the LPPL maintenance status "maintained".
@@ -57,7 +48,7 @@ subeqn package. You may however distribute the subeqn package
without such generated files.
The list of all files belonging to the subeqn package is
-given in the file `manifest.txt.
+given in the file `MANIFEST'.
The list of derived (unpacked) files belonging to the distribution
and covered by LPPL is defined by the unpacking scripts (with
@@ -70,7 +61,7 @@ extension .ins) which are part of the distribution.
% The sample file
-\generateFile{subeqn.tex}{t}{\from{subeqn.dtx}{sample}}
+\generateFile{subeqn-sample.tex}{t}{\from{subeqn.dtx}{sample}}
\Msg{***********************************************************}
\Msg{*}
diff --git a/Master/texmf-dist/source/latex/subeqnarray/subeqnarray.dtx b/Master/texmf-dist/source/latex/subeqnarray/subeqnarray.dtx
index 5b3555c3120..d460ccfca32 100644
--- a/Master/texmf-dist/source/latex/subeqnarray/subeqnarray.dtx
+++ b/Master/texmf-dist/source/latex/subeqnarray/subeqnarray.dtx
@@ -1,43 +1,40 @@
% \iffalse meta-comment
%
-% Copyright 1994-2004 Johannes Braams. All rights reserved.
-%
+% Copyright 1998-2024 Johannes L. Braams. All rights reserved.
+%
% This file is part of the subeqnarray package.
% ---------------------------------------------
-%
+%
% It may be distributed and/or modified under the
-% conditions of the LaTeX Project Public License, either version 1.3
+% 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
% http://www.latex-project.org/lppl.txt
-% and version 1.3 or later is part of all distributions of LaTeX
-% version 2003/12/01 or later.
-%
+% and version 1.3c or later is part of all distributions of LaTeX
+% version 2008 or later.
+%
% This work has the LPPL maintenance status "maintained".
-%
+%
% The Current Maintainer of this work is Johannes Braams.
-%
-% The list of all files belonging to the subeqnarray package is
-% given in the file `manifest.txt'.
-%
+%
+% The list of all files belonging to the supertabular package is
+% given in the file `MANIFEST'.
+%
% 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
-% \CheckSum{259}
-%\iffalse
+%
+% \CheckSum{264}
+%
+% \iffalse
%
% Subeqnarray package to use with LaTeX2e
%
-%% Copyright (C) 1988--2004 by Johannes Braams,
-%% all rights resserved
%%
%% Error reports please to: J. Braams
%% TeXniek
-%% Kooienswater 62
-%% 2715 AJ Zoetermeer
-%% The Netherlands
-%% Email: texniek at braams.cistron.nl
+%% Email: texniek at texniek.nl
%
% \section{Producing the documentation}
%
@@ -48,10 +45,10 @@
%</dtx>
%<package>\NeedsTeXFormat{LaTeX2e}[1998/06/01]
%<package>\ProvidesPackage{subeqnarray}
-%<sample>\ProvidesFile{subeqnarray.tex}
+%<sample>\ProvidesFile{subeqnarray-sample.tex}
%<driver>\ProvidesFile{subeqnarray.drv}
%\ProvidesFile{subeqnarray.dtx}
- [2004/04/15 v2.1c subeqnarray package]
+ [2024/07/20 v2.1e subeqnarray package]
%<*driver>
\documentclass{ltxdoc}
@@ -82,10 +79,8 @@
%
% \author{Johannes Braams\\
% \TeX niek\\
-% Kersengaarde 33\\
-% 2723 BP Zoetermeer\\
% The Netherlands\\
-% Internet: \texttt{TeXniek at braams.cistron.nl}}
+% Internet: \texttt{texniek at texniek.nl}}
%
% \date{\filedate}
%
@@ -114,8 +109,8 @@
% \changes{2.0}{1993/11/02}{Added support for the leqno option}
% \changes{2.0}{1993/11/02}{Added support for the fleqn option}
% \changes{2.1}{1994/02/09}{Upgrade for LaTeX2e}
-% \changes{2.1b}{1999/03/03}{Changed licensing remarks to use LPPL}
-% \changes{2.1c}{2004/04/15}{Updated address information}
+% \changes{v2.1b}{1999/03/03}{Changed licensing remarks to use LPPL}
+% \changes{v2.1e}{2024/07/20}{Updated contact info}
%
% \section{Initial Code}
%
@@ -129,8 +124,8 @@
% \end{macro}
%
% \begin{macro}{\thesubequation}
-% The representation o the counter \texttt{subequation} includes
-% the \texttt{equation} counter
+% The representation of the counter \texttt{subequation} includes
+% the \texttt{equation} counter.
% \begin{macrocode}
\def\thesubequation{\theequation\alph{subequation}}
% \end{macrocode}
@@ -197,7 +192,7 @@
\ExecuteOptions{reqno,deqn}
% \end{macrocode}
%
-% Now see if the use specified any options.
+% Now see if the user specified any options.
% \begin{macrocode}
\ProcessOptions
% \end{macrocode}
@@ -206,9 +201,9 @@
%
% \begin{macro}{\slabel}
% A new label command to refer to subequations. It works
-% like the |\label| command and was taken from \texttt{latex.tex}.
+% like the |\label| command and was taken from \texttt{latex.ltx}.
%
-% |\slabel{FOO}| writes the following on file |\@auxout|
+% |\slabel{FOO}| writes the following on file |\@auxout|:
%
% |\newlabel{FOO}{{eval(\@currentlabel)}{eval(\thepage)}}|
%
@@ -285,7 +280,7 @@
% \end{macro}
%
% \begin{macro}{\@@subeqncr}
-% Ceck the number of columns, and insert extra |&| if needed. If
+% Check the number of columns, and insert extra |&| if needed. If
% there appear to be more than 3 columns an error is signalled.
% \begin{macrocode}
\def\@@subeqncr{\let\@tempa\relax
@@ -314,7 +309,6 @@
% \begin{macrocode}
\let\@ssubeqncr\@subeqncr
%</package>
-%<*sample>
% \end{macrocode}
% \end{macro}
%
@@ -328,6 +322,11 @@
\documentclass[fleqn]{article}
\usepackage{subeqnarray}
\begin{document}
+\title{Sample subeqnarray}
+\author{Johannes L. Braams}
+\date{\today}
+\maketitle
+
This document shows an example of the use of the \emph{subeqnarray}
environment. Here is one:
\begin{subeqnarray}
@@ -360,20 +359,4 @@ These are equations~\ref{eq10},~\ref{eq11} and~\ref{eq12}.
%
% \Finale
\endinput
-%
-%% \CharacterTable
-%% {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 \~}
-%%
+% \ No newline at end of file
diff --git a/Master/texmf-dist/source/latex/subeqnarray/subeqnarray.ins b/Master/texmf-dist/source/latex/subeqnarray/subeqnarray.ins
index efa2d4da606..f28eb4717a2 100644
--- a/Master/texmf-dist/source/latex/subeqnarray/subeqnarray.ins
+++ b/Master/texmf-dist/source/latex/subeqnarray/subeqnarray.ins
@@ -1,53 +1,49 @@
-%%
+%
%% This file will generate fast loadable files and documentation
%% driver files from the doc files in this package when run through
%% LaTeX or TeX.
%%
-%% Copyright 1989-2004 Johannes L. Braams. All rights reserved.
-%%
-%% This file is part of the subeqnarray package.
-%% ---------------------------------------------
-%%
+%% Copyright (C) 1999-2024 Johannes L. Braams. All rights reserved.
+%%
+%% This file is part of the eqnarray distribution.
+%% -----------------------------------------------
+%%
%% It may be distributed and/or modified under the
-%% conditions of the LaTeX Project Public License, either version 1.3
+%% 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
-%% http://www.latex-project.org/lppl.txt
-%% and version 1.3 or later is part of all distributions of LaTeX
-%% version 2003/12/01 or later.
-%%
-%% This work has the LPPL maintenance status "maintained".
-%%
-%% The Current Maintainer of this work is Johannes Braams.
-%%
-%% The list of all files belonging to the subeqnarray package is
-%% given in the file `manifest.txt.
-%%
-%% 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.
+%% 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".
+%%
+%% As this file contains legal notices, it is NOT PERMITTED to modify
+%% this file in any way that the legal information placed into
+%% generated files is changed (i.e., the files generated when the
+%% original file is executed). This restriction does not apply if
+%% (parts of) the content is reused in a different WORK producing its
+%% own generated files.
%%
%% --------------- start of docstrip commands ------------------
%%
-% ignored commands
-\def\filedate{2004/04/15}
-\def\batchfile{subeqnarray.ins}
+
\input docstrip.tex
\preamble
-Copyright (C) 1999-2004 Johannes Braams. All rights reserved.
+Copyright (C) 1999-2024 Johannes Braams. All rights reserved.
This file was generated from file(s) of the subeqnarray package.
----------------------------------------------------------------
It may be distributed and/or modified under the
-conditions of the LaTeX Project Public License, either version 1.3
+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
http://www.latex-project.org/lppl.txt
-and version 1.3 or later is part of all distributions of LaTeX
-version 2003/12/01 or later.
+and version 1.3c or later is part of all distributions of LaTeX
+version 2008 or later.
This work has the LPPL maintenance status "maintained".
@@ -71,7 +67,7 @@ extension .ins) which are part of the distribution.
% The sample file
-\generateFile{subeqnarray.tex}{t}{\from{subeqnarray.dtx}{sample}}
+\generateFile{subeqnarray-sample.tex}{t}{\from{subeqnarray.dtx}{sample}}
\Msg{***********************************************************}
\Msg{*}
@@ -89,4 +85,4 @@ extension .ins) which are part of the distribution.
\Msg{* Happy TeXing}
\Msg{***********************************************************}
-\endinput
+\endbatchfile
diff --git a/Master/texmf-dist/source/latex/supertabular/supertabular.dtx b/Master/texmf-dist/source/latex/supertabular/supertabular.dtx
index be31a2d113d..6bde17bbfa6 100644
--- a/Master/texmf-dist/source/latex/supertabular/supertabular.dtx
+++ b/Master/texmf-dist/source/latex/supertabular/supertabular.dtx
@@ -1,6 +1,6 @@
% \iffalse meta-comment
%
-% Copyright 1989-2020 Johannes L. Braams. All rights reserved.
+% Copyright 1989-2021 Johannes L. Braams. All rights reserved.
%
% This file is part of the supertabular package.
% ---------------------------------------------
@@ -25,14 +25,13 @@
% extension .ins) which are part of the distribution.
% \fi
%
-% \CheckSum{1132}
+% \CheckSum{1188}
% \iffalse
%% Sourcefile `supertabular.dtx'.
%%
%% Copyright (C) 1988 by Theo Jurriens
-%% Copyright (C) 1990-2020 by Johannes Braams texniek at braams.xs4all.nl
-%% Kersengaarde 33
-%% 2723 BP Zoetermeer NL
+%% Copyright (C) 1990-2024 by Johannes Braams texniek at texniek.nl
+%% The Netherlands
%% all rights reserved.
%%
%%
@@ -43,11 +42,11 @@
%<package>\ProvidesPackage{supertabular}
%<driver>\ProvidesFile{supertabular.drv}
%\ProvidesFile{supertabular.dtx}
- [2020/02/02 v4.1g the supertabular environment]
+ [2024/07/20 v4.2c the supertabular environment]
%
%<*driver>
\documentclass{ltxdoc}
-\usepackage[debugshow]{supertabular}
+\usepackage[debugshow,calculate]{supertabular}
\newcommand{\tbsp}{\rule{0pt}{18pt}}
\begin{document}
\providecommand{\Lenv}[1]{\textsf{#1}}
@@ -59,17 +58,19 @@
%</driver>
% \fi
%
-% \changes{v4.0a}{1996/11/28}{Cleanup of the code, now a \file{.dtx}
-% source file}
-% \changes{v4.0c}{1997/02/20}{Replace \cs{tableformat} by
-% \cs{ST@tableformat} to prevent a clash with the \pkg{KOMA}
-% pacakage}
-% \changes{v4.0f}{1997/04/10}{Repaired a few typos in the
-% documentation}
-% \changes{v4.1a}{1997/09/18}{Repaired a number of typos and added
-% contributed mpsupertabular environemnts}
-% \changes{v4.1b}{1997/10/08}{Renamed \cs{@@tabularcr} to
-% \cs{org@tabularcr}}
+% \changes{v4.0a}{1996/11/28}{Cleanup of the code, now a \file{.dtx}
+% source file}
+% \changes{v4.0c}{1997/02/20}{Replace \cs{tableformat} by
+% \cs{ST@tableformat} to prevent a clash with the \pkg{KOMA}
+% pacakage}
+% \changes{v4.0f}{1997/04/10}{Repaired a few typos in the
+% documentation}
+% \changes{v4.1a}{1997/09/18}{Repaired a number of typos and added
+% contributed mpsupertabular environemnts}
+% \changes{v4.1b}{1997/10/08}{Renamed \cs{@@tabularcr} to
+% \cs{org@tabularcr}}
+% \changes{v4.2a}{2020-06-27}{renamed \cs{ST@lineht} to \cs{ST@rowht}}
+% \changes{v4.2c}{2024/07/20}{A few documentation changes}
%
% \GetFileInfo{supertabular.dtx}
% \title{The \texttt{supertabular} environment\thanks{This file
@@ -110,7 +111,13 @@
% and why \pkg{supertabular} decides to break the tabular
% environment in order to produce a new page.
% \item The option \textsf{debugshow} also adds information about
-% each line that is added to the tabular.
+% each row that is added to the tabular.
+% \item The option \textsf{estimate} (the default) has the package
+% use the old estimation-based algortihm to establish the height
+% of individual rows.
+% \item The option \textsf{calculate} has the package use the new
+% calculation-based algortihm to establish the height
+% of individual rows.
% \end{enumerate}
%
% Below is a description of the new commands and environments that
@@ -172,15 +179,15 @@
%
% \begin{itemize}
% \item When the material of a normal entry (not a p-arg) becomes
-% larger than the estimated |\ST@lineht|, overfull |\vbox|es
-% will be produced at all.
+% larger than the estimated |\ST@rowht|, overfull |\vbox|es
+% will be produced.
% \item When the last p-arg on a page gets more than 4 lines
% (probably even more than 3 lines) it will result in an overfull
% |\vbox|. Also some combinations of |\baselinestretch|
-% |\arraystretch| and a large font may lead to one line too much.
-% \item if accidentally the last line of the tabular produces a
+% |\arraystretch| and a large font may lead to one row too much.
+% \item if accidentally the last row of the tabular produces a
% newpage, on the next page the tabletail will be written
-% immediately after the tablehead. Depending on the contents this
+% immediately after the tablehead. Depending on the contents, this
% may result in an error message regarding misplaced |\noalign|.
%
% A quick but not very elegant solution: shrink the allowed height
@@ -431,6 +438,36 @@
\DeclareOption{errorshow}{\c@tracingst\z@}
\DeclareOption{pageshow}{\c@tracingst\thr@@}
\DeclareOption{debugshow}{\c@tracingst5\relax}
+% \end{macrocode}
+% In version 4.1g a new way of determining the height of the
+% average row was introduced. Instead of using an estimation, based
+% on the value of |\baselineskip| a computation was introduced,
+% based on the size of the |\strutbox|. The effect of this new
+% method was that the parial tabulars fill the page better, so less
+% \texttt{underfull vbox} message would appear. Unfortunately this
+% had a negative effect on existing documents (that don;t come out
+% like they used to) and especially when a very small font
+% (|\tiny| or |\scriptsize| was chosen for the tabular and the
+% cells contain subscripts or superscripts. It turned out that the
+% heigth and depth of a formula like $5^5_5$ exceeds the size of
+% |\strutbox|. The result is that the rows have more height (and/or
+% depth) thatn what the algorithm computed. Hence, when more rows
+% are added to the partial tabular than fit on the page. Especially
+% on the first part thisis a probem as the partial tabular becomes
+% too high and doesn't fit in the avialbale space. \TeX\ then
+% decides to move it to the next page, resulting in two
+% consecutive pages that have a lot of white space on them.
+% \changes{v4.2a}{2020-06-27}{Two new options to choose the
+% computation algorithhm}
+% \begin{macrocode}
+\DeclareOption{calculate}{\def\ST@calculate@rowht{\ST@compute@rowht}}
+\DeclareOption{estimate}{\def\ST@calculate@rowht{\ST@estimate@rowht}}
+%\def\ST@calculate@rowht{\ST@estimate@rowht}
+% \end{macrocode}
+% The default for the options is to only show errors and use the
+% old estmation algorithm (so as not to break old documents).
+% \begin{macrocode}
+\ExecuteOptions{errorshow,estimate}
\ProcessOptions
% \end{macrocode}
%
@@ -510,7 +547,7 @@
% yet be visible in the amount of space occupoed on the page
% sofar. Therefore we include the possibility to reduce the height
% of the first part of the supertabular. In order to this we need a
-% macro that indicates a aption has been put in front of the
+% macro that indicates a caption has been put in front of the
% table. We do this to reduce the risk that the first part of the
% table is too high after all and is pushed onto the next page due
% to an overfull |\vbox| condition.
@@ -523,7 +560,7 @@
% \begin{macro}{\ST@caption}
% This is a redefinition of LaTeX's |\@caption|, |\@makecaption| is
% called within a group so as not to return to |\normalsize|
-% globally. also a fix is made for the `feature' of the
+% globally. Also a fix is made for the `feature' of the
% |\@makecaption| of the document class \cls{article} and friends
% that a caption \textbf{always} gets a |\vskip 10pt| at the top
% and \textbf{none} at the bottom. If a user wants to precede his
@@ -554,14 +591,19 @@
% to \cs{@tabularcr}}
% \changes{v4.1b}{1997/10/08}{Not \cs{@tabularcr} but
% \cs{org@tabularcr}}
+% \changes{v4.2b}{2021-02-14}{When the argument is empty the internal
+% macro \cs{@tablehead} needs to be empty as well.}
% \begin{macrocode}
\newcommand\tablehead[1]{%
- \gdef\@tablehead{%
- \noalign{%
- \global\let\@savcr=\\
- \global\let\\=\org@tabularcr}%
- #1%
- \noalign{\global\let\\=\@savcr}}}
+ \def\@ST@arg{#1}%
+ \ifx\@ST@arg\@empty\gdef\@tablehead{}\else
+ \gdef\@tablehead{%
+ \noalign{%
+ \global\let\@savcr=\\
+ \global\let\\=\org@tabularcr}%
+ #1%
+ \noalign{\global\let\\=\@savcr}}%
+ \fi}
\tablehead{}
% \end{macrocode}
% It's possible to specify a different tablehead for the first
@@ -571,17 +613,22 @@
% document.
% \changes{v4.1f}{2019/01/12}{\cs{\@table@first@head} needs the same
% definition as \cs{\@tablehead} (found by FMi)}
+% \changes{v4.2b}{2021-02-14}{When the argument is empty the internal
+% macro \cs{@table@first@head} needs to be empty as well.}
% \begin{macrocode}
\newcommand\tablefirsthead[1]{%
- \gdef\@table@first@head{%
- \noalign{%
- \global\let\@savcr=\\
- \global\let\\=\org@tabularcr}%
- #1%
- \noalign{%
- \global\let\\=\@savcr
- \global\let\@table@first@head\undefined
- }}}
+ \def\@ST@arg{#1}%
+ \ifx\@ST@arg\@empty\gdef\@table@first@head{}\else
+ \gdef\@table@first@head{%
+ \noalign{%
+ \global\let\@savcr=\\
+ \global\let\\=\org@tabularcr}%
+ #1%
+ \noalign{%
+ \global\let\\=\@savcr
+ \global\let\@table@first@head\undefined
+ }}%
+ \fi}
% \end{macrocode}
% \end{macro}
% \end{macro}
@@ -598,14 +645,19 @@
% to \cs{@tabularcr}}
% \changes{v4.1b}{1997/10/08}{Not \cs{@tabularcr} but
% \cs{org@tabularcr}}
+% \changes{v4.2b}{2021-02-14}{When the argument is empty the internal
+% macro \cs{@tabletail} needs to be empty as well.}
% \begin{macrocode}
\newcommand\tabletail[1]{%
- \gdef\@tabletail{%
- \noalign{%
- \global\let\@savcr=\\
- \global\let\\=\org@tabularcr}%
- #1%
- \noalign{\global\let\\=\@savcr}}}
+ \def\@ST@arg{#1}%
+ \ifx\@ST@arg\@empty\gdef\@tabletail{}\else
+ \gdef\@tabletail{%
+ \noalign{%
+ \global\let\@savcr=\\
+ \global\let\\=\org@tabularcr}%
+ #1%
+ \noalign{\global\let\\=\@savcr}}%
+ \fi}
\tabletail{}
% \end{macrocode}
% It's possible to specify a different tabletail for the last
@@ -615,17 +667,22 @@
% document.
% \changes{v4.1f}{2019/01/12}{\cs{\@table@last@tail} needs the same
% definition as \cs{\@tabletail}}
+% \changes{v4.2b}{2021-02-14}{When the argument is empty the internal
+% macro \cs{@tabletail} needs to be empty as well.}
% \begin{macrocode}
\newcommand\tablelasttail[1]{%
- \gdef\@table@last@tail{%
- \noalign{%
- \global\let\@savcr=\\
- \global\let\\=\org@tabularcr}%
- #1%
- \noalign{%
- \global\let\\=\@savcr
- \global\let\@table@last@tail\undefined
- }}}
+ \def\@ST@arg{#1}%
+ \ifx\@ST@arg\@empty\gdef\@table@last@tail{}\else
+ \gdef\@table@last@tail{%
+ \noalign{%
+ \global\let\@savcr=\\
+ \global\let\\=\org@tabularcr}%
+ #1%
+ \noalign{%
+ \global\let\\=\@savcr
+ \global\let\@table@last@tail\undefined
+ }}%
+ \fi}
% \end{macrocode}
% \end{macro}
% \end{macro}
@@ -660,7 +717,7 @@
%
% \begin{macro}{\ST@trace@cr}
% A variant of |\ST@trace| that can be called from within |\\| as
-% that command is looking for an optional argument will end up
+% that command is looking for an optional argument and will end up
% scanning the next line.
% \begin{macro}{\ST@save@lineno}
% \changes{v4.1f}{2019/01/18}{Added a macro to save the current input
@@ -752,25 +809,22 @@
% \changes{v4.0b}{1997/02/04}{Removed the use of \cs{ST@pboxcorr},
% correction seems to be no longer necessary}
%
-% \begin{macro}{\ST@lineht}
+% \begin{macro}{\ST@rowht}
% \begin{macro}{\ST@stretchht}
% \changes{v4.0g}{1997/04/12}{Dimension register added}
% \begin{macro}{\ST@prevht}
% \changes{v4.0g}{1997/04/12}{Dimension register added}
-% The estimated height of a normal line is stored in
-% |\ST@lineht|. The dimension register |\ST@stretchht| is used to
-% store the difference between the `normal' line height and the
-% line height when |\arraystretch| has a non-standard value. This
-% is used in the case where p-box entries are added to the
-% tabular. The dimension register |\ST@prevht| is use to store the
-% height of the previous line to use it as an estimate for the
-% height of the next line. This is needed for a better estimate of
+% The estimated height of a normal row is stored in
+% |\ST@rowht|. The dimension register |\ST@stretchht| was used to
+% store the difference between the `normal' row height and the
+% row height when |\arraystretch| has a non-standard value. This
+% was used in the case where p-box entries are added to the
+% tabular. The dimension register |\ST@prevht| is used to store the
+% height of the previous row, to use it as an estimate for the
+% height of the next row. This is needed for a better estimate of
% when to break the tabular.
-% \changes{v4.1g}{2020/02/02}{\cs{ST@stretchht} is no longer needed,
-% will be removed in a future release}
% \begin{macrocode}
-\newdimen\ST@lineht
-%\newdimen\ST@stretchht
+\newdimen\ST@rowht
\newdimen\ST@prevht
% \end{macrocode}
% \end{macro}
@@ -907,10 +961,12 @@
% \end{macro}
% \end{macro}
%
-% \begin{macro}{\ST@compute@lineht}
-% \changes{v4.1g}{2020/02/02}{New macro \cs{ST@compute@lineht} to
-% replacte \cs{estimate@lineht}}
-% The height of a line in an array environemnt can be computed as:
+% \begin{macro}{\ST@compute@rowht}
+% \changes{v4.1g}{2020/02/02}{New macro \cs{ST@compute@rowht} to
+% replace \cs{ST@estimate@rowht}}
+% \changes{v4.2a}{2020-06-27}{Make sure that \cs{ST@rowht} is large
+% enough to take subscripts and superscripts into account}
+% The height of a row in an array environemnt can be computed as:
% \begin{itemize}
% \item the height of the strutbox |\ht\strutbox| (plus
% |\extrarowheight| when the \pkg{array} package is loaded),
@@ -919,34 +975,60 @@
% by |\arraystretch|.
% \end{itemize}
% \begin{macrocode}
-\def\ST@compute@lineht{%
- \ST@lineht=\ht\strutbox
+\def\ST@compute@rowht{%
+% \end{macrocode}
+% Temporarily store a formula with superscript and subscript in a
+% box in order to be able to measure its height and depth.
+% \begin{macrocode}
+ \setbox\@tempboxa=\vbox{\@arrayparboxrestore $5^5_5$}
+% \end{macrocode}
+% Use the largest height of either |\@tempboxa| or |\strutbox|.
+% \begin{macrocode}
+ \ifnum\ht\@tempboxa>\ht\strutbox
+ \ST@rowht=\ht\@tempboxa
+ \else
+ \ST@rowht=\ht\strutbox
+ \fi
+% \end{macrocode}
+% If the \textsf{array} pacakge is used we need to add the
+% value of |\extrarowheight|.
+% \begin{macrocode}
\ifx\extrarowheight\undefined\else
- \advance \ST@lineht by \extrarowheight
+ \advance \ST@rowht by \extrarowheight
+ \fi
+% \end{macrocode}
+% Also use the largest depth of either |\@tempboxa| or |\strutbox|.
+% \begin{macrocode}
+ \ifnum\dp\@tempboxa>\dp\strutbox
+ \advance\ST@rowht \dp\@tempboxa
+ \else
+ \advance\ST@rowht \dp\strutbox
\fi
- \ST@lineht = \arraystretch\ST@lineht
- \advance\ST@lineht \arraystretch\dp\strutbox
- \ST@trace\tw@{Normal Line height: \the\ST@lineht}%
+% \end{macrocode}
+% And finally multiply by |\arraystretch|.
+% \begin{macrocode}
+ \ST@rowht = \arraystretch\ST@rowht
+% \end{macrocode}
+% \begin{macrocode}
+ \ST@trace\tw@{Normal Row height: \the\ST@rowht}%
}
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\estimate@lineht}
+% \begin{macro}{\ST@estimate@rowht}
% Estimates the height of normal line taking |\arraystretch| into
% account. Also computes the difference between a normal line and a
% `stretched' one.
% \changes{v4.0b}{1997/02/04}{Removed use of \cs{ST@pboxcorr}}
% \changes{v4.0g}{1997/04/12}{Added the computation of
% \cs{ST@stretchht}}
-% This macro will be removed in a future release.
+% \changes{v4.2a}{2020-06-27}{removed the computation of
+% \cs{ST@stretchht} as it is no longer used}
% \begin{macrocode}
-\def\estimate@lineht{%
- \ST@lineht=\arraystretch \baslineskp
- \global\advance\ST@lineht by 1\p@
- \ST@stretchht\ST@lineht\advance\ST@stretchht-\baslineskp
- \ifdim\ST@stretchht<\z@\ST@stretchht\z@\fi
- \ST@trace\tw@{Average line height: \the\ST@lineht}%
- \ST@trace\tw@{Stretched line height: \the\ST@stretchht}%
+\def\ST@estimate@rowht{%
+ \ST@rowht=\arraystretch \baslineskp
+ \global\advance\ST@rowht by 1\p@
+ \ST@trace\tw@{Average Row height: \the\ST@rowht}%
}
% \end{macrocode}
% \end{macro}
@@ -1071,23 +1153,23 @@
\ST@tailht=\ht\@tempboxa\advance\ST@tailht\dp\@tempboxa
\fi
% \end{macrocode}
-% We add the average height of a line to this because when we
+% We add the average height of a row to this because when we
% decide to continue the tabular we need to have enough space left
-% for one line and the tail.
+% for one row \emph{and} the tail.
% \begin{macrocode}
- \advance\ST@tailht by \ST@lineht
+ \advance\ST@tailht by \ST@rowht
\ST@trace\tw@{Height of tail: \the\ST@tailht}%
\ST@trace\tw@{Maximum height of tabular: \the\ST@pageleft}%
\@tempdima\ST@headht
% \end{macrocode}
% \changes{v4.0b}{1997/02/04}{Base the decision whether to start on a
-% new page on the total of headheight, tailht and lineht}
+% new page on the total of headheight, tailht and rowht}
% Now we decide whether we can continue on the current page or
% whether we need to start on a new page. We assume that the
% minimum height of a tabular is the height of the head, the tail
-% and one line of data. If that doesn't fit a new page is started.
+% and one row of data. If that doesn't fit a new page is started.
% \begin{macrocode}
- \advance\@tempdima\ST@lineht
+ \advance\@tempdima\ST@rowht
\advance\@tempdima\ST@tailht
\ST@trace\tw@{Minimum height of tabular: \the\@tempdima}%
\ifnum\@tempdima>\ST@pageleft
@@ -1164,7 +1246,7 @@
\global\let\@oldcr=\\
% \end{macrocode}
% Save the current value of |\baselineskip|, as we need it in the
-% calculation of the average height of a line.
+% calculation of the average height of a row.
% \begin{macrocode}
\def\baslineskp{\baselineskip}%
% \end{macrocode}
@@ -1174,9 +1256,9 @@
\ifx\undefined\@classix
% \end{macrocode}
% Save old |\@tabularcr| and insert the definition of
+% |\ST@tabularcr|.
% \changes{v4.1c}{1997/11/07}{For standard \LaTeX\ we need to change
% \cs{@@startpbox}, \emph{not} \cs{@startpbox}}
-% |\ST@tabularcr|.
% \begin{macrocode}
\let\org@tabularcr\@tabularcr
\let\@tabularcr\ST@tabularcr
@@ -1210,20 +1292,20 @@
\fi
% \end{macrocode}
% The first part of a supertabular may be moved on to the next page
-% if it doesn't fit on the current page afterall. Subsequent parts
+% if it doesn't fit on the current page after all. Subsequent parts
% can not be moved; therefor we will have to switch the definition
-% of |\ST@skippart| around.
+% of |\ST@skippage| around.
% \changes{v4.0e}{1997/04/09}{Make sure that only the first part of a
% supertabular can be moved to the next page.}
% \begin{macrocode}
\let\ST@skippage\ST@skipfirstpart
% \end{macrocode}
-% Now we can estimate the average line height and the height of the
+% Now we can estimate the average row height and the height of the
% first page of the \Lenv{supertabular}.
% \changes{v4.0i}{1997/09/18}{Added \cs{noindent}}
-% \changes{v4.1g}{2020/02/02}{Now call \cs{ST@compute@lineht}}
+% \changes{v4.1g}{2020/02/02}{Now call \cs{ST@calculate@rowht}}
% \begin{macrocode}
- \ST@compute@lineht
+ \ST@calculate@rowht
\@calfirstpageht
\noindent
}
@@ -1544,20 +1626,20 @@
% \begin{macrocode}
\def\ST@cr{%
\noalign{%
- \ifnum\ST@pboxht<\ST@lineht
+ \ifnum\ST@pboxht<\ST@rowht
% \end{macrocode}
-% If there is a non-empty line, but an empty parbox, then
-% |\ST@pboxht| might be non-zero, but too small thereby breaking
-% the algorithm. Therefor we estimate the height of the line to be
-% |\ST@lineht| in this case.
+% If there is a non-empty row, but an empty parbox, then
+% |\ST@pboxht| might be non-zero, but too small, thereby breaking
+% the algorithm. Therefor we estimate the height of the row to be
+% |\ST@rowht| in this case.
% \begin{macrocode}
- \global\advance\ST@pageleft -\ST@lineht
+ \global\advance\ST@pageleft -\ST@rowht
% \end{macrocode}
% And we store that fact in |\ST@prevht|.
-% \changes{v4.0g}{1997/04/12}{store the height of the previous line in
+% \changes{v4.0g}{1997/04/12}{store the height of the previous row in
% \cs{ST@prevht}}
% \begin{macrocode}
- \global\ST@prevht\ST@lineht
+ \global\ST@prevht\ST@rowht
\else
% \end{macrocode}
% When the parbox was not empty we take into account its height
@@ -1605,11 +1687,11 @@
\else
% \end{macrocode}
% When there is not enough space left on the current page, we start
-% a new page. To compute the amount of space need we use the
-% height of the previous line (|\ST@prevht|) as an estimation of
-% the height of the next line. If we are processing a
+% a new page. To compute the amount of space needed we use the
+% height of the previous row (|\ST@prevht|) as an estimation of
+% the height of the next row. If we are processing a
% \Lenv{mpsupertabular} we need to take the height of the footnotes
-% into account.
+% into account as well.
% \changes{v4.0g}{1997/04/12}{Leave room for both \cs{ST@tailht}
% \emph{and} \cs{ST@prevht}}
% \changes{v4.1a}{1997/09/19}{Take care of space needed for
@@ -1659,10 +1741,19 @@
% \begin{macrocode}
\global\advance\ST@pageleft\pagetotal
% \end{macrocode}
-% Then we can set |\ST@pagesofar| to $0$ and start the new page.
+% Then we can set |\ST@pagesofar| to $0$...
% \begin{macrocode}
\global\ST@pagesofar\z@
- \newpage
+% \end{macrocode}
+% ... and start the new page, but in this special case we need to
+% trigger the output routine directly by issuing a |\penalty|
+% rather than calling |\newpage| as that macro effectively issues a
+% |\vskip-\maxdepth| which makes the first two rows of the tabular
+% overlap.
+% \changes{v4.2b}{2021-02-14}{Issue a \cs{penalty} instead of
+% \cs{newpage} to trigger the output routine.}
+% \begin{macrocode}
+ \penalty -\@M
% \end{macrocode}
%
% Finally we make sure that this macro can only be executed once
diff --git a/Master/texmf-dist/source/latex/synthslant/Makefile b/Master/texmf-dist/source/latex/synthslant/Makefile
index d8de419230a..8ef77a6982b 100644
--- a/Master/texmf-dist/source/latex/synthslant/Makefile
+++ b/Master/texmf-dist/source/latex/synthslant/Makefile
@@ -19,8 +19,9 @@ DVIPS := dvips
DVIPS_FLAGS := -d1 # debug \special{}
-LATEX := /usr/bin/env max_print_line=2147483647 pdflatex
-LATEX_FLAGS := -file-line-error -halt-on-error -interaction=nonstopmode
+LATEX_PROPER := pdflatex
+LATEX := /usr/bin/env max_print_line=2147483647 $(LATEX_PROPER)
+LATEX_FLAGS := -file-line-error -halt-on-error -interaction=nonstopmode -output-directory=.
LATEX_RERUN_TRIGGER := '^Package rerunfilecheck Warning: File [^ ]* has changed'
LATEX_WARNING := '^LaTeX (|[A-Za-z0-9_]* )Warning:'
@@ -33,18 +34,9 @@ METAPOST := mpost
METAPOST_FLAGS := -file-line-error -interaction=nonstopmode -tex=latex
-SPELLCHECK := aspell
-SPELLCHECK_FLAGS := \
- --add-tex-command='citenum p' --add-tex-command='code p' \
- --add-tex-command='Cref p' --add-tex-command='cref p' \
- --add-tex-command='cs p' \
- --add-tex-command='DescribeEnv p' --add-tex-command='DescribeMacro p' \
- --add-tex-command='marg p' --add-tex-command='meta p' \
- --add-tex-command='oarg p' \
- --lang=en_US --mode=tex
-
-
-SOURCE_FILES := LICENSE Makefile synthslant.dtx synthslant.ins
+PROJECT_NAME := synthslant
+SOURCE_FILES := LICENSE Makefile README.md synthslant.dtx synthslant.ins
+DOCUMENTATION_FILES := synthslant-gauge.pdf synthslant.pdf
@@ -57,7 +49,7 @@ sty: synthslant.sty
.PHONY: pdf
-pdf: doc gauge
+pdf: doc gauge test
.PHONY: doc
@@ -68,19 +60,42 @@ doc: synthslant.pdf
gauge: synthslant-gauge.pdf
-.PHONY: cpio
-cpio:
- cd ..; \
- echo $(addprefix synthslant/,$(SOURCE_FILES)) | \
- cpio -o | \
- gzip > "synthslant-$$(date +%Y-%m-%d).cpio.gz"
+.PHONY: test
+test: synthslant-minimal-test.pdf
+
+
+export TEMPORARY_DIRECTORY
+
+
+.PHONY: dist
+dist:
+ $(eval TEMPORARY_DIRECTORY := $(shell mktemp -d))
+ trap '$(RM) -r $(TEMPORARY_DIRECTORY); exit 1' HUP INT QUIT TERM; $(MAKE) __dist
+ $(RM) -r $(TEMPORARY_DIRECTORY)
+
+
+.PHONY: __dist
+__dist: LATEX_FLAGS += -interaction=batchmode
+__dist: $(DOCUMENTATION_FILES)
+ test -d '$(TEMPORARY_DIRECTORY)'
+ test -w '$(TEMPORARY_DIRECTORY)'
+ mkdir $(TEMPORARY_DIRECTORY)/$(PROJECT_NAME)
+ cp $(SOURCE_FILES) $(TEMPORARY_DIRECTORY)/$(PROJECT_NAME)
+ mkdir $(TEMPORARY_DIRECTORY)/$(PROJECT_NAME)/docs
+ cp $(DOCUMENTATION_FILES) $(TEMPORARY_DIRECTORY)/$(PROJECT_NAME)/docs
+ tar czf $(PROJECT_NAME).tar.gz -C $(TEMPORARY_DIRECTORY) $(PROJECT_NAME)
-.PHONY: tar
-tar:
- cd ..; \
- tar czf "synthslant-$$(date +%Y-%m-%d).tar.gz" \
- $(addprefix synthslant/,$(SOURCE_FILES))
+.PHONY: distcheck
+distcheck: LATEX_FLAGS += -interaction=batchmode
+distcheck: dist
+ $(eval TEMPORARY_DIRECTORY := $(shell mktemp -d))
+ test -d '$(TEMPORARY_DIRECTORY)'
+ test -w '$(TEMPORARY_DIRECTORY)'
+ tar xzf $(PROJECT_NAME).tar.gz -C $(TEMPORARY_DIRECTORY)
+ $(MAKE) --directory=$(TEMPORARY_DIRECTORY)/$(PROJECT_NAME) LATEX_FLAGS='$(LATEX_FLAGS)' all
+ $(RM) -r $(TEMPORARY_DIRECTORY)
+ @printf '\n\ndistcheck passed.\n'
.PHONY: clean
@@ -91,6 +106,7 @@ clean:
$(RM) mptextmp.* mpxerr.tex
$(RM) README README.html RELEASE-HOWTO RELEASE-HOWTO.html
$(RM) compare-with-the-gimp.eps compare-with-the-gimp.png
+ $(RM) $(PROJECT_NAME).tar.gz
.PHONY: mostlyclean
@@ -99,35 +115,27 @@ mostlyclean: clean
.PHONY: maintainer-clean
maintainer-clean: mostlyclean
- $(RM) ./*.base64 ./*.ist ./*.mp ./*.sty ./*.tex
+ $(RM) ./*.base64 ./*.gst ./*.ist ./*.mp ./*.sty ./*.tex
.PHONY: perf
perf: synthslant-gauge.tex synthslant.sty
- perf stat --repeat=10 -- $(LATEX) $(LATEX_FLAGS) -interaction batchmode -draftmode $<
+ perf stat --repeat=10 -- $(LATEX) $(LATEX_FLAGS) -interaction=batchmode -draftmode $<
.PHONY: tool-check
tool-check:
- @printf '*** LATEX = "%s"\n' '$(LATEX)'
- $(LATEX) --version
+ @printf '*** LATEX_PROPER = "%s"\n' '$(LATEX_PROPER)'
+ $(LATEX_PROPER) --version
+ @printf '\n\n*** BibTeX\n'
+ bibtex --version
@printf '\n\n*** MAKEINDEX = "%s"\n' '$(MAKEINDEX)'
- $(MAKEINDEX) < /dev/null
+ $(MAKEINDEX) < /dev/null
@printf '\n\n*** METAPOST = "%s"\n' '$(METAPOST)'
$(METAPOST) --version
@printf '\n*** BASE64 = "%s"\n' '$(BASE64)'
$(BASE64) --version
- @printf '\n\nTool check passed.\n'
-
-
-.PHONY: spell-check
-spell-check:
- @sed -e '\#<DISABLE-SPELL-CHECK/>#d' \
- -e '\#<DISABLE-SPELL-CHECK>#,\#</DISABLE-SPELL-CHECK>#d' < synthslant.dtx | \
- sed -e 's/^ *%%*//' | \
- sed -e 's/\\-//g' -e 's/|[^|]*|/ /g' | \
- $(SPELLCHECK) $(SPELLCHECK_FLAGS) list | \
- sort | uniq | fmt | sed -e 's/ / /g'
+ @printf '\n\ntool check passed.\n'
.PHONY: update-docs
@@ -142,8 +150,12 @@ all: Make everything there is to make. This is the .DEFAULT_GOAL.
clean: Remove some products.
-cpio: In the parent directory create a cpio(1) archive of the
- project source files whose name is time-stamped.
+dist: Create a tar file of the project source files and the PDF
+ documentation files. The archive is in the form and has a
+ name that CTAN prefers.
+
+distcheck: Create a tar file of the project source files, unpack it in
+ a different location and build all targets.
doc: Build "synthslant.pdf" the Syntslant documentation.
@@ -160,15 +172,22 @@ pdf: Build doc: and gauge:.
sty: Only extract "synthslant.sty" from "synthslant.dtx". This
operation requires LaTeX (-> $(LATEX)) and nothing else.
-tar: In the parent directory create a tar(1) file of the project
- source files whose name is time-stamped.
+test: Run some tests. Currently only compiles a minimal document
+ to check whether "synthslant.sty" contains all the necessary
+ \RequirePackage directives.
tool-check: Check whether some of the required tools to build the
project are available.
+update-docs: Copy the documentation files into the "docs"
+ sub-directory.
+
Selected Implicit Rules
-----------------------
+%: %.html
+ Convert HTML to plain text. Requires w3m(1).
+
%.dvi %.pdf: %.dtx
Run LaTeX or pdfLaTeX (-> $(LATEX)) on dtx source until a
fix-point is reached.
@@ -177,6 +196,9 @@ Selected Implicit Rules
Run LaTeX or pdfLaTeX (-> $(LATEX)) on tex file until a
fix-point is reached.
+%.html: %.md
+ Convert markdown to HTML. Requires markdown(1).
+
%.mx.pdf: %.dvi
Convert dvi to pdf via dvipdfmx (-> $(DVIPDFMX)).
@@ -187,9 +209,9 @@ Selected Implicit Rules
Some Explicit Rules
-------------------
README.html:
- Convert "README.md" to html. Requires markdown(1).
+ Convert "README.md" to html.
-README: Convert "README.html" to plain text. Requires w3m(1).
+README: Convert "README.html" to plain text.
endef
@@ -205,8 +227,8 @@ help:
define MAKE_INDEX_AND_GLOSSARY
sed -e '/@/d' < $*.idx > ,$*.idx; mv ,$*.idx $*.idx; \
-$(MAKEINDEX) $(MAKEINDEX_FLAGS) -s synthslant.ist -t $*.ilg -o $*.ind $*.idx; \
-$(MAKEINDEX) $(MAKEINDEX_FLAGS) -s gglo.ist -t $*.glg -o $*.gls $*.glo
+$(MAKEINDEX) $(MAKEINDEX_FLAGS) -s $*.ist -t $*.ilg -o $*.ind $*.idx; \
+$(MAKEINDEX) $(MAKEINDEX_FLAGS) -s $*.gst -t $*.glg -o $*.gls $*.glo
endef
define GREP_LATEX_WARNINGS
@@ -250,7 +272,13 @@ endef
%.mps: %.mp
- $(METAPOST) -s 'outputtemplate="%j.mps"' $(METAPOST_FLAGS) $<
+ $(METAPOST) -s 'outputtemplate="%j.mps"' $(METAPOST_FLAGS) $< || { \
+ printf '=== $*.log ===\n'; \
+ cat $*.log; \
+ printf '\n\n=== mpxerr.log ===\n'; \
+ cat mpxerr.log; \
+ false; \
+ } 1>&2
%.eps: %.png
@@ -265,7 +293,8 @@ endef
-synthslant.sty synthslant.ist synthslant-gauge.tex \
+synthslant.sty synthslant.ist \
+synthslant-gauge.tex synthslant-minimal-test.tex \
compare-with-the-gimp.png.base64 shear-transform.mp title.mp: \
synthslant.ins synthslant.dtx
$(LATEX) $(LATEX_FLAGS) $<
diff --git a/Master/texmf-dist/source/latex/synthslant/synthslant.dtx b/Master/texmf-dist/source/latex/synthslant/synthslant.dtx
index f5424cf7fa1..6c052c64a7f 100644
--- a/Master/texmf-dist/source/latex/synthslant/synthslant.dtx
+++ b/Master/texmf-dist/source/latex/synthslant/synthslant.dtx
@@ -3,11 +3,11 @@
% Copyright (C) 2024 by Ch. L. Spiel
%
% This work may be distributed and/or modified under the conditions
-% of the LaTeX Project Public License, either version 1.3 of this
+% 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
-% http://www.latex-project.org/lppl.txt
-% and version 1.3 or later is part of all distributions of LaTeX
+% httpc://www.latex-project.org/lppl.txt
+% and version 1.3c or later is part of all distributions of LaTeX
% version 2003/12/01 or later.
%
% \fi
@@ -26,7 +26,6 @@
\PassOptionsToClass{a4paper}{article}
\PassOptionsToPackage{hyperfootnotes=false}{hyperref}
-\PassOptionsToPackage{charter, scale=1.06}{newtxmath}
\PassOptionsToPackage{dvipsnames}{xcolor}
\usepackage{amsmath}
@@ -52,6 +51,7 @@
\newcommand*{\textls}[2][]{#2}
\fi
\usepackage{needspace}
+\usepackage[section]{placeins}
\usepackage{ragged2e}
\usepackage{setspace}
\usepackage[slant=.18, negslant=-.16]{synthslant}
@@ -65,7 +65,7 @@
\usepackage[default, lining, proportional, regular, semibold]{sourceserifpro}
\usepackage[lining, proportional, regular, semibold]{sourcesanspro}
\usepackage[lining, regular]{sourcecodepro}
-\usepackage[xcharter]{newtxmath}
+\usepackage[scaled=1.08, uprightscript, xcharter]{newtxmath}
\setstretch{1.04166}% \baselineskip: 12.5pt
@@ -74,15 +74,15 @@
\newcommand*{\fontclan}{\expandafter\@get@fontclan\f@family\relax}
\makeatother
-\newcommand*{\proportionalliningfigures}{\fontfamily{\fontclan-LF}\selectfont}
-\newcommand*{\proportionaloldstylefigures}{\fontfamily{\fontclan-OsF}\selectfont}
-\newcommand*{\tabularliningfigures}{\fontfamily{\fontclan-TLF}\selectfont}
-\newcommand*{\tabularoldstylefigures}{\fontfamily{\fontclan-TOsF}\selectfont}
+\DeclareRobustCommand{\proportionalliningfigures}{\fontfamily{\fontclan-LF}\selectfont}
+\DeclareRobustCommand{\proportionaloldstylefigures}{\fontfamily{\fontclan-OsF}\selectfont}
+\DeclareRobustCommand{\tabularliningfigures}{\fontfamily{\fontclan-TLF}\selectfont}
+\DeclareRobustCommand{\tabularoldstylefigures}{\fontfamily{\fontclan-TOsF}\selectfont}
-\newcommand*{\textdenominator}[1]{{\fontfamily{\fontclan-Dnom}\selectfont #1}}
-\newcommand*{\textinferior}[1]{{\fontfamily{\fontclan-Inf}\selectfont #1}}
-\newcommand*{\textnumerator}[1]{{\fontfamily{\fontclan-Numr}\selectfont #1}}
-\newcommand*{\textsuperior}[1]{{\fontfamily{\fontclan-Sup}\selectfont #1}}
+\DeclareRobustCommand{\textdenominator}[1]{{\fontfamily{\fontclan-Dnom}\selectfont #1}}
+\DeclareRobustCommand{\textinferior}[1]{{\fontfamily{\fontclan-Inf}\selectfont #1}}
+\DeclareRobustCommand{\textnumerator}[1]{{\fontfamily{\fontclan-Numr}\selectfont #1}}
+\DeclareRobustCommand{\textsuperior}[1]{{\fontfamily{\fontclan-Sup}\selectfont #1}}
\newcommand*{\nativetextfraction}[2]
{\mbox{\textnumerator{#1}\textfractionsolidus\textdenominator{#2}}}
@@ -92,21 +92,23 @@
\newenvironment*{tabfigures}
{\edef\rmdefault{\fontclan-T\sourceserifpro@figurestyle}\rm\ignorespaces}
{\ignorespacesafterend}
-
-\newcommand*{\elseries}{\def\mdseries@rm{el}\def\mdseries@sf{el}\def\mdseries@tt{el}}
-\newcommand*{\textel}[1]{{\elseries\textmd{#1}}}
-\newcommand*{\lseries}{\def\mdseries@rm{l}\def\mdseries@sf{l}\def\mdseries@tt{l}}
-\newcommand*{\textl}[1]{{\lseries\textmd{#1}}}
-%%--\newcommand*{\mdseries}{\def\mdseries@rm{m}\def\mdseries@sf{m}\def\mdseries@tt{m}}
-%%--\newcommand*{\textmd}[1]{{\mdseries\textmd{#1}}}
-\newcommand*{\sbseries}{\def\bfseries@rm{sb}\def\bfseries@sf{sb}\def\bfseries@tt{sb}}
-\newcommand*{\textsb}[1]{{\sbseries\textbf{#1}}}
-\newcommand*{\bseries}{\def\bfseries@rm{b}\def\bfseries@sf{b}\def\bfseries@tt{b}}
-\newcommand*{\textb}[1]{{\bseries\textbf{#1}}}
-\newcommand*{\ebseries}{\def\bfseries@rm{k}\def\bfseries@sf{eb}\def\bfseries@tt{k}}
-\newcommand*{\texteb}[1]{{\ebseries\textbf{#1}}}
\makeatother
+\DeclareRobustCommand{\elseries}{\fontseries{el}\selectfont}
+\DeclareTextFontCommand{\textel}{\elseries}
+\DeclareRobustCommand{\lseries}{\fontseries{l}\selectfont}
+\DeclareTextFontCommand{\textl}{\lseries}
+%%--\DeclareRobustCommand{\mdseries}{\fontseries{m}\selectfont}
+%%--\DeclareTextFontCommand{\textmd}{\mdseries}
+\DeclareRobustCommand{\sbseries}{\fontseries{sb}\selectfont}
+\DeclareTextFontCommand{\textsb}{\sbseries}
+\DeclareRobustCommand{\bseries}{\fontseries{b}\selectfont}
+\DeclareTextFontCommand{\textb}{\bseries}
+\DeclareRobustCommand{\ebseries}{\fontseries{eb}\selectfont}
+\DeclareTextFontCommand{\texteb}{\ebseries}
+\DeclareRobustCommand{\ubseries}{\fontseries{k}\selectfont}
+\DeclareTextFontCommand{\textub}{\ubseries}
+
\usepackage{cleveref}
@@ -119,7 +121,7 @@
citecolor = blue,
colorlinks = true,
linkcolor = blue,
- linktocpage = false,
+ linktocpage = true,
pdfauthor={Dr. Christoph L. Spiel},
pdfcreationdate={\pdffiledate},
pdfkeywords={LaTeX, font, italic, oblique, slant, upright},
@@ -131,9 +133,94 @@
}
+\SetExtraKerning[context=drop-left-sidebearing, name=source-code-normal, unit=space]
+ {font={T1/SourceCodePro-LF/m/n/44, T1/SourceCodePro-TLF/m/n/44}}
+ {
+ 1={-150,},
+ 2={-120,},
+ 3={-120,},
+ 4={-40,},
+ A={-100,},
+ B={-170,}
+ }
+
+\newlength{\sectiontocindent}
+\newlength{\sectionnumberwidth}
+\newlength{\subsectiontocindent}
+\newlength{\subsectionnumberwidth}
+\newlength{\subsubsectiontocindent}
+\newlength{\subsubsectionnumberwidth}
+
+\setlength{\sectiontocindent}{0pt}
+\setlength{\sectionnumberwidth}{40pt}
+\setlength{\subsectiontocindent}{40pt}
+\setlength{\subsectionnumberwidth}{25pt}
+\setlength{\subsubsectiontocindent}{65pt}
+\setlength{\subsubsectionnumberwidth}{30pt}
+
\makeatletter
-\renewcommand*{\@dotsep}{10000} % suppress leaders
-\patchcmd{\@dottedtocline}{\normalfont}{\bfseries}{\relax}{\PatchingFailed}
+\renewcommand*{\l@section}[2]
+ {\ifnum \c@tocdepth >\z@
+ \addpenalty\@secpenalty
+ \addvspace{1.0em \@plus\p@}%
+ \setlength{\@tempdima}{\sectionnumberwidth}%
+ \begingroup
+ \def\numberline##1{\hb@xt@\@tempdima{%
+ \tt\lseries
+ \fontsize{44}{0}\selectfont
+ \microtypecontext{kerning=drop-left-sidebearing}%
+ \iffalse\raisebox{-30pt}[0pt][0pt]{\rule{0.1pt}{40pt}}\fi
+ \textcolor{customred3}{##1}%
+ \hfil}}%
+ \parindent \z@
+ \rightskip \@pnumwidth
+ \parfillskip -\@pnumwidth
+ \leavevmode
+ \advance\leftskip\@tempdima
+ \hskip -\leftskip
+ \bfseries
+ \iffalse
+ \nobreak\hfil
+ \nobreak\hb@xt@\@pnumwidth{\hss #2\kern-\p@\kern\p@}%
+ \else
+ {\sffamily\large #1}\quad
+ {#2}\hfil\hbox{}
+ \fi
+ \par
+ \endgroup
+ \fi}
+
+\renewcommand*{\@dottedtocline}[5]
+ {\ifnum #1>\c@tocdepth
+ \else
+ \vskip \z@ \@plus.2\p@
+ \begingroup
+ \leftskip #2\relax
+ \rightskip \@tocrmarg
+ \parfillskip -\rightskip
+ \parindent #2\relax\@afterindenttrue
+ \interlinepenalty\@M
+ \leavevmode
+ \@tempdima #3\relax
+ \advance\leftskip \@tempdima
+ \null\nobreak
+ \hskip -\leftskip
+ {#4}\nobreak
+ \iffalse
+ \leaders\hbox{$\m@th \mkern \@dotsep mu\hbox{.}\mkern \@dotsep mu$}\hfill
+ \nobreak\hb@xt@\@pnumwidth{\hfil\normalfont \normalcolor #5\kern-\p@\kern\p@}%
+ \else
+ \hbox{\quad\normalfont\bfseries #5}\nobreak\hfill\hbox{}%
+ \fi
+ \par
+ \endgroup
+ \fi}
+
+\renewcommand*{\l@subsection}{\@dottedtocline{2}{\subsectiontocindent}{\subsectionnumberwidth}}
+\renewcommand*{\l@subsubsection}{\@dottedtocline{3}{\subsubsectiontocindent}{\subsubsectionnumberwidth}}
+\newrobustcmd*{\tocsquashedsubsections}
+ {\def\l@subsection{\@dottedtocline{2}{0pt}{\subsubsectionnumberwidth}}%
+ \def\l@subsubsection{\@dottedtocline{3}{0pt}{\subsubsectionnumberwidth}}}
\makeatother
@@ -156,8 +243,10 @@
\newcommand*{\floatcaptionwidth}{.79\textwidth}
-\captionsetup[figure]{font=small, justification=centerlast, labelfont=sc, width=\floatcaptionwidth}
-\captionsetup[table]{font=small, justification=centerlast, labelfont=sc, width=\floatcaptionwidth}
+\captionsetup[figure]{font=small, justification=centerlast,
+ labelfont=sc, width=\floatcaptionwidth}
+\captionsetup[table]{font=small, justification=centerlast,
+ labelfont=sc, width=\floatcaptionwidth}
\newsavebox{\listlabelbox}
@@ -188,13 +277,15 @@
\fancypagestyle{pagenumberonly}{
+ \fancyhf{}
\fancyhead[L]{}
\fancyhead[R]{\thepage}
}
-\pagestyle{fancy}
-\fancyhf{}
-\fancyhead[L]{\rightmark}
-\fancyhead[R]{\textsf{\thepage}}
+\fancypagestyle{fancy}{
+ \fancyhf{}
+ \fancyhead[L]{\rightmark}
+ \fancyhead[R]{\thepage}
+}
\newcommand*{\resetfancyhead}
{\fancyhead[L]{\textsf{\textsc{\textls[20]{\nouppercase\rightmark}}}}}
@@ -236,12 +327,9 @@
\pretocmd{\DescribeMacro}{\needspace{25pt}}{\relax}{\PrependingFailed}
-\setcounter{IndexColumns}{2}
-
-
\setlength{\columnsep}{20pt}
\setlength{\skip\footins}{25pt}
-\setlength{\overfullrule}{3pt}
+\setlength{\overfullrule}{0pt}
@@ -273,15 +361,19 @@
\newcommand*{\citenum}[1]{\@nameuse{b@#1}}
\makeatother
-\def\code#1{\texttt{#1}}
+\renewcommand*{\code}[1]{\texttt{#1}}
+
+\newcommand*{\codelineindicator}{\mbox{\small$\mathscr{l}$}}
\newrobustcmd*{\command}[1]{\mbox{\textbf{#1}}}
\newcommand*{\degree}{{}^\circ}
+\newcommand*{\detoxindex}[1]{\index{\detokenize{#1}}}
+
\newcommand*{\doublequotes}[1]{\guillemetright\kern-.03333em #1\guillemetleft}
-\newcommand*{\dumpmacro}[1]{\texttt{\detokenize\expandafter{#1}}}
+\newcommand*{\dumpmacro}[1]{\texttt{\detokenize\expandafter{#1}\unskip}}
\newcommand*{\filesystem}[1]{\mbox{\textit{#1\/}}}
@@ -295,12 +387,48 @@
\renewcommand*{\fps@table}{htbp}
\makeatother
+\apptocmd{\GlossaryParms}
+ {\RaggedRight\normalsize}
+ {\relax}
+ {\AppendingFailed}
+
+\let\oldhdclindex=\hdclindex
+\renewcommand*{\hdclindex}[2]
+ {\ifstrequal{#2}{code}
+ {\oldhdclindex{#1}{codeidx}}
+ {\oldhdclindex{#1}{#2}}}
+
+\let\oldhdpindex=\hdpindex
+\renewcommand*{\hdpindex}[2]{\textbf{\oldhdpindex{#1}{#2}}}
+
\newcommand*{\hollowrectangle}[2]
{\setlength{\fboxrule}{.5pt}%
\setlength{\fboxsep}{0pt}%
\framebox{\rule{#1}{0pt}\rule{0pt}{#2}}}
\newcommand*{\hollowsquare}[1]{\hollowrectangle{#1}{#1}}
+\apptocmd{\IndexParms}
+ {\RaggedRight\small}
+ {\relax}
+ {\AppendingFailed}
+
+\makeatletter
+\ExplSyntaxOn
+\apptocmd{\index@prologue}
+ {\legacy_if:nTF {codeline@index}
+ {We\space prefix\space all\space references\space
+ to\space code\space lines\space with~\singlequotes{\codelineindicator}.}
+ {}}
+ {\relax}
+ {\AppendingFailed}
+
+\newcommand*{\linenumberdecoration}
+ {\legacy_if:nTF {codeline@index}
+ {\codelineindicator}
+ {}}
+\ExplSyntaxOff
+\makeatother
+
\newcommand*{\logmacro}[1]
{\ifdef{#1}
{\message{^^JDump of macro \string#1 follows.^^J}
@@ -314,6 +442,24 @@
\begin{fullwidth}}
{\end{fullwidth}}
+
+\let\originalmulticols=\multicols
+\let\endoriginalmulticols=\endmulticols
+\RenewDocumentEnvironment{multicols}{m o o}
+ {\ifnum #1=1
+ \IfNoValueTF{#2}{\relax}{#2}%
+ \else
+ \IfNoValueTF{#2}
+ {\originalmulticols{#1}}
+ {\originalmulticols{#1}[#2]}%
+ \fi}
+ {\ifnum #1=1
+ \relax
+ \else
+ \endoriginalmulticols
+ \fi}
+
+
\newenvironment*{multilinecodeexample}
{\begin{quote}\tt
\def\indent{\mbox{}\hspace{25pt}}%
@@ -409,7 +555,7 @@
\newenvironment*{specialcodesection}[1]
{\Needspace{4\baselineskip}%
\begin{tcolorbox}[colback=white, colframe=\markercolor,
- bottomrule=0pt, leftrule=5pt, rightrule=0pt, toprule=0pt]
+ bottomrule=.5pt, leftrule=5pt, rightrule=.5pt, toprule=.5pt]
\sffamily
\begin{list}
{\specialcodesectionheading{#1}}
@@ -464,6 +610,12 @@
\newcommand*{\tikzlogo}{\textrm{Ti\textit{k\/}Z}}
+\newcommand*{\toccontinuesonnextpage}
+ {\addtocontents{toc}{\par
+ \bigskip
+ \hfill\textit{Table of Contents continued on next page.}\par
+ \clearpage}}
+
\newcommand*{\topstrut}{\rule{0pt}{1.3em}}
\newcommand*{\transpose}[1]{{#1}^{\text{T}}}
@@ -477,6 +629,12 @@
\copy0\kern\ttellipsisgap
\box0\kern\ttellipsisgap}
+\newcommand*{\unmarkedfntext}[1]
+ {{\def\thefootnote{}\footnote{#1}%
+ \addtocounter{footnote}{-1}}}
+
+\newcommand*{\userman}[1]{\textbf{\hyperpage{#1}}}
+
\newcommand*{\visualpar}{\textcolor{\markercolor}{\P}\linebreak[1]\enspace}
\newenvironment*{widecodeexample}
@@ -491,6 +649,15 @@
\hyphenation{% https://hyphenateit.com/en-us
+ neg-slant-context
+ neg-slant-environment
+ slant-context
+ slant-environment
+ synth-neg-slant
+ synth-slant
+ synth-slant-box
+ text-synth-slant
+ text-synth-upright-italic
}
@@ -515,12 +682,33 @@
%</driver>
%<*index-style>
actual '='
+delim_0 "\\nobreak\\enspace"
+delim_1 "\\nobreak\\enspace"
+delim_2 "\\nobreak\\enspace"
heading_prefix "\\pagebreak[3]\\smallskip\n\n{\\sffamily\\bfseries\\large "
heading_suffix "}\\nopagebreak\n"
headings_flag 1
level '>'
+line_max 65536
quote '!'
%</index-style>
+%<*changes-style>
+actual '='
+delim_0 "\\nobreak\\enspace"
+delim_1 "\\nobreak\\enspace"
+delim_2 "\\nobreak\\enspace"
+heading_prefix "\\pagebreak[3]\\smallskip\n\n{\\sffamily\\bfseries\\large "
+heading_suffix "}\\nopagebreak\n"
+headings_flag 0
+item_x1 "\\efill\n\\subitem "
+item_x2 "\\ "
+keyword "\\glossaryentry"
+level '>'
+line_max 65536
+postamble "\n\\end{theglossary}\n"
+preamble "\\begin{theglossary}\n \\makeatletter\\scan@allowedfalse"
+quote '!'
+%</changes-style>
% \fi
%
%
@@ -530,7 +718,7 @@ quote '!'
% \DoNotIndex{\edef,\else}
% \DoNotIndex{\endgroup,\endmicrotypecontext,\endnegslantenvironment,\endslantenvironment}
% \DoNotIndex{\expandafter,\ExplSyntaxOff,\ExplSyntaxOn}
-% \DoNotIndex{\fi,\font,\fontdimen,\fontspec,\fp}
+% \DoNotIndex{\fi,\font,\fontdimen,\fontspec,\fp,\fpeval}
% \DoNotIndex{\hbox,\hskip}
% \DoNotIndex{\ifcase,\ifcsdef,\ifdefined,\ifluatex,\ifmmode,\ifnum,\ifpdftex,\ifx,\itshape}
% \DoNotIndex{\kern}
@@ -540,16 +728,17 @@ quote '!'
% \DoNotIndex{\newbox,\newcommand,\NewDocumentCommand,\NewDocumentEnvironment,\newenvironment,\newrobustcmd}
% \DoNotIndex{\node,\nolinebreak}
% \DoNotIndex{\or}
-% \DoNotIndex{\PackageInfo,\PackageWarning,\ProcessOptionsX,\providecommand,\ProvidesPackage}
+% \DoNotIndex{\PackageError,\PackageInfo,\PackageWarning,\ProcessOptionsX,\providecommand,\ProvidesPackage}
% \DoNotIndex{\pdfoutput,\pdfrestore,\pdfsave,\pdfsetmatrix,\pstilt}
% \DoNotIndex{\relax,\RequirePackage}
-% \DoNotIndex{\sbox,\skip,\space}
+% \DoNotIndex{\sbox,\skip,\space,\string}
% \DoNotIndex{\tikz}
% \DoNotIndex{\upshape,\usebox}
% \DoNotIndex{\wd}
+% \DoNotIndex{\xdef}
%
%
-% \changes{v0.1}{2024-2-12}{Initial version}
+% \changes{v0.1}{2024-2-12}{Initial version.}
%
%
% \pagenumbering{roman}
@@ -636,39 +825,83 @@ end
% \footnotesize
% \noindent
% This package is copyright \textcopyright~2024 Ch.~L.~Spiel. It may be distributed and/or
-% modified under the conditions of the \LaTeX{} Project Public License \acronym{(LPPL)},
-% either version~1.3c of this license or --~at your option~-- any later version. This work
-% has the \acronym{LPPL} maintenance status \doublequotes{author-maintained}.\par
+% modified under the conditions of the \href{https://www.latex-project.org/lppl.txt}{\LaTeX{}
+% Project Public License} \acronym{(LPPL)}, either version~1.3c of this license or --~at your
+% option~-- any later version. This work has the \acronym{LPPL} maintenance status
+% \doublequotes{author-maintained}.\par
% \endgroup
%
%
% \clearpage
-% \thispagestyle{pagenumberonly}
-% \tableofcontents
+% \pagestyle{pagenumberonly}
%
-% \vspace{\fill}
-%
-% \begingroup
-% \footnotesize
-% \singlespacing
-% \noindent
-% The font samples~\singlequotes{fga} on the title page
-% were generated with the help of \MP{} using \doublequotes{\acronym{URW} Palladio~L}
-% in styles~\singlequotes{roman} and~\singlequotes{italic}.
-% The affine transformations were \code{slanted .2} for the slanted roman and
-% \code{slanted -.2} for the upright italics.\par
-% \endgroup
+% \unmarkedfntext{The font samples~\singlequotes{fga} on the title page were generated with the
+% help of \MP{} using \doublequotes{\acronym{URW} Palladio} in styles~\singlequotes{roman}
+% and~\singlequotes{italic}. The affine transformations were\enspace \code{slanted
+% .2}\enspace for the slanted roman and\enspace \code{slanted -.2}\enspace for the upright
+% italics.}
+% \tableofcontents
%
%
% \clearpage
-% \thispagestyle{pagenumberonly}
% \listoftables
% \bigskip
% \listoffigures
%
%
% \clearpage
+% \phantomsection
+% \addcontentsline{toc}{section}{\numberline{}Quick Reference}
+% \addtocontents{toc}{\medskip}
+% \section*{Quick Reference}
+%
+% Alphabetically sorted list of all user macros and environments defined by
+% package~\packagename{synthslant}. The list of all package options can be found on
+% \cpageref{sec:package-options} and \pageref{secend:package-options}. The
+% \hyperref[sec:index]{Index} on pages~\pageref{sec:index} to~\pageref{secend:index} may
+% provide some more detailed insights.
+%
+% \begin{list}{}{\itemindent=-\leftmargin \itemsep=4.5pt plus 2pt minus 1pt}
+% \NewDocumentCommand{\qritem}{m m O{}}
+% {\item
+% \hyperref[#1]{#2}#3\relax
+% \def\qrref{\cpageref{#1}}\par\ignorespaces}
+% \qritem{syn:negslantcontext}{\cs{negslantcontext}}
+% Name of the \packagename{microtype} context used when typesetting backward slanted
+% text~(\qrref)
+%
+% \qritem{syn:negslantenvironment}{\code{negslantenvironment}}
+% Wrapper around \cs{synthslantbox} when slanting backward with
+% \cs{textsynthuprightitalic}~(\qrref)
+%
+% \qritem{syn:slantcontext}{\cs{slantcontext}}
+% Name of the \packagename{microtype} context used when typesetting forward slanted
+% text~(\cpageref{syn:slantcontext})
+%
+% \qritem{syn:slantenvironment}{\code{slantenvironment}}
+% Wrapper around \cs{synthslantbox} when slanting forward with
+% \cs{textsynthslant}~(\qrref)
+%
+% \qritem{syn:synthnegslant}{\cs{synthnegslant}}
+% Slant value used by \cs{textsynthuprightitalic}~(\qrref)
+%
+% \qritem{syn:synthslantbox}{\cs{synthslantbox}}[\marg{slant}\marg{text}]
+% Slant \meta{text} (forward or backward) with \meta{slant}~(\qrref)
+%
+% \qritem{syn:synthslant}{\cs{synthslant}}
+% Slant value used by \cs{textsynthslant}~(\qrref)
+%
+% \qritem{syn:textsynthslant}{\cs{textsynthslant}}[\marg{text}]
+% Forward slant upright glyphs~(\qrref)
+%
+% \qritem{syn:textsynthuprightitalic}{\cs{textsynthuprightitalic}}[\marg{text}]
+% Backward slant italics or oblique glyphs~(\qrref)
+% \end{list}
+%
+%
+% \clearpage
% \pagenumbering{arabic}
+% \pagestyle{fancy}
% \section{Introduction}\label{sec:introduction}
%
% The \packagename{synthslant} package provides a translator (e.\,g.~\LaTeX, \pdfLaTeX, or
@@ -688,8 +921,8 @@ end
%
% \subsection{Appeal for Artificially Slanted Type}\label{sec:appleal-for-artificially-slanted}
%
-% Artificially slanted type have a bad reputation. Whenever there is an order to round up the
-% usual font suspects synthetically slanted, bolded\footnote{Package~\packagename{amsbsy}
+% Artificially slanted type have a lousy reputation. Whenever there is an order to round up
+% the usual font suspects synthetically slanted, bolded\footnote{Package~\packagename{amsbsy}
% defines a \doublequotes{Poor Man's Bold} macro~\cs{pmb} that works by
% \singlequotes{overprinting}. The authors of \packagename{amsbsy} recommend to prefer
% package~\packagename{bm} for bold mathematical symbols, though.}, and condensed type along
@@ -699,8 +932,9 @@ end
% condescension for synthetic bold and condensed variants. They spoil the glyphs' outline
% because they do not (and cannot) conserve the necessary proportions. For small-caps the
% problems are somewhat minor and I wonder how far one could get with an
-% \propername{OpenType}~font that supports a \code{size}~axis\index{font>axis>size=\code{size}}
-% as well as an \code{opsz}~axis\index{font>axis>opsz=\code{opsz}} in the necessary ranges to
+% \propername{OpenType}~font that supports a
+% \code{size}~axis\index{font>axis>size=\code{size}|userman} as well as an
+% \code{opsz}~axis\index{font>axis>opsz=\code{opsz}|userman} in the necessary ranges to
% construct convincing small-caps out of the multiple-master font.
%
% In my view artificial slanting keeps much of the font's character intact. In fact one
@@ -741,13 +975,14 @@ end
%
% Some fonts in current \LaTeX{} distributions offer slanted series right out of the box.
% \foreignphrase{Eureka!} In particular the oldest (and once upon a time the only) font family
-% shipping with \TeX, \href{https://tug.org/FontCatalogue/cmrfonts.html}{Computer Modern
-% Roman}\index{font>Computer Modern Roman} --~nowadays member of the \acronym{CM}-Super
-% family~-- is available in a deluge of almost thirty shapes. It covers not just slanted roman
-% or slanted smallcaps but also slanted typewriter and somewhat surprisingly upright italics.
-% Furthermore, the \LaTeXe{} font selection scheme provisions \singlequotes{\code{sl}} for
-% slanted shapes and \singlequotes{\code{ui}} for upright italics~\cite{fntguide}. The former
-% is accompanied by the macros~\cs{slshape} and~\cs{textsl}.
+% shipping with \TeX, \href{https://tug.org/FontCatalogue/cmrfonts.html}{\acronym{CM}
+% Roman}\index{font>typeface>CM Roman=\acronym{CM} Roman|userman} --~nowadays member of the
+% \acronym{CM}-Super family~-- is available in a deluge of almost thirty shapes. It covers not
+% just slanted roman or slanted smallcaps but also slanted typewriter and somewhat surprisingly
+% upright italics. Furthermore, the \LaTeXe{} font selection scheme provisions
+% \singlequotes{\code{sl}} for slanted shapes and \singlequotes{\code{ui}} for upright
+% italics~\cite{fntguide}. The former is accompanied by the macros~\cs{slshape}
+% and~\cs{textsl}.
%
% \begin{wraptable}{r}{.382\textwidth}
% \renewcommand*{\floatcaptionwidth}{\textwidth}
@@ -759,15 +994,15 @@ end
%
% \begin{tabular}{@{}l@{}}
% \toprule
-% Font Name \\
+% Font \\
% \midrule
-% Cairo\index{font>Cairo} \\
-% Commissioner\index{font>Commissioner} \\
-% Geologica\index{font>Geologica} \\
-% Gluten\index{font>Gluten} \\
-% Inter\index{font>Inter} \\
-% Recursive\index{font>Recursive} \\
-% Roboto Flex\index{font>Roboto Flex} \\
+% Cairo\index{font>typeface>Cairo|userman} \\
+% Commissioner\index{font>typeface>Commissioner|userman} \\
+% Geologica\index{font>typeface>Geologica|userman} \\
+% Gluten\index{font>typeface>Gluten|userman} \\
+% Inter\index{font>typeface>Inter|userman} \\
+% Recursive\index{font>typeface>Recursive|userman} \\
+% Roboto Flex\index{font>typeface>Roboto Flex|userman} \\
% \bottomrule
% \end{tabular}
% \end{wraptable}
@@ -781,8 +1016,9 @@ end
% \code{slnt}-axis} or fonts with an \href{https://v-fonts.com/tags/C5}{unusual variation} at
% \href{https://v-fonts.com/}{Variable Fonts}.} that offer a slant-axis\footnote{The
% registered axis is called \code{slnt} and it is not to be confused with the
-% \code{ital}~axis.}\index{font>axis>slant=\code{slant}}\index{font>axis>ital=\code{ital}} that
-% can be controlled with \packagename{fontspec}'s\index{package>\packagename{fontspec}}
+% \code{ital}~axis.}\index{font>axis>slant=\code{slant}|userman}\index{font>axis>ital=\code{ital}|userman}
+% that can be controlled with
+% \packagename{fontspec}'s\index{package>fontspec=\packagename{fontspec}|userman}
% \code{Slant}\footnote{Since \packagename{fontspec} version~2.9a as of 2024/2/13.}~key and
% \cref{tab:slanted-series-fonts} for a rather incomplete list of fonts that are shipped with
% slanted shapes. For these fonts \packagename{synthslant} is largely superfluous unless
@@ -801,35 +1037,35 @@ end
%
% \begin{tabular}[t]{@{}p{12em}@{}}
% \toprule
-% Font Name \\
+% Font \\
% \midrule
-% Arvo\index{font>Arvo} \\
-% Computer Modern Roman\index{font>Computer Modern Roman} \\
-% Domitian\index{font>Domitian} \\
-% Droid Serif\index{font>Droid Serif} \\
-% Erewhon\index{font>Erewhon} \\
-% Extended Charter\index{font>Extended Charter} \\
-% \acronym{GFS} Artemisia\index{font>GFS Artemisia=\acronym{GFS} Artemisia} \\
-% \acronym{GFS} Bodoni\index{font>GFS Bodoni=\acronym{GFS} Bodoni} \\
-% \acronym{GFS} Didot\index{font>GFSDidot=\acronym{GFS} Didot} \\
+% Arvo\index{font>typeface>Arvo|userman} \\
+% \acronym{CM} Roman\index{font>typeface>CM Roman=\acronym{CM} Roman|userman} \\
+% Domitian\index{font>typeface>Domitian|userman} \\
+% Droid Serif\index{font>typeface>Droid Serif|userman} \\
+% Erewhon\index{font>typeface>Erewhon|userman} \\
+% Extended Charter\index{font>typeface>Extended Charter|userman} \\
+% \acronym{GFS} Artemisia\index{font>typeface>GFS Artemisia=\acronym{GFS} Artemisia|userman} \\
+% \acronym{GFS} Bodoni\index{font>typeface>GFS Bodoni=\acronym{GFS} Bodoni|userman} \\
+% \acronym{GFS} Didot\index{font>typeface>GFS Didot=\acronym{GFS} Didot|userman} \\
% \\
% \bottomrule
% \end{tabular}
% \qquad
% \begin{tabular}[t]{@{}p{12em}@{}}
% \toprule
-% Font Name \\
+% Font \\
% \midrule
-% Cabin\index{font>Cabin} \\
-% Clear Sans\index{font>Clear Sans} \\
-% Cuprum\index{font>Cuprum} \\
-% Fira Sans\index{font>Fira Sans} \\
-% Gandhi Sans\index{font>Gandhi Sans} \\
-% \acronym{Inria} Sans\index{font>Inria Sans=\acronym{Inria} Sans} \\
-% Lato\index{font>Lato}\itshapemark \\
-% Montserrat\index{font>Montserrat} \\
-% \acronym{PT} Sans\index{font>PT Sans=\acronym{PT} Sans} \\
-% Source Sans Pro\index{font>Source Sans Pro} \\
+% Cabin\index{font>typeface>Cabin|userman} \\
+% Clear Sans\index{font>typeface>Clear Sans|userman} \\
+% Cuprum\index{font>typeface>Cuprum|userman} \\
+% Fira Sans\index{font>typeface>Fira Sans|userman} \\
+% Gandhi Sans\index{font>typeface>Gandhi Sans|userman} \\
+% \acronym{Inria} Sans\index{font>typeface>Inria Sans=\acronym{Inria} Sans|userman} \\
+% Lato\itshapemark\index{font>typeface>Lato|userman} \\
+% Montserrat\index{font>typeface>Montserrat|userman} \\
+% \acronym{PT} Sans\index{font>typeface>PT Sans=\acronym{PT} Sans|userman} \\
+% Source Sans Pro\index{font>typeface>Source Sans Pro|userman} \\
% \bottomrule
% \end{tabular}
%
@@ -852,15 +1088,16 @@ end
% \pdfTeX~version~1.40.0~\cite{schroeder:2007}.} With the help of the latter affine
% transformations of arbitrary content can be coded directly by setting the transformation
% matrix. A slight variant of his code is used in this package for the \acronym{PDF}- and
-% \packagename{l3draw}\index{package>\packagename{l3draw}}-slant~engines. The implementations
-% for \pstrickslogo, \tikzlogo{}, and \packagename{fontspec}\packagename{fontspec} are trivial
-% as they build upon shear~functions supplied by the respective packages.
+% \packagename{l3draw}\index{package>l3draw=\packagename{l3draw}|userman}-slant~engines. The
+% implementations for \pstrickslogo, \tikzlogo{}, and
+% \packagename{fontspec}\packagename{fontspec} are trivial as they build upon shear~functions
+% supplied by the respective packages.
%
%
% \subsection{Shear Transformation, Slant, and Angle}\label{sec:shear-transformation}
%
-% \index{slant>operation}
-% \index{shear>transformation}
+% \index{slant>operation|userman}
+% \index{shear>transformation|userman}
% Mathematically the slant operation is a shear transformation, which can be expressed with the
% equation
% \begin{equation}\label{equ:shear-transformation}
@@ -1018,7 +1255,7 @@ end
% For \(\alpha = 0\) the shear matrix becomes the identity matrix. Throughout of
% \packagename{synthslant} we work with the \meta{slant} which is \(\sin \alpha\) in
% \cref{equ:shear-transformation} and avoid converting back and forth to the
-% \index{shear>angle}shear angle~\(\alpha\).\footnote{At least one slant engine currently
+% \index{shear>angle|userman}shear angle~\(\alpha\).\footnote{At least one slant engine currently
% requires such a conversion, namely~\pstrickslogo. The math is hidden from the user, though.}
% Some values for orientation: \mbox{\(\sin 5.74\degree \approx .1\)}, \mbox{\(\sin 11.5\degree
% \approx .2\)}, and \mbox{\(\sin 17.5\degree \approx .3\)}.\footnote{For small
@@ -1038,8 +1275,8 @@ end
% \begin{enumerate}
% \item\label{it:no-italics}
% Generate a slanted serif in the unfortunate situation when a serif font comes without
-% italics such as \singlequotes{\acronym{URW}~Antiqua}\index{font>URW Antiqua=\acronym{URW}
-% Antiqua}.
+% italics such as
+% \singlequotes{\acronym{URW}~Antiqua}\index{font>typeface>URW Antiqua=\acronym{URW} Antiqua|userman}.
%
% Here, the user is relatively free to choose a \meta{slant}, for there are no italics whose
% angle must be matched. \packagename{Synthslant}'s default of~.2 should be a good starting
@@ -1053,8 +1290,8 @@ end
%
% \item\label{it:correct-italics-angle}
% An italics shape that has an excessive slant angle, as
-% e.\,g.~\singlequotes{Libre~Caslon}\index{font>Libre Caslon} may be corrected, i.\,e.,
-% partially un-slanted.
+% e.\,g.~\singlequotes{Libre~Caslon}\index{font>typeface>Libre Caslon|userman} may be corrected,
+% i.\,e., partially un-slanted.
%
% In this case, and generally if a font as a whole needs to be corrected, an alternative
% approach like the one sketched in \cref{sec:alternative} on \cpageref{sec:alternative} may
@@ -1062,16 +1299,16 @@ end
%
% \item\label{it:generate-sole-obliques}
% Generate an oblique sans-serif if a sans-serif font comes without an oblique shape as,
-% e.\,g., \singlequotes{\acronym{URW}~Grotesk}.\index{font>URW Grotesk=\acronym{URW} Grotesk}
+% e.\,g., \singlequotes{\acronym{URW}~Grotesk}.\index{font>typeface>URW Grotesk=\acronym{URW} Grotesk|userman}
%
% \item\label{it:generate-extra-obliques}
% Supply a slanted sans-serif shape for sans-serif fonts with designed, this is \emph{true}
-% obliques as e.\,g.~\singlequotes{Open Sans}.\index{font>Open Sans}
+% obliques as e.\,g.~\singlequotes{Open Sans}.\index{font>typeface>Open Sans|userman}
%
% \item\label{it:slant-typewriter}
% Fixed-width --~also called \singlequotes{typewriter} or \singlequotes{teletype}~-- fonts
-% without obliques (Yes, I am looking at you, Inconsolata!)\index{font>Inconsolata} finally
-% get an oblique shape.
+% without obliques (Yes, I am looking at you, Inconsolata!)\index{font>typeface>Inconsolata|userman}
+% finally get an oblique shape.
%
% \item\label{it:slanted-small-caps}
% Small caps without accompanying italics can be slanted, too.
@@ -1109,7 +1346,9 @@ end
%
% \begingroup
% \newcommand*{\indexpackageoption}[1]
-% {\index{package option>#1=\code{#1}}\index{#1=\code{#1}~(option)}\ignorespaces}
+% {\detoxindex{package option>#1=\code{#1}|userman}%
+% \detoxindex{#1=\code{#1}~(option)|userman}%
+% \ignorespaces}
% \begin{description}
% [before={\let\oldmakelabel=\makelabel
% \renewcommand{\makelabel}[1]
@@ -1130,13 +1369,14 @@ end
%
% \item[|fontspec|]\label{item:fontspec}
% \indexpackageoption{fontspec}
-% Use \packagename{fontspec}\index{package>\packagename{fontspec}} as slanting
-% back-end.\footnote{Requires \filesystem{fontspec.sty.}}
+% Use \packagename{fontspec}\index{package>fontspec=\packagename{fontspec}|userman} as
+% slanting back-end.\footnote{Requires \filesystem{fontspec.sty.}}
%
% \item[|l3draw|]\label{item:l3draw}
% \indexpackageoption{l3draw}
-% Select the \singlequotes{draw} layer\index{package>\packagename{l3draw}} of \LaTeXIII{} as
-% base for the slanting engine.\footnote{This option requires \filesystem{l3draw.sty.}}
+% Select the \singlequotes{draw} layer\index{package>l3draw=\packagename{l3draw}|userman} of
+% \LaTeXIII{} as base for the slanting engine.\footnote{This option requires
+% \filesystem{l3draw.sty.}}
%
% \begin{caution}
% This engine is experimental and the \singlequotes{draw} layer of \LaTeXIII{} itself is
@@ -1148,7 +1388,7 @@ end
% \indexpackageoption{negslant}
% Set the default value for \hyperref[syn:synthnegslant]{\cs{synthnegslant}} \emph{only.}
% The argument \meta{slant-expr} is a floating-point expression. Note that for this option
-% \meta{slant-expr} must evaluate to a non-positive value.
+% \meta{slant-expr} must evaluate to a nonpositive value.
%
% \item[|PDF|, |pdf|]\label{item:pdf}
% \indexpackageoption{pdf}
@@ -1159,14 +1399,14 @@ end
% \indexpackageoption{posslant}
% Set the default value for \hyperref[syn:synthslant]{\cs{synthslant}} \emph{only.} The
% argument \meta{slant-expr} is a floating-point expression. Note that for this option
-% \meta{slant-expr} must evaluate to a non-negative value.
+% \meta{slant-expr} must evaluate to a nonnegative value.
%
% \item[|PS|, |ps|]\label{item:postscript}
-% \index{ps}
-% Use \pstrickslogo\index{package>\packagename{pstricks}} to delegate slanting to the
-% PostScript\index{PostScript} interpreter. Obviously requires \pstrickslogo\footnote{The
-% package actually required is \filesystem{pst-3d.sty.}} and \acronym{DVI}-to-PostScript
-% translation.
+% \index{ps|userman}
+% Use \pstrickslogo\index{package>pstricks=\packagename{pstricks}|userman} to delegate
+% slanting to the PostScript\index{PostScript|userman} interpreter. Obviously requires
+% \pstrickslogo\footnote{The package actually required is \filesystem{pst-3d.sty.}} and
+% \acronym{DVI}-to-PostScript translation.
%
% \begin{caution}
% This engine is still experimental and produces low-quality output! See
@@ -1176,7 +1416,7 @@ end
% \item[|slant=|\meta{slant-expr}]\label{item:slant}
% \indexpackageoption{slant}
% Set the default values for both \hyperref[syn:synthslant]{\cs{synthslant}} and
-% \hyperref[syn:synthnegslant]{\cs{synthnegslant}}, this is, behave as if the two package
+% \hyperref[syn:synthnegslant]{\cs{synthnegslant}}, this is, act as if the two package
% options \(\code{posslant} = \meta{slant-expr}\) and \(\code{negslant} =
% -(\meta{slant-expr})\) have been given. The argument \meta{slant-expr} is a floating-point
% expression.
@@ -1185,8 +1425,8 @@ end
%
% \item[|TikZ|, |tikz|]\label{item:tikz}
% \indexpackageoption{tikz}
-% Use \packagename{TikZ}\index{package>\packagename{TikZ}} for slanting.\footnote{Requires
-% \filesystem{tikz.sty.}}
+% Use \packagename{TikZ}\index{package>tikz=\packagename{tikz}|userman} for
+% slanting.\footnote{Requires \filesystem{tikz.sty.}}
%
% \begin{caution}
% This engine is still experimental and produces low-quality output! See
@@ -1199,7 +1439,7 @@ end
% floating-point \emph{expressions} as their arguments not just plain floating-point literals.
% See Ref.~\citenum{latex3-interfaces}, Ch.~29, \doublequotes{The \textsf{l3fp}~module~--
% Floating points} for a description of the floating-point expression syntax and the available
-% functions.
+% functions.\label{secend:package-options}
%
%
% \clearpage
@@ -1218,7 +1458,7 @@ end
%
% \DescribeMacro{\synthslant}
% Control the slant applied by \hyperref[syn:textsynthslant]{\cs{textsynthslant}}.
-% This value is non-negative.
+% This value is nonnegative.
%
% \begin{synopsis}\label{syn:synthslant}
% \cs{synthslant}
@@ -1248,43 +1488,43 @@ end
% \begin{tabfigures}
% \begin{tabular}[t]{@{}p{9.5em}l@{}}
% \toprule
-% Font Name & Slant \\
+% Font & Slant \\
% \midrule
-% \acronym{ADF} Accanthis\index{font>ADF Accanthis=\acronym{ADF} Accanthis} & .26 \\
-% \acronym{ADF} Baskervald\index{font>ADF Baskervald=\acronym{ADF} Baskervald} & .32 \\
-% \acronym{ADF} Berenis\index{font>ADF Berenis=\acronym{ADF} Berenis} & .2 \\
-% \acronym{ADF} Venturis\index{font>ADF Venturis=\acronym{ADF} Venturis} & .2 \\
-% Alegreya\index{font>Alegreya} & .2 \\
-% Arvo\index{font>Arvo} & .2 \\
-% BaskervilleF\index{font>BaskervilleF} & .2 \\
-% Bera Serif\index{font>Bera Serif} & .2 \\
-% Bitter\index{font>Bitter} & .16 \\
-% Caladea\index{font>Caladea} & .14 \\
-% Clara\index{font>Clara} & .24 \\
-% Cochineal\index{font>Cochineal} & .2 \\
-% Coelacanth\index{font>Coelacanth} & .2 \\
-% Crimson Pro\index{font>Crimson Pro} & .2 \\
-% Crimson Text\index{font>Crimson Text} & .2 \\
+% \acronym{ADF} Accanthis\index{font>typeface>ADF Accanthis=\acronym{ADF} Accanthis|userman} & .26 \\
+% \acronym{ADF} Baskervald\index{font>typeface>ADF Baskervald=\acronym{ADF} Baskervald|userman} & .32 \\
+% \acronym{ADF} Berenis\index{font>typeface>ADF Berenis=\acronym{ADF} Berenis|userman} & .2 \\
+% \acronym{ADF} Venturis\index{font>typeface>ADF Venturis=\acronym{ADF} Venturis|userman} & .2 \\
+% Alegreya\index{font>typeface>Alegreya|userman} & .2 \\
+% Arvo\index{font>typeface>Arvo|userman} & .2 \\
+% BaskervilleF\index{font>typeface>BaskervilleF|userman} & .2 \\
+% Bera Serif\index{font>typeface>Bera Serif|userman} & .2 \\
+% Bitter\index{font>typeface>Bitter|userman} & .16 \\
+% Caladea\index{font>typeface>Caladea|userman} & .14 \\
+% Clara\index{font>typeface>Clara|userman} & .24 \\
+% Cochineal\index{font>typeface>Cochineal|userman} & .2 \\
+% Coelacanth\index{font>typeface>Coelacanth|userman} & .2 \\
+% Crimson Pro\index{font>typeface>Crimson Pro|userman} & .2 \\
+% Crimson Text\index{font>typeface>Crimson Text|userman} & .2 \\
% \bottomrule
% \end{tabular}%
% \qquad
% \begin{tabular}[t]{@{}p{9.5em}l@{}}
% \toprule
-% Font Name & Slant \\
+% Font & Slant \\
% \midrule
-% Day Roman\index{font>Day Roman} & .2 \\
-% \acronym{EB} Garamond\index{font>EB Garamond=\acronym{EB} Garamond} & .3 \\
-% etbb\index{font>etbb} & .2 \\
-% fbb\index{font>fbb} & .2 \\
-% Garamond Expert\index{font>Garamond Expert} & .2 \\
-% Gandhi Serif\index{font>Gandhi Serif} & .2 \\
-% Gentium\index{font>Gentium} & .2 \\
-% Ibarra Real Nova\index{font>Ibarra Real Nova} & .2 \\
-% \acronym{IBM} Plex Serif\index{font>IBM Plex Serif=\acronym{IBM} Plex Serif} & .24 \\
-% \acronym{Inria} Serif\index{font>Inria Serif=\acronym{Inria} Serif} & .2 \\
-% Libertinus Serif\index{font>Libertinus Serif} & .2 \\
-% Libre Baskerville\index{font>Libre Baskerville} & .3 \\
-% Libre Caslon\index{font>Libre Caslon} & .38 \\
+% Day Roman\index{font>typeface>Day Roman|userman} & .2 \\
+% \acronym{EB} Garamond\index{font>typeface>EB Garamond=\acronym{EB} Garamond|userman} & .3 \\
+% etbb\index{font>typeface>etbb|userman} & .2 \\
+% fbb\index{font>typeface>fbb|userman} & .2 \\
+% Garamond Expert\index{font>typeface>Garamond Expert|userman} & .2 \\
+% Gandhi Serif\index{font>typeface>Gandhi Serif|userman} & .2 \\
+% Gentium\index{font>typeface>Gentium|userman} & .2 \\
+% Ibarra Real Nova\index{font>typeface>Ibarra Real Nova|userman} & .2 \\
+% \acronym{IBM} Plex Serif\index{font>typeface>IBM Plex Serif=\acronym{IBM} Plex Serif|userman} & .24 \\
+% \acronym{Inria} Serif\index{font>typeface>Inria Serif=\acronym{Inria} Serif|userman} & .2 \\
+% Libertinus Serif\index{font>typeface>Libertinus Serif|userman} & .2 \\
+% Libre Baskerville\index{font>typeface>Libre Baskerville|userman} & .3 \\
+% Libre Caslon\index{font>typeface>Libre Caslon|userman} & .38 \\
% & \\
% & \\
% \bottomrule
@@ -1292,22 +1532,22 @@ end
% \qquad
% \begin{tabular}[t]{@{}p{9.5em}l@{}}
% \toprule
-% Font Name & Slant \\
+% Font & Slant \\
% \midrule
-% Merriweather\index{font>Merriweather} & .14 \\
-% MLModern\index{font>MLModern} & .23 \\
-% Noto Serif\index{font>Noto Serif} & .22 \\
-% \acronym{PT} Serif\index{font>PT Serif=\acronym{PT} Serif} & .2 \\
-% Roboto Slab\index{font>Roboto Slab} & .2 \\
-% Quattrocento\index{font>Quattrocento} & .2 \\
-% Source Serif Pro\index{font>Source Serif Pro} & .18 \\
-% Spectral\index{font>Spectral} & .18 \\
-% \acronym{STIX}\index{font>STIX=\acronym{STIX}} & .2 \\
-% \TeX{} Gyre Pagella\index{font>TeX Gyre Pagella=\TeX{} Gyre Pagella} & .16 \\
-% \acronym{TX} Fonts Serif\index{font>TX Fonts Serif=\acronym{TX} Fonts Serif} & .2 \\
-% \acronym{URW} Antiqua\index{font>URW Antiqua=\acronym{URW} Antiqua} & .2 \\
-% \acronym{URW} Nimbus Roman\index{font>URW Nimbus Roman=\acronym{URW} Nimbus Roman} & .2 \\
-% Utopia\index{font>Utopia} & .2 \\
+% Merriweather\index{font>typeface>Merriweather|userman} & .14 \\
+% \acronym{ML} Modern\index{font>typeface>ML Modern=\acronym{ML} Modern|userman} & .23 \\
+% Noto Serif\index{font>typeface>Noto Serif|userman} & .22 \\
+% \acronym{PT} Serif\index{font>typeface>PT Serif=\acronym{PT} Serif|userman} & .2 \\
+% Roboto Slab\index{font>typeface>Roboto Slab|userman} & .2 \\
+% Quattrocento\index{font>typeface>Quattrocento|userman} & .2 \\
+% Source Serif Pro\index{font>typeface>Source Serif Pro|userman} & .18 \\
+% Spectral\index{font>typeface>Spectral|userman} & .18 \\
+% \acronym{STIX}\index{font>typeface>STIX=\acronym{STIX}|userman} & .2 \\
+% \TeX{} Gyre Pagella\index{font>typeface>TeX Gyre Pagella=\TeX{} Gyre Pagella|userman} & .16 \\
+% \acronym{TX} Fonts Serif\index{font>typeface>TX Fonts Serif=\acronym{TX} Fonts Serif|userman} & .2 \\
+% \acronym{URW} Antiqua\index{font>typeface>URW Antiqua=\acronym{URW} Antiqua|userman} & .2 \\
+% \acronym{URW} Nimbus Roman\index{font>typeface>URW Nimbus Roman=\acronym{URW} Nimbus Roman|userman} & .2 \\
+% Utopia\index{font>typeface>Utopia|userman} & .2 \\
% & \\
% \bottomrule
% \end{tabular}
@@ -1319,7 +1559,7 @@ end
% \DescribeMacro{\synthnegslant}
% Control the slant applied by
% \hyperref[syn:textsynthuprightitalic]{\cs{textsynthuprightitalic}}. This value is
-% non-positive.
+% nonpositive.
%
% \begin{synopsis}\label{syn:synthnegslant}
% \cs{synthnegslant}
@@ -1332,9 +1572,9 @@ end
% more flexible and powerful interface, see~\cref{sec:advanced-interface}.
%
% \begin{note}
-% The following restrictions and workarounds to get line-breaking and automatic hyphenation
-% working again do \emph{not} apply to the
-% \packagename{fontspec}\index{package>\packagename{fontspec}} back-end.
+% The following restrictions and workarounds to get line-breaking and \TeX's automatic
+% hyphenation working again do \emph{not} apply to the
+% \packagename{fontspec}\index{package>fontspec=\packagename{fontspec}|userman} back-end.
% \end{note}
%
% \noindent
@@ -1344,7 +1584,7 @@ end
% provisions to re-enable at least some breakability.
%
% \begin{enumerate}
-% \item Spaces introduce breakpoint,\index{breakpoint at space} e.\,g.
+% \item Spaces introduce breakpoint,\index{breakpoint at space|userman} e.\,g.
% \begin{codeexample}
% \cs{textsynthslant}\{topological dual space\}
% \end{codeexample}
@@ -1352,8 +1592,8 @@ end
% second word (producing another horizontal box). \TeX{} sees two (unbreakable) boxes and a
% discardable space when it comes to linebreaking.
%
-% \item Discretionary hyphens\index{discretionary hyphen} in the form of \singlequotes{\cs{-}}
-% get propagated. So, we could improve on our above example by saying
+% \item Discretionary hyphens\index{discretionary hyphen|userman} in the form of
+% \singlequotes{\cs{-}} get propagated. So, we could improve on our above example by saying
% \begin{codeexample}
% \cs{textsynthslant}\{topo\cs{-}log\cs{-}i\cs{-}cal dual space\}
% \end{codeexample}
@@ -1374,7 +1614,7 @@ end
%
% In horizontal mode switch to an upright shape, slant \meta{text} with the slant value stored
% in \hyperref[syn:synthslant]{\cs{synthslant}} and apply \doublequotes{slant
-% correction}\index{slant>correction} --~the equivalent of italics correction~-- at the
+% correction}\index{slant>correction|userman} --~the equivalent of italics correction~-- at the
% right-hand side of~\meta{text}.
%
% In math mode just slant \meta{text} with the slant value stored in
@@ -1391,7 +1631,7 @@ end
%
% \noindent
% where we show the font modification in conjunction with the
-% \packagename{babel}~macro\index{package>\packagename{babel}}
+% \packagename{babel}~macro\index{package>babel=\packagename{babel}|userman}
% \cs{foreignlanguage}~\cite{package:babel}.~\visualpar
%
% In math-mode you cannot have enough fonts, symbols, and most of the gizmos over there! I
@@ -1485,7 +1725,7 @@ end
% \end{synopsis}
%
% Switch to an upright font shape and --~if
-% package~\packagename{microtype}~\cite{package:microtype}\index{package>\packagename{microtype}}
+% package~\packagename{microtype}~\cite{package:microtype}\index{package>microtype=\packagename{microtype}|userman}
% has been loaded~-- enter the Microtype-context defined by
% macro~\hyperref[syn:slantcontext]{\cs{slantcontext}}. At the end add some slant correction,
% which is the equivalent of italics correction.
@@ -1511,7 +1751,7 @@ end
% Microtype-context defined by macro~\hyperref[syn:negslantcontext]{\cs{negslantcontext}}.
%
% \DescribeMacro{\slantcontext}
-% Microtype context used when typesetting slanted text.
+% Name of the \packagename{microtype} context used when typesetting slanted text.
%
% \begin{synopsis}\label{syn:slantcontext}
% \cs{slantcontext}
@@ -1530,7 +1770,7 @@ end
% \end{note}
%
% \DescribeMacro{\negslantcontext}
-% Microtype context used when typesetting un-slanted text.
+% Name of the \packagename{microtype} context used when typesetting backward slanted text.
%
% \begin{synopsis}\label{syn:negslantcontext}
% \cs{negslantcontext}
@@ -1667,13 +1907,13 @@ end
% and --~after recompiling with the appropriate \LaTeX-engine~-- used to examine the details of
% the slant operations.
%
-% Page~2, Sec.~3.1, \singlequotes{Copy}, shows wild mixes of different font shapes, native al
-% well as synthesized ones. Here, the slanted glyphs as well as the upright italics should
-% blend well with the native italics/obliques and the normal font, respectively.
+% Page~2, Sec.~3.1, \singlequotes{Copy}, shows wild mixes of different font shapes, native and
+% synthesized ones. Here, the slanted glyphs as well as the upright italics should blend well
+% with the native italics/obliques and with the normal font, respectively.
%
-% Page~3, Sec.~3.2 and following sub-sections, examines the coupling of
-% \packagename{synthslant} with the \TeX-system and some of its extensions. If a slant engine
-% malfunctions, it will become evident on this page.
+% Page~3, Sec.~3.2 and following sub-sections, examine the coupling of \packagename{synthslant}
+% with the \TeX-system and some of its extensions. If a slant engine malfunctions, it will
+% become evident on this page.
%
%
% \clearpage
@@ -1687,7 +1927,7 @@ end
% \packagename{Syntslant}~manipulations may not survive
% (pre-)\discretionary{}{}{}processing by \MP.
%
-% \item[\packagename{l3draw} engine.]\index{package>\packagename{l3draw}}\mbox{}
+% \item[\packagename{l3draw} engine.]\index{package>l3draw=\packagename{l3draw}|userman}\mbox{}
% \begin{itemize}
% \item Depending of the shear direction the \packagename{l3draw} engine may generate some
% extra positive or negative space at the ends of the text.
@@ -1697,10 +1937,10 @@ end
% \item Markedly slower than the \acronym{PDF}-implementation!
% \end{itemize}
%
-% \item[\pstrickslogo{} engine.]\index{package>\packagename{pstricks}}
+% \item[\pstrickslogo{} engine.]\index{package>pstricks=\packagename{pstricks}|userman}
% The \pstrickslogo{} engine produces some extra space at the ends of the text.
%
-% \item[\tikzlogo{} engine.]\index{package>\packagename{tikz}}
+% \item[\tikzlogo{} engine.]\index{package>tikz=\packagename{tikz}|userman}
% The \tikzlogo{} engine produces some extra space at the ends of the text.
% \end{description}
%
@@ -1753,7 +1993,7 @@ end
%
% I want to elaborate the example given in \cref{sec:usage-ideas},
% \cref{it:correct-italics-angle} and generate less-angled italics for
-% Libre~Caslon.\index{font>Libre Caslon} Here is a suitable map line taken from
+% Libre~Caslon.\index{font>typeface>Libre Caslon|userman} Here is a suitable map line taken from
% \filesystem{pdftex.map} on my system:
%
% \begin{multilinecodeexample}
@@ -1824,7 +2064,8 @@ end
% \end{example}
%
%
-% \subsection{Combining \LaTeX{} and \command{dvipdfmx}}\label{sec:alternative-latex}
+% \subsection{Combining \LaTeX{} and
+% \texorpdfstring{\command{dvipdfmx}}{dvipdfmx}}\label{sec:alternative-latex}
%
% The alternative when using \LaTeX{} is similar the one elaborated in the previous section.
% The font mapline gets modified by \cs{special} primitive
@@ -1872,14 +2113,20 @@ end
%
% \MaybeStop{
% \clearpage
-% \phantomsection
-% \resetfancyhead
-% \addcontentsline{toc}{section}{Change History}
-% \PrintChanges
+% \begingroup
+% \setcounter{GlossaryColumns}{1}
+% \phantomsection
+% \label{sec:changes}
+% \resetfancyhead
+% \addtocontents{toc}{\bigskip}
+% \addcontentsline{toc}{section}{\numberline{}Change History}
+% \PrintChanges
+% \endgroup
%
% \clearpage
% \phantomsection
-% \addcontentsline{toc}{section}{References}
+% \addtocontents{toc}{\medskip}
+% \addcontentsline{toc}{section}{\numberline{}References}
% \begin{RaggedRight}
% \begin{thebibliography}{88}
% \bibitem{package:relsize}
@@ -1986,20 +2233,31 @@ end
%
%
% \clearpage
-% \begin{RaggedRight}
+% \begingroup
% \setcounter{IndexColumns}{2}
% \setlength{\columnsep}{30pt}
-% \label{sec:index}
% \phantomsection
-% \addcontentsline{toc}{section}{Index}
+% \label{sec:index}
+% \addtocontents{toc}{\medskip}
+% \addcontentsline{toc}{section}{\numberline{}Index}
+% \raggedcolumns
+% \def\codeidx##1{\linenumberdecoration\textbf{##1}}
+% \def\main##1{\linenumberdecoration\underbar{\textbf{##1}}}
+% \def\usage##1{\textit{\textbf{##1}}}
% \PrintIndex
-% \end{RaggedRight}
+% \label{secend:index}
+% \endgroup
% }
%
%
% \clearpage
+% \toccontinuesonnextpage
% \section{Package Code}\label{sec:package-code}
-% \addtocontents{toc}{\begingroup\small}
+% \addtocontents{toc}{\protect\begin{list}{}{\leftmargin=\subsectiontocindent\parsep=0pt}}
+% \addtocontents{toc}{\protect\item}
+% \addtocontents{toc}{\RaggedRight}
+% \addtocontents{toc}{\small}
+% \addtocontents{toc}{\tocsquashedsubsections}
% \addtocontents{toc}{\protect\begin{multicols}{2}}
% \addtocontents{toc}{\protect\raggedcolumns}
%
@@ -2008,12 +2266,15 @@ end
% and explain its implementation details.
%
%
+% \changes{v0.1a}{2024-6-2}{Add missing dependency on \packagename{etoolbox}.
+% Fix suggested by \code{mbertucci47}.}
% \begin{macrocode}
%<*package>
\NeedsTeXFormat{LaTeX2e}[2005/12/01]
\ProvidesPackage{synthslant}
- [2024/05/07 v0.1 Synthetically Slant glyphs]
+ [2024/07/08 v0.1a Synthetically Slant glyphs]
+\RequirePackage{etoolbox}
\RequirePackage{iftex}
\RequirePackage{xkeyval}
@@ -2094,12 +2355,16 @@ end
% \begin{macrocode}
\ExplSyntaxOn
\fp_compare:nNnTF {\synthslant} < {.0}
- {\PackageError{synthslant}{\string\synthslant\space <\space 0}
- {Pass\space a\space value\space that\space is\space non-negative.}}
+ {\PackageError{synthslant}
+ {\string\synthslant\space <\space 0}
+ {Pass\space a\space value\space that\space
+ is\space nonnegative.}}
{}
\fp_compare:nNnTF {\synthnegslant} > {.0}
- {\PackageError{synthslant}{\string\synthnegslant\space >\space 0}
- {Pass\space a\space value\space that\space is\space non-positive.}}
+ {\PackageError{synthslant}
+ {\string\synthnegslant\space >\space 0}
+ {Pass\space a\space value\space that\space
+ is\space nonpositive.}}
{}
\ExplSyntaxOff
@@ -2176,7 +2441,7 @@ end
% \end{macro}
%
%
-% \subsubsection{\acronym{PDF} Slant Engine}
+% \subsubsection{\texorpdfstring{\acronym{PDF}}{PDF} Slant Engine}
%
% The \acronym{PDF}-engine works well and it is the best tested alternative.
%
@@ -2251,13 +2516,15 @@ end
% \begin{macrocode}
\fp_compare:nNnTF {#1} >= {.0}
{
- \box_set_wd:Nn \l_tmpa_box {\l_tmpa_dim - #1\l_tmpb_dim}
+ \box_set_wd:Nn \l_tmpa_box
+ {\l_tmpa_dim - #1\l_tmpb_dim}
}
{
\draw_suspend_begin:
\kern#1\l_tmpb_dim
\draw_suspend_end:
- \box_set_wd:Nn \l_tmpa_box {\l_tmpa_dim + #1\l_tmpb_dim}
+ \box_set_wd:Nn \l_tmpa_box
+ {\l_tmpa_dim + #1\l_tmpb_dim}
}
% \end{macrocode}
%
@@ -2348,7 +2615,8 @@ end
% \begin{macrocode}
\newcommand*{\synthslantbox@fontspect@shear@box}[2]{
\begingroup
- \expandafter\fontspec[FakeSlant = #1]{\l_fontspec_family_tl}
+ \expandafter
+ \fontspec[FakeSlant=#1]{\l_fontspec_family_tl}
#2
\endgroup
}
@@ -2473,8 +2741,12 @@ end
% \begin{macrocode}
\ifnum\synthslant@engine=4% fontspec
\newrobustcmd*{\synthslantbox}[2]{%
- \edef\synthslant@slant@value{#1}% definition for compatibility of both branches
- \synthslantbox@fontspect@shear@box{\synthslant@slant@value}{#2}%
+% \end{macrocode}
+% The following (expanding) definition is only here for the compatibility of both branches.
+% \begin{macrocode}
+ \edef\synthslant@slant@value{#1}
+ \synthslantbox@fontspect@shear@box{\synthslant@slant@value}
+ {#2}%
}
% \end{macrocode}
%
@@ -2530,7 +2802,8 @@ end
\NewDocumentEnvironment{slantenvironment}{}
{\upshape
\ifcsdef{microtypecontext}
- {\expandafter\microtypecontext\expandafter{\slantcontext}}
+ {\expandafter\microtypecontext
+ \expandafter{\slantcontext}}
{}}
{\ifcsdef{endmicrotypecontext}
{\endmicrotypecontext}
@@ -2557,8 +2830,8 @@ end
% \end{macro}
%
% \begin{macro}{\synthslantbox@right@negslant@correction}
-% We could play the same trick here as in \cs{synthslantbox@right@slant@correction} and use
-% \cs{synthnegslant} instead of \cs{synthslant}. But my experiments show no need for a
+% We could play the same trick here as in \cs{synthslantbox@\-right@\-slant@\-correction} and
+% use \cs{synthnegslant} instead of \cs{synthslant}. But my experiments show no need for a
% correction. Anyhow, this macro may be convenient to override someday.
%
% \begin{macrocode}
@@ -2588,7 +2861,8 @@ end
\NewDocumentEnvironment{negslantenvironment}{}
{\itshape
\ifcsdef{microtypecontext}
- {\expandafter\microtypecontext\expandafter{\negslantcontext}}
+ {\expandafter\microtypecontext
+ \expandafter{\negslantcontext}}
{}}
{\ifcsdef{endmicrotypecontext}
{\endmicrotypecontext}
@@ -2622,7 +2896,7 @@ end
%
%
% \addtocontents{toc}{\protect\end{multicols}}
-% \addtocontents{toc}{\endgroup}
+% \addtocontents{toc}{\protect\end{list}}
%
%
% \Finale
@@ -4889,7 +5163,7 @@ KJ8AAAAASUVORK5CYII=
\setlength{\headheight}{0pt}
\setlength{\headsep}{0pt}
-\setlength{\overfullrule}{3pt}
+\setlength{\overfullrule}{0pt}
\pagestyle{plain}
@@ -5254,6 +5528,20 @@ right: \code{\cs{textsynthslant}\{Show line-break\cs{-}ing in a sen\cs{-}tence.\
%
%
%
+% \iffalse
+%<*minimal-test>
+\documentclass{minimal}
+
+\usepackage{synthslant}
+
+\begin{document}
+\textsynthslant{abc}
+\end{document}
+%</minimal-test>
+% \fi
+%
+%
+%
\endinput
%
%
diff --git a/Master/texmf-dist/source/latex/synthslant/synthslant.ins b/Master/texmf-dist/source/latex/synthslant/synthslant.ins
index 845b4378b19..f7027fe6f5e 100644
--- a/Master/texmf-dist/source/latex/synthslant/synthslant.ins
+++ b/Master/texmf-dist/source/latex/synthslant/synthslant.ins
@@ -1,11 +1,11 @@
%% Copyright (C) 2024 by Ch. L. Spiel
%%
%% This work may be distributed and/or modified under the conditions
-%% of the LaTeX Project Public License, either version 1.3 of this
+%% 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
-%% http://www.latex-project.org/lppl.txt
-%% and version 1.3 or later is part of all distributions of LaTeX
+%% https://www.latex-project.org/lppl.txt
+%% and version 1.3c or later is part of all distributions of LaTeX
%% version 2003/12/01 or later.
@@ -23,11 +23,11 @@ This is a generated file.
Copyright (C) 2024 by Ch. L. Spiel
This work may be distributed and/or modified under the conditions
-of the LaTeX Project Public License, either version 1.3 of this
+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
- http://www.latex-project.org/lppl.txt
-and version 1.3 or later is part of all distributions of LaTeX
+ https://www.latex-project.org/lppl.txt
+and version 1.3c or later is part of all distributions of LaTeX
version 2003/12/01 or later.
This work has the LPPL maintenance status `maintained'.
@@ -46,12 +46,15 @@ shear-transform.mp, and title.mp.
\generate{\file{synthslant.sty}{\from{\source}{package}}
\file{synthslant-gauge.tex}{\from{\source}{gauge}}
- \file{synthslant.ist}{\from{\source}{index-style}}}
+ \file{synthslant-minimal-test.tex}{\from{\source}{minimal-test}}}
\nopostamble
-\generate{\file{title.mp}{\from{\source}{title}}}
-\generate{\file{shear-transform.mp}{\from{\source}{shear-transform}}}
+\generate{\file{shear-transform.mp}{\from{\source}{shear-transform}}
+ \file{synthslant.gst}{\from{\source}{changes-style}}
+ \file{synthslant.ist}{\from{\source}{index-style}}
+ \file{title.mp}{\from{\source}{title}}}
+
\nopreamble
diff --git a/Master/texmf-dist/source/latex/tablvar/tablvar.dtx b/Master/texmf-dist/source/latex/tablvar/tablvar.dtx
index afc47fc9539..e39c2382f0c 100644
--- a/Master/texmf-dist/source/latex/tablvar/tablvar.dtx
+++ b/Master/texmf-dist/source/latex/tablvar/tablvar.dtx
@@ -1,6 +1,6 @@
% \iffalse meta-comment
%
-% Copyright (C) 2018-2023 by Antoine Missier <antoine.missier@ac-toulouse.fr>
+% Copyright (C) 2018-2024 by Antoine Missier <antoine.missier@ac-toulouse.fr>
%
% This file may be distributed and/or modified under the conditions of
% the LaTeX Project Public License, either version 1.3 of this license
@@ -22,11 +22,11 @@
%<*package>
\NeedsTeXFormat{LaTeX2e}[2005/12/01]
\ProvidesPackage{tablvar}
- [2023/12/23 v2.0 .dtx tablvar file]
+ [2024/08/09 v2.1 Tables of signs and variations]
%</package>
%<*driver>
\documentclass{ltxdoc}
-\usepackage[utf8]{inputenc}
+%\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[french]{babel}
\usepackage{lmodern}
@@ -38,10 +38,12 @@
\def\bbObrecht{\vrule\kern1pt\vrule} \let\bb\relax
\let\variations\relax
\usepackage{tkz-tab}
+\usepackage{pstricks}
+\usepackage{tableau}
\usepackage[pstricks]{tablvar}
\usepackage[style=french,font=fcm]{lgrmath} % pour un joli pi droit
-\usepackage{hyperref}
+\usepackage[hyperindex=false]{hyperref}
\usepackage{sectsty}
\usepackage{makecell}
\usepackage{spacingtricks}
@@ -58,6 +60,8 @@
\definecolor{darkbrown}{rgb}{0.5,0.1,0.1}
\allsectionsfont{\color{darkbrown}}
\hypersetup{%
+ bookmarksopen=true,
+ bookmarksopenlevel=2,
colorlinks,
linkcolor=blue,
citecolor=red,
@@ -76,7 +80,7 @@
%</driver>
% \fi
%
-% \CheckSum{752}
+% \CheckSum{828}
%
% \CharacterTable
% {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
@@ -119,27 +123,21 @@
% \changes{v2.0}{16/12/2023}{Nouveau paramètre limsep}
% \changes{v2.0}{20/12/2023}{Macro bas et mil valables pour un nb quelconque de lignes}
% \changes{v2.0}{22/12/2023}{Macros @pos -> tv@pos, @@pos -> tv@@pos}
+% \changes{v2.1}{23/07/2024}{
+% - Calcul de hauteur automatique de la colonne de légende :
+% * nouveaux paramètres rowtopsep et rowbottomsep
+% * tv@saveheight -> tv@setheight
+% - option pstricks possible avec LuaLaTeX + luapstricks,
+% - amélioration du calcul de position de la macro mil,
+% - nouvelles macros limg*, limd* et bblim*
+% - exemple plus sophistiqué pour bblim}
%
% \GetFileInfo{tablvar.sty}
-%
-% \DoNotIndex{\@@ZI,\tv@@pos,\tv@pos,\@ZI,\@arstrutbox,\@ifstar,\\}
-% \DoNotIndex{\addtocounter,\advance,\arraybackslash}
-% \DoNotIndex{\begin,\boolean,\centering,\color,\DeclareOption,\def}
-% \DoNotIndex{\define@boolkey,\defin@key,\dp,\draw,\else,\empty,\end}
-% \DoNotIndex{\fi,\fill,\global,\hspace,\ht}
-% \DoNotIndex{\I,\if,\ifdim,\ifnum,\ifthenelse,\Ix,\Iy,\kern}
-% \DoNotIndex{\makebox,\MessageBreak,\multido,\ncline,\newboolean,}
-% \DoNotIndex{\newcommand,\newcounter,\newenvironment,\newlength,\newsavebox}
-% \DoNotIndex{\node,\PackageWarningNoLine,\ProcessOptions,\psframe}
-% \DoNotIndex{\raisebox,\relax,\renewcommand,\RequirePackage,\rnode}
-% \DoNotIndex{\sbox,\setboolean,\setcounter,\setlength,\stepcounter}
-% \DoNotIndex{\TikZ,\tvanchor,\usetikzlibrary,\value,\wd}
-% \DoNotIndex{\ZIheight,\ZIheighti,\ZIheightii,\ZIheightiii,\ZIheightiv,\ZIdepth,\ZIwidth}
%
% \title{L'extension \textsf{tablvar}\thanks{Ce document
-% correspond à \textsf{tablvar}~\fileversion, dernière modification le 23/12/2023.}}
+% correspond à \textsf{tablvar}~\fileversion, dernière modification le 09/08/2024.}}
% \author{Antoine Missier \\ \texttt{antoine.missier@ac-toulouse.fr}}
-% \date{23 décembre 2023}
+% \date{9 août 2024}
% \maketitle
% \tableofcontents
%
@@ -175,8 +173,8 @@
% |pstricks| ou |tikz|, que l'on invoque dans le préambule à l'appel de l'extension :
% |\usepackage[tikz]{tablvar}|.
% Lorsque l'option n'est pas précisée, l'extension choisira \texttt{tikz}
-% pour un compilateur PDF (comme pdf\LaTeX\ ou \LuaLaTeX), \texttt{pstricks} sinon
-% (typiquement \LaTeX\ + dvips + ps2pdf ou \XeLaTeX).
+% pour un mode de sortie PDF direct (avec pdf\LaTeX\ ou \LuaLaTeX),
+% \texttt{pstricks} sinon (avec \LaTeX\ > dvips > ps2pdf ou \XeLaTeX).
% Pour l'option |tikz|, il faut compiler \emph{deux fois},
% la première fois les flèches ne sont pas correctement dessinées
% (un message de compilation le rappelle).
@@ -189,9 +187,9 @@
%
% \subsection{Tableaux de variations simples}
%
-% % \DescribeEnv{tablvar}
+% \DescribeEnv{tablvar}
% Un tableau de variations (ou de signes) se définit par un environnement |tablvar|
-% qui \emph{doit être en mode mathématiques} (comme |array|).
+% qui \emph{doit être en mode mathématique} (comme |array|).
%
% \medskip
% Voici un premier tableau tout simple avec les commandes
@@ -235,8 +233,8 @@
% Cette unité à l'avantage de s'ajuster lorsqu'on change de fonte
% sans avoir besoin de modifier le code. L'unité de même type utilisée pour les hauteurs
% est le \texttt{ex}, hauteur du \og x \fg.}.
-% Les flèches ne sont pas contraintes à rester à l'intérieur des colonnes intervalles
-% mais s'ajustent par rapport à la taille effective des valeurs qu'elles relient.
+% La longueur des flèches s'ajuste en fonction de la taille des valeurs
+% qu'elles relient et ne sont pas contraintes à rester à l'intérieur des colonnes intervalles.
% Lorsqu'une valeur est trop large, elle déborde automatiquement
% dans les colonnes intervalles sans altérer
% les largeurs de colonne.
@@ -314,7 +312,7 @@
% (voir section \ref{options} pour la liste détaillée des options).
%
% \DescribeMacro{\variations\oarg{nblignes}}
-% C'est la commande |\variations| qui, se charge de la construction des flèches
+% C'est la commande |\variations| qui se charge de la construction des flèches
% en fonction du positionnement des valeurs.
% Un paramètre optionnel permet de définir
% un nombre arbitraire de lignes pour les variations (3 par défaut).
@@ -418,7 +416,8 @@
% \mbox{Signe de }f'(x) & & - & \barre[0] & + & \barre[0] & - & \\
% \hline
% \variations{ \mil{\makecell{\mbox{Variations} \\ \mbox{de }f}} &
-% \haut{+\infty} && \bas{-14} && \haut{\frac{69}{4}} && \bas{-\infty} }
+% \haut{+\infty} && \bas{-14} && \haut{\frac{69}{4}} &&
+% \bas{-\infty} }
% \hline
%\end{tablvar}\]
% \end{verbatim}
@@ -435,50 +434,57 @@
%
% \medskip
% Une première solution est d'interrompre la double barre pour placer
-% les limites qui resteront alors centrées au milieu de la colonne (mais il faut aimer).
+% les limites qui resteront alors centrées au milieu de la colonne
+% (mais il faut aimer).
%\[\begin{tablvar}{2}
% \hline
-% x & -\infty && 0 && +\infty \\
+% x & -\infty && 2 && +\infty \\
% \hline
-% \variations{\mil{\e^{\frac{1}{x}}} & \haut{1} &&
-% \bas{0} \pos*{2}{\bb} \discont \haut{+\infty} && \bas{1} }
+% \variations{\mil{\dfrac{1}{x-2}} & \pos{2}{0} && \bas{-\infty}
+% \pos*{2}{\bb} \discont \haut{+\infty} && \pos{2}{0} }
% \hline
%\end{tablvar}\]
-% La macro |\e| compose le nombre d'Euler $\e$ en romain (forme droite),
-% comme c'est la règle pour les constantes mathématiques
-% (cf. \textsf{mismath}~\cite{MIS} ou \textsf{frenchmath}~\cite{FR}).
% \begin{verbatim}
%\[\begin{tablvar}{2}
% \hline
-% x & -\infty && 0 && +\infty \\
+% x & -\infty && 2 && +\infty \\
% \hline
-% \variations{\mil{\e^{\frac{1}{x}}} & \haut{1} &&
-% \bas{0} \pos*{2}{\bb} \discont \haut{+\infty} && \bas{1} }
+% \variations{\mil{\dfrac{1}{x-2}} & \pos{2}{0} && \bas{-\infty}
+% \pos*{2}{\bb} \discont \haut{+\infty} && \pos{2}{0} }
% \hline
%\end{tablvar}\]
% \end{verbatim}
%
% \hypertarget{firstcolsep}{}
% \DescribeMacro{\limg} \DescribeMacro{\limd}
-% Les macros |\limg|\oarg{pos}\marg{ligne}\marg{valeur}
-% et |\limd|\oarg{pos}\marg{ligne}\marg{valeur}
+% Les macros |\limg|\oarg{pos}\marg{ligne}\marg{valeur} et
+% |\limd|\oarg{pos}\marg{lgn}\marg{val}
% offrent une solution plus élégante pour placer des limites à gauche ou à droite.
% L'option de positionnement \meta{pos} correspond à celle de la macro |\pos|
% (\texttt{c}, \texttt{t} ou \texttt{b}).
+%
+% \DescribeMacro{\limg*}\DescribeMacro{\limd*}
+% Les variantes étoilées |\limg*| et |\limd*| sont des alias :
+% |\limg*{+}| signifie |\limg{1}{+\infty}|,
+% |\limg*{-}| correspond à |\limg{|$n$|}{-\infty}|
+% (pour une partie variations sur $n$ lignes),
+% de même pour |\limd*|.
+% Tout autre argument que \texttt{+} ou \texttt{-} génère un message d'erreur.
+%
+% \DescribeMacro{firstcolsep}
+% La colonne de légende peut être élargie en ajoutant de l'espace à ses extrémités
+% avec l'option \texttt{firstcolsep} (dont la valeur par défaut est \texttt{5pt}).
%\[\begin{tablvar}[firstcolsep=10pt,intervalwidth=4em]{2}
% \hline
% x & -\infty && 0 && +\infty \\
% \hline
% -\frac{1}{x} & & + & \bb & - & \\
% \hline
-% \variations{ \mil{\dfrac{1}{x^2}} & \bas{0} && \limg{1}{+\infty} \bb
-% \discont \limd{1}{+\infty} && \bas{0} }
+% \variations{ \mil{\e^{\frac{1}{x}}} & \haut{1} && \limg{3}{0} \bb
+% \discont \limd*{+} && \bas{1} }
% \hline
%\end{tablvar}\]
%
-% \DescribeMacro{firstcolsep}
-% Ci-dessus la colonne de légende a été élargie en ajoutant de l'espace à ses extrémités
-% avec l'option \texttt{firstcolsep} (dont la valeur par défaut est \texttt{5pt}).
% \begin{verbatim}
%\[\begin{tablvar}[firstcolsep=10pt,intervalwidth=4em]{2}
% \hline
@@ -486,13 +492,18 @@
% \hline
% -\frac{1}{x} & & + & \bb & - & \\
% \hline
-% \variations{ \mil{\dfrac{1}{x^2}} & \bas{0} && \limg{1}{+\infty} \bb
-% \discont \limd{1}{+\infty} && \bas{0} }
+% \variations{ \mil{\e^{\frac{1}{x}}} & \haut{1} && \limg{3}{0} \bb
+% \discont \limd*{+} && \bas{1} }
% \hline
%\end{tablvar}\]
% \end{verbatim}
+% \vspace{-2ex}
+% La macro |\e| compose le nombre d'Euler $\e$ en romain,
+% comme c'est la règle pour les constantes mathématiques
+% (cf. \textsf{mismath}~\cite{MIS} ou \textsf{frenchmath}~\cite{FR}).
%
-% \DescribeMacro{\bblim}
+% \bigskip
+% \DescribeMacro{\bblim}\DescribeMacro{\bblim*}
% Sauf sur les bords du tableau ou lorsqu'il y a une zone interdite,
% les doubles barres sont en général accompagnées à la fois d'une limite à gauche
% et d'une limite à droite. La commande |\bblim| permet alors d'alléger la syntaxe.
@@ -502,24 +513,28 @@
% C'est un alias de
% |\limg|\marg{ligne}\marg{valeur}|\bb\discont\limd|\marg{ligne}\marg{valeur}.
% La seule différence est que |\bblim| ne possède pas d'option de positionnement
-% des nœuds comme |\limg| et |\limd|.
-%\[\begin{tablvar}{4}
+% des nœuds comme |\limg| et |\limd|. La forme étoilée offre une syntaxe
+% encore plus légère lorsque les deux limites sont infinies :
+% |\bblim*{-}{+}| correspond à |\bblim{3}{-\infty}{1}{+\infty}|
+% (lorsqu'il y a 3 lignes de variations).
+%
+%\[\begin{tablvar}{5}
% \hline
-% x & -\infty && -1 && 0 && 1 && +\infty \\
+% x & -\infty && -2 && 0 && 1 && 2 && +\infty \\
% \hline
-% \variations{\mil{\dfrac{1}{1-x^2}} & \haut{0} &&
-% \bblim{3}{-\infty}{1}{+\infty} && \bas{1} &&
-% \bblim{1}{+\infty}{3}{-\infty} && \haut{0} }
+% \variations{ \mil{\dfrac{\e^{\frac{1}{x}}}{x-2}} & \haut{0} &&
+% \bas{-\frac{1}{4}\e^{-\frac{1}{2}}} && \bblim{1}{0}{3}{-\infty} &&
+% \haut{-\e} && \bblim*{-}{+} && \bas{0} }
% \hline
%\end{tablvar}\]
% \begin{verbatim}
-%\[\begin{tablvar}{4}
+%\[\begin{tablvar}{5}
% \hline
% x & -\infty && -1 && 0 && 1 && +\infty \\
% \hline
-% \variations{\mil{\dfrac{1}{1-x^2}} & \haut{0} &&
-% \bblim{3}{-\infty}{1}{+\infty} && \bas{1} &&
-% \bblim{1}{+\infty}{3}{-\infty} && \haut{0} }
+% \variations{ \mil{\dfrac{\e^{\frac{1}{x}}}{x-2}} & \haut{0} &&
+% \bas{-\frac{1}{4}\e^{-\frac{1}{2}}} && \bblim{1}{0}{3}{-\infty} &&
+% \haut{-\e} && \bblim*{-}{+} && \bas{0} }
% \hline
%\end{tablvar}\]
% \end{verbatim}
@@ -533,7 +548,7 @@
% sauf si on préfère plus de blanc.
% On peut y compris leur donner des valeurs négatives si l'on veut s'approcher
% davantage des filets verticaux, par exemple \texttt{limsep=-1.5pt}
-% amène au contact de la double barre).
+% amènerait au contact de la double barre).
%\[\begin{tablvar}[bordercolsep=4pt,limsep=3pt]{3}
% \hline
% x & -\infty && 0 && 1 && +\infty \\
@@ -568,7 +583,7 @@
% \hline
% x & 0 && 1 && +\infty \\
% \hline
-% \variations{ \mil{\ln x -x} & \bb\limd{3}{-\infty} && \haut{-1} &&
+% \variations{ \mil{\ln x -x} & \bb\limd*{-} && \haut{-1} &&
% \bas{-\infty} }
% \hline
%\end{tablvar*}
@@ -589,7 +604,7 @@
% \hline
% x & 0 && 1 && +\infty \\
% \hline
-% \variations{ \mil{\ln x -x} & \bb\limd{3}{-\infty} && \haut{-1} &&
+% \variations{ \mil{\ln x -x} & \bb\limd*{-} && \haut{-1} &&
% \bas{-\infty} }
% \hline
%\end{tablvar*}
@@ -603,8 +618,8 @@
% \hline
%\end{tablvar*}\]
% \end{verbatim}
-% \hypertarget{ext}{}
%
+% \hypertarget{ext}{}
% \DescribeMacro{extleft}\DescribeMacro{extright}
% Dans \texttt{tablvar*}, si, à une extrémité sans double barre,
% les valeurs ont des largeurs vraiment différentes
@@ -622,25 +637,25 @@
% pour éviter que le 1 ne soit collé au bord droit
% et qu'il garde un bon centrage par rapport à $+\infty$.
%
-% \noindent\begin{minipage}[t]{7.7cm}
+% \noindent\begin{minipage}[t]{7.4cm}
% \begin{verbatim}
-%\[\begin{tablvar}[extleft,intervalwidth=4em]{1}
+%\[\begin{tablvar}[extleft]{1}
% \hline
% x & 0 && +\infty \\
% \hline
-% \variations{ \mil{1-\dfrac{1}{x}} & \bb
-% \limd{3}{-\infty} && \haut{1} }
+% \variations[2]{ \mil{1-\dfrac{1}{x}}
+% & \bb \limd*{-} && \haut{1} }
% \hline
%\end{tablvar}\]
% \end{verbatim}
% \end{minipage}
% \begin{minipage}[t]{5cm}
-%\[\begin{tablvar}[extleft,intervalwidth=4em]{1}
+%\[\begin{tablvar}[extleft]{1}
% \hline
% x & 0 && +\infty \\
% \hline
-% \variations{ \mil{1-\dfrac{1}{x}} & \bb
-% \limd{3}{-\infty} && \haut{1} }
+% \variations[2]{ \mil{1-\dfrac{1}{x}}
+% & \bb \limd*{-} && \haut{1} }
% \hline
%\end{tablvar}\]
% \end{minipage}
@@ -661,14 +676,14 @@
%
% Voici un exemple où la valeur remarquable
% est placée dans la colonne intervalle.\\
-% \begin{minipage}[t]{7.7cm}
+% \begin{minipage}[t]{7.4cm}
% \begin{verbatim}
%\[\begin{tablvar*}[6em]{1}
% \hline
% x & 0 & \vr{1} & +\infty \\
% \hline
% \variations{ \mil{\ln x} &
-% \bb \limd{3}{-\infty} & \vr{0} &
+% \bb \limd*{-} & \vr{0} &
% \pos[t]{1}{+\infty} }
% \hline
%\end{tablvar*}\]
@@ -680,7 +695,7 @@
% x & 0 & \vr{1} & +\infty \\
% \hline
% \variations{ \mil{\ln x} &
-% \bb \limd{3}{-\infty} & \vr{0} &
+% \bb \limd*{-} & \vr{0} &
% \pos[t]{1}{+\infty} }
% \hline
%\end{tablvar*}\]
@@ -702,8 +717,8 @@
% \hline
% x & -\infty && \vr{0} && \vr{1} && +\infty \\
% \hline
-% \variations[4]{ \mil{\exp x} & \haut{0} &&
-% \vr[3]{1} && \vr{\e} && \bas{+\infty} }
+% \variations[4]{ \mil{\exp x} & \bas{0} &&
+% \vr[3]{1} && \vr{\e} && \haut{+\infty} }
% \hline
%\end{tablvar}\]
% \end{verbatim}
@@ -738,7 +753,7 @@
% \medskip
% On peut préférer que les flèches de variations ne passent pas à travers
% les valeurs remarquables (qui doivent alors être aussi des nœuds pour les flèches).
-% L'exemple suivant présente un tableau utilisant simultanément
+% L'exemple qui suit présente un tableau utilisant simultanément
% les deux manières de traiter les valeurs remarquables.
% La taille des flèches s'ajuste automatiquement.
% Le second zéro correspond à la fois à un nœud pour les flèches
@@ -767,6 +782,10 @@
% L'option |[t]| pour le max en ligne 1
% est ici combinée avec l'option |[b]| en ligne 3 et permet de conserver
% un positionnement correct du 0 sur la flèche.
+%
+% Pour placer la dernière valeur, on aurait pu utiliser |\limg[b]{3}{-\infty}|,
+% mais ici |\pos[b]{3}{-\infty}| convient aussi à cause de l'option \texttt{extright}
+% qui produit un alignement au fer à droite de la dernière colonne.
% \begin{verbatim}
%\[\begin{tablvar}[extright,intervalwidth=2em]{4}
% \hline
@@ -782,7 +801,6 @@
%\end{tablvar}\]
% \end{verbatim}
%
-% \vspace{-\baselineskip}
% \DescribeMacro{\vrconnect}
% C'est la macro graphique |\vrconnect| qui gère le tracé de ces traits pointillés.
% Elle peut être redéfinie pour changer leur aspect
@@ -802,7 +820,7 @@
% 0 &\mbox{si } x= 0
%\end{array}
%\right. .\]
-% \begin{minipage}[t]{6.5cm}
+% \begin{minipage}[t]{6.7cm}
% \begin{verbatim}
%\[\begin{tablvar}{2}
% \hline
@@ -900,7 +918,7 @@
% \vspace{-\baselineskip}
% Le |\hspace{-0.5em}| devant \texttt{+} a pour effet de décaler le $+$ affiché
% vers la gauche afin de le recentrer.
-% En effet, les macros |\limg| et |limd| placent les valeurs dans des boîtes de largeur
+% En effet, les macros |\limg| et |\limd| placent les valeurs dans des boîtes de largeur
% nulle (grâce à la commande |\zbox|, voir section \ref{cmd-pos}).
% De ce fait, le contenu d'une colonne valeur (qui a une largeur fixe)
% peut déborder en largeur
@@ -926,8 +944,8 @@
% -\frac{x}{\strut\sqrt{x^2-1}^3} && + & \bb & \ZI & \bb & - & \\
% \hline
% \variations{\pos*{2}{\dfrac{1}{\sqrt{x^2-1}}} & \bas{0} &&
-% \limg{1}{+\infty} \bb & \ZI &
-% \bb \limd{1}{+\infty} && \bas{0} }
+% \limg*{+} \bb & \ZI &
+% \bb \limd*{+} && \bas{0} }
% \hline
%\end{tablvar}\]
%
@@ -943,8 +961,8 @@
% -\frac{x}{\strut\sqrt{x^2-1}^3} && + & \bb & \ZI & \bb & - & \\
% \hline
% \variations{\pos*{2}{\dfrac{1}{\sqrt{x^2-1}}} & \bas{0} &&
-% \limg{1}{+\infty} \bb & \ZI &
-% \bb \limd{1}{+\infty} && \bas{0} }
+% \limg*{+} \bb & \ZI &
+% \bb \limd*{+} && \bas{0} }
% \hline
%\end{tablvar}\]
% \end{verbatim}
@@ -961,7 +979,8 @@
% Il arrive que la compilation \LaTeX\ + dvips + ps2pdf
% n'affiche pas cette transparence,
% ce qui semble être dû à un bug dans certaines versions de Ghostscript.
-% Dans ce cas la solution est de compiler avec \XeLaTeX.
+% Dans ce cas une solution peut être de compiler avec \XeLaTeX\ ou \LuaLaTeX\
+% (si \textsf{luapstricks} est installé sur votre distribution).
% La compilation pdf\LaTeX\ avec l'option \texttt{tikz} ne pose pas ce problème.}
%
%\[\begin{tablvar}[ZItype=c,ZIcolor=green,ZIaddwidth=1pt]{3}
@@ -1000,17 +1019,18 @@
%\end{tablvar}\]
% \end{verbatim}
%
-% Si des extrema de grande taille sont placés dans la partie variations,
+% lorsque des extrema de grande taille sont placés dans la partie \emph{variations},
% il est nécessaire de modifier la hauteur des lignes,
% pour éviter de toucher le filet horizontal (au-dessus ou en-dessous)
-% \footnote{L'extension \textsf{tabularray}~\cite{TABUL} de Jianrui Lyu permettra
-% éventuellement une gestion automatisée des hauteurs de ligne dans une version future.}.
+% \footnote{L'extension \textsf{tabularray}~\cite{TABUL} de Jianrui Lyu permettrait
+% éventuellement une gestion automatisée des hauteurs de ligne
+% dans une possible version future.}.
% Cette modification peut se faire
-% avec \texttt{stretch} ou avec |\vstrut|\oarg{depth}\marg{height}
-% \emph{qu'il faut placer dans la toute 1\iere colonne} pour
+% avec l'option \texttt{stretch} ou avec |\vstrut|\oarg{depth}\marg{height}
+% qu'il faut placer \emph{dans la colonne de légendes} pour
% que |\ZI| prenne en compte sa hauteur.
-% Dans l'exemple suivant, \texttt{stretch=2.2} aurait donné le même résultat pour
-% les variations mais une ligne des $x$ plus haute.
+% Dans l'exemple suivant, \texttt{stretch=2.2} aurait donné le même résultat
+% mais une ligne des $x$ plus haute.
%
%\[\begin{tablvar}[4em]{4}
% \hline
@@ -1080,7 +1100,7 @@
% \DescribeMacro{\hachure}
% Lorsque l'on dessine des zones interdites hachurées
% sur plusieurs colonnes contiguës,
-% les hachures seront en général discontinues.
+% les hachures ne seront en général pas jointives.
% Pour pallier cela, on peut
% utiliser la primitive graphique |\hachure|
% qui permet de définir manuellement le rectangle à hachurer.
@@ -1090,16 +1110,16 @@
%\[ \begin{tablvar}[intervalwidth=1.8em,ZIaddwidth=1pt]{8}
% \hline
% x & -\infty && -2 && -\sqrt{\frac{5}{2}} && -1
-% && 0 && 1 && \sqrt{\frac{5}{2}} && 2 && +\infty \\
+% && 0 && 1 && \sqrt{\frac{5}{2}} && 2 && +\infty \\
% \hline
% 2x & &-& \barre &-& \barre &-& \barre &-& \barre[0] &+&
-% \barre &+& \barre &+& \barre &+& \\
+% \barre &+& \barre &+& \barre &+& \\
% \hline
% 2x^2-5 & &+& \barre &+& \barre[0] &-& \barre &-& \barre &-&
-% \barre &-& \barre[0] &+& \barre &+& \\
+% \barre &-& \barre[0] &+& \barre &+& \\
% \hline
% f'(x) & &-& \bb & \ZI & \barre & \ZI & \bb &+&
-% \barre[0] &-& \bb & & & & \bb & + & \\
+% \barre[0] &-& \bb & & & & \bb & + & \\
% \hline
% \variations{\mil{f(x)} & \haut{+\infty} && \bas{0}\barre & \ZI &
% \barre & \ZI & \bas{0}\barre && \haut{2} && \bas{0}\barre \discont
@@ -1108,7 +1128,7 @@
% \hline
%\end{tablvar} \] }
%
-% Pour hachurer une zone donnée, la commande |\hachure| peut être placée où l'on veut
+% La commande |\hachure| peut être placée où l'on veut
% dans le tableau, il suffit de donner les coordonnées du rectangle visé à
% partir de la position courante (réglage manuel).
% Dans la partie variations, il faut mettre la commande |\hachure| dans un |\pos*|,
@@ -1119,16 +1139,16 @@
%\[ \begin{tablvar}[intervalwidth=1.8em,ZIaddwidth=1pt]{8}
% \hline
% x & -\infty && -2 && -\sqrt{\frac{5}{2}} && -1
-% && 0 && 1 && \sqrt{\frac{5}{2}} && 2 && +\infty \\
+% && 0 && 1 && \sqrt{\frac{5}{2}} && 2 && +\infty \\
% \hline
% 2x & &-& \barre &-& \barre &-& \barre &-& \barre[0] &+&
-% \barre &+& \barre &+& \barre &+& \\
+% \barre &+& \barre &+& \barre &+& \\
% \hline
% 2x^2-5 & &+& \barre &+& \barre[0] &-& \barre &-& \barre &-&
-% \barre &-& \barre[0] &+& \barre &+& \\
+% \barre &-& \barre[0] &+& \barre &+& \\
% \hline
% f'(x) & &-& \bb & \ZI & \barre & \ZI & \bb &+&
-% \barre[0] &-& \bb & & & & \bb & + & \\
+% \barre[0] &-& \bb & & & & \bb & + & \\
% \hline
% \variations{\mil{f(x)} & \haut{+\infty} && \bas{0}\barre & \ZI &
% \barre & \ZI & \bas{0}\barre && \haut{2} && \bas{0}\barre \discont
@@ -1219,11 +1239,11 @@
% \medskip
% \DescribeMacro{\tablvarset\marg{keyval}}
% Mais les environnements \texttt{tablvar} et \texttt{tablvar*} possèdent également
-% un jeu de paramètres qui peuvent être définis de manière globale
-% (ou locale dans un environnement ou un groupe |{...}|),
-% avec des variables spécifiques
-% ou (depuis la version 2.0) avec la commande |\tablvarset|\marg{keyval},
-% utilisant le mécanisme \emph{clé=valeur}.
+% un jeu de paramètres qui peuvent être définis de manière globale,
+% ou locale dans un environnement (ou un groupe |{...}|),
+% soit en utilisant des variables spécifiques,
+% soit (depuis la version 2.0) avec la commande |\tablvarset|\marg{keyval},
+% basée sur le mécanisme \emph{clé=valeur}.
%
% \DescribeEnv{tablvar\oarg{keyval}}\DescribeEnv{tablvar*\oarg{keyval}}
% Ces paramètres peuvent aussi être réglés localement,
@@ -1280,12 +1300,12 @@
% \begin{description}
% \item[stretch] qui est un facteur d'élasticité verticale agissant sur toutes
% les lignes du tableau
-% \footnote{Pour ajuster la hauteur d'une ligne particulière, on dispose de la
-% macro \texttt{\textbackslash vstrut}\oarg{depth}\marg{height}
+% \footnote{Pour augmenter la hauteur d'une ligne particulière, on pourra utiliser la
+% commande \texttt{\textbackslash vstrut}\oarg{depth}\marg{height}
% (du package \textsf{spacingtricks}~\cite{SPA}),
% où \meta{depth} désigne la \emph{profondeur} et \meta{height} la \emph{hauteur}
% minimales à atteindre par rapport à la ligne de \emph{base},
-% ou encore de \texttt{\bslash cstrut}\marg{height} qui garantit une hauteur minimale
+% ou encore \texttt{\bslash cstrut}\marg{height} qui garantit une hauteur minimale
% en-dessous et au-dessus de la ligne de centrage mathématique.} ;
% une valeur de 1 correspond à la valeur standard
% d'un environnement \texttt{array}.
@@ -1322,7 +1342,7 @@
%
% \medskip
% Le rendu des commandes graphiques peut également être modifié,
-% en redéfinissant ces commandes, en particulier |\fleche|, |vrconnect| et |\hachure|
+% en redéfinissant ces commandes, en particulier |\fleche|, |\vrconnect| et |\hachure|
% grâce aux nombreuses options offertes par PSTricks ou \TikZ.
% C'est le cas aussi de l'aspect des filets et barres du tableau qui sont définis
% par les commandes |\tvrulewidth| (\texttt{0.4pt} par défaut),
@@ -1349,8 +1369,8 @@
% \hline
% -\frac{x+2}{x^4} && - & \barre[0] & + & \bb & - & \\
% \hline
-% \variations{\mil{\e^{\frac{x+1}{x^2}}} & \haut{1} && \bas{\e^{-\frac{1}{4}}}
-% && \bblim{1}{+\infty}{1}{+\infty} && \bas{1} }
+% \variations{\mil{\e^{\frac{x+1}{\vstrut{1.2ex} x^2}}} & \haut{1} &&
+% \bas{\e^{-\frac{1}{4}}} && \bblim*{+}{+} && \bas{1} }
% \hline
%\end{tablvar} \]
% \begin{verbatim}
@@ -1366,24 +1386,27 @@
% \hline
% -\frac{x+2}{x^4} && - & \barre[0] & + & \bb & - & \\
% \hline
-% \variations{\mil{\e^{\frac{x+1}{x^2}}} & \haut{1} &&
-% \bas{\e^{-\frac{1}{4}}} && \bblim{1}{+\infty}{1}{+\infty} &&
-% \bas{1} }
+% \variations{\mil{\e^{\frac{x+1}{\vstrut{1.2ex} x^2}}} & \haut{1} &&
+% \bas{\e^{-\frac{1}{4}}} && \bblim*{+}{+} && \bas{1} }
% \hline
%\end{tablvar} \]
% \end{verbatim}
+%
+% Enfin deux autres paramètres de type longueur |\rowtopsep| et |\rowbottomsep|
+% garantissent un espace minimum (de \texttt{2pt} par défaut)
+% entre les filets horizontaux et le contenu des cellules, pour la colonne des légendes.
%
-% \subsection{Nouveautés de la version 2.0}
+% \subsection{Nouveautés depuis la version 2.0}
%
-% Cette version présente de nombreuses nouveautés :
+% La version 2.0 présente de nombreuses nouveautés :
% \begin{itemize}
% \item \emph{Il n'y a plus d'option par défaut} à l'appel de l'extension.
% C'était \texttt{pstricks} dans les versions précédentes.
% Dorénavant, si aucune option n'est précisée, l'extension choisira elle-même
-% en fonction du compilateur utilisé, donc \texttt{tikz} pour le moteur pdf\LaTeX\
+% en fonction du compilateur utilisé, donc \texttt{tikz} pour pdf\LaTeX\
% qui ne supporte pas le code PSTricks.
%
-% \item \emph{Les colonnes de valeurs ont des largeurs fixes (\texttt{2em} par défaut)}
+% \item \emph{Les colonnes de valeurs ont des largeurs fixes} (\texttt{2em} \emph{par défaut)}
% et non plus variables en fonction du contenu, comme c'était le cas jusqu'à la version
% 1.2. L'avantage est d'améliorer le centrage pour les signes,
% lorsque les colonnes de valeurs ont des largeurs très différentes,
@@ -1395,7 +1418,7 @@
% et a été fixé à \texttt{0pt} car, en l'absence de filets verticaux,
% il ne sert plus à rien avec les colonnes à largeur fixe.
% Mais, en contrepartie, \emph{la valeur par défaut de} |\intervalwidth|
-% \emph{a été augmentée de \texttt{2.5em} à \texttt{3em}}.
+% \emph{a été augmentée de} \texttt{2.5em} \emph{à} \texttt{3em}.
%
% \item Les réglages peuvent désormais être effectués,
% avec la syntaxe \emph{clé = valeur} et la commande |\tablvarset|,
@@ -1446,12 +1469,26 @@
% De nouveaux types de colonnes ont été définis pour les valeurs et légendes,
% mais sont également internes à l'environnement \texttt{tablvar}.
%
-% \item Les macros |\haut|, |\bas| et |\mil| peuvent à présent être utilisées
+% \item Les macros |\bas| et |\mil| peuvent à présent être utilisées
% même lorsque le nombre de lignes de variations est différent de 3.
% Dans ce cas, commande |\mil| calcule automatiquement le décalage vertical ;
% l'utilisateur n'a plus besoin d'un appel explicite à |\vdecal|.
% \end{itemize}
%
+% Dans la version 2.1 :
+% \begin{itemize}
+% \item Ont été ajoutés deux nouveaux paramètres |\rowtopsep| et |\rowbottomsep|
+% pour garantir un espace minimum (de \texttt{2pt} par défaut)
+% entre les filets horizontaux et le contenu pour la colonne des légendes.
+% \item
+% Il est désormais possible d'utiliser l'option \texttt{pstricks} avec \LuaLaTeX,
+% si \textsf{luapstricks} est installé sur votre distribution.
+% \item Le calcul du décalage vertical de la commande |\mil| a été amélioré,
+% dans le cas d'un nombre pair de lignes de variations.
+% \item Les nouvelles commandes étoilées |\limg*|, |\limd*| et |\bblim*|
+% permettent une écriture simplifiée de |\limg|, |\limd| et |\bblim|,
+% pour des limites $\infty$.
+% \end{itemize}
% \medskip
% Des problèmes de composition peuvent apparaître avec des tableaux
% réalisés antérieurement à la version 2.0, en particulier
@@ -1469,16 +1506,81 @@
% dans la rubrique \og Maths tabvar \fg.
% Nous les décrivons ici brièvement.
% \begin{description}
-% \item[tableaux] de Nicolas Kisselhoff~\cite{TABL}.
+% \item[tableaux] de Nicolas Kisselhoff~\cite{TABL}.
% Propose un pseudo-code PSTricks,
% certainement plus commode que d'écrire toutes les commandes PSTricks.
-
+% Attention l'extension doit être appelée avec |\usepackage{tableau}|, sans \texttt{x}.
+% Voici un exemple repris de la doc de \textsf{tableaux} avec le code en suivant.
+%\newpsstyle{hachured}{fillstyle=hlines,hatchwidth=0.2pt,hatchsep=2pt}
+%\setlength{\TabTitreL}{1cm}
+%
+%\begin{MonTableau}{1}{9}{1.5}
+%\psframe[style=hachured,linestyle=none](.3,1)(.45,0)
+%
+%\TabNewCol{0}
+%\rTabPut{Br}{-.15}{.25}{$x$}
+%\rTabPut{Br}{-.15}{.40}{$f(x)$}
+%
+%\TabNewCol{0}
+%\rTabPut{Bl}{.15}{.25}{$0$}
+%\rTabPut{Bl}{.15}{.60}{$\frac{3}{2}$}
+%
+%\TabNewCol{.30}
+%\rTabPut{B}{0}{.25}{$1$}
+%\rTabPut{Br}{-.15}{.80}{$+\infty$}
+%\psline[style=TabDblBarre](.3,0)(.3,1)
+%
+%\TabNewCol{.45}
+%\rTabPut{B}{0}{.25}{$\frac{3}{2}$}
+%\rTabPut[2]{B}{0}{.10}{\TabZ}
+%
+%\TabNewCol{1}
+%\rTabPut{Br}{-.15}{.25}{$+\infty$}
+%\rTabPut{Br}{-.15}{.40}{$1$}
+%
+%\TabFleche{B1}{C1}
+%\TabFleche{D1}{E1}
+%\end{MonTableau}
+%
+% \begin{verbatim}
+%\newpsstyle{hachured}{fillstyle=hlines,hatchwidth=0.2pt,hatchsep=2pt}
+%\setlength{\TabTitreL}{1cm}
+%
+%\begin{MonTableau}{1}{9}{1.5}
+%\psframe[style=hachured,linestyle=none](.3,1)(.45,0)
+%
+%\TabNewCol{0}
+%\rTabPut{Br}{-.15}{.25}{$x$}
+%\rTabPut{Br}{-.15}{.40}{$f(x)$}
+%
+%\TabNewCol{0}
+%\rTabPut{Bl}{.15}{.25}{$0$}
+%\rTabPut{Bl}{.15}{.60}{$\frac{3}{2}$}
+%
+%\TabNewCol{.30}
+%\rTabPut{B}{0}{.25}{$1$}
+%\rTabPut{Br}{-.15}{.80}{$+\infty$}
+%\psline[style=TabDblBarre](.3,0)(.3,1)
+%
+%\TabNewCol{.45}
+%\rTabPut{B}{0}{.25}{$\frac{3}{2}$}
+%\rTabPut[2]{B}{0}{.10}{\TabZ}
+%
+%\TabNewCol{1}
+%\rTabPut{Br}{-.15}{.25}{$+\infty$}
+%\rTabPut{Br}{-.15}{.40}{$1$}
+%
+%\TabFleche{B1}{C1}
+%\TabFleche{D1}{E1}
+%\end{MonTableau}
+% \end{verbatim}
+%
% \item[tabvar] de Daniel Flipo~\cite{TABV},
% l'auteur, entre-autres de \textsf{babel-french},
% extension bien connue de tous les utilisateurs francophones de \LaTeX.
% Permet de réaliser des tableaux plutôt symboliques.
% Voici un tableau simple et son code \textsf{tabvar}. \\
-% \begin{minipage}[t]{7cm}
+% \begin{minipage}[t]{7.5cm}
% \begin{verbatim}
%\[\begin{tabvar}{|C|CCCCR|}
% \hline
@@ -1492,7 +1594,7 @@
%\end{tabvar}\]
% \end{verbatim}
% \end{minipage}
-% \begin{minipage}[t]{5cm}
+% \begin{minipage}[t]{4.2cm}
%\[\begin{tabvar}{|C|CCCCR|}
% \hline
% x & 0 & & \frac{1}{2} & & 1 \\
@@ -1551,19 +1653,19 @@
% Une très belle extension qui fait a peu près tout ce que fait \textsf{tablvar}
% et même un peu plus : par exemple tangentes horizontales sur les extrema,
% cellules en couleur.
-% Un de ses principaux avantages par rapport à \textsf{tablvar} est de ne pas nécessiter
+% Un de ses principaux bénéfices par rapport à \textsf{tablvar} est de ne pas nécessiter
% de double compilation
% \footnote{La double compilation avec \textsf{tablvar} n'est cependant nécessaire
% qu'avec l'option \texttt{tikz}.}.
-% Signalons quelques différences avec \textsf{tablvar} :
+% Signalons quand même quelques avantages de \textsf{tablvar} :
% \begin{itemize}
-% \item un tableau n'est pas globalement en mode mathématique, il faut donc mettre les
-% \$ du mode math autour de chaque valeur,
-% \item les hauteurs de ligne doivent être précisées de manière explicite et
-% ne peuvent être données qu'en cm (unité fixe qui ne s'ajuste pas à la fonte),
-% \item \textsf{tablvar} offre la possibilité de mettre des 0 par dessus les flèches,
-% \item les double barres aux extrémités du tableau sont assez éloignées des filets,
-% ce qui peut donc laisser un certain blanc sur les bords.
+% \item avec \textsf{tkz-tab}, un tableau n'est pas globalement en mode mathématique,
+% il faut donc mettre les |$| du mode math autour de chaque valeur,
+% \item et les hauteurs de ligne doivent être précisées de manière explicite et
+% uniquement cm (unité fixe qui ne s'ajuste pas à la fonte),
+% \item \textsf{tablvar} offre la possibilité de mettre des valeurs par dessus les flèches,
+% \item dans \textsf{tkz-tab}, les double barres aux extrémités du tableau
+% sont assez éloignées des filets, ce qui laisse un blanc important sur les bords.
% \end{itemize}
% Voici un exemple illustrant ce dernier point, avec son code.
% Pour comparer, le tableau obtenu avec \textsf{tablvar}
@@ -1615,7 +1717,7 @@
\RequirePackage{ifthen}
\RequirePackage{multido}
\RequirePackage{xkeyval}
-\RequirePackage{ifpdf}
+\RequirePackage{iftex}
\newif\iftv@tikz % false par défaut
\DeclareOption{tikz}{\tv@tikztrue}
@@ -1625,23 +1727,31 @@
\iftv@pstricks
\ifpdf
- \PackageError{tablvar}{Don't use the pstricks option with PDF engines}{}
+ \ifluatex
+ \PackageInfo{tablvar}{Option 'pstricks' works
+ with luapstricks}
+ \else
+ \PackageError{tablvar}{Don't use the 'pstricks' option with
+ PDF output mode}{Use 'tikz' option or change the engine}
+ \fi
\else
- \PackageInfo{tablvar}{PSTricks option is used}
+ \PackageInfo{tablvar}{Option 'pstricks' is used}
\fi
\else\iftv@tikz
- \PackageInfo{tablvar}{tikz option is used.
+ \AtEndDocument{\PackageWarningNoLine{tablvar}{Option 'tikz' is used.
\MessageBreak
- Run twice to draw the arrows correctly}
+ Maybe rerun to draw the arrows correctly}
+ }
\else\ifpdf
- \PackageWarningNoLine{tablvar}{PDF engine is used,
- I'm using the tikz option.
+ \AtEndDocument{\PackageWarningNoLine{tablvar}{Output is in PDF mode,
+ I'm using the 'tikz' option.
\MessageBreak
- Run twice to draw the arrows correctly}
+ Maybe rerun to draw the arrows correctly}
+ }
\tv@tikztrue
\else
- \PackageWarningNoLine{tablvar}{PDF engines not used,
- I'm using the pstricks option}
+ \PackageWarningNoLine{tablvar}{Output is in DVI mode,
+ I'm using the 'pstricks' option}
\tv@pstrickstrue
\fi\fi\fi
@@ -1832,6 +1942,28 @@
% \end{macrocode}
% \end{macro}
+% \begin{macro}{\rowtopsep}
+% Cette longueur définit l'espace minimal entre le filet vertical supérieur et le contenu,
+% pour les cellules de la colonne des légendes.
+% Elle ne s'applique pas pour les lignes de variations
+% puisque, dans la colonne des légendes, seule la ligne
+% \og milieu \fg est censée posséder un contenu.
+% \begin{macrocode}
+\newlength{\rowtopsep}
+\setlength{\rowtopsep}{2pt}
+% \end{macrocode}
+% \end{macro}
+
+% \begin{macro}{\rowbottomsep}
+% Cette longueur définit l'espace minimal entre le filet vertical inférieur et le contenu,
+% pour les cellules de la colonne des légendes.
+% Elle ne s'applique pas pour les lignes de variations.
+% \begin{macrocode}
+\newlength{\rowbottomsep}
+\setlength{\rowbottomsep}{2pt}
+% \end{macrocode}
+% \end{macro}
+
% \subsection{Les commandes graphiques PSTricks/\TikZ} \label{graph}
%
% Nous présentons ici les commandes graphiques permettant le dessin
@@ -1962,12 +2094,13 @@
}
% \end{macrocode}
-% La commande |\mil| positionne son contenu sur la colonne 2,
-% mais réalise un décalage vertical si le nombre de lignes de variations diffère de 3.
+% La commande |\mil| positionne son contenu sur la colonne |mil@row|,
+% et réalise un décalage vertical de |\mil@shift|
+% si le nombre de lignes de variations est pair.
% Pour cela nous avons besoin d'une variable de dimension et d'un compteur.
% \begin{macrocode}
-\newlength\mil@heightshift
-\newcounter{mil@rowshift}
+\newlength\mil@shift
+\newcounter{mil@row}
% \end{macrocode}
% Pour gérer correctement les zones interdites, avec la commande |\ZI|,
@@ -2046,7 +2179,7 @@
% \end{macrocode}
% \end{macro}
-% \begin{macro}{\tv@saveheight}
+% \begin{macro}{\tv@setheight}
% Cette macro sert à calculer la hauteur et la profondeur d'une cellule,
% qui seront enregistrées dans des variables globales afin que la commande |\ZI|
% puisse les récupérer.
@@ -2071,21 +2204,22 @@
% et le contenu de la cellule agrandie va toucher le filet horizontal.
% La solution est alors de placer un |\vstrut| ou |\cstrut| dans la colonne
% de légendes pour augmenter sa hauteur qui, de ce fait, sera bien enregistrée
-% par |\tv@saveheight|.
+% par |\tv@setheight|.
% \begin{macrocode}
-\newcommand\tv@saveheight{%
- \tv@cellheight=0pt
- \tv@celldepth=0pt
- \ifdim \ht\tv@cellbox > \ht\@arstrutbox
- \global\advance\tv@cellheight by \ht\tv@cellbox
- \else
- \global\advance\tv@cellheight by \ht\@arstrutbox
+\newcommand\tv@setheight{%
+ \global\tv@cellheight=\ht\tv@cellbox
+ \ifthenelse{\value{var@ligne}=0}{
+ \global\advance\tv@cellheight by \rowtopsep}{}
+ \ifdim \tv@cellheight < \ht\@arstrutbox
+ \global\tv@cellheight = \ht\@arstrutbox
\fi
- \ifdim \dp\tv@cellbox > \dp\@arstrutbox
- \global\advance\tv@celldepth by \dp\tv@cellbox
- \else
- \global\advance\tv@celldepth by \dp\@arstrutbox
+ \global\tv@celldepth=\dp\tv@cellbox
+ \ifthenelse{\value{var@ligne}=0}{
+ \global\advance \tv@celldepth by \rowbottomsep}{}
+ \ifdim \tv@celldepth < \dp\@arstrutbox
+ \global\tv@celldepth = \dp\@arstrutbox
\fi
+ \vrule height \tv@cellheight depth \tv@celldepth width 0pt
}
% \end{macrocode}
% \end{macro}
@@ -2115,7 +2249,7 @@
>{\setcounter{tv@icol}{0}\stepcounter{tv@row}\begin{lrbox}%
\tv@cellbox $}%
c%
- <{$\end{lrbox}\usebox{\tv@cellbox}\tv@saveheight}}
+ <{$\end{lrbox}\usebox{\tv@cellbox}\tv@setheight}}
% type de colonne i pour les intervalles
\newcolumntype{i}{>{\stepcounter{tv@icol}
\centering\arraybackslash$}p{\intervalwidth}<{$}}
@@ -2142,7 +2276,7 @@
% On commence par prendre en compte les options grâce à |\setkeys*| fourni par l'extension
% \textsf{xkeyval}. La version étoilée de |\setkeys|
% a l'avantage de ne pas produire d'erreur lorsqu'une clé n'est pas reconnue
-% (celle-ci est passée à |XKV@rm|). On l'interprète
+% (celle-ci est passée à |\XKV@rm|). On l'interprète
% \footnote{Un message d'erreur de dimension erronée
% peut donc signifier que l'on s'est trompé dans l'orthographe d'une clé.}
% alors comme une dimension pour le paramètre |\intervalwidth|.
@@ -2156,8 +2290,8 @@
\setkeys*{tablvar}{#1} % fourni par xkeyval
\if\XKV@rm\empty \else \setlength{\intervalwidth}{#1} \fi
\tvcoltypes
- \ifextleft \newcolumntype{B}{v{l}} \else \newcolumntype{B}{v{c}} \fi
- \ifextright \newcolumntype{E}{v{r}} \else \newcolumntype{E}{v{c}} \fi
+ \ifextleft\newcolumntype{B}{v{l}}\else\newcolumntype{B}{v{c}}\fi
+ \ifextright\newcolumntype{E}{v{r}}\else\newcolumntype{E}{v{c}}\fi
\tablvarinit{#2}
\ZIinit
\begin{array}{%
@@ -2228,11 +2362,12 @@
% Les flèches et pointillés sont dessinés à la fin, quand tous les nœuds sont créés,
% mais il faut les tracer avant le |\\| final, sinon la compilation plante !
% Le compteur |var@ligne| doit être remis à 0 au cas où il y a plusieurs parties variations.
+% Cette remise à zéro s'effectue à la fin au cas où on mettrait des lignes de signes
+% après une ligne variations.
% \begin{macrocode}
\newcommand*{\variations}[2][3]{% #1=nblignes (3 par défaut)
% (ré)initialisation des compteurs
\setcounter{nbvarlignes}{#1}
- \setcounter{var@ligne}{0}
\setcounter{numdiscont}{0}
\multido{\I=1+1}{\themaxdiscont}{\setcounter{discont\I}{0}}
% boucle : on exécute le code #2 un nb de fois égal à (#1)-1
@@ -2259,6 +2394,7 @@
}
% tracé des pointillés pour les valeurs remarquables
\multido{\Ix=1+1}{\thenumvr}{\vrconnect{X\Ix}{Y\Ix}}
+ \setcounter{var@ligne}{0}
\\ % dernier retour ligne du tableau
}
% \end{macrocode}
@@ -2291,6 +2427,7 @@
% Place son contenu dans une boite de largeur nulle : affiche le contenu
% mais considère que l'espace occupé est nul pour ne pas altérer le calcul de la
% largeur de colonne.
+% Cette macro est similaire à |\mathclap| de l'extension \textsf{mathtools}~\cite{TOOLS}.
% Sa syntaxe est :
% |\zbox|\oarg{pos}\marg{contenu} où \meta{opt} = |c| (par défaut), |l| (left) ou |r| (right).
% \begin{macrocode}
@@ -2367,24 +2504,31 @@
% \end{macro}
% \begin{macro}{\mil}
-% La commande |\mil|\marg{valeur} positionne \meta{valeur} sur la ligne 2
-% de la partie variations. Lorsqu'il y a 3 lignes de variations cela correspond bien
-% au milieu, mais sinon on réalise un décalage vertical grâce à |\vdecal|.
-% La formule de ce décalage est
-% $(3- \mbox{nblignes}) \times (\mbox{hauteur de ligne})/2$.
-% Le résultat de ce calcul est stocké dans la variable de dimension |\mil@heightshift|.
-% Au cas où |\mil| ne donnerait pas un résultat parfait, on pourrait alors régler
+% Pour un nombre $n$ impair de lignes de variations,
+% la commande |\mil|\marg{valeur} positionne \meta{valeur} sur la ligne $\frac{n+1}{2}$
+% de la partie variations. Cela correspond bien à la ligne du milieu :
+% ligne 2 lorsqu'il y a 3 lignes.
+% Par contre si $n$ est pair, on place \meta{valeur} sur la ligne $\frac{n}{2}$ mais avec
+% un décalage vertical négatif (vers le bas) grâce à |\vdecal|.
+% Ce décalage correspond à une profondeur de cellule augmenté de \texttt{0.5ex}
+% (écart entre la ligne de base du texte et la ligne de centrage mathématique).
+% Le résultat de ce calcul est stocké dans la variable de dimension |\mil@shift|.
+% Au cas où l'on ne serait pas satisfait du résultat de |\mil|, on pourrait alors régler
% le décalage manuellement avec
%|\pos*|\marg{ligne}|{\vdecal|\marg{decal}\marg{contenu}|}|.
% \begin{macrocode}
\newcommand*{\mil}[1]{%
- \mil@heightshift = \ht\@arstrutbox
- \advance\mil@heightshift by \dp\@arstrutbox
- \divide\mil@heightshift by 2
- \setcounter{mil@rowshift}{3}
- \addtocounter{mil@rowshift}{-\value{nbvarlignes}}
- \multiply\mil@heightshift by \value{mil@rowshift}
- \pos*{2}{\vdecal{\mil@heightshift}{#1}}
+ \setcounter{mil@row}{\value{nbvarlignes}}
+ \ifthenelse{\isodd{\value{nbvarlignes}}}{
+ \addtocounter{mil@row}{1}
+ \divide\value{mil@row} by 2
+ \pos*{\themil@row}{\smash{#1}}
+ }{
+ \divide\value{mil@row} by 2
+ \mil@shift = \dp\@arstrutbox
+ \advance\mil@shift by 0.5ex
+ \pos*{\themil@row}{\vdecal{-\mil@shift}{#1}}
+ }
}
% \end{macrocode}
% \end{macro}
@@ -2409,7 +2553,7 @@
% \begin{macro}{\bb}
% La macro |\bb|, qui produit une double barre,
-% reprend celle de l'extension \textsf{variations} de Christian Obrecht
+% reprend celle de l'extension \mbox{\textsf{variations}} de Christian Obrecht :
% |\def\bb{\vrule\kern1pt\vrule}|.
% Nous avons ajouté \texttt{1.5pt} d'espace avant et après, afin d'aligner au mieux
% la double barre avec un 0 sur la ligne des $x$, lorsque la double barre
@@ -2423,14 +2567,38 @@
% \end{macro}
% \DescribeMacro{\limg}\DescribeMacro{\limd}
-% Les macros |\limg| et |limd| servent à positionner des limites à gauche \emph{ou} à droite,
+% Les macros |\limg| et |\limd| servent à positionner des limites à gauche ou à droite,
% en particulier aux bords des double barres.
% Le premier paramètre, optionnel, précise l'option de positionnement (\texttt{c},
% \texttt{l} ou \texttt{r}) et le second \emph{obligatoire} et le numéro de ligne,
% enfin le troisième est la valeur à placer.
+%
+% \DescribeMacro{\limg*}\DescribeMacro{\limd*}
+% Les versions étoilées n'acceptent comme argument que \texttt{+} ou \texttt{-},
+% |\limg*{+}| correspond à |\limg{1}{+\infty}|,
+% |\limg*{-}| correspond à |\limg{|$n$|}{-\infty}| (pour une partie variations
+% sur $n$ lignes et de même pour |\limd*|.
% \begin{macrocode}
-\newcommand*{\limg}[3][c]{\zbox[r]{\valpos[#1]{#2}{#3\hspace{\limsep}}}}
-\newcommand*{\limd}[3][c]{\zbox[l]{\valpos[#1]{#2}{\hspace{\limsep}#3}}}
+\newcommand*{\@limg}[3][c]{%
+ \zbox[r]{\valpos[#1]{#2}{#3\hspace{\limsep}}}}
+\newcommand*{\@limd}[3][c]{%
+ \zbox[l]{\valpos[#1]{#2}{\hspace{\limsep}#3}}}
+\newcommand*{\@@limg}[1]{%
+ \ifthenelse{\equal{#1}{+}}{\@limg{1}{+\infty}}{
+ \ifthenelse{\equal{#1}{-}}{\@limg{\value{nbvarlignes}}{-\infty}}{
+ \PackageError{tablvar}{Invalid argument for \string\limg*}
+ {Only + or - are valid arguments for \string\limg*}
+ }}
+}
+\newcommand*{\@@limd}[1]{%
+ \ifthenelse{\equal{#1}{+}}{\@limd{1}{+\infty}}{
+ \ifthenelse{\equal{#1}{-}}{\@limd{\value{nbvarlignes}}{-\infty}}{
+ \PackageError{tablvar}{Invalid argument for \string\limd*}
+ {Only + or - are valid arguments for \string\limd*}
+ }}
+}
+\newcommand{\limg}{\@ifstar{\@@limg}{\@limg}}
+\newcommand{\limd}{\@ifstar{\@@limd}{\@limd}}
% \end{macrocode}
% \begin{macro}{\discont}
@@ -2458,16 +2626,19 @@
% \end{macrocode}
% \end{macro}
-% \begin{macro}{\bblim}
-% Sert à positionner des limites à gauche \emph{et} à droite
+% \DescribeMacro{\bblim}\DescribeMacro{\bblim*}
+% Ces macros servent à positionner des limites à gauche \emph{et} à droite
% d'une double barre.
-% Cette macro trace la double barre, place les limites et appelle |\discont|.
-% Sa syntaxe est :
-% |\bblim|\marg{ligne gauche}\marg{limite gauche}\marg{ligne droite}\marg{limite droite}.
+% Elles tracent la double barre, placent les limites et appellent |\discont|.\\
+% La syntaxe de |\bblim| est : \\
+% |\bblim|\marg{ligne gauche}\marg{limite gauche}\marg{ligne droite}\marg{limite droite}.\\
+% La syntaxe de|\bblim*| reprend celle de |\limg*| et |\limd*| :
+% |\bblim*|\marg{+$\vert$-}\marg{+$\vert$-}.
% \begin{macrocode}
-\newcommand*{\bblim}[4]{\limg{#1}{#2}\bb\discont\limd{#3}{#4}}
+\newcommand*{\@bblim}[4]{\limg{#1}{#2}\bb\discont\limd{#3}{#4}}
+\newcommand*{\@@bblim}[2]{\limg*{#1}\bb\discont\limd*{#2}}
+\newcommand*{\bblim}{\@ifstar{\@@bblim}{\@bblim}}
% \end{macrocode}
-% \end{macro}
% \begin{macro}{\vr}
% La commande |\vr| fabrique un nœud pour chaque valeur remarquable.
@@ -2595,7 +2766,7 @@
% courante dans une des 4 variables de dimension |\ZIheighti|, \ldots, |\ZIheightiv|
% correspondant à la zone interdite appelante.
% On récupère hauteur et profondeur qui ont été enregistrés dans
-% les variables globales |\tv@cellheight| et |\tv@cellheight|,
+% les variables globales |\tv@cellheight| et |\tv@celldepth|,
% par la colonne de légendes de la même ligne.
% Le numéro de la ZI (son indice) est passé en argument.
% \begin{macrocode}
@@ -2711,18 +2882,18 @@
% \end{macrocode}
%
% \bigskip
-% \begin{thebibliography}{14}
+% \begin{thebibliography}{15}
% \begin{raggedright}
-% \bibitem{TABL} \emph{Tableaux}. Nicolas Kisselhoff, CTAN.
-% \bibitem{TABV} \emph{Tableaux de variations : \textsf{‘tabvar’}}. Daniel Flipo,
+% \bibitem{TABL} \emph{Tableaux}, Nicolas Kisselhoff, CTAN.
+% \bibitem{TABV} \emph{Tableaux de variations : \textsf{‘tabvar’}}, Daniel Flipo,
% CTAN, v1.8 16/07/2022.
-% \bibitem{VARI} \emph{L'extension \textsf{variations}}. Christian Obrecht,
+% \bibitem{VARI} \emph{L'extension \textsf{variations}}, Christian Obrecht,
% CTAN, v0.3 13/09/2006.
% \bibitem{TABLOR} \emph{\textsf{tablor.sty} La machine à créer des tableaux
-% de signes et de variations}. Guillaume Connan, CTAN, v4.07 09/05/2010.
+% de signes et de variations}, Guillaume Connan, CTAN, v4.07 09/05/2010.
% \bibitem{VARMP} \emph{\textsf{tableauVariations} -- Variation tables in
-% \textlogo{METAPOST}}. Frédéric Mazoit, CTAN, 2005.
-% \bibitem{TKZ} \emph{\textsf{Tkz-Tab}}. Alain Matthes, CTAN,
+% \textlogo{METAPOST}}, Frédéric Mazoit, CTAN, 2005.
+% \bibitem{TKZ} \emph{\textsf{Tkz-Tab}}, Alain Matthes, CTAN,
% v2.12c 29/04/2020.
% \bibitem{ARRAY} \emph{A new implementation of LATEX’s \textsf{tabular} and \textsf{array}
% environment}, Frank Mittelbach, David Carlisle, CTAN, v2.5g revised 16/10/2023.
@@ -2734,12 +2905,14 @@
% v1.9.0 04/01/2022.
% \bibitem{SPA} \emph{The \textsf{spacingtricks} package}, Antoine Missier,
% CTAN, v1.7 28/07/2023.
-% \bibitem{XKEY} \emph{The \textsf{xkeyval} package}. Hendri Adriaens,
-% CTAN, v2.9, 16/06/2022.
-% \bibitem{MIS} \emph{\textsf{mismath} -- Miscellaneous mathematical macros},
-% Antoine Missier, CTAN, v2.9 19/12/2023.
-% \bibitem{FR} \emph{L'extension \textsf{frenchmath}}. Antoine Missier,
-% CTAN, v2.7, 23/12/2023.
+% \bibitem{XKEY} \emph{The \textsf{xkeyval} package}, Hendri Adriaens,
+% CTAN, v2.9 16/06/2022.
+% \bibitem{TOOLS} \emph{The \textsf{mathtools} package}, Morten Høgholm, Lars Madsen,
+% CTAN, v1.23 17/01/2020.
+% \bibitem{MIS} Miscellaneous mathematical macros -- The \emph{\textsf{mismath} package},
+% Antoine Missier, CTAN, v3.1 16/06/2024.
+% \bibitem{FR} \emph{L'extension \textsf{frenchmath}}, Antoine Missier,
+% CTAN, v3.1 07/05/2024.
% \end{raggedright}
% \end{thebibliography}
% \Finale
diff --git a/Master/texmf-dist/source/latex/tablvar/tablvar.ins b/Master/texmf-dist/source/latex/tablvar/tablvar.ins
index 0280b617734..192a1eb6e83 100644
--- a/Master/texmf-dist/source/latex/tablvar/tablvar.ins
+++ b/Master/texmf-dist/source/latex/tablvar/tablvar.ins
@@ -1,5 +1,5 @@
%%
-%% Copyright (C) 2018-2023 by Antoine Missier <antoine.missier@ac-toulouse.fr>
+%% Copyright (C) 2018-2024 by Antoine Missier <antoine.missier@ac-toulouse.fr>
%%
%% This file may be distributed and/or modified under the conditions of
%% the LaTeX Project Public License, either version 1.3 of this license
@@ -21,7 +21,7 @@
This is a generated file.
-Copyright (C) 2018-2023 by Antoine Missier <antoine.missier@ac-toulouse.fr>
+Copyright (C) 2018-2024 by Antoine Missier <antoine.missier@ac-toulouse.fr>
This file may be distributed and/or modified under the conditions of
the LaTeX Project Public License, either version 1.3 of this license
@@ -46,7 +46,7 @@ and version 1.3 or later is part of all distributions of LaTeX version
\Msg{* tablvar.sty *}
\Msg{* *}
\Msg{* To produce the documentation run the file tablvar.dtx *}
-\Msg{* through XeLaTeX or LaTeX + dvips + ps2pdf. *}
+\Msg{* through LaTeX + dvips + ps2pdf. *}
\Msg{* *}
\Msg{* Happy TeXing! *}
\Msg{* *}
diff --git a/Master/texmf-dist/source/latex/tagpdf/tagpdf-backend.dtx b/Master/texmf-dist/source/latex/tagpdf/tagpdf-backend.dtx
index 0f388b2542e..0ed233e2e0b 100644
--- a/Master/texmf-dist/source/latex/tagpdf/tagpdf-backend.dtx
+++ b/Master/texmf-dist/source/latex/tagpdf/tagpdf-backend.dtx
@@ -47,13 +47,13 @@
% }^^A
% }
%
-% \date{Version 0.99b, released 2024-04-12}
+% \date{Version 0.99d, released 2024-08-02}
% \maketitle
% \begin{implementation}
% \begin{macrocode}
%<@@=tag>
%<*luatex>
-\ProvidesExplFile {tagpdf-luatex.def} {2024-04-12} {0.99b}
+\ProvidesExplFile {tagpdf-luatex.def} {2024-08-02} {0.99d}
{tagpdf~driver~for~luatex}
% \end{macrocode}
% \section{Loading the lua}
@@ -164,8 +164,8 @@
local ProvidesLuaModule = {
name = "tagpdf",
- version = "0.99b", --TAGVERSION
- date = "2024-04-12", --TAGDATE
+ version = "0.99d", --TAGVERSION
+ date = "2024-08-02", --TAGDATE
description = "tagpdf lua code",
license = "The LATEX Project Public License 1.3c"
}
@@ -196,8 +196,8 @@ ltx.@@.page will contain page data
ltx.@@.tables contains also data from mc and struct (from older code). This needs cleaning up.
There are certainly dublettes, but I don't dare yet ...
ltx.@@.func will contain (public) functions.
-ltx.@@.trace will contain tracing/loging functions.
-local funktions starts with __
+ltx.@@.trace will contain tracing/logging functions.
+local functions starts with __
functions meant for users will be in ltx.tag
functions
@@ -210,7 +210,7 @@ functions
ltx.@@.func.store_mc_kid (mcnum,kid,page): stores the mc-kids of mcnum on page page
ltx.@@.func.store_mc_in_page(mcnum,mcpagecnt,page): stores in the page table the number of mcnum on this page
ltx.@@.func.store_struct_mcabs (structnum,mcnum): stores relations structnum<->mcnum (abs)
- ltx.@@.func.mc_insert_kids (mcnum): inserts the /K entries for mcnum by wandering throught the [kids] table
+ ltx.@@.func.mc_insert_kids (mcnum): inserts the /K entries for mcnum by wandering through the [kids] table
ltx.@@.func.mark_page_elements(box,mcpagecnt,mccntprev,mcopen,name,mctypeprev) : the main function
ltx.@@.func.mark_shipout (): a wrapper around the core function which inserts the last EMC
ltx.@@.func.fill_parent_tree_line (page): outputs the entries of the parenttree for this page
@@ -252,6 +252,12 @@ local iwfontattributeid = luatexbase.new_attribute ("g_@@_interwordfont_attr")
local tagunmarkedbool= token.create("g_@@_tagunmarked_bool")
local truebool = token.create("c_true_bool")
% \end{macrocode}
+% with this token we can query the state of the softhyphen boolean
+% and so detect if hyphens from hyphenation should be replaced by soft-hyphens.
+% \begin{macrocode}
+local softhyphenbool = token.create("g_@@_softhyphen_bool")
+% \end{macrocode}
+
% Now a number of local versions from global tables.
% Not all is perhaps needed, most node variants were copied from lua-debug.
% \begin{macrocode}
@@ -286,6 +292,9 @@ local KERN = node.id("kern")
local PENALTY = node.id("penalty")
local LOCAL_PAR = node.id("local_par")
local MATH = node.id("math")
+
+local explicit_disc = 1
+local regular_disc = 3
% \end{macrocode}
% Now we setup the main table structure. ltx is used by other latex code too!
% \begin{macrocode}
@@ -827,7 +836,7 @@ end
% @@_activate_mark_space,
% ltx.@@.func.markspaceoff
% }
-% Theses functions add/remove the function which marks the spaces to the callbacks
+% These functions add/remove the function which marks the spaces to the callbacks
% |pre_linebreak_filter| and |hpack_filter|
% \begin{macrocode}
local function @@_activate_mark_space ()
@@ -1267,6 +1276,80 @@ function ltx.@@.func.output_parenttree (abspage)
end
% \end{macrocode}
% \end{macro}
+%
+% \begin{macro}
+% {
+% process_softhyphen_pre
+% process_softhyphen_post
+% }
+% First some local definitions. Since these are only needed locally everything gets wrapped into a block.
+% \begin{macrocode}
+do
+ local properties = node.get_properties_table()
+ local is_soft_hyphen_prop = 'tagpdf.rewrite-softhyphen.is_soft_hyphen'
+ local hyphen_char = 0x2D
+ local soft_hyphen_char = 0xAD
+% \end{macrocode}
+%
+% A lookup table to test if the font supports the soft hyphen glyph.
+% \begin{macrocode}
+ local softhyphen_fonts = setmetatable({}, {__index = function(t, fid)
+ local fdir = identifiers[fid]
+ local format = fdir and fdir.format
+ local result = (format == 'opentype' or format == 'truetype')
+ local characters = fdir and fdir.characters
+ result = result and (characters and characters[soft_hyphen_char]) ~= nil
+ t[fid] = result
+ return result
+ end})
+% \end{macrocode}
+%
+% A pre shaping callback to mark hyphens as being hyphenation hyphens.
+% This runs before shaping to avoid affecting hyphens moved into
+% discretionaries during shaping.
+% \begin{macrocode}
+ local function process_softhyphen_pre(head, _context, _dir)
+ if softhyphenbool.mode ~= truebool.mode then return true end
+ for disc, sub in node.traverse_id(DISC, head) do
+ if sub == explicit_disc or sub == regular_disc then
+ for n, _ch, _f in node.traverse_char(disc.pre) do
+ local props = properties[n]
+ if not props then
+ props = {}
+ properties[n] = props
+ end
+ props[is_soft_hyphen_prop] = true
+ end
+ end
+ end
+ return true
+ end
+
+% \end{macrocode}
+%
+% Finally do the actual replacement after shaping. No checking for double processing here
+% since the operation is idempotent.
+% \begin{macrocode}
+ local function process_softhyphen_post(head, _context, _dir)
+ if softhyphenbool.mode ~= truebool.mode then return true end
+ for disc, sub in node.traverse_id(DISC, head) do
+ for n, ch, fid in node.traverse_glyph(disc.pre) do
+ local props = properties[n]
+ if softhyphen_fonts[fid] and ch == hyphen_char and props and props[is_soft_hyphen_prop] then
+ n.char = soft_hyphen_char
+ props.glyph_info = nil
+ end
+ end
+ end
+ return true
+ end
+
+ luatexbase.add_to_callback('pre_shaping_filter', process_softhyphen_pre, 'tagpdf.rewrite-softhyphen')
+ luatexbase.add_to_callback('post_shaping_filter', process_softhyphen_post, 'tagpdf.rewrite-softhyphen')
+end
+% \end{macrocode}
+% \end{macro}
+%
% \begin{macrocode}
%</lua>
% \end{macrocode}
diff --git a/Master/texmf-dist/source/latex/tagpdf/tagpdf-checks.dtx b/Master/texmf-dist/source/latex/tagpdf/tagpdf-checks.dtx
index f786ede6156..3cbe3b141bb 100644
--- a/Master/texmf-dist/source/latex/tagpdf/tagpdf-checks.dtx
+++ b/Master/texmf-dist/source/latex/tagpdf/tagpdf-checks.dtx
@@ -48,7 +48,7 @@
% }^^A
% }
%
-% \date{Version 0.99b, released 2024-04-12}
+% \date{Version 0.99d, released 2024-08-02}
% \maketitle
% \begin{documentation}
% \section{Commands}
@@ -74,7 +74,7 @@
% It relies currently on that the code, that saved the box, correctly sets
% the command \verb+\l_tag_box_\int_use:N #1_tl+ to a positive value.
% The LaTeX commands will do that automatically
-% at some time but it is in the responsability of the user to
+% at some time but it is in the responsibility of the user to
% ensure that when using low-level code.
% If the internal command doesn't exist the box is assumed to be untagged.
% \end{function}
@@ -331,7 +331,7 @@
% \begin{macrocode}
%<@@=tag>
%<*header>
-\ProvidesExplPackage {tagpdf-checks-code} {2024-04-12} {0.99b}
+\ProvidesExplPackage {tagpdf-checks-code} {2024-08-02} {0.99d}
{part of tagpdf - code related to checks, conditionals, debugging and messages}
%</header>
% \end{macrocode}
@@ -639,7 +639,7 @@
% It relies on that the code that saved the box correctly set
% \verb+\l_tag_box_<box number>_tl+ to a positive value.
% The LaTeX commands will do that automatically
-% at some time but it is in the responsability of the user to
+% at some time but it is in the responsibility of the user to
% ensure that when using low-level code.
% If the internal command doesn't exist the box is assumed to be untagged.
% \begin{macrocode}
diff --git a/Master/texmf-dist/source/latex/tagpdf/tagpdf-data.dtx b/Master/texmf-dist/source/latex/tagpdf/tagpdf-data.dtx
index d8cba421420..6417b44c404 100644
--- a/Master/texmf-dist/source/latex/tagpdf/tagpdf-data.dtx
+++ b/Master/texmf-dist/source/latex/tagpdf/tagpdf-data.dtx
@@ -47,7 +47,7 @@
% }^^A
% }
%
-% \date{Version 0.99b, released 2024-04-12}
+% \date{Version 0.99d, released 2024-08-02}
% \maketitle
% \begin{documentation}
% This files contains a various data files which are read in
@@ -58,10 +58,10 @@
% \section{The LaTeX namespace}
% This is the main new namespace. It is bound to change a lot!
% It lists the new tag, the rolemap and the namespace of the rolemap.
-% latex-lab has also a namespace module, which takes precendence!
+% latex-lab has also a namespace module, which takes precedence!
% \begin{macrocode}
%<*ns-latex>
-%% \ProvidesExplFile {tagpdf-ns-latex.def} {2024-04-12} {0.99b}
+%% \ProvidesExplFile {tagpdf-ns-latex.def} {2024-08-02} {0.99d}
%% {latex} {https://www.latex-project.org/ns/dflt/2022}{}
title, Title, pdf2,
part, Title, pdf2,
@@ -93,7 +93,7 @@ text, P, pdf2,
% It is bound to change
% \begin{macrocode}
%<*ns-latex-book>
-%% \ProvidesExplFile {tagpdf-ns-latex-book.def} {2024-04-12} {0.99b}
+%% \ProvidesExplFile {tagpdf-ns-latex-book.def} {2024-08-02} {0.99d}
%% {latex-book} {https://www.latex-project.org/ns/book/2022}{}
chapter, H1,pdf2,
section, H2,pdf2,
@@ -107,7 +107,7 @@ subparagraph, H6,pdf2,
% \section{The pdf namespace data}
% \begin{macrocode}
%<*ns-pdf>
-%% \ProvidesExplFile {tagpdf-ns-pdf.def} {2024-04-12} {0.99b}
+%% \ProvidesExplFile {tagpdf-ns-pdf.def} {2024-08-02} {0.99d}
%% {pdf} {http://iso.org/pdf/ssn}{}
StructTreeRoot,StructTreeRoot,pdf,D,
Document,Document,pdf,D,
@@ -175,7 +175,7 @@ Strong,Span,pdf,I,
% \section{The pdf 2.0 namespace data}
% \begin{macrocode}
%<*ns-pdf2>
-%% \ProvidesExplFile {tagpdf-ns-pdf2.def} {2024-04-12} {0.99b}
+%% \ProvidesExplFile {tagpdf-ns-pdf2.def} {2024-08-02} {0.99d}
%% {pdf2} {http://iso.org/pdf2/ssn}{}
StructTreeRoot,StructTreeRoot,pdf2,D,
Document,Document,pdf2,D,
@@ -232,7 +232,7 @@ Strong,Strong,pdf2,I,
% \section{The mathml namespace data}
% \begin{macrocode}
%<*ns-mathml>
-%% \ProvidesExplFile {tagpdf-ns-mathml.def} {2024-04-12} {0.99b}
+%% \ProvidesExplFile {tagpdf-ns-mathml.def} {2024-08-02} {0.99d}
% {mathml}{http://www.w3.org/1998/Math/MathML}{}
abs,abs,mathml,
and,and,mathml,
@@ -430,7 +430,7 @@ xor,xor,mathml,
% \section{Rule naming}
% \begin{macro}{\c_@@_role_rules_prop}
% These two properties map the rule strings to numbers and back.
-% There are in tagpdf-data.dtx near the csv files for easier maintainance.
+% There are in tagpdf-data.dtx near the csv files for easier maintenance.
% \begin{macrocode}
%<*package>
\prop_const_from_keyval:Nn \c_@@_role_rules_prop
@@ -467,7 +467,7 @@ xor,xor,mathml,
% This will perhaps change in future.
% \begin{macrocode}
%<*parent-child>
-%% \ProvidesExplFile {tagpdf-parent-child.csv} {2024-04-12} {0.99b}
+%% \ProvidesExplFile {tagpdf-parent-child.csv} {2024-08-02} {0.99d}
,,,StructTreeRoot,Document,Art,Part,Div,Sect,BlockQuote,NonStruct,TOC,TOCI,Index,Private,Quote,Note,Reference,BibEntry,P,Hn,H,Lbl,Code,Span,Link,Annot,Form,Ruby,RB,RT,RP,Warichu,WT,WP,L,LI,LBody,Table,TR,TH,TD,THead,TBody,TFoot,Caption,Figure,Formula,MC
Document,both,document level,1,0..n,∅,‡,‡,∅,0..n,‡,∅,∅,∅,0..n,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅
Art,1.7,grouping,∅,0..n,∅,‡,‡,0..n,0..n,‡,∅,∅,∅,0..n,∅,0..n,∅,∅,∅,0..1,0..1,∅,∅,∅,0..n,0..n,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,0..n,∅,∅,0..n,0..n,∅,∅,∅,0..n,0..n,∅,∅
@@ -522,7 +522,7 @@ MC,both,---,∅,∅,∅,∅,∅,∅,0..n,‡,∅,∅,∅,0..n,0..n,0..n,0..n,0..
% This will perhaps change in future.
% \begin{macrocode}
%<*parent-child-2>
-%% \ProvidesExplFile {tagpdf-parent-child-2.csv} {2024-04-12} {0.99b}
+%% \ProvidesExplFile {tagpdf-parent-child-2.csv} {2024-08-02} {0.99d}
,,,StructTreeRoot,Document,DocumentFragment,Art,Part,Div,Sect,Aside,BlockQuote,NonStruct,TOC,TOCI,Index,Private,Title,Sub,Quote,Note,Reference,BibEntry,P,Hn,H,Lbl,Code,Em,Strong,Span,Link,Annot,Form,Ruby,RB,RT,RP,Warichu,WT,WP,FENote,L,LI,LBody,Table,TR,TH,TD,THead,TBody,TFoot,Caption,Figure,Formula,math,mathml,Artifact,MC
Document,both,document level,1,0..n,0..n,∅,‡,‡,∅,0..n,0..n,‡,∅,∅,∅,0..n,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,0..n,∅
DocumentFragment,2.0,document level,∅,0..n,0..n,0..n,‡,‡,0..n,0..n,0..n,‡,∅,∅,∅,0..n,∅,∅,∅,∅*,∅,∅,∅,∅,∅,∅,∅*,∅,∅,∅,∅*,∅*,∅,∅,∅,∅,∅,∅,∅,∅,∅*,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅*,∅,∅,∅,∅,0..n,∅
diff --git a/Master/texmf-dist/source/latex/tagpdf/tagpdf-mc-generic.dtx b/Master/texmf-dist/source/latex/tagpdf/tagpdf-mc-generic.dtx
index b1ce874db69..ff036b5523f 100644
--- a/Master/texmf-dist/source/latex/tagpdf/tagpdf-mc-generic.dtx
+++ b/Master/texmf-dist/source/latex/tagpdf/tagpdf-mc-generic.dtx
@@ -46,7 +46,7 @@
% }^^A
% }
%
-% \date{Version 0.99b, released 2024-04-12}
+% \date{Version 0.99d, released 2024-08-02}
% \maketitle
% \begin{documentation}
% \end{documentation}
@@ -55,11 +55,11 @@
% \begin{macrocode}
%<@@=tag>
%<*generic>
-\ProvidesExplPackage {tagpdf-mc-code-generic} {2024-04-12} {0.99b}
+\ProvidesExplPackage {tagpdf-mc-code-generic} {2024-08-02} {0.99d}
{part of tagpdf - code related to marking chunks - generic mode}
%</generic>
%<*debug>
-\ProvidesExplPackage {tagpdf-debug-generic} {2024-04-12} {0.99b}
+\ProvidesExplPackage {tagpdf-debug-generic} {2024-08-02} {0.99d}
{part of tagpdf - debugging code related to marking chunks - generic mode}
%</debug>
% \end{macrocode}
@@ -393,12 +393,12 @@
% \end{macro}
% \begin{macro}{\@@_add_missing_mcs_to_stream:Nn}
-% This is the main command to add mc to the stream. It is therefor
+% This is the main command to add mc to the stream. It is therefore
% guarded by the mc-boolean.
%
% If we aren't in the main stream then processing is a bit more
% complicated because to get at the marks in the box we need to
-% artifically split it and then look at the split marks.
+% artificially split it and then look at the split marks.
%
% First argument is the box to update and the second is the \enquote{stream}.
% In lua mode the command is a no-op.
diff --git a/Master/texmf-dist/source/latex/tagpdf/tagpdf-mc-luacode.dtx b/Master/texmf-dist/source/latex/tagpdf/tagpdf-mc-luacode.dtx
index 9db6cc95fa1..3c2e91605e1 100644
--- a/Master/texmf-dist/source/latex/tagpdf/tagpdf-mc-luacode.dtx
+++ b/Master/texmf-dist/source/latex/tagpdf/tagpdf-mc-luacode.dtx
@@ -46,10 +46,10 @@
% }^^A
% }
%
-% \date{Version 0.99b, released 2024-04-12}
+% \date{Version 0.99d, released 2024-08-02}
% \maketitle
% \begin{implementation}
-% The code is splitted into three parts: code shared by all engines,
+% The code is split into three parts: code shared by all engines,
% code specific to luamode and code not used by luamode.
%
% \section{Marked content code -- luamode code}
@@ -86,11 +86,11 @@
% \begin{macrocode}
%<@@=tag>
%<*luamode>
-\ProvidesExplPackage {tagpdf-mc-code-lua} {2024-04-12} {0.99b}
+\ProvidesExplPackage {tagpdf-mc-code-lua} {2024-08-02} {0.99d}
{tagpdf - mc code only for the luamode }
%</luamode>
%<*debug>
-\ProvidesExplPackage {tagpdf-debug-lua} {2024-04-12} {0.99b}
+\ProvidesExplPackage {tagpdf-debug-lua} {2024-08-02} {0.99d}
{part of tagpdf - debugging code related to marking chunks - lua mode}
%</debug>
% \end{macrocode}
diff --git a/Master/texmf-dist/source/latex/tagpdf/tagpdf-mc-shared.dtx b/Master/texmf-dist/source/latex/tagpdf/tagpdf-mc-shared.dtx
index aeadb889d46..5bfe0658d10 100644
--- a/Master/texmf-dist/source/latex/tagpdf/tagpdf-mc-shared.dtx
+++ b/Master/texmf-dist/source/latex/tagpdf/tagpdf-mc-shared.dtx
@@ -46,7 +46,7 @@
% }^^A
% }
%
-% \date{Version 0.99b, released 2024-04-12}
+% \date{Version 0.99d, released 2024-08-02}
% \maketitle
% \begin{documentation}
% \section{Public Commands}
@@ -175,13 +175,13 @@
% \end{function}
% \end{documentation}
% \begin{implementation}
-% The code is splitted into three parts: code shared by all engines,
+% The code is split into three parts: code shared by all engines,
% code specific to luamode and code not used by luamode.
% \section{Marked content code -- shared}
% \begin{macrocode}
%<@@=tag>
%<*header>
-\ProvidesExplPackage {tagpdf-mc-code-shared} {2024-04-12} {0.99b}
+\ProvidesExplPackage {tagpdf-mc-code-shared} {2024-08-02} {0.99d}
{part of tagpdf - code related to marking chunks -
code shared by generic and luamode }
%</header>
diff --git a/Master/texmf-dist/source/latex/tagpdf/tagpdf-roles.dtx b/Master/texmf-dist/source/latex/tagpdf/tagpdf-roles.dtx
index de239c2db79..fb5f1b77c99 100644
--- a/Master/texmf-dist/source/latex/tagpdf/tagpdf-roles.dtx
+++ b/Master/texmf-dist/source/latex/tagpdf/tagpdf-roles.dtx
@@ -33,7 +33,7 @@
%</driver>
% \fi
% \title{^^A
-% The \pkg{tagpdf-roles} module\\ Tags, roles and namesspace code ^^A
+% The \pkg{tagpdf-roles} module\\ Tags, roles and namespace code ^^A
% \\ Part of the tagpdf package
% }
%
@@ -46,7 +46,7 @@
% }^^A
% }
%
-% \date{Version 0.99b, released 2024-04-12}
+% \date{Version 0.99d, released 2024-08-02}
% \maketitle
% \begin{documentation}
% \begin{function}
@@ -98,7 +98,7 @@
% \begin{macrocode}
%<@@=tag>
%<*header>
-\ProvidesExplPackage {tagpdf-roles-code} {2024-04-12} {0.99b}
+\ProvidesExplPackage {tagpdf-roles-code} {2024-08-02} {0.99d}
{part of tagpdf - code related to roles and structure names}
%</header>
% \end{macrocode}
@@ -190,7 +190,7 @@
% \end{variable}
%
% \begin{variable}{\g_@@_role_tags_class_prop}
-% With pdf 2.0 we store the class in the NS dependant props.
+% With pdf 2.0 we store the class in the NS dependent props.
% With pdf <2.0 we store for now the type(s) of a tag in a common
% prop.
% Tags that are rolemapped should get the type from
@@ -750,19 +750,31 @@
{
\hook_gput_code:nnn {begindocument}{tagpdf}
{
- \cs_if_exist:NT \chapter
- {
- \prop_map_inline:cn{g_@@_role_NS_latex-book_prop}
- {
- \@@_role_add_tag:ne {#1}{\use_i:nn #2\c_empty_tl\c_empty_tl}
- }
- }
+ \bool_lazy_and:nnT
+ {
+ \cs_if_exist_p:N \chapter
+ }
+ {
+ \cs_if_exist_p:N \c@chapter
+ }
+ {
+ \prop_map_inline:cn{g_@@_role_NS_latex-book_prop}
+ {
+ \@@_role_add_tag:ne {#1}{\use_i:nn #2\c_empty_tl\c_empty_tl}
+ }
+ }
}
}
{
\hook_gput_code:nnn {begindocument}{tagpdf}
{
- \cs_if_exist:NT \chapter
+ \bool_lazy_and:nnT
+ {
+ \cs_if_exist_p:N \chapter
+ }
+ {
+ \cs_if_exist_p:N \c@chapter
+ }
{
\prop_map_inline:cn{g_@@_role_NS_latex-book_prop}
{
diff --git a/Master/texmf-dist/source/latex/tagpdf/tagpdf-space.dtx b/Master/texmf-dist/source/latex/tagpdf/tagpdf-space.dtx
index 62c9fd1ecab..5c8e0070848 100644
--- a/Master/texmf-dist/source/latex/tagpdf/tagpdf-space.dtx
+++ b/Master/texmf-dist/source/latex/tagpdf/tagpdf-space.dtx
@@ -46,7 +46,7 @@
% }^^A
% }
%
-% \date{Version 0.99b, released 2024-04-12}
+% \date{Version 0.99d, released 2024-08-02}
% \maketitle
% \begin{documentation}
% \begin{function}{activate/space (setup-key),interwordspace (deprecated)}
@@ -58,7 +58,7 @@
% This key is deprecated. Use |debug/show=spaces| instead.
% This key works only with luatex and shows with small red
% bars where spaces have been inserted. This is only for debugging and
-% is not completly reliable (and change affect other literals and tagging), so it
+% is not completely reliable (and change affect other literals and tagging), so it
% should be used with care.
% \end{function}
% \end{documentation}
@@ -66,12 +66,12 @@
% \begin{macrocode}
%<@@=tag>
%<*header>
-\ProvidesExplPackage {tagpdf-space-code} {2024-04-12} {0.99b}
+\ProvidesExplPackage {tagpdf-space-code} {2024-08-02} {0.99d}
{part of tagpdf - code related to real space chars}
%</header>
% \end{macrocode}
% \section{Code for interword spaces}
-% The code is engine/backend dependant. Basically only pdftex and luatex
+% The code is engine/backend dependent. Basically only pdftex and luatex
% support real space chars. Most of the code for luatex which uses attributes
% is in the lua code, here are only the keys.
%
diff --git a/Master/texmf-dist/source/latex/tagpdf/tagpdf-struct.dtx b/Master/texmf-dist/source/latex/tagpdf/tagpdf-struct.dtx
index 04ffa900cc3..6da5e48b187 100644
--- a/Master/texmf-dist/source/latex/tagpdf/tagpdf-struct.dtx
+++ b/Master/texmf-dist/source/latex/tagpdf/tagpdf-struct.dtx
@@ -46,7 +46,7 @@
% }^^A
% }
%
-% \date{Version 0.99b, released 2024-04-12}
+% \date{Version 0.99d, released 2024-08-02}
% \maketitle
% \begin{documentation}
% \section{Public Commands}
@@ -95,7 +95,7 @@
% This inserts an annotation in the structure. \meta{object reference}
% is there reference to the annotation. \meta{struct parent number}
% should be the same number as had been inserted with \cs{tag_struct_parent_int:}
-% as |StructParent| value to the dictionary of the annotion.
+% as |StructParent| value to the dictionary of the annotation.
% The command will increase the value of the counter
% used by \cs{tag_struct_parent_int:}.
% \end{function}
@@ -147,7 +147,7 @@
% needed as you can only use structures already defined), and by the
% |ref| key (which can refer to future structures).
% Internally the label name will start with \texttt{tagpdfstruct-} and it stores
-% the two attributs |tagstruct| (the structure number) and |tagstructobj| (the
+% the two attributes |tagstruct| (the structure number) and |tagstructobj| (the
% object reference).
% \end{function}
% \begin{function}{parent (struct-key)}
@@ -285,7 +285,7 @@
% \begin{macrocode}
%<@@=tag>
%<*header>
-\ProvidesExplPackage {tagpdf-struct-code} {2024-04-12} {0.99b}
+\ProvidesExplPackage {tagpdf-struct-code} {2024-08-02} {0.99d}
{part of tagpdf - code related to storing structure}
%</header>
% \end{macrocode}
@@ -323,7 +323,7 @@
% in generic mode it can happen after
% a page break that we have to inject into a structure
% sequence an additional mc after. We will store this additional
-% info in a property. The key is the absolut mc num, the value the pdf directory.
+% info in a property. The key is the absolute mc num, the value the pdf directory.
% \begin{macrocode}
\@@_prop_new:N \g_@@_struct_cont_mc_prop
% \end{macrocode}
@@ -419,7 +419,7 @@
T, %title, value in () or <>
Lang, %language
Alt, % value in () or <>
- E, % abreviation
+ E, % abbreviation
ActualText,
AF, %pdf 2.0, array of dict, associated files
NS, %pdf 2.0, dict, namespace
@@ -523,7 +523,7 @@
{ g_@@_struct_#1_prop }{#2}{#3}
%<debug>\prop_gput:cnn { g_@@_struct_debug_#1_prop } {#2} {#3}
}
-\cs_generate_variant:Nn \@@_struct_prop_gput:nnn {nne,nee,nno}
+\cs_generate_variant:Nn \@@_struct_prop_gput:nnn {onn,nne,nee,nno}
%</package|debug>
% \end{macrocode}
% \end{macro}
@@ -902,7 +902,7 @@
% Basically it does what |\pdfdict_use:n| does.
% This is used a lot so should be rather fast.
% \begin{macrocode}
-\cs_new_protected:Npn \@@_struct_get_dict_content:nN #1 #2 %#1: stucture num
+\cs_new_protected:Npn \@@_struct_get_dict_content:nN #1 #2 %#1: structure num
{
\tl_clear:N #2
\prop_map_inline:cn { g_@@_struct_#1_prop }
@@ -1270,7 +1270,7 @@
% extension.
% AF/AFref is an array and can be used more than once, so we store it in a tl.
% which is expanded.
-% AFinline currently uses the fix extention txt.
+% AFinline currently uses the fix extension txt.
% texsource is a special variant which creates a tex-file, it expects a
% tl-var as value (e.g. from math grabbing)
%
@@ -1579,6 +1579,7 @@
{ g_@@_struct_ \l_@@_struct_stack_parent_tmpa_tl _prop}
{S}
\l_@@_tmpa_tl
+ \quark_if_no_value:NT\l_@@_tmpa_tl{\tl_set:Nn \l_@@_tmpa_tl{UNKNOWN}}
\msg_warning:nneee
{ tag }
{role-parent-child}
@@ -1936,7 +1937,7 @@
% \section{Attributes and attribute classes}
% \begin{macrocode}
%<*header>
-\ProvidesExplPackage {tagpdf-attr-code} {2024-04-12} {0.99b}
+\ProvidesExplPackage {tagpdf-attr-code} {2024-08-02} {0.99d}
{part of tagpdf - code related to attributes and attribute classes}
%</header>
% \end{macrocode}
@@ -1962,7 +1963,7 @@
\tl_new:N \l_@@_attr_value_tl
\prop_new:N \g_@@_attr_objref_prop %will contain obj num of used attributes
% \end{macrocode}
-% This seq is currently kept for compability with the table code.
+% This seq is currently kept for compatibility with the table code.
% \begin{macrocode}
\seq_new:N\g_@@_attr_class_used_seq
% \end{macrocode}
diff --git a/Master/texmf-dist/source/latex/tagpdf/tagpdf-tree.dtx b/Master/texmf-dist/source/latex/tagpdf/tagpdf-tree.dtx
index 63192505236..f7ae6de9966 100644
--- a/Master/texmf-dist/source/latex/tagpdf/tagpdf-tree.dtx
+++ b/Master/texmf-dist/source/latex/tagpdf/tagpdf-tree.dtx
@@ -47,13 +47,13 @@
% }^^A
% }
%
-% \date{Version 0.99b, released 2024-04-12}
+% \date{Version 0.99d, released 2024-08-02}
% \maketitle
% \begin{implementation}
% \begin{macrocode}
%<@@=tag>
%<*header>
-\ProvidesExplPackage {tagpdf-tree-code} {2024-04-12} {0.99b}
+\ProvidesExplPackage {tagpdf-tree-code} {2024-08-02} {0.99d}
{part of tagpdf - code related to writing trees and dictionaries to the pdf}
%</header>
% \end{macrocode}
@@ -275,6 +275,10 @@
{
\l_@@_tmpa_tl
}
+% \end{macrocode}
+% Better put S back, see https://github.com/latex3/tagging-project/issues/86
+% \begin{macrocode}
+ \prop_gput:cnn { g_@@_struct_1_prop } {S}{ /StructTreeRoot }
}
% \end{macrocode}
% \end{macro}
@@ -506,7 +510,7 @@
{
\tl_clear:N \l_@@_tmpa_tl
% \end{macrocode}
-% We process the older sec for compability with the table code.
+% We process the older sec for compatibility with the table code.
% TODO: check if still needed
% \begin{macrocode}
\seq_map_inline:Nn \g_@@_attr_class_used_seq
diff --git a/Master/texmf-dist/source/latex/tagpdf/tagpdf-user.dtx b/Master/texmf-dist/source/latex/tagpdf/tagpdf-user.dtx
index 099cd95299f..a4014b62e39 100644
--- a/Master/texmf-dist/source/latex/tagpdf/tagpdf-user.dtx
+++ b/Master/texmf-dist/source/latex/tagpdf/tagpdf-user.dtx
@@ -46,7 +46,7 @@
% }^^A
% }
%
-% \date{Version 0.99b, released 2024-04-12}
+% \date{Version 0.99d, released 2024-08-02}
% \maketitle
% \begin{documentation}
% \section{Setup commands}
@@ -309,7 +309,7 @@
% \begin{macrocode}
%<@@=tag>
%<*header>
-\ProvidesExplPackage {tagpdf-user} {2024-04-12} {0.99b}
+\ProvidesExplPackage {tagpdf-user} {2024-08-02} {0.99d}
{tagpdf - user commands}
%</header>
% \end{macrocode}
@@ -848,7 +848,7 @@
}
% \end{macrocode}
% \end{macro}
-% TEMPORARLY FIX (2023-11-17). Until latex-lab is updated we must adapt a sec command:
+% TEMPORARY FIX (2023-11-17). Until latex-lab is updated we must adapt a sec command:
% \begin{macrocode}
\AddToHook{package/latex-lab-testphase-sec/after}
{
diff --git a/Master/texmf-dist/source/latex/tagpdf/tagpdf.dtx b/Master/texmf-dist/source/latex/tagpdf/tagpdf.dtx
index 064490c2c4d..b1d008a6e6c 100644
--- a/Master/texmf-dist/source/latex/tagpdf/tagpdf.dtx
+++ b/Master/texmf-dist/source/latex/tagpdf/tagpdf.dtx
@@ -72,6 +72,12 @@
% marked up as artifact. The initial value is true.
% \end{function}
%
+% \begin{function}{activate/softhyphen (setup-key)}
+% This key allows to activates automatic handling of hyphens inserted
+% by hyphenation. It only is used in luamode and replaces hyphens
+% by U+00AD if the font supports this.
+% \end{function}
+%
% \begin{function}{page/tabsorder (setup-key), tabsorder (deprecated)}
% This sets the tabsorder on a page. The values are |row|, |column|, |structure| (default)
% or |none|. Currently this is set more or less globally. More finer control can be
@@ -87,7 +93,7 @@
% \begin{macrocode}
%<@@=tag>
%<*package>
-\ProvidesExplPackage {tagpdf} {2024-04-12} {0.99b}
+\ProvidesExplPackage {tagpdf} {2024-08-02} {0.99d}
{ A package to experiment with pdf tagging }
\bool_if:nF
@@ -113,7 +119,7 @@
% \end{macrocode}
%<*debug>
% \begin{macrocode}
-\ProvidesExplPackage {tagpdf-debug} {2024-04-12} {0.99b}
+\ProvidesExplPackage {tagpdf-debug} {2024-08-02} {0.99d}
{ debug code for tagpdf }
\@ifpackageloaded{tagpdf}{}{\PackageWarning{tagpdf-debug}{tagpdf~not~loaded,~quitting}\endinput}
% \end{macrocode}
@@ -136,7 +142,7 @@
% we define a base package with dummy functions
% \begin{macrocode}
%<*base>
-\ProvidesExplPackage {tagpdf-base} {2024-04-12} {0.99b}
+\ProvidesExplPackage {tagpdf-base} {2024-08-02} {0.99d}
{part of tagpdf - provide base, no-op versions of the user commands }
%</base>
% \end{macrocode}
@@ -171,15 +177,16 @@
% possible, so we define a command which a special in the relevant backends:
% \begin{macrocode}
%<*base>
+\cs_new_protected:Npn \@@_whatsits: {}
\AddToHook{begindocument}
{
\str_case:VnF \c_sys_backend_str
{
- { luatex } { \cs_new_protected:Npn \@@_whatsits: {} }
- { dvisvgm } { \cs_new_protected:Npn \@@_whatsits: {} }
+ { luatex } { \cs_set_protected:Npn \@@_whatsits: {} }
+ { dvisvgm } { \cs_set_protected:Npn \@@_whatsits: {} }
}
{
- \cs_new_protected:Npn \@@_whatsits: {\tex_special:D {} }
+ \cs_set_protected:Npn \@@_whatsits: {\tex_special:D {} }
}
}
%</base>
@@ -353,6 +360,13 @@
% \end{macrocode}
% \end{variable}
%
+% \begin{variable}{\g_@@_softhyphen_bool}
+% This boolean controls if the code should try to automatically
+% handle hyphens from hyphenation. It is currently only used in luamode.
+% \begin{macrocode}
+\bool_new:N \g_@@_softhyphen_bool
+% \end{macrocode}
+% \end{variable}
% \section{Variants of l3 commands}
% \begin{macrocode}
\prg_generate_conditional_variant:Nnn \pdf_object_if_exist:n {e}{T,F,TF}
@@ -647,6 +661,13 @@
tagunmarked .bool_gset:N = \g_@@_tagunmarked_bool,
% \end{macrocode}
% \end{macro}
+% \begin{macro}{activate/softhyphen (setup-key)}
+% This key activates (in luamode) the handling of soft hyphens.
+% \begin{macrocode}
+ activate/softhyphen .bool_gset:N = \g_@@_softhyphen_bool,
+ activate/softhyphen .initial:n = true,
+% \end{macrocode}
+% \end{macro}
% \begin{macro}{page/tabsorder (setup-key),tabsorder (deprecated)}
% This sets the tabsorder on a page. The values are |row|, |column|, |structure| (default)
% or |none|. Currently this is set more or less globally. More finer control can be
diff --git a/Master/texmf-dist/source/latex/oberdiek/telprint.dtx b/Master/texmf-dist/source/latex/telprint/telprint.dtx
index 57152c66517..74bb22ea8af 100644
--- a/Master/texmf-dist/source/latex/oberdiek/telprint.dtx
+++ b/Master/texmf-dist/source/latex/telprint/telprint.dtx
@@ -1,13 +1,13 @@
% \iffalse meta-comment
%
% File: telprint.dtx
-% Version: 2016/05/16 v1.11
+% Version: 2024-07-26 v1.12
% Info: Format German phone numbers
%
% Copyright (C)
% 1996, 1997, 2004-2008 Heiko Oberdiek
-% 2016-2019 Oberdiek Package Support Group
-% https://github.com/ho-tex/oberdiek/issues
+% 2016-2024 Oberdiek Package Support Group
+% https://github.com/ho-tex/telprint/issues
%
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either
@@ -23,7 +23,7 @@
%
% The Current Maintainers of this work are
% Heiko Oberdiek and the Oberdiek Package Support Group
-% https://github.com/ho-tex/oberdiek/issues
+% https://github.com/ho-tex/telprint/issues
%
% The Base Interpreter refers to any `TeX-Format',
% because some files are installed in TDS:tex/generic//.
@@ -34,8 +34,8 @@
% telprint-test1.tex.
%
% Distribution:
-% CTAN:macros/latex/contrib/oberdiek/telprint.dtx
-% CTAN:macros/latex/contrib/oberdiek/telprint.pdf
+% CTAN:macros/latex/contrib/telprint/telprint.dtx
+% CTAN:macros/latex/contrib/telprint/telprint.pdf
%
% Unpacking:
% (a) If telprint.ins is present:
@@ -56,7 +56,7 @@
% use A4 as paper format:
% \PassOptionsToClass{a4paper}{article}
%
-% Programm calls to get the documentation (example):
+% Program calls to get the documentation (example):
% pdflatex telprint.dtx
% makeindex -s gind.ist telprint.idx
% pdflatex telprint.dtx
@@ -64,9 +64,9 @@
% pdflatex telprint.dtx
%
% Installation:
-% TDS:tex/generic/oberdiek/telprint.sty
-% TDS:doc/latex/oberdiek/telprint.pdf
-% TDS:source/latex/oberdiek/telprint.dtx
+% TDS:tex/generic/telprint/telprint.sty
+% TDS:doc/latex/telprint/telprint.pdf
+% TDS:source/latex/telprint/telprint.dtx
%
%<*ignore>
\begingroup
@@ -83,7 +83,7 @@
\input docstrip.tex
\Msg{************************************************************************}
\Msg{* Installation}
-\Msg{* Package: telprint 2016/05/16 v1.11 Format German phone numbers (HO)}
+\Msg{* Package: telprint 2024-07-26 v1.12 Format German phone numbers (HO)}
\Msg{************************************************************************}
\keepsilent
@@ -95,11 +95,11 @@
This is a generated file.
Project: telprint
-Version: 2016/05/16 v1.11
+Version: 2024-07-26 v1.12
Copyright (C)
1996, 1997, 2004-2008 Heiko Oberdiek
- 2016-2019 Oberdiek Package Support Group
+ 2016-2024 Oberdiek Package Support Group
This work may be distributed and/or modified under the
conditions of the LaTeX Project Public License, either
@@ -115,7 +115,7 @@ This work has the LPPL maintenance status "maintained".
The Current Maintainers of this work are
Heiko Oberdiek and the Oberdiek Package Support Group
-https://github.com/ho-tex/oberdiek/issues
+https://github.com/ho-tex/telprint/issues
The Base Interpreter refers to any `TeX-Format',
@@ -132,9 +132,9 @@ and the derived files
\generate{%
\file{telprint.ins}{\from{telprint.dtx}{install}}%
\file{telprint.drv}{\from{telprint.dtx}{driver}}%
- \usedir{tex/generic/oberdiek}%
+ \usedir{tex/generic/telprint}%
\file{telprint.sty}{\from{telprint.dtx}{package}}%
-% \usedir{doc/latex/oberdiek/test}%
+% \usedir{doc/latex/telprint/test}%
% \file{telprint-test1.tex}{\from{telprint.dtx}{test1}}%
}
@@ -162,7 +162,7 @@ and the derived files
%<*driver>
\NeedsTeXFormat{LaTeX2e}
\ProvidesFile{telprint.drv}%
- [2016/05/16 v1.11 Format German phone numbers (HO)]%
+ [2024-07-26 v1.12 Format German phone numbers (HO)]%
\documentclass{ltxdoc}
\usepackage{holtxdoc}[2011/11/22]
\usepackage[ngerman,english]{babel}
@@ -177,9 +177,9 @@ and the derived files
% \GetFileInfo{telprint.drv}
%
% \title{The \xpackage{telprint} package}
-% \date{2016/05/16 v1.11}
+% \date{2024-07-26 v1.12}
% \author{Heiko Oberdiek\thanks
-% {Please report any issues at \url{https://github.com/ho-tex/oberdiek/issues}}}
+% {Please report any issues at \url{https://github.com/ho-tex/telprint/issues}}}
%
% \maketitle
%
@@ -397,7 +397,7 @@ and the derived files
\fi
\expandafter\x\csname ver@telprint.sty\endcsname
\ProvidesPackage{telprint}%
- [2016/05/16 v1.11 Format German phone numbers (HO)]%
+ [2024-07-26 v1.12 Format German phone numbers (HO)]%
% \end{macrocode}
%
% \subsection{Catcodes}
@@ -467,7 +467,11 @@ and the derived files
% \begin{macro}{\telspace}
% \begin{macrocode}
\DeclareRobustCommand*{\telspace}[1]{\def\TELspace{#1}}
-\telspace{{}$\,${}}
+\ifcsname LaTeXReleaseInfo\endcsname
+ \telspace{\,}
+\else
+ \telspace{{}$\,${}}
+\fi
% \end{macrocode}
% \end{macro}
% \begin{macro}{\telhyphen}
@@ -615,30 +619,10 @@ and the derived files
% \paragraph{Package.} This package is available on
% CTAN\footnote{\CTANpkg{telprint}}:
% \begin{description}
-% \item[\CTAN{macros/latex/contrib/oberdiek/telprint.dtx}] The source file.
-% \item[\CTAN{macros/latex/contrib/oberdiek/telprint.pdf}] Documentation.
-% \end{description}
-%
-%
-% \paragraph{Bundle.} All the packages of the bundle `oberdiek'
-% are also available in a TDS compliant ZIP archive. There
-% the packages are already unpacked and the documentation files
-% are generated. The files and directories obey the TDS standard.
-% \begin{description}
-% \item[\CTANinstall{install/macros/latex/contrib/oberdiek.tds.zip}]
+% \item[\CTAN{macros/latex/contrib/telprint/telprint.dtx}] The source file.
+% \item[\CTAN{macros/latex/contrib/telprint/telprint.pdf}] Documentation.
% \end{description}
-% \emph{TDS} refers to the standard ``A Directory Structure
-% for \TeX\ Files'' (\CTANpkg{tds}). Directories
-% with \xfile{texmf} in their name are usually organized this way.
%
-% \subsection{Bundle installation}
-%
-% \paragraph{Unpacking.} Unpack the \xfile{oberdiek.tds.zip} in the
-% TDS tree (also known as \xfile{texmf} tree) of your choice.
-% Example (linux):
-% \begin{quote}
-% |unzip oberdiek.tds.zip -d ~/texmf|
-% \end{quote}
%
% \subsection{Package installation}
%
@@ -655,9 +639,9 @@ and the derived files
% \begin{quote}
% \def\t{^^A
% \begin{tabular}{@{}>{\ttfamily}l@{ $\rightarrow$ }>{\ttfamily}l@{}}
-% telprint.sty & tex/generic/oberdiek/telprint.sty\\
-% telprint.pdf & doc/latex/oberdiek/telprint.pdf\\
-% telprint.dtx & source/latex/oberdiek/telprint.dtx\\
+% telprint.sty & tex/generic/telprint/telprint.sty\\
+% telprint.pdf & doc/latex/telprint/telprint.pdf\\
+% telprint.dtx & source/latex/telprint/telprint.dtx\\
% \end{tabular}^^A
% }^^A
% \sbox0{\t}^^A
@@ -836,6 +820,9 @@ and the derived files
% \item
% Documentation updates.
% \end{Version}
+% \begin{Version}{2024-07-26 v1.12}
+% \item Avoid math in \cs{telspace} for better tagging support.
+% \end{Version}
% \end{History}
%
% \PrintIndex
diff --git a/Master/texmf-dist/source/latex/texvc/Makefile b/Master/texmf-dist/source/latex/texvc/Makefile
new file mode 100644
index 00000000000..d32d473d3bd
--- /dev/null
+++ b/Master/texmf-dist/source/latex/texvc/Makefile
@@ -0,0 +1,17 @@
+PACKAGE = texvc
+all: $(PACKAGE).pdf
+
+$(PACKAGE).sty: $(PACKAGE).dtx $(PACKAGE).ins
+ pdflatex $(PACKAGE).ins
+
+$(PACKAGE).idx: $(PACKAGE).dtx $(PACKAGE).sty
+ pdflatex $(PACKAGE).dtx
+
+$(PACKAGE).ind: $(PACKAGE).idx $(PACKAGE).sty
+ makeindex -s gind.ist $(PACKAGE).idx
+
+$(PACKAGE).gls: $(PACKAGE).idx $(PACKAGE).sty
+ makeindex -s gglo.ist -o $(PACKAGE).gls $(PACKAGE).glo
+
+$(PACKAGE).pdf: $(PACKAGE).dtx $(PACKAGE).sty $(PACKAGE).ind $(PACKAGE).gls
+ pdflatex $(PACKAGE).dtx
diff --git a/Master/texmf-dist/source/latex/texvc/texvc.dtx b/Master/texmf-dist/source/latex/texvc/texvc.dtx
index 429a1a5e6e1..7309d0266f7 100644
--- a/Master/texmf-dist/source/latex/texvc/texvc.dtx
+++ b/Master/texmf-dist/source/latex/texvc/texvc.dtx
@@ -1,6 +1,6 @@
% \iffalse meta-comment
%
-% Copyright (C) 2015 by Moritz Schubotz
+% Copyright (C) 2015-2018 by Moritz Schubotz
% -----------------------------------
%
% This file may be distributed and/or modified under the
@@ -22,7 +22,7 @@
%<package>\NeedsTeXFormat{LaTeX2e}[2005/12/01]
%<package>\ProvidesPackage{texvc}
%<*package>
-[2018/03/04 v1.1 Bugfixes]
+[2020/02/09 v1.2 Document deprecations]
%</package>
%<package>
%<package>\RequirePackage{amsmath}
@@ -42,7 +42,7 @@
%<package>
%<*driver>
\documentclass{ltxdoc}
-\usepackage{texvc}[2018/03/04]
+\usepackage{texvc}[2020/02/09]
\EnableCrossrefs
\CodelineIndex
\RecordChanges
@@ -75,19 +75,21 @@
%
% \changes{v1.0}{2015/11/09}{Initial version}
% \changes{v1.1}{2018/03/04}{Fix bug with varcoppa, document usage of or}
+% \changes{v1.2}{2020/02/09}{Document deprecations}
% \GetFileInfo{texvc.sty}
-%
+% \newcommand{\deprecated}{\emph{This command is deprecated.}}
% \DoNotIndex{\newcommand,\newenvironment}
%
% \title{The \textsf{texvc} package\thanks{This document
% corresponds to \textsf{texvc}~\fileversion,
% dated \filedate.}}
-% \author{Moritz Schubotz \\ \texttt{moritz.schubotz@uni-konstanz.de}}
-%
+% \author{Moritz Schubotz \\ \texttt{moritz.schubotz@fiz-karlsruhe.de}}
+% \date{\filedate}
+%
% \maketitle
%
% \begin{abstract}
-% This package provides all\footnote{The command \texttt{\textbackslash or} is only availible if custom code is copied into your \LaTeX-file. See page \pageref{cmd.or} for details.} LaTeX command availible in MediaWiki.
+% This package provides all\footnote{The command \texttt{\textbackslash or} is only available if custom code is copied into your \LaTeX-file. See page \pageref{cmd.or} for details.} LaTeX command available in MediaWiki.
% This includes several packages like amsmath, and adds some specific
% commands such as \texttt{\textbackslash Reals}.
% \end{abstract}
@@ -95,7 +97,7 @@
% \section{Provided Macros}
%
% \subsection{Arrows}
-% The first group of MediaWiki coustom command (other\_delimiters2) defines short hand notations for some arrorws.
+% The first group of MediaWiki custom command (other\_delimiters2) defines short hand notations for some arrows.
%
% \DescribeMacro{\darr} Short hand notation for arrow $\downarrow.$
%
@@ -122,12 +124,12 @@
%
% \subsection{Literals}
%
-% The second group of MediaWiki coustom commands (other\_litereals3) defines short hand notations for some literals.
+% The second group of MediaWiki custom commands (other\_litereals3) defines short hand notations for some literals.
%
-% \DescribeMacro{\C} Short hand notation for literal $\mathbb{C}.$
+% \DescribeMacro{\C} Short hand notation for literal $\mathbb{C}.$ \deprecated
%
%
-% \DescribeMacro{\H} Short hand notation for literal $\mathbb{H}.$
+% \DescribeMacro{\H} Short hand notation for literal $\mathbb{H}.$ \deprecated
%
%
% \DescribeMacro{\N} Short hand notation for literal $\mathbb{N}.$
@@ -151,10 +153,10 @@
% \DescribeMacro{\Alpha} Short hand notation for literal $\mathrm{A}.$
%
%
-% \DescribeMacro{\and} Short hand notation for literal $\land.$
+% \DescribeMacro{\and} Short hand notation for literal $\land.$ \deprecated
%
%
-% \DescribeMacro{\ang} Short hand notation for literal $\angle.$
+% \DescribeMacro{\ang} Short hand notation for literal $\angle.$ \deprecated
%
%
% \DescribeMacro{\Beta} Short hand notation for literal $\mathrm{B}.$
@@ -277,10 +279,10 @@
% \DescribeMacro{\Omicron} Short hand notation for literal $\mathrm{O}.$
%
%
-% \DescribeMacro{\or} Short hand notation for literal $\lor.$
+% \DescribeMacro{\or} Short hand notation for literal $\lor.$ \deprecated
%
%
-% \DescribeMacro{\part} Short hand notation for literal $\partial.$
+% \DescribeMacro{\part} Short hand notation for literal $\partial.$ \deprecated
%
%
% \DescribeMacro{\plusmn} Short hand notation for literal $\pm.$
@@ -342,7 +344,21 @@
%
% \DescribeMacro{\Zeta} Short hand notation for literal $\mathrm{Z}.$
%
-%
+% \section{Deprecations}
+% According to the decision of \emph{Wikimedia Community User Group Math}\footnote{\url{https://meta.wikimedia.org/w/index.php?oldid=19705444}} the following macros have been deprecated\footnote{See \url{https://phabricator.wikimedia.org/T197842} for the discussion.}:
+% \begin{enumerate}
+% \item \verb|$|
+% \item \verb|%|
+% \item \verb|\and|
+% \item \verb|\or|
+% \item \verb|\part|
+% \item \verb|\ang|
+% \item \verb|\C|
+% \item \verb|\H|
+% \item \verb|\bold|
+% \item \verb|\Bbb|
+% \end{enumerate}
+% The commands 1,2,4,9,10 have never been part of this package, but were available from within Wikipedia.
% \StopEventually{}
%
% \section{Implementation}
diff --git a/Master/texmf-dist/source/latex/texvc/texvc.ins b/Master/texmf-dist/source/latex/texvc/texvc.ins
index 5343a6a94fb..0c12dd61eb8 100644
--- a/Master/texmf-dist/source/latex/texvc/texvc.ins
+++ b/Master/texmf-dist/source/latex/texvc/texvc.ins
@@ -1,42 +1,42 @@
-%%
-%% Copyright (C) 2015 by Moritz Schubotz
-%%
-%% This file may be distributed and/or modified under the
-%% conditions of the LaTeX Project Public License, either
-%% version 1.3 of this license or (at your option) any later
-%% version. The latest version of this license is in:
-%%
-%% http://www.latex-project.org/lppl.txt
-%%
-%% and version 1.3 or later is part of all distributions of
-%% LaTeX version 2005/12/01 or later.
-%%
-\input docstrip.tex
-\keepsilent
-\usedir{tex/latex/texvc}
-\askforoverwritefalse
-\preamble
-This is a generated file.
-Copyright (C) 2015 by Moritz Schubotz
-This file may be distributed and/or modified under the
-conditions of the LaTeX Project Public License, either
-version 1.3 of this license or (at your option) any later
-version. The latest version of this license is in:
-http://www.latex-project.org/lppl.txt
-and version 1.3 or later is part of all distributions of
-LaTeX version 2005/12/01 or later.
-\endpreamble
-\generate{\file{texvc.sty}{\from{texvc.dtx}{package}}}
-\Msg{*********************************************************}
-\Msg{*}
-\Msg{* To finish the installation you have to move the}
-\Msg{* following file into a directory searched by TeX:}
-\Msg{*}
-\Msg{* \space\space texvc.sty}
-\Msg{*}
-\Msg{* To produce the documentation run the file texvc.dtx}
-\Msg{* through LaTeX.}
-\Msg{*}
-\Msg{* Happy TeXing!}
-\Msg{*********************************************************}
-\endbatchfile
+%%
+%% Copyright (C) 2015-2018 by Moritz Schubotz
+%%
+%% This file may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either
+%% version 1.3 of this license or (at your option) any later
+%% version. The latest version of this license is in:
+%%
+%% http://www.latex-project.org/lppl.txt
+%%
+%% and version 1.3 or later is part of all distributions of
+%% LaTeX version 2005/12/01 or later.
+%%
+\input docstrip.tex
+\keepsilent
+\usedir{tex/latex/texvc}
+\askforoverwritefalse
+\preamble
+This is a generated file.
+Copyright (C) 2015-2018 by Moritz Schubotz
+This file may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either
+version 1.3 of this license or (at your option) any later
+version. The latest version of this license is in:
+http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of
+LaTeX version 2005/12/01 or later.
+\endpreamble
+\generate{\file{texvc.sty}{\from{texvc.dtx}{package}}}
+\Msg{*********************************************************}
+\Msg{*}
+\Msg{* To finish the installation you have to move the}
+\Msg{* following file into a directory searched by TeX:}
+\Msg{*}
+\Msg{* \space\space texvc.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the file texvc.dtx}
+\Msg{* through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing!}
+\Msg{*********************************************************}
+\endbatchfile
diff --git a/Master/texmf-dist/source/latex/thuthesis/thuthesis.dtx b/Master/texmf-dist/source/latex/thuthesis/thuthesis.dtx
index ea4ac03f229..e6f3e46ad82 100644
--- a/Master/texmf-dist/source/latex/thuthesis/thuthesis.dtx
+++ b/Master/texmf-dist/source/latex/thuthesis/thuthesis.dtx
@@ -14,7 +14,7 @@
%
% \iffalse
%<*driver>
-\ProvidesFile{thuthesis.dtx}[2024/05/20 7.5.1 Tsinghua University Thesis Template]
+\ProvidesFile{thuthesis.dtx}[2024/07/01 7.5.2 Tsinghua University Thesis Template]
\documentclass{ltxdoc}
\usepackage{dtx-style}
@@ -251,7 +251,7 @@
% $ bibtex thuthesis-example.aux # ç”Ÿæˆ bbl 文件
% $ bibtex thuthesis-example-appendix-a.aux # 附录 A çš„çš„å‚考文献
% $ bibtex thuthesis-example-appendix-b.aux # 附录 B çš„çš„å‚考文献……
-% $ bibtex thuthesis-example-index.aux # 本科生的书é¢ç¿»è¯‘对应的原文索引
+% $ bibtex thuthesis-example-index-1.aux # 本科生的书é¢ç¿»è¯‘对应的原文索引
% $ xelatex thuthesis-example.tex # 解决引用
% $ xelatex thuthesis-example.tex # 生æˆè®ºæ–‡ PDF
%
@@ -813,7 +813,7 @@
% }
% \end{latex}
%
-% 用户也å¯ä»¥é€é¡¹ä¿®æ”¹æ•°å­¦æ ·å¼ã€‚
+% 用户也å¯ä»¥é€é¡¹ä¿®æ”¹æ•°å­¦æ ·å¼ï¼ŒåŒ…括:
% \newcommand\dif{\mathop{}\!\mathrm{d}}
% \begin{enumerate}
% \item \DescribeOption{uppercase-greek}
@@ -885,12 +885,16 @@
% 模æ¿ä½œäº†å¤„ç†ï¼Œç”¨æˆ·å¯ä»¥ç›´æŽ¥ä½¿ç”¨è¿™äº›å®åŒ…的命令,如 \cs{bm}ã€\cs{mathscr}ã€
% \cs{uppi}。
%
-% å¦å¤–,模æ¿è¿˜ä¸º `math-font` æ供了传统的 Type 1 字体 \option{newtx}。
+% å¦å¤–,模æ¿è¿˜ä¸º |math-font| æ供了传统的 Type 1 字体 \option{newtx}。
% 该选项会调用 \pkg{newtxmath} å®åŒ…。
% 但是,如果西文字体已ç»ä½¿ç”¨äº† OpenType çš„ Times New Roman,
% 混用 Type 1 字体å¯èƒ½ä¼šå¯¼è‡´é—®é¢˜ï¼Œå°¤å…¶æ˜¯ä½¿ç”¨ \pkg{siunitx} å®åŒ…时。
% 该选项还处于测试阶段,需è¦è°¨æ…Žä½¿ç”¨ã€‚
%
+% \DescribeOption{eqn-paren-style}
+% 控制中文论文中,数学公å¼ç¼–å·ä¸¤è¾¹çš„括å·æ ·å¼ã€‚å¯é€‰é¡¹åŒ…括:\option{full}(全角,默认) / \option{half}(åŠè§’)。
+% 在语言为英语(|language = english|)时,此选项无效,仅使用åŠè§’括å·ã€‚
+%
% \subsubsection{定ç†çŽ¯å¢ƒ}
% \label{sec:theorem}
% \thuthesis{} 定义了常用的数学环境:
@@ -1269,7 +1273,7 @@
% \begin{macrocode}
%<cls>\NeedsTeXFormat{LaTeX2e}[2017/04/15]
%<cls>\ProvidesClass{thuthesis}
-%<cls>[2024/05/20 7.5.1 Tsinghua University Thesis Template]
+%<cls>[2024/07/01 7.5.2 Tsinghua University Thesis Template]
% \end{macrocode}
%
% 报错
@@ -1330,7 +1334,7 @@
%<*cls>
\hyphenation{Thu-Thesis}
\def\thuthesis{ThuThesis}
-\def\version{7.5.1}
+\def\version{7.5.2}
\RequirePackage{kvdefinekeys}
\RequirePackage{kvsetkeys}
\RequirePackage{kvoptions}
@@ -1658,6 +1662,17 @@
},
default = print,
},
+% \end{macrocode}
+%
+% 数学公å¼ç¼–å·çš„括å·ä½¿ç”¨å…¨è§’还是åŠè§’。
+% \begin{macrocode}
+ eqn-paren-style = {
+ name = eqn@paren@style,
+ choices = {
+ full,
+ half,
+ }
+ },
}
\newif\ifthu@degree@graduate
\newcommand\thu@set@graduate{%
@@ -3511,10 +3526,23 @@
% 中文模æ¿çš„å…¬å¼ç¼–å·ä½¿ç”¨ä¸­æ–‡æ‹¬å·ã€‚需è¦ä¿®æ”¹ \pkg{amsmath} çš„ \cs{tagform@}。
% 这里中文的 \cs{unskip} 是为了“|å¼~\eqref|â€è¿™æ ·çš„写法ä¸äº§ç”Ÿé¢å¤–的空格。
% \begin{macrocode}
+\newcommand\thu@eqn@left@paren{(}
+\newcommand\thu@eqn@right@paren{)}
+\newcommand\thu@set@eqn@paren@style{%
+ \ifthu@eqn@paren@style@full
+ \renewcommand\thu@eqn@left@paren{(}%
+ \renewcommand\thu@eqn@right@paren{)}%
+ \else
+ \renewcommand\thu@eqn@left@paren{(}%
+ \renewcommand\thu@eqn@right@paren{)}%
+ \fi
+}
+\thu@set@eqn@paren@style
+\thu@option@hook{eqn-paren-style}{\thu@set@eqn@paren@style}
\newcommand\thu@put@parentheses[1]{%
\ifthu@language@chinese
\unskip
- (#1)%
+ \thu@eqn@left@paren#1\thu@eqn@right@paren
\else
(#1)%
\fi
@@ -6347,9 +6375,11 @@
% \begin{macrocode}
\newenvironment{translation-index}{}{}
\AtEndOfPackageFile*{bibunits}{
+ \newcounter{thu@translation@index}%
\renewenvironment{translation-index}{%
+ \global\advance\c@thu@translation@index\@ne
\begin{bibunit}%
- \renewcommand\@bibunitname{\jobname-index}%
+ \renewcommand\@bibunitname{\jobname-index-\arabic{thu@translation@index}}%
\renewcommand\bibname{书é¢ç¿»è¯‘对应的原文索引}%
\thu@set@survey@bibheading
}{%
diff --git a/Master/texmf-dist/source/latex/typog/Makefile b/Master/texmf-dist/source/latex/typog/Makefile
index bb3c83ab24b..1b7e0b21a39 100644
--- a/Master/texmf-dist/source/latex/typog/Makefile
+++ b/Master/texmf-dist/source/latex/typog/Makefile
@@ -7,8 +7,9 @@
SHELL := /bin/sh
-LATEX := /usr/bin/env max_print_line=2147483647 pdflatex
-LATEX_FLAGS := -file-line-error -halt-on-error -interaction=nonstopmode
+LATEX_PROPER := pdflatex
+LATEX := /usr/bin/env max_print_line=2147483647 $(LATEX_PROPER)
+LATEX_FLAGS := -file-line-error -halt-on-error -interaction=nonstopmode -output-directory=.
LATEX_RERUN_TRIGGER := '^Package rerunfilecheck Warning: File [^ ]* has changed'
LATEX_WARNING := '^LaTeX (|[A-Za-z0-9_]* )Warning:'
@@ -16,6 +17,10 @@ MAKEINDEX := makeindex
MAKEINDEX_FLAGS := -q
+MAKEINFO := makeinfo
+MAKEINFO_FLAGS := --no-split
+
+
METAPOST := mpost
METAPOST_FLAGS := -file-line-error -interaction=nonstopmode -tex=latex
@@ -24,8 +29,12 @@ PODCHECKER := podchecker
PODCHECKER_FLAGS := -warnings
+define SED_VERSION_REGEXP
+^\( *\|\\ProvidesPackage{[^}]*} *\)\[\([0-9][0-9]*/[0-9][0-9]*/[0-9][0-9]*\) *v\([^ ]*\) *\([^]]*\)].*$$
+endef
+
POD2MAN := pod2man
-POD2MAN_FLAGS := $$(sed -ne 's,\\ProvidesPackage{typog}\[\([0-9][0-9]*/[0-9][0-9]*/[0-9][0-9]*\) *v\([^ ]*\) .*$$,--date=\1 --release=\2,p' < typog.sty)
+POD2MAN_FLAGS := $$(sed -ne 's,$(SED_VERSION_REGEXP),--date=\2 --release=\3,p' < typog.sty)
POD2TEXI := pod2texi
@@ -33,31 +42,32 @@ POD2TEXI_FLAGS :=
GROFF := groff
-## Codes of serif fonts that work for PDF output
+## Codes of fonts that work for PDF output as by the contents
+## of "/usr/share/groff/current/font/devpdf".
+##
+## Serif
## BM: URW Bookman L
## N: URW Century Schoolbook L
## P: URW Palladio L
## T: URW Nimbus Roman No9 L
+##
+## Sans Serif
+## A: Avantgarde
+## H: Helvetica
+##
+## Monospace
+## C: Courier
GROFF_FLAGS := -Tpdf -dpaper=a4 -fP -man -wall
-SPELLCHECK := aspell
-SPELLCHECK_FLAGS := \
- --add-tex-command='citenum p' --add-tex-command='code p' \
- --add-tex-command='Cref p' --add-tex-command='cref p' \
- --add-tex-command='cs p' \
- --add-tex-command='DescribeEnv p' --add-tex-command='DescribeMacro p' \
- --add-tex-command='marg p' --add-tex-command='meta p' \
- --add-tex-command='oarg p' \
- --lang=en_US --mode=tex
-
-
-SOURCE_FILES := LICENSE Makefile typog.dtx typog.ins
+PROJECT_NAME := typog
+SOURCE_FILES := LICENSE Makefile README.md typog.dtx typog.ins
+DOCUMENTATION_FILES := typog-example.pdf typog-grep.1.pdf typog.pdf
.PHONY: all
-all: sty pdf man
+all: sty pdf bin man
.PHONY: sty
@@ -65,7 +75,7 @@ sty: typog.sty
.PHONY: pdf
-pdf: doc ex nomt
+pdf: doc ex test
.PHONY: doc
@@ -76,69 +86,88 @@ doc: typog.pdf
ex: typog-example.pdf
-.PHONY: nomt
-nomt: typog-nomt.pdf
+.PHONY: test
+test: typog-minimal-test.pdf typog-without-microtype-test.pdf
+
+
+.PHONY: bin
+bin: typog-grep
.PHONY: man
man: typog-grep.1
-.PHONY: cpio
-cpio:
- cd ..; \
- echo $(addprefix typog/,$(SOURCE_FILES)) | \
- cpio -o | \
- gzip > "typog-$$(date +%Y-%m-%d).cpio.gz"
+export TEMPORARY_DIRECTORY
+
+
+.PHONY: dist
+dist:
+ $(eval TEMPORARY_DIRECTORY := $(shell mktemp -d))
+ trap '$(RM) -r $(TEMPORARY_DIRECTORY); exit 1' HUP INT QUIT TERM; $(MAKE) __dist
+ $(RM) -r $(TEMPORARY_DIRECTORY)
+
+
+.PHONY: __dist
+__dist: LATEX_FLAGS += -interaction=batchmode
+__dist: $(DOCUMENTATION_FILES)
+ test -d '$(TEMPORARY_DIRECTORY)'
+ test -w '$(TEMPORARY_DIRECTORY)'
+ mkdir $(TEMPORARY_DIRECTORY)/$(PROJECT_NAME)
+ cp $(SOURCE_FILES) $(TEMPORARY_DIRECTORY)/$(PROJECT_NAME)
+ mkdir $(TEMPORARY_DIRECTORY)/$(PROJECT_NAME)/docs
+ cp $(DOCUMENTATION_FILES) $(TEMPORARY_DIRECTORY)/$(PROJECT_NAME)/docs
+ tar czf $(PROJECT_NAME).tar.gz -C $(TEMPORARY_DIRECTORY) $(PROJECT_NAME)
-.PHONY: tar
-tar:
- cd ..; \
- tar czf "typog-$$(date +%Y-%m-%d).tar.gz" $(addprefix typog/,$(SOURCE_FILES))
+.PHONY: distcheck
+distcheck: LATEX_FLAGS += -interaction=batchmode
+distcheck: dist
+ $(eval TEMPORARY_DIRECTORY := $(shell mktemp -d))
+ test -d '$(TEMPORARY_DIRECTORY)'
+ test -w '$(TEMPORARY_DIRECTORY)'
+ tar xzf $(PROJECT_NAME).tar.gz -C $(TEMPORARY_DIRECTORY)
+ $(MAKE) --directory=$(TEMPORARY_DIRECTORY)/$(PROJECT_NAME) LATEX_FLAGS='$(LATEX_FLAGS)' all
+ $(RM) -r $(TEMPORARY_DIRECTORY)
+ @printf '\n\ndistcheck passed.\n'
.PHONY: clean
clean:
- $(RM) ./*.1 ./*.aux ./*.brf ./*.glg ./*.glo ./*.gls
- $(RM) ./*.hd ./*.idx ./*.ilg ./*.ind ./*.loe ./*.lof ./*.log ./*.lot
- $(RM) ./*.mps ./*.mpx ./*.out ./*.pdf ./*.toc
+ $(RM) ./*.1 ./*.aux ./*.brf ./*.dvi ./*.glg ./*.glo ./*.gls
+ $(RM) ./*.hd ./*.idx ./*.ilg ./*.ind ./*.info ./*.loe ./*.lof ./*.log ./*.lot
+ $(RM) ./*.mps ./*.mpx ./*.out ./*.pdf ./*.pl.in ./*.toc
$(RM) mptextmp.* mpxerr.tex
$(RM) README README.html RELEASE-HOWTO RELEASE-HOWTO.html
+ $(RM) typog-grep typog-grep.version.sed
+ $(RM) $(PROJECT_NAME).tar.gz
.PHONY: mostlyclean
mostlyclean: clean
+ $(RM) ./*.texi
.PHONY: maintainer-clean
maintainer-clean: mostlyclean
- $(RM) ./*.ist ./*.mp ./*.pl ./*.pod ./*.sed ./*.sty ./*.tex
+ $(RM) ./*.gst ./*.ist ./*.mp ./*.pl ./*.pod ./*.sed ./*.sty ./*.tex
.PHONY: tool-check
tool-check:
- @printf '*** LATEX = "%s"\n' '$(LATEX)'
- $(LATEX) --version
+ @printf '*** LATEX_PROPER = "%s"\n' '$(LATEX_PROPER)'
+ $(LATEX_PROPER) --version
+ @printf '\n\n*** BibTeX\n'
+ bibtex --version
@printf '\n\n*** MAKEINDEX = "%s"\n' '$(MAKEINDEX)'
- $(MAKEINDEX) < /dev/null
+ $(MAKEINDEX) < /dev/null
@printf '\n\n*** METAPOST = "%s"\n' '$(METAPOST)'
$(METAPOST) --version
@printf '\n*** POD2MAN = "%s"\n' '$(POD2MAN)'
$(POD2MAN) --help > /dev/null
@printf '\n\n*** POD2TEXI = "%s"\n' '$(POD2TEXI)'
$(POD2TEXI) --version
- @printf '\n\nTool check passed.\n'
-
-
-.PHONY: spell-check
-spell-check:
- @sed -e '\#<DISABLE-SPELL-CHECK/>#d' \
- -e '\#<DISABLE-SPELL-CHECK>#,\#</DISABLE-SPELL-CHECK>#d' < typog.dtx | \
- sed -e 's/^ *%%*//' | \
- sed -e 's/\\-//g' -e 's/|[^|]*|/ /g' | \
- $(SPELLCHECK) $(SPELLCHECK_FLAGS) list | \
- sort | uniq | fmt | sed -e 's/ / /g'
+ @printf '\n\ntool check passed.\n'
.PHONY: update-docs
@@ -151,10 +180,16 @@ Selected Phony Targets
----------------------
all: Make everything there is to make. This is the .DEFAULT_GOAL.
+bin: Build typog-grep (which is not a binary, but executable).
+
clean: Remove some products.
-cpio: In the parent directory create a cpio(1) archive of the
- project source files whose name is time-stamped.
+dist: Create a tar file of the project source files and the PDF
+ documentation files. The archive is in the form and has a
+ name that CTAN prefers.
+
+distcheck: Create a tar file of the project source files, unpack it in
+ a different location and build all targets.
doc: Build "typog.pdf" the Typog documentation.
@@ -170,12 +205,14 @@ pdf: Build doc: and gauge:.
sty: Only extract "typog.sty" from "typog.dtx". This
operation requires LaTeX (-> $(LATEX)) and nothing else.
-tar: In the parent directory create a tar(1) file of the project
- source files whose name is time-stamped.
+test: Run some tests.
tool-check: Check whether some of the required tools to build the
project are available.
+update-docs: Copy the documentation files into the "docs"
+ sub-directory.
+
Selected Implicit Rules
-----------------------
@@ -206,6 +243,7 @@ README: Convert "README.html" to plain text. Requires w3m(1).
endef
+
.PHONY: help
help:
$(info $(HELP_SCREEN))
@@ -217,10 +255,10 @@ help:
define MAKE_INDEX_AND_GLOSSARY
-sed -e '/@/d' -e 's/{\\ttfamily /{\\ttfamily\\hskip0pt\\relax /' < $*.idx > ,$*.idx; \
+sed -e '/@/d' -e 's/{\\ttfamily /{\\ttfamily\\hskip0pt\\relax /' < $*.idx > ,$*.idx; \
mv ,$*.idx $*.idx; \
-$(MAKEINDEX) $(MAKEINDEX_FLAGS) -s typog.ist -t $*.ilg -o $*.ind $*.idx; \
-$(MAKEINDEX) $(MAKEINDEX_FLAGS) -s gglo.ist -t $*.glg -o $*.gls $*.glo
+$(MAKEINDEX) $(MAKEINDEX_FLAGS) -s $*.ist -t $*.ilg -o $*.ind $*.idx; \
+$(MAKEINDEX) $(MAKEINDEX_FLAGS) -s $*.gst -t $*.glg -o $*.gls $*.glo
endef
define GREP_LATEX_WARNINGS
@@ -253,7 +291,13 @@ endef
%-1.mps %-2.mps %-3.mps %-4.mps: %.mp
- $(METAPOST) -s 'outputtemplate="%j-%c.mps"' $(METAPOST_FLAGS) $<
+ $(METAPOST) -s 'outputtemplate="%j-%c.mps"' $(METAPOST_FLAGS) $< || { \
+ printf '=== $*.log ===\n'; \
+ cat $*.log; \
+ printf '\n\n=== mpxerr.log ===\n'; \
+ cat mpxerr.log; \
+ false; \
+ } 1>&2
%.1: %.pod
@@ -263,6 +307,15 @@ endef
%.1.pdf: %.1
$(GROFF) $(GROFF_FLAGS) ./$< > $@
+%.texi: %.pod
+ $(POD2TEXI) $(POD2TEXI_FLAGS) --output=$@ ./$<
+
+%.info: %.texi
+ $(MAKEINFO) $(MAKEINFO_FLAGS) --output=$@ $<
+
+%.info.pdf: %.texi
+ $(MAKEINFO) $(MAKEINFO_FLAGS) --pdf --output=$@ $<
+
%.tex: %.pod | teximan2latex.sed
$(POD2TEXI) $(POD2TEXI_FLAGS) ./$< | sed -f teximan2latex.sed > $@
@@ -276,12 +329,11 @@ endef
crooked-paragraphs.mp slant-angle.mp smooth-parshapes.mp title.mp \
teximan2latex.sed \
-typog-grep.pl typog-grep typog-grep.pod \
-typog.sty typog.ist typog-example.tex typog-nomt.tex: \
+typog-grep.pl.in typog-grep.pod \
+typog.sty typog.ist typog-example.tex \
+typog-minimal-test.tex typog-without-microtype-test.tex: \
typog.ins typog.dtx
$(LATEX) $(LATEX_FLAGS) $<
- chmod 755 typog-grep.pl
- ln -sf typog-grep.pl typog-grep
crooked-paragraphs-1.mps crooked-paragraphs-2.mps \
@@ -300,3 +352,14 @@ typog.pdf: typog.dtx \
smooth-parshapes-1.mps smooth-parshapes-2.mps smooth-parshapes-3.mps \
typog-grep.tex \
| typog.sty
+
+
+typog-grep.pl: typog-grep.pl.in typog.sty
+ sed -ne 's,$(SED_VERSION_REGEXP),s#@DATE@#\2#g\ns#@RELEASE@#\3#g\ns#@TITLE@#\4#g,p' \
+ < typog.sty \
+ > typog-grep.version.sed
+ sed -f typog-grep.version.sed < $< > $@
+ chmod 755 $@
+
+typog-grep: typog-grep.pl
+ ln -sf $< $@
diff --git a/Master/texmf-dist/source/latex/typog/typog.dtx b/Master/texmf-dist/source/latex/typog/typog.dtx
index 0f2176206a2..3037f502fad 100644
--- a/Master/texmf-dist/source/latex/typog/typog.dtx
+++ b/Master/texmf-dist/source/latex/typog/typog.dtx
@@ -3,11 +3,11 @@
% Copyright (C) 2024 by Ch. L. Spiel
%
% This work may be distributed and/or modified under the conditions
-% of the LaTeX Project Public License, either version 1.3 of this
+% 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
-% http://www.latex-project.org/lppl.txt
-% and version 1.3 or later is part of all distributions of LaTeX
+% https://www.latex-project.org/lppl.txt
+% and version 1.3c or later is part of all distributions of LaTeX
% version 2003/12/01 or later.
%
% \fi
@@ -26,7 +26,6 @@
\PassOptionsToClass{a4paper}{article}
\PassOptionsToPackage{hyperfootnotes=false}{hyperref}
-\PassOptionsToPackage{charter, scale=1.06}{newtxmath}
\PassOptionsToPackage{dvipsnames}{xcolor}
\usepackage{amsmath}
@@ -42,40 +41,43 @@
\usepackage{fullwidth}
\usepackage{hypdoc}
\usepackage{hyphenat}
-\usepackage[shrink=10, stretch=10]{microtype}
+\usepackage[kerning=true, shrink=10, stretch=10, verbose=true]{microtype}
\usepackage{multirow}
\usepackage{needspace}
-\usepackage{placeins}
+\usepackage[section]{placeins}
\usepackage{ragged2e}
\usepackage{setspace}
\usepackage{sidecap}
\usepackage{tabularx}
\usepackage{tcolorbox}
\usepackage{titlesec}\renewcommand*{\bottomtitlespace}{.15\textheight}%nobottomtitles*
-\usepackage[debug, raise*=.05em]{typog}
+\usepackage[debug, raise*=.05em,
+ uppercaselabelitemadjustments={.0125em, .075em, -.1em, .0125em},
+ lowercaselabelitemadjustments={-.075em, 0pt, -.2em, -.075em}]{typog}
\usepackage{xcolor}
\usepackage[default, lining, proportional, regular, semibold]{sourceserifpro}
\usepackage[lining, proportional, regular, semibold]{sourcesanspro}
\usepackage[lining, regular]{sourcecodepro}
-\usepackage[xcharter]{newtxmath}
+\usepackage[scaled=1.08, uprightscript, xcharter]{newtxmath}
\setbaselineskip{12.5pt}
+
\makeatletter
\def\@get@fontclan#1-#2\relax{#1}
\newcommand*{\fontclan}{\expandafter\@get@fontclan\f@family\relax}
\makeatother
-\newcommand*{\proportionalliningfigures}{\fontfamily{\fontclan-LF}\selectfont}
-\newcommand*{\proportionaloldstylefigures}{\fontfamily{\fontclan-OsF}\selectfont}
-\newcommand*{\tabularliningfigures}{\fontfamily{\fontclan-TLF}\selectfont}
-\newcommand*{\tabularoldstylefigures}{\fontfamily{\fontclan-TOsF}\selectfont}
+\DeclareRobustCommand{\proportionalliningfigures}{\fontfamily{\fontclan-LF}\selectfont}
+\DeclareRobustCommand{\proportionaloldstylefigures}{\fontfamily{\fontclan-OsF}\selectfont}
+\DeclareRobustCommand{\tabularliningfigures}{\fontfamily{\fontclan-TLF}\selectfont}
+\DeclareRobustCommand{\tabularoldstylefigures}{\fontfamily{\fontclan-TOsF}\selectfont}
-\newcommand*{\textdenominator}[1]{{\fontfamily{\fontclan-Dnom}\selectfont #1}}
-\newcommand*{\textinferior}[1]{{\fontfamily{\fontclan-Inf}\selectfont #1}}
-\newcommand*{\textnumerator}[1]{{\fontfamily{\fontclan-Numr}\selectfont #1}}
-\newcommand*{\textsuperior}[1]{{\fontfamily{\fontclan-Sup}\selectfont #1}}
+\DeclareRobustCommand{\textdenominator}[1]{{\fontfamily{\fontclan-Dnom}\selectfont #1}}
+\DeclareRobustCommand{\textinferior}[1]{{\fontfamily{\fontclan-Inf}\selectfont #1}}
+\DeclareRobustCommand{\textnumerator}[1]{{\fontfamily{\fontclan-Numr}\selectfont #1}}
+\DeclareRobustCommand{\textsuperior}[1]{{\fontfamily{\fontclan-Sup}\selectfont #1}}
\newcommand*{\nativetextfraction}[2]
{\mbox{\textnumerator{#1}\textfractionsolidus\textdenominator{#2}}}
@@ -85,21 +87,23 @@
\newenvironment*{tabfigures}
{\edef\rmdefault{\fontclan-T\sourceserifpro@figurestyle}\rm\ignorespaces}
{\ignorespacesafterend}
-
-\newcommand*{\elseries}{\def\mdseries@rm{el}\def\mdseries@sf{el}\def\mdseries@tt{el}}
-\newcommand*{\textel}[1]{{\elseries\textmd{#1}}}
-\newcommand*{\lseries}{\def\mdseries@rm{l}\def\mdseries@sf{l}\def\mdseries@tt{l}}
-\newcommand*{\textl}[1]{{\lseries\textmd{#1}}}
-%%--\newcommand*{\mdseries}{\def\mdseries@rm{m}\def\mdseries@sf{m}\def\mdseries@tt{m}}
-%%--\newcommand*{\textmd}[1]{{\mdseries\textmd{#1}}}
-\newcommand*{\sbseries}{\def\bfseries@rm{sb}\def\bfseries@sf{sb}\def\bfseries@tt{sb}}
-\newcommand*{\textsb}[1]{{\sbseries\textbf{#1}}}
-\newcommand*{\bseries}{\def\bfseries@rm{b}\def\bfseries@sf{b}\def\bfseries@tt{b}}
-\newcommand*{\textb}[1]{{\bseries\textbf{#1}}}
-\newcommand*{\ebseries}{\def\bfseries@rm{k}\def\bfseries@sf{eb}\def\bfseries@tt{k}}
-\newcommand*{\texteb}[1]{{\ebseries\textbf{#1}}}
\makeatother
+\DeclareRobustCommand{\elseries}{\fontseries{el}\selectfont}
+\DeclareTextFontCommand{\textel}{\elseries}
+\DeclareRobustCommand{\lseries}{\fontseries{l}\selectfont}
+\DeclareTextFontCommand{\textl}{\lseries}
+%%--\DeclareRobustCommand{\mdseries}{\fontseries{m}\selectfont}
+%%--\DeclareTextFontCommand{\textmd}{\mdseries}
+\DeclareRobustCommand{\sbseries}{\fontseries{sb}\selectfont}
+\DeclareTextFontCommand{\textsb}{\sbseries}
+\DeclareRobustCommand{\bseries}{\fontseries{b}\selectfont}
+\DeclareTextFontCommand{\textb}{\bseries}
+\DeclareRobustCommand{\ebseries}{\fontseries{eb}\selectfont}
+\DeclareTextFontCommand{\texteb}{\ebseries}
+\DeclareRobustCommand{\ubseries}{\fontseries{k}\selectfont}
+\DeclareTextFontCommand{\textub}{\ubseries}
+
\usepackage{cleveref}
@@ -112,7 +116,7 @@
citecolor = blue,
colorlinks = true,
linkcolor = blue,
- linktocpage = false,
+ linktocpage = true,
pdfauthor={Dr. Christoph L. Spiel},
pdfcreationdate={\pdffiledate},
pdfkeywords={LaTeX, typography, ligature, italic-correction, paragraph justification, baselineskip, sloppy, ragged},
@@ -124,9 +128,94 @@
}
+\SetExtraKerning[context=drop-left-sidebearing, name=source-code-normal, unit=space]
+ {font={T1/SourceCodePro-LF/m/n/44, T1/SourceCodePro-TLF/m/n/44}}
+ {
+ 1={-150,},
+ 2={-120,},
+ 3={-120,},
+ 4={-40,},
+ A={-100,},
+ B={-170,}
+ }
+
+\newlength{\sectiontocindent}
+\newlength{\sectionnumberwidth}
+\newlength{\subsectiontocindent}
+\newlength{\subsectionnumberwidth}
+\newlength{\subsubsectiontocindent}
+\newlength{\subsubsectionnumberwidth}
+
+\setlength{\sectiontocindent}{0pt}
+\setlength{\sectionnumberwidth}{40pt}
+\setlength{\subsectiontocindent}{40pt}
+\setlength{\subsectionnumberwidth}{25pt}
+\setlength{\subsubsectiontocindent}{65pt}
+\setlength{\subsubsectionnumberwidth}{30pt}
+
\makeatletter
-\renewcommand*{\@dotsep}{10000} % suppress leaders
-\patchcmd{\@dottedtocline}{\normalfont}{\bfseries}{\relax}{\PatchingFailed}
+\renewcommand*{\l@section}[2]
+ {\ifnum \c@tocdepth >\z@
+ \addpenalty\@secpenalty
+ \addvspace{1.0em \@plus\p@}%
+ \setlength{\@tempdima}{\sectionnumberwidth}%
+ \begingroup
+ \def\numberline##1{\hb@xt@\@tempdima{%
+ \tt\lseries
+ \fontsize{44}{0}\selectfont
+ \microtypecontext{kerning=drop-left-sidebearing}%
+ \iffalse\raisebox{-30pt}[0pt][0pt]{\rule{0.1pt}{40pt}}\fi
+ \textcolor{customred3}{##1}%
+ \hfil}}%
+ \parindent \z@
+ \rightskip \@pnumwidth
+ \parfillskip -\@pnumwidth
+ \leavevmode
+ \advance\leftskip\@tempdima
+ \hskip -\leftskip
+ \bfseries
+ \iffalse
+ \nobreak\hfil
+ \nobreak\hb@xt@\@pnumwidth{\hss #2\kern-\p@\kern\p@}%
+ \else
+ {\sffamily\large #1}\quad
+ {#2}\hfil\hbox{}
+ \fi
+ \par
+ \endgroup
+ \fi}
+
+\renewcommand*{\@dottedtocline}[5]
+ {\ifnum #1>\c@tocdepth
+ \else
+ \vskip \z@ \@plus.2\p@
+ \begingroup
+ \leftskip #2\relax
+ \rightskip \@tocrmarg
+ \parfillskip -\rightskip
+ \parindent #2\relax\@afterindenttrue
+ \interlinepenalty\@M
+ \leavevmode
+ \@tempdima #3\relax
+ \advance\leftskip \@tempdima
+ \null\nobreak
+ \hskip -\leftskip
+ {#4}\nobreak
+ \iffalse
+ \leaders\hbox{$\m@th \mkern \@dotsep mu\hbox{.}\mkern \@dotsep mu$}\hfill
+ \nobreak\hb@xt@\@pnumwidth{\hfil\normalfont \normalcolor #5\kern-\p@\kern\p@}%
+ \else
+ \hbox{\quad\normalfont\bfseries #5}\nobreak\hfill\hbox{}%
+ \fi
+ \par
+ \endgroup
+ \fi}
+
+\renewcommand*{\l@subsection}{\@dottedtocline{2}{\subsectiontocindent}{\subsectionnumberwidth}}
+\renewcommand*{\l@subsubsection}{\@dottedtocline{3}{\subsubsectiontocindent}{\subsubsectionnumberwidth}}
+\newrobustcmd*{\tocsquashedsubsections}
+ {\def\l@subsection{\@dottedtocline{2}{0pt}{\subsectionnumberwidth}}%
+ \def\l@subsubsection{\@dottedtocline{3}{0pt}{\subsubsectionnumberwidth}}}
\makeatother
@@ -171,7 +260,6 @@
leftmargin=!
}
-
\SetEnumitemKey{nestedinspecialsection}{
leftmargin=10pt
}
@@ -191,13 +279,15 @@
\fancypagestyle{pagenumberonly}{
+ \fancyhf{}
\fancyhead[L]{}
\fancyhead[R]{\thepage}
}
-\pagestyle{fancy}
-\fancyhf{}
-\fancyhead[L]{\rightmark}
-\fancyhead[R]{\thepage}
+\fancypagestyle{fancy}{
+ \fancyhf{}
+ \fancyhead[L]{\rightmark}
+ \fancyhead[R]{\thepage}
+}
\newcommand*{\resetfancyhead}
{\fancyhead[L]{\textsf{\textsc{\textls[20]{\nouppercase\rightmark}}}}}
@@ -239,8 +329,8 @@
\setlength{\skip\footins}{25pt}
-\setlength{\overfullrule}{3pt}
-\renewcommand*{\sidecaptionsep}{16pt}
+\setlength{\overfullrule}{0pt}
+\renewcommand*{\sidecaptionsep}{25pt}
@@ -272,13 +362,17 @@
\newcommand*{\citenum}[1]{\@nameuse{b@#1}}
\makeatother
-\def\code#1{\texttt{#1}}
+\renewcommand*{\code}[1]{\texttt{#1}}
+
+\newcommand*{\codelineindicator}{\mbox{\small$\mathscr{l}$}}
\newrobustcmd*{\command}[1]{\mbox{\textbf{#1}}}
+\newcommand*{\detoxindex}[1]{\index{\detokenize{#1}}}
+
\newcommand*{\doublequotes}[1]{\doubleguillemetright\kern-.03333em #1\doubleguillemetleft}
-\newcommand*{\dumpmacro}[1]{\texttt{\detokenize\expandafter{#1}}}
+\newcommand*{\dumpmacro}[1]{\texttt{\detokenize\expandafter{#1}\unskip}}
\newcommand*{\filesystem}[1]{\mbox{\textit{#1\/}}}
@@ -287,6 +381,12 @@
\newcommand*{\foreignphrase}[1]{\textsl{#1}}
+\makeatletter
+\newcommand*{\formatdimen}{\@ifstar{\@typog@rem@pt}{\@typog@strip@pt}}
+\newcommand*{\@typog@rem@pt}[1]{\dimen0=\dimexpr#1\relax\strip@pt\dimen0\,pt}
+\newcommand*{\@typog@strip@pt}[1]{\expandafter\strip@pt#1\relax\,pt}
+\makeatother
+
\newcommand*{\formatskip}[3]{#1\genfrac{}{}{0pt}{}{{+}#2}{{-}#3}}
\makeatletter
@@ -294,19 +394,46 @@
\renewcommand*{\fps@table}{htbp}
\makeatother
+\apptocmd{\GlossaryParms}
+ {\RaggedRight\normalsize}
+ {\relax}
+ {\AppendingFailed}
+
+\let\oldhdpindex=\hdpindex
+\renewcommand*{\hdpindex}[2]{\textbf{\oldhdpindex{#1}{#2}}}
+
+\let\oldhdclindex=\hdclindex
+\renewcommand*{\hdclindex}[2]
+ {\ifstrequal{#2}{code}
+ {\oldhdclindex{#1}{codeidx}}
+ {\oldhdclindex{#1}{#2}}}
+
\newcommand*{\hollowrectangle}[2]
{\setlength{\fboxrule}{.5pt}%
\setlength{\fboxsep}{0pt}%
\framebox{\rule{#1}{0pt}\rule{0pt}{#2}}}
\newcommand*{\hollowsquare}[1]{\hollowrectangle{#1}{#1}}
+\apptocmd{\IndexParms}
+ {\RaggedRight\small}
+ {\relax}
+ {\AppendingFailed}
\makeatletter
+\ExplSyntaxOn
\apptocmd{\index@prologue}
- {\marginnote{In the Index page ranges are stuck together with
- \hyperref[syn:figuredash]{\cs{figuredash*}}.}}
+ {\legacy_if:nTF {codeline@index}
+ {We\space prefix\space all\space references\space
+ to\space code\space lines\space with~\singlequotes{\codelineindicator}.}
+ {}}
{\relax}
{\AppendingFailed}
+
+\newcommand*{\linenumberdecoration}
+ {\legacy_if:nTF {codeline@index}
+ {\codelineindicator}
+ {}}
+\ExplSyntaxOff
\makeatother
\newcommand*{\logmacro}[1]
@@ -348,11 +475,27 @@
\AtBeginDocument{\setlength{\emreference}{\fontdimen6\font}}
\newrobustcmd*{\milliem}[1]
{\ifdim #1=0pt
- #1%
+ 0\,pt%
\else
\nativetextfraction{\the\numexpr\dimexpr (#1) * 1000 / \emreference}{1000}\:em%
\fi}
+\let\originalmulticols=\multicols
+\let\endoriginalmulticols=\endmulticols
+\RenewDocumentEnvironment{multicols}{m o o}
+ {\ifnum #1=1
+ \IfNoValueTF{#2}{\relax}{#2}%
+ \else
+ \IfNoValueTF{#2}
+ {\originalmulticols{#1}}
+ {\originalmulticols{#1}[#2]}%
+ \fi}
+ {\ifnum #1=1
+ \relax
+ \else
+ \endoriginalmulticols
+ \fi}
+
\newcommand*{\needtocspace}[1][3]
{\addtocontents{toc}{\protect\needspace{#1\baselineskip}}}
@@ -455,7 +598,7 @@
\newenvironment*{specialcodesection}[1]
{\Needspace{4\baselineskip}%
\begin{tcolorbox}[colback=white, colframe=\markercolor,
- bottomrule=0pt, leftrule=5pt, rightrule=0pt, toprule=0pt]
+ bottomrule=.5pt, leftrule=5pt, rightrule=.5pt, toprule=.5pt]
\sf\typogsetupsf
\begin{list}
{\specialcodesectionheading{#1}}
@@ -498,11 +641,37 @@
\begin{minipage}{\floatcaptionwidth}}
{\end{minipage}}
\newcommand*{\tablenotemark}[1]{\smash{\textsuperscript{#1}}}
+\newcommand*{\tablenotesymbol}[1]{% Bringhurst's "traditional order" (p69) from 1 to 6
+ \ifcase#1\relax
+ #1% 0
+ \or \textasteriskcentered% 1
+ \or \textdagger% 2
+ \or \textdaggerdbl% 3
+ \or \textsection% 4
+ \or \textbardbl% 5
+ \or \textsection% 6
+ \or \textasteriskcentered\textasteriskcentered%7
+ \or \textdagger\textdagger%8
+ \or \textdaggerdbl\textdaggerdbl%9
+ \else
+ #1
+ \fi
+}
\newcommand*{\termparbox}[1]{\parbox[t]{\linewidth}{#1\bottomstrut}}
\newcommand*{\thousandsseparator}{\mbox{,}}
+\ExplSyntaxOn
+\newcommand*{\titlecase}[1]{\text_titlecase:n {#1}}
+\ExplSyntaxOff
+
+\newcommand*{\toccontinuesonnextpage}
+ {\addtocontents{toc}{\par
+ \bigskip
+ \hfill\textit{Table of Contents continued on next page.}\par
+ \protect\clearpage}}
+
\newcommand*{\topstrut}{\rule{0pt}{1.3em}}
\newcommand*{\typogsetuprm}
@@ -514,11 +683,16 @@
{\typogsetup{raise*=.06667em,
raiseguillemets=.05em}}
+\newcommand*{\unmarkedfntext}[1]
+ {{\def\thefootnote{}\footnote{#1}%
+ \addtocounter{footnote}{-1}}}
+
+\newcommand*{\userman}[1]{\textbf{\hyperpage{#1}}}%%-- https://github.com/ho-tex/hypdoc/issues/11
+
\newcommand*{\visualpar}{\textcolor{\markercolor}{\P}\linebreak[1]\enspace}
\newenvironment*{whittyquote}
{\begin{flushright}
- \renewcommand*{\propername}[1]{\mbox{##1}}%
\sf\typogsetupsf}
{\end{flushright}}
@@ -532,7 +706,6 @@
\end{minipage}
\end{maxipage}}
-
\NewDocElement[macrolike = true,
idxtype = dim.,
idxgroup = dimensions,
@@ -547,6 +720,20 @@
{EnumItemKey}{enumitemkey}
\pretocmd{\DescribeEnumItemKey}{\needspace{25pt}}{\relax}{\PrependingFailed}
+\NewDocElement[macrolike = true,
+ idxtype = skip,
+ idxgroup = \LaTeX{} length (skip),
+ printtype = \textit{skip}]
+ {LaTeXSkip}{lskip}
+\pretocmd{\DescribeLaTeXSkip}{\needspace{25pt}}{\relax}{\PrependingFailed}
+
+\NewDocElement[macrolike = true,
+ idxtype = counter,
+ idxgroup = \protect\TeX{} counters,
+ printtype = \textit{counter}]
+ {TeXCounter}{tcounter}
+\pretocmd{\DescribeTeXCounter}{\needspace{25pt}}{\relax}{\PrependingFailed}
+
\hyphenation{% https://hyphenateit.com/en-us
Double-guillemet-left
@@ -585,6 +772,8 @@
line-width
loose-ness
loose-spacing
+ lower-case-adjust-label-items
+ lower-case-label-item-adjustments
make-at-letter
make-at-other
mar-gin-al
@@ -612,6 +801,7 @@
set-leading
set-leading-percentage
short-inter-text
+ shrink-limits
single-guillemet-left
single-guillemet-right
single-quotes
@@ -625,6 +815,7 @@
smooth-ragged-right-shape-septuplet
smooth-ragged-right-shape-triplet
space-skip
+ stretch-limits
text-italics-correction
tight-spacing
tracing-boxes
@@ -632,6 +823,8 @@
tracking-tt-spacing
typog-get
typog-setup
+ upper-case-adjust-label-items
+ upper-case-label-item-adjustments
vtie-bot
vtie-bot-disp
vtie-bot-disp-par
@@ -648,29 +841,52 @@
\begin{document}
\typogsetuprm
+ \uppercaseadjustlabelitems{*}
\DocInput{typog.dtx}
\end{document}
%</driver>
%<*index-style>
actual '='
+delim_0 "\\nobreak\\enspace"
+delim_1 "\\nobreak\\enspace"
+delim_2 "\\nobreak\\enspace"
delim_r "\\figuredash*"
heading_prefix "\\pagebreak[3]\\smallskip\n\n{\\sffamily\\bfseries\\large "
heading_suffix "}\\nopagebreak\n"
headings_flag 1
level '>'
+line_max 65536
quote '!'
%</index-style>
+%<*changes-style>
+actual '='
+delim_0 "\\nobreak\\enspace"
+delim_1 "\\nobreak\\enspace"
+delim_2 "\\nobreak\\enspace"
+heading_prefix "\\pagebreak[3]\\smallskip\n\n{\\sffamily\\bfseries\\large "
+heading_suffix "}\\nopagebreak\n"
+headings_flag 0
+item_x1 "\\efill\n\\subitem "
+item_x2 "\\ "
+keyword "\\glossaryentry"
+level '>'
+line_max 65536
+postamble "\n\\end{theglossary}\n"
+preamble "\\begin{theglossary}\n \\makeatletter\\scan@allowedfalse"
+quote '!'
+%</changes-style>
% \fi
%
%
% \DoNotIndex{\,}
-% \DoNotIndex{\addtolength,\advance,\aftergroup,\allowdisplaybreaks,\arabic}
-% \DoNotIndex{\AtBeginDocument,\autotransfer}
-% \DoNotIndex{\baselineskip}
-% \DoNotIndex{\c,\char,\clubpenalties,\clubpenalty,\count,\cs,\csname}
+% \DoNotIndex{\\}
+% \DoNotIndex{\addtocounter,\addtolength,\advance,\aftergroup,\allowdisplaybreaks,\arabic,\arraystretch}
+% \DoNotIndex{\AfterEndPreamble,\AfterPreamble,\AtBeginDocument,\autotransfer}
+% \DoNotIndex{\baselineskip,\begin,\begingroup,\booltrue,\box}
+% \DoNotIndex{\c,\char,\clist,\clubpenalties,\clubpenalty,\count,\cs,\csname}
% \DoNotIndex{\DeclareRobustCommand,\def,\define@choicekey,\define@key,\detokenize}
% \DoNotIndex{\dim,\dimen,\dimexpr,\discretionary,\displaywidowpenalties,\displaywidowpenalty}
-% \DoNotIndex{\edef,\else,\emergencystretch,\empty,\endcsname}
+% \DoNotIndex{\edef,\else,\emergencystretch,\empty,\end,\endcsname,\endgroup}
% \DoNotIndex{\endlastlineflushrightpar}
% \DoNotIndex{\endlastlineraggedleftpar}
% \DoNotIndex{\endnofontexpand,\endnofontexpansion}
@@ -679,33 +895,37 @@ quote '!'
% \DoNotIndex{\endsmoothraggedrightshapetriplet}
% \DoNotIndex{\endtypoginspect}
% \DoNotIndex{\exhyphenpenalty,\expandafter,\ExplSyntaxOff,\ExplSyntaxOn}
-% \DoNotIndex{\fi,\finalhyphendemerits,\font,\fontdimen,\fp,\fussy,\futurelet}
+% \DoNotIndex{\fi,\finalhyphendemerits,\font,\fontdimen,\forcsvlist,\fp,\fpeval,\fussy,\futurelet}
% \DoNotIndex{\gdef,\global,\glueexpr,\@gobble}
% \DoNotIndex{\guillemotleft,\guillemotright,\guilsinglleft,\guilsinglright}
-% \DoNotIndex{\hbadness,\hfuzz,\hskip,\hspace}
+% \DoNotIndex{\hbadness,\hbox,\hfuzz,\hskip,\hspace,\ht}
% \DoNotIndex{\ignorespaces,\ignorespacesafterend}
-% \DoNotIndex{\if,\IfBooleanT,\IfBooleanTF,\ifcase,\ifdefined,\ifdim,\iffalse,\ifmmode,\ifMT@expansion}
-% \DoNotIndex{\@ifnextchar,\IfNoValueF,\IfNoValueTF,\ifnum}
+% \DoNotIndex{\if,\ifblank,\ifbool,\IfBooleanT,\IfBooleanTF,\ifcase,\ifdefined,\ifdim,\iffalse,\ifmmode}
+% \DoNotIndex{\ifMT@expansion,\@ifnextchar,\IfNoValueF,\IfNoValueTF,\ifnum,\ifodd,\ifstrequal}
% \DoNotIndex{\iftypog@microtype@loadedfalse}
% \DoNotIndex{\iftypog@microtype@preloadedfalse}
-% \DoNotIndex{\ifvmode,\ifx,\ignorespaces,\inputlineno,\int,\interlinepenalty}
+% \DoNotIndex{\ifvmode,\ifx,\ignorespaces,\inputlineno,\int,\interlinepenalty,\itemize}
% \DoNotIndex{\jobname}
% \DoNotIndex{\kern}
-% \DoNotIndex{\l,\lastlinefit,\lastlineflushrightpar,\lastlineraggedleftpar,\leftmargin,\leftskip,\let}
-% \DoNotIndex{\linepenalty,\linewidth,\@listdepth,\looseness,\lsstyle}
-% \DoNotIndex{\@M,\m@th,\mathbin,\mathord,\maxdimen,\message,\microtypecontext,\microtypesetup}
+% \DoNotIndex{\l,\labelitemi,\labelitemii,\labelitemiii,\labelitemiv}
+% \DoNotIndex{\lastlinefit,\lastlineflushrightpar,\lastlineraggedleftpar}
+% \DoNotIndex{\lefthyphenmin,\leftmargin,\leftskip,\let,\letcs}
+% \DoNotIndex{\linepenalty,\linewidth,\@listdepth,\loop,\looseness,\lsstyle}
+% \DoNotIndex{\@M,\m@th,\mathbin,\mathord,\maxdimen,\mbox,\message,\microtypecontext,\microtypesetup}
% \DoNotIndex{\@minus,\mkern,\m@ne,\mspace,\MT@letterspace@,\MT@MT,\muexpr}
-% \DoNotIndex{\@ne,\NeedsTeXFormat,\NewDocumentCommand,\NewDocumentEnvironment,\newcommand,\newenvironment}
-% \DoNotIndex{\newcounter,\newdimen,\newif,\newlength,\newmuskip}
+% \DoNotIndex{\@ne,\NeedsTeXFormat,\newbool,\NewDocumentCommand,\NewDocumentEnvironment}
+% \DoNotIndex{\newcommand,\newenvironment}
+% \DoNotIndex{\newcounter,\newdimen,\newif,\newlength,\newline,\newmuskip}
% \DoNotIndex{\nobreak,\nofontexpand,\nofontexpansion,\nr,\numexpr}
% \DoNotIndex{\or,\optarg}
% \DoNotIndex{\p@,\PackageError,\PackageWarning}
-% \DoNotIndex{\par,\parfillskip,\parindent,\parshape,\pdf@strcmp}
+% \DoNotIndex{\par,\parfillskip,\parindent,\parshape,\patchcmd,\pdf@strcmp}
% \DoNotIndex{\pdfstringdefDisableCommands}
% \DoNotIndex{\penalty,\@plus,\PopPostHook,\postdisplaypenalty,\predisplaypenalty,\prg}
% \DoNotIndex{\pretolerance,\protected,\ProvidesPackage,\PushPostHook}
-% \DoNotIndex{\raisebox,\refstepcounter,\relax,\RenewExpandableDocumentCommand,\RequirePackage,\rightskip}
-% \DoNotIndex{\setcounter,\SetEnumitemKey,\SetExpansion,\setkeys,\setlength,\setstretch}
+% \DoNotIndex{\raisebox,\refstepcounter,\relax,\RenewExpandableDocumentCommand,\repeat,\RequirePackage}
+% \DoNotIndex{\righthyphenmin,\rightskip,\rlap,\romannumeral,\rule}
+% \DoNotIndex{\setbox,\setcounter,\SetEnumitemKey,\SetExpansion,\setkeys,\setlength,\setstretch}
% \DoNotIndex{\showboxbreadth,\showboxdepth,\skip,\sloppy}
% \DoNotIndex{\smoothraggedrightpar}
% \DoNotIndex{\smoothraggedrightshapequintuplet}
@@ -715,9 +935,9 @@ quote '!'
% \DoNotIndex{\textemdash,\textendash,\textsf,\textsl,\texttimes,\textwidth,\the,\times,\tl,\tolerance}
% \DoNotIndex{\tracingnone,\tracingpages,\tracingparagraphs}
% \DoNotIndex{\typeout,\typoginspect,\typoglogo}
-% \DoNotIndex{\unless}
+% \DoNotIndex{\unhbox,\unless}
% \DoNotIndex{\val,\value,\vbadness,\vfuzz}
-% \DoNotIndex{\widowpenalties,\widowpenalty}
+% \DoNotIndex{\wd,\widowpenalties,\widowpenalty}
% \DoNotIndex{\z@,\z@skip}
%
%
@@ -828,7 +1048,8 @@ end
% \footnotesize
% \noindent
% This package is copyright \textcopyright~2024 Ch.~L.~Spiel. It may be distributed
-% and\kernedslash*or modified under the conditions of the \LaTeX{} Project Public License
+% and\kernedslash*or modified under the conditions of the
+% \href{https://www.latex-project.org/lppl.txt}{\LaTeX{} Project Public License}
% \acronym{(LPPL)}, either version~1.3c of this license or --~at your option~-- any later
% version. This work has the \acronym{LPPL} maintenance status
% \doublequotes{author-maintained}.
@@ -836,30 +1057,36 @@ end
%
%
% \clearpage
-% \thispagestyle{pagenumberonly}
-% \tableofcontents
-% \vspace{\fill}
+% \pagestyle{pagenumberonly}
%
+% \unmarkedfntext{The font sample on the title page was generated with the help of \MP{} using
+% \doublequotes{\acronym{URW}~Palladio}%
+% \detoxindex{font>typeface>URW Palladio=\acronym{URW} Palladio|userman}.}
%
-% \thispagestyle{pagenumberonly}
-% \listoftables
-% \phantomsection
-% \addcontentsline{toc}{subsection}{List of Tables}
-% \vspace{\fill}
+% \begin{nofontexpansion}
+% \begin{nocharprotrusion}
+% \tableofcontents
+% \end{nocharprotrusion}
+% \end{nofontexpansion}
%
+% \addtocontents{toc}{%
+% \protect\begin{whittyquote}
+% Hoffentlich wird es nicht so schlimm, wie es schon ist! \\
+% \capitalemdash*~\propername{Karl Valentin}
+% \protect\end{whittyquote}\par}
%
-% \begingroup
-% \footnotesize
-% \singlespacing
-% \noindent
-% The font sample on the title page was generated with the help of \MP{} using
-% \doublequotes{\acronym{URW} Palladio~L}\index{font>URW Palladio L=\acronym{URW} Palladio
-% L}.
-% \endgroup
+% \vspace{\fill}
+%
+% \begin{nofontexpansion}
+% \begin{nocharprotrusion}
+% \listoftables
+% \end{nocharprotrusion}
+% \end{nofontexpansion}
%
%
% \clearpage
% \pagenumbering{arabic}
+% \pagestyle{fancy}
% \section{Introduction}\label{sec:introduction}
%
% \begin{whittyquote}
@@ -892,7 +1119,10 @@ end
% \Cref{sec:latex-hyphenation} expands the hyphenation facilities of \LaTeX.
%
% \Cref{sec:break-ligatures,sec:manual-italic-correction,sec:extra-kerning,sec:raise-characters}
-% deal with vertically positioning glyphs in a more pleasant way.
+% deal with vertically positioning glyphs in a more pleasant way. Also in the realm of
+% vertical alignments is \cref{sec:adjust-label-items} that explains how to height-adjust the
+% labels in |itemize|~lists to perfection whether the items are followed by uppercase or by
+% lowercase letters.
%
% \Cref{sec:align-last-line,sec:fill-last-line} discuss dearly missed macros for better control
% of the last line of a paragraph.
@@ -950,15 +1180,17 @@ end
% \end{tabbing}
% \end{synopsis}
%
-% \index{package options|(}
-% The package \meta{OPTIONs} serve as configuration \meta{key}s, too. This means they can be
-% set with \hyperref[syn:typogsetup]{\code{typogsetup}} and their values can be retrieved with
-% \hyperref[syn:typogget]{\cs{typogget}}. Options that rely on package~\packagename{microtype}
-% are indicated with \doublequotes{\microtyperequiredmarker}.
+% \index{package options|(userman}
+% The package \meta{OPTIONs} also serve as configuration \meta{key}s (unless noted otherwise).
+% This means they can be set with \hyperref[syn:typogsetup]{\code{typogsetup}} and their values
+% can be retrieved with \hyperref[syn:typogget]{\cs{typogget}}. Options that rely on
+% package~\packagename{microtype} are indicated with \doublequotes{\microtyperequiredmarker}.
%
% \begin{typogsetup}{}
% \newcommand*{\indexpackageoption}[1]
-% {\index{package option>#1=\code{#1}}\index{#1=\code{#1}~(option)}\ignorespaces}
+% {\detoxindex{package option>#1=\code{#1}|userman}%
+% \detoxindex{#1=\code{#1}~(option)|userman}%
+% \ignorespaces}
% \begin{description}
% [before={\let\oldmakelabel=\makelabel
% \renewcommand{\makelabel}[1]
@@ -978,17 +1210,44 @@ end
% \item[|debug|, |nodebug|]\label{item:debug}
% \indexpackageoption{debug}
% \indexpackageoption{nodebug}
-% Write package-specific debug information to the log file. Opposite: |nodebug|. The
-% default is not to log debug information.
+% Write some package-specific debug information to the \filesystem{log}~file. Opposite:
+% |nodebug|. The default is not to record debug information.
+%
+% These two options neither can be used with \hyperref[syn:typogsetup]{\code{typogsetup}}
+% nor with \hyperref[syn:typogget]{\cs{typogget}}.
%
% \item[|ligaturekern=|\meta{dim}]\label{item:ligaturekern}
% \indexpackageoption{ligaturekern}
% Set \meta{dim} of the kern that is inserted to split a ligature in
% macro\hyperref[syn:nolig]{\cs{nolig}}. See
-% \cref{sec:break-ligatures}.\shiftedmarginnote{We access the configuration values with
-% \hyperref[syn:typogget]{\cs{typogget}}.} Default
+% \cref{sec:break-ligatures}.\shiftedmarginnote{We access all the (default) configuration
+% values with \hyperref[syn:typogget]{\cs{typogget}}.} Default
% value:~\milliem{\typogget{ligaturekern}}.
%
+% \item[|lowercaselabelitemadjustments=\{|\meta{dim1}, \meta{dim2}, \meta{dim3}, \meta{dim4}|\}|]%
+% \label{item:lowercaselabelitemadjustments}
+% \indexpackageoption{lowercaselabelitemadjustments}
+% \sinceversion{Since v0.4}
+% Vertical shifts \meta{dimN} to apply to \cs{labelitem}\meta{N}, where \meta{N} is the
+% nesting level of the |itemize|~list starting at one. An empty \meta{dimN} is equivalent
+% to~\formatdimen*{0pt}. The adjustments apply to the lowercase setting
+% (\hyperref[syn:lowercaseadjustlabelitems]{\code{\string\lowercaseadjustlabelitems}}).
+% See \cref{sec:adjust-label-items} (in particular subsection~\singlequotes{Setup} and
+% \cref{tab:labelitemadjustvalues} on \cpageref{tab:labelitemadjustvalues}) and also
+% configuration option
+% \hyperref[item:uppercaselabelitemadjustments]{\code{uppercaseadjustlabelitem}}.
+%
+% All four lengths default to~\formatdimen*{0pt}.
+%
+% \begin{important}
+% \slightlysloppy
+% \noindent
+% Configuring \code{lowercaselabelitemadjustments} (or
+% \code{uppercaselabelitemadjustments}) does \emph{not} activate the correction
+% mechanism. Use one of the macros \code{\string\lowercaseadjustlabelitems} or
+% \code{\string\uppercaseadjustlabelitems} for that purpose.
+% \end{important}
+%
% \item[|mathitalicscorrection=|\meta{dim}]\label{item:mathitalicscorrection}
% \indexpackageoption{mathitalicscorrection}
% Italics correction in math mode. See \cref{sec:manual-italic-correction} and also the
@@ -1000,10 +1259,14 @@ end
% \item[|raise*=|\meta{dim}]\label{item:raise}
% \indexpackageoption{raise*}
% Set the length by which selected characters (dash, hyphen, times, and number dash) are
-% raised. Default value:~0pt.
+% raised. Default value:~\formatdimen*{0pt}.
%
% Only the raise amounts for guillemets are unaffected by this option.
%
+% This option neither can be used with \hyperref[syn:typogsetup]{\code{typogsetup}} nor
+% with \hyperref[syn:typogget]{\cs{typogget}}, however, the specific options influenced by
+% it can.
+%
% \item[|raisecapitaldash=|\meta{dim}]\label{item:raisecapitaldash}
% \indexpackageoption{raisecapitaldash}
% Set the length that the \cs{textendash} is raised in
@@ -1093,6 +1356,30 @@ end
% \emph{not} in the document body.
%
% By default this option is unset.
+%
+% \item[|uppercaselabelitemadjustments=\{|\meta{dim1}, \meta{dim2}, \meta{dim3}, \meta{dim4}|\}|]%
+% \label{item:uppercaselabelitemadjustments}
+% \indexpackageoption{uppercaselabelitemadjustments}
+% \sinceversion{Since v0.4}
+% Vertical shifts \meta{dimN} to apply to \cs{labelitem}\meta{N}, where \meta{N} is the
+% nesting level of the |itemize|~list starting at one. An empty \meta{dimN} is equivalent
+% to~\formatdimen*{0pt}. The adjustments apply to the uppercase setting
+% (\hyperref[syn:uppercaseadjustlabelitems]{\code{\string\uppercaseadjustlabelitems}}).
+% See \cref{sec:adjust-label-items} (in particular subsection~\singlequotes{Setup} and
+% \cref{tab:labelitemadjustvalues} on \cpageref{tab:labelitemadjustvalues}) and also
+% configuration option
+% \hyperref[item:lowercaselabelitemadjustments]{\code{lowercaseadjustlabelitem}}.
+%
+% All four lengths default to~\formatdimen*{0pt}.
+%
+% \begin{important}
+% \slightlysloppy
+% \noindent
+% Configuring \code{uppercaselabelitemadjustments} (or
+% \code{lowercaselabelitemadjustments}) does \emph{not} activate the correction
+% mechanism. Use one of the macros \code{\string\uppercaseadjustlabelitems} or
+% \code{\string\lowercaseadjustlabelitems} for that purpose.
+% \end{important}
% \end{description}
% \end{typogsetup}
% \index{package options|)}
@@ -1116,12 +1403,13 @@ end
% issues a \cs{par} at its end. Environments with different name suffixes never close
% with~\cs{par}.
%
-% \bigskip
%
-% \noindent
+% \subsection{Setup and Reconfiguration}\label{sec:setup}
+%
% \DescribeEnv{typogsetup}
-% Configure\index{configuration}\index{setup} the package with the given \meta{keys}. An empty
-% argument of \code{typogsetup} resets all \meta{keys} to their default values.
+% Configure\index{configuration|userman}\index{setup|userman} the package with the given
+% \meta{keys}. An empty argument of \code{typogsetup} resets all \meta{keys} to their default
+% values.
%
% \begin{synopsis}\label{syn:typogsetup}
% \cs{begin}|{typogsetup}|\marg{keys}
@@ -1129,7 +1417,7 @@ end
% \cs{end}|{typogsetup}|
% \end{synopsis}
%
-% The package can be (re-)configured\index{reconfigure} at any point with
+% The package can be (re-)configured\index{reconfigure|userman} at any point with
% \cs{typogsetup}\marg{keys}, or --~for localized changes~-- as
%
% \begin{codeexample}
@@ -1143,6 +1431,12 @@ end
% where \meta{keys} have the same format as the package options described in
% \cref{sec:package-options}.
%
+% \begin{note}
+% Use \code{\string\PassOptionsToPackage\{\meta{keys}\}\{typog\}} to pass \meta{keys} to
+% \packagename{typog} before loading it and \code{\string\typogsetup\{\meta{keys}\}} after
+% \code{\string\usepackage\{typog\}}.
+% \end{note}
+%
% \begin{usecases}
% \cs{typogsetup} can substitute configuring the package at load-time or serve as an
% addition.~\visualpar Using the |typogsetup|~environment allows to fine-tune the parameters
@@ -1154,9 +1448,9 @@ end
%
% \noindent
% \DescribeMacro{\typogget}
-% Sometimes the user needs to access internal configuration values of
-% package~\packagename{typog}. This can be done in a safe way without resorting to code that
-% is bracketed by \cs{makeatletter}/\cs{makeatother} with the help of the following macro.
+% Sometimes the user needs to access configuration values of package~\packagename{typog}. This
+% can be done in a safe way without resorting to code that is bracketed by \cs{makeatletter}
+% and \cs{makeatother} with the help of the following macro.
%
% \begin{synopsis}\label{syn:typogget}
% \cs{typogget}\marg{key}
@@ -1177,15 +1471,47 @@ end
% \> \{\cs{raisebox}\= \{\cs{typogget}\{raisecapitaldash\}\}\{\cs{cdot}\}\}
% \end{codeexample}
%
-% The latter only is useful inside of an \code{itemize}~environment of course.
+% The latter only is useful inside of an \code{itemize}~environment of course. Compare with
+% the solution in \cref{sec:adjust-label-items} offered by \packagename{typog} since v0.4.
% \end{usecase}
%
+% \DescribeMacro{\typoggetnth}
+% \sinceversion{Since v0.4}
+% If a configuration item is associated with a list as
+% \hyperref[item:lowercaselabelitemadjustments]{\code{lowercaselabelitemadjustments}},
+% \hyperref[item:shrinklimits]{\code{shrinklimits}},
+% \hyperref[item:stretchlimits]{\code{stretchlimits}},
+% \hyperref[item:trackingttspacing]{\code{trackingttspacing}}, and
+% \hyperref[item:uppercaselabelitemadjustments]{\code{uppercaselabelitemadjustments}} are, it
+% may be convenient to fetch a particular list element of it.
+%
+% \begin{synopsis}\label{syn:typoggetnth}
+% \cs{typoggetnth}\marg{csname}\marg{key}\marg{index} \\
+% \cs{typoggetnth}\marg{dimen-register}\marg{key}\marg{index}
+% \end{synopsis}
+%
+% Retrieve the configuration value --~which is a comma-separated list~-- that is associated
+% with~\meta{key} and store the item having position~\meta{index} in \meta{dimen-register} or
+% the parameter-less, global macro~\meta{csname}. The destination \meta{dimen-register} may be
+% predefined like, e.\,g., \cs{dimen0} or user-defined. Dimensions can also be stored in a
+% macro by using the \meta{csname}~form of \cs{typoggetnth} but not \foreignphrase{vice versa}.
+%
+% Index into the list either from left-to-right with positive indices starting at~\(1\) up to
+% the length of the list, or from right-to-left with negative indices starting at~\(-1\) down
+% to the negative length.
+%
+% \begin{note}
+% Macro~\cs{typoggetnth} \emph{only} works with \meta{key}s that are associated with a list
+% of values.
+% \end{note}
+%
%
-% \subsection{Information}\label{sec:information}\index{information}
+% \subsection{Information}\label{sec:information}
+% \index{information|userman}
%
% \begin{whittyquote}
% Never forget: The visual output counts; \\
-% it must always be checked, [\dots]. \\
+% it must always be checked, [\dots\itcorr{-4}]. \\
% \marginnote{The em-dash at then end of the quote is height-adjusted with
% \hyperref[syn:capitalemdash]{\cs{capitalemdash*}}.}%
% \capitalemdash*~\propername{Udo Wermuth}~\cite{wermuth:2017a}
@@ -1196,14 +1522,14 @@ end
%
%
% \subsubsection{Font Information}\label{sec:font-information}
-% \index{font>information}
+% \index{font>information|userman}
%
% \DescribeMacro{\fontsizeinfo}
% Capture the font~size\footnote{We use \cs{fontdimen6}, the em-height as the font
-% size.}\index{font>size} and line~spacing\footnote{The line~spacing simply is
-% \cs{baselineskip}.}\index{line spacing} at the point where \cs{fontsizeinfo} \emph{is called}
-% in macro~\meta{cs-name}. Both dimensions are measured in points~(pt) and the results are
-% rounded to tenths.
+% size.}\index{font>size|userman} and line~spacing\footnote{The line~spacing simply is
+% \cs{baselineskip}.}\index{line spacing|userman} at the point where \cs{fontsizeinfo} \emph{is
+% called} in macro~\meta{cs-name}. Both dimensions are measured in points~(pt) and the results
+% are rounded to tenths.
%
% \begin{synopsis}\label{syn:fontsizeinfo}
% \cs{fontsizeinfo}\marg{cs-name}
@@ -1259,9 +1585,8 @@ end
%
% \begin{caution}
% The end-of-trace marker sometimes gets placed too early and the trace seems truncated.
-% \LaTeX{} reliably logs the requested the trace information, but the write operations for
-% trace data and \cs{immediate}\cs{write} which is used to print the end-tag are not
-% synchronized.
+% \LaTeX{} reliably logs the requested trace information, but the write operations for trace
+% data and \cs{immediate}\cs{write} which is used to print the end-tag are not synchronized.
% \end{caution}
%
%
@@ -1287,7 +1612,8 @@ end
%
% \begin{itemize}[noindent]
% \item Any text tool can be used to ferret out the tags. \propername{Emacs} users will find
-% \mbox{\code{(occur \meta{regexp})}} to be useful.
+% \mbox{\code{(occur \meta{regexp})}} to be useful.\shiftedmarginnote{This \code{itemize}
+% list demonstrates vertically adjusted label items (\cref{sec:adjust-label-items}).}
%
% \item As long as the tags are not nested \programname{sed} or \programname{perl}
% extract the information gathered by~|typoginspect|, for example:
@@ -1338,13 +1664,20 @@ end
%
% \item If more trace information is needed just add \cs{tracing\dots} calls right after
% \code{\string\begin\{typoginspect\}}
-% or~\code{\string\begin\{typoginspectpar\}}.\specialsectionendhere
+% or~\code{\string\begin\{typoginspectpar\}}.
+%
+% \item As the overhead of \cs{typoginspect} is relatively low, hairy parts of a document can
+% permanently be furnished with them, for example, the Index.
+%
+% \item Any labeled part can treat their ids to \meta{id}. Think of \cs{caption}s or any
+% theorem-like environment and their associated, unique \cs{label}s.\specialsectionendhere
% \end{itemize}
% \end{tips}
%
%
% \phantomsection
-% \paragraph{Investigating the badness of a paragraph.}\label{sec:investigating-paragraph-badness}\index{paragraph>badness}
+% \paragraph{Investigating the badness of a paragraph.}\label{sec:investigating-paragraph-badness}
+% \index{paragraph>badness|userman}
%
% It is generally unnecessary to determine the \emph{exact} classification of a paragraph's
% badness~\cite[p.~97n]{knuth:1986}, though the curious user can switch on logging of
@@ -1386,9 +1719,9 @@ end
% \begin{enumerate}[beginpenalty=10000, nosep]
% \item The shortfall~\sample{s} and
% \item glue~\sample{a} or~\sample{g}.\footnote{The author is unaware of any descriptions
-% of \code{s}, \code{a}, or~\code{g}. The interested reader is referred to the source
-% code, e.\,g., \filesystem{pdftex.web}; search for \code{print("\textvisiblespace s=")}.
-% In the weaved documentation the first relevant section is~\S1851.}
+% of \sample{s}, \sample{a}, or~\sample{g} and the interested reader is referred to the
+% source code, e.\,g., \filesystem{pdftex.web}; search for \code{print("\textvisiblespace
+% s=")}. In the weaved documentation the first relevant section is~\S1851.}
% \end{enumerate}
% \item The best\footnote{\singlequotes{Best} means the minimum-demerits path in the graph of
% the feasible breakpoints, which has been constructed for the paragraph.} way to get
@@ -1404,13 +1737,13 @@ end
% as parenthesized values (units are thousandths of the current font's~em) like, e.\,g.,
%
% \begin{codeexample}
-% \textbackslash T1/erewhon-LF/m/n/9/@/@ (-13) \dots
+% \textbackslash T1/erewhon-LF/m/n/9/@/@ (-13) \dots
% \end{codeexample}
%
% or
%
% \begin{codeexample}
-% \textbackslash T1/erewhon-LF/m/n/9/@/@/10ls (+7) \dots
+% \textbackslash T1/erewhon-LF/m/n/9/@/@/10ls (+7) \dots
% \end{codeexample}
%
% An \sample{ls} appended to the font name specification indicates that
@@ -1419,7 +1752,9 @@ end
% \end{note}
%
%
-% \paragraph{Investigating page-breaks.}\index{page break}
+% \phantomsection
+% \paragraph{Investigating page-breaks.}
+% \index{page break|userman}
%
% Use \code{\cs{tracingpages}=1} or the \hyperref[syn:typoginspect]{typoginspect}~environment
% to switch on tracing of \TeX's page-break
@@ -1486,7 +1821,7 @@ end
%
%
% \subsection{Hyphenation}\label{sec:latex-hyphenation}
-% \index{hyphenation}
+% \index{hyphenation|userman}
%
% \TeX's and thus \LaTeX's hyphenation algorithm is highly sophisticated, yet the document
% author sometimes lacks convenient macros to solve seemingly trivial typographic tasks. For
@@ -1500,8 +1835,8 @@ end
% \cs{allowhyphenation}
% \end{synopsis}
%
-% Macro~\cs{allowhyphenation}\index{hyphenation>re-enable automatic} re-enables automatic
-% hyphenation after \TeX{} has turned it off, for example, in the innocuous case of a
+% Macro~\cs{allowhyphenation}\index{hyphenation>re-enable automatic|userman} re-enables
+% automatic hyphenation after \TeX{} has turned it off, for example, in the innocuous case of a
% hyphenated compound.
%
% The admittedly simple rules when \TeX{} auto-hyphenates and when not give rise to so many
@@ -1636,7 +1971,7 @@ end
% Whenever using \cs{-}, the short-hand form of \cs{discretionary\{-\}\{\}\{\}}, authors
% writing in a foreign language should reconsider whether it really beats \cs{hyphenation} or
% \cs{babelhyphenation}\footnote{\cs{babelhyphenation} is the multi-lingual extension of \TeX's
-% \cs{hyphenation} and it is defined in package~\packagename{babel}~\cite{package:babel}}. in
+% \cs{hyphenation} and it is defined in package~\packagename{babel}~\cite{package:babel}.} in
% the particular situation. However, sometimes \cs{-} actually \emph{is} the way to go.
%
% Let us assume we mark up proper names with
@@ -1662,6 +1997,12 @@ end
% which are impossible to encode with \cs{hyphenation} or~\cs{babelhyphenation} as these expect
% only letters and dashes as their arguments with spaces separating the words.
%
+% \index{hyphenation>first word|userman}
+% \index{hyphenation>hskip=\cs{hskip}|userman}
+% \TeX{} never hyphenates the initial word in a paragraph and \cs{allowhyphenation} cannot help
+% in this case. Start the paragraph with \cs{hskip~0pt} to enable hyphenation even for the
+% first word.
+%
% \begin{tip}[Typewriter Fonts]
% Sometimes it is desired to get a hyphenatable typewriter font. \LaTeX{} suppresses any
% hyphenation for fonts in \cs{ttfamily} by un-defining their \cs{hyphenchar}s. If these are
@@ -1686,8 +2027,8 @@ end
% \cs{breakpoint*}
% \end{synopsis}
%
-% The starred form inserts an empty discretionary,\index{hyphenation>empty discretionary} which
-% disables automatic hyphenation. The unstarred form inserts an empty discretionary and
+% The starred form inserts an empty discretionary,\index{hyphenation>empty discretionary|userman}
+% which disables automatic hyphenation. The unstarred form inserts an empty discretionary and
% immediately re-enables automatic hyphenation.
%
% The difference between \cs{breakpoint} and the \LaTeX{} macro~\cs{allowbreak} is not only
@@ -1729,7 +2070,7 @@ end
%
%
% \subsection{Disable\kernedslash Break Ligatures}\label{sec:break-ligatures}
-% \index{ligature}
+% \index{ligature|userman}
%
% \DescribeMacro{\nolig*}
% Break a ligature without introducing a hyphenation opportunity.
@@ -1739,8 +2080,8 @@ end
% \end{synopsis}
%
% Inserting \cs{nolig*} disables a ligature at the given point by a kern. Set the size of the
-% kern\index{kerning>ligature} with \hyperref[item:ligaturekern]{|ligaturekern|} or override
-% this value with \meta{kerning} as thousandths of the current font's~em.
+% kern\index{kerning>ligature|userman} with \hyperref[item:ligaturekern]{\code{ligaturekern}} or
+% override this value with \meta{kerning} as thousandths of the current font's~em.
%
% \begin{usecases}
% \cs{nolig*} can be useful in headings, where additional hyphenation points are
@@ -1762,12 +2103,12 @@ end
% introduces a hyphenation opportunity with
% penalty~\hyperref[item:breakpenalty]{|breakpenalty|}.
%
-% \begin{important}[\packagename{hyperref} bookmarks]\index{hyperref=\packagename{hyperref} (package)}
+% \begin{important}[\packagename{hyperref} bookmarks]\index{hyperref=\packagename{hyperref} (package)|userman}
% If a \cs{nolig} --~whether starred or un-starred~-- occurs in an argument that is processed
% with package~\packagename{hyperref} for inclusion into the document's
-% \acronym{PDF}-bookmarks\index{PDF=\acronym{PDF}}\index{bookmark} an additional argument is
-% necessary to parse the macro. This argument either is \cs{relax} or~the empty
-% group~(\code{\{\}}).
+% \acronym{PDF}-bookmarks\index{PDF=\acronym{PDF}|userman}\index{bookmark|userman} an
+% additional argument is necessary to parse the macro. This argument either is \cs{relax}
+% or~the empty group~(\code{\{\}}).
%
% \begin{synopsis}
% \begin{tabbing}
@@ -1944,14 +2285,14 @@ end
%
%
% \subsection{Apply Extra Kerning}\label{sec:extra-kerning}
-% \index{kerning>extra}
+% \index{kerning>extra|userman}
%
% Package \packagename{typog} supplies two sets of macros to kern some of the punctuation
% symbols. One is for forward slashes the other, more extensive one, for hyphens.
%
%
% \subsubsection{Slash}\label{sec:slash-with-kern}
-% \index{kerning>forward slash}
+% \index{kerning>forward slash|userman}
%
% \DescribeMacro{\kernedslash}
% \DescribeMacro{\kernedslash*}
@@ -1980,7 +2321,7 @@ end
%
%
% \subsubsection{Hyphen}\label{sec:hyphen-with-kern}
-% \index{kerning>hyphen}
+% \index{kerning>hyphen|userman}
%
% \DescribeMacro{\kernedhyphen}
% \DescribeMacro{\kernedhyphen*}
@@ -2027,7 +2368,7 @@ end
%
%
% \subsection{Raise Selected Characters}\label{sec:raise-characters}
-% \index{raised character}
+% \index{raised character|userman}
%
% Usually all hyphens and dashes of a font are designed to join lowercase letters. This holds
% also true for most of our \cs{labelitem}\meta{N} markers, bullets, stars, and even fancy
@@ -2036,10 +2377,10 @@ end
% arises if |itemize|~list markers precede an uppercase letter, a lining numeral, or a big
% mathematical operator.
%
-% We introduce a set of macros for the most common cases that allow typsetting these characters
-% at a user definable, adjusted height above the baseline. Users can base their own
-% definitions of raised characters on their associated dimensions.\footnote{Also compare with
-% Ex.~12 in Ref.~\citenum{wermuth:2023} for an attempt to automate vertical alignment.}
+% We introduce a set of macros for the most common cases that typeset these characters at a
+% user definable, adjusted height above the baseline. Users can base their own definitions of
+% raised characters on their associated dimensions.\footnote{Also compare with Ex.~12 in
+% Ref.~\citenum{wermuth:2023} for an attempt to automate vertical alignment.}
%
% \begin{caution}
% The height adjustment disables a font's built-in kerning.
@@ -2051,7 +2392,7 @@ end
%
%
% \subsubsection{Capital Hyphen}\label{sec:capital-hyphen}
-% \index{raised character>hyphen}
+% \index{raised character>hyphen|userman}
%
% \DescribeMacro{\capitalhyphen}
% \DescribeMacro{\capitalhyphen*}
@@ -2081,7 +2422,7 @@ end
%
%
% \subsubsection{Capital Dash}\label{sec:capital-dash}
-% \index{raised character>en-dash}
+% \index{raised character>en-dash|userman}
%
% \DescribeMacro{\capitalendash}
% \DescribeMacro{\capitalendash*}
@@ -2127,7 +2468,7 @@ end
%
%
% \subsubsection{Number Dash (Figure Dash)}\label{sec:number-dash}
-% \index{raised character>number dash}
+% \index{raised character>number dash|userman}
%
% \DescribeMacro{\figuredash}
% \DescribeMacro{\figuredash*}
@@ -2152,49 +2493,63 @@ end
% The actual amount the en-dash gets raised in \cs{figuredash} is determined by
% \hyperref[item:raisefiguredash]{|raisefiguredash|}.
%
-% Values of .05em to .1em are typical for fonts that need this kind of correction and~.1em is a
-% good starting point. \Cref{tab:raisefiguredash} summarizes some findings.
+% Values of .05\,em to .1\,em are typical for fonts that need this kind of correction
+% and~.1\,em is a good starting point. \Cref{tab:raisefiguredash} summarizes some findings.
%
% \begin{table}
% \centering
% \caption[Suggested raise amounts for \cs{figuredash}]%
-% {Suggested values for raising the en-dash between lining numerals of some selected
-% fonts.}
+% {Suggested values for raising \cs{figuredash}, which actually is an en-dash,
+% between lining numerals of some selected fonts in multiples of~1\,em.}
% \label{tab:raisefiguredash}
%
+% \newcommand*{\fbbmark}{\tablenotemark{\tablenotesymbol{1}}}
+%
% \begin{tabfigures}
-% \begin{tabular}{@{}l>{\RaggedRight}p{20em}@{}}
+% \begin{tabularx}{\linewidth}{@{}>{\RaggedRight}Xl@{}}
% \toprule
-% Raise & Font Name \\
-% em & \\
+% Font & Raise \\
% \midrule
-% 0 & Alegreya\index{font>Alegreya}, Arvo\index{font>Arvo},
-% Bitter\index{font>Bitter}, Clara\index{font>Clara},
-% \acronym{EB}~Garamond\index{font>EB Garamond=\acronym{EB} Garamond},
-% Gentium\index{font>Gentium},
-% Ibarra Real Nova\index{font>Ibarra Real Nova},
-% \acronym{Inria}~Serif\index{font>Inria Serif=\acronym{Inria} Serif},
-% Libertine\index{font>Libertine}, Libertinus\index{font>Libertinus},
-% Merriweather\index{font>Merriweather},
-% \acronym{PT}~Serif\index{font>PT Serif=\acronym{PT} Serif},
-% Roboto Slab\index{font>Roboto Slab}, Spectral\index{font>Spectral},
-% \acronym{STIX}\index{font>STIX=\acronym{STIX}}, and many more \\
-% .05 & fbb\index{font>fbb}, Source Serif Pro\index{font>Source Serif Pro} \\
-% .0667 & Libre Baskerville\index{font>Libre Baskerville},
-% Crimson Pro\index{font>Crimson Pro},
-% Erewhon\index{font>Erewhon}, Droid Serif\index{font>Droid Serif} \\
-% .1 & \acronym{GFS}~Artemisia\index{font>GFS Artemisia=\acronym{GFS} Artemisia},
-% Libre Caslon\index{font>Libre Caslon},
-% Coelacanth\index{font>Coelacanth}, Crimson Pro\index{font>Crimson Pro},
-% Crimson Text\index{font>Crimson Text},
-% \TeX{} Gyre~Pagella\index{font>TeX Gyre Pagella=\TeX{} Gyre Pagella},
-% Quattrocento\index{font>},
-% \acronym{TX}~Fonts\index{font>TX Fonts=\acronym{TX} Fonts},
-% \acronym{ADF}~Venturis\index{font>ADF Venturis=\acronym{ADF} Venturis},
-% and many more \\
+% Alegreya\detoxindex{font>typeface>Alegreya|userman}, Arvo\detoxindex{font>typeface>Arvo|userman},
+% Bitter\detoxindex{font>typeface>Bitter|userman}, Clara\detoxindex{font>typeface>Clara|userman},
+% \acronym{EB}~Garamond\detoxindex{font>typeface>EB Garamond=\acronym{EB} Garamond|userman},
+% Gentium\detoxindex{font>typeface>Gentium|userman},
+% Ibarra Real Nova\detoxindex{font>typeface>Ibarra Real Nova|userman},
+% \acronym{Inria}~Serif\detoxindex{font>typeface>Inria Serif=\acronym{Inria} Serif|userman},
+% Libertine\detoxindex{font>typeface>Libertine|userman},
+% Libertinus\detoxindex{font>typeface>Libertinus Serif|userman},
+% Merriweather\detoxindex{font>typeface>Merriweather|userman},
+% \acronym{PT}~Serif\detoxindex{font>typeface>PT Serif=\acronym{PT} Serif|userman},
+% Roboto Slab\detoxindex{font>typeface>Roboto Slab|userman},
+% Spectral\detoxindex{font>typeface>Spectral|userman},
+% \acronym{STIX}\detoxindex{font>typeface>STIX=\acronym{STIX}|userman}, and many more &
+% .0 \\
+% fbb\fbbmark\detoxindex{font>typeface>fbb|userman},
+% Source Serif Pro\detoxindex{font>typeface>Source Serif Pro|userman} &
+% .05 \\
+% Libre Baskerville\detoxindex{font>typeface>Libre Baskerville|userman},
+% Crimson Pro\detoxindex{font>typeface>Crimson Pro|userman},
+% Erewhon\detoxindex{font>typeface>Erewhon|userman},
+% Droid Serif\detoxindex{font>typeface>Droid Serif|userman} &
+% .0667 \\
+% \acronym{GFS}~Artemisia\detoxindex{font>typeface>GFS Artemisia=\acronym{GFS} Artemisia|userman},
+% Libre Caslon\detoxindex{font>typeface>Libre Caslon|userman},
+% Coelacanth\detoxindex{font>typeface>Coelacanth|userman},
+% Crimson Pro\detoxindex{font>typeface>Crimson Pro|userman},
+% Crimson Text\detoxindex{font>typeface>Crimson Text|userman},
+% \TeX{} Gyre~Pagella\detoxindex{font>typeface>TeX Gyre Pagella=\TeX{} Gyre Pagella|userman},
+% Quattrocento\detoxindex{font>typeface>Quattrocento|userman},
+% \acronym{TX}~Fonts\detoxindex{font>typeface>TX Fonts=\acronym{TX} Fonts|userman},
+% \acronym{ADF}~Venturis\detoxindex{font>typeface>ADF Venturis=\acronym{ADF} Venturis|userman},
+% and many more &
+% .1 \\
% \bottomrule
-% \end{tabular}
+% \end{tabularx}
% \end{tabfigures}
+%
+% \begin{tablenotes}
+% \fbbmark\enspace Free Bembo.
+% \end{tablenotes}
% \end{table}
%
% Other macros may be redefined with \cs{figuredash} for a consistent appearance of the copy,
@@ -2210,7 +2565,7 @@ end
%
% \subsubsection[Multiplication Sign]%
% {Multiplication Sign -- Times~\sample{\texttimes}}\label{sec:mult-sign}
-% \index{raised character>multiplication sign}
+% \index{raised character>multiplication sign|userman}
%
% \DescribeMacro{\capitaltimes}
% The \cs{capitaltimes}~macro is a variation of the
@@ -2232,17 +2587,19 @@ end
%
%
% \subsubsection{Guillemets}\label{sec:guillemets}
-% \index{raised character>guillemets}
+% \index{raised character>guillemets|userman}
%
% Another possible typographic problem this package addresses is that both sets --~single and
% double quotes~-- of guillemets may suffer from a too small distance to the baseline.
%
% For the implementation \packagename{typog} relies on the T1\footnote{Font
-% encoding~T1\index{font>encoding} can be forced via \cs{usepackage}|[T1]\{fontenc\}| in the
-% document preamble.}~font encoding not on package~\packagename{babel}.
+% encoding~T1\detoxindex{font>encoding|userman} can be forced via
+% \cs{usepackage}|[T1]\{fontenc\}| in the document preamble.}~font encoding not on
+% package~\packagename{babel}.
%
%
% \paragraph{Lowercase Versions.}
+%
% \DescribeMacro{\singleguillemetleft}
% \DescribeMacro{\singleguillemetright}
% \DescribeMacro{\doubleguillemetleft}
@@ -2280,33 +2637,34 @@ end
% or lining numerals is \cs{Singleguillemetleft} and \cs{Singleguillemetright} and
% \cs{Doubleguillemetleft} and \cs{doubleguillemetright}. Mnemonic: These macros start with an
% uppercase letter. Their height above the baseline is adjusted with
-% \hyperref[item:raisecapitalguillemets]{|raisecapitalguillemets|}. Values of .025em to .075em
-% are typical for fonts that need this kind of correction. \Cref{tab:raiseguillemets}
+% \hyperref[item:raisecapitalguillemets]{|raisecapitalguillemets|}. Values of .025\,em to
+% .075\,em are typical for fonts that need this kind of correction. \Cref{tab:raiseguillemets}
% summarizes some findings.
%
% \begin{table}
% \centering
% \caption[Suggested raise amounts for guillemets]%
-% {Suggested values for raising guillemets of some selected fonts.}
+% {Suggested values for raising guillemets of some selected fonts in multiples
+% of~1\,em.}
% \label{tab:raiseguillemets}
%
% \begin{tabfigures}
-% \begin{tabular}{@{}cc>{\RaggedRight}p{20em}@{}}
+% \def~{\hphantom{0}}
+% \begin{tabular}{@{}>{\RaggedRight}p{.5\textwidth}cc@{}}
% \toprule
-% \multicolumn{2}{@{}c}{Raise} & Font Name \\
-% Lowercase & Uppercase & \\
-% em & em & \\
+% Font & Uppercase & Lowercase \\
% \midrule
-% 0 & .05\hphantom{00} &
-% \acronym{EB}~Garamond\index{font>EB Garamond=\acronym{EB} Garamond},
-% Libertinus\index{font>Libertinus},
-% Merriweather\index{font>Merriweather}, and many more \\
-% .025 & .05\hphantom{00} & Gentium\index{font>Gentium} \\
-% .04\hphantom{0} & .0667 &
-% \acronym{ADF}~Baskervald\index{font>ADF Baskervald=\acronym{ADF} Baskervald} \\
-% .05\hphantom{0} & .0625 &
-% \acronym{GFS}~Artemisia\index{font>GFS Artemisia=\acronym{GFS} Artemisia},
-% \acronym{GFS}~Didot\index{font>GFS Didot=\acronym{GFS} Didot} \\
+% \acronym{EB} Garamond\detoxindex{font>typeface>EB Garamond=\acronym{EB} Garamond|userman},
+% Libertinus\index{font>typeface>Libertinus Serif|userman},
+% Merriweather\index{font>typeface>Merriweather|userman}, and many more &
+% .05~~ & .0~~ \\
+% Gentium\index{font>typeface>Gentium|userman} &
+% .05~~ & .025 \\
+% \acronym{GFS} Artemisia\detoxindex{font>typeface>GFS Artemisia=\acronym{GFS} Artemisia|userman},
+% \acronym{GFS} Didot\detoxindex{font>typeface>GFS Didot=\acronym{GFS} Didot|userman} &
+% .0625 & .05~ \\
+% \acronym{ADF} Baskervald\index{font>typeface>ADF Baskervald=\acronym{ADF} Baskervald|userman} &
+% .0667 & .04~ \\
% \bottomrule
% \end{tabular}
% \end{tabfigures}
@@ -2322,7 +2680,8 @@ end
% \cs{let}\cs{sq}=\cs{singlequotes}
% \end{codeexample}
%
-% and similar definitions for \cs{Singlequotes}, \cs{doublequotes}, and~\cs{Doublequotes}.
+% \noindent
+% and similar definitions for \cs{Singlequotes}, \cs{doublequotes}, and \cs{Doublequotes}.
%
% Users working according to the French typesetting conventions will want to add extra
% spacing between the guillemets and the macro argument already in these macros.
@@ -2334,7 +2693,7 @@ end
%
%
% \paragraph{Interaction with package~\packagename{csquotes}.}
-% \index{csquotes=\packagename{csquotes} (package)}
+% \index{csquotes=\packagename{csquotes} (package)|userman}
%
% The users of package~\packagename{csquotes}
% can hook up the guillemets as defined by \packagename{typog}
@@ -2367,21 +2726,374 @@ end
% \end{futuredirection}
%
%
+% \subsection[Vertically Adjust Label Items]
+% {Vertically Adjust Label Items of
+% Environment \code{itemize}}\label{sec:adjust-label-items}
+% \index{label items|userman}
+%
+% \begin{whittyquote}
+% Perfection of planned layout \\
+% is archieved only by institutions \\
+% on the point of collapse. \\
+% \capitalemdash*~\propername{Cyril Northcote Parkinson}
+% \end{whittyquote}
+%
+% \noindent
+% The symbols that \LaTeX{} uses to distinguish the items of |itemize|~lists do not always
+% align well in the vertical direction with the following text. Sometimes the label is too
+% low, especially if followed by an uppercase (initial) letter. In rare occasions the label is
+% placed too far above the baseline. If any label has been taken from a math-font vertical
+% alignment with the text font is almost purely accidental.\footnote{The exception being
+% mathematics typeset as text via package~\packagename{mathastext}~\cite{package:mathastext}.}
+%
+% \hangindent=2\parindent
+% \hangafter=-3
+% \noindent
+% \DescribeMacro{\uppercaseadjustlabelitems}
+% \DescribeMacro{\lowercaseadjustlabelitems}
+% \DescribeMacro{\noadjustlabelitems}
+% \sinceversion{All three since v0.4}
+% Package~\packagename{typog} lets the user vertically align the \code{itemize}~labels for
+% subsequent uppercase or lowercase letters, where the designations~\singlequotes{uppercase}
+% and \singlequotes{lowercase} are just names for two four-tuples of lengths (technically:
+% |dimen|s) to shift the labels up or down.
+%
+% \begin{synopsis}
+% \label{syn:lowercaseadjustlabelitems}
+% \label{syn:noadjustlabelitems}
+% \label{syn:uppercaseadjustlabelitems}
+% \cs{uppercaseadjustlabelitems}\marg{levels-to-adjust} \\
+% \cs{lowercaseadjustlabelitems}\marg{levels-to-adjust} \\
+% \cs{noadjustlabelitems}\marg{levels-to-adjust}
+% \end{synopsis}
+%
+% Apply uppercase adjustment, lowercase adjustment or no adjustment to the labels in
+% |itemize|~environments at the \meta{levels-to-adjust}. The adjustment values themselves,
+% this is the vertical shifts are configured with
+% options~\hyperref[item:uppercaselabelitemadjustments]{\code{uppercaselabelitemadjustments}}
+% and~\hyperref[item:lowercaselabelitemadjustments]{\code{lowercaselabelitemadjustments}}.
+% They are doubly font dependent: on the one hand the font where the label itself comes from
+% and on the other hand the font of the copy.
+%
+% The argument \meta{levels-to-adjust} is a --~possibly empty~-- comma separated list of the
+% levels the respective adjustments are to be applied to. The levels themselves are given as
+% \emph{decimal} numbers, this is, 1, 2, 3, 4 or the special value~\sample{*} which stands for
+% all four levels. An empty argument list also has a special meaning. Used within any
+% \code{itemize}~environment it automatically applies the adjustment to exactly this level.
+%
+% \begin{example}
+% \begin{typogsetup}{uppercaselabelitemadjustments={.1em}}
+% With the flexible syntax the following settings are possible.
+%
+% \renewcommand*{\labelitemi}{{\small$\rhd$}}%
+% \begin{itemize}\uppercaseadjustlabelitems{}
+% \item Correct all |itemize| labels for uppercase letters.
+%
+% \begin{codeexample}
+% \cs{uppercaseadjustlabelitems}\{*\}
+% \end{codeexample}
+%
+% \item Adjust nesting levels~1, 2, and~3 for uppercase letters and level~4 for lowercase.
+%
+% \begin{codeexample}
+% \cs{lowercaseadjustlabelitems}\{4\} \\
+% \cs{uppercaseadjustlabelitems}\{2,3,1\}
+% \end{codeexample}
+%
+% \item Within an |itemize|~environment just turn off any correction for this level whatever
+% it may be.
+%
+% \begin{codeexample}
+% \cs{begin}\{itemize\} \\
+% \cs{noadjustlabelitems}\{\} \\
+% \cs{item} \dots \\
+% \cs{end}\{itemize\}
+% \end{codeexample}
+%
+% \item Override \cs{labelitemi} with a right-pointing triangle and adjust its vertical
+% position inside of a \code{typogsetup}~environment.
+%
+% \begin{codeexample}
+% \cs{begin}\=\{typogsetup\} \\
+% \>\{uppercaselabelitemadjustments=\{.1em\}\} \\
+% 12\=34567890 \kill
+% \>\cs{renewcommand*}\{\cs{labelitemi}\}\{\{\cs{small}\$\cs{rhd}\$\}\} \\
+% \>\cs{begin}\{itemize\} \\
+% \>\cs{uppercaseadjustlabelitems}\{\} \\
+% \>\cs{item} \dots \\
+% \>\cs{end}\{itemize\} \\
+% \cs{end}\{typogsetup\}
+% \end{codeexample}
+% \end{itemize}
+%
+% The observant reader will have noticed that the itemized list in this emphasized section
+% uses the code of the last example.
+% \end{typogsetup}
+% \end{example}
+%
+%
+% \paragraph{Setup.}
+%
+% To assist the user in finding the desired adjustments of the labels of \packagename{typog}
+% provides macros that help setting up
+% \hyperref[item:lowercaselabelitemadjustments]{\code{lowercaselabelitemadjustments}} and
+% \hyperref[item:uppercaselabelitemadjustments]{\code{uppercaselabelitemadjustments}}. Their
+% intended uses are in the draft phase of a document or in non-printed sections of the text.
+%
+% The macros assume a \singlequotes{correct} height that they derive from the measured height
+% of a sample text scaled by a user-defined factor, which defaults
+% to~\nativetextfraction{1}{2}.\footnote{The default factor of~.5 hearkens back to
+% \propername{Strizver's} suggestion that \doublequotes{[b]ullets should be centered on either
+% the cap~height or x-height of the neighboring text, \dots.}~\cite[p.~220]{strizver:2014}.}
+% The then correct height gets indicated by a thin horizontal line parallel to the baseline.
+% Thus, at sufficiently high magnifications it is possible to judge whether a label gets
+% typeset too high or too low with respect to this reference line.
+%
+% \begin{note}
+% The macros use the actual height of a given sample~text. So, a lowercase~sample should not
+% contain any letters with ascenders.
+%
+% Swashes whether upper- or lowercase always need special attention.
+% \end{note}
+%
+% \DescribeMacro{\typogadjuststairs}
+% \sinceversion{Since v0.4}
+% To get a quick overview how the four \code{itemize}~labels align vertically
+% \cs{typogadjuststairs} draws them at user-defined steps, typically
+% \nativetextfraction{1}{4}\,pt, \nativetextfraction{1}{3}\,pt, or
+% \nativetextfraction{1}{2}\,pt. It ignores any existing adjustments and in that way can be
+% utilized as a first configuration step or, for a small \meta{step-size} and a high
+% \meta{number-of-steps}, for an easy refinement.
+%
+% \begin{synopsis}
+% \begin{tabbing}
+% \label{syn:typogadjuststairs}
+% \cs{typogadjuststairs}\=[\meta{scale-factor}=.5] \\
+% \>\marg{step-size}\marg{number-of-steps} \\
+% \>\marg{sample}
+% \end{tabbing}
+% \end{synopsis}
+%
+% Generate stairs of \meta{number-of-steps} vertically shifted label items; use the next odd
+% number, if \meta{number-of-steps} is even. Draw a reference hairline at \meta{scale-factor}
+% times the height of \meta{sample}, where \meta{scale-factor} defaults to~.5. The stairs
+% start at a vertical shift of
+% \begin{gather*}
+% -\frac{\text{\meta{number-of-steps}} - 1}{2} \times \text{\meta{step-size}} \\
+% \intertext{and repeat up}
+% \frac{\text{\meta{number-of-steps}} - 1}{2} \times \text{\meta{step-size}}.
+% \end{gather*}
+%
+% \noindent
+% The central step --~which is always surrounded by a bit more space~-- shows the neutral
+% alignment, this is~0\,pt. \cs{typogadjuststairs} never prints the contents of \meta{sample}.
+%
+% \begin{example}
+% Play ball!
+%
+% \begin{center}
+% \typogadjuststairs{.25pt}{9}{ABC}
+% \end{center}
+%
+% This is the result of \code{\string\typogadjuststairs\{.25pt\}\{9\}\{ABC\}} with the
+% document's definitions of \cs{labelitem}\meta{N}. The fifth label~item in each line is the
+% uncorrected one.
+% \end{example}
+%
+% \hangindent=2\parindent
+% \hangafter=-3
+% \noindent
+% \DescribeMacro{\typoguppercaseadjustcheck}
+% \DescribeMacro{\typoglowercaseadjustcheck}
+% \sinceversion{Both since v0.4}
+% For a quick and easy check how the four label items vertically align \emph{as configured} use
+% \code{\string\typoguppercaseadjustcheck} and \code{\string\typoglowercaseadjustcheck}.
+% Experienced users with a keen eye for type can apply these macros even in the initial setup.
+% An accurate determination of \code{uppercaselabelitemadjustments} and
+% \code{lowercaselabelitemadjustments} is preferably done at a high magnification (400\% to
+% 600\% on a 100\,dpi screen) with a representative sample of initial letters.
+%
+% \begin{synopsis}
+% \label{syn:typoguppercaseadjustcheck}
+% \label{syn:typoglowercaseadjustcheck}
+% \cs{typoguppercaseadjustcheck}[\meta{scale-factor}=.5]\marg{sample} \\
+% \cs{typoglowercaseadjustcheck}[\meta{scale-factor}=.5]\marg{sample}
+% \end{synopsis}
+%
+% Typeset all four label items adjusted for uppercase or for lowercase with an indicator line
+% at \meta{scale-factor} times the \meta{sample}'s actual height. The default
+% \meta{scale-factor} is~.5. Both macros refer to the currently configured values for the
+% uppercase or lowercase adjustments but they are independent of any settings done with
+% \cs{uppercaseadjustlabelitems}, \cs{lowercaseadjustlabelitems}, or \cs{noadjustlabelitems}.
+% Again, \meta{sample} does not get printed.
+%
+% \begin{example}
+% Uppercase check with \code{\string\typoguppercaseadjustcheck\{ABCXYZ\}}:
+%
+% \centering
+% ABGH\typoguppercaseadjustcheck{ABCXYZ}QWYZ,\enspace
+% 0123\typoguppercaseadjustcheck{ABCXYZ}4567
+%
+% \justifying
+% \noindent
+% and similarly for lowercase: \code{\string\typoglowercaseadjustcheck\{acexyz\}}:
+%
+% \centering
+% ace\typoglowercaseadjustcheck{acexyz}mno,\enspace
+% bdf\typoglowercaseadjustcheck{acexyz}gjy,\enspace
+% {\proportionaloldstylefigures 0123\typoglowercaseadjustcheck{acexyz}4567,}
+%
+% \justifying
+% \noindent
+% where we have bracketed the macro calls with selected uppercase and lowercase letters, or
+% suitable figures.
+% \end{example}
+%
+% In \Cref{tab:labelitemadjustvalues} on \cpageref{tab:labelitemadjustvalues} we collected some
+% suggestions for adjustment values in the \emph{default} case when the label items are not
+% redefined by the user and expand like
+%
+% \begin{center}
+% \def\arraystretch{1}
+% \begin{tabular}{@{}l@{\enspace\(\vdash\)\enspace}l@{}}
+% \cs{labelitemi} & \dumpmacro{\labelitemi}, \\
+% \cs{labelitemii} & \dumpmacro{\labelitemii}, \\
+% \cs{labelitemiii} & \dumpmacro{\labelitemiii}, and \\
+% \cs{labelitemiv} & \dumpmacro{\labelitemiv}.
+% \end{tabular}
+% \end{center}
+%
+% \noindent
+% They display as \sample{\labelitemi}, \sample{\labelitemii}, \sample{\labelitemiii}, and
+% \sample{\labelitemiv}, respectively.
+%
+% \begin{table}
+% \centering
+% \caption[Label item adjustment suggestions]%
+% {Some suggested values for the vertical adjustments of label items. The table
+% assumes that the default definitions (of class~\packagename{article}) for
+% \cs{labelitem}\meta{N} are in effect. The \code{itemize}-list levels~\code{i},
+% \code{ii}, \code{iii} and~\code{iv} are referred to with \(N = 1, 2, 3, 4\). All
+% lengths are given as printer points~(pt) and refer to a document font size of
+% \formatdimen*{10pt}.}
+% \label{tab:labelitemadjustvalues}
+%
+% \newcommand*{\etbbmark}{\tablenotemark{\tablenotesymbol{1}}}
+% \newcommand*{\xchartermark}{\tablenotemark{\tablenotesymbol{2}}}
+% \newcommand*{\kpmark}{\tablenotemark{\tablenotesymbol{3}}}
+% \newcommand*{\palladiomark}{\tablenotemark{\tablenotesymbol{4}}}
+% \newcommand*{\utopiamark}{\tablenotemark{\tablenotesymbol{5}}}
+%
+% \begin{tabfigures}
+% \def~{\hphantom{0}}
+% \def\mc#1{#1~~~}
+% \noindent
+% \makebox[0pt]{%
+% \begin{tabular}{@{}l*{4}{r}@{\qquad}*{4}{r}@{}}
+% \toprule
+% Font Name &
+% \multicolumn{4}{c}{Uppercase Adjustments} & \multicolumn{4}{c@{}}{Lowercase Adjustments} \\
+% {} &
+% \mc{1} & \mc{2} & \mc{3} & \mc{4} &
+% \mc{1} & \mc{2} & \mc{3} & \mc{4} \\
+% \midrule
+% \acronym{ADF} Accanthis\detoxindex{font>typeface>ADF Venturis=\acronym{ADF} Accanthis|userman} &
+% .5~~ & 1.5~~ & \textminus1.5~~ & 1.125 &
+% \textminus.75~ & .25~ & \textminus2.75~ & \textminus.125 \\
+% \acronym{ADF} Venturis\detoxindex{font>typeface>ADF Venturis=\acronym{ADF} Venturis|userman} &
+% .0~~ & 1.0~~ & .75~ & 1.0~~ &
+% \textminus.75~ & .0~~ & \textminus.25~ & .0~~ \\
+% \acronym{CM} Roman\detoxindex{font>typeface>CM Roman=\acronym{CM} Roman|userman} &
+% 1.0~~ & .75~ & 1.0~~ & 1.0~~ &
+% \textminus.25~ & \textminus.5~~ & \textminus.25~ & \textminus.25~ \\
+% Domitian\detoxindex{font>typeface>Domitian|userman} &
+% .25~ & 1.0~~ & .75~ & 1.0~~ &
+% \textminus1.0~~ & .0~~ & \textminus.325 & \textminus.25~ \\
+% Cochineal\detoxindex{font>typeface>Cochineal|userman} &
+% 1.0~~ & 1.0~~ & 1.0~~ & 1.0~~ &
+% \textminus.125 & \textminus.125 & \textminus.125 & \textminus.125 \\
+% \acronym{EB} Garamond\detoxindex{font>typeface>EB Garamond=\acronym{EB} Garamond|userman} &
+% .0~~ & 1.25~ & \textminus.875 & 1.325 &
+% \textminus1.5~~ & .0~~ & \textminus2.0~~ & 0.125 \\
+% etbb\etbbmark\detoxindex{font>typeface>etbb|userman} &
+% .25~ & 1.0~~ & 1.125 & .5~~ &
+% \textminus1.0~~ & \textminus.0~~ & \textminus.0~~ & \textminus.5~~ \\
+% Extended Charter\xchartermark\detoxindex{font>typeface>Extended Charter|userman} &
+% \textminus.25~ & 1.0~~ & 1.75 & .125 &
+% \textminus1.125 & .0~~ & .875 & \textminus.875 \\
+% Gentium\detoxindex{font>typeface>Gentium|userman} &
+% .0~~ & .75~ & .0~~ & .0~~ &
+% \textminus.5~~ & \textminus.25~ & \textminus.75~ & \textminus1.0~~ \\
+% \acronym{GFS} Bodoni\detoxindex{font>typeface>GFS Bodoni=\acronym{GFS} Bodoni|userman} &
+% \textminus.25~ & .625 & 1.0~~ & 1.125 &
+% \textminus1.25~ & \textminus.625 & \textminus.5~~ & \textminus.25~ \\
+% \acronym{GFS} Didot\detoxindex{font>typeface>GFS Didot=\acronym{GFS} Didot|userman} &
+% \textminus1.5~~ & .75~ & 1.0~~ & 1.25~ &
+% \textminus2.75~ & \textminus.25~ & \textminus.25~ & .25~ \\
+% \acronym{IBM} Plex Serif\detoxindex{font>typeface>IBM Plex Serif=\acronym{IBM} Plex Serif|userman} &
+% .5~~ & .5~~ & \textminus1.325 & .5~~ &
+% \textminus.25~ & \textminus.25~ & \textminus2.25~ & \textminus.25~ \\
+% \acronym{KP} Serif\kpmark\detoxindex{font>typeface>KP Serif=\acronym{KP} Serif|userman} &
+% .0~~ & 1.0~~ & 1.25~ & .75~ &
+% \textminus1.0~~ & .0~~ & .0~~ & \textminus.5~~ \\
+% Libertinus Serif\detoxindex{font>typeface>Libertinus Serif|userman} &
+% 1.0~~ & .75~ & 1.125 & .75~ &
+% .0~~ & \textminus.325 & .0~~ & \textminus.25~ \\
+% \acronym{ML} Modern\detoxindex{font>typeface>ML Modern=\acronym{ML} Modern|userman} &
+% 1.25~ & .75~ & 1.0~~ & .125 &
+% .0~~ & \textminus.5~~ & \textminus.25~ & \textminus.125 \\
+% Source Serif Pro\detoxindex{font>typeface>Source Serif Pro|userman} &
+% .125 & .75~ & \textminus1.0~~ & .125 &
+% \textminus.75~ & .0~~ & \textminus2.0~~ & \textminus.75~ \\
+% Spectral\detoxindex{font>typeface>Spectral|userman} &
+% .625 & .625 & \textminus1.5~~ & .625 &
+% \textminus.25~ & \textminus.25~ & \textminus2.5~~ & \textminus.25~ \\
+% \acronym{STIX}\detoxindex{font>typeface>STIX=\acronym{STIX}|userman} &
+% 1.0~~ & 1.0~~ & .75~ & 1.0~~ &
+% .0~~ & .0~~ & .0~~ & .0~~ \\
+% \acronym{URW} Palladio\palladiomark\detoxindex{font>typeface>URW Palladio=\acronym{URW} Palladio|userman} &
+% .25~ & 1.125 & 1.0~~ & 1.0~~ &
+% \textminus1.0~~ & \textminus.125 & \textminus.125 & \textminus.125 \\
+% Utopia Regular\utopiamark\detoxindex{font>typeface>Utopia Regular|userman} &
+% .0~~ & 1.0~~ & .75~ & 1.0~~ &
+% \textminus.75~ & .0~~ & \textminus.25~ & .0~~ \\
+% \bottomrule
+% \end{tabular}}
+% \end{tabfigures}
+%
+% \begin{tablenotes}
+% \etbbmark\enspace \propername{Edward Tufte}'s Bembo in package~\packagename{ETbb}. Note
+% the two initial capital letters in the filename.
+%
+% \xchartermark\enspace Found in package \packagename{XCharter}. Again note the two
+% initial capitals in the filename.
+%
+% \kpmark\enspace In package \packagename{kpfonts}.
+%
+% \palladiomark\enspace Contained in package~\packagename{mathpazo}.
+%
+% \utopiamark\enspace Utopia is available through package~\packagename{fourier} or
+% package~\packagename{mathdesign}. In the latter case pass option~\code{adobe-utopia} to
+% the package.
+% \end{tablenotes}
+% \end{table}
+%
+%
% \subsection[Align Last Line]
% {Align Last Line of a Paragraph}\label{sec:align-last-line}
-% \index{paragraph>align last line}
+% \index{paragraph>align last line|userman}
%
% The usual algorithms of \LaTeX{} typeset the last line of a paragraph flush with the left
% margin unless |center|, |raggedleft| or |Centering|, |FlushRight|
% (package~\packagename{ragged2e}~\cite{package:ragged2e}) are in effect. For an instructive
% discussion consult Ch.~17, \doublequotes{Paragraph End}, of Ref.~\citenum{eijkhout:2007}.
-% The following environments allow to adjust the last lines of paragraphs in different ways.
+% The following environments adjust the last lines of paragraphs in different ways.
%
% \DescribeEnv{lastlineraggedleftpar}
% \DescribeEnv{lastlineflushrightpar}
-% The environment |lastlineraggedleftpar|\index{paragraph>align last line>flush right} adjusts
-% the various skips such that the last lines of the paragraphs gets typeset flush with the
-% right margin.
+% The environment \code{lastlineraggedleftpar}\index{paragraph>align last line>flush right|userman}
+% adjusts the various skips such that the last lines of the paragraphs gets typeset flush with
+% the right margin.
%
% \begin{synopsis}\label{syn:lastlineraggedleftpar}\label{syn:lastlineflushrightpar}
% \cs{begin}|{lastlineraggedleftpar}| \\
@@ -2393,8 +3105,9 @@ end
% The name |lastlineflushrightpar| is an alias for~\code{lastlineraggedleftpar}.
%
% \DescribeEnv{lastlinecenteredpar}
-% Center\index{paragraph>align last line>centered} the last lines of the paragraphs enclosed by
-% this environment.\footnote{Also compare the approach taken in Ref.~\citenum{wermuth:2018}.}
+% Center\index{paragraph>align last line>centered|userman} the last lines of the paragraphs
+% enclosed by this environment.\footnote{Also compare the approach taken in
+% Ref.~\citenum{wermuth:2018}.}
%
% \begin{synopsis}\label{syn:lastlinecenteredpar}
% \cs{begin}|{lastlinecenteredpar}| \\
@@ -2412,7 +3125,7 @@ end
% \needtocspace
% \subsection[Fill Last Line]
% {Fill Last Line of a Paragraph}\label{sec:fill-last-line}
-% \index{paragraph>fill last line}
+% \index{paragraph>fill last line|userman}
%
% The problem of when and how to \singlequotes{fill} the last line of a paragraph is quite
% intricate. We first define the problem then we proceed to general purpose functions and we
@@ -2421,7 +3134,7 @@ end
%
% \subsubsection{Problem Definition}
%
-% Depending on the value of \cs{parindent}, either zero or nonzero, there may be the desire to
+% Depending on the value of \cs{parindent}, either zero or nonzero, there may be the need to
% control the length of the last line of a paragraph.
%
% \iffalse
@@ -2562,7 +3275,7 @@ end
% \includegraphics{crooked-paragraphs-3.mps}
% \end{center}
% \end{minipage}\footnotetext{Package~\packagename{parskip} defines \cs{parskip}
-% as \mbox{6pt plus 2pt} for a base size of~10pt.}
+% as \mbox{6\,pt plus 2\,pt} for a base size of~10\,pt.}
%
% \medskip
% \begin{minipage}{\linewidth}
@@ -2576,7 +3289,7 @@ end
%
% The suggestions for the gap-width vary from two~em to twice the width of a
% \singlequotes{typical} \cs{parindent}\footnote{% For example, \LaTeX's class
-% \packagename{article} uses a \cs{parindent} of~25pt.} for the gap~\cite{carlisle:1996}.
+% \packagename{article} uses a \cs{parindent} of~25\,pt.} for the gap~\cite{carlisle:1996}.
% \end{enumerate}
%
% \begin{tip}
@@ -2598,9 +3311,10 @@ end
% them should have certain advantageous properties.
%
% \begin{itemize}
-% \item Technically, the paragraphs need to contain enough glue (see
-% e.\,g.~\cref{sec:sloppy-paragraphs}) to achieve a low badness such that the desired
-% paragraph end is deemed feasible by \TeX.
+% \item Technically, the paragraphs need to contain enough glue (see for example
+% \cref{sec:sloppy-paragraphs}) to achieve a low badness such that the desired paragraph
+% end is deemed feasible by \TeX.\shiftedmarginnote{This \code{itemize} list demonstrates
+% vertically adjusted label items (\cref{sec:adjust-label-items}).}
%
% \item Aesthetically, the paragraphs must be long enough to absorb the change in last-line
% fill level otherwise their gray-values visibly deviate from the
@@ -2618,18 +3332,21 @@ end
% \item End-of-paragraph intervention.\label{enum:end-of-paragraph-intervention}
%
% \begin{enumerate}[notopsep]
-% \item Tie~\sample{\texttt{\char126}}\label{enum:tie-last-words}\index{paragraph>fill last line>tie}
+% \item Tie~\sample{\texttt{\char126}}\label{enum:tie-last-words}
+% \index{paragraph>fill last line>tie|userman}
%
% Tie the last words.
%
% The problem with the tie may be a hyphenation of one of the words that participates in
% the tie. The next item avoids this disadvantage.
%
-% \item \cs{mbox}\label{enum:mbox-last-words}\index{paragraph>fill last line>mbox=\cs{mbox}}
+% \item \cs{mbox}\label{enum:mbox-last-words}
+% \index{paragraph>fill last line>mbox=\cs{mbox}|userman}
%
% Join the last words or inline equation at the end of the paragraph with an~\cs{mbox}.
%
-% \item \cs{linebreak}\label{enum:linebreak}\index{paragraph>fill last line>linebreak=\cs{linebreak}}
+% \item \cs{linebreak}\label{enum:linebreak}
+% \index{paragraph>fill last line>linebreak=\cs{linebreak}|userman}
%
% Add a \cs{linebreak} to the back part of the paragraph (approximately where the
% \cs{mbox} of item~\ref{enum:mbox-last-words} would start) in a way that the last line
@@ -2646,7 +3363,8 @@ end
% \item Uniform paragraph change.\label{enum:uniform-paragraph-change}
%
% \begin{enumerate}[notopsep]
-% \item Vary spacing.\label{enum:vary-spacing}\index{font>spacing}
+% \item Vary spacing.\label{enum:vary-spacing}
+% \index{font>spacing|userman}
%
% Modify the inter-word spacing, for example, with the macros introduced in
% \cref{sec:looser-tighter-spacing}.
@@ -2655,13 +3373,15 @@ end
% or~\hyperref[syn:tightspacing]{|tightspacing|}.
% Increase the spacing~\meta{level} until the last line gets the desired length.
%
-% \item Vary font tracking.\label{enum:vary-font-tracking}\index{font>tracking}
+% \item Vary font tracking.\label{enum:vary-font-tracking}
+% \index{font>tracking|userman}
%
% Enclose the paragraph in a \hyperref[syn:setfonttracking]{\code{setfonttracking}}~group.
% See \cref{sec:tracking-control}. Increase or decrease the tracking in steps of
% \nativetextfraction{1}{1000}\,em until the last line looks good.
%
-% \item Vary font expansion.\label{enum:vary-font-expansion}\index{font>expansion}
+% \item Vary font expansion.\label{enum:vary-font-expansion}
+% \index{font>expansion|userman}
%
% Enclose the paragraph in a \hyperref[syn:setfontexpand]{\code{setfontexpand}}~group. See
% \cref{sec:font-expansion-control}.
@@ -2688,15 +3408,17 @@ end
%
% \DescribeEnv{shortenpar}
% \DescribeEnv{prolongpar}
-% The two environments |shortenpar|\index{paragraph>fill last
-% line>shortenpar=\code{shortenpar}} and |prolongpar|\index{paragraph>fill last
-% line>prolongpar=\code{prolongpar}} can be employed in quite general situations when a
+% The two environments
+% \code{shortenpar}\index{paragraph>fill last line>shortenpar=\code{shortenpar}|userman}
+% and \code{prolongpar}\index{paragraph>fill last line>prolongpar=\code{prolongpar}|userman}
+% can be employed in quite general situations when a
% paragraph should be typeset one line longer or shorter, e.\,g., to avoid a
-% widow~line\footnote{The last line of a paragraph becomes a \singlequotes{widow}\index{forlorn
-% line>widow} (ger.~\foreignphrase{Hurenkind}) if it starts the following page or column.} or
-% a club~line\footnote{The first line of a paragraph is called
-% \singlequotes{club}\index{forlorn line>club} or~\singlequotes{orphan}\index{forlorn
-% line>orphan} (ger.~\foreignphrase{Schusterjunge}) if it appears at the bottom of the page or
+% widow~line\footnote{The last line of a paragraph becomes a
+% \singlequotes{widow}\detoxindex{forlorn line>widow|userman} (ger.~\foreignphrase{Hurenkind}) if it
+% starts the following page or column.} or a club~line\footnote{The first line of a paragraph
+% is called \singlequotes{club}\detoxindex{forlorn line>club|userman}
+% or~\singlequotes{orphan}\detoxindex{forlorn line>orphan|userman}
+% (ger.~\foreignphrase{Schusterjunge}) if it appears at the bottom of the page or
% column.}~[\citenum{knuth:1986}, p.~104 and~\citenum{mittelbach:2018c}]. (See also
% \cref{sec:vtie-paragraph} for special functions to avoid clubs or widows.)
% \singlequotes{Accidentally}, they also change the length of the last line of the paragraph.
@@ -2730,7 +3452,8 @@ end
% parameter change.
%
% \DescribeEnv{covernextindentpar}
-% Environment |covernextindentpar|\index{paragraph>fill last line>covernextindentpar=\code{covernextindentpar}}
+% Environment \code{covernextindentpar}%
+% \index{paragraph>fill last line>covernextindentpar=\code{covernextindentpar}|userman}
% can be helpful for \hyperref[item:o1]{case~O1}, i.\,e., a too short last line.
%
% \begin{synopsis}\label{syn:covernextindentpar}
@@ -2747,9 +3470,10 @@ end
% (if \(\cs{parindent} = 0\)), or \meta{dim} if called with an optional argument.
%
% \DescribeEnv{openlastlinepar}
-% The next environment, |openlastlinepar|,\index{paragraph>fill last
-% line>openlastlinepar=\code{openlastlinepar}} takes care of \hyperref[item:o2]{case~O2},
-% i.\,e., a last line in a paragraph that is almost full or completely filled.
+% The next environment, \code{openlastlinepar},%
+% \index{paragraph>fill last line>openlastlinepar=\code{openlastlinepar}|userman}
+% takes care of \hyperref[item:o2]{case~O2}, i.\,e., a last line in a paragraph that is almost
+% full or completely filled.
%
% \begin{synopsis}\label{syn:openlastlinepar}
% \cs{begin}|{openlastlinepar}|\oarg{dim} \\
@@ -2769,13 +3493,15 @@ end
% last line is avoided, but the result may be of \hyperref[item:o1]{type~O1} nonetheless.
%
%
+% \toccontinuesonnextpage
% \needtocspace
% \Needspace{150pt}
-% \subsection{Spacing}\label{sec:spacing-control}\index{font>spacing}
+% \subsection{Spacing}\label{sec:spacing-control}
+% \index{font>spacing|userman}
%
% \begin{whittyquote}
-% 90~\% of design is typography. \\
-% And the other 90~\% is whitespace. \\
+% 90\% of design is typography. \\
+% And the other 90\% is whitespace. \\
% \capitalemdash*~\propername{Jeffrey Zeldman}
% \end{whittyquote}
%
@@ -2785,7 +3511,9 @@ end
% \cref{sec:microtype-frontend}.
%
%
-% \subsubsection[Looser\kernedslash Tighter]{Looser or Tighter Spacing}\label{sec:looser-tighter-spacing}\index{font>spacing>loose}\index{font>spacing>tight}
+% \subsubsection[Looser\kernedslash Tighter]{Looser or Tighter Spacing}\label{sec:looser-tighter-spacing}
+% \index{font>spacing>loose|userman}
+% \index{font>spacing>tight|userman}
%
%
% \begin{whittyquote}
@@ -2822,7 +3550,7 @@ end
%
% \begin{SCtable}[10]
% \caption[Spacing changes made by \code{loosespacing}]%
-% {Adjustments made by environment |loosespacing| to \cs{spaceskip}.
+% {Adjustments made by environment \code{loosespacing} to \cs{spaceskip}.
% The mapping of \meta{level} to the exact skip definitions are
% \(1 \mapsto \formatskip{1.05}{.5}{.1}\),
% \(2 \mapsto \formatskip{1.1}{.5}{.1}\),
@@ -2836,7 +3564,7 @@ end
% \def~{\hphantom{0}}%
% \begin{tabular}{@{}ccl@{}}
% \toprule
-% \meta{level} & Adjustment & Comment \\
+% \meta{level} & Adjustment & Note \\
% {} & \% & \\
% \midrule
% 0 & n/a & neutral \\
@@ -2861,29 +3589,29 @@ end
% \cref{tab:tightspacing}.
%
% \begin{SCtable}[10]
+% \def~{\hphantom{0}}
% \caption[Spacing changes made by \code{tightspacing}]%
-% {Adjustments made by environment |tightspacing| to \cs{spaceskip}.
+% {Adjustments made by environment \code{tightspacing} to \cs{spaceskip}.
% The mapping of \meta{level} to the exact skip definitions are
-% \(1 \mapsto \formatskip{.9875}{.0125}{.5\hphantom{000}}\)\!,
-% \(2 \mapsto \formatskip{.975}{.025}{.5\hphantom{00}}\)\!,
-% \(3 \mapsto \formatskip{.95}{.05}{.5\hphantom{0}}\)\!, and
+% \(1 \mapsto \formatskip{.9875}{.0125}{.5~~~}\)\!,
+% \(2 \mapsto \formatskip{.975}{.025}{.5~~}\)\!,
+% \(3 \mapsto \formatskip{.95}{.05}{.5~}\)\!, and
% \(\ge 4 \mapsto \formatskip{.9}{.1}{.5}\),
% where all factors scale with \cs{dimen2},
% the current font's space-width.}
% \label{tab:tightspacing}
%
% \begin{tabfigures}
-% \def~{\hphantom{0}}%
% \begin{tabular}{@{}ccl@{}}
% \toprule
-% \meta{level} & Adjustment & Comment \\
+% \meta{level} & Adjustment & Note \\
% {} & \% & \\
% \midrule
% 0 & n/a & neutral \\
-% 1 & ~{-}1.25 & default \\
-% 2 & ~{-}2.5~ & \\
-% 3 & ~{-}5\hphantom{.00} & \\
-% \(\ge\)\:4 & -10\hphantom{.00} & \\
+% 1 & ~\textminus 1.25 & default \\
+% 2 & ~\textminus 2.5~ & \\
+% 3 & ~\textminus 5\hphantom{.}~~ & \\
+% \(\ge\)\:4 & \textminus 10\hphantom{.}~~ & \\
% \bottomrule
% \end{tabular}
% \end{tabfigures}
@@ -2902,7 +3630,8 @@ end
% \end{usecases}
%
%
-% \subsubsection{Wide Space}\label{sec:wide-space}\index{wide space}
+% \subsubsection{Wide Space}\label{sec:wide-space}
+% \index{wide space|userman}
%
% The \cs{widespace} macro and its companion \cs{narrowspace} derive their appearances from
% several of the current font's \cs{fontdimen}\meta{number}s. \TeX{} addresses the latter by
@@ -2914,10 +3643,11 @@ end
%
% \begin{SCtable}
% \caption[\cs{fontdimen}\meta{number} parameters]
-% {The first column~\sample{\#} states the index of the \cs{fontdimen} parameter:
-% \meta{number}. Column~2 presents short descriptions of the
-% \cs{fontdimen}\meta{number} parameters. As examples, the values for the current
-% font are shown in column~3; they are normalized to the quad-size.\bottomstrut}
+% {All \TeX{} font parameters normalized to the font's quad-size. The first
+% column~\sample{\#} states the index of the \cs{fontdimen} parameter:
+% \meta{number}. Column~2 presents short descriptions of
+% \cs{fontdimen}\meta{number}. As examples, the values for the current font are
+% shown in column~3.\bottomstrut}
% \label{tab:fontdimen}
%
% \begin{tabfigures}
@@ -2931,7 +3661,6 @@ end
% \begin{tabular}{@{}lll@{}}
% \toprule
% \# & Description & Value \\
-% {} & & \multicolumn{1}{c}{\%} \\
% \midrule
% 1 & Slant per 1\,pt height & ~~\relativefontdimen1\topstrut \\
% 2 & Interword space width & ~\relativefontdimen2 \\
@@ -2990,7 +3719,8 @@ end
% \end{usecase}
%
%
-% \subsubsection{Narrow Space}\label{sec:narrow-space}\index{narrow space}
+% \subsubsection{Narrow Space}\label{sec:narrow-space}
+% \index{narrow space|userman}
%
% \DescribeMacro{\narrowspace}
% \DescribeMacro{\narrowspace*}
@@ -3033,25 +3763,25 @@ end
% \centering
% \caption[Comparison of some space sizes]
% {Exemplary comparison of standard \cs{space} versus \cs{narrowspace} and
-% \cs{widespace}. All values are relative to the size of the current font's quad
-% size. \cs{narrowspace} and \cs{widespace} use the package's defaults.~\visualpar
-% The upper values in the Width-column for \cs{narrowspace}, and \cs{widespace}
-% refer to the \(\cs{fontdimen7} \not= 0\) case and the lower ones to the
-% \(\cs{fontdimen7} = 0\) code-path.}
+% \cs{widespace}. All values are relative to the size of the current font's
+% quad-size and shown as a percentage of it. \cs{narrowspace} and \cs{widespace}
+% use the package's defaults.~\visualpar The upper values in the
+% \singlequotes{Width}~column for \cs{narrowspace} and \cs{widespace} refer to the
+% \(\cs{fontdimen7} \not= 0\) case and the lower ones to the \(\cs{fontdimen7} = 0\)
+% code-path.}
% \label{tab:space-sizes}
%
% \begin{tabfigures}
-% \def~{\hphantom{0}}%
+% \def~{\hphantom{0}}
% \ExplSyntaxOn
% \def\relativedimen#1{\fp_eval:n {round (1000 * (#1) / \the\fontdimen6\font) / 10}}
% \def\relativefontdimen#1{\relativedimen{\the\fontdimen#1\font}}
% \ExplSyntaxOff
% \def\nrows{1.75}
%
-% \begin{tabular}{@{}llll@{}}
+% \begin{tabular}{@{}l*{3}{r}@{}}
% \toprule
-% Name & Width & Stretch & Shrink \\
-% {} & \% & \% & \% \\
+% Macro & Width & Stretch & Shrink \\
% \midrule
% \multirow{\nrows}{*}{\cs{narrowspace}} &
% \relativedimen{\the\fontdimen2\font - \narrowspacestrength * \the\fontdimen7\font} &
@@ -3071,7 +3801,7 @@ end
%
%
% \subsection{\packagename{Microtype} Front\capitalhyphen End}\label{sec:microtype-frontend}
-% \index{microtype=\packagename{microtype} (package)}
+% \index{microtype=\packagename{microtype} (package)|userman}
%
% The functionalities are just front-ends of selected macros in
% package~\packagename{microtype} -- welcome syntactic sugar.
@@ -3091,7 +3821,8 @@ end
% \end{important}
%
%
-% \subsubsection{Tracking}\label{sec:tracking-control}\index{font>tracking}
+% \subsubsection{Tracking}\label{sec:tracking-control}
+% \index{font>tracking|userman}
%
% \begin{caution}
% The tracking changes may interfere with implicit changes of tracking declared with
@@ -3136,7 +3867,7 @@ end
% \end{codeexample}
%
% If the argument of option~\code{trackingttspacing} is omitted the outer spacing defaults to
-% \makeatletter\mbox{\typog@trackingttspacing}\makeatother.
+% \makeatletter\mbox{\typog@config@trackingttspacing}\makeatother.
%
% \begin{usecases}
% Nudge line breaks or hyphenation points.~\visualpar Avoid clashes of descenders and
@@ -3145,7 +3876,8 @@ end
% \end{usecases}
%
%
-% \subsubsection{Font Expansion}\label{sec:font-expansion-control}\index{font>expansion}
+% \subsubsection{Font Expansion}\label{sec:font-expansion-control}
+% \index{font>expansion|userman}
%
% \DescribeEnv{setfontshrink}
% \DescribeEnv{setfontstretch}
@@ -3153,10 +3885,10 @@ end
% component, i.\,e., shrinkability and stretchability, respectively.
%
% \begin{synopsis}\label{syn:setfontshrink}\label{syn:setfontstretch}
-% \cs{begin}|{setfontshrink}|\marg{level}
+% \cs{begin}|{setfontshrink}|\oarg{level}
% \dots{}
% \cs{end}|{setfontshrink}| \\
-% \cs{begin}|{setfontstretch}|\marg{level}
+% \cs{begin}|{setfontstretch}|\oarg{level}
% \dots{}
% \cs{end}|{setfontstretch}|
% \end{synopsis}
@@ -3165,20 +3897,20 @@ end
% summarize the values for |stretch| and |shrink| in these environments.
%
% \begin{SCtable}
-% \caption[Shrink values of \code{setfontshrink}]%
+% \caption[Shrink values of \code{setfontshrink}]
% {\slightlysloppy[2] Preconfigured values for |shrink| inside of
-% environment~\code{setfontshrink}. Note that all |stretch| values are zero, so the fonts
-% only can shrink.}
+% environment~\code{setfontshrink} as \nativetextfraction{1}{1000}\,em. Note that all
+% |stretch| values are zero, so the fonts only can shrink.}
% \label{tab:setfontshrink-values}
%
% \begin{tabfigures}
+% \def~{\hphantom{0}}
% \begin{tabular}{@{}cccl@{}}
% \toprule
-% \meta{level} & |stretch| & |shrink| & Comment \\
-% {} & \nativetextfraction{1}{1000}\,em & \nativetextfraction{1}{1000}\,em & \\
+% \meta{level} & |stretch| & |shrink| & Note \\
% \midrule
% 0 & n/a & n/a & no operation \\
-% 1 & 0 & \hphantom{0}\makeatletter\typog@shrink@i\makeatother & default \\
+% 1 & 0 & ~\makeatletter\typog@shrink@i\makeatother & default \\
% 2 & 0 & \makeatletter\typog@shrink@ii\makeatother & \\
% 3 & 0 & \makeatletter\typog@shrink@iii\makeatother & \\
% \bottomrule
@@ -3188,20 +3920,20 @@ end
%
% \begin{SCtable}
% \centering
-% \caption[Stretch values of \code{setfontstretch}]%
+% \caption[Stretch values of \code{setfontstretch}]
% {\slightlysloppy[2] Preconfigured values for |stretch| inside of
-% environment~\code{setfontstretch}. Note that all |shrink| values are zero, so the fonts
-% only can stretch.}
+% environment~\code{setfontstretch} as \nativetextfraction{1}{1000}\,em. Note that all
+% |shrink| values are zero, so the fonts only can stretch.}
% \label{tab:setfontstretch-values}
%
% \begin{tabfigures}
+% \def~{\hphantom{0}}
% \begin{tabular}{@{}cccl@{}}
% \toprule
% \meta{level} & |stretch| & |shrink| \\
-% {} & \nativetextfraction{1}{1000}\,em & \nativetextfraction{1}{1000}\,em & \\
% \midrule
% 0 & n/a & n/a & no operation \\
-% 1 & \hphantom{0}\makeatletter\typog@stretch@i\makeatother & 0 & default \\
+% 1 & ~\makeatletter\typog@stretch@i\makeatother & 0 & default \\
% 2 & \makeatletter\typog@stretch@ii\makeatother & 0 & \\
% 3 & \makeatletter\typog@stretch@iii\makeatother & 0 & \\
% \bottomrule
@@ -3224,7 +3956,7 @@ end
% Manipulate both, |stretch| and |shrink|~values at the same time.
%
% \begin{synopsis}\label{syn:setfontexpand}
-% \cs{begin}|{setfontexpand}|\marg{level}
+% \cs{begin}|{setfontexpand}|\oarg{level}
% \dots{}
% \cs{end}|{setfontexpand}|
% \end{synopsis}
@@ -3232,20 +3964,20 @@ end
% \Cref{tab:setfontexpand-values} gives an overview of the values associated with \meta{level}.
%
% \begin{SCtable}
-% \caption[Shrink and stretch values of \code{setfontexpand}]%
+% \caption[Shrink and stretch values of \code{setfontexpand}]
% {\slightlysloppy[2] Preconfigured values for |shrink| and |stretch| inside of
-% environment~\code{setfontexpand}. Note that both |shrink| and |stretch| values are
-% nonzero, so the fonts can shrink or expand.}
+% environment~\code{setfontexpand} as \nativetextfraction{1}{1000}\,em. Note that both
+% |shrink| and |stretch| values are nonzero, so the fonts can shrink or expand.}
% \label{tab:setfontexpand-values}
%
% \begin{tabfigures}
+% \def~{\hphantom{0}}
% \begin{tabular}{@{}cccl@{}}
% \toprule
-% \meta{level} & |stretch| & |shrink| & Comment \\
-% {} & \nativetextfraction{1}{1000}\,em & \nativetextfraction{1}{1000}\,em & \\
+% \meta{level} & |stretch| & |shrink| & Note \\
% \midrule
% 0 & n/a & n/a & no operation \\
-% 1 & \hphantom{0}\makeatletter\typog@stretch@i\makeatother & \hphantom{0}\makeatletter\typog@stretch@i\makeatother & default \\
+% 1 & ~\makeatletter\typog@stretch@i\makeatother & ~\makeatletter\typog@stretch@i\makeatother & default \\
% 2 & \makeatletter\typog@stretch@ii\makeatother & \makeatletter\typog@stretch@ii\makeatother & \\
% 3 & \makeatletter\typog@stretch@iii\makeatother & \makeatletter\typog@stretch@iii\makeatother & \\
% \bottomrule
@@ -3302,7 +4034,8 @@ end
% \end{usecases}
%
%
-% \subsubsection{Character Protrusion}\label{sec:protrusion}\index{font>protrusion}
+% \subsubsection{Character Protrusion}\label{sec:protrusion}
+% \index{font>protrusion|userman}
%
% \DescribeEnv{nocharprotrusion}
% Disable the \packagename{microtype} feature~\singlequotes{protrusion} inside of the
@@ -3320,8 +4053,8 @@ end
% \end{usecases}
%
%
-% \FloatBarrier
-% \subsection{Sloppy Paragraphs}\label{sec:sloppy-paragraphs}\index{paragraph>sloppy}
+% \subsection{Sloppy Paragraphs}\label{sec:sloppy-paragraphs}
+% \index{paragraph>sloppy|userman}
%
% Experienced \LaTeX{} users know that \cs{sloppy} is more of a problem by itself and not
% really a viable solution of the \doublequotes{overfull~box} syndrome.
@@ -3357,21 +4090,22 @@ end
%
% \begin{suspendshortverb}
% \begin{tabfigures}
+% \def~{\hphantom{0}}
% \begin{tabular}{@{}ccccl@{}}
% \toprule
-% \meta{sloppiness} & \cs{toler-} & \cs{hfuzz} & \cs{emergency-} & Comment \\
+% \meta{sloppiness} & \cs{toler-} & \cs{hfuzz} & \cs{emergency-} & Note \\
% {} & \code{ance} & \cs{vfuzz} & \code{stretch}~\(G\) & \\
% {} & & pt & em & \\
% \midrule
-% 0 & \hphantom{0}200\hphantom{\tolerancemark} & .1\hphantom{0} & 0\hphantom{.000\scaledmark} & \TeX: \verb+\fussy+ \\
-% 1 & \hphantom{0}330\tolerancemark & .15 & \hphantom{0}.375\scaledmark & default \\
-% 2 & \hphantom{0}530\tolerancemark & .2\hphantom{0} & \hphantom{0}.75\scaledmark\hphantom{0} & \\
-% 3 & \hphantom{0}870\tolerancemark & .25 & 1.125\scaledmark & \\
-% 4 & 1410\tolerancemark & .3\hphantom{0} & 1.5\scaledmark\hphantom{00} & \\
+% 0 & ~200\hphantom{\tolerancemark} & .1~ & 0\hphantom{.000\scaledmark} & \TeX: \verb+\fussy+ \\
+% 1 & ~330\tolerancemark & .15 & ~.375\scaledmark & default \\
+% 2 & ~530\tolerancemark & .2~ & ~.75\scaledmark~ & \\
+% 3 & ~870\tolerancemark & .25 & 1.125\scaledmark & \\
+% 4 & 1410\tolerancemark & .3~ & 1.5\scaledmark~~ & \\
% 5 & 2310\tolerancemark & .35 & 1.875\scaledmark & \\
-% 6 & 3760\tolerancemark & .4\hphantom{0} & 2.25\scaledmark\hphantom{0} & \\
+% 6 & 3760\tolerancemark & .4~ & 2.25\scaledmark~ & \\
% 7 & 6130\tolerancemark & .45 & 2.625\scaledmark & \\
-% \(\ge\)\:8 & 9999\hphantom{\tolerancemark} & .5\hphantom{0} & 3\hphantom{.000\scaledmark} & \TeX: \verb+\sloppy+ \\
+% \(\ge\)\:8 & 9999\hphantom{\tolerancemark} & .5~ & 3\hphantom{.000\scaledmark} & \TeX: \verb+\sloppy+ \\
% \bottomrule
% \end{tabular}
% \end{tabfigures}
@@ -3403,8 +4137,8 @@ end
% \end{usecases}
%
%
-% \FloatBarrier
-% \subsection{Vertically Partially-Tied Paragraphs}\label{sec:vtie-paragraph}\index{paragraph>vertically tied}
+% \subsection{Vertically Partially-Tied Paragraphs}\label{sec:vtie-paragraph}
+% \index{paragraph>vertically tied|userman}
%
% \LaTeX{} provides several macros and environments to tie material vertically~-- most
% prominently |samepage| and |minipage|.\footnote{A valuable complement to these is
@@ -3421,7 +4155,7 @@ end
%
% \DescribeMacro{\vtietop}
% \DescribeEnv{vtietoppar}
-% Avoid a club\index{forlorn line>club} line in each partial paragraph.
+% Avoid a club\index{forlorn line>club|userman} line in each partial paragraph.
%
% \begin{synopsis}\label{syn:vtietop}\label{syn:vtietoppar}
% \cs{vtietop}\oarg{number-of-lines} \\[\smallskipamount]
@@ -3436,16 +4170,17 @@ end
%
% \begin{usecases}
% String together the first paragraph right after a sectioning command.~\visualpar Tie the
-% first line of an itemized, enumerated, or a description list\index{list} with the paragraph
-% following~\cs{item}.
+% first line of an itemized, enumerated, or a description list\index{list|userman} with the
+% paragraph following~\cs{item}.
% \end{usecases}
%
% \noindent
% \DescribeMacro{\splicevtietop}
-% Inside of a \code{list} a one-off solution simply concatenates \cs{item}[\dots]\cs{vtietop}
-% to fuse the line with the \code{item\#}, the representation of the \code{enum\#}, or the
-% description term with the first paragraph. For a systematic use prefer \cs{splicevtietop}
-% and apply it as the first thing in the \code{list}~body.
+% Inside of a \code{list} a one-off solution simply concatenates
+% \cs{item}[\dots\itcorr{-5}]\cs{vtietop} to fuse the line with the \code{item\#}, the
+% representation of the \code{enum\#}, or the description term with the first paragraph. For a
+% systematic use prefer \cs{splicevtietop} and apply it as the first thing in the
+% \code{list}~body.
%
% \begin{synopsis}\label{syn:splicevtietop}
% \cs{splicevtietop}\oarg{number-of-lines}
@@ -3492,7 +4227,7 @@ end
% \noindent
% \DescribeMacro{\vtiebot}
% \DescribeEnv{vtiebotpar}
-% Avoid a widow\index{forlorn line>widow} line in each partial paragraph.
+% Avoid a widow\index{forlorn line>widow|userman} line in each partial paragraph.
%
% \begin{synopsis}\label{syn:vtiebot}\label{syn:vtiebotpar}
% \cs{vtiebot}\oarg{number-of-lines} \\[\smallskipamount]
@@ -3507,7 +4242,8 @@ end
%
% \noindent
% \DescribeEnv{vtiebotdisp}
-% Avoid a display widow\index{forlorn line>display widow} line in each partial paragraph.
+% Avoid a display widow\index{forlorn line>display widow|userman} line in each partial
+% paragraph.
%
% \begin{synopsis}\label{syn:vtiebotdisp}\label{syn:vtiebotdisppar}
% \cs{begin}|vtiebotdisp|\oarg{before-disp-number-of-lines} \\
@@ -3579,15 +4315,16 @@ end
%
% \begin{typoginspectpar}{partial-paragraphs}
% \setlength{\smoothraggedrightragwidth}{8pt}
-% \paragraph{Partial Paragraphs And Counting Lines.} The top-of-paragraph ties, \cs{vtietop}
-% and \code{vtietoppar} count \meta{number\hyp{}of\hyp{}lines} from the beginning of every
-% partial paragraph. Each displayed math in the paragraph resets the count. The
-% bottom-paragraph ties, \cs{vtiebot}, \code{vtiebotpar}, \cs{vtiebotdisp}, and
-% \code{vtiebotdisppar} count backward from the end of each partial paragraph. Again, each
-% displayed math in the paragraph resets the count. According to \TeX's rules, a displayed
-% math formula always is counted as \emph{three} lines no matter its contents.
-% \Cref{tab:partial-paragraph-line-counts} summarizes these rules with the help of an
-% example.
+% \paragraph{Partial Paragraphs And Counting Lines.}
+%
+% The top-of-paragraph ties, \cs{vtietop} and \code{vtietoppar} count
+% \meta{number\hyp{}of\hyp{}lines} from the beginning of every partial paragraph. Each
+% displayed math in the paragraph resets the count. The bottom-paragraph ties, \cs{vtiebot},
+% \code{vtiebotpar}, \cs{vtiebotdisp}, and \code{vtiebotdisppar} count backward from the end
+% of each partial paragraph. Again, each displayed math in the paragraph resets the count.
+% According to \TeX's rules, a displayed math formula always is counted as \emph{three} lines
+% no matter its contents. \Cref{tab:partial-paragraph-line-counts} summarizes these rules
+% with the help of an example.
% \end{typoginspectpar}
%
% \begin{table}
@@ -3655,11 +4392,11 @@ end
% \end{usecases}
%
%
-% \FloatBarrier
-% \subsection{Breakable Displayed Equations}\label{sec:breakable-display}\index{page break}
+% \subsection{Breakable Displayed Equations}\label{sec:breakable-display}
+% \index{page break|userman}
%
% \DescribeEnv{breakabledisplay}
-% Package~\packagename{amsmath}\index{amsmath=\packagename{amsmath} (package)} offers
+% Package~\packagename{amsmath}\index{amsmath=\packagename{amsmath} (package)|userman} offers
% \cs{allowdisplaybreaks} to render displayed equations breakable at each of their lines.
% Environment~\cs{breakabledisplay} is a wrapper around it which limits the macro's influence
% to the environment. Furthermore, the default \meta{level} of \code{breakabledisplay} is~3
@@ -3688,16 +4425,17 @@ end
% \newcommand*{\clubmark}{\tablenotemark{\dag}}
%
% \begin{tabfigures}
+% \def~{\hphantom{0}}
% \begin{tabular}{@{}ccl@{}}
% \toprule
-% \meta{level} & \cs{interdisplay-} & Comment \\
+% \meta{level} & \cs{interdisplay-} & Note \\
% {} & \code{linepenalty} & \\
% \midrule
% 0 & 10000 & no operation \\
-% 1 & \hphantom{0}9999 & \\
-% 2 & \hphantom{0}6999 & \\
-% 3 & \hphantom{0}2999 & default \\
-% 4 & \hphantom{0000}0\rlap{\clubmark} & \\
+% 1 & ~9999 & \\
+% 2 & ~6999 & \\
+% 3 & ~2999 & default \\
+% 4 & ~~~~0\rlap{\clubmark} & \\
% \bottomrule
% \end{tabular}
% \end{tabfigures}
@@ -3738,7 +4476,6 @@ end
% \end{usecases}
%
%
-% \FloatBarrier
% \clearpage
% \subsection{\packagename{Setspace} Front-End}\label{sec:setspace-frontend}
%
@@ -3747,11 +4484,11 @@ end
% interface of \cs{setstretch} though is unintuitive as it asks for an obscure
% factor.\fontsizeinfo{setspacefontsizeinfo}\marginnote{In the copy of this document gets
% typeset with~\setspacefontsizeinfo*.} The \LaTeX{} user however prefers to keep her eyes on
-% the ball and set the line skip\index{baseline skip} directly (e.\,g.~12.5pt) or the lines'
-% leading\index{leading} to a length or percentage of the font's size.\footnote{To find out
-% about the current font's size and the \cs{baselineskip} in printable form check out
-% \cref{sec:font-information} on \cpageref{sec:font-information}.} This is where the following
-% macros go to bat.
+% the ball and set the line skip\index{baseline skip|userman} directly (e.\,g.~12.5\,pt) or the
+% lines' leading\index{leading|userman} to a length or percentage of the font's
+% size.\footnote{To find out about the current font's size and the \cs{baselineskip} in
+% printable form check out \cref{sec:font-information} on \cpageref{sec:font-information}.}
+% This is where the following macros go to bat.
%
% \begin{important}
% All macros that are introduced in this section rely on macro~\cs{setstretch}. So
@@ -3785,24 +4522,25 @@ end
% will be used in the computation.
%
% \begin{example}
-% Let us assume we want to lighten the gray value of the copy a tad with a \cs{baselineskip}
-% increased (from e.g.~12pt) to~12.5pt. To this end we say:
+% \begin{itemize}[notopsep]
+% \item Let us assume we want to lighten the gray value of the copy a tad with the
+% \cs{baselineskip} increased from 12\,pt to~12.5\,pt. To this end we say:
%
% \begin{codeexample}
-% \cs{setbaselineskip}\{12.5pt\}\specialsectionendhere
+% \cs{setbaselineskip}\{12.5\,pt\}
% \end{codeexample}
-% \end{example}
%
-% \begin{tip}
-% To set the \cs{baselineskip} relative to the current value use
+% \item In a generic part of the document, where the actual \cs{baselineskip} is not known,
+% we can refer to its current value and rescale it:
%
% \begin{codeexample}
-% \cs{setbaselineskip}\{\meta{factor}\cs{baselineskip}\}
+% \cs{setbaselineskip}\{\cs{baselineskip} * 12.5 / 12\}
% \end{codeexample}
%
-% \noindent
-% where \meta{factor} is a floating-point number.
-% \end{tip}
+% Care should be taken if code like the above is implicitly or explicitly
+% repeated, because it results in a geometric series.\specialsectionendhere
+% \end{itemize}
+% \end{example}
%
% \DescribeMacro{\resetbaselineskip}
% \sinceversion{Since v0.3}
@@ -3816,6 +4554,9 @@ end
% notion of what is a single-line \cs{baselineskip}.
%
%
+% \hangindent=2\parindent
+% \hangafter=-2
+% \noindent
% \DescribeMacro{\setbaselineskippercentage}
% \sinceversion{Since v0.3}
% Set the \cs{baselineskip} with a relative value calculated as a percentage of the current
@@ -3828,14 +4569,14 @@ end
% Set \cs{baselineskip} to \(\cs{typogfontsize} \times \meta{baselineskip-percentage} / 100\).
%
% \begin{example}
-% We modify the previous example and assume a font design size of 10pt, but now write
+% We modify the previous example and assume a font design size of 10\,pt, but now write
%
% \begin{codeexample}
% \cs{setbaselineskippercentage}\{125\}
% \end{codeexample}
%
% \noindent
-% which sets \cs{baselineskip} to \(10\text{pt} \times 125 / 100 = 12.5\text{pt}\).
+% which sets \cs{baselineskip} to \(10\text{\,pt} \times 125 / 100 = 12.5\text{\,pt}\).
% \end{example}
%
% \DescribeMacro{\setleading}
@@ -3850,7 +4591,7 @@ end
% \meta{leading} can be negative, e.\,g.~to set solid.
%
% \begin{example}
-% Another solution of the previous example, given a font design size of 10pt is to write
+% Another solution of the previous example, given a font design size of 10\,pt is to write
%
% \begin{codeexample}
% \cs{setleading}\{2.5pt\}
@@ -3872,14 +4613,14 @@ end
% Set \cs{baselineskip} to \(\cs{typogfontsize} \times (1 + \meta{leading-percentage} / 100)\).
%
% \begin{example}
-% We modify the previous example and again assume a font design size of 10pt, but now write
+% We modify the previous example and again assume a font design size of 10\,pt, but now write
%
% \begin{codeexample}
% \cs{setleadingpercentage}\{25\}
% \end{codeexample}
%
% \noindent
-% which sets \cs{baselineskip} to \(10\text{pt} \times (1 + 25 / 100) = 12.5\text{pt}\).
+% which sets \cs{baselineskip} to \(10\text{\,pt} \times (1 + 25 / 100) = 12.5\text{\,pt}\).
% \end{example}
%
% \smallskip
@@ -3949,9 +4690,9 @@ end
% \end{tip}
%
%
-% \FloatBarrier
% \clearpage
-% \subsection{Smooth Ragged}\label{sec:smooth-ragged}\index{ragged right}
+% \subsection{Smooth Ragged}\label{sec:smooth-ragged}
+% \index{ragged right|userman}
%
% \begin{whittyquote}
% The attention someone gives \\
@@ -3964,25 +4705,30 @@ end
% \noindent
% Package \packagename{typog} implements a novel approach to typeset ragged paragraphs.
% Instead of setting the glue inside of a paragraph to zero and letting the line-widths vary
-% accordingly~\cite{wermuth:2020} we prescribe the line-widths with the \cs{parshape}~primitive
-% and leave alone the stretchability or shrinkability of the glue.
+% accordingly~\cite{wermuth:2020} we prescribe the line-widths with \TeX's
+% \cs{parshape}~primitive and leave alone the stretchability or shrinkability of the glue.
%
-% \begin{slightlysloppypar}
-% \hangindent=5.5em\hangafter=-5
+% \begin{caution}
+% None of the following environments work inside of lists.
+% \end{caution}
+%
+% \begin{slightlysloppypar}[2]
+% \hangindent=3.5\parindent
+% \hangafter=-6
+% \noindent
% \DescribeEnv{smoothraggedrightshapetriplet}
% \DescribeEnv{smoothraggedrightshapequintuplet}
% \DescribeEnv{smoothraggedrightshapeseptuplet}
-% We introduce three environments that allow for setting three, five, or seven different
-% line-lengths: \code{smoothraggedrightshapetriplet},
-% \code{smoothraggedrightshapequintuplet}, and \code{smoothraggedrightshapeseptuplet}; they
-% work for paragraphs up to
+% We introduce three environments that set three, five, or seven different line-lengths
+% (which \TeX{} of course will repeat for paragraphs longer than three, five, or seven
+% lines): \code{smoothraggedrightshapetriplet}, \code{smoothraggedrightshapequintuplet}, and
+% \code{smoothraggedrightshapeseptuplet}; they work for paragraph lengths up to
% \makeatletter
-% \typog@triplet@max@lines, \typog@quintuplet@max@lines, or \typog@septuplet@max@lines~lines,
+% \typog@triplet@max@lines, \typog@quintuplet@max@lines, and \typog@septuplet@max@lines~lines,
% \makeatother
% respectively.
% \end{slightlysloppypar}
%
-%
% \begin{maxipage}
% \begin{synopsis}\label{syn:smoothraggedrightshapetriplet}\label{syn:smoothraggedrightshapequintuplet}\label{syn:smoothraggedrightshapeseptuplet}
% \cs{begin}|{smoothraggedrightshapetriplet}|\oarg{option\dots}\marg{width1}\marg{width2}\marg{width3} \\
@@ -4224,23 +4970,47 @@ end
% The default generator is |triplet|.
%
% \item[\cs{smoothraggedrightleftskip}=\meta{dim}]
-% Value for |leftskip| to pass to the generator. Default:~0pt.
+% Value for |leftskip| to pass to the generator. Default:~0\,pt.
%
% \item[\cs{smoothraggedrightparindent}=\meta{dim}]
-% Value for |parindent| to pass to the generator. Default:~0pt.
+% Value for |parindent| to pass to the generator. Default:~0\,pt.
%
% \item[\cs{smoothraggedrightragwidth}=\meta{dim}]
-% Value for the width of the ragged right margin. Default:~2em.
+% Value for the width of the ragged right margin. Default:~2\,em.
% \end{description}
%
+% \begin{samepage}
+% \def\smoothraggedrightgenerator{quintuplet}
+% \setlength{\smoothraggedrightragwidth}{7pt}
+% \begin{nocharprotrusion}\fussy
+% \begin{smoothraggedright}
+% Throughout this manual we have demonstrated how \code{smoothraggedright} environments
+% work for very narrow columns namely inside of the document's margins: all maginal notes
+% were typeset inside of \cs{smoothraggedright} environments (quintuplet generator,
+% 1.5\,em rag width, at footnote~size in addition using
+% environments~\code{slightlysloppy} and \code{loosespacing}). Here, we utilize it with
+% the \smoothraggedrightgenerator~generator and a rag-width of only
+% \the\smoothraggedrightragwidth{} in a paragraph that is \the\linewidth~wide and
+% averages around twelve words per line. There is much more glue to adapt to the
+% line-ends and thus the desired rag is archieved far easier. The sloppyness is minimal,
+% this is, \cs{fussy} is in effect and character protrusion into the margins is switched
+% off. A limitation of the current implementation is that it is ineffective inside of lists.
+% Therefore, this paragraph has not been wrapped inside of an \singlequotes{example}, because
+% all examples are coded as lists.
+% \end{smoothraggedright}
+% \end{nocharprotrusion}
+% \end{samepage}
+%
% \begin{usecases}
% Replacement for \cs{RaggedRight}~\cite{package:ragged2e}.~\visualpar Design alternative for
% fully justified paragraphs if used with a small rag-width.
% \end{usecases}
%
-%
-% \addtocontents{toc}{\par\bigskip\hfill\textit{Table of Contents continued on next page.}}
-% \addtocontents{toc}{\clearpage}
+% \begin{futuredirection}
+% Translate the code to \packagename{l3galley} which is part of the
+% \packagename{l3experimental}~package~\cite{package:l3experimental}. Galley~code is
+% supposed to work inside of lists, too.
+% \end{futuredirection}
%
%
% \sectionfinish
@@ -4250,7 +5020,7 @@ end
% Many other packages help with getting better output from \LaTeX. Here is a list --~in
% alphabetical order~-- of the ones the author considers particularly valuable.
%
-% \sbox{\listlabelbox}{\packagename{microtype}}
+% \sbox{\listlabelbox}{\packagename{enumitem}}
% \begin{description}[font=\normalfont, labelsep*=1em, labelwidth=\wd\listlabelbox, leftmargin=!]
% \item[\packagename{enumitem}]
% Flexible and consistent definition of all basic \LaTeX-list types plus inline
@@ -4268,6 +5038,9 @@ end
% Fine control of spacing, tracking, sidebearings, character protrusion into the margins,
% font expansion, and much more~\cite{package:microtype}.
%
+% See \Cref{sec:microtype-frontend} for a front-end to \packagename{microtype} offered by
+% this package.
+%
% See also \propername{Khirevich's} discussion~\cite{khirevich:2013}.
%
% \item[\packagename{ragged2e}]
@@ -4275,8 +5048,11 @@ end
% |center|~\cite{package:ragged2e}.
%
% \item[\packagename{setspace}]
-% Consistently set the document's line-spacing, i.\,e.,
+% Consistently set the line-spacing of a document, i.\,e., control
% \cs{baselineskip}~\cite{package:setspace}.
+%
+% See \Cref{sec:setspace-frontend} for a front-end to \packagename{setspace} offered by this
+% package.
% \end{description}
%
%
@@ -4291,26 +5067,34 @@ end
%
% The companion program \programname{typog-grep} for analyzing the output of
% \hyperref[syn:typoginspect]{\code{typoginspect}} and
-% \hyperref[syn:typoginspect]{\code{typoginspectpar}} has its own manual page. We reproduce
-% it here for completeness of the documentation.
+% \hyperref[syn:typoginspect]{\code{typoginspectpar}} has its own manual page. We
+% reproduce it here for completeness of the documentation.
%
+% \addtocontents{toc}{\protect\setcounter{tocdepth}{0}}
% \begin{suspendshortverb}
% \setlength{\parindent}{0pt}
% \setlength{\parskip}{6.0pt plus 2.0pt minus .5pt}
-% \input typog-grep
+% \input{typog-grep.tex}
% \end{suspendshortverb}
+% \addtocontents{toc}{\protect\setcounter{tocdepth}{2}}
%
% \sectionfinish
% \clearpage
-% \phantomsection
-% \resetfancyhead
-% \addcontentsline{toc}{section}{Change History}
-% \PrintChanges
+% \begingroup
+% \setcounter{GlossaryColumns}{1}
+% \phantomsection
+% \label{sec:changes}
+% \resetfancyhead
+% \addtocontents{toc}{\bigskip}
+% \addcontentsline{toc}{section}{\numberline{}Change History}
+% \PrintChanges
+% \endgroup
%
% \sectionfinish
% \clearpage
% \phantomsection
-% \addcontentsline{toc}{section}{References}
+% \addtocontents{toc}{\medskip}
+% \addcontentsline{toc}{section}{\numberline{}References}
% \begin{RaggedRight}
% \begin{thebibliography}{88}
% \bibitem{abrahams:2020}
@@ -4354,6 +5138,12 @@ end
% 1998,
% \biburl{https://mirrors.ctan.org/systems/doc/etex/etex_man.pdf}.
%
+% \bibitem{package:mathastext}
+% \bibauthor{Burnol, Jean-François}.
+% \bibtitle{Package~\packagename{mathastext}}.
+% 2023,
+% \biburl{https://ctan.org/pkg/mathastext}.
+%
% \bibitem{carlisle:1996}
% \bibauthor{Carlisle, David}.
% \bibtitle{Russian Paragraph Shapes}.
@@ -4399,6 +5189,12 @@ end
% Addison Wesley, Reading\kernedslash MA,
% 1986.
%
+% \bibitem{package:l3experimental}
+% \bibauthor{The \LaTeX\ Project}.
+% \bibtitle{Package~\packagename{l3experimental}}.
+% 2024,
+% \biburl{https://ctan.org/pkg/l3experimental}.
+%
% \bibitem{package:layout}
% \bibauthor{McPherson, Kent}.
% \bibtitle{Package~\packagename{layout}}.
@@ -4450,6 +5246,13 @@ end
% TUGboat, 11(1), 69\figuredash85, 1990,
% \biburl{http://www.tug.org/TUGboat/Articles/tb11-1/tb27salomon.pdf}.
%
+% \bibitem{strizver:2014}
+% \bibauthor{Strizver, Ilene}.
+% \bibtitle{Type rules!: the designer's guide to professional typography},
+% 4\textsuperior{th}~ed.
+% John Wiley~\& Sons, Hoboken\kernedslash NJ,
+% 2014.
+%
% \bibitem{package:setspace}
% \bibauthor{Tobin, Geoffrey,} and \bibauthor{Robin Fairbairns}.
% \bibtitle{Package~\packagename{setspace}}.
@@ -4526,23 +5329,35 @@ end
% \end{RaggedRight}
%
% \sectionfinish
+%
+%
% \clearpage
-% \begin{RaggedRight}
+% \begingroup
% \setcounter{IndexColumns}{2}
% \setlength{\columnsep}{30pt}
% \label{sec:index}
% \phantomsection
-% \addcontentsline{toc}{section}{Index}
+% \addtocontents{toc}{\medskip}
+% \addcontentsline{toc}{section}{\numberline{}Index}
+% \raggedcolumns
+% \def\codeidx##1{\linenumberdecoration\textbf{##1}}
+% \def\main##1{\linenumberdecoration\underbar{\textbf{##1}}}
+% \def\usage##1{\textit{\textbf{##1}}}
% \PrintIndex
-% \end{RaggedRight}
+% \endgroup
% }
%
-%
% \sectionfinish
+%
+%
% \clearpage
% \appendix
% \section{Package Code}\label{sec:package-code}
-% \addtocontents{toc}{\begingroup\small}
+% \addtocontents{toc}{\protect\begin{list}{}{\leftmargin=\subsectiontocindent\parsep=0pt}}
+% \addtocontents{toc}{\protect\item}
+% \addtocontents{toc}{\RaggedRight}
+% \addtocontents{toc}{\small}
+% \addtocontents{toc}{\tocsquashedsubsections}
% \addtocontents{toc}{\protect\begin{multicols}{2}}
% \addtocontents{toc}{\protect\raggedcolumns}
%
@@ -4555,7 +5370,7 @@ end
%<*package>
\NeedsTeXFormat{LaTeX2e}[2005/12/01]
\ProvidesPackage{typog}
- [2024/05/07 v0.3 TypoGraphic extensions]
+ [2024/07/08 v0.4 TypoGraphic extensions]
\RequirePackage{etoolbox}
\RequirePackage{everyhook}
@@ -4592,17 +5407,34 @@ end
% \end{macro}
%
% \begin{macro}{\typog@typeout}
+% Our information printer.
+% Just adds a prefix so that we can tease apart the \filesystem{log} later.
+%
+% \begin{macrocode}
+\newcommand*{\typog@typeout}[1]{\typeout{typog: #1}}
+
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\typog@typeout}
% Our debug information printer.
%
% \begin{macrocode}
-\newcommand*{\typog@typeout}[1]
- {\iftypog@debug
- \typeout{typog: #1}%
- \fi}
+\newcommand*{\typog@debug@typeout}[1]{\iftypog@debug\typog@typeout{#1}\fi}
% \end{macrocode}
% \end{macro}
%
+% \begin{tcounter}{typog@@iteration}
+% We want our own counter (currently for keeping track of iterations) that does not get
+% trampled underfoot too easily.
+%
+% \begin{macrocode}
+\newcounter{typog@@iteration}
+
+% \end{macrocode}
+% \end{tcounter}
+%
% \begin{macro}{\typog@trim@spaces}
% Pull \cs{tl\_trim\_spaces} into the \singlequotes{classic} namespace.
%
@@ -4693,69 +5525,149 @@ end
%
% Our own state\dots
%
-% \begin{macro}{\typog@mathitalicscorrection}
+% \begin{macro}{\typog@config@mathitalicscorrection}
% \begin{macrocode}
-\newmuskip\typog@mathitalicscorrection
+\newmuskip\typog@config@mathitalicscorrection
+
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\typog@textitalicscorrection}
+% Actual \cs{labelitem}\meta{N} corrections.
+%
+% \begin{ldimen}{\typog@adjust@labelitemi}
+% \begin{macrocode}
+\newdimen{\typog@adjust@labelitemi}
+% \end{macrocode}
+% \end{ldimen}
+%
+% \begin{ldimen}{\typog@adjust@labelitemii}
+% \begin{macrocode}
+\newdimen{\typog@adjust@labelitemii}
+% \end{macrocode}
+% \end{ldimen}
+%
+% \begin{ldimen}{\typog@adjust@labelitemiii}
+% \begin{macrocode}
+\newdimen{\typog@adjust@labelitemiii}
+% \end{macrocode}
+% \end{ldimen}
+%
+% \begin{ldimen}{\typog@adjust@labelitemiv}
+% \begin{macrocode}
+\newdimen{\typog@adjust@labelitemiv}
+% \end{macrocode}
+% \end{ldimen}
+%
+% Configuration constants for \cs{labelitem}\meta{N} corrections.
+%
+% \begin{ldimen}{\typog@adjust@lowercase@labelitemi}
+% \begin{macrocode}
+\newdimen{\typog@adjust@lowercase@labelitemi}
+% \end{macrocode}
+% \end{ldimen}
+%
+% \begin{ldimen}{\typog@adjust@lowercase@labelitemii}
+% \begin{macrocode}
+\newdimen{\typog@adjust@lowercase@labelitemii}
+% \end{macrocode}
+% \end{ldimen}
+%
+% \begin{ldimen}{\typog@adjust@lowercase@labelitemiii}
+% \begin{macrocode}
+\newdimen{\typog@adjust@lowercase@labelitemiii}
+% \end{macrocode}
+% \end{ldimen}
+%
+% \begin{ldimen}{\typog@adjust@lowercase@labelitemiv}
+% \begin{macrocode}
+\newdimen{\typog@adjust@lowercase@labelitemiv}
+% \end{macrocode}
+% \end{ldimen}
+%
+% \begin{ldimen}{\typog@adjust@uppercase@labelitemi}
+% \begin{macrocode}
+\newdimen{\typog@adjust@uppercase@labelitemi}
+% \end{macrocode}
+% \end{ldimen}
+%
+% \begin{ldimen}{\typog@adjust@uppercase@labelitemii}
+% \begin{macrocode}
+\newdimen{\typog@adjust@uppercase@labelitemii}
+% \end{macrocode}
+% \end{ldimen}
+%
+% \begin{ldimen}{\typog@adjust@uppercase@labelitemiii}
% \begin{macrocode}
-\newlength{\typog@textitalicscorrection}
+\newdimen{\typog@adjust@uppercase@labelitemiii}
+% \end{macrocode}
+% \end{ldimen}
+%
+% \begin{ldimen}{\typog@adjust@uppercase@labelitemiv}
+% \begin{macrocode}
+\newdimen{\typog@adjust@uppercase@labelitemiv}
+
+% \end{macrocode}
+% \end{ldimen}
+%
+% Other lengths\dots
+%
+% \begin{macro}{\typog@config@textitalicscorrection}
+% \begin{macrocode}
+\newlength{\typog@config@textitalicscorrection}
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\typog@ligaturekern}
+% \begin{macro}{\typog@config@ligaturekern}
% \begin{macrocode}
-\newlength{\typog@ligaturekern}
+\newlength{\typog@config@ligaturekern}
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\typog@raisecapitaldash}
+% \begin{macro}{\typog@config@raisecapitaldash}
% \begin{macrocode}
-\newlength{\typog@raisecapitaldash}
+\newlength{\typog@config@raisecapitaldash}
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\typog@raisecapitalguillemets}
+% \begin{macro}{\typog@config@raisecapitalguillemets}
% \begin{macrocode}
-\newlength{\typog@raisecapitalguillemets}
+\newlength{\typog@config@raisecapitalguillemets}
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\typog@raisecapitalhyphen}
+% \begin{macro}{\typog@config@raisecapitalhyphen}
% \begin{macrocode}
-\newlength{\typog@raisecapitalhyphen}
+\newlength{\typog@config@raisecapitalhyphen}
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\typog@raisecapitaltimes}
+% \begin{macro}{\typog@config@raisecapitaltimes}
% \begin{macrocode}
-\newlength{\typog@raisecapitaltimes}
+\newlength{\typog@config@raisecapitaltimes}
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\typog@raiseguillemets}
+% \begin{macro}{\typog@config@raiseguillemets}
% \begin{macrocode}
-\newlength{\typog@raiseguillemets}
+\newlength{\typog@config@raiseguillemets}
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\typog@raisefiguredash}
+% \begin{macro}{\typog@config@raisefiguredash}
% \begin{macrocode}
-\newlength{\typog@raisefiguredash}
+\newlength{\typog@config@raisefiguredash}
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\typog@slashkern}
+% \begin{macro}{\typog@config@slashkern}
% \begin{macrocode}
-\newlength{\typog@slashkern}
+\newlength{\typog@config@slashkern}
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\typog@breakpenalty}
+% \begin{macro}{\typog@config@breakpenalty}
% \begin{macrocode}
-\newcommand*{\typog@breakpenalty}{\exhyphenpenalty}
+\newcommand*{\typog@config@breakpenalty}{\exhyphenpenalty}
% \end{macrocode}
% \end{macro}
%
@@ -4771,9 +5683,9 @@ end
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\typog@trackingttspacing}
+% \begin{macro}{\typog@config@trackingttspacing}
% \begin{macrocode}
-\newcommand*{\typog@trackingttspacing}{300, 90, 60}
+\newcommand*{\typog@config@trackingttspacing}{300, 90, 60}
% \end{macrocode}
% \end{macro}
%
@@ -4871,77 +5783,99 @@ end
\newcommand*{\typog@set@shrink@limits}
{\edef\typog@@star{*}%
- \edef\typog@@limit{\typog@triple@get@i{\typog@shrinklimits}}%
+ \edef\typog@@limit{\typog@triple@get@i{\typog@config@shrinklimits}}%
\unless\ifx\typog@@limit\typog@@star\edef\typog@shrink@i{\number\typog@@limit}\fi
- \edef\typog@@limit{\typog@triple@get@ii{\typog@shrinklimits}}%
+ \edef\typog@@limit{\typog@triple@get@ii{\typog@config@shrinklimits}}%
\unless\ifx\typog@@limit\typog@@star\edef\typog@shrink@ii{\number\typog@@limit}\fi
- \edef\typog@@limit{\typog@triple@get@iii{\typog@shrinklimits}}%
+ \edef\typog@@limit{\typog@triple@get@iii{\typog@config@shrinklimits}}%
\unless\ifx\typog@@limit\typog@@star\edef\typog@shrink@iii{\number\typog@@limit}\fi}
\newcommand*{\typog@set@stretch@limits}
{\edef\typog@@star{*}%
- \edef\typog@@limit{\typog@triple@get@i{\typog@stretchlimits}}%
+ \edef\typog@@limit{\typog@triple@get@i{\typog@config@stretchlimits}}%
\unless\ifx\typog@@limit\typog@@star\edef\typog@stretch@i{\number\typog@@limit}\fi
- \edef\typog@@limit{\typog@triple@get@ii{\typog@stretchlimits}}%
+ \edef\typog@@limit{\typog@triple@get@ii{\typog@config@stretchlimits}}%
\unless\ifx\typog@@limit\typog@@star\edef\typog@stretch@ii{\number\typog@@limit}\fi
- \edef\typog@@limit{\typog@triple@get@iii{\typog@stretchlimits}}%
+ \edef\typog@@limit{\typog@triple@get@iii{\typog@config@stretchlimits}}%
\unless\ifx\typog@@limit\typog@@star\edef\typog@stretch@iii{\number\typog@@limit}\fi}
\DeclareOptionX<typog>{breakpenalty}%
- {\renewcommand*{\typog@breakpenalty}{#1}}
+ {\renewcommand*{\typog@config@breakpenalty}{#1}}
\DeclareOptionX<typog>{debug}{\typog@debugtrue}
\DeclareOptionX<typog>{mathitalicscorrection}[.4mu]%
- {\typog@mathitalicscorrection=#1\relax}%
+ {\typog@config@mathitalicscorrection=#1\relax}%
\DeclareOptionX<typog>{nodebug}{\typog@debugfalse}
\DeclareOptionX<typog>{textitalicscorrection}[.02em]%
- {\setlength{\typog@textitalicscorrection}{#1}}
+ {\setlength{\typog@config@textitalicscorrection}{#1}}
\DeclareOptionX<typog>{ligaturekern}[.033333em]%
- {\setlength{\typog@ligaturekern}{#1}}
+ {\setlength{\typog@config@ligaturekern}{#1}}
+\DeclareOptionX<typog>{lowercaselabelitemadjustments}%
+ {\typog@debug@typeout{lowercaselabelitemadjustments={#1}}
+ \def\typog@@do##1{\addtocounter{typog@@iteration}{1}
+ \global\setlength{\csname typog@adjust@lowercase@labelitem\romannumeral\thetypog@@iteration\endcsname}{##1}}
+ \setcounter{typog@@iteration}{0}
+ \forcsvlist{\typog@@do}{#1}}
+\newcommand*{\typog@config@lowercaselabelitemadjustments}
+ {\the\typog@adjust@lowercase@labelitemi,\space
+ \the\typog@adjust@lowercase@labelitemii,\space
+ \the\typog@adjust@lowercase@labelitemiii,\space
+ \the\typog@adjust@lowercase@labelitemiv}
\DeclareOptionX<typog>{raisecapitaldash}[\z@]%
- {\setlength{\typog@raisecapitaldash}{#1}}
+ {\setlength{\typog@config@raisecapitaldash}{#1}}
\DeclareOptionX<typog>{raisecapitalguillemets}[\z@]%
- {\setlength{\typog@raisecapitalguillemets}{#1}}
+ {\setlength{\typog@config@raisecapitalguillemets}{#1}}
\DeclareOptionX<typog>{raisecapitalhyphen}[\z@]%
- {\setlength{\typog@raisecapitalhyphen}{#1}}
+ {\setlength{\typog@config@raisecapitalhyphen}{#1}}
\DeclareOptionX<typog>{raisecapitaltimes}[\z@]%
- {\setlength{\typog@raisecapitaltimes}{#1}}
+ {\setlength{\typog@config@raisecapitaltimes}{#1}}
\DeclareOptionX<typog>{raiseguillemets}[\z@]%
- {\setlength{\typog@raiseguillemets}{#1}}
+ {\setlength{\typog@config@raiseguillemets}{#1}}
\DeclareOptionX<typog>{raisefiguredash}[\z@]%
- {\setlength{\typog@raisefiguredash}{#1}}
+ {\setlength{\typog@config@raisefiguredash}{#1}}
\DeclareOptionX<typog>{raise*}[\z@]%
- {\setlength{\typog@raisecapitaldash}{#1}%
- \setlength{\typog@raisecapitalhyphen}{#1}%
- \setlength{\typog@raisecapitaltimes}{#1}%
- \setlength{\typog@raisefiguredash}{#1}}
+ {\setlength{\typog@config@raisecapitaldash}{#1}%
+ \setlength{\typog@config@raisecapitalhyphen}{#1}%
+ \setlength{\typog@config@raisecapitaltimes}{#1}%
+ \setlength{\typog@config@raisefiguredash}{#1}}
\DeclareOptionX<typog>{shrinklimits}%
[\typog@default@shrink@i, \typog@default@shrink@ii, \typog@default@shrink@iii]%
{\typog@require@preloaded@microtype
\ifx\@onlypreamble\@notprerr
\PackageWarning{typog}{option `shrinklimits' can only be used in the preamble}%
\else
- \edef\typog@shrinklimits{#1}%
+ \edef\typog@config@shrinklimits{#1}%
\typog@set@shrink@limits
\fi}
\DeclareOptionX<typog>{slashkern}[.05em]%
- {\setlength{\typog@slashkern}{#1}}
+ {\setlength{\typog@config@slashkern}{#1}}
\DeclareOptionX<typog>{stretchlimits}%
[\typog@default@stretch@i, \typog@default@stretch@ii, \typog@default@stretch@iii]%
{\typog@require@preloaded@microtype
\ifx\@onlypreamble\@notprerr
\PackageWarning{typog}{option `stretchlimits' can only be used in the preamble}%
\else
- \edef\typog@stretchlimits{#1}%
+ \edef\typog@config@stretchlimits{#1}%
\typog@set@stretch@limits
\fi}
-\DeclareOptionX<typog>{trackingttspacing}[\typog@trackingttspacing]%
+\DeclareOptionX<typog>{trackingttspacing}[\typog@config@trackingttspacing]%
{\typog@require@preloaded@microtype
\ifx\@onlypreamble\@notprerr
\PackageWarning{typog}{option `trackingttspacing' can only be used in the preamble}%
\else
- \typog@typeout{trackingttspacing=#1}%
+ \typog@debug@typeout{trackingttspacing=#1}%
\SetTracking[outer spacing={#1}]{encoding=*, family=tt*}{0}%
\fi}
+\DeclareOptionX<typog>{uppercaselabelitemadjustments}%
+ {\typog@debug@typeout{uppercaselabelitemadjustments={#1}}
+ \def\typog@@do##1{\addtocounter{typog@@iteration}{1}
+ \setlength{\csname typog@adjust@uppercase@labelitem\romannumeral\thetypog@@iteration\endcsname}{##1}}
+ \setcounter{typog@@iteration}{0}
+ \forcsvlist{\typog@@do}{#1}}
+\newcommand*{\typog@config@uppercaselabelitemadjustments}
+ {\the\typog@adjust@uppercase@labelitemi,\space
+ \the\typog@adjust@uppercase@labelitemii,\space
+ \the\typog@adjust@uppercase@labelitemiii,\space
+ \the\typog@adjust@uppercase@labelitemiv}
\newcommand*{\typog@initialize@options}
{\ExecuteOptionsX<typog>{
@@ -4963,7 +5897,7 @@ end
% \fi
%
%
-% \subsection*{Setup}
+% \subsection{Setup and Reconfiguration}
%
% \begin{environment}{typogsetup}
% An empty argument list resets all initialized values to their defaults.
@@ -4982,8 +5916,42 @@ end
% \end{environment}
%
% \begin{macro}{\typogget}
+% Access the package's configuration (name-)space.
+%
% \begin{macrocode}
-\NewDocumentCommand{\typogget}{m}{\csname typog@#1\endcsname}
+\NewDocumentCommand{\typogget}{m}{\csname typog@config@#1\endcsname}
+
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\typoggetnth}
+% \changes{v0.4}{2024-05-15}{New macro.}
+% Access the \(n\)\textsuperscript{th} element of a comma-separated, list-like configuration
+% item's value.
+%
+% \begin{macrocode}
+\ExplSyntaxOn
+\cs_generate_variant:Nn \seq_set_split:Nnn {Nne}
+\cs_new:Npn \typog_get_nth_csname:cnn #1#2#3
+ {
+ \seq_set_split:Nne \l_tmpa_seq {,} {\cs:w typog@config@#2 \cs_end:}
+ \cs_gset:cpn {#1} {\seq_item:Nn \l_tmpa_seq {#3}}
+ }
+\cs_new:Npn \typog_get_nth_dimen:nnn #1#2#3
+ {
+ \seq_set_split:Nne \l_tmpa_seq {,} {\cs:w typog@config@#2 \cs_end:}
+ \dim_set:Nn {#1} {\seq_item:Nn \l_tmpa_seq {#3}}
+ }
+\NewDocumentCommand{\typoggetnth}{m m m}{
+ \token_if_dim_register:NTF {#1}
+ {
+ \typog_get_nth_dimen:nnn {#1} {#2} {#3}
+ }
+ {
+ \typog_get_nth_csname:cnn {#1} {#2} {#3}
+ }
+}
+\ExplSyntaxOff
% \end{macrocode}
% \end{macro}
@@ -5065,6 +6033,7 @@ end
%
% \begin{macrocode}
\newcounter{typog@inspect@count}
+
% \end{macrocode}
% \end{macro}
%
@@ -5085,11 +6054,16 @@ end
\edef\typog@@arg{#2}%
\ifx\typog@@arg\empty
\stepcounter{typog@inspect@count}%
- \edef\typog@@id{\typog@default@inspect@id@prefix\arabic{typog@inspect@count}}%
+ \edef\typog@@id{\typog@default@inspect@id@prefix
+ \arabic{typog@inspect@count}}%
\else
\edef\typog@@id{\typog@trim@spaces{\typog@@arg}}%
\fi
- \typeout{<typog-inspect id="\typog@@id" job="\jobname" line="\the\inputlineno" page="\the\value{page}">}%
+ \typeout{<typog-inspect\space
+ id="\typog@@id"\space
+ job="\jobname"\space
+ line="\the\inputlineno"\space
+ page="\the\value{page}">}%
% \end{macrocode}
%
% Set both badness thresholds to absurdly low values as to activate \TeX's reports.
@@ -5210,7 +6184,7 @@ end
% \begin{macro}{\nolig}
% \begin{macrocode}
\NewDocumentCommand{\nolig}{s o}
- {\dimen0=\IfNoValueTF{#2}{\typog@ligaturekern}{#2\typog@dim@unit}%
+ {\dimen0=\IfNoValueTF{#2}{\typog@config@ligaturekern}{#2\typog@dim@unit}%
\IfBooleanTF{#1}%
{\kern\dimen0\ignorespaces}%
{\discretionary{\typog@hyphen}{}{\kern\dimen0}%
@@ -5249,7 +6223,7 @@ end
%
% \begin{macrocode}
\newcommand*{\typog@itcorr@text@unconditional}[1]
- {\kern#1\typog@textitalicscorrection}
+ {\kern#1\typog@config@textitalicscorrection}
% \end{macrocode}
% \end{macro}
%
@@ -5275,7 +6249,7 @@ end
%
% \begin{macrocode}
\newcommand*{\typog@itcorr@math}[1]
- {\mkern#1\typog@mathitalicscorrection}
+ {\mkern#1\typog@config@mathitalicscorrection}
% \end{macrocode}
% \end{macro}
%
@@ -5326,11 +6300,11 @@ end
%
% \begin{macrocode}
\NewDocumentCommand{\kernedslash}{s}
- {\hspace*{\typog@slashkern}%
+ {\hspace*{\typog@config@slashkern}%
\typog@forwardslash
\IfBooleanTF{#1}%
- {\hspace*{\typog@slashkern}\ignorespaces}%
- {\typog@breakpoint\typog@allowhyphenation\hspace*{\typog@slashkern}}}
+ {\hspace*{\typog@config@slashkern}\ignorespaces}%
+ {\typog@breakpoint\typog@allowhyphenation\hspace*{\typog@config@slashkern}}}
% \end{macrocode}
%
% \acronym{PDF}-substitute definition
@@ -5358,7 +6332,7 @@ end
\def\typog@@optarg{#2}%
\hspace*{#3\typog@dim@unit}%
\raisebox{\ifx\typog@@optarg\typog@@auto
- \typog@raisecapitalhyphen
+ \typog@config@raisecapitalhyphen
\else
\typog@@optarg\typog@dim@unit
\fi}{\typog@hyphen}%
@@ -5428,7 +6402,7 @@ end
%
% \begin{macrocode}
\newcommand*{\typog@breakpoint}
- {\penalty\typog@breakpenalty}
+ {\penalty\typog@config@breakpenalty}
% \end{macrocode}
% \end{macro}
%
@@ -5439,7 +6413,7 @@ end
%
% \begin{macrocode}
\NewDocumentCommand{\capitalhyphen}{s}
- {\raisebox{\typog@raisecapitalhyphen}{\typog@hyphen}%
+ {\raisebox{\typog@config@raisecapitalhyphen}{\typog@hyphen}%
\IfBooleanTF{#1}%
{\ignorespaces}%
{\typog@breakpoint\typog@allowhyphenation}}
@@ -5473,7 +6447,7 @@ end
%
% \begin{macrocode}
\NewDocumentCommand{\capitalendash}{s}
- {\raisebox{\typog@raisecapitaldash}{\textendash}%
+ {\raisebox{\typog@config@raisecapitaldash}{\textendash}%
\IfBooleanTF{#1}%
{\ignorespaces}%
{\typog@breakpoint\typog@allowhyphenation}}
@@ -5503,7 +6477,7 @@ end
%
% \begin{macrocode}
\NewDocumentCommand{\capitalemdash}{s}
- {\raisebox{\typog@raisecapitaldash}{\textemdash}%
+ {\raisebox{\typog@config@raisecapitaldash}{\textemdash}%
\IfBooleanTF{#1}%
{\ignorespaces}%
{\typog@breakpoint\typog@allowhyphenation}}
@@ -5531,7 +6505,7 @@ end
%
% \begin{macrocode}
\NewDocumentCommand{\figuredash}{s}
- {\raisebox{\typog@raisefiguredash}{\textendash}%
+ {\raisebox{\typog@config@raisefiguredash}{\textendash}%
\IfBooleanTF{#1}%
{\ignorespaces}%
{\typog@breakpoint\typog@allowhyphenation}}
@@ -5550,9 +6524,9 @@ end
% \begin{macrocode}
\NewDocumentCommand{\capitaltimes}{}
{\ifmmode
- \mathbin{\raisebox{\typog@raisecapitaltimes}{$\m@th\times$}}%
+ \mathbin{\raisebox{\typog@config@raisecapitaltimes}{$\m@th\times$}}%
\else
- \raisebox{\typog@raisecapitaltimes}{\texttimes}%
+ \raisebox{\typog@config@raisecapitaltimes}{\texttimes}%
\fi}
% \end{macrocode}
%
@@ -5571,7 +6545,7 @@ end
% \begin{macrocode}
\NewDocumentCommand{\singleguillemetleft}{}
{\typog@allowhyphenation
- \raisebox{\typog@raiseguillemets}{\guilsinglleft}}
+ \raisebox{\typog@config@raiseguillemets}{\guilsinglleft}}
% \end{macrocode}
%
% \acronym{PDF}-substitute definition
@@ -5584,7 +6558,7 @@ end
% \begin{macro}{\singleguillemetright}
% \begin{macrocode}
\NewDocumentCommand{\singleguillemetright}{}
- {\raisebox{\typog@raiseguillemets}{\guilsinglright}%
+ {\raisebox{\typog@config@raiseguillemets}{\guilsinglright}%
\typog@allowhyphenation}
% \end{macrocode}
%
@@ -5599,7 +6573,7 @@ end
% \begin{macrocode}
\NewDocumentCommand{\doubleguillemetleft}{}
{\typog@allowhyphenation
- \raisebox{\typog@raiseguillemets}{\guillemotleft}}
+ \raisebox{\typog@config@raiseguillemets}{\guillemotleft}}
% \end{macrocode}
%
% \acronym{PDF}-substitute definition
@@ -5612,7 +6586,7 @@ end
% \begin{macro}{\doubleguillemetright}
% \begin{macrocode}
\NewDocumentCommand{\doubleguillemetright}{}
- {\raisebox{\typog@raiseguillemets}{\guillemotright}%
+ {\raisebox{\typog@config@raiseguillemets}{\guillemotright}%
\typog@allowhyphenation}
% \end{macrocode}
%
@@ -5627,7 +6601,7 @@ end
% \begin{macrocode}
\NewDocumentCommand{\Singleguillemetleft}{}
{\typog@allowhyphenation
- \raisebox{\typog@raisecapitalguillemets}{\guilsinglleft}}
+ \raisebox{\typog@config@raisecapitalguillemets}{\guilsinglleft}}
% \end{macrocode}
%
% \acronym{PDF}-substitute definition
@@ -5640,7 +6614,7 @@ end
% \begin{macro}{\Singleguillemetright}
% \begin{macrocode}
\NewDocumentCommand{\Singleguillemetright}{}
- {\raisebox{\typog@raisecapitalguillemets}{\guilsinglright}%
+ {\raisebox{\typog@config@raisecapitalguillemets}{\guilsinglright}%
\typog@allowhyphenation}
% \end{macrocode}
%
@@ -5655,7 +6629,7 @@ end
% \begin{macrocode}
\NewDocumentCommand{\Doubleguillemetleft}{}
{\typog@allowhyphenation
- \raisebox{\typog@raisecapitalguillemets}{\guillemotleft}}
+ \raisebox{\typog@config@raisecapitalguillemets}{\guillemotleft}}
% \end{macrocode}
%
% \acronym{PDF}-substitute definition
@@ -5668,7 +6642,7 @@ end
% \begin{macro}{\Doubleguillemetright}
% \begin{macrocode}
\NewDocumentCommand{\Doubleguillemetright}{}
- {\raisebox{\typog@raisecapitalguillemets}{\guillemotright}%
+ {\raisebox{\typog@config@raisecapitalguillemets}{\guillemotright}%
\typog@allowhyphenation}
% \end{macrocode}
%
@@ -5681,6 +6655,457 @@ end
% \end{macro}
%
%
+% \subsection{Vert. Adjust Label Items}
+%
+% \begin{macro}{\@typog@uppercase@adjust@labelitem}
+% Handle all possible requests for uppercase label item correction.
+% Patch |itemize|~environments.
+%
+% \begin{macrocode}
+\newcommand*{\@typog@uppercase@adjust@labelitem}[1]
+ {\@typog@maybe@patch@itemize
+ \ifstrequal{#1}{*}
+ {\setlength{\typog@adjust@labelitemi}
+ {\typog@adjust@uppercase@labelitemi}
+ \setlength{\typog@adjust@labelitemii}
+ {\typog@adjust@uppercase@labelitemii}
+ \setlength{\typog@adjust@labelitemiii}
+ {\typog@adjust@uppercase@labelitemiii}
+ \setlength{\typog@adjust@labelitemiv}
+ {\typog@adjust@uppercase@labelitemiv}}
+ {\ifcase #1% 0
+ \relax % outside of any itemize environment
+ \or % 1
+ \setlength{\typog@adjust@labelitemi}
+ {\typog@adjust@uppercase@labelitemi}
+ \or % 2
+ \setlength{\typog@adjust@labelitemii}
+ {\typog@adjust@uppercase@labelitemii}
+ \or % 3
+ \setlength{\typog@adjust@labelitemiii}
+ {\typog@adjust@uppercase@labelitemiii}
+ \or % 4
+ \setlength{\typog@adjust@labelitemiv}
+ {\typog@adjust@uppercase@labelitemiv}
+ \else
+ \PackageError{typog}
+ {Itemize level out of range}
+ {Valid levels are 1, 2, 3, 4, and *}
+ \fi}}
+
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@typog@lowercase@adjust@labelitem}
+% Handle all possible requests for lowercase label item correction.
+% Patch |itemize|~environments.
+%
+% \begin{macrocode}
+\newcommand*{\@typog@lowercase@adjust@labelitem}[1]
+ {\@typog@maybe@patch@itemize
+ \ifstrequal{#1}{*}
+ {\setlength{\typog@adjust@labelitemi}
+ {\typog@adjust@lowercase@labelitemi}
+ \setlength{\typog@adjust@labelitemii}
+ {\typog@adjust@lowercase@labelitemii}
+ \setlength{\typog@adjust@labelitemiii}
+ {\typog@adjust@lowercase@labelitemiii}
+ \setlength{\typog@adjust@labelitemiv}
+ {\typog@adjust@lowercase@labelitemiv}}
+ {\ifcase #1% 0
+ \relax % outside of any itemize environment
+ \or % 1
+ \setlength{\typog@adjust@labelitemi}
+ {\typog@adjust@lowercase@labelitemi}
+ \or % 2
+ \setlength{\typog@adjust@labelitemii}
+ {\typog@adjust@lowercase@labelitemii}
+ \or % 3
+ \setlength{\typog@adjust@labelitemiii}
+ {\typog@adjust@lowercase@labelitemiii}
+ \or % 4
+ \setlength{\typog@adjust@labelitemiv}
+ {\typog@adjust@lowercase@labelitemiv}
+ \else
+ \PackageError{typog}
+ {Itemize level out of range}
+ {Valid levels are 1, 2, 3, 4, and *}
+ \fi}}
+
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@typog@noadjust@labelitem}
+% Neutralize all label item corrections.
+% This function \emph{does not} request patching any |itemize|~environment!
+%
+% \begin{macrocode}
+\newcommand*{\@typog@noadjust@labelitem}[1]
+ {\ifstrequal{#1}{*}
+ {\setlength{\typog@adjust@labelitemi}{\z@}
+ \setlength{\typog@adjust@labelitemii}{\z@}
+ \setlength{\typog@adjust@labelitemiii}{\z@}
+ \setlength{\typog@adjust@labelitemiv}{\z@}}
+ {\ifcase #1% 0
+ \relax % outside of any itemize environment
+ \or % 1
+ \setlength{\typog@adjust@labelitemi}{\z@}
+ \or % 2
+ \setlength{\typog@adjust@labelitemii}{\z@}
+ \or % 3
+ \setlength{\typog@adjust@labelitemiii}{\z@}
+ \or % 4
+ \setlength{\typog@adjust@labelitemiv}{\z@}
+ \else
+ \PackageError{typog}
+ {Itemize level out of range}
+ {Valid levels are 1, 2, 3, 4, and *}
+ \fi}}
+
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\uppercaseadjustlabelitems}
+% \changes{v0.4}{2024-05-14}{New macro.}
+% User macro that handles lists and the treats the empty list specially. We wrap the code
+% into \cs{AfterPreamble} because it may be called in the document's preamble where we don't
+% know whether package~\packagename{enumitem} already has been loaded and we can patch its
+% variant of \code{itemize}.
+%
+% \begin{macrocode}
+\NewDocumentCommand{\uppercaseadjustlabelitems}{m}
+ {\AfterPreamble{%
+ \ifblank{#1}
+ {\@typog@uppercase@adjust@labelitem{\@itemdepth}}
+ {\forcsvlist{\@typog@uppercase@adjust@labelitem}{#1}}%
+ \ignorespaces}}
+
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\lowercaseadjustlabelitems}
+% \changes{v0.4}{2024-05-14}{New macro.}
+% User macro that handles lists and the treats the empty list specially.
+%
+% \begin{macrocode}
+\NewDocumentCommand{\lowercaseadjustlabelitems}{m}
+ {\AfterPreamble{%
+ \ifblank{#1}
+ {\@typog@lowercase@adjust@labelitem{\@itemdepth}}
+ {\forcsvlist{\@typog@lowercase@adjust@labelitem}{#1}}%
+ \ignorespaces}}
+
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\noadjustlabelitems}
+% \changes{v0.4}{2024-05-14}{New macro.}
+% User macro that handles lists and the treats the empty list specially.
+%
+% \begin{macrocode}
+\NewDocumentCommand{\noadjustlabelitems}{m}
+ {\ifblank{#1}
+ {\@typog@noadjust@labelitem{\@itemdepth}}
+ {\forcsvlist{\@typog@noadjust@labelitem}{#1}}%
+ \ignorespaces}
+
+% \end{macrocode}
+% \end{macro}
+%
+% Now we get to the dirty part. All the above definitions do not get called until we hack the
+% existing |itemize|-environments, either the one of plain~\LaTeX{} or the one modified by
+% package~\packagename{enumitem}.
+%
+% Here comes the result of \code{latexdef -c article -s itemize}, which was used to derive the
+% patch code:
+%
+% \begin{verbatim}
+% \def\itemize{%
+% \ifnum \@itemdepth > \thr@@
+% \@toodeep
+% \else
+% \advance\@itemdepth\@ne
+% \edef\@itemitem{labelitem\romannumeral\the\@itemdepth}%
+% \expandafter
+% \list
+% \csname\@itemitem\endcsname
+% {\def\makelabel##1{\hss\llap{##1}}}%
+% \fi}\end{verbatim}
+%
+% \begin{macro}{\@typog@itemize@patch}
+% This is the additional code we inject into plain \LaTeX's or
+% package~\packagename{enumitem}'s \cs{itemize}.
+%
+% \begin{macrocode}
+\newcommand*{\@typog@itemize@patch}
+% \end{macrocode}
+%
+% Save the original definition of \cs{@itemitem} for chain-calling it later on.
+%
+% \begin{macrocode}
+ {\letcs{\@typog@old@itemitem}{\@itemitem}
+% \end{macrocode}
+%
+% Sneak in our own macro's name.
+%
+% \begin{macrocode}
+ \edef\@itemitem{@typog@labelitem\romannumeral\the\@itemdepth}
+% \end{macrocode}
+%
+% Redefine under the original macro's name so that our code gets called and the old code
+% (\cs{@typog@old@itemitem}) is expanded.
+%
+% \begin{macrocode}
+ \expandafter\def\csname\@itemitem\endcsname
+ {\raisebox{\csname typog@adjust@labelitem\romannumeral\the\@itemdepth\endcsname}
+ {\@typog@old@itemitem}}}
+
+% \end{macrocode}
+% \end{macro}
+%
+% If package~\packagename{enumitem} has been loaded, we use the \emph{same} patch. Here comes
+% the result of \code{latexdef -c article -p enumitem -s enit@itemize@i} that explains, why no
+% change is required:
+%
+% \begin{verbatim}
+% \def\enit@itemize@i#1#2#3#4{%
+% \ifnum #1 > #3 \relax
+% \enit@toodeep
+% \else
+% \enit@prelist\@ne{#1}{#2}%
+% \edef\@itemitem{label#2\romannumeral#1}%
+% \expandafter
+% \enit@list
+% \csname\@itemitem\endcsname
+% {\let\enit@calc\z@
+% \def\makelabel##1{\enit@align{\enit@format{##1}}}%
+% \enit@preset{#2}{#1}{#4}%
+% \enit@calcleft
+% \enit@before
+% \enit@negwidth}%
+% \enit@keyfirst
+% \fi}\end{verbatim}
+%
+% \begin{macro}{\@typog@patch@itemize}
+% Unconditionally apply the patches that are just \emph{single} macro calls to disturb the
+% original macros as little as possible. If we detect \packagename{enumitem} to be present
+% we modify its definition of \code{itemize} otherwise we wrestle \LaTeX's macro.
+%
+% \begin{macrocode}
+\newcommand*{\@typog@patch@itemize}
+ {\ifdefined\enit@itemize@i
+ \patchcmd{\enit@itemize@i}
+ {\expandafter}
+ {\@typog@itemize@patch\expandafter}
+ {\typog@debug@typeout{patching enumitem \string\enit@itemize@i\space succeeded}}
+ {\PackageError{typog}
+ {Patching enumitem macro \string\enit@itemize@i\space failed}
+ {}}
+ \else
+ \patchcmd{\itemize}
+ {\expandafter}
+ {\@typog@itemize@patch\expandafter}
+ {\typog@debug@typeout{patching \string\itemize\space succeeded}}
+ {\PackageError{typog}
+ {Patching plain LaTeX macro \string\itemize\space failed}
+ {}}
+ \fi}
+
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@typog@maybe@patch@itemize}
+% Apply the patches only once.
+%
+% \begin{macrocode}
+\newbool{@typog@itemize@has@been@patched}
+\newcommand*{\@typog@maybe@patch@itemize}
+ {\ifbool{@typog@itemize@has@been@patched}
+ {\relax}
+ {\@typog@patch@itemize
+ \booltrue{@typog@itemize@has@been@patched}}}
+
+% \end{macrocode}
+% \end{macro}
+%
+% Here come our convenience macros to simplify an accurate setup of the label adjustments.
+%
+% \begin{macro}{\typog@hairline@width}
+% Line width of the horizontal reference lines in our convenience macros.
+%
+% \begin{macrocode}
+\newcommand*{\typog@hairline@width}{.125pt}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\typogadjuststairsfor}
+% The arguments are:
+% \#1: \meta{scale-factor},
+% \#2: \meta{step-size},
+% \#3: \meta{number-of-steps},
+% \#4: \meta{sample}, and
+% \#5: \cs{labelitem}\meta{N}.
+%
+% Generate an ascending stairs of argument~\#5.
+%
+% \begin{macrocode}
+\newcommand*{\typogadjuststairsfor}[5]
+% \end{macrocode}
+%
+% Store (half of) the space between two samples in \cs{dimen0}.
+%
+% \begin{macrocode}
+ {\dimen0=1pt%
+% \end{macrocode}
+%
+% Load the \meta{number-of-steps} and ensure that it is odd.
+%
+% \begin{macrocode}
+ \count0=#3\relax
+ \unless\ifodd\count0
+ \advance\count0 by 1%
+ \fi
+% \end{macrocode}
+%
+% Set the iteration counter.
+%
+% \begin{macrocode}
+ \setcounter{typog@@iteration}{1}%
+% \end{macrocode}
+%
+% Put the \meta{sample} into a box so that we can measure it with \cs{ht}.
+%
+% \begin{macrocode}
+ \setbox0=\hbox{#4}%
+% \end{macrocode}
+%
+% Box~1 is the accumulator for the raised samples.
+%
+% \begin{macrocode}
+ \setbox1=\hbox{}%
+% \end{macrocode}
+%
+% Build the stairs.
+%
+% \begin{macrocode}
+ \loop
+ \ifnum\thetypog@@iteration=\numexpr\count0 / 2\relax
+ \dimen1=2\dimen0
+ \else
+ \dimen1=\dimen0
+ \fi
+ \dimen2=\dimexpr#2 * (\thetypog@@iteration - \count0 / 2)\relax
+ \setbox1=\hbox{\unhbox1\raisebox{\dimen2}{\kern\dimen1 #5\kern\dimen1}}%
+ \addtocounter{typog@@iteration}{1}%
+ \unless\ifnum\thetypog@@iteration>\count0
+ \repeat
+% \end{macrocode}
+%
+% Merge the stairs with a hairline at \#1 times the height of \meta{sample}.
+% Answer just a single box.
+%
+% \begin{macrocode}
+ \mbox{\rlap{\raisebox{\fpeval{#1}\ht0}{\rule{\wd1}{\typog@hairline@width}}}\box1}}
+
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\typogadjuststairs}
+% \changes{v0.4}{2024-05-14}{New macro.}
+% The arguments are:
+% \#1: \meta{scale-factor},
+% \#2: \meta{step-size},
+% \#3: \meta{number-of-steps}, and
+% \#4: \meta{sample}.
+%
+% \begin{macrocode}
+\NewDocumentCommand{\typogadjuststairs}{O{.5} m m m}
+ {\begingroup
+ \unless\ifdim #2>\z@
+ \PackageError{typog}
+ {\string\typogadjuststairs\space non-positive step-size}
+ {step-size must be a positive dimension}%
+ \fi
+ \ifnum #3<1
+ \PackageError{typog}
+ {\string\typogadjuststairs\space too few number-of-steps}
+ {number-of-steps must at least be 1}%
+ \fi
+ \ifblank{#4}
+ {\PackageError{typog}
+ {sample must not be empty}
+ {supply either some uppercase or some lowercase letters}}
+ {}%
+ \def\arraystretch{1}%
+ \begin{tabular}{@{}c@{}}
+ \typogadjuststairsfor{#1}{#2}{#3}{#4}{\labelitemi} \\
+ \typogadjuststairsfor{#1}{#2}{#3}{#4}{\labelitemii} \\
+ \typogadjuststairsfor{#1}{#2}{#3}{#4}{\labelitemiii} \\
+ \typogadjuststairsfor{#1}{#2}{#3}{#4}{\labelitemiv}
+ \end{tabular}
+ \endgroup}
+
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\typog@uppercase@adjusted@labelitems}
+% Return all four labelitems in a horizontal box after they have been adjusted with the
+% uppercase-constants set.
+%
+% \begin{macrocode}
+\newcommand*{\typog@uppercase@adjusted@labelitems}
+ {\hbox{\raisebox{\typog@adjust@uppercase@labelitemi}{\labelitemi}%
+ \raisebox{\typog@adjust@uppercase@labelitemii}{\labelitemii}%
+ \raisebox{\typog@adjust@uppercase@labelitemiii}{\labelitemiii}%
+ \raisebox{\typog@adjust@uppercase@labelitemiv}{\labelitemiv}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\typoguppercaseadjustcheck}
+% \changes{v0.4}{2024-05-14}{New macro.}
+% We stuff the user's sample text into a box only to measure its height. We typeset all four
+% labels and draw a hairline at half the height of the sample right through it.
+%
+% \begin{macrocode}
+\NewDocumentCommand{\typoguppercaseadjustcheck}{O{.5} m}
+ {\setbox0=\hbox{#2}%
+ \setbox1=\typog@uppercase@adjusted@labelitems
+ \mbox{\rlap{\raisebox{\fpeval{#1}\ht0}
+ {\rule{\wd1}{\typog@hairline@width}}}%
+ \box1}}
+
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\typog@lowercase@adjusted@labelitems}
+% Return all four labelitems in a horizontal box after they have been adjusted with the
+% lowercase-constants set.
+%
+% \begin{macrocode}
+\newcommand*{\typog@lowercase@adjusted@labelitems}
+ {\hbox{\raisebox{\typog@adjust@lowercase@labelitemi}{\labelitemi}%
+ \raisebox{\typog@adjust@lowercase@labelitemii}{\labelitemii}%
+ \raisebox{\typog@adjust@lowercase@labelitemiii}{\labelitemiii}%
+ \raisebox{\typog@adjust@lowercase@labelitemiv}{\labelitemiv}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\typoglowercaseadjustcheck}
+% \changes{v0.4}{2024-05-14}{New macro.}
+% Same code as \cs{typoguppercaseadjustcheck} for lowercase.
+%
+% \begin{macrocode}
+\NewDocumentCommand{\typoglowercaseadjustcheck}{O{.5} m}
+ {\setbox0=\hbox{#2}%
+ \setbox1=\typog@lowercase@adjusted@labelitems
+ \mbox{\rlap{\raisebox{\fpeval{#1}\ht0}
+ {\rule{\wd1}{\typog@hairline@width}}}%
+ \box1}}
+
+% \end{macrocode}
+% \end{macro}
+%
+%
% \subsection[Align Last Line]{Align Last Line of a Paragraph}
%
% The code of environment |lastlineraggedleftpar|
@@ -5955,7 +7380,7 @@ end
% \end{environment}
%
%
-% \subsection{Microtype Front\capitalhyphen End}
+% \subsection{\packagename{Microtype} Front\capitalhyphen End}
%
% \subsubsection*{Tracking}
%
@@ -6296,7 +7721,7 @@ end
% \item[Initialize.] \code{load("list\_functions")\$}
% \item[\cs{tolerance}:] \code{logspace(log10(200), log10(9999), 9), numer;}
% \item[\cs{emergencystretch}:] \code{linspace(0, 3, 9), numer;}
-% \item[\cs{hfuzz}:] \code{linspace(0.1, 0.5, 9);}
+% \item[\cs{hfuzz}:] \code{linspace(.1, .5, 9);}
% \end{description}
% \end{implementationnote}
%
@@ -6338,7 +7763,7 @@ end
\NewDocumentCommand{\vtietop}{O{3}}
{\setcounter{typog@mean@penalty}
{\typog@geometric@mean{\@M}{\clubpenalty}}%
- \typog@typeout{vtietop: penalties \the\@M--\the\value{typog@mean@penalty}--\the\clubpenalty}%
+ \typog@debug@typeout{vtietop: penalties \the\@M--\the\value{typog@mean@penalty}--\the\clubpenalty}%
\unless\ifnum\clubpenalty<\@M
\PackageWarning{typog}{vtietop: clubpenalty=\the\clubpenalty\space>= 10000}%
\fi
@@ -6426,7 +7851,7 @@ end
\NewDocumentCommand{\vtiebot}{O{3}}
{\setcounter{typog@mean@penalty}
{\typog@geometric@mean{\@M}{\widowpenalty}}%
- \typog@typeout{vtiebot: penalties \the\@M--\the\value{typog@mean@penalty}--\the\widowpenalty}%
+ \typog@debug@typeout{vtiebot: penalties \the\@M--\the\value{typog@mean@penalty}--\the\widowpenalty}%
\unless\ifnum\widowpenalty<\@M
\PackageWarning{typog}{vtiebot: widowpenalty=\the\widowpenalty\space>= 10000}%
\fi
@@ -6494,7 +7919,7 @@ end
\NewDocumentCommand{\typog@vtiebotdisp}{m}
{\setcounter{typog@mean@penalty}
{\typog@geometric@mean{\@M}{\displaywidowpenalty}}%
- \typog@typeout{vtiebotdisp: penalties \the\@M--\the\value{typog@mean@penalty}--\the\displaywidowpenalty}%
+ \typog@debug@typeout{vtiebotdisp: penalties \the\@M--\the\value{typog@mean@penalty}--\the\displaywidowpenalty}%
\unless\ifnum\displaywidowpenalty<\@M
\PackageWarning{typog}{vtiebotdisp: displaywidowpenalty=\the\displaywidowpenalty\space>= 10000}%
\fi
@@ -6588,7 +8013,7 @@ end
% \end{environment}
%
%
-% \subsection{Setspace Front-End}
+% \subsection{\packagename{Setspace} Front-End}
%
% \begin{macro}{\typog@iter@limit}
% The maximum number of iterations we perform before bailing out with an error. Can be
@@ -6631,9 +8056,9 @@ end
% \begin{macrocode}
\dim_set:Nn \l_tmpa_dim {\glueexpr #1}
- \typog@typeout{\string\setbaselineskip:\space
+ \typog@debug@typeout{\string\setbaselineskip:\space
initial\space baselineskip:\space \the\baselineskip}
- \typog@typeout{\string\setbaselineskip:\space
+ \typog@debug@typeout{\string\setbaselineskip:\space
target\space baselineskip:\space \dim_use:N \l_tmpa_dim}
\dim_compare:nNnTF {\baselineskip} > {\c_zero_dim}
@@ -6686,10 +8111,10 @@ end
{}
}
- \typog@typeout{\string\setbaselineskip:\space
+ \typog@debug@typeout{\string\setbaselineskip:\space
final\space \string\setstretch\space argument:\space
\fp_use:N \l_tmpa_fp}
- \typog@typeout{\string\setbaselineskip:\space
+ \typog@debug@typeout{\string\setbaselineskip:\space
final\space baselineskip:\space \the\baselineskip}
}
@@ -6756,7 +8181,7 @@ end
% \begin{macrocode}
\AfterEndPreamble{
\dim_set:Nn \typogfontsize {\fontdimen6\font}
- \typog@typeout{\string\typogfontsize =
+ \typog@debug@typeout{\string\typogfontsize =
\dim_use:N \typogfontsize\space
(at\space begin\space of\space document)}
}
@@ -6892,13 +8317,13 @@ end
\skip1=#2\relax
\skip2=#3\relax
\skip3=#4\relax
- \typog@typeout{smoothraggedrightshapetriplet: skip0=\the\skip0}%
- \typog@typeout{smoothraggedrightshapetriplet: skip1=\the\skip1}%
- \typog@typeout{smoothraggedrightshapetriplet: skip2=\the\skip2}%
- \typog@typeout{smoothraggedrightshapetriplet: skip3=\the\skip3}%
+ \typog@debug@typeout{smoothraggedrightshapetriplet: skip0=\the\skip0}%
+ \typog@debug@typeout{smoothraggedrightshapetriplet: skip1=\the\skip1}%
+ \typog@debug@typeout{smoothraggedrightshapetriplet: skip2=\the\skip2}%
+ \typog@debug@typeout{smoothraggedrightshapetriplet: skip3=\the\skip3}%
\unless\ifnum\typog@mod{\typog@triplet@max@lines}{3}=0
\PackageError{typog}
- {Line number of triplet generator %
+ {Line number of triplet generator\space
(\typog@triplet@max@lines) not divisible by 3}
{}
\fi
@@ -6943,15 +8368,15 @@ end
\skip3=#4\relax
\skip4=#5\relax
\skip5=#6\relax
- \typog@typeout{smoothraggedrightshapequintuplet: skip0=\the\skip0}%
- \typog@typeout{smoothraggedrightshapequintuplet: skip1=\the\skip1}%
- \typog@typeout{smoothraggedrightshapequintuplet: skip2=\the\skip2}%
- \typog@typeout{smoothraggedrightshapequintuplet: skip3=\the\skip3}%
- \typog@typeout{smoothraggedrightshapequintuplet: skip4=\the\skip4}%
- \typog@typeout{smoothraggedrightshapequintuplet: skip5=\the\skip5}%
+ \typog@debug@typeout{smoothraggedrightshapequintuplet: skip0=\the\skip0}%
+ \typog@debug@typeout{smoothraggedrightshapequintuplet: skip1=\the\skip1}%
+ \typog@debug@typeout{smoothraggedrightshapequintuplet: skip2=\the\skip2}%
+ \typog@debug@typeout{smoothraggedrightshapequintuplet: skip3=\the\skip3}%
+ \typog@debug@typeout{smoothraggedrightshapequintuplet: skip4=\the\skip4}%
+ \typog@debug@typeout{smoothraggedrightshapequintuplet: skip5=\the\skip5}%
\unless\ifnum\typog@mod{\typog@quintuplet@max@lines}{5}=0
\PackageError{typog}
- {Line number of quintuplet generator %
+ {Line number of quintuplet generator\space
(\typog@quintuplet@max@lines) not divisible by 5}
{}
\fi
@@ -6998,17 +8423,17 @@ end
\skip5=#6\relax
\skip6=#7\relax
\skip7=#8\relax
- \typog@typeout{smoothraggedrightshapeseptuplet: skip0=\the\skip0}%
- \typog@typeout{smoothraggedrightshapeseptuplet: skip1=\the\skip1}%
- \typog@typeout{smoothraggedrightshapeseptuplet: skip2=\the\skip2}%
- \typog@typeout{smoothraggedrightshapeseptuplet: skip3=\the\skip3}%
- \typog@typeout{smoothraggedrightshapeseptuplet: skip4=\the\skip4}%
- \typog@typeout{smoothraggedrightshapeseptuplet: skip5=\the\skip5}%
- \typog@typeout{smoothraggedrightshapeseptuplet: skip6=\the\skip6}%
- \typog@typeout{smoothraggedrightshapeseptuplet: skip7=\the\skip7}%
+ \typog@debug@typeout{smoothraggedrightshapeseptuplet: skip0=\the\skip0}%
+ \typog@debug@typeout{smoothraggedrightshapeseptuplet: skip1=\the\skip1}%
+ \typog@debug@typeout{smoothraggedrightshapeseptuplet: skip2=\the\skip2}%
+ \typog@debug@typeout{smoothraggedrightshapeseptuplet: skip3=\the\skip3}%
+ \typog@debug@typeout{smoothraggedrightshapeseptuplet: skip4=\the\skip4}%
+ \typog@debug@typeout{smoothraggedrightshapeseptuplet: skip5=\the\skip5}%
+ \typog@debug@typeout{smoothraggedrightshapeseptuplet: skip6=\the\skip6}%
+ \typog@debug@typeout{smoothraggedrightshapeseptuplet: skip7=\the\skip7}%
\unless\ifnum\typog@mod{\typog@septuplet@max@lines}{7}=0
\PackageError{typog}
- {Line number of septuplet generator %
+ {Line number of septuplet generator\space
(\typog@septuplet@max@lines) not divisible by 7}
{}
\fi
@@ -7115,7 +8540,7 @@ end
% |generator=triplet| produces a \doublequotes{short line -- long line -- middle length line}~sequence.
% \begin{macrocode}
\typog@fuzzwidth=.25\smoothraggedrightragwidth
- \typog@typeout{smoothraggedright: generator=triplet, typog@fuzzwidth=\the\typog@fuzzwidth}%
+ \typog@debug@typeout{smoothraggedright: generator=triplet, typog@fuzzwidth=\the\typog@fuzzwidth}%
\smoothraggedrightshapetriplet[leftskip=\typog@@smoothraggedrightleftskip,
parindent=\glueexpr\smoothraggedrightparindent + \parindent,
#1]%
@@ -7130,7 +8555,7 @@ end
% |generator=quintuplet|.
% \begin{macrocode}
\typog@fuzzwidth=.125\smoothraggedrightragwidth
- \typog@typeout{smoothraggedright: generator=quintuplet, typog@fuzzwidth=\the\typog@fuzzwidth}%
+ \typog@debug@typeout{smoothraggedright: generator=quintuplet, typog@fuzzwidth=\the\typog@fuzzwidth}%
\smoothraggedrightshapequintuplet[leftskip=\typog@@smoothraggedrightleftskip,
parindent=\glueexpr\smoothraggedrightparindent + \parindent,
#1]%
@@ -7153,7 +8578,7 @@ end
%
% \begin{macrocode}
\typog@fuzzwidth=.08333\smoothraggedrightragwidth
- \typog@typeout{smoothraggedright: generator=septuplet, typog@fuzzwidth=\the\typog@fuzzwidth}%
+ \typog@debug@typeout{smoothraggedright: generator=septuplet, typog@fuzzwidth=\the\typog@fuzzwidth}%
\smoothraggedrightshapeseptuplet[leftskip=\typog@@smoothraggedrightleftskip,
parindent=\glueexpr\smoothraggedrightparindent + \parindent,
#1]%
@@ -7198,7 +8623,7 @@ end
%
%
% \addtocontents{toc}{\protect\end{multicols}}
-% \addtocontents{toc}{\endgroup}
+% \addtocontents{toc}{\protect\end{list}}
%
%
% \Finale
@@ -7220,10 +8645,14 @@ end
\usepackage{fullwidth}
\usepackage{hyphenat}
\usepackage{mathtools}
-\usepackage[activate=true, verbose=true]{microtype}
+\usepackage[activate=true, verbose=false]{microtype}
\usepackage{ragged2e}
\usepackage[nobottomtitles*]{titlesec}\renewcommand*{\bottomtitlespace}{.2\textheight}
-\usepackage[debug, trackingttspacing]{typog}
+\usepackage{trace}
+\usepackage[debug,
+ trackingttspacing,
+ uppercaselabelitemadjustments={0pt, .1em, .15em, .1em},
+ lowercaselabelitemadjustments={-.0667em, 0pt, .1em, 0pt}]{typog}
\usepackage{xcolor}
\usepackage[loosest, proportional, scaled=1.064]{erewhon}
@@ -7234,49 +8663,42 @@ end
\def\xsfdefault{\relax}
-{
- \def\examplefont{6}
-
- \ifcase\examplefont % 0 -- document's default sans-serif font (e.g., ecrm1000)
- \gdef\examplefontname{default}
- \global\let\xsf=\sf
- \global\let\xsfdefault=\sfdefault
- \or % 1 -- Nunito
- \gdef\examplefontname{Nunito}
- \usepackage{nunito}
- \xdef\xsfdefault{\rmdefault}
- \gdef\xsf{\let\sfdefault=\xsfdefault\sf}
- \or % 2 -- OpenSans
- \gdef\examplefontname{OpenSans}
- \usepackage[defaultsans]{opensans}
- \xdef\xsfdefault{\sfdefault}
- \gdef\xsf{\let\sfdefault=\xsfdefault\sf}
- \or % 3 -- Noto Sans
- \gdef\examplefontname{OpenSans}
- \usepackage[sfdefault]{noto}
- \xdef\xsfdefault{\sfdefault}
- \gdef\xsf{\let\sfdefault=\xsfdefault\sf}
- \or % 4 -- Roboto
- \gdef\examplefontname{Roboto}
- \usepackage[sfdefault]{roboto}
- \xdef\xsfdefault{\sfdefault}
- \gdef\xsf{\let\sfdefault=\xsfdefault\sf}
- \or % 5 -- Montserrat
- \gdef\examplefontname{Montserrat Alternate}
- \usepackage[alternates]{montserrat}
- \xdef\xsfdefault{\sfdefault}
- \gdef\xsf{\let\sfdefault=\xsfdefault\sf}
- \or % 6 -- Inter
- \gdef\examplefontname{Inter}
- \usepackage[sfdefault]{inter}
- \xdef\xsfdefault{\sfdefault}
- \gdef\xsf{\let\sfdefault=\xsfdefault\sf}
- \else
- \SelectedUnknownExampleFont
- \fi
- \typeout{typog-example: font for examples: `\xsfdefault'}%
-}
+\def\examplefont{6}
+
+\ifcase\examplefont % 0 -- document's default sans-serif font (e.g., ecrm1000)
+ \def\examplefontname{default}
+ \let\xsf=\sf
+ \let\xsfdefault=\sfdefault
+\or % 1 -- Nunito
+ \def\examplefontname{Nunito}
+ \def\xsfdefault{Nunito-TOsF}
+ \def\xsf{\let\sfdefault=\xsfdefault\sf}
+\or % 2 -- OpenSans
+ \def\examplefontname{OpenSans}
+ \def\xsfdefault{opensans-TLF}
+ \def\xsf{\let\sfdefault=\xsfdefault\sf}
+\or % 3 -- Noto Sans
+ \def\examplefontname{Noto Sans}
+ \def\xsfdefault{NotoSans-TLF}
+ \def\xsf{\let\sfdefault=\xsfdefault\sf}
+\or % 4 -- Roboto
+ \def\examplefontname{Roboto}
+ \def\xsfdefault{Roboto-LF}
+ \def\xsf{\let\sfdefault=\xsfdefault\sf}
+\or % 5 -- Montserrat
+ \def\examplefontname{Montserrat Alternates}
+ \def\xsfdefault{MontserratAlternates-LF}
+ \def\xsf{\let\sfdefault=\xsfdefault\sf}
+\or % 6 -- Inter
+ \def\examplefontname{Inter}
+ \def\xsfdefault{Inter-LF}
+ \def\xsf{\let\sfdefault=\xsfdefault\sf}
+\else
+ \SelectedUnknownExampleFont
+\fi
+
+\typeout{typog-example: font for examples: `\xsfdefault'}%
\usepackage{hyperref}
@@ -7388,7 +8810,6 @@ end
concentrate all the badness in one place, making one truly unsightly line instead of
two moderately bad ones, because a single ``write-off'' produces fewest total
demerits according to the rules.}
- %There is a much better way to get the desired effect:~[\dots]
\newcommand*{\texbooktolerancesamplecredits}
{\medskip\noindent
\textsl{The sample text was taken from The~\TeX{}book~\cite[p.~107]{knuth:1986}.}}
@@ -7396,7 +8817,7 @@ end
\newcommand*{\texbookparfillskipsample}
{We still haven't discussed the special trick that allows the final line of a paragraph
to be shorter than the others. Just before \TeX{} begins to choose breakpoints,
- it does two important things: [\dots]}
+ it does two important things: [\dots\itcorr{-4}]}
\newcommand*{\texbooklongparfillskipsample}
{We still haven't discussed the special trick that allows the final line of a paragraph
to be shorter than the others. Just before \TeX{} begins to choose breakpoints,
@@ -7404,7 +8825,7 @@ end
that glue is discarded. (The reason is that a blank space often gets into a token list just
before \code{\char92par} or just before \code{\char36\char36}, and this blank space should not be
part of the paragraph.) (2)~Three or more items are put at the end of the
- current horizontal list~[\dots]}
+ current horizontal list~[\dots\itcorr{-4}]}
\newcommand*{\texbookparfillskipsamplecredits}
{\medskip\noindent
\textsl{The sample text was taken from The~\TeX{}book~\cite[p.~99n]{knuth:1986}.}}
@@ -7458,7 +8879,7 @@ end
\setcounter{tocdepth}{1}
-\setlength{\overfullrule}{3pt}
+\setlength{\overfullrule}{0pt}
\hbadness=-1
@@ -7575,7 +8996,76 @@ in the official documentation of package~\packagename{typog}.
\noindent
Unless otherwise noted the font used in the examples is \singlequotes{\examplefontname}.
-\bigskip
+
+\section{Setup and Reconfiguration}
+
+\noindent
+\code{\char`\\ typogget}
+
+\begin{list}{}{}
+ \newcommand*{\expandsto}{$\mathbin{\mapsto}$}
+\item \code{breakpenalty} \expandsto{} \the\typogget{breakpenalty}
+\item \code{ligaturekern} \expandsto{} \milliem{\typogget{ligaturekern}}
+\item \code{lowercaselabelitemadjustments} \expandsto{} \typogget{lowercaselabelitemadjustments}
+\item \code{mathitalicscorrection} \expandsto{} \the\typogget{mathitalicscorrection}
+\item \code{raisecapitaldash} \expandsto{} \the\typogget{raisecapitaldash}
+\item \code{raisecapitalguillemets} \expandsto{} \the\typogget{raisecapitalguillemets}
+\item \code{raisecapitalhyphen} \expandsto{} \the\typogget{raisecapitalhyphen}
+\item \code{raisecapitaltimes} \expandsto{} \the\typogget{raisecapitaltimes}
+\item \code{raisefiguredash} \expandsto{} \the\typogget{raisefiguredash}
+\item \code{raiseguillemets} \expandsto{} \the\typogget{raiseguillemets}
+\item \code{shrinklimits} \expandsto{} \typogget{shrinklimits}
+\item \code{slashkern} \expandsto{} \the\typogget{slashkern}
+\item \code{stretchlimits} \expandsto{} \typogget{stretchlimits}
+\item \code{textitalicscorrection} \expandsto{} \the\typogget{textitalicscorrection}
+\item \code{trackingttspacing} \expandsto{} \typogget{trackingttspacing}
+\item \code{uppercaselabelitemadjustments} \expandsto{} \typogget{uppercaselabelitemadjustments}
+\end{list}
+
+\begingroup
+ \dimen0=\typogget{raisecapitaldash}%
+ \setbox0=\hbox to \typogget{ligaturekern} {}%
+\endgroup
+
+\noindent
+\code{\char`\\ typoggetnth}
+
+\begin{list}{}{}
+\item
+ Elements of \code{lowercaselabelitemadjustments}:
+ (1)~\typoggetnth{\dimen0}{lowercaselabelitemadjustments}{1}\the\dimen0,
+ (2)~\typoggetnth{\dimen0}{lowercaselabelitemadjustments}{2}\the\dimen0,
+ (3)~\typoggetnth{\dimen0}{lowercaselabelitemadjustments}{3}\the\dimen0, and
+ (4)~\typoggetnth{\dimen0}{lowercaselabelitemadjustments}{4}\the\dimen0.
+
+ Same elements now accessed from the right-hand-side, i.\,e.~with negative indices:
+ (\textminus4)~\typoggetnth{nth}{lowercaselabelitemadjustments}{-4}\nth,
+ (\textminus3)~\typoggetnth{nth}{lowercaselabelitemadjustments}{-3}\nth,
+ (\textminus2)~\typoggetnth{nth}{lowercaselabelitemadjustments}{-2}\nth, and
+ (\textminus1)~\typoggetnth{nth}{lowercaselabelitemadjustments}{-1}\nth.
+
+\item Elements of \code{shrinklimits}:
+ (1)~\typoggetnth{nth}{shrinklimits}{1}\nth,
+ (2)~\typoggetnth{nth}{shrinklimits}{2}\nth, and
+ (3)~\typoggetnth{nth}{shrinklimits}{3}\nth.
+
+\item Elements of \code{stretchlimits}:
+ (1)~\typoggetnth{nth}{stretchlimits}{1}\nth,
+ (2)~\typoggetnth{nth}{stretchlimits}{2}\nth, and
+ (3)~\typoggetnth{nth}{stretchlimits}{3}\nth.
+
+\item Elements of \code{trackingttspacing}:
+ (1)~\typoggetnth{nth}{trackingttspacing}{1}\nth,
+ (2)~\typoggetnth{nth}{trackingttspacing}{2}\nth, and
+ (3)~\typoggetnth{nth}{trackingttspacing}{3}\nth.
+
+\item Elements of \code{uppercaselabelitemadjustments}:
+ (1)~\typoggetnth{\dimen0}{uppercaselabelitemadjustments}{1}\the\dimen0,
+ (2)~\typoggetnth{\dimen0}{uppercaselabelitemadjustments}{2}\the\dimen0,
+ (3)~\typoggetnth{\dimen0}{uppercaselabelitemadjustments}{3}\the\dimen0, and
+ (4)~\typoggetnth{\dimen0}{uppercaselabelitemadjustments}{4}\the\dimen0.
+\end{list}
+
\section{Information}
@@ -8068,6 +9558,82 @@ We again compare the default implementation with the adjusted one.
\end{quote}
+\section{Label Items}
+
+The current configurations for the uppercase and lowercase adjustments are
+\{\typogget{uppercaselabelitemadjustments}\} and \{\typogget{lowercaselabelitemadjustments}\},
+respectively.
+
+\begin{center}
+ \makeatletter
+ \noindent
+ A\raisebox{\typog@adjust@uppercase@labelitemi}{\labelitemi}%
+ B\raisebox{\typog@adjust@uppercase@labelitemii}{\labelitemii}%
+ E\raisebox{\typog@adjust@uppercase@labelitemiii}{\labelitemiii}%
+ G\raisebox{\typog@adjust@uppercase@labelitemiv}{\labelitemiv}H \\
+ a\raisebox{\typog@adjust@lowercase@labelitemi}{\labelitemi}%
+ b\raisebox{\typog@adjust@lowercase@labelitemii}{\labelitemii}%
+ c\raisebox{\typog@adjust@lowercase@labelitemiii}{\labelitemiii}%
+ e\raisebox{\typog@adjust@lowercase@labelitemiv}{\labelitemiv}g
+ \makeatother
+\end{center}
+
+For the following nested lists we adjust levels one and three for uppercase and levels two and
+four for lowercase.
+
+\begingroup
+ \uppercaseadjustlabelitems{1,3}
+ \lowercaseadjustlabelitems{2,4}
+ \setlength{\itemsep}{0pt}
+ \setlength{\parsep}{0pt}
+ \setlength{\topsep}{0pt}
+ \begin{itemize}
+ \item A
+ \item B
+ \item C
+ \begin{itemize}
+ \item d
+ \item e
+ \item f
+ \begin{itemize}
+ \item G
+ \item H
+ \item I
+ \begin{itemize}
+ \item j
+ \item k
+ \item l
+ \end{itemize}
+ \end{itemize}
+ \end{itemize}
+ \end{itemize}
+\endgroup
+\noadjustlabelitems{*}% not necessary, but we want to exercise the macro
+
+The left example shows the result of \code{\string\typogadjuststairs\{.25pt\}\{11\}\{ABC\}} and
+the one on the right hand side just uses the same parameters except for the sample~\sample{ace},
+this is, only lowercase letters.
+
+\begin{center}
+ \begin{minipage}[t]{12em}
+ \centering
+ \typogadjuststairs{.25pt}{11}{ABC}
+ \end{minipage}
+ \begin{minipage}[t]{12em}
+ \centering
+ \typogadjuststairs{.25pt}{11}{ace}
+ \end{minipage}
+\end{center}
+
+For this document the calls
+\code{\string\typoguppercaseadjustcheck\{ABC\-DEF\-GHI\-JKL\-MNO\-PQR\-STU\-VWX\-YZ\}} and
+\code{\string\typoglowercaseadjustcheck\{ace\-gmn\-opq\-rsu\-vwx\-yz\}} yield
+\sample{\typoguppercaseadjustcheck{ABCDEFGHIJKLMNOPQRSTUVWXYZ}} and
+\sample{\typoglowercaseadjustcheck{acegmnopqrsuvwxyz}}, where the adjustments in effect are
+\code{\{\typogget{uppercaselabelitemadjustments}\}} and
+\code{\{\typogget{lowercaselabelitemadjustments}\}}, respectively.
+
+
\clearpage
\section{Align Last Line}
@@ -8292,7 +9858,7 @@ consult \propername{David Carlisle's} excellent post on \propername{StackExchang
\begin{center}
\setlength{\overfullrule}{0pt}
- \newcommand*{\spacesampletext}[1]{some#1text#1with#1spaces\rule{0.1pt}{1em}}
+ \newcommand*{\spacesampletext}[1]{some#1text#1with#1spaces\rule{.1pt}{1em}}
\newsavebox{\narrowspacesample}
\sbox{\narrowspacesample}{\spacesampletext{\narrowspace}}
\newsavebox{\widespacesample}
@@ -8707,7 +10273,7 @@ New settings: \baselinesetsize.
\newcommand*{\relbls}{130}
\paragraph{\code{\string\setbaselineskippercentage\{\relbls\}}}
-\setbaselineskippercentage{1 + 2 + .3333 * 100 + 100 * 0.6667}% float expression
+\setbaselineskippercentage{1 + 2 + .3333 * 100 + 100 * .6667}% float expression
\setbaselineskippercentage{\relbls}
\fontsizeinfo{baselinesetsize}
New settings: \baselinesetsize.
@@ -8840,7 +10406,7 @@ visually: \rule{.1pt}{.8em}\kern\parindent\rule{.1pt}{.8em};
%
%
% \iffalse
-%<*nomicrotype>
+%<*without-microtype>
\documentclass[]{article}
@@ -8853,7 +10419,9 @@ visually: \rule{.1pt}{.8em}\kern\parindent\rule{.1pt}{.8em};
{\singleguillemetright}
{\singleguillemetleft}
-\usepackage[]{typog}
+\usepackage[uppercaselabelitemadjustments={.1em, .075em, .1em, .1em},
+ lowercaselabelitemadjustments={-.025em, -.05em, -.025em, -.025em}]
+ {typog}
\newcommand*{\packagename}[1]{\mbox{\textsf{#1}}}
@@ -8868,7 +10436,9 @@ visually: \rule{.1pt}{.8em}\kern\parindent\rule{.1pt}{.8em};
\bigskip
-\noindent
+
+\section*{No Microtype}
+
This example \LaTeX-document uses package~\packagename{typog}
\emph{without} package~\packagename{microtype}.
@@ -8876,6 +10446,38 @@ We want \packagename{typog} to be as usable as possible even without
the nice features that \packagename{microtype} offers.
After all \packagename{typog} is just a front-end for it.
+
+\section*{No EnumItem}
+
+We intentionally do not load package~\packagename{enumitem}, either.
+So, we can test whether \packagename{typog} correctly patches the
+plain \LaTeX{} definition if environment~\texttt{itemize}.
+
+The vertical alignment of the label items was setup for
+uppercase (ABC\typoguppercaseadjustcheck{ABCXYZ}XYZ) and for
+lowercase (ace\typoglowercaseadjustcheck{acexyz}xyz), though
+this is not necessary for the test.
+
+\uppercaseadjustlabelitems{*}
+\begin{itemize}
+\item Level i
+\item Sublist \dots
+ \begin{itemize}
+ \item Level ii
+ \item Sublist \dots
+ \begin{itemize}
+ \item Level iii
+ \item Sublist \dots
+ \begin{itemize}
+ \item Level iv
+ \end{itemize}
+ \end{itemize}
+ \end{itemize}
+\end{itemize}
+
+
+\section*{CSQuotes}
+
As we are testing a special configuration here anyhow,
we hook up our quotes with package~csquotes
to check whether they interact ok.
@@ -8883,7 +10485,28 @@ to check whether they interact ok.
\enquote{This is the outer part of the phrase
which contains the \enquote{inner part}.}}
\end{document}
-%</nomicrotype>
+%</without-microtype>
+% \fi
+%
+%
+%
+% \iffalse
+%<*minimal-test>
+\documentclass{minimal}
+
+\usepackage{typog}
+
+\newcommand*{\raiseamount}{0.5pt}
+
+\begin{document}
+\begin{typogsetup}{raise*=\raiseamount}
+ Em-dash raised by \the\typogget{raisecapitaldash} (expected: \raiseamount).
+\end{typogsetup}
+
+\fontsizeinfo{typoinfo}
+Document class ``minimal'' sets up font size and line spacing as~\typoinfo.
+\end{document}
+%</minimal-test>
% \fi
%
%
@@ -8902,35 +10525,49 @@ to check whether they interact ok.
/@menu/,/@end menu/d
## Convert sectioning macros to our own hierarchy.
-s/^@chapter \(.*\)$/\\subsection*{\\textls[40]{\1}}/
-s/^@section \(.*\)$/\\subsubsection*{\1}/
+s/^@chapter \(.*\)$/\\subsection{\\titlecase{\1}\\label{\1}}/
+s/^@section \(.*\)$/\\subsubsection{\\titlecase{\1}}\\label{\1}/
## Make `@asis' list resemble the Texinfo format.
s/@table @asis/\\begin{list}{}{\\itemindent=-20pt\\leftmargin=20pt}/
s/@end table/\\end{list}/
+## We substitute our maxipage environment for @display.
+s/@display/\\begin{maxipage}/
+s/@end display/\\end{maxipage}/
+
+## Translate `@example' environments.
+s/@example/\\begin{quote}\\tt\\obeylines/
+s/@end example/\\end{quote}\n\n/
+
## Indenting by four spaces generates a `verbatim' environment.
s/@verbatim/\\begin{verbatim}/
s/@end verbatim/\\end{verbatim}/
-## We substitute @display for our maxipage environment.
-s/@display/\\begin{maxipage}/
-s/@end display/\\end{maxipage}/
-
## The argument format of the URL macro is different.
s/@url{\([^,]*\), \([^}]*\)}/\\href{\1}{\2}/g
## Use our own markup.
s/\.\.\./\\dots{}/g
s/LaTeX/\\LaTeX{}/g
-s/@file/\\textit/g
+s/@file/\\emph/g
s/@strong/\\textbf/g
+s/@var/\\emph/g
s/[w]{/mbox{/g
+## Translate some Texinfo macros.
+s/@backslashchar/\\char`\\\\/g
+s/@lbracechar/\\{/g
+s/@noindent/\\noindent/g
+s/@rbracechar/\\}/g
+
## Quote some special characters.
s/%/\\%/g
s/_/\\_/g
+## Add space around alternative-indicators.
+s/[|]/\\,|\\,/g
+
## Adapt to how a man-page is typeset.
## En-dashes in front of long options really suck!
s/--/-\\nolig*-/g
@@ -8944,7 +10581,7 @@ s/@@/@/g
s/\\jobname/\\textbackslash jobname/g
## Make qualified Perl names breakable.
-s/::/::\\discretionary{}{}{}/g
+s/::/::\\breakpoint*/g
%</teximan2latex>
% \fi
%
@@ -8960,6 +10597,7 @@ use strict;
use warnings;
use Data::Dumper ();
+use Encode ();
use English;
use File::Basename ();
use Getopt::Long;
@@ -9011,32 +10649,32 @@ sub limit_string_length {
## We set all colors to `undef' and fill them later with the values
## of the actual configuration.
my $highlight_patterns = {
- PARTIAL_LINE => {
- FONT_SPEC => [qr#
- \\
- (?: OMS | OMX | OT1 | T1 | TS1 | U )
- (?: /[^/]+ ){5} / \S+ \s
- (?: \([+-]\d+\) )?
- #x, undef],
- MATH => [qr#
- \$
- \\
- (?: LMS | OML )
- (?: /[^/]+ ){5} / \S+ \s
- (?: \([+-]\d+\) )?
- .*?
- \$
- #x, undef]
- },
- WHOLE_LINE => {
- FILL_STATE => [qr#^(?:Under|Over)full \\hbox .*$#, undef],
- FIRST_VBOX => [qr#^%%#, undef],
- HORIZONTAL_BREAKPOINT => [qr#^@@\d+:.*$#, undef],
- HORIZONTAL_BREAK_CANDIDATE => [qr#^@[\\ ].*$#, undef],
- LINE_BREAK_PASS => [qr#^@[a-z]+?pass#, undef],
- TIGHTNESS => [qr#^(?:Loose|Tight) \\hbox .*$#, undef],
- VERTICAL_BREAKPOINT => [qr#^% t=\d+.*$#, undef]
- }
+ PARTIAL_LINE => {
+ FONT_SPEC => [qr#
+ \\
+ (?: OMS | OMX | OT1 | T1 | TS1 | U )
+ (?: /[^/]+ ){5} / \S+ \s
+ (?: \([+-]\d+\) )?
+ #x, undef],
+ MATH => [qr#
+ \$
+ \\
+ (?: LMS | OML )
+ (?: /[^/]+ ){5} / \S+ \s
+ (?: \([+-]\d+\) )?
+ .*?
+ \$
+ #x, undef]
+ },
+ WHOLE_LINE => {
+ FILL_STATE => [qr#^(?:Under|Over)full \\hbox .*$#, undef],
+ FIRST_VBOX => [qr#^%%#, undef],
+ HORIZONTAL_BREAKPOINT => [qr#^@@\d+:.*$#, undef],
+ HORIZONTAL_BREAK_CANDIDATE => [qr#^@[\\ ].*$#, undef],
+ LINE_BREAK_PASS => [qr#^@[a-z]+?pass#, undef],
+ TIGHTNESS => [qr#^(?:Loose|Tight) \\hbox .*$#, undef],
+ VERTICAL_BREAKPOINT => [qr#^% t=\d+.*$#, undef]
+ }
};
@@ -9048,7 +10686,7 @@ sub colorize_line {
return Term::ANSIColor::colored($line, $pattern_color_pair->[1])
if $line =~ $pattern_color_pair->[0];
}
- return $line if $line =~ m#^\.#; # we do not paint box contents yet
+ return $line if $line =~ m#^\.#; # we do not paint box contents yet
$line =~ s#$highlight_patterns->{PARTIAL_LINE}->{MATH}->[0]
#Term::ANSIColor::colored($MATCH, $highlight_patterns->{PARTIAL_LINE}->{MATH}->[1])
@@ -9074,13 +10712,30 @@ my $open_tag_regexp =
>#x;
+sub find_encoder {
+ my $encoding = shift;
+
+ my $encoder;
+
+ if ($encoding) {
+ $encoder = Encode::find_encoding($encoding);
+ if (!$encoder) {
+ issue_warning("encoding @{[quote_literal($encoding)]} unknown; proceeding without decoder");
+ }
+ }
+
+ return $encoder;
+}
+
+
sub grep_log_file {
my ($options, $configuration, $file, $filename, $id_regexp) = @_;
+ my $encoder = find_encoder($options->{ENCODING});
my $job_name;
- my $line_number = 0; # line number in the log file we are inspecting, i.e., $filename
+ my $line_number = 0; # line number in the log file we are inspecting, i.e., $filename
my $match_count = 0;
- my $source_line_number; # line number in TeX file the log refers to, i.e., "$job_name.tex"
+ my $source_line_number; # line number in TeX file the log refers to, i.e., "$job_name.tex"
my $page_number;
my $regexp_modifier = $options->{IGNORE_CASE} ? 'i' : '';
my $id_value;
@@ -9094,6 +10749,8 @@ sub grep_log_file {
chomp $line;
$line_number++;
+ $line = Encode::encode_utf8($encoder->decode($line, Encode::FB_CROAK)) if $encoder;
+
if ($line =~ $close_tag_regexp) {
fail_with_error("$filename: $line_number: mismatched open/close tags") unless @nesting_levels;
pop @nesting_levels;
@@ -9175,19 +10832,25 @@ sub grep_log_file {
}
}
}
+
+ return $match_count;
}
sub show_ids_in_file {
my ($options, $configuration, $file, $filename, $id_regexp) = @_;
+ my $encoder = find_encoder($options->{ENCODING});
my $line_number = 0;
+ my $match_count = 0;
my @nesting_levels;
while (my $line = readline $file) {
chomp $line;
$line_number++;
+ $line = Encode::encode_utf8($encoder->decode($line, Encode::FB_CROAK)) if $encoder;
+
if ($line =~ $close_tag_regexp) {
fail_with_error("$filename: $line_number: mismatched open/close tags") unless @nesting_levels;
pop @nesting_levels;
@@ -9200,6 +10863,7 @@ sub show_ids_in_file {
my $page_number = $+{page_match};
++$MATCH_COUNT;
+ ++$match_count;
push @nesting_levels, 1;
if ($options->{LOG_LINE_NUMBER}) {
@@ -9239,6 +10903,8 @@ sub show_ids_in_file {
print ' ' x $indent, $id_value, "\n";
}
}
+
+ return $match_count;
}
@@ -9256,7 +10922,7 @@ sub open_file_for_reading {
fail_with_error("cannot open @{[quote_filesystem($filename)]}: $OS_ERROR");
}
- $file;
+ return $file;
}
@@ -9272,9 +10938,9 @@ sub grep_or_show {
my ($options, $configuration, $file, $filename, $id_regexp) = @_;
if ($options->{SHOW_ALL_IDS}) {
- show_ids_in_file($options, $configuration, $file, $filename, $id_regexp);
+ return show_ids_in_file($options, $configuration, $file, $filename, $id_regexp);
} else {
- grep_log_file($options, $configuration, $file, $filename, $id_regexp);
+ return grep_log_file($options, $configuration, $file, $filename, $id_regexp);
}
}
@@ -9282,6 +10948,8 @@ sub grep_or_show {
sub scan_files {
my ($options, $configuration, $id_regexp, $log_filenames) = @_;
+ my $match_count = 0;
+
if (@$log_filenames) {
foreach my $log_filename (@$log_filenames) {
$log_filename = 'stdin' if $log_filename eq '-';
@@ -9294,15 +10962,17 @@ sub scan_files {
print $filename_header;
}
my $file = open_file_for_reading($log_filename);
- grep_or_show($options, $configuration, $file, $log_filename, $id_regexp);
+ $match_count += grep_or_show($options, $configuration, $file, $log_filename, $id_regexp);
close_file($file, $log_filename);
}
} else {
my $log_filename = 'stdin';
my $file = open_file_for_reading($log_filename);
- grep_or_show($options, $configuration, $file, $log_filename, $id_regexp);
+ $match_count = grep_or_show($options, $configuration, $file, $log_filename, $id_regexp);
close_file($file, $log_filename);
}
+
+ return $match_count;
}
@@ -9319,10 +10989,12 @@ sub redirect_and_scan_files {
my $stdout = select $pager;
$pager->autoflush;
- scan_files($options, $configuration, $id_regexp, $log_filenames);
+ my $match_count = scan_files($options, $configuration, $id_regexp, $log_filenames);
close $pager or issue_warning "error occurred while closing the pager (pid: $pid) pipe: $OS_ERROR";
select $stdout;
+
+ return $match_count;
}
@@ -9431,6 +11103,7 @@ sub setup_configuation {
my $default_options = {
COLORIZE_MODE => 'auto',
DEBUG => 0,
+ ENCODING => undef,
ID => 0,
IGNORE_CASE => 0,
JOB_NAME => 0,
@@ -9452,6 +11125,7 @@ Options
--colour [WHEN] use color to highlight specific log contents
WHEN is 'always', 'never', or 'auto'
-C, --config KEY=VALUE set configuration KEY to VALUE
+ -E, --encoding ENCODING set character ENCODING of LOG-FILE
-i, --[no-]id print matching id with output lines
-y, --[no-]ignore-case ignore case distinctions in patterns and data
-j, --[no-]job-name print \\jobname with output lines
@@ -9461,10 +11135,12 @@ Options
-P, --[no-]pager redirect output to pager
-w, --[no-]word-regexp match only whole words
- -a, --all, --any show all IDs in LOG-FILE
+ -a, --all, --any discover all IDs in LOG-FILE
+
--debug turn on debug output
-h, --help display this help and exit
--show-config show default configuration and exit
+ --show-encodings show all known encodings and exit
-V, --version show version information and exit
HELP_TEXT
@@ -9473,6 +11149,17 @@ HELP_TEXT
}
+sub show_encodings {
+ my @all_encodings = Encode->encodings(':all');
+
+ foreach my $encoding (@all_encodings) {
+ print "$encoding\n";
+ }
+
+ exit 0;
+}
+
+
sub show_configuration {
my $format_string_value = sub {quote_literal($default_configuration->{$_[0]})};
@@ -9508,10 +11195,10 @@ FIXED_CONFIGURATION_TEXT
sub show_version {
print <<VERSION_TEXT;
-typog-grep 0.1
+typog-grep @RELEASE@
Copyright (C) 2024 by Ch. L. Spiel
-License LPPL: LaTeX Project Public License version 1.3 or later
+License LPPL: LaTeX Project Public License version 1.3c or later
VERSION_TEXT
exit 0;
@@ -9527,6 +11214,7 @@ sub get_options {
'color|colour=s' => \$options->{COLORIZE_MODE},
'C|configuration=s' => sub{setup_configuation($_[1], $configuration)},
'debug+' => \$DEBUG,
+ 'E|encoding=s' => \$options->{ENCODING},
'h|help' => \&show_help,
'i|id!' => \$options->{ID},
'y|ignore-case!' => \$options->{IGNORE_CASE},
@@ -9535,13 +11223,18 @@ sub get_options {
'N|log-line-number!' => \$options->{LOG_LINE_NUMBER},
'p|page-number!' => \$options->{PAGE_NUMBER},
'P|pager!' => \$options->{REQUEST_PAGER},
+ 'show-encodings' => \&show_encodings,
'show-config' => \&show_configuration,
'V|version' => \&show_version,
'w|word-regexp!' => \$options->{WORD_REGEXP}) or
- fail_with_error('problems while parsing options');
+ fail_with_error('problems while parsing options');
- fail_with_error("unknown colorize mode @{[quote_literal($options->{COLORIZE_MODE})]}")
- unless $options->{COLORIZE_MODE} =~ m/^(?:always|auto|never)$/i
+ if ($options->{COLORIZE_MODE}) {
+ fail_with_error("unknown colorize mode @{[quote_literal($options->{COLORIZE_MODE})]}")
+ unless $options->{COLORIZE_MODE} =~ m/^(?:always|auto|never)$/i;
+ } else {
+ $options->{COLORIZE_MODE} = 'auto';
+ }
}
@@ -9565,14 +11258,27 @@ sub do_colorize {
sub main {
$OUTPUT_IS_REDIRECTED = -t STDOUT ? 0 : 1;
- my $options = {%$default_options};
my $configuration = {%$default_configuration};
+ my $options = {%$default_options};
+ debug_print(Data::Dumper::Dumper(['Default Configuration', $configuration]));
+ debug_print(Data::Dumper::Dumper(['Default Options', $options]));
+
+ my $user_options = {};
+ my $user_configuration = {};
+ get_options($user_options, $user_configuration);
+ debug_print(Data::Dumper::Dumper(['User Configuration', $user_configuration]));
+ debug_print(Data::Dumper::Dumper(['User Options', $user_options]));
+ while (my ($key, $value) = each %$user_options) {
+ $options->{$key} = $value if $value;
+ }
+ while (my ($key, $value) = each %$user_configuration) {
+ $configuration->{$key} = $value if $value;
+ }
+ debug_print(Data::Dumper::Dumper(['Final Configuration', $configuration]));
+ debug_print(Data::Dumper::Dumper(['Final Options', $options]));
- get_options($options, $configuration);
$options->{COLORIZE_OUTPUT} = do_colorize($options->{COLORIZE_MODE});
initialize_highlighting_from_configuration($configuration);
- debug_print(Data::Dumper::Dumper($configuration));
- debug_print(Data::Dumper::Dumper($options));
my $id_regexp;
if ($options->{SHOW_ALL_IDS}) {
@@ -9584,17 +11290,18 @@ sub main {
$id_regexp = shift @ARGV;
}
- if ($options->{REQUEST_PAGER} && $OUTPUT_IS_REDIRECTED) {
+ if ($user_options->{REQUEST_PAGER} && $OUTPUT_IS_REDIRECTED) {
issue_warning("option @{[quote_literal('--pager')]} ignored because output is redirected");
}
my $use_pager = $options->{REQUEST_PAGER} && !$OUTPUT_IS_REDIRECTED;
+ my $match_count;
if ($use_pager) {
- redirect_and_scan_files($options, $configuration, $id_regexp, \@ARGV);
+ $match_count = redirect_and_scan_files($options, $configuration, $id_regexp, \@ARGV);
} else {
- scan_files($options, $configuration, $id_regexp, \@ARGV);
+ $match_count = scan_files($options, $configuration, $id_regexp, \@ARGV);
}
- exit ($MATCH_COUNT == 0);
+ exit ($match_count == 0);
}
@@ -9615,7 +11322,7 @@ main();
=head1 NAME
-typog-grep - grep for typog-inspect elements in LaTeX log files
+typog-grep - specialized grep for typog-inspect elements in LaTeX log files
=head1 SYNOPSIS
@@ -9628,9 +11335,70 @@ typog-grep - grep for typog-inspect elements in LaTeX log files
=back
-The first form shows all C<E<lt>typog-inspect id="I<ID>" ...E<gt>> elements in F<LOG-FILE>.
+The first form, ``discovery mode'', shows all I<ID>s of
+
+=begin text
+
+<typog-inspect id="ID" ...>
+
+=end text
+
+=begin man
+
+.RS
+.EX
+<typog-inspect id="\fI\,ID\/\fP" ...>
+.EE
+.RE
+
+=end man
+
+=begin texinfo
+
+@example
+<typog-inspect id="@var{ID}" ...>
+@end example
+@noindent
+
+=end texinfo
+
+Z<>
+elements in F<LOG-FILE>.
+
+The second form shows the contents, I<LOG-DATA>, of the elements
-The second form shows the contents of C<E<lt>typog-inspect id="I<ID>" ...E<gt>> elements
+=begin text
+
+<typog-inspect id="ID" ...>
+LOG-DATA
+</typog-inspect>
+
+=end text
+
+=begin man
+
+.RS
+.EX
+<typog-inspect id="\fI\,ID\/\fP" ...>
+\fILOG-DATA\fP
+</typog-inspect>
+.EE
+.RE
+
+=end man
+
+=begin texinfo
+
+@example
+<typog-inspect id="@var{ID}" ...>
+@var{LOG-DATA}
+</typog-inspect>
+@end example
+@noindent
+
+=end texinfo
+
+Z<>
whose I<ID>s match I<REGEXP> in F<LOG-FILE>.
If no F<LOG-FILE> is given read from F<stdin>.
@@ -9639,57 +11407,101 @@ The S<filename C<->> is synonymous to F<stdin>.
=head1 DESCRIPTION
-B<typog-grep> is a tailored post-processor for LaTeX log files
-and the C<typoginspect> environment as provided by S<package typog>.
+B<typog-grep> is a tailored post-processor for LaTeX S<F<log> files>
+and the C<typoginspect> environment as provided by the S<LaTeX package typog>.
It shares more with the venerable
L<B<sgrep>|https://www.cs.helsinki.fi/u/jjaakkol/sgrep.html>
than with S<POSIX L<B<grep>|https://pubs.opengroup.org/onlinepubs/9699919799/utilities/grep.html>>.
-The LaTeX user brackets her text in
+In the LaTeX source file the user brackets her text or code
+in a C<typoginspect> environment:
+
+=begin text
+
+\begin{typoginspect}{ID}
+ TEXT-OR-CODE-TO-INVESTIGATE
+\end{typoginspect}
+
+=end text
+
+=begin man
+
+.RS
+.EX
+\ebegin{typoginspect}{\fI\,ID\/\fP}
+\fITEXT-OR-CODE-TO-INVESTIGATE\fP
+\eend{typoginspect}
+.EE
+.RE
- \begin{typoginspect}{ID}
- Text and code to investigate
- \end{typoginspect}
+=end man
+
+=begin texinfo
+
+@example
+@backslashchar{}begin@lbracechar{}typoginspect@rbracechar{}@lbracechar{}@var{ID}@rbracechar{}
+@var{TEXT-OR-CODE-TO-INVESTIGATE}
+@backslashchar{}end@lbracechar{}typoginspect@rbracechar{}
+@end example
+@noindent
+
+=end texinfo
+Z<>
where I<ID> is used to identify one or more bracketed snippets.
I<ID> does not have to be unique.
The I<REGEXP> mechanism makes it easy to select groups of related I<ID>s
if they are named accordingly.
-In F<LOG-FILE> the environment shows up, packed with tracing information, as
+In F<LOG-FILE> the result of the environment shows up,
+packed with tracing information, as
-=begin texinfo
+=begin text
-@display
-@relax
+<typog-inspect id="ID" job="JOB-NAME" line="LINE-NUMBER" page="PAGE-NUMBER">
+ LOG-DATA
+</typog-inspect>
-=end texinfo
+=end text
+
+=begin man
- <typog-inspect id="ID" job="JOB-NAME" line="LINE-NUMBER" page="PAGE-NUMBER">
- Trace Data
- </typog-inspect>
+.RS
+.EX
+<typog-inspect id="\fI\,ID\/\fP" job="\fI\,JOB-NAME\/\fP" line="\fI\,LINE-NUMBER\/\fP" page="\fI\,PAGE-NUMBER\/\fP">
+\fILOG-DATA\fP
+</typog-inspect>
+.EE
+.RE
+
+=end man
=begin texinfo
-@end display
-@relax
+@example
+<typog-inspect id="@var{ID}" job="@var{JOB-NAME}" line="@var{LINE-NUMBER}" page="@var{PAGE-NUMBER}">
+@var{LOG-DATA}
+</typog-inspect>
+@end example
+@noindent
=end texinfo
+Z<>
where all the capital-letter sequences are meta-variables
and in particular
I<JOB-NAME> is the expansion of C<\jobname>,
I<LINE-NUMBER> is the LaTeX source file line number
of the beginning of the C<typoginspect> environment,
and I<PAGE-NUMBER> is the page where
-the output of S<C<Text and code to investigate>> occurs.
+the output of S<C<TEXT-OR-CODE-TO-INVESTIGATE>> occurs.
B<typog-grep> reveals the contents of F<LOG-FILE>
between C<E<lt>typog-inspect id="I<ID>" ...E<gt>>
-and C<E<lt>/typog-inspectE<gt>> excluding the XML-tags.
+and C<E<lt>/typog-inspectE<gt>> excluding the XML-tags themselves.
Access the I<JOB-NAME>, I<LINE-NUMBER>, and I<PAGE-NUMBER>
with the commandline options
-B<--job-name>, B<--line-number>, and B<--page-number>, respectively.
+B<--job-name>, B<--line-number>, and B<--page-number>, respectively.
Use B<--id> to show the name of the IDs that matched I<REGEXP>.
C<typoginspect> environments can be nested.
@@ -9707,11 +11519,18 @@ The list of options is sorted by the names of the long options.
=item B<-a>, B<--all>, B<--any>
ID-discovery mode:
-Show all C<typog-inspect> elements independent of any matching patterns.
+Discover all C<typog-inspect> elements independent of any matching patterns
+and print their I<ID>s.
+The results are printed in their order of occurrence in the respective F<LOG-FILE>s.
+Pipe the output into B<sort> to get alphabetically ordered I<ID>s.
+
+Augment with options
+B<--job-name>, B<--line-number>, B<--log-line-number>, or S<B<--page-number>>
+for more information.
=item B<--color>, B<colour> I<WHEN>
-Colorize specific log contents for the matching ids.
+Colorize specific log contents for the matching I<ID>s.
The S<argument I<WHEN>> determines when to apply color:
C<always>, C<never>, S<or C<auto>>.
The setting C<auto> checks whether standard output has been redirected.
@@ -9720,29 +11539,45 @@ This is the default.
=item B<-C>, B<--config> I<KEY>=I<VALUE>[:I<KEY>=I<VALUE>[:...]]
Set one or more configuration I<KEY> to I<VALUE> pairs.
-See S<Sec. CONFIGURATION> below for a description of all available configuration items.
-Use option B<--show-config> to display the default configuration.
+See section L</CONFIGURATION> for a description
+of all available configuration items.
+Use S<option B<--show-config>> to display the default configuration.
=item B<--debug>
Turn on debug output on F<stderr>.
+=item B<-E>, B<--encoding> I<ENCODING>
+
+Set the I<ENCODING> of F<LOG-FILE> for the translation to UTF-8.
+The default is unset.
+
+Use this option to get rid of pesky
+S<"E<lt>I<HEX-DIGITS>E<gt>" escapes> on UTF-8 terminals.
+See S<option B<--show-encodings>> for the known encodings and
+Encode::Supported for a summary of all encodings.
+See also S<section L</Some Common Encodings>>.
+
+Apply L<B<iconv>|https://pubs.opengroup.org/onlinepubs/9699919799/utilities/iconv.html>
+(POSIX) or L<B<recode>|https://github.com/rrthomas/recode/> (GNU) on F<LOG-FILE>
+before this tool to avoid having to use S<option B<--encoding>>.
+
=item B<-h>, B<--help>
Display brief help then exit.
=item B<-i>, B<--[no-]id>
-Print the actual id name that matched I<REGEXP>.
-Control the appearance of the matching id with configuration S<item C<id-heading>>.
+Print the actual ID-name that matched I<REGEXP>.
+Control the appearance of the matching I<ID> with configuration S<item C<id-heading>>.
=item B<-y>, B<--[no-]ignore-case>
-Match ids while ignoring case distinctions in patterns and data.
+Match I<ID>s while ignoring case distinctions in patterns and data.
=item B<-j>, B<--[no-]job-name>
-Print the C<\jobname> that B<tex> associated with the input file.
+Print the C<\jobname> that B<latex> associated with the input file.
=item B<-n>, B<--[no-]line-number>
@@ -9766,6 +11601,10 @@ Redirect output from F<stdout> to the configured pager.
Show the default configuration and exit.
+=item B<--show-encodings>
+
+Show all known encodings and exit.
+
=item B<-V>, B<--version>
Show version information and exit.
@@ -9789,26 +11628,26 @@ S<Default: C<%s:>.>
=item C<id-heading>=C<0>E<verbar>C<1>
-Choose between printing the matching ids with S<option B<--id>>:
+Choose between printing the matching I<ID>s with S<option B<--id>>:
S<Inline (C<0>)> or heading before the matching data (C<1>).
S<Default: C<0>.>
=item C<id-heading-format>=I<FORMAT>
-Control the I<FORMAT> for printing matching ids in heading-mode,
+Control the I<FORMAT> for printing matching I<ID>s in heading-mode,
where I<FORMAT> is passed to Perl's C<printf>.
S<Default: C<--E<gt> %s E<lt>-->.>
=item C<id-indent>=I<INDENT>
Indentation of nested typog-inspect tags.
-Only used in ``discovery'' mode (first form), i.e., if B<--all> is active.
+Only used in ``discovery mode'' (first form), i.e., if S<B<--all>> is active.
S<Default: 8.>
=item C<id-max-length>=I<MAXIMUM-LENGTH>
-Set the maximum length of a matching id for printing.
-It a matching id exceeds this length it will be truncated
+Set the maximum length of a matching I<ID> for printing.
+It a matching I<ID> exceeds this length it will be truncated
and the last three characters (short of I<MAXIMUM-LENGTH>) will be replaced by dots.
S<Default: 40.>
@@ -9874,11 +11713,11 @@ Color of lines with horizontal S<breakpoints C<@@>>.
=item C<id-color>
-Color of matching ids when printed inline.
+Color of matching I<ID>s when printed inline.
=item C<id-heading-color>
-Color of matching ids when printed in heading form.
+Color of matching I<ID>s when printed in heading form.
=item C<line-break-pass-color>
@@ -9947,15 +11786,93 @@ C<bold>, C<dark>, C<italic>, C<underline>, C<reverse>
=back
+=head2 Some Common Encodings
+
+The following list shows some encodings
+that are suitable for S<option B<--encoding>>.
+
+=over 4
+
+=item Latin-1, Western European
+
+C<iso-8859-1>, C<cp850>, C<cp860>, C<cp1252>
+
+=item Latin-2, Central European
+
+C<iso-8859-2>, C<cp852>, C<cp1250>
+
+=item Latin-3, South European (Esperanto, Maltese)
+
+C<iso-8859-3>
+
+=item Latin-4, North European (Baltics)
+
+C<iso-8859-4>
+
+=item Cyrillics
+
+C<iso-8859-5>, C<cp855>, C<cp866> (Ukrainian), C<cp1251>
+
+=item Arabic
+
+C<iso-8859-6>, C<cp864>, C<cp1006> (Farsi), C<cp1256>
+
+=item Greek
+
+C<iso-8859-7>, C<cp737>, C<cp1253>
+
+=item Hebrew
+
+C<iso-8859-8>, C<cp862>, C<cp1255>
+
+=item Turkish
+
+C<iso-8859-9>, C<cp857>, C<cp1254>
+
+=item Nordic
+
+C<iso-8859-10>, C<cp865>, C<cp861> (Icelandic)
+
+=item Thai
+
+C<iso-8859-11>, C<cp874>
+
+=item Baltic
+
+C<iso-8859-13>, C<cp775>, C<cp1257>
+
+=item Celtic
+
+C<iso-8859-14>
+
+=item Latin-9 (sometimes called Latin0)
+
+C<iso-8859-15>
+
+=item Latin-10
+
+C<iso-8859-16>
+
+=back
+
+
=head1 EXIT STATUS
The exit status is 0 if at least one I<ID> matched I<REGEXP>,
1 if no I<ID> matched I<REGEXP>, and 2 if an error occurred.
+=head1 CAVEATS
+
+The end tag C<< </typog-inspect> >> sometimes gets placed too early in the output and the trace
+I<seems> truncated. However, LaTeX reliably logs the requested the trace information, but the
+write operations for trace data and the code which is used to print the S<end tag> are not
+synchronized.
+
+
=head1 SEE ALSO
-B<grep>(1), B<printf>(3), B<Term::ANSIColor>(pm)
+B<grep>(1), B<printf>(3), B<Encode::Supported>(pm), B<Term::ANSIColor>(pm)
=cut
diff --git a/Master/texmf-dist/source/latex/typog/typog.ins b/Master/texmf-dist/source/latex/typog/typog.ins
index 06378d86bbe..23c8b333664 100644
--- a/Master/texmf-dist/source/latex/typog/typog.ins
+++ b/Master/texmf-dist/source/latex/typog/typog.ins
@@ -1,11 +1,11 @@
%% Copyright (C) 2024 by Ch. L. Spiel
%%
%% This work may be distributed and/or modified under the conditions
-%% of the LaTeX Project Public License, either version 1.3 of this
+%% 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
-%% http://www.latex-project.org/lppl.txt
-%% and version 1.3 or later is part of all distributions of LaTeX
+%% https://www.latex-project.org/lppl.txt
+%% and version 1.3c or later is part of all distributions of LaTeX
%% version 2003/12/01 or later.
@@ -23,11 +23,11 @@ This is a generated file.
Copyright (C) 2024 by Ch. L. Spiel
This work may be distributed and/or modified under the conditions
-of the LaTeX Project Public License, either version 1.3 of this
+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
- http://www.latex-project.org/lppl.txt
-and version 1.3 or later is part of all distributions of LaTeX
+ https://www.latex-project.org/lppl.txt
+and version 1.3c or later is part of all distributions of LaTeX
version 2003/12/01 or later.
This work has the LPPL maintenance status `maintained'.
@@ -37,7 +37,9 @@ The Current Maintainer of this work is Ch. L. Spiel.
This work consists of the files typog.dtx and typog.ins
and the derived files typog.sty, slant-angle.mp,
crooked-paragraphs.mp, smooth-parshapes.mp, title.mp,
-typog-example.tex, typog-nomt.tex, typog-grep.pl,
+typog-example.tex, typog-minimal-test.tex,
+typog-without-microtype-test.tex
+typog-grep.pl.in, typog-grep.pl,
typog-grep.pod, and teximan2latex.sed.
@@ -48,20 +50,22 @@ typog-grep.pod, and teximan2latex.sed.
\generate{\file{typog.sty}{\from{\source}{package}}
\file{typog-example.tex}{\from{\source}{example}}
- \file{typog-nomt.tex}{\from{\source}{nomicrotype}}
- \file{typog.ist}{\from{\source}{index-style}}}
+ \file{typog-minimal-test.tex}{\from{\source}{minimal-test}}
+ \file{typog-without-microtype-test.tex}{\from{\source}{without-microtype}}}
\nopostamble
-\generate{\file{title.mp}{\from{\source}{title}}
+\generate{\file{crooked-paragraphs.mp}{\from{\source}{crookedparagraphs}}
\file{slant-angle.mp}{\from{\source}{slantangle}}
- \file{crooked-paragraphs.mp}{\from{\source}{crookedparagraphs}}
- \file{smooth-parshapes.mp}{\from{\source}{smoothparshapes}}}
+ \file{smooth-parshapes.mp}{\from{\source}{smoothparshapes}}
+ \file{title.mp}{\from{\source}{title}}
+ \file{typog.gst}{\from{\source}{changes-style}}
+ \file{typog.ist}{\from{\source}{index-style}}}
\nopreamble
\generate{\file{teximan2latex.sed}{\from{\source}{teximan2latex}}
- \file{typog-grep.pl}{\from{\source}{typog-grep}}
+ \file{typog-grep.pl.in}{\from{\source}{typog-grep}}
\file{typog-grep.pod}{\from{\source}{typog-grep-documentation}}}
diff --git a/Master/texmf-dist/source/latex/uantwerpendocs/uantwerpendocs.dtx b/Master/texmf-dist/source/latex/uantwerpendocs/uantwerpendocs.dtx
index 141b590a991..6ba894ce8f5 100644
--- a/Master/texmf-dist/source/latex/uantwerpendocs/uantwerpendocs.dtx
+++ b/Master/texmf-dist/source/latex/uantwerpendocs/uantwerpendocs.dtx
@@ -35,11 +35,11 @@
%<le>\ProvidesClass{uantwerpenletter}
%<ex>\ProvidesClass{uantwerpenexam}
%<bmr>\ProvidesPackage{beamerthemeuantwerpen}
-%<cls|ct|bmt|pt|rp|le|ex|bmr> [2024/04/09 v4.6 .dtx skeleton file]
+%<cls|ct|bmt|pt|rp|le|ex|bmr> [2024/08/27 v4.8 .dtx skeleton file]
%<*driver>
\documentclass[a4paper]{ltxdoc}
-\def\fileversion{4.6}
-\def\filedate{2024/04/09}%
+\def\fileversion{4.8}
+\def\filedate{2024/08/27}%
\usepackage{makeidx}
\usepackage{alltt}
\usepackage{longtable}
@@ -127,6 +127,8 @@
% multiple degree programs for exams and course texts, corrected
% disclaimers, replaced 'basic usage' in documentation by heavily
% commented examples}
+% \changes{v4.7}{2024/06/13}{\@ Minor bugfixes on the request of the library}
+% \changes{v4.8}{2024/08/27}{\@ Minor bugfixes on the request of the Antwerp Doctoral School}
%
% \DoNotIndex{\newcommand,\newenvironment,\begin,\bfseries,\draw,\clip,\else,\fi,\if,\fill,\filldraw,\ifthenelse,\ifx,\textwidth,\node,\\,\@empty,\@tempdima,\@tempdimb,\@tempswatrue,\{,\},\ ,\bf,\BODY,\break,\Alph,\and,\define@key,\color,\dx,\dy,\g,\gdef,\hbox,\tiny,\scriptsize,\footnotesize,\small,\normalsize,\large,\Large,\LARGE,\huge,\Huge,\l,\LaTeX,\let,\p@,\relax,\renewcommand,\Requirepackage,\textbf,\textsf,\texttt,\textbackslash,\vspace,\hspace,\hfill,\hskip,\vskip,\hline,\vrule,\typeout,\usebox,\end,\paperheight,\paperwidth,\par,\NewDocumentCommand,\seq}
% \setlength{\parindent}{0em}
@@ -1043,6 +1045,7 @@
\@author
\end{center}
]
+
\kant[11]
\kant[12]
@@ -1208,7 +1211,7 @@
\jurymember{prof. dr. M. Byr}{IMEC, Nederland}
%% specify your degree (manually) and where and when you obtain your degree
-\degree{doctor in de toegepaste ingenieurswetenschappen}
+\degree{doctor in de Toegepaste Ingenieurswetenschappen}
\defenselocation{Antwerpen}
\defensedate{2024}
@@ -1216,8 +1219,8 @@
\titlepageimage{Images/uantwerpen-keyboard.jpg}
%% some data about your manuscript
-\isbn{987-90-57285-34-7} %% don't specify this if you don't want one
-\depot{D/2024/12.293/03} %% idem
+%% \isbn{987-90-57285-34-7} %% only secify one if you have obtained one!
+%% \depot{D/2024/12.293/03} %% idem
\begin{document}
@@ -1362,16 +1365,16 @@
\jurymember{prof. dr. M. Byr}{IMEC, The Netherlands}
%% specify your degree (manually) and where and when you obtain your degree
-\degree{doctor in applied engineering}
-\defenselocation{Antwerpen}
+\degree{doctor in Applied Engineering}
+\defenselocation{Antwerp}
\defensedate{2024}
%% specify a fancy photo for your titlepage (if you don't want a dull one)
\titlepageimage{Images/uantwerpen-keyboard.jpg}
%% some data about your manuscript
-\isbn{987-90-57285-34-7} %% don't specify this if you don't want one
-\depot{D/2024/12.293/03} %% idem
+%% \isbn{987-90-57285-34-7} %% only secify one if you have obtained one!
+%% \depot{D/2024/12.293/03} %% idem
\begin{document}
@@ -2806,8 +2809,8 @@ juryname = Jury
jurymembersname = Members
jurychairname = Chair
bmthesisname = Thesis to obtain the degree of
-pthesisnamei = Thesis submitted in fulfilment of the requirements for the degree of
-pthesisnameii = at the University of Antwerp
+pthesisnamei = Thesis submitted for the degree of
+pthesisnameii = at the University of Antwerp to be defended by
weightname = Weight
%</endata>
% \end{macrocode}
@@ -4654,8 +4657,8 @@ we-nl-ma-wiftw = Master of Science in wiskunde: financiële en toegepaste wiskun
xshift=1pt]
at (3.5cm,\paperheight-6.4cm)
{\sethlcolor{maincolor}%
- \textsf{\textbf{\reversevideo{\@title}}}\\
- \textsf{\reversevideo{\@subtitle}}};
+ \textsf{\textbf{\reversevideo{\@title}}}%
+ \ifx\@subtitle\empty\else\\\textsf{\reversevideo{\@subtitle}}\fi};
\node
[anchor=north west,font=\LARGE,yshift=-1cm,xshift=-1pt]
at (title.south west)
diff --git a/Master/texmf-dist/source/latex/ulthese/ulthese.dtx b/Master/texmf-dist/source/latex/ulthese/ulthese.dtx
index 0d790808812..58da90e888d 100644
--- a/Master/texmf-dist/source/latex/ulthese/ulthese.dtx
+++ b/Master/texmf-dist/source/latex/ulthese/ulthese.dtx
@@ -1,340 +1,490 @@
-% \iffalse meta-comment
+% \iffalse meta-comment -*- mode: doctex -*-
%
-% Copyright (C) 2021 Universite Laval
+% Thesis class for Universite Laval
+%
+% Copyright (C) 2012-2024 Universite Laval
%
% This file 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:
%
-% http://www.latex-project.org/lppl.txt
-%
-% and version 1.3c or later is part of all distributions of LaTeX
-% version 2006/05/20 or later.
-%
-% This work has the LPPL maintenance status `maintained'.
-%
-% The Current Maintainer of this work is Universite Laval
-% <ulthese-dev@bibl.ulaval.ca>.
-%
-% This work consists of the files ulthese.dtx and ulthese.ins
-% and the derived files listed in the README.md file.
+% https://www.latex-project.org/lppl.txt
%
+% The Current Maintainer of this work is Vincent Goulet for
+% Universite Laval <ulthese-dev@bibl.ulaval.ca>.
% \fi
%
% \iffalse
%<*dtx>
\ProvidesFile{ulthese.dtx}
%</dtx>
-%<class>\NeedsTeXFormat{LaTeX2e}[2009/09/24]
+%<class>\NeedsTeXFormat{LaTeX2e}[2021/06/01]
%<class>\ProvidesClass{ulthese}%
%<*class>
- [2021/08/09 v5.3a Universite Laval thesis and memoir class]
+ [2024/07/02 v6.0 Thesis class for Universite Laval]
%</class>
%<*driver>
-\documentclass[11pt,english,french]{ltxdoc}
- \usepackage[utf8]{inputenc}
- \usepackage[T1]{fontenc}
- \usepackage{natbib}
+\documentclass[article,oneside,11pt,x11names,english,french]{memoir}
\usepackage{babel}
\usepackage[autolanguage]{numprint}
- \usepackage{microtype}
- \usepackage[scaled=0.92]{helvet}
- \usepackage[scaled=1.02]{inconsolata}
- \usepackage[sc]{mathpazo}
- \usepackage{fontawesome}
+ \usepackage[round,semicolon,authoryear,sectionbib]{natbib}
\usepackage{metalogo}
- \usepackage{tabularx,booktabs,caption}
+ \usepackage{enumitem}
+ \usepackage{relsize}
+ \usepackage{awesomebox}
+
+ %% Le chargement de doc.sty cause des conflits avec memoir. Il faut:
+ %%
+ %% - annuler la définition de l'environnement 'glossary' de memoir;
+ %% - remettre en place les définitions standards des commandes pour
+ %% le glossaire sur lesquelles se base doc.sty (nécessaire aussi
+ %% pour l'index, mais il n'est pas utilisé).
+ \let\theglossary\relax % avoid conflict with doc.sty
+ \let\endtheglossary\relax % avoid conflict with doc.sty
+ \makeatletter
+ \def\makeglossary{%
+ \newwrite\@glossaryfile
+ \immediate\openout\@glossaryfile=\jobname.glo
+ \def\glossary{\@bsphack\begingroup
+ \@sanitize
+ \@wrglossary}\typeout
+ {Writing glossary file \jobname.glo }%
+ \let\makeglossary\@empty
+ }
+ \@onlypreamble\makeglossary
+ \def\@wrglossary#1{%
+ \protected@write\@glossaryfile{}%
+ {\string\glossaryentry{#1}{\thepage}}%
+ \endgroup
+ \@esphack}
+ \def\glossary{\@bsphack\begingroup\@sanitize\@index}
+ \@twosidefalse\@mparswitchfalse % turn off twoside option
+ \makeatother
+ \usepackage{doc}
+ \def\changes#1#2#3{\glossary{#1>#3}} % simplification
\DisableCrossrefs
\CodelineNumbered
\RecordChanges
- \GlossaryPrologue{\section*{Historique des versions}%
- \addcontentsline{toc}{section}{Historique des versions}}
+ %\OnlyDescription
+ \DontCheckModules
+
+ %% Polices de caractères
+ \iftutex
+ \usepackage[babel=true]{microtype}
+ \usepackage{fontspec}
+ \usepackage{unicode-math}
+ \setmainfont{STIXTwoText}
+ [
+ Extension = .otf,
+ UprightFont = *-Regular,
+ BoldFont = *-SemiBold,
+ ItalicFont = *-Italic,
+ BoldItalicFont = *-SemiBoldItalic,
+ Numbers = {Proportional,OldStyle},
+ Scale = 1,
+ Ligatures = TeX
+ ]
+ \setsecheadstyle{\normalfont\Large\sffamily\bfseries\raggedright}
+ \setsubsecheadstyle{\normalfont\large\sffamily\bfseries\raggedright}
+ \setsubsubsecheadstyle{\normalfont\sffamily\bfseries\raggedright}
+ \else
+ \usepackage[babel=true]{microtype}
+ \usepackage[utf8]{inputenc}
+ \usepackage[T1]{fontenc}
+ \usepackage[stix2]{newtxmath}
+ \fi
+ \usepackage[book,medium,proportional,oldstyle,scale=0.92]{FiraSans}
+ \usepackage[medium,lining,scale=0.90]{FiraMono}
%% Couleurs
\usepackage{xcolor}
- \definecolor{link}{rgb}{0,0.4,0.6} % ~RoyalBlue de dvips
- \definecolor{url}{rgb}{0.6,0,0} % rouge foncé
- \definecolor{citation}{rgb}{0,0.5,0} % vert foncé
-
- %% Liste description alignée à gauche
- \usepackage{enumitem}
- \setlist[description]{leftmargin=*,align=left}
-
- %% Environnement pour remarques
- \usepackage{amsthm}
- \theoremstyle{definition}
- \newtheorem*{rem}{Remarque}
+ \definecolor{link}{rgb}{0,0.4,0.6} % liens internes
+ \definecolor{url}{rgb}{0.6,0,0} % liens externes
+ \definecolor{citation}{rgb}{0,0.5,0} % citations
%% Hyperliens
- \usepackage{hyperref}
- \hypersetup{%
- pdfauthor = {Faculté des études supérieures et postdoctorales},
- pdftitle = {Guide de l'utilisateur de la classe ulthese},
- colorlinks = {true},
- linktocpage = {true},
- urlcolor = {url},
- linkcolor = {link},
- citecolor = {citation},
- pdfpagemode = {UseOutlines},
- pdfstartview = {Fit},
- bookmarksopen = {true},
- bookmarksnumbered = {true},
- bookmarksdepth = {subsubsection}}
- \addto\extrasfrench{%
- \def\appendixautorefname{annexe}%
- \def\tableautorefname{tableau}%
- \def\subsectionautorefname{section}%
+ \AtEndPreamble{%
+ \usepackage{bookmark} % charge hyperref
+ \hypersetup{%
+ pdftitle = {Guide d'utilisation de la classe ulthese},
+ pdfauthor = {Faculté des études supérieures et postdoctorales},
+ colorlinks = {true},
+ urlcolor = {url},
+ linkcolor = {link},
+ citecolor = {citation}}
+ \bookmarksetup{%
+ open = true,
+ depth = 3,
+ numbered = true}
+ \addto\extrasfrench{%
+ \def\subsectionautorefname{section}%
+ }
}
%% Paramétrage de babel
- \frenchbsetup{%
- StandardItemizeEnv=true, % listes standards
+ \frenchsetup{%
+ SmallCapsFigTabCaptions=false, % pas de petites capitales
ThinSpaceInFrenchNumbers=true, % espace fine dans les nombres
og=«, fg=» % « et » sont les guillemets
}
- \def\frenchtablename{{\scshape Tab.}}
+ \renewcommand*\frenchtablename{Tab.}
+ \renewcommand*\frenchfigurename{Fig.}
+ \renewcommand*\generalname{Général} % mot clé du glossaire
+
+ %% Désactiver le niveau des chapitres de memoir
+ \let\chapter\relax
+ \counterwithout{section}{chapter}
+
+ %% Utiliser une numérotation des sections à trois niveaux
+ \setsecnumdepth{subsubsection}
+ \maxsecnumdepth{subsubsection}
+
+ % Les annexes sont des sections, ici. Redéfinir la
+ % commande \appendix comme dans la classe article.
+ \makeatletter
+ \renewcommand*\appendix{\par
+ \setcounter{section}{0}
+ \gdef\thesection{\@Alph\c@section}}
+ \makeatother
+
+ %% Aligner à gauche l'environnement description
+ \setlist[description]{leftmargin=*,align=left}
+
+ %% Configurer le glossaire
+ \addto\extrasfrench{%
+ \def\glossaryname{Historique des versions}}
+ \GlossaryPrologue{\section*{\glossaryname}%
+ \addcontentsline{toc}{section}{\glossaryname}}
+ \setcounter{GlossaryColumns}{2}
+ \setlength{\GlossaryMin}{5cm}
- %% Commandes de mise en forme spéciales
- \newcommand{\class}[1]{\textsf{#1}}
- \newcommand{\pkg}[1]{\textbf{#1}}
+ %% Nouvel environnement de type \DescribeMacro pour les options de
+ %% la classe
+ \NewDocElement[envlike,notoplevel,printtype=\emph{option}]{Option}{option}
- %% Commandes pour les liens vers la documentation
- \newcommand{\link}[2]{\href{#1}{#2~\raisebox{-0.2ex}{\faExternalLink}}}
- \newcommand{\doc}[2][documentation]{\link{#2}{#1}}
+ %% Commandes sémantiques additionnelles
+ \let\class\textsf
+ \let\pkg\textbf
+ \makeatletter
+ \renewcommand\code{\bgroup\@makeother\_\@makeother\~\@makeother\$\code@}
+ \def\code@#1{{\normalfont\ttfamily\hyphenchar\font=-1 #1}\egroup}
+ \makeatother
+ \newcommand*\ulthesename{ulthese}
+ \newcommand*\ulclass{\class{\ulthesename}}
+ \newcommand*\btx{\textsc{Bib}\TeX}
- %% Francisation d'un mot clé de l'historique des commandes
- \def\generalname{Général}
+ %% Redéfinir \year pour utiliser l'information de \filedate plutôt
+ %% que la date de compilation
+ \def\parsedate#1/#2/#3\relax{\def\year{#1}}
+
+ %% Convertir la date en format ISO
+ \def\isodate#1/#2/#3\relax{#1-#2-#3}
+
+ \MakeShortVerb{\|}
\begin{document}
\DocInput{ulthese.dtx}
\end{document}
%</driver>
% \fi
-% \CheckSum{914}
% \DoNotIndex{\',\^,\`,\ ,\ae}
% \DoNotIndex{\RequirePackage,\ExecuteOptions,\ProcessOptions}
% \DoNotIndex{\newcommand,\newcommand*}
% \DoNotIndex{\setlength}
+% \changes{6.0}{2024-05-22}{Prise en compte des règles de présentation
+% entrées en vigueur à l'automne 2023 qui n'exigent plus une
+% bibliographie par chapitre pour les thèses et mémoire par
+% intégration d'articles.}
+% \changes{6.0}{2024-05-22}{Suppression des options
+% \texttt{bibchapitre} et \texttt{bibsection}.}
+% \changes{6.0}{2024-07-02}{Ajout du grade de maître en travail
+% social.}
+% \changes{6.0}{2024-07-02}{Retrait du grade de maître en
+% physiothérapie.}
+% \changes{6.0}{2024-05-24}{Utilisation du codage de caractères UTF-8
+% par défaut dans la classe. Modification des gabarits en
+% conséquence.}
+% \changes{6.0}{2024-06-17}{Révision exhaustive de la documentation.}
% \changes{4.4}{2017-05-16}{Prise en charge des bibliographies
-% multiples pour les thèses et mémoires par articles.}
+% multiples pour les thèses et mémoires par articles.}
+% \changes{4.4}{2017-05-15}{Ajout de l'option \texttt{bibchapitre}.}
+% \changes{4.4}{2017-05-15}{Ajout de l'option \texttt{bibsection}.}
% \changes{4.4}{2017-05-16}{Documentation révisée, principalement ce
-% qui touche à la préparation de la bibliographie.}
+% qui touche à la préparation de la bibliographie.}
% \changes{4.3}{2017-03-01}{Nouvelles options pour les titres de
-% docteur en musique, maître en architecture, maître en
-% ergothérapie, maître en physiothérapie et maître en
-% psychoéducation.}
-% \changes{4.3}{2017-03-01}{Modifications à la composition des sigles de
-% grades.}
+% docteur en musique, maître en architecture, maître en ergothérapie,
+% maître en physiothérapie et maître en psychoéducation.}
+% \changes{4.3}{2017-03-01}{Modifications à la composition des sigles
+% de grades.}
% \changes{4.3}{2017-03-01}{Vérification de la compatibilité entre le
-% grade et les options multifacultaire, cotutelle, bidiplomation et
-% extension.}
+% grade et les options \texttt{multifacultaire}, \texttt{cotutelle},
+% \texttt{bidiplomation} et \texttt{extension}.}
% \changes{4.3}{2017-03-01}{Améliorations à la documentation.}
-% \changes{4.2}{2016-03-29}{Ajout de l'option «examen».}
+% \changes{4.2}{2016-03-29}{Ajout de l'option \texttt{examen}.}
% \changes{4.1}{2016-02-13}{Paquetage geometry déclaré incompatible
-% avec la classe.}
-% \changes{4.0}{2015-06-12}{Nouvelles règles de présentation matérielle
-% de la FESP: recto seulement, page frontispice.}
-% \changes{3.1}{2014-05-23}{Prise en charge de la maîtrise en bidiplomation.}
+% avec la classe.}
+% \changes{4.0}{2015-06-12}{Nouvelles règles de présentation
+% matérielle de la FESP: recto seulement, page frontispice.}
+% \changes{3.1}{2014-05-23}{Prise en charge de la maîtrise en
+% bidiplomation.}
% \changes{3.0a}{2014-03-24}{Modifications et corrections à la
-% documentation, notamment relativement à la configuration de natbib.}
+% documentation, notamment relativement à la configuration de
+% \textbf{natbib}.}
% \changes{3.0}{2014-01-06}{Déclaration du grade en option de la
-% classe.}
-% \changes{3.0}{2014-01-06}{Moteur XeLaTeX supporté.}
-% \changes{3.0}{2014-01-06}{Ajout de l'option nobabel.}
+% classe.}
+% \changes{3.0}{2014-01-06}{Moteur {\XeLaTeX} supporté.}
+% \changes{3.0}{2014-01-06}{Ajout de l'option \texttt{nobabel}.}
% \changes{2.1}{2013-01-16}{Utilisation transparente de la police
-% Helvetica pour la page de titre.}
+% Helvetica pour la page de titre.}
% \changes{2.0}{2013-01-13}{Traitement automatique des longs titres.}
% \changes{1.0b}{2012-11-11}{Ajouts et corrections mineures dans la
-% documentation.}
+% documentation.}
% \changes{1.0a}{2012-10-17}{Précisions dans la documentation.}
% \changes{1.0}{2012-09-30}{Version initiale.}
% \GetFileInfo{ulthese.dtx}
-% \title{\class{ulthese}: la classe pour les thèses et mémoires de
-% l'Université Laval\thanks{Ce document décrit la classe
-% \class{ulthese}~\fileversion, datée du \filedate.}}
+%
+% \title{Guide d'utilisation de la classe {\ulclass} \\ pour les thèses et
+% mémoires \\ de l'Université Laval}
% \author{Faculté des études supérieures et postdoctorales\thanks{%
% Cette classe et sa documentation ont été rédigées par Vincent
% Goulet~(Faculté des sciences et de génie) avec la collaboration de
% Koassi D'Almeida~(Faculté des études supérieures et postdoctorales) et
-% de Pierre Lasou~(Bibliothèque).}}
-% \date{}
+% Pierre Lasou~(Bibliothèque).}}
+% \date{Version {\fileversion} du {\expandafter\isodate\filedate\relax}}
% \maketitle
%
% \section{Introduction}
%
-% La classe \class{ulthese} permet de composer avec {\LaTeX} ou
-% {\XeLaTeX} des thèses et mémoires immédiatement conformes aux règles
-% générales de présentation matérielle de la Faculté des études
-% supérieures et postdoctorales (FESP) de l'Université Laval. Ces
-% règles définissent principalement la présentation des pages de titre
-% des thèses et mémoires ainsi que la disposition du texte sur la
-% page. La classe en elle-même est donc relativement simple.
-%
-% Cependant, \class{ulthese} est basée sur la classe \class{memoir}
-% \citep{memoir}, une extension de la classe standard \class{book}
-% facilitant à plusieurs égards la préparation de documents d'allure
-% professionnelle dans {\LaTeX}. La classe \class{memoir} incorpore
-% d'office plus de 30 des paquetages les plus populaires\footnote{%
-% Consulter la section~18.24 de la documentation de \class{memoir}
-% pour la liste ou encore le journal de la compilation (\emph{log})
-% d'un document utilisant la classe \class{ulthese}.}. %
-% L'intégralité des fonctionnalités de \class{memoir} se retrouve donc
-% dans \class{ulthese}.
-%
-% La classe \class{memoir} fait partie des distributions {\LaTeX}
-% modernes; elle devrait donc être installée et disponible sur votre
-% système. Elle est livrée avec une %
-% \doc{http://texdoc.net/pkg/memoir} %
-% exhaustive: le guide de l'utilisateur fait près de 600~pages!
-% N'hésitez pas à vous y référer pour réaliser une mise en page
-% particulière.
-%
-% L'autre compagnon naturel de la présente documentation est
-% \doc[Rédaction avec {\LaTeX}]{http://texdoc.net/pkg/formation-latex-ul} ^^A
-% \citep{formation-latex-ul}, la formation {\LaTeX} de l'Université Laval.
-% Vous y trouverez des informations additionnelles sur l'utilisation des
-% classes \class{ulthese} et \class{memoir}.
+% La classe {\ulclass} permet de composer des thèses et mémoires
+% immédiatement conformes aux règles générales et complémentaires de
+% présentation de la Faculté des études supérieures et postdoctorales
+% (FESP) de l'Université Laval. Ces règles définissent principalement
+% la présentation des pages de titre des thèses et mémoires, ainsi que
+% la disposition du texte sur la page.
+%
+% La composition d'un manuscript avec la classe {\ulclass} requiert une
+% distribution {\TeX} récente et à jour. Nous recommandons les
+% distributions %
+% \href{https://tug.org/texlive}{{\TeX}~Live}~---%
+% ou sa variante pour macOS %
+% \href{https://tug.org/mactex}{Mac{\TeX}}~--- %
+% et %
+% \href{https://miktex.org}{MiK{\TeX}}. %
+% Vous pouvez également avoir recours à une plateforme de rédaction en
+% ligne comme %
+% \href{https://overleaf.com}{Overleaf}; %
+% leurs distributions {\TeX} satisfont généralement les conditions
+% ci-dessus.
+%
+% La classe {\ulclass} fait partie des distributions {\TeX} standards via
+% le paquetage %
+% \href{https://ctan.org/pkg/ulthese}{\pkg{ulthese}}. %
+% Dans la mesure où votre distribution est
+% à jour, vous devriez pouvoir l'utiliser sans autre intervention.
+%
+% Le compagnon naturel de la présente documentation est \emph{Rédaction
+% avec {\LaTeX}}, la formation {\LaTeX} de l'Université Laval. Vous y
+% trouverez sans doute une foule d'informations utiles pour la
+% préparation de votre thèse ou de votre mémoire. L'ouvrage fait
+% lui aussi partie des distributions {\TeX} standards, via le
+% paquetage %
+% \href{https://ctan.org/pkg/formation-latex-ul}{\pkg{formation-latex-ul}}. %
%
% \section{Démarrage rapide (pour les impatients)}
% \label{sec:utilisation:rapide}
%
-% La classe est livrée avec les distributions {\TeX}~Live, Mac{\TeX} et
-% MiK{\TeX}. Si vous utilisez l'une ou l'autre de ces distributions et
-% qu'elle est à jour\footnote{%
-% Validez à l'aide de l'assistant de mise à jour de votre
-% distribution.}, %
-% vous devriez pouvoir utiliser \class{ulthese} sans autre
-% intervention.
-%
-% Il est recommandé de segmenter tout document d'une certaine ampleur
-% dans des fichiers |.tex| distincts pour chaque partie ---
-% habituellement un fichier par chapitre. Le document complet est alors
-% composé à l'aide d'un fichier maître qui contient le préambule
-% {\LaTeX} et un ensemble de commandes \cmd{\include} pour réunir les
-% parties dans un tout.
+% La classe {\ulclass} est livrée avec un ensemble de gabarits sur
+% lesquels se baser pour le document maître de divers types de thèses
+% et de mémoires (standard, par articles, en cotutelle, en
+% bidiplomation), ainsi que pour les parties les plus usuelles
+% (résumés français et anglais, remerciements, avant-propos,
+% introduction, chapitres, conclusion, annexe). Les noms des fichiers
+% devraient permettre de facilement identifier leur contenu. Dans la
+% distribution {\TeX}~Live, les gabarits sont classés avec la
+% documentation.
%
-% La classe \class{ulthese} est livrée avec un ensemble de gabarits sur
-% lesquels se baser pour:
-% \begin{itemize}
-% \item le document maître de divers types de thèses et de mémoires
-% (standard, par articles, en cotutelle, en bidiplomation);
-% \item les fichiers des parties les plus usuelles (résumés français
-% et anglais, avant-propos, introduction, chapitres, conclusion,
-% etc.).
-% \end{itemize}
-% Les noms des fichiers devraient permettre de facilement identifier
-% leur contenu (c'est là une bonne pratique: le nom |rappels.tex|
-% parle de lui-même et résiste mieux aux changements à l'ordre des
-% chapitres que |chapitre1.tex|).
+% Pour débuter rapidement la rédaction de votre manuscrit, copiez les
+% gabarits appropriés dans votre dossier de travail et suivez les
+% directives qui s'y trouvent. Nous recommandons de compiler votre
+% manuscript avec {\XeLaTeX}.
%
-% Dans {\TeX}~Live, les gabarits sont classés avec la documentation de
-% la classe. Pour les utiliser, copiez les fichiers appropriés dans votre
-% dossier de travail.
+% La classe utilise le codage de caractères
+% \href{https://fr.wikipedia.org/wiki/UTF-8}{UTF-8}. Vous devez donc
+% obligatoirement utiliser ce type codage quand un fichier contient
+% des caractères non-ASCII (comme des lettres accentuées).
%
-% Pour débuter la rédaction, renommez le gabarit de document maître
-% approprié d'après votre numéro de dossier. Par exemple, l'étudiante
-% dont le numéro de dossier est 111555555 et qui entame la rédaction
-% d'une thèse par articles renommera le fichier
-% \begin{quote}
-% |gabarit-doctorat-articles.tex|
-% \end{quote}
-% en
-% \begin{quote}
-% |111555555.tex|.
-% \end{quote}
+% Le reste de ce guide contient les informations détaillées sur les
+% caractéristiques et fonctionnalités de la classe.
%
-% Les gabarits comportent des commentaires succincts pour vous guider
-% dans la préparation de votre document. La \autoref{sec:gabarits}
-% fournit les informations détaillées.
+% \changes{5.3a}{2021-08-09}{Ajout à la documentation de la
+% disponibilité d'une archive pour les personnes qui ne disposent pas
+% d'une installation de {\TeX} locale.}
+% \tipbox{Si vous n'avez pas accès aux gabarits parce qu'ils ne sont
+% pas inclus dans votre distribution ou parce que vous utilisez une
+% plateforme de rédaction en ligne, poursuivez votre lecture à la
+% \autoref{sec:installation}.}
%
% \section{Installation}
+% \label{sec:installation}
%
-% Cette section explique comment installer la classe \class{ulthese}
+% Cette section explique comment installer la classe {\ulclass}
% si elle n'est pas disponible sur votre système ou si la version
% n'est pas à jour.
%
-% La classe est distribuée sous forme d'une archive |ulthese.zip| via
-% le réseau de sites \emph{Comprehensive {\TeX} Archive Network} (CTAN):
+% La classe {\ulclass} est distribuée dans le paquetage %
+% \href{https://ctan.org/pkg/ulthese}{\pkg{ulthese}} %
+% via le réseau de sites \emph{Comprehensive {\TeX} Archive Network}
+% (CTAN). Celui-ci fait partie des distributions {\TeX} standards telles
+% que {TeX}~Live, Mac{\TeX} et MiK{\TeX}. Nous recommandons fortement
+% d'installer ou de mettre à jour \pkg{ulthese} à l'aide du
+% gestionnaire de paquetages de votre distribution {\TeX}. Par
+% exemple, avec {\TeX}~Live, vous pouvez effectuer ces opérations dans
+% l'assistant graphique, ou encore avec l'une ou l'autre des commandes
+% ci-dessous:
% \begin{quote}
-% \url{https://www.ctan.org/pkg/ulthese}
+% \code{tlmgr install ulthese}
+% \end{quote}
+% ou
+% \begin{quote}
+% \code{tlmgr update ulthese}
% \end{quote}
%
-% L'installation de la classe consiste à créer le fichier
-% |ulthese.cls| et les gabarits |.tex| à partir du code source
-% documenté se trouvant dans le fichier |ulthese.dtx|. Il est
-% recommandé de simplement créer ces fichiers dans le dossier de
-% travail de la thèse ou du mémoire.
-%
-% Pour procéder à l'installation, décompressez l'archive |ulthese.zip|
-% dans votre dossier de travail, puis compilez avec {\LaTeX} le fichier
-% |ulthese.ins| en exécutant la commande suivante depuis une invite
-% de commande:
+% S'il vous est impossible d'installer des paquetages ou de mettre à
+% jour la distribution {\TeX}~--- notamment si vous utilisez une
+% plateforme de rédaction en ligne~--- vous pouvez procéder à une
+% installation simplifiée de la classe dont la portée sera limitée à
+% votre projet. Pour ce faire, téléchargez l'archive %
% \begin{quote}
-% |latex ulthese.ins|
+% \code{ulthese-installation-projet.zip}
% \end{quote}
-% Vous pouvez aussi ouvrir le fichier |ulthese.ins| dans votre éditeur
-% de texte favori et lancer depuis celui-ci la compilation avec
-% {\LaTeX}, pdf{\LaTeX}, {\XeLaTeX} ou un autre moteur {\TeX}.
+% depuis le
+% \href{https://gitlab.com/vigou3/ulthese/-/releases}{dépôt du projet ulthese}
+% et décompressez celle-ci dans le répertoire de votre document. Vous
+% disposerez alors de tous les fichiers essentiels de la classe à
+% l'intérieur de ce projet.
%
-% \changes{5.3a}{2021-08-09}{Ajout à la documentation de la
-% disponibilité d'une archive pour les personnes qui ne disposent
-% pas d'une installation de {\TeX} locale.}
-% \begin{rem}
-% Si vous ne disposez pas d'une version de {\TeX} sur votre poste de
-% travail --- vraisemblablement parce que vous utilisez une
-% plateforme de rédaction en ligne --- téléchargez
-% l'archive |ulthese-sans-tex-local.zip| depuis le
-% \link{https://gitlab.com/vigou3/ulthese/-/releases}{dépôt du
-% projet}. Celle-ci contient tous les fichiers
-% normalement créés lors de l'installation de la classe.
-% \end{rem}
+% Si votre expertise {\TeX} vous pousse à préférer une installation
+% manuelle avec accès à l'intégralité du code source de la classe,
+% consultez les instructions qui se trouvent dans le fichier
+% \code{README.md} du paquetage.
%
% \section{Utilisation}
+% \label{sec:utilisation}
+%
+% La classe {\ulclass} est basée sur la classe %
+% \href{https://ctan.org/pkg/memoir}{\class{memoir}}, %
+% une extension de la classe standard \class{book} facilitant à
+% plusieurs égards la préparation de documents d'allure
+% professionnelle dans {\LaTeX}. L'intégralité des fonctionnalités de
+% \class{memoir} se retrouve donc dans {\ulclass}.
+%
+% La classe \class{memoir} fait partie des distributions {\TeX}
+% récentes; elle devrait donc être installée et disponible sur votre
+% système. La classe est livrée avec une documentation exhaustive: le
+% guide de l'utilisateur fait près de 600~pages! N'hésitez pas à vous
+% y référer pour réaliser une mise en page particulière.
+%
+% La classe {\ulclass} est compatible avec le moteur pdf{\LaTeX}.
+% Cependant, pour faciliter la gestion du codage des fichiers et des
+% polices de caractères, nous recommandons de compiler votre
+% manuscript avec le plus moderne moteur {\XeLaTeX}.
+%
+% \subsection{Gabarits}
+% \label{sec:utilisation:gabarits}
+%
+% La classe est livrée avec un ensemble de gabarits sur lesquels vous
+% baser pour:
+% \begin{itemize}
+% \item le document maître de divers types de thèses et de mémoires
+% (standard, par articles, en cotutelle, en bidiplomation);
+% \item les fichiers des parties les plus usuelles (résumés français
+% et anglais, remerciements, avant-propos, introduction, chapitres,
+% conclusion, annexe).
+% \end{itemize}
+% Vous pourriez devoir combiner les caractéristiques de deux gabarits
+% de document maître, par exemple pour une thèse en cotutelle par
+% articles.
+%
+% Les gabarits vous incitent à adopter le mode d'organisation des
+% fichiers de tout document d'une certaine ampleur, soit: un fichier
+% |.tex| par partie; un fichier maître contenant le préambule {\LaTeX}
+% et un ensemble de commandes \cmdprint{\include} pour réunir les
+% parties dans un tout.
+%
+% Si vous utilisez la version de la classe fournie avec votre
+% distribution {\TeX}, les gabarits peuvent être classés avec la
+% documentation (c'est le cas dans {\TeX}~Live). Si vous avez plutôt
+% effectué une installation locale de la classe, ou si vous l'avez
+% installée manuellement, les gabarits se trouvent dans votre
+% dossier de travail.
%
-% La classe est compatible avec les moteurs {\LaTeX} traditionnels
-% ainsi qu'avec le plus récent moteur {\XeLaTeX}.
+% Nous recommandons fortement de rédiger votre manuscript à partir des
+% gabarits. Il peut aussi s'avérer utile de suivre un gabarit en lisant
+% la présente section.
+%
+% \tipbox{Il n'y a pas de gabarit spécifique pour un examen de
+% doctorat, pour un essai de maîtrise, pour un projet de recherche ou
+% pour un rapport de stage. Utilisez un gabarit de thèse ou de
+% maîtrise avec l'une ou l'autre des options |examen|, |essai|,
+% |projet| ou |stage|.}
+%
+% \changes{6.0}{2024-05-24}{Documentation: nouvelle section sur le
+% codage de caractères du code source.}
+% \subsection{Codage de caractères du code source}
+% \label{sec:utilisation:codage}
+%
+% La classe utilise le codage de caractères
+% \href{https://fr.wikipedia.org/wiki/UTF-8}{UTF-8}
+% tant avec pdf{\LaTeX} qu'avec {\XeLaTeX}. Les fichiers
+% contenant du texte avec des accents ou tout autre symbole non-ASCII
+% doivent donc obligatoirement être enregistrés dans ce codage de
+% caractères\footnote{%
+% L'UTF-8 n'étant pas le codage par défaut sous Windows, portez une
+% attention toute particulière à ce point si vous utilisez ce système
+% d'exploitation.}.
+%
+% \subsection{Déclaration de la classe et options}
+% \label{sec:utilisation:options}
%
% On charge la classe avec la commande
% \begin{quote}
-% |\documentclass|\oarg{options}|{ulthese}|
+% |\documentclass|\oarg{options}|{ulthese}|
% \end{quote}
% Les marges, l'interligne et la numérotation des pages sont adaptées
-% aux règles de présentation matérielle de la FESP. Les sections
-% suivantes décrivent les options et les commandes définies par la
-% classe.
+% aux règles de présentation de la FESP. La classe ne crée pas de page
+% de titre par défaut\footnote{%
+% Depuis la version 5.0 de la classe.}, %
+% sa production étant prise en charge par la FESP pour les thèses et
+% les mémoires. Si vous utilisez la classe pour un document qui
+% nécessite une page de titre, un examen de doctorat, un essai de
+% maitre
%
% \changes{5.0}{2018-04-24}{La classe ne crée plus de page de titre
-% suite à une nouvelle directive de la FESP.}
-% \begin{rem}
-% Depuis la version 5.0, la classe ne crée plus de page de titre
-% par défaut, sa production étant désormais prise en charge par la
-% FESP. Néanmoins, les fonctionnalités de composition d'une page
-% de titre demeurent disponibles dans la classe. Les commandes
-% pertinentes sont regroupées à l'\autoref{sec:pagetitre}.
-% \end{rem}
-%
-% \subsection{Options de la classe}
-% \label{sec:utilisation:options}
+% suite à une nouvelle directive de la FESP.}
+% \tipbox{Les fonctionnalités de composition d'une page de titre
+% demeurent disponibles dans la classe. Si votre document en nécessite
+% une, consultez l'\autoref{sec:pagetitre}.}
%
% Cette section passe en revue les \meta{options} que l'on peut
% spécifier au chargement de la classe. Les commandes mentionnées
% ci-dessous font quant à elles l'objet de la
% \autoref{sec:utilisation:commandes}.
%
-% \begin{DescribeMacro}{PhD,MSc,MA, ...}
-% Identifie le type de grade; consulter le \autoref{tab:grades} pour
-% la liste complète des options et les grades correspondants. La
-% déclaration d'un type de grade est obligatoire, sauf en cas de
-% l'utilisation de l'option |projet| (voir ci-dessous).
-% \end{DescribeMacro}
+% \begin{DescribeOption}{PhD,MSc,MA, ...}
+% Les options telles que |PhD|, |MSc| ou |MA| identifient le type de
+% grade; le \autoref{tab:grades} fournit la liste complète des
+% options et les grades correspondants. La déclaration d'un type de
+% grade est obligatoire, sauf en cas de l'utilisation de l'option
+% |projet| (voir ci-dessous).
+% \end{DescribeOption}
%
% \begin{table}[t]
% \centering
% \caption{Options de la classe pour la déclaration du grade et libellés
% correspondants}
% \label{tab:grades}
-% \begin{tabularx}{0.85\linewidth}{lX}
+% \begin{tabularx}{0.9\linewidth}{l>{\raggedright\arraybackslash}X}
% \toprule
% Option & Nom du grade (sigle) \\
% \midrule
@@ -355,145 +505,138 @@
% |MArch|
% & Maître en architecture
% (M.~Arch.) \\
-% |MA|
-% & Maître ès arts (M.A.) \\
% |LLM|
% & Maître en droit (LL.~M.) \\
% |MErg|
% & Maître en ergothérapie (M.~Erg.) \\
% |MMus|
% & Maître en musique (M.~Mus.) \\
-% |MPht|
-% & Maître en physiothérapie (M.~Pht.) \\
-% |MSc|
-% & Maître ès sciences (M.~Sc.) \\
+% |MPsEd|
+% & Maître en psychoéducation (M.~Ps.~éd.) \\
% |MScGeogr|
% & Maître en sciences géographiques (M.~Sc.~géogr.) \\
% |MServSoc|
% & Maître en service social (M.~Serv.~soc.) \\
-% |MPsEd|
-% & Maître en psychoéducation (M.~Ps.~éd.) \\
+% |MTravSoc|
+% & Maître en travail social (M.~Trav.~soc.) \\
+% |MA|
+% & Maître ès arts (M.A.) \\
+% |MSc|
+% & Maître ès sciences (M.~Sc.) \\
% \bottomrule
% \end{tabularx}
% \end{table}
%
-% \begin{DescribeMacro}{cotutelle}
-% Identifie une thèse effectuée en cotutelle avec une autre
-% université. Valide uniquement avec un grade de doctorat.
-% \end{DescribeMacro}
-%
-% \begin{DescribeMacro}{bidiplomation}
-% Identifie un mémoire effectué en bidiplomation avec une autre
-% université. Valide uniquement avec un grade de maîtrise.
-% \end{DescribeMacro}
-%
-% \begin{DescribeMacro}{examen}
-% Identifie un examen de doctorat. Cette option permet d'utiliser la
-% classe pour la rédaction d'un examen de doctorat respectant les
-% règles de présentation matérielle de la FESP. Elle a pour effet de
-% changer l'appellation «Thèse» sur la page de titre pour «Examen
-% de doctorat». Elle supprime également la page frontispice.
+% \begin{DescribeOption}{cotutelle}
+% L'option |cotutelle| identifie une thèse effectuée en cotutelle
+% avec une autre université. Valide uniquement avec un grade de
+% doctorat.
+% \end{DescribeOption}
+%
+% \begin{DescribeOption}{bidiplomation}
+% L'option |bidiplomation| identifie un mémoire effectué en
+% bidiplomation avec une autre université. Valide uniquement avec un
+% grade de maîtrise.
+% \end{DescribeOption}
+%
+% \begin{DescribeOption}{examen}
+% L'option |examen| identifie un examen de doctorat. Elle permet
+% d'utiliser la classe pour la rédaction d'un examen de doctorat
+% respectant les règles de présentation de la FESP. L'option a pour
+% effet de changer l'appellation «Thèse» sur la page de titre pour
+% «Examen de doctorat». Elle supprime également la page frontispice.
% L'option n'est compatible qu'avec l'une des options de grade de
% doctorat.
-% \end{DescribeMacro}
-%
-% \changes{5.0}{2018-05-09}{Ajout d'une option «essai» pour les
-% maîtrises analogue à «examen» pour les doctorats.}
-% \changes{5.2}{2019-05-06}{L'option «essai» n'empêche plus
-% l'utilisation d'une page frontispice.}
-% \begin{DescribeMacro}{essai}
-% Identifie un essai de maîtrise. Cette option permet d'utiliser la
-% classe pour la rédaction d'un essai de maîtrise respectant les
-% règles de présentation matérielle de la FESP. Elle a pour effet de
-% changer l'appellation «Maîtrise» sur la page de titre pour
-% «Essai». L'option n'est compatible qu'avec l'une des options de
+% \end{DescribeOption}
+%
+% \changes{5.0}{2018-05-09}{Ajout d'une option \texttt{essai} pour les
+% maîtrises analogue à \texttt{examen} pour les doctorats.}
+% \changes{5.2}{2019-05-06}{L'option \texttt{essai} n'empêche plus
+% l'utilisation d'une page frontispice.}
+% \begin{DescribeOption}{essai}
+% L'option |essai| identifie un essai de maîtrise. Elle permet
+% d'utiliser la classe pour la rédaction d'un essai de maîtrise
+% respectant les règles de présentation de la FESP. L'option a pour
+% effet de changer l'appellation «Maîtrise» sur la page de titre
+% pour «Essai». Elle n'est compatible qu'avec l'une des options de
% grade de maîtrise. Pour un essai de maîtrise, l'utilisation
% simultanée de l'option |article| de la classe \class{memoir} peut
% s'avérer tout indiquée.
-% \end{DescribeMacro}
-%
-% \changes{5.2}{2019-05-06}{Ajout d'une option «projet» pour les
-% cours de projet de recherche.}
-% \begin{DescribeMacro}{projet}
-% Identifie un projet de recherche. Cette option permet d'utiliser
-% la classe pour la rédaction d'un rapport de projet de recherche
-% respectant les règles de présentation matérielle de la FESP. Elle
-% a pour effet d'inscrire l'appellation «Projet de recherche» sur la
-% page de titre et de supprimer la mention du grade. L'utilisation
-% de cette option rend d'ailleurs non obligatoire la déclaration de
-% grade qui, si elle est présente, est simplement ignorée. Comme
-% pour un essai de maîtrise, l'utilisation simultanée de l'option
-% |article| de la classe \class{memoir} peut s'avérer tout indiquée
-% avec les cette option.
-% \end{DescribeMacro}
-%
-% \changes{5.3}{2019-11-29}{Ajout d'une option «stage» pour les
-% rapports de stage.}
-% \begin{DescribeMacro}{stage}
-% Identifie un rapport de stage. L'effet de cette option est
-% identique à celui de l'option |projet| à deux exceptions près:
-% l'inscription sur la page de titre est «Rapport de stage» et la
-% page frontispice est supprimée.
-% \end{DescribeMacro}
-%
-% \begin{DescribeMacro}{10pt,11pt,12pt}
-% Sélectionne une taille de police de 10, 11 ou 12~points. Par
-% défaut la classe utilise une police de 11~points. Ces options
-% n'ont aucun effet sur la taille des polices des pages de titre.
-% \end{DescribeMacro}
-%
-% \changes{4.4}{2017-05-15}{Ajout de l'option bibchapitre.}
-% \changes{4.4}{2017-05-15}{Ajout de l'option bibsection.}
-% \begin{DescribeMacro}{bibchapitre}
-% \begin{DescribeMacro}{bibsection}
-% Permettent de composer une bibliographie distincte après chaque
-% fichier inséré dans le document avec \cmd{\include},
-% habituellement un chapitre; voir la
-% \autoref{sec:bibliographie:multiples}. Ces options sont
-% principalement utiles pour les thèses et mémoires par articles.
-% La bibliographie se présente sous la forme d'un chapitre non
-% numéroté avec |bibchapitre|, et sous la forme d'une section
-% numérotée avec |bibsection|.
-% \end{DescribeMacro}
-% \end{DescribeMacro}
-%
-% \begin{DescribeMacro}{nonatbib}
-% Empêche le chargement du paquetage \pkg{natbib}. La paquetage est
-% normalement chargé par la classe; voir la
+% \end{DescribeOption}
+%
+% \changes{5.2}{2019-05-06}{Ajout d'une option \texttt{projet} pour
+% les cours de projet de recherche.}
+% \begin{DescribeOption}{projet}
+% L'option |projet| identifie un projet de recherche. Elle permet
+% d'utiliser la classe pour la rédaction d'un rapport de projet de
+% recherche respectant les règles de présentation de la FESP.
+% L'option a pour effet d'inscrire l'appellation «Projet de
+% recherche» sur la page de titre et de supprimer la mention du
+% grade. Son utilisation rend d'ailleurs non obligatoire la
+% déclaration de grade qui, si elle est présente, est simplement
+% ignorée. Comme pour un essai de maîtrise, l'utilisation simultanée
+% de l'option |article| de la classe \class{memoir} peut s'avérer
+% tout indiquée avec cette option.
+% \end{DescribeOption}
+%
+% \changes{5.3}{2019-11-29}{Ajout d'une option \texttt{stage} pour les
+% rapports de stage.}
+% \begin{DescribeOption}{stage}
+% L'option |stage| identifie un rapport de stage. L'effet de cette
+% option est identique à celui de l'option |projet| à deux
+% exceptions près: l'inscription sur la page de titre est «Rapport
+% de stage» et la page frontispice est supprimée.
+% \end{DescribeOption}
+%
+% \begin{DescribeOption}{10pt,11pt,12pt}
+% Les options |10pt|, |11pt| et |12pt| sélectionnent une taille de
+% police de 10, 11 ou 12~points. Par défaut la classe utilise une
+% police de 11~points. Ces options n'ont aucun effet sur la taille
+% des polices des pages de titre.
+% \end{DescribeOption}
+%
+% \begin{DescribeOption}{nonatbib}
+% L'option |nonatbib| empêche le chargement du paquetage %
+% \href{https://ctan.org/pkg/natbib}{\pkg{natbib}}. %
+% Celui-ci est normalement chargé par la classe; voir la
% \autoref{sec:bibliographie}. L'option |nonatbib| permet d'empêcher
-% le chargement pour modifier les options du paquetage ou en cas de
-% conflit avec un autre paquetage de mise en forme de la
-% bibliographie.
-% \end{DescribeMacro}
-%
-% \begin{DescribeMacro}{nobabel}
-% Empêche le chargement du paquetage \pkg{babel}. La classe utilise
-% par défaut ce paquetage pour le traitement des langues dans le
-% document; voir la \autoref{sec:langues}. L'option |nobabel| permet
-% d'empêcher son chargement si un autre paquetage devait être
-% utilisé --- on pense ici principalement à \pkg{polyglossia} pour
-% un document produit avec le moteur {\XeLaTeX}.
-% \end{DescribeMacro}
-%
-% \changes{5.1}{2018-09-30}{Ajout de l'option nohyperref.}
-% \begin{DescribeMacro}{nohyperref}
-% Empêche le chargement du paquetage \pkg{hyperref}. L'interaction
-% de ce paquetage avec les autres est parfois --- voire souvent ---
-% délicate. La classe se charge de le charger en tout dernier tel
-% que généralement recommandé. L'option |nohyperref| permet
-% d'empêcher son chargement s'il est absolument nécessaire de
+% son chargement pour vous permettre de modifier les options du
+% paquetage ou en cas de conflit avec un autre paquetage de mise en
+% forme de la bibliographie.
+% \end{DescribeOption}
+%
+% \begin{DescribeOption}{nobabel}
+% L'option |nobabel| empêche le chargement du paquetage %
+% \href{https://ctan.org/pkg/babel}{\pkg{babel}}. %
+% La classe utilise par défaut ce paquetage pour le traitement des
+% langues dans le document; voir la \autoref{sec:langues}. L'option
+% |nobabel| permet d'empêcher son chargement si un autre paquetage
+% devait être utilisé~--- on pense ici principalement à %
+% \href{https://ctan.org/pkg/polyglossia}{\pkg{polyglossia}} %
+% pour un document produit avec le moteur {\XeLaTeX}.
+% \end{DescribeOption}
+%
+% \changes{5.1}{2018-09-30}{Ajout de l'option \texttt{nohyperref}.}
+% \begin{DescribeOption}{nohyperref}
+% L'option |nohyperref| empêche le chargement du paquetage %
+% \href{https://ctan.org/pkg/hyperref}{\pkg{hyperref}}. %
+% L'interaction de ce paquetage avec les autres est parfois~---
+% voire souvent~--- délicate. La classe tâche de le charger en tout
+% dernier, tel que généralement recommandé. L'option |nohyperref|
+% permet d'empêcher son chargement s'il est absolument nécessaire de
% charger d'autres paquetages avant \pkg{hyperref}. Si vous utilisez
% cette option, vous devez obligatoirement charger \pkg{hyperref}
% dans le préambule du document.
-% \end{DescribeMacro}
-%
-% \begin{DescribeMacro}{english, french, ...}
-% Déclare les langues utilisées dans le document. Ces options sont
-% transférées au paquetage \pkg{babel} (dans la mesure où |nobabel|
-% n'est pas spécifié, bien entendu). Le libellé des langues devrait
-% donc correspondre aux options de \pkg{babel}. La dernière langue
+% \end{DescribeOption}
+%
+% \begin{DescribeOption}{english, french, ...}
+% Les options telles que |english|, |french| ou autres déclarent les
+% langues utilisées dans le document. Ces options sont transférées
+% au paquetage \pkg{babel} (dans la mesure où |nobabel| n'est pas
+% spécifié, bien entendu). Le libellé des langues devrait donc
+% correspondre aux options de \pkg{babel}. La dernière langue
% spécifiée est la langue active par défaut dans le document.
-% \end{DescribeMacro}
+% \end{DescribeOption}
%
% Toute autre option sera passée à la classe \class{memoir} dont,
% entre autres, le format du papier. Le format lettre nord-américain
@@ -505,14 +648,14 @@
% \subsection{Commandes de la classe}
% \label{sec:utilisation:commandes}
%
-% La classe \class{ulthese} définit quelques nouvelles commandes
+% La classe {\ulclass} définit quelques nouvelles commandes
% servant principalement à créer la page frontispice et des éléments
% des pages liminaires. Le sommaire des commandes se trouve dans le
% \autoref{tab:commandes} et les descriptions détaillées, ci-dessous.
%
% \begin{table}[t]
% \centering
-% \caption{Sommaire des commandes de la classe \class{ulthese}.
+% \caption{Sommaire des commandes de la classe {\ulclass}.
% Celles marquées d'une étoile $^\star$ sont obligatoires.}
% \label{tab:commandes}
% \begin{tabularx}{\linewidth}{lX}
@@ -533,12 +676,13 @@
% \end{table}
%
% \begin{DescribeMacro}{\titre}
-% Titre principal de la thèse ou du mémoire. Ne pas utiliser la
-% commande \cmd{\title} de {\LaTeX} pour ce faire.
+% La commande \cmdprint{\titre} sert à spécifier le titre principal
+% du manuscrit. Vous ne devez pas utiliser la commande \cmd{\title}
+% de {\LaTeX} pour ce faire.
%
-% Vous devez couper manuellement avec |\\| ou \cmd{\newline} un
-% titre très long. Par exemple, la déclaration d'un titre d'une
-% seule ligne est:
+% Coupez manuellement avec {\bs\bs} ou \cmd{\newline} un titre très
+% long. Par exemple, la déclaration d'un titre d'une seule ligne
+% est:
% \begin{quote}
% |\titre{Ceci est un titre d'une seule ligne}|
% \end{quote}
@@ -550,48 +694,51 @@
% \end{DescribeMacro}
%
% \begin{DescribeMacro}{\soustitre}
-% Sous-titre de la thèse ou du mémoire, le cas échéant. Les remarques
-% sur un long titre principal s'appliquent également au sous-titre.
+% La commande \cmdprint{\soustitre} sert à spécifier le sous-titre
+% du manuscrit, le cas échéant. Les remarques sur un long titre
+% principal s'appliquent également au sous-titre.
% \end{DescribeMacro}
%
% \begin{DescribeMacro}{\auteur}
-% Nom complet de l'auteur de la thèse ou du mémoire, sous la forme
-% |Prénom Nom| avec seulement des majuscules initiales. Ne pas
-% utiliser la commande \cmd{\author} de {\LaTeX} pour le nom de
-% l'auteur.
+% La commande \cmdprint{\auteur} permet de saisir le nom complet de
+% l'auteur de la thèse ou du mémoire, sous la forme |Prénom Nom|
+% avec seulement des majuscules initiales. N'utilisez pas la
+% commande \cmd{\author} de {\LaTeX} pour le nom de l'auteur.
% \end{DescribeMacro}
%
% \begin{DescribeMacro}{\programme}
-% Nom complet officiel du programme d'études comme «Doctorat en
-% informatique» ou «Maîtrise en mathématiques». Si le programme
-% comporte une majeure, séparer sa mention de celle du programme
-% principal par un tiret demi-quadratin (obtenu avec |--|).
+% La commande \cmdprint{\programme} sert à spécifier le nom complet
+% officiel du programme d'études comme «Doctorat en informatique» ou
+% «Maîtrise en mathématiques». Si le programme comporte une majeure,
+% séparez sa mention de celle du programme principal par un tiret
+% demi-quadratin (obtenu avec |--|).
% \end{DescribeMacro}
%
% \begin{DescribeMacro}{\direction}
-% Nom complet du directeur ou de la directrice de recherche, sous la
-% forme |Prénom Nom| avec seulement des majuscules initiales, suivi
-% d'une virgule et de la mention «directeur de recherche» ou
-% «directrice de recherche».
+% La commande \cmdprint{\direction} sert à spécifier le nom complet
+% du directeur ou de la directrice de recherche, sous la forme
+% |Prénom Nom| avec seulement des majuscules initiales, suivi d'une
+% virgule et de la mention «directeur de recherche» ou «directrice
+% de recherche».
%
% Les thèses en cotutelle comportent un directeur ou une directrice
% de recherche et un directeur ou une directrice de cotutelle.
-% Séparer chaque mention par |\\|, comme ceci:
+% Séparez chaque mention par {\bs\bs}, comme ceci:
% \begin{quote}
% |\direction{Prénom Nom, directrice de recherche \\| \\
% | Prénom Nom, directeur de cotutelle}|
% \end{quote}
%
% De même, les maîtrises en bidiplomation comptent deux directeurs
-% ou directrices de recherche. Séparer chaque mention tel que
+% ou directrices de recherche. Séparez chaque mention tel que
% mentionné ci-dessus.
% \end{DescribeMacro}
%
% \begin{DescribeMacro}{\codirection}
-% Comme la commande \cmd{\direction}, mais pour le ou les
-% codirecteurs de recherche, s'il y a lieu. Lorsqu'il y a plus d'un
-% codirecteur de recherche, séparer chaque mention par |\\|, comme
-% ceci:
+% La commande \cmdprint{\codirection} joue le même rôle que la
+% commande \cmdprint{\direction}, mais pour le ou les codirecteurs
+% de recherche, s'il y a lieu. Lorsqu'il y a plus d'un codirecteur
+% de recherche, séparez chaque mention par {\bs\bs}, comme ceci:
% \begin{quote}
% |\codirection{Prénom Nom, directrice de recherche \\| \\
% | Prénom Nom, directeur de recherche}|
@@ -599,27 +746,30 @@
% \end{DescribeMacro}
%
% \begin{DescribeMacro}{\frontispice}
-% Création de la page frontispice. De toutes les commandes
-% ci-dessus, c'est la seule qui doit se trouver dans le corps du
-% document plutôt que dans le préambule.
+% La commande \cmdprint{\frontispice} crée la page frontispice à
+% l'endroit où elle apparait dans le code source. De toutes les
+% commandes ci-dessus, c'est la seule qui doit se trouver dans le
+% corps du document plutôt que dans le préambule.
% \end{DescribeMacro}
%
% \begin{DescribeMacro}{\dedicace}
-% Ajout d'une dédicace («À mes parents», «À Camille») à la thèse ou
-% au mémoire. La dédicace est disposée seule sur une page liminaire,
-% à une dizaine de lignes de la marge du haut et alignée à droite.
-% Par défaut, elle est composée en italique.
+% La commande \cmdprint{\dedicace} permet d'insérer une dédicace («À
+% mes parents», «À Camille») à l'endroit où elle apparait dans le
+% code source. La dédicace est disposée seule sur une page
+% liminaire, à une dizaine de lignes de la marge du haut et alignée
+% à droite. Par défaut, elle est composée en italique.
% \end{DescribeMacro}
%
% \begin{DescribeMacro}{\epigraphe}
-% Ajout d'une épigraphe au début du document. Comme la dédicace,
-% l'épigraphe est disposée seule sur une page liminaire, à une
-% dizaine de lignes de la marge du haut et alignée à droite. La
-% commande accepte deux arguments, soit le texte de la citation et
-% son auteur ou la source, dans l'ordre.
-%
-% Pour ajouter une épigraphe au début d'un ou plusieurs chapitres,
-% utiliser directement la commande \cmd{\epigraph} de
+% La commande \cmdprint{\epigraphe} permet d'insérer une épigraphe
+% au début du document. Comme la dédicace, l'épigraphe est disposée
+% seule sur une page liminaire, à une dizaine de lignes de la marge
+% du haut et alignée à droite. La commande accepte deux arguments,
+% soit le texte de la citation et son auteur ou la source, dans
+% l'ordre.
+%
+% Pour ajouter une épigraphe au début d'un ou de plusieurs
+% chapitres, utilisez directement la commande \cmd{\epigraph} de
% \class{memoir}, sur laquelle \cmd{\dedicace} et \cmd{\epigraphe}
% sont d'ailleurs basées.
% \end{DescribeMacro}
@@ -640,8 +790,8 @@
% L'environnement |quotation|, quant à lui, doit être utilisé pour
% les citations «longues», celles qui peuvent s'étendre sur plus de
% cinq lignes ou, surtout, plus d'un paragraphe. Dans la classe, le
-% texte est alors toujours placé en retrait de 10~mm, mais également
-% à interligne simple. De plus, un espace vertical sépare les
+% texte est alors toujours placé en retrait de 10~mm, mais aussi à
+% interligne simple. De plus, un espace vertical sépare les
% paragraphes, le cas échéant, afin de bien les distinguer les uns
% des autres.
% \end{DescribeEnv}
@@ -658,8 +808,9 @@
% \end{DescribeMacro}
%
% \begin{DescribeMacro}{\SingleSpacing}
-% Si ce devait être nécessaire ailleurs dans le document, la
-% commande \cmd{\SingleSpacing} permet de passer à l'interligne simple.
+% Si ce devait être nécessaire ailleurs dans le document, vous
+% pouvez avoir recours à la commande \cmd{\SingleSpacing} pour
+% passer à l'interligne simple.
% \end{DescribeMacro}
%
% \subsection{Hyperliens}
@@ -680,58 +831,44 @@
% \subsection{Autres paquetages chargés}
% \label{sec:paquetages}
%
-% Outre \class{memoir}, la classe \class{ulthese} charge quelques
-% paquetages qui peuvent aussi vous être utiles. Il n'est donc pas
-% nécessaire de charger de nouveau les paquetages suivants:
-% \begin{description}
-% \item[\normalfont\pkg{babel}] \citep{babel} gestion des documents
-% rédigés dans une ou plusieurs langues autres que l'anglais (si
-% l'option |nobabel| de la classe est absente; voir aussi la
-% \autoref{sec:langues});
-% \item[\normalfont\pkg{numprint}] \citep{numprint} requis par la
-% commande \cmd{\nombre} de \pkg{babel}; le paquetage est donc
-% chargé uniquement si \pkg{babel} l'est. Permet de composer
-% automatiquement des nombres avec un séparateur toutes les trois
-% positions (une espace en français);
-% \item[\normalfont\pkg{natbib}] \citep{natbib} gestion de la
-% bibliographie (si l'option |nonatbib| de la classe est absente;
-% voir aussi la \autoref{sec:bibliographie});
-% \item[\normalfont\pkg{chapterbib}] \citep{chapterbib} gestion de
-% bibliographies multiples (si l'une ou l'autre des options
-% |bibchapitre| ou |bibsection| est spécifiée;
-% voir aussi la \autoref{sec:bibliographie:multiples});
-% \item[\normalfont\pkg{hyperref}] \citep{hyperref} permet de
-% transformer toutes les références en hyperliens cliquables lorsque
-% le document est produit avec pdf{\LaTeX} ou {\XeLaTeX} (si
-% l'option |nohyperref| est spécifiée, vous devez obligatoirement
-% charger le paquetage vous-même);
-% \item[\normalfont\pkg{etoolbox}] \citep{etoolbox} outils
-% additionnels pour la conception de classes et de paquetages
-% (utilisé pour le chargement de \pkg{hyperref});
-% \item[\normalfont\pkg{fontspec}] \citep{fontspec} gestion des
-% polices OpenType sous {\XeLaTeX} (chargé avec ce moteur
-% seulement);
-% \item[\normalfont\pkg{graphicx}] \citep{graphicx} insertion et
-% manipulation de graphiques;
-% \item[\normalfont\pkg{xcolor}] \citep{xcolor} gestion des couleurs
-% dans le document, notamment celle des hyperliens;
-% \item[\normalfont\pkg{textcomp}] multitude de symboles spéciaux,
-% dont un beau symbole de copyright, \textcopyright.
-% \end{description}
-% L'\autoref{sec:meo} sur la mise en Å“uvre de la classe fournit
-% plus de détails sur la liste des paquetages chargés et les raisons
-% pour lesquelles ils sont requis dans la classe.
+% \changes{6.0}{2024-06-17}{Documentation: simplification de la
+% section sur les autres paquetages chargés par la classe.}
+% La classe {\ulclass} charge par défaut les paquetages suivants qui
+% peuvent vous être utiles: %
+% \href{https://ctan.org/pkg/babel}{\pkg{babel}} (voir aussi la \autoref{sec:langues}) %
+% \href{https://ctan.org/pkg/fontspec}{\pkg{fontspec}}, %
+% \href{https://ctan.org/pkg/graphicx}{\pkg{graphicx}}, %
+% \href{https://ctan.org/pkg/hyperref}{\pkg{hyperref}}, %
+% \href{https://ctan.org/pkg/microtype}{\pkg{microtype}}, %
+% \href{https://ctan.org/pkg/natbib}{\pkg{natbib}} (voir aussi la
+% \autoref{sec:bibliographie}), %
+% \href{https://ctan.org/pkg/numprint}{\pkg{numprint}}, %
+% \href{https://ctan.org/pkg/xcolor}{\pkg{xcolor}}. %
+% Tel que mentionné précédemment, la classe est basée sur
+% \class{memoir} qui, elle-même, incorpore d'office une trentaine de
+% paquetages\footnote{%
+% Consultez la section~18.24 de la documentation de \class{memoir}
+% pour la liste, ou encore le journal de la compilation (\emph{log})
+% d'un document utilisant la classe {\ulclass}.}. %
+% L'intégralité des fonctionnalités de \class{memoir} se retrouve donc
+% dans {\ulclass}.
+%
+% L'\autoref{sec:meo} sur la mise en Å“uvre de la classe fournit la
+% liste détaillée des paquetages chargés et les raisons pour
+% lesquelles ils sont requis dans la classe.
%
% \subsection{Paquetage incompatible}
% \label{sec:incompatible}
%
-% Le paquetage \pkg{geometry} est incompatible avec la classe à cause
-% de sa mauvaise interaction avec \class{memoir}. Son chargement dans
-% le préambule du document cause une erreur lors de la compilation.
+% Le paquetage %
+% \href{https://ctan.org/pkg/geometry}{\pkg{geometry}} %
+% est incompatible avec la classe à cause de sa mauvaise interaction
+% avec \class{memoir}. Son chargement dans le préambule du document
+% cause une erreur lors de la compilation.
%
% \section{Thèses et mémoires par articles}
% \changes{5.0}{2018-06-08}{Ajout d'une section spécifique sur les
-% thèses et mémoires par articles.}
+% thèses et mémoires par articles.}
%
% La rédaction de la thèse ou du mémoire par articles est une pratique
% qui gagne en popularité. Elle consiste à remplacer le corps
@@ -741,167 +878,54 @@
% du mémoire (le cas échéant) y apparaissent sous forme de
% sections numérotées.
%
-% L'autre caractéristique qui distingue la thèse et le mémoire par
-% articles des versions standards, c'est la nécessité d'utiliser une
-% bibliographie distincte pour chacun des chapitres. Les options de la
-% classe |bibchapitre| et |bibsection| permettent de réaliser cette
-% mise en forme particulière. La \autoref{sec:bibliographie:multiples}
-% explique comment en tirer profit.
-%
% Des gabarits de document maître et de chapitre fournissent la
% structure de base pour la thèse et le mémoire par articles. Vous
% pouvez, au besoin, combiner les caractéristiques de ces gabarits à
-% celles de la thèse en cotutelle ou du mémoire en bidiplomation. La
-% \autoref{sec:gabarits} fournit les détails sur les gabarits.
+% celles de la thèse en cotutelle ou du mémoire en bidiplomation.
%
-% \section{Français et autres langues}
-% \label{sec:langues}
-%
-% Une complication additionnelle si vous rédigez dans une langue autre
-% que l'anglais consiste à adapter {\LaTeX} à votre langue, qu'il
-% s'agisse des mots clés, de la typographie ou de la césure des mots.
-% La solution standard à ce problème provient du paquetage
-% \pkg{babel}. Celui-ci permet de combiner plusieurs langues dans un
-% même document et de passer de l'une à l'autre facilement. Il est
-% chargé par défaut par la classe \class{ulthese}.
-%
-% Aucune langue n'est spécifiée dans la classe. Vous aurez sans doute
-% recours à l'anglais et au français, ne serait-ce que pour les deux
-% résumés demandés par la FESP. Vous devez spécifier les langues
-% utilisées dans le document en options à la classe, tel que mentionné
-% à la \autoref{sec:utilisation:options}. La \emph{dernière} langue
-% spécifiée devient par défaut la langue active du document.
-%
-% \begin{DescribeMacro}{\selectlanguage}
-% La commande \cmd{\selectlanguage} de \pkg{babel} permet de passer de
-% la langue courante à la langue spécifiée en argument.
-% \end{DescribeMacro}
-%
-% \begin{DescribeEnv}{otherlanguage}
-% L'environnement |otherlanguage| de \pkg{babel} permet de faire
-% la même chose que la commande \cmd{\selectlanguage}, sauf que le
-% changement de langue est local à l'environnement --- utile pour
-% les brefs changements de langue.
-% \end{DescribeEnv}
-%
-% Si vous n'êtes pas autrement familier avec le paquetage
-% \pkg{babel}, consultez sa %
-% \doc{http://texdoc.net/pkg/babel/}. %
-% Celle-ci est éclatée en un
-% document principal, pour le cœur du paquetage et plusieurs
-% autres pour les fonctionnalités propres à une langue: %
-% \doc[anglais]{http://texdoc.net/pkg/babel-english}, %
-% \doc[français]{http://texdoc.net/pkg/babel-french}, %
-% etc. Consultez au moins les documents consacrés aux
-% langues utilisées dans votre thèse ou mémoire. Le plus simple
-% consiste sans doute à consulter en ligne sur CTAN les
-% \link{https://mirrors.ctan.org/tex-archive/macros/latex/required/babel/contrib/}{%
-% documents spécifiques par langue}.
-% \changes{4.4}{2017-05-14}{Correction d'une url vers la documentation
-% de babel.}
-%
-% \begin{DescribeMacro}{\nombre}
-% Le paquetage \pkg{numprint} étant chargé dans la classe avec
-% \pkg{babel}, vous pouvez utiliser la commande \cmd{\nombre} pour
-% formater automatiquement les nombres. Par exemple, le résultat de
-% |\nombre{123456789}| est \nombre{123456789}.
-% \end{DescribeMacro}
-%
-% Les utilisateurs de {\XeLaTeX} qui souhaiteraient plutôt utiliser le
-% plus récent paquetage \pkg{polyglossia} \citep{polyglossia} peuvent
-% empêcher le chargement de \pkg{babel} avec l'option |nobabel| de la
-% classe. Ils devront toutefois charger et configurer
-% \pkg{polyglossia} eux-mêmes dans l'entête de leur document. Ce
-% paquetage est moins évolué que \pkg{babel} pour la typographie
-% française.
+% \tipbox{À l'automne~2023, la FESP a retiré l'exigence de produire
+% une bibliographie par chapitre pour les thèses et mémoires par
+% articles. La thèse ou le mémoire doit désormais contenir une seule
+% bibliographie regroupant l’ensemble des références du document.}
%
% \section{Bibliographie}
% \label{sec:bibliographie}
+% \changes{6.0}{2024-05-22}{Documentation: suppression de la section
+% sur les bibliographies multiples.}
+% \changes{6.0}{2024-06-19}{Documentation: inversion des sections sur
+% la bibliographie et sur la rédaction en français.}
%
% \begin{DescribeMacro}{\bibliography}
-% Tel qu'expliqué au chapitre~8 de \citet{formation-latex-ul},
-% il est fortement recommandé d'utiliser {\BibTeX} pour la
+% Il est fortement recommandé d'utiliser {\BibTeX} pour la
% préparation de la bibliographie d'un document. Celle-ci est
% insérée dans le document à l'endroit où apparait la commande
% \cmd{\bibliography} dans le code source. Cette commande prend en
-% arguments les noms des bases de données bibliographiques séparés
+% arguments les noms des bases de données bibliographiques, séparés
% par des virgules.
% \end{DescribeMacro}
%
% \subsection{Mise en forme des citations}
% \label{sec:bibliographie:options}
%
-% Dans la classe \class{ulthese}, la mise en forme des citations est
-% confiée au paquetage \pkg{natbib} (à moins que l'option |nonatbib|
-% ne soit spécifiée). Le paquetage est chargé avec les options par
-% défaut, soit |round|, |semicolon| et |authoryear|. Pour spécifier
-% d'autres options, vous avez deux possibilités:
-% \begin{enumerate}
-% \item utiliser l'option |nonatbib| de la classe et ensuite charger
-% explicitement \pkg{natbib} avec ses options;
-% \item
-% \begin{DescribeMacro}{\setcitestyle}
-% utiliser la commande \cmd{\setcitestyle} pour passer de
-% nouvelles options à \pkg{natbib}.
-% \end{DescribeMacro}
-% \end{enumerate}
+% \begin{DescribeMacro}{\setcitestyle}
+% Dans la classe {\ulclass}, la mise en forme des citations est
+% confiée au paquetage %
+% \href{https://ctan.org/pkg/natbib}{\pkg{natbib}} %
+% (à moins que l'option |nonatbib| ne soit spécifiée). Le paquetage
+% est chargé avec les options par défaut, soit |round|, |semicolon|
+% et |authoryear|. Pour spécifier d'autres options utilisez la
+% commande \cmd{\setcitestyle} pour passer de nouvelles options à
+% \pkg{natbib}.
+% \end{DescribeMacro}
%
% Par exemple, pour utiliser un style de citation numérique où le
-% numéro de la référence se trouve entre crochets, vous pouvez
-% procéder de l'une ou l'autre des deux manières suivantes:
-% \begin{quote}
-% |\documentclass[nonatbib]{ulthese}| \\
-% |\usepackage[numbers,square]{natbib}| \\
-% |...| \\
-% |\bibliographystyle{plain-fr}|
-% \end{quote}
-% ou
+% numéro de la référence se trouve entre crochets, insérez la commande
+% suivante dans le préambule:
% \begin{quote}
-% |\documentclass{ulthese}| \\
-% |...| \\
-% |\setcitestyle{numbers,square}| \\
-% |\bibliographystyle{plain-fr}|
+% |\setcitestyle{numbers,square}|
% \end{quote}
%
-% Consultez la %
-% \doc{http://texdoc.net/pkg/natbib/} %
-% de \pkg{natbib} pour les détails.
-%
-% \subsection{Bibliographies multiples}
-% \label{sec:bibliographie:multiples}
-%
-% L'ajout de |bibchapitre| ou de |bibsection| dans les options de la
-% classe permet de générer une bibliographie distincte pour chaque
-% chapitre, une chose particulièrement utile pour les thèses et
-% mémoire par articles.
-%
-% La classe fait appel au paquetage \pkg{chapterbib}
-% \citep{chapterbib} pour composer des bibliographies multiples. La
-% \doc{http://texdoc.net/pkg/chapterbib/} du paquetage
-% explique la procédure à suivre pour obtenir une bibliographie par
-% chapitre avec {\BibTeX}. En résumé:
-% \begin{enumerate}
-% \item chaque chapitre comportant sa propre bibliographie doit
-% absolument être inséré dans le document principal avec la commande
-% \cmd{\include} \citep[section~3.5]{formation-latex-ul};
-% \item chaque fichier visé doit contenir une commande
-% \cmd{\bibliographystyle} (\autoref{sec:bibliographie:style}) et
-% une commande \cmd{\bibliography};
-% \item on obtient les diverses bibliographies en compilant avec
-% {\BibTeX} les fichiers individuels, et non le document maître.
-% \end{enumerate}
-%
-% La plupart des auteurs préféreront sans doute l'effet de l'option
-% |bibsection|, où la bibliographie apparait comme une section normale
-% à la fin d'un chapitre. Lorsque \pkg{babel} est chargé, la section
-% sera numérotée. Pour supprimer la numérotation, insérer dans le
-% préambule du document la commande
-% \begin{quote}
-% |\addto\extras|\meta{langue}|{\renewcommand{\bibsection}{%| \\
-% | \section*{\bibname}\prebibhook}}|
-% \end{quote}
-% où \meta{langue} est la langue par défaut du document
-% (\autoref{sec:langues}).
+% Consultez la documentation de \pkg{natbib} pour plus de détails.
%
% \subsection{Style de la bibliographie}
% \label{sec:bibliographie:style}
@@ -909,423 +933,142 @@
% \begin{DescribeMacro}{\bibliographystyle}
% Le format général de la bibliographie est contrôlé par un
% \emph{style} choisi avec la commande \cmd{\bibliographystyle} dans
-% le préambule du document ou dans les fichiers de chaque chapitre
-% dans une thèse ou un mémoire par articles. Les styles standards de
-% {\LaTeX} sont |plain|, |unsrt|, |alpha| et |abbrv|.
+% le préambule du document. Les styles standards de {\LaTeX} sont
+% |plain|, |unsrt|, |alpha| et |abbrv|.
% \end{DescribeMacro}
%
-% Le paquetage \pkg{natbib} chargé par défaut par la classe supporte
-% le style de citation auteur-année fréquemment employé en sciences
-% naturelles, plusieurs commandes de citation, un grand nombre de
-% styles de bibliographie ainsi que des entrées spécifiques pour les
-% numéros ISBN et les URL. Le paquetage fournit des styles de
-% bibliographie |plainnat|, |unsrtnat| et |abbrvnat| similaires aux
-% styles standards, mais plus complets. Il existe des
-% \link{https://mirrors.ctan.org/biblio/bibtex/contrib/bib-fr/}{versions
-% francisées} de ces styles (et de quelques autres) dans CTAN.
-%
-% Le paquetage \pkg{francais-bst} \citep{francais-bst} fournit une
-% feuille de style compatible avec \pkg{natbib} permettant de composer
-% des bibliographies auteur-année respectant les normes de typographie
-% française proposées dans \cite{Malo:1996}. Pour utiliser ce style,
-% spécifier dans le préambule du document LaTeX
-% \begin{quote}
-% |\bibliographystyle{francais}|
-% \end{quote}
+% Le paquetage \pkg{natbib} prend en charge le style de citation
+% auteur-année fréquemment employé en sciences naturelles, plusieurs
+% commandes de citation, un grand nombre de styles de bibliographie,
+% ainsi que des entrées spécifiques pour les numéros ISBN et les
+% adresses URL. Le paquetage fournit des styles de bibliographie
+% |plainnat|, |unsrtnat| et |abbrvnat| similaires aux styles
+% standards, mais plus complets. Il existe des %
+% \href{https://ctan.org/pkg/bib-fr}{versions francisées} %
+% de ces styles (et de quelques autres) dans CTAN.
+%
+% Les styles \code{francais} et \code{francaissc} du paquetage %
+% \href{https://ctan.org/pkg/francais-bst}{\pkg{francais-bst}} %
+% permettent de composer des bibliographies auteur-année respectant
+% les normes de typographie française. Ils sont compatibles avec
+% \pkg{natbib} et plus modernes que les styles mentionnés ci-dessus.
%
% Autrement, la FESP n'a pas d'exigences particulières quant à la
% présentation de la bibliographie (présentation du titre, des auteurs
% et autres informations bibliographiques).
%
-% \section{Police de caractères du document}
-% \label{sec:police}
-%
-% Les documents {\LaTeX} sont facilement reconnaissables par leur
-% police de caractères par défaut, {\fontfamily{cmr}\selectfont
-% Computer Modern}. Avec toute distribution {\LaTeX} moderne, il est
-% maintenant simple d'utiliser l'une ou l'autre des polices PostScript
-% standards. D'ailleurs la classe \class{ulthese} utilise la police
-% sans empattements \textsf{Helvetica} pour composer les pages de
-% titre.
-%
-% La FESP permet l'utilisation des polices Times, Palatino (la police
-% du présent document) et Lucida~Bright dans les thèse et mémoires.
-% \citet[section~10.2]{formation-latex-ul} explique comment utiliser ces
-% polices dans votre document.
-%
-% \section{Gabarits}
-% \label{sec:gabarits}
-%
-% Afin de vous épauler dans la préparation de votre manuscrit, la
-% classe \class{ulthese} est livrée avec un ensemble de gabarits. Tout
-% d'abord, pour le document maître de différents types de thèses et de
-% mémoires:
-% \begin{itemize}[noitemsep]
-% \item |gabarit-doctorat.tex|;
-% \item |gabarit-doctorat-articles.tex|;
-% \item |gabarit-doctorat-cotutelle.tex|;
-% \item |gabarit-maitrise.tex|;
-% \item |gabarit-maitrise-articles.tex|;
-% \item |gabarit-maitrise-bidiplomation.tex|.
-% \end{itemize}
-% Ensuite, pour quelques parties d'un document:
-% \begin{itemize}[noitemsep]
-% \item |resume.tex|;
-% \item |abstract.tex|;
-% \item |remerciements.tex|;
-% \item |avantpropos.tex|;
-% \item |introduction.tex|;
-% \item |chapitre1.tex|;
-% \item |chapitre1-articles.tex|;
-% \item |chapitre2.tex|;
-% \item |chapitre2-articles.tex|;
-% \item |conclusion.tex|;
-% \item |annexe.tex|.
-% \end{itemize}
-% Vous pourriez devoir combiner les caractéristiques de deux gabarits
-% de document maître comme, par exemple, pour une thèse en cotutelle
-% par articles.
-%
-% Les gabarits comportent des commentaires succincts pour vous guider
-% dans leur utilisation. Les sections suivantes fournissent des
-% détails additionnels, et ce, dans l'ordre où les commandes
-% apparaissent dans les fichiers.
-%
-% \begin{rem}
-% Il n'y a pas de gabarit spécifique pour un examen de doctorat,
-% pour un essai de maîtrise, pour un projet de recherche ou pour un
-% rapport de stage. Utilisez un gabarit de thèse ou de maîtrise et
-% inscrivez l'option |examen|, |essai|, |projet| ou |stage| dans la
-% commande \cmd{\documentclass}.
-% \end{rem}
-%
-% \subsection{Encodage des fichiers}
-%
-% Composer en {\LaTeX} de longs textes dans une langue ayant recours
-% aux signes diacritiques devient rapidement pénible si l'on utilise
-% des commandes telles que |\'e|, |\`a| ou |\"o| pour entrer des lettres
-% accentuées. Afin de pouvoir plutôt entrer directement |é|, |à| ou
-% |ö|, {\LaTeX} doit être configuré pour reconnaître les lettres
-% accentuées. C'est le rôle du paquetage \pkg{inputenc}
-% \citep{inputenc}.
-%
-% Il existe plusieurs manières différentes d'encoder --- ou
-% d'enregistrer --- les lettres accentuées et autres caractères
-% spéciaux (comme, par exemple, le symbole de l'euro) dans un
-% ordinateur. La méthode la plus répandue et celle standard sur les
-% versions récentes des systèmes d'exploitation Linux et macOS est
-% l'UTF-8 de la norme
-% \link{https://fr.wikipedia.org/wiki/Unicode}{Unicode}. Les gabarits
-% sont livrés dans ce type d'encodage.
-%
-% La déclaration
-% \begin{quote}
-% |\usepackage[utf8]{inputenc}|
-% \end{quote}
-% dans le préambule assure que {\LaTeX} traitera correctement des
-% fichiers source encodés en UTF-8.
-%
-% La norme Unicode n'est pas aussi uniformément supportée par Windows.
-% Selon l'éditeur de texte employé et la version du système
-% d'exploitation, il peut être nécessaire d'utiliser les normes
-% d'encodage %
-% \link{https://fr.wikipedia.org/wiki/ISO_8859-1}{ISO~8859-1} %
-% (ou Latin-1; option |latin1| de \pkg{inputenc}), %
-% \link{https://fr.wikipedia.org/wiki/ISO_8859-15}{ISO~8859-15} %
-% (ou Latin-9; option |latin9|) ou %
-% \link{https://fr.wikipedia.org/wiki/Windows-1252}{Windows-1252} %
-% (options |cp1252| ou |ansinew|).
-%
-% La situation est plus simple avec {\XeLaTeX} puisqu'il gère
-% nativement Unicode. Le paquetage \pkg{inputenc} est non seulement
-% inutile, mais incompatible avec {\XeLaTeX}. C'est pourquoi, dans les
-% gabarits, \pkg{inputenc} est chargé seulement lorsque {\XeTeX}
-% n'est pas le moteur employé pour compiler le document.
-%
-% \subsection{Paquetages additionnels}
-%
-% Tel qu'expliqué à la \autoref{sec:paquetages}, la classe charge déjà
-% quelques paquetages. Cependant, il est fort probable que vous devrez
-% en charger d'autres pour composer votre document. Les gabarits
-% prévoient un endroit pour le chargement de paquetages additionnels.
-%
-% Si vous utilisez un paquetage non standard dans les distributions
-% courantes (\TeX~Live, Mac\TeX, MiK\TeX), vous devez le fournir avec
-% le code source de votre document lors du dépôt final.
-%
-% \subsection{Changement de police de caractères}
-%
-% Les gabarits comportent des déclarations types pour utiliser les
-% polices Palatino ou Times sous {\LaTeX} ou, sous {\XeLaTeX}, leurs
-% équivalents Pagella et Termes du projet
-% \link{https://www.gust.org.pl/projects/e-foundry/tex-gyre/}{TeX~Gyre}.
-%
-% \subsection{Options de \pkg{babel}}
-%
-% \begin{DescribeMacro}{\frenchbsetup}
-% La commande \cmd{\frenchbsetup} de \pkg{babel} permet de contrôler
-% certains ajustements typographiques apportés par le paquetage en
-% mode français. Consultez la documentation de \pkg{babel} pour la
-% liste des options de configuration disponibles.
-% \end{DescribeMacro}
-%
-% Les concepteurs de la classe \class{ulthese} proposent trois
-% ajustements dans les gabarits:
-% \begin{enumerate}
-% \item l'option |StandardItemizeEnv=true| évite que le mode français de
-% \pkg{babel} ne diminue l'espacement vertical dans les listes;
-% \item l'option |ThinSpaceInFrenchNumbers=true| fait en sorte qu'une espace fine
-% sera utilisée comme séparateur des milliers dans les nombres plutôt
-% qu'une espace pleine;
-% \item les options |og=«| et |fg=»| déclarent que les caractères « et
-% » utilisés dans le code source représentent les guillemets ouvrant
-% et fermant, respectivement. Cela évite de devoir utiliser les
-% commandes \cmd{\og} et \cmd{\fg} de \pkg{babel} tout en bénéficiant de
-% l'ajutement automatique des espaces autour des symboles.
-% \end{enumerate}
-% Vous devez évidemment désactiver ces ajustements si l'option
-% |nobabel| est spécifiée au chargement de la classe.
+% \section{Français et autres langues}
+% \label{sec:langues}
%
-% \subsection{Style de la bibliographie}
-% \label{sec:bibliographystyle}
-%
-% Tel qu'expliqué à la \autoref{sec:bibliographie:style}, la commande
-% \cmd{\bibliographystyle} permet de définir le mode de citation dans
-% le texte et la présentation des notices bibliographiques. Cette
-% commande devrait figurer dans les fichiers des chapitres
-% individuels dans une thèse ou un mémoire par articles.
-%
-% \subsection{Déclarations de la page frontispice}
-%
-% Les gabarits comportent toutes les déclarations nécessaires pour
-% composer la page frontispice des divers types de thèse ou de
-% mémoires. Vous devez remplacer les éléments se trouvant entre
-% crochets |< >| en respectant la forme indiquée. Assurez-vous de
-% supprimer les caractères |<| et |>| afin qu'ils n'apparaissent pas
-% sur la page frontispice de votre document.
-%
-% \subsection{Pages liminaires}
-%
-% \begin{DescribeMacro}{\frontmatter}
-% La commande \cmd{\frontmatter} déclare que {\LaTeX} doit considérer le
-% matériel qui suit comme des pages liminaires. En pratique, cela
-% résulte essentiellement en une numérotation des pages en chiffres
-% romains.
-% \end{DescribeMacro}
+% Une complication additionnelle si vous rédigez dans une langue autre
+% que l'anglais consiste à adapter {\LaTeX} à votre langue, qu'il
+% s'agisse des mots clés, de la typographie ou de la césure des mots.
+% La solution standard à ce problème provient du paquetage %
+% \href{https://ctan.org/pkg/babel}{\pkg{babel}}. %
+% Celui-ci permet de combiner plusieurs langues dans un même document
+% et de passer de l'une à l'autre facilement. Il est chargé par défaut
+% par la classe {\ulclass}.
%
-% Les normes de présentation de la FESP édictent que les thèses et
-% mémoires devraient comporter les pages liminaires suivantes, dans
-% l'ordre:
-% \begin{enumerate}[noitemsep]
-% \item page frontispice (obligatoire);
-% \item résumé en français (obligatoire);
-% \item résumé en anglais (recommandé, mais non obligatoire);
-% \item table des matières (obligatoire);
-% \item liste des tableaux;
-% \item liste des figures;
-% \item liste des abbréviations et des sigles;
-% \item dédicace;
-% \item épigraphe;
-% \item remerciements;
-% \item avant-propos (obligatoire dans le cas d'une thèse ou d'un
-% mémoire par articles).
-% \end{enumerate}
-%
-% Les commandes
-% \begin{quote}
-% \cmd{\frontispice} \\
-% \cmd{\tableofcontents} \\
-% \cmd{\listoftables} \\
-% \cmd{\listoffigures} \\
-% \cmd{\dedicace}\marg{texte} \\
-% \cmd{\epigraphe}\marg{texte}\marg{auteur}
-% \end{quote}
-% permettent de générer les pages correspondantes. Seules les deux
-% dernières commandes admettent des arguments.
-%
-% \begin{rem}
-% L'examen de doctorat, l'essai de maîtrise, le rapport de projet de
-% recherche et le rapport de stage comportent une page de titre.
-% Vous devez ajouter dans les gabarits les commandes nécessaires
-% pour la production de la page de titre (\autoref{sec:pagetitre})
-% et supprimer les autres pages liminaires. Rappelons que l'option
-% de classe |examen| a pour effet de supprimer la page frontispice.
-% \end{rem}
-%
-% \begin{DescribeMacro}{\chapter*}
-% Les résumés, la liste des abbréviations et des sigles, les
-% remerciements et l'avant-propos sont composés comme des chapitres
-% normaux, mais sans être numérotés. Il faut donc définir ces éléments
-% avec la commande \cmd{\chapter*}.
-% \end{DescribeMacro}
+% Aucune langue n'est spécifiée dans la classe. Vous aurez sans doute
+% recours à l'anglais et au français, ne serait-ce que pour les deux
+% résumés demandés par la FESP. Vous devez spécifier les langues
+% utilisées dans le document en options à la classe, tel que mentionné
+% à la \autoref{sec:utilisation:options}. La \emph{dernière} langue
+% spécifiée devient par défaut la langue active du document.
%
-% \begin{DescribeMacro}{\label}
-% La commande \cmd{\label} permet d'utiliser le système de renvois
-% automatiques de {\LaTeX} \citep[section~3.4]{formation-latex-ul}.
-% Les étiquettes des chapitres non numérotés sont déjà configurées
-% pour l'ajout de ces chapitres dans la table des matières (voir
-% ci-dessous). Nous recommandons fortement de définir vos propres
-% étiquettes pour les chapitres normaux.
+% \begin{DescribeMacro}{\selectlanguage}
+% La commande \cmd{\selectlanguage} de \pkg{babel} permet de passer de
+% la langue courante à la langue spécifiée en argument.
% \end{DescribeMacro}
%
-% \begin{DescribeMacro}{\phantomsection}
-% \begin{DescribeMacro}{\addcontentsline}
-% \begin{DescribeMacro}{\nameref}
-% Les chapitres déclarés avec la commande \cmd{\chapter*}
-% n'apparaissent pas dans la table des matières. Comme les
-% normes de présentation de la FESP exigent que toutes les pages
-% liminaires y figurent, nous faisons suivre les commandes
-% \cmd{\chapter*}\marg{Titre} et \cmd{\label}\marg{nom} des
-% commandes
-% \end{DescribeMacro}
-% \end{DescribeMacro}
-% \end{DescribeMacro}
-% \begin{quote}
-% |\phantomsection\addcontentsline{toc}{chapter}{%| \\
-% | \nameref|\marg{nom}|}|
-% \end{quote}
-% Celles-ci ajoutent à la table des matières (|toc|) une section de
-% niveau |chapter| dont le titre est celui du chapitre auquel
-% correspond l'étiquette \meta{nom}. La commande \cmd{\phantomsection}
-% est rendue nécessaire (ou recommandée) par le paquetage
-% \pkg{hyperref}.
+% \begin{DescribeEnv}{otherlanguage}
+% L'environnement |otherlanguage| de \pkg{babel} permet de faire la
+% même chose que la commande \cmd{\selectlanguage}, sauf que le
+% changement de langue est local à l'environnement, ce qui peut
+% s'avérer utile pour les brefs changements de langue.
+% \end{DescribeEnv}
%
-% \subsection{Corps du document}
+% Si vous n'êtes pas autrement familier avec le paquetage \pkg{babel},
+% consultez sa documentation. Celle-ci est éclatée en un document
+% principal pour le cœur du paquetage et plusieurs autres pour les
+% fonctionnalités propres à une langue. Consultez au moins les
+% documents consacrés aux langues utilisées dans votre thèse ou
+% mémoire. Le plus simple consiste sans doute à consulter en ligne sur
+% CTAN les
+% \href{https://ctan.org/pkg/babel-contrib/}{documents spécifiques par langue}.
+% \changes{4.4}{2017-05-14}{Correction d'une url vers la documentation
+% de \textbf{babel}.}
%
-% \begin{DescribeMacro}{\mainmatter}
-% La commande \cmd{\mainmatter} délimite le début du corps du document. La
-% numérotation des pages passe en chiffres arabes.
+% \begin{DescribeMacro}{\nombre}
+% Le paquetage %
+% \href{https://ctan.org/pkg/numprint}{\pkg{numprint}} %
+% étant chargé dans la classe avec \pkg{babel}, vous pouvez utiliser
+% la commande \cmd{\nombre} pour formater automatiquement les
+% nombres. Par exemple, le résultat de |\nombre{123456789}| est
+% \nombre{123456789}.
% \end{DescribeMacro}
%
-% Le corps du document devrait normalement compter une introduction (non
-% numérotée), un développement divisé en chapitres (numérotés) et une
-% conclusion (non numérotée).
-%
-% \subsection{Annexes}
-%
-% \begin{DescribeMacro}{\appendix}
-% Si la thèse ou le mémoire comporte une ou plusieurs annexes,
-% composer celles-ci comme des chapitres normaux insérés dans le
-% document maître après la commande \cmd{\appendix}. Cette commande a
-% pour effet de passer d'un mode de numération numérique (1, 1.1, 2, 2.1,
-% \dots) à un mode alphanumérique (A, A.1, B, B.1, \dots).
-% \end{DescribeMacro}
+% Si vous souhaitez plutôt utiliser le plus récent paquetage %
+% \href{https://ctan.org/pkg/polyglossia}{\pkg{polyglossia}} %
+% avec {\XeLaTeX}, vous devez empêcher le chargement de \pkg{babel}
+% avec l'option |nobabel| de la classe, puis charger et configurer
+% \pkg{polyglossia} vous-même dans l'entête de votre document. Ce
+% paquetage est moins évolué que \pkg{babel} pour la typographie
+% française.
%
-% \subsection{Bibliographie}
+% \section{Police de caractères du document}
+% \label{sec:police}
+% \changes{6.0}{2024-06-17}{Documentation: révision de la section sur
+% les polices de caractères suite aux modifications apportées aux
+% règles de présentation de la FESP.}
%
-% La bibliographie figure normalement à la toute fin du document, sous
-% forme de chapitre non numéroté. Tel qu'expliqué à la
-% \autoref{sec:bibliographie:multiples}, la commande
-% \cmd{\bibliography} doit plutôt se trouver dans les fichiers des
-% chapitres dans une thèse ou un mémoire par articles.
+% Les documents {\LaTeX} sont facilement reconnaissables par leur
+% police de caractères par défaut: %
+% {\iftutex\fontfamily{lmr}\else\fontfamily{cmr}\fi\selectfont
+% Computer Modern}. %
+% Si vous le souhaitez, il est aujourd'hui assez simple de produire
+% des documents {\LaTeX} utilisant d'autres polices. L'approche
+% recommandée consiste à utiliser une police OpenType ou TrueType
+% présente sur votre système avec le moteur {\XeLaTeX}. Autrement,
+% vous pouvez charger l'une ou l'autre des polices PostScript
+% standards compatibles avec le moteur pdf{\LaTeX} en ayant recours au
+% paquetage %
+% \href{https://ctan.org/pkg/psnfss}{\pkg{psnfss}}. %
+% Dans tous les cas, assurez-vous de respecter les règles de
+% présentation de la FESP en matière de polices de caractères.
+%
+% La BibliotheÌ€que de l’UniversiteÌ Laval deÌtient une licence
+% d’utilisation des polices de très grande qualité %
+% \href{https://tug.org/store/lucida}{Lucida Bright}. %
+% Vous pouvez vous procurer gratuitement une copie des polices en
+% eÌcrivant aÌ€ %
+% \href{mailto:lucida@bibl.ulaval.ca}{lucida@bibl.ulaval.ca}.
+%
+% À titre indicatif, le présent document est composé avec les polices
+% OpenType %
+% \href{https://ctan.org/pkg/stix2-otf}{STIX~Two} %
+% pour le texte et %
+% \href{https://ctan.org/pkg/fira}{Fira} %
+% pour les éléments décoratifs (notamment \textsf{Fira Sans} pour les
+% titres de sections et \texttt{Fira Mono} pour le code informatique).
+%
+% \changes{6.0}{2024-05-25}{Documentation: suppression de la section
+% portant sur l'explication détaillée des gabarits. En échange,
+% ceux-ci comportent des commentaires additionnels.}
%
% \section{Commentaires, suggestions et aide}
% \changes{5.0}{2018-08-09}{Code source du projet déplacé de GitHub
-% vers GitLab.}
+% vers GitLab.}
+% \changes{6.0}{2024-06-18}{Documentation: retrait du wiki thèse
+% (fermé) et des archives de la liste ulthese-aide (peu utiles).}
%
-% Le \link{https://gitlab.com/vigou3/ulthese/}{dépôt du projet} dans
+% Le \href{https://gitlab.com/vigou3/ulthese/}{dépôt du projet} dans
% GitLab demeure le meilleur endroit pour rapporter des bogues ou pour
-% proposer des améliorations à la classe \class{ulthese}.
-%
-% Pour obtenir de l'aide additionnelle sur l'utilisation de la classe
-% --- et non sur celle de {\LaTeX} en général --- consultez d'abord:
-% \begin{enumerate}
-% \item le \link{http://www.theses.ulaval.ca/wiki/}{WikiThèse} de
-% l'Université Laval, en particulier la
-% \link{http://www.theses.ulaval.ca/wiki/index.php?title=FAQ}{Foire aux questions};
-% \item les
-% \link{http://listes.ulaval.ca/listserv/archives/ulthese-aide.html}{archives}
-% de la liste de distribution \texttt{ulthese-aide}.
-% \end{enumerate}
-% Si la réponse à votre question ne se trouve ni dans le wiki, ni dans
-% les archives, alors écrivez à l'adresse
-% \href{mailto:ulthese-aide@listes.ulaval.ca}{\url{ulthese-aide@listes.ulaval.ca}}.
-%
-% \StopEventually{
-% \begin{thebibliography}{15}
-% \addcontentsline{toc}{section}{Références}
-% \bibitem[{Arseneau(2010)}]{chapterbib}
-% Arseneau, D. 2010,
-% {\selectlanguage{english}\emph{chapterbib. Multiple
-% bibliographies in {\LaTeX}}}.
-% URL~\url{https://www.ctan.org/pkg/chapterbib/}.
-%
-% \bibitem[{Braams et Bezos(2016)}]{babel}
-% Braams, J. et J.~Bezos. 2016,
-% {\selectlanguage{english}\emph{Babel}}.
-% URL~\url{https://www.ctan.org/pkg/babel/}.
-%
-% \bibitem[{Carlisle et {The \LaTeX3\ Project}(2016)}]{graphicx}
-% Carlisle, D. et {The \LaTeX3\ Project}. 2016,
-% {\selectlanguage{english}\emph{Packages in the `graphics'
-% Bundle}}. URL~\url{https://www.ctan.org/pkg/graphics/}.
-%
-% \bibitem[{Charette(2015)}]{polyglossia}
-% Charette, F. 2015, {\selectlanguage{english}\emph{Polyglossia:
-% An Alternative to Babel for {\XeLaTeX} and {\LuaLaTeX}}}.
-% URL~\url{https://www.ctan.org/pkg/polyglossia/}, current
-% maintainer Arthur Reutenauer.
-%
-% \bibitem[{Daly(2010)}]{natbib}
-% Daly, P.~W. 2010, {\selectlanguage{english}\emph{Natural
-% Sciences Citations and References}}.
-% URL~\url{https://www.ctan.org/pkg/natbib/}.
-%
-% \bibitem[{Goulet(2013)}]{francais-bst}
-% Goulet, V. 2013, {\selectlanguage{french}«Paquetage
-% francais-bst»},
-% URL~\url{https://www.ctan.org/pkg/francais-bst/}.
-%
-% \bibitem[{Goulet(2020)}]{formation-latex-ul}
-% Goulet, V. 2020, {\selectlanguage{french}\emph{Rédaction avec
-% {\LaTeX}}}, document libre sous contrat Creative Commons.
-% URL~\url{httpss://ctan.org/pkg/formation-latex-ul}.
-%
-% \bibitem[{Harders(2012)}]{numprint}
-% Harders, H. 2012, {\selectlanguage{english}\emph{The
-% numprint package}}.
-% URL~\url{https://www.ctan.org/pkg/numprint/}.
-%
-% \bibitem[{Jeffrey et Mittelbach(2015)}]{inputenc}
-% Jeffrey, A. et F.~Mittelbach. 2015,
-% {\selectlanguage{english}\emph{inputenc.sty}}.
-% URL~\url{https://www.ctan.org/pkg/inputenc/}.
-%
-% \bibitem[{Kern(2016)}]{xcolor}
-% Kern, D.~U. 2016, {\selectlanguage{english}\emph{Extending
-% {\LaTeX}’s color facilities: the xcolor package}}.
-% URL~\url{https://www.ctan.org/pkg/xcolor/}.
-%
-% \bibitem[{Lehman et Wright(2018)}]{etoolbox}
-% Lehman, P. et J.~Wright. 2018,
-% {\selectlanguage{english}\emph{The etoolbox package}}.
-% URL~\url{https://www.ctan.org/pkg/etoolbox/}.
-%
-% \bibitem[{Malo(1996)}]{Malo:1996}
-% Malo, M. 1996, {\selectlanguage{french}\emph{Guide de la
-% communication écrite au cégep, à l'université et en
-% entreprise}}, Québec Amérique. ISBN~978-2-8903-7875-9.
-%
-% \bibitem[{Rahtz et Oberdiek(2017)}]{hyperref}
-% Rahtz, S. et H.~Oberdiek. 2017,
-% {\selectlanguage{english}\emph{Hypertext marks in {\LaTeX}: a
-% manual for hyperref}}.
-% URL~\url{https://www.ctan.org/pkg/hyperref/}.
-%
-% \bibitem[{Robertson et Hosny(2017)}]{fontspec}
-% Robertson, W. et K.~Hosny. 2017,
-% {\selectlanguage{english}\emph{The fontspec package: Font
-% selection for {\XeLaTeX} and {\LuaLaTeX}}}.
-% URL~\url{https://www.ctan.org/pkg/fontspec/}.
-%
-% \bibitem[{Wilson(2016)}]{memoir}
-% Wilson, P. 2016, {\selectlanguage{english}\emph{The Memoir Class
-% for Configurable Typesetting}}, 8{\ieme} éd., The Herries Press.
-% URL~\url{https://www.ctan.org/pkg/memoir/}, maintained by Lars
-% Madsen.
-% \end{thebibliography}
-% \PrintChanges
-% }
+% proposer des améliorations à la classe {\ulclass}.
+%
+% Pour de l'aide additionnelle sur l'utilisation de la classe~--- et
+% non sur celle de {\LaTeX} en général~--- écrivez à l'adresse %
+% \href{mailto:ulthese-aide@listes.ulaval.ca}{ulthese-aide@listes.ulaval.ca}.
%
% \appendix
%
@@ -1343,44 +1086,47 @@
% la \autoref{sec:utilisation:options} lorsque l'on souhaite créer une
% page de titre.
%
-% \begin{DescribeMacro}{multifacultaire}
-% Identifie une thèse multifacultaire. Valide uniquement avec un
-% grade de doctorat. Cette déclaration requiert ensuite d'utiliser
-% la commande \cmd{\faculteUL}.
-% \end{DescribeMacro}
-%
-% \begin{DescribeMacro}{extensionUdeS}
-% Identifie une thèse réalisée en extension à l'Université de
-% Sherbrooke. Valide uniquement avec un grade de doctorat. Cette
-% déclaration requiert ensuite d'utiliser les commandes
-% \cmd{\faculteUL} et \cmd{\faculteUdeS}.
-% \end{DescribeMacro}
-%
-% \begin{DescribeMacro}{extensionUQO}
-% Identifie une thèse réalisée en extension à l'Université du
-% Québec en Outaouais (UQO). Valide uniquement avec un grade de doctorat.
-% Cette déclaration requiert ensuite d'utiliser les commandes
-% \cmd{\faculteUL} et \cmd{\faculteUQO}.
-% \end{DescribeMacro}
-%
-% \begin{DescribeMacro}{extensionUQAC}
-% Identifie un mémoire réalisé en extension à l'Université du Québec
-% à Chicoutimi (UQAC). Valide uniquement avec un grade de maîtrise.
-% Cette déclaration requiert ensuite d'utiliser les commandes
-% \cmd{\faculteUL} et \cmd{\faculteUQAC}.
-% \end{DescribeMacro}
+% \begin{DescribeOption}{multifacultaire}
+% L'option |multifacultaire| identifie une thèse
+% multifacultaire. Valide uniquement avec un grade de doctorat.
+% Cette déclaration requiert ensuite d'utiliser la commande
+% \cmd{\faculteUL}.
+% \end{DescribeOption}
+%
+% \begin{DescribeOption}{extensionUdeS}
+% L'option |extensionUdeS| identifie une thèse réalisée en extension
+% à l'Université de Sherbrooke. Valide uniquement avec un grade de
+% doctorat. Cette déclaration requiert ensuite d'utiliser les
+% commandes \cmd{\faculteUL} et \cmd{\faculteUdeS}.
+% \end{DescribeOption}
+%
+% \begin{DescribeOption}{extensionUQO}
+% L'option |extensionUQO| identifie une thèse réalisée en extension
+% à l'Université du Québec en Outaouais (UQO). Valide uniquement
+% avec un grade de doctorat. Cette déclaration requiert ensuite
+% d'utiliser les commandes \cmd{\faculteUL} et \cmd{\faculteUQO}.
+% \end{DescribeOption}
+%
+% \begin{DescribeOption}{extensionUQAC}
+% L'option |extensionUQAC| identifie un mémoire réalisé en extension
+% à l'Université du Québec à Chicoutimi (UQAC). Valide uniquement
+% avec un grade de maîtrise. Cette déclaration requiert ensuite
+% d'utiliser les commandes \cmd{\faculteUL} et \cmd{\faculteUQAC}.
+% \end{DescribeOption}
%
% Ensuite, la composition d'une page de titre peut nécessiter
% d'utiliser les commandes ci-dessous en plus de celles de la
% \autoref{sec:utilisation:commandes}.
%
% \begin{DescribeMacro}{\annee}
-% Année du dépôt final de la thèse ou du mémoire.
+% La commande \cmdprint{\annee} spécifie l'année du dépôt final de
+% la thèse ou du mémoire.
% \end{DescribeMacro}
%
% \begin{DescribeMacro}{\univcotutelle}
-% Nom, ville et pays de l'université de cotutelle, déclarés sous la
-% forme
+% Pour les thèses en cotutelle, la commande
+% \cmdprint{\univcotutelle} permet de saisir le nom, la ville et le
+% pays de l'université de cotutelle, sous la forme
% \begin{quote}
% |\univcotutelle{Nom de l'université \\ Ville, Pays}|
% \end{quote}
@@ -1389,8 +1135,9 @@
% \end{DescribeMacro}
%
% \begin{DescribeMacro}{\gradecotutelle}
-% Grade conféré par l'université de cotutelle, déclaré
-% sous la forme
+% Pour les thèses en cotutelle, la commande
+% \cmdprint{\gradecotutelle} spécifie le grade conféré par
+% l'université de cotutelle, sous la forme
% \begin{quote}
% |\gradecotutelle{Nom du grade (sigle)}|
% \end{quote}
@@ -1399,8 +1146,9 @@
% \end{DescribeMacro}
%
% \begin{DescribeMacro}{\univbidiplomation}
-% Nom, ville et pays de l'université de bidiplomation, déclarés sous
-% la forme
+% Pour les mémoires en bidiplomation, la commande
+% \cmdprint{\univbidiplomation} permet de saisir le nom, la ville et
+% le pays de l'université de bidiplomation, sous la forme
% \begin{quote}
% |\univbidiplomation{Nom de l'université \\ Ville, Pays}|
% \end{quote}
@@ -1409,8 +1157,9 @@
% \end{DescribeMacro}
%
% \begin{DescribeMacro}{\gradebidiplomation}
-% Grade conféré par l'université de bidiplomation, déclaré sous la
-% forme
+% Pour les mémoires en bidiplomation, la commande
+% \cmdprint{\gradebidiplomation} spécifie le grade conféré par
+% l'université de bidiplomation, sous la forme
% \begin{quote}
% |\gradebidiplomation{Nom du grade (sigle)}|
% \end{quote}
@@ -1419,7 +1168,8 @@
% \end{DescribeMacro}
%
% \begin{DescribeMacro}{\faculteUL}
-% La commande a deux usages:
+% La commande \cmdprint{\faculteUL} sert à saisir deux types
+% d'informations:
% \begin{enumerate}
% \item noms des facultés pour les thèses et mémoires
% multifacultaires, séparés par des commandes |\\|;
@@ -1433,35 +1183,37 @@
% \end{DescribeMacro}
%
% \begin{DescribeMacro}{\faculteUdeS}
-% Nom de la faculté de l'Université de Sherbrooke hébergeant la
-% thèse en extension. Cette commande prend effet seulement lorsque
-% la classe est chargée avec l'option |extensionUdeS|.
+% La commande \cmdprint{\faculteUdeS} spécifie le nom de la faculté
+% de l'Université de Sherbrooke hébergeant la thèse en extension.
+% Cette commande prend effet seulement lorsque la classe est chargée
+% avec l'option |extensionUdeS|.
% \end{DescribeMacro}
%
% \begin{DescribeMacro}{\faculteUQO}
-% Nom de la faculté de l'Université du Québec en Outaouais
-% hébergeant la thèse en extension. Cette commande prend effet
-% seulement lorsque la classe est chargée avec l'option
-% |extensionUQO|.
+% La commande \cmdprint{\faculteUQO} spécifie le nom de la faculté
+% de l'Université du Québec en Outaouais hébergeant la thèse en
+% extension. Cette commande prend effet seulement lorsque la classe
+% est chargée avec l'option |extensionUQO|.
% \end{DescribeMacro}
%
% \begin{DescribeMacro}{\faculteUQAC}
-% Nom de la faculté de l'Université du Québec à Chicoutimi
-% hébergeant le mémoire en extension. Cette commande prend effet
-% seulement lorsque la classe est chargée avec l'option
-% |extensionUQAC|.
+% La commande \cmdprint{\faculteUQAC} spécifie le nom de la faculté
+% de l'Université du Québec à Chicoutimi hébergeant le mémoire en
+% extension. Cette commande prend effet seulement lorsque la classe
+% est chargée avec l'option |extensionUQAC|.
% \end{DescribeMacro}
%
% \begin{DescribeMacro}{\pagetitre}
-% Création de la page de titre. Ne pas utiliser la commande
-% \cmd{\pagetitle} de {\LaTeX} pour ce faire. De toutes les
+% La commande \cmdprint{\pagetitre} crée la page de titre à
+% l'endroit où elle apparait dans le code source. N'utilisez pas la
+% commande \cmd{\titlepage} de {\LaTeX} pour ce faire. De toutes les
% commandes ci-dessus, c'est la seule qui doit se trouver dans le
% corps du document plutôt que dans le préambule.
% \end{DescribeMacro}
%
+% \MaybeStop{\PrintChanges}
%
-% ^^A Début du code de la classe
-%
+% ^^A >>>>> Début du code de la classe
% \section{Mise en Å“uvre}
% \label{sec:meo}
%
@@ -1470,37 +1222,30 @@
% explorer comment la classe est programmée.
%
% \subsection{Tests et valeurs booléennes}
-% \changes{4.4}{2017-06-01}{Tests et valeurs booléennes réalisés sans ifthen.}
+% \changes{4.4}{2017-06-01}{Tests et valeurs booléennes réalisés sans
+% \textbf{ifthen}.}
%
-% Le paquetage \pkg{ifxetex} permet de tester si un document est
-% compilé avec \XeTeX.
-% \begin{macrocode}
-%<*class>
-\RequirePackage{ifxetex}
-% \end{macrocode}
% Nous définissons ici toutes les valeurs booléennes requises par la
% classe.
% \begin{macrocode}
+%<*class>
\newif\ifUL@babel \UL@babeltrue % charger babel?
\newif\ifUL@natbib \UL@natbibtrue % charger natbib?
\newif\ifUL@hyperref \UL@hyperreftrue % charger hyperref?
-\newif\ifUL@chapterbib \UL@chapterbibfalse % charger chapterbib?
-\newif\ifUL@sectionbib \UL@sectionbibfalse % option sectionbib de chapterbib?
-\newif\ifUL@isthesis % programme est une thèse?
-\newif\ifUL@iscotutelle \UL@iscotutellefalse % thèse en cotutelle?
+\newif\ifUL@isthesis % programme est une these?
+\newif\ifUL@iscotutelle \UL@iscotutellefalse % these en cotutelle?
\newif\ifUL@isexam \UL@isexamfalse % examen de doctorat?
-\newif\ifUL@isessay \UL@isessayfalse % essai de maîtrise?
+\newif\ifUL@isessay \UL@isessayfalse % essai de maitrise?
\newif\ifUL@isresearch \UL@isresearchfalse % projet de recherche?
\newif\ifUL@isworkterm \UL@isworktermfalse % rapport de stage?
\newif\ifUL@hassubtitle \UL@hassubtitlefalse % document a un sous-titre?
-\newif\ifUL@hastitlepage \UL@hastitlepagefalse % page titre utilisée?
+\newif\ifUL@hastitlepage \UL@hastitlepagefalse % page titre utilisee?
% \end{macrocode}
%
% \subsection{Options de la classe}
%
% Les grandes catégories d'options propres à la classe sont: la
-% possibilité d'empêcher le chargement du paquetage \pkg{natbib};
-% l'activation des bibliographies par chapitre ou par section; la
+% possibilité d'empêcher le chargement du paquetage \pkg{natbib}; la
% possibilité d'empêcher le chargement du paquetage \pkg{babel}; la
% possibilité d'empêcher le chargement du paquetage \pkg{hyperref}; la
% taille de la police de caractères en points; le type de grade; la
@@ -1516,21 +1261,6 @@
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{bibchapitre}
-% \begin{macro}{bibsection}
-% L'option |bibchapitre| entraine le chargement du paquetage
-% \pkg{chapterbib} qui permet de composer des bibliographies
-% multiples dans un document, habituellement une par
-% chapitre. Avec l'option |bibsection|, la bibliographie se
-% présente sous la forme d'une section plutôt que d'un chapitre.
-% La seconde option implique la première.
-% \begin{macrocode}
-\DeclareOption{bibchapitre}{\UL@chapterbibtrue}
-\DeclareOption{bibsection}{\UL@chapterbibtrue\UL@sectionbibtrue}
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-%
% \begin{macro}{nobabel}
% L'option |nobabel| permet d'empêcher la classe de charger le
% paquetage \pkg{babel}. Cette option peut s'avérer utile pour
@@ -1618,10 +1348,6 @@
\UL@isthesisfalse
\renewcommand*{\UL@typenum}{0}
\newcommand*{\UL@degree}{Ma\^itre en architecture (M.~Arch.)}}
-\DeclareOption{MA}{%
- \UL@isthesisfalse
- \renewcommand*{\UL@typenum}{0}
- \newcommand*{\UL@degree}{Ma\^itre \`es arts (M.A.)}}
\DeclareOption{LLM}{%
\UL@isthesisfalse
\renewcommand*{\UL@typenum}{0}
@@ -1634,14 +1360,10 @@
\UL@isthesisfalse
\renewcommand*{\UL@typenum}{0}
\newcommand*{\UL@degree}{Ma\^itre en musique (M.~Mus.)}}
-\DeclareOption{MPht}{%
- \UL@isthesisfalse
- \renewcommand*{\UL@typenum}{0}
- \newcommand*{\UL@degree}{Ma\^itre en physioth\'erapie (M.~Pht.)}}
-\DeclareOption{MSc}{%
+\DeclareOption{MPsEd}{%
\UL@isthesisfalse
\renewcommand*{\UL@typenum}{0}
- \newcommand*{\UL@degree}{Ma\^itre \`es sciences (M.~Sc.)}}
+ \newcommand*{\UL@degree}{Ma\^itre en psycho\'education (M.~Ps.~\'ed.)}}
\DeclareOption{MScGeogr}{%
\UL@isthesisfalse
\renewcommand*{\UL@typenum}{0}
@@ -1650,10 +1372,18 @@
\UL@isthesisfalse
\renewcommand*{\UL@typenum}{0}
\newcommand*{\UL@degree}{Ma\^itre en service social (M.~Serv.~soc.)}}
-\DeclareOption{MPsEd}{%
+\DeclareOption{MTravSoc}{%
\UL@isthesisfalse
\renewcommand*{\UL@typenum}{0}
- \newcommand*{\UL@degree}{Ma\^itre en psycho\'education (M.~Ps.~\'ed.)}}
+ \newcommand*{\UL@degree}{Ma\^itre en travail social (M.~Trav.~soc.)}}
+\DeclareOption{MA}{%
+ \UL@isthesisfalse
+ \renewcommand*{\UL@typenum}{0}
+ \newcommand*{\UL@degree}{Ma\^itre \`es arts (M.A.)}}
+\DeclareOption{MSc}{%
+ \UL@isthesisfalse
+ \renewcommand*{\UL@typenum}{0}
+ \newcommand*{\UL@degree}{Ma\^itre \`es sciences (M.~Sc.)}}
\DeclareOption{multifacultaire}{%
\ifUL@isthesis
\renewcommand*{\UL@typenum}{1}
@@ -1761,7 +1491,7 @@
% \end{macrocode}
% \end{macro}
%
-% \subsection{Chargement de la classe \class{memoir}}
+% \subsection{Chargement de la classe \texorpdfstring{\class{memoir}}{memoir}}
%
% Toutes les options de la classe sont passées à \class{memoir}. Le
% format de papier et la taille de police par défaut sont, dans
@@ -1787,51 +1517,50 @@
% \end{macrocode}
%
% \subsection{Paquetages requis}
-% \changes{5.0}{2018-06-10}{Le paquetage unicode-math n'est plus
-% chargé par défaut par la classe.}
-% \changes{5.0}{2018-08-11}{Le paquetage hyperref est désormais chargé
-% dans la classe plutôt que dans les gabarits. Requiert le paquetage
-% etoolbox.}
+% \changes{5.0}{2018-06-10}{Le paquetage \textbf{unicode-math} n'est
+% plus chargé par défaut par la classe.}
+% \changes{5.0}{2018-08-11}{Le paquetage \textbf{hyperref} est
+% désormais chargé dans la classe plutôt que dans les gabarits.
+% Requiert le paquetage etoolbox.}
%
% La classe s'efforce de charger un minimum de paquetages afin d'éviter
% les conflits potentiels.
%
-% {\XeLaTeX} requiert le paquetage \pkg{fontspec} pour le traitement
-% des polices. Sous {\LaTeX}, il est aujourd'hui préférable d'utiliser
-% les polices T1.
+% \changes{6.0}{2024-05-24}{Mise en Å“uvre: paquetage \textbf{inputenc} ^^A
+% désormais chargé avec l'option \texttt{utf8} lorsque la compilation
+% est effectuée par pdf{\LaTeX}.}
+% Le code source doit obligatoirement être enregistré dans le codage
+% UTF-8. Avec pdf{\LaTeX}, cela requiert le paquetage \pkg{inputenc}.
+%
+% \changes{6.0}{2024-05-24}{Mise en Å“uvre: paquetage
+% \textbf{microtype} désormais chargé par la classe avec
+% \textbf{fontspec} ou \textbf{fontenc}.}
+% \changes{6.0}{2024-05-24}{Mise en Å“uvre: option \texttt{Ligatures} ^^A
+% plus définie par défaut pour les polices OpenType.}
+% La classe charge également les paquetages minimalement nécessaires
+% pour la gestion des polices de caractères, soit \pkg{fontspec} avec
+% les moteurs modernes et \pkg{fontenc} avec pdf{\LaTeX}.
% \begin{macrocode}
-\ifxetex
+\iftutex
+ \RequirePackage[babel=true]{microtype}
\RequirePackage{fontspec}
- \defaultfontfeatures{Ligatures=TeX}
\else
+ \RequirePackage[babel=true]{microtype}
+ \RequirePackage[utf8]{inputenc}
\RequirePackage[T1]{fontenc}
\fi
% \end{macrocode}
%
-% Les paquetages \pkg{natbib} et \pkg{chapterbib} doivent être chargés
-% avant \pkg{babel} pour bien fonctionner, le cas échéant. Tel que
-% précisé dans la documentation de \pkg{natbib}, l'option |sectionbib|
-% est passée à ce paquetage lorsqu'il est chargé, ou à
-% \pkg{chapterbib} autrement.
+% Le paquetage \pkg{natbib} doit être chargé avant \pkg{babel} pour
+% bien fonctionner, le cas échéant.
% \begin{macrocode}
\ifUL@natbib
- \ifUL@sectionbib
- \PassOptionsToPackage{sectionbib}{natbib}
- \fi
\RequirePackage[round,semicolon,authoryear]{natbib}
\fi
-\ifUL@chapterbib
- \ifUL@sectionbib
- \ifUL@natbib\else
- \PassOptionsToPackage{sectionbib}{chapterbib}
- \fi
- \fi
- \RequirePackage{chapterbib}
-\fi
% \end{macrocode}
%
% Le support pour les langues autres que l'anglais est offert par le
-% paquetage \pkg{babel} --- à moins que l'option |nobabel| n'ait
+% paquetage \pkg{babel}~--- à moins que l'option |nobabel| n'ait
% été spécifiée au chargement de la classe. Les langues sont passées
% en option de la classe, et non du paquetage. Le paquetage
% \pkg{numprint} est requis par \pkg{babel} pour la définition
@@ -1844,14 +1573,16 @@
% \end{macrocode}
%
% Le paquetage obligatoire \pkg{hyperref} est chargé en tout dernier
-% avec la commande \cmd{\AtEndPreamble} du paquetage \pkg{etoolbox}.
-% Si l'option |nohyperref| a été spécifiée, la classe vérifie que le
-% paquetage a été chargé. La configuration de base de la classe fait
-% en sorte que tous les liens sont signalés par la couleur
-% |ULlinkcolor| définie à la \autoref{sec:couleurs}.
+% avec la commande \cmd{\AtEndPreamble} du paquetage \pkg{etoolbox}
+% (chargé par \class{memoir}). Si l'option |nohyperref| a été
+% spécifiée, la classe vérifie que le paquetage a été chargé. La
+% configuration de base de la classe fait en sorte que tous les liens
+% sont signalés par la couleur |ULlinkcolor| définie à la
+% \autoref{sec:couleurs}.
+% \changes{6.0}{2024-06-17}{Mise en Å“uvre: chargement explicite de
+% \textbf{etoolbox} retiré, car le paquetage est chargé par memoir.}
% \begin{macrocode}
\ifUL@hyperref
- \RequirePackage{etoolbox}
\AtEndPreamble{\RequirePackage{hyperref}}
\else
\AtBeginDocument{%
@@ -1870,11 +1601,8 @@
\RequirePackage{xcolor}
% \end{macrocode}
%
-% La commande \cmd{\textcopyright} utilisée sur la page de titre requiert le
-% paquetage \pkg{textcomp} pour obtenir un beau signe de copyright.
-% \begin{macrocode}
-\RequirePackage{textcomp}
-% \end{macrocode}
+% \changes{6.0}{2024-06-17}{Mise en Å“uvre: paquetage \textbf{textcomp} ^^A
+% retiré, car non nécessaire.}
%
% \subsection{Paquetage incompatible}
%
@@ -1926,7 +1654,7 @@
% \subsection{Interligne}
%
% L'espacement entre les lignes est d'un interligne et demi.
-% L'espacement «double» entre les paragraphes est fixé à
+% L'espacement double entre les paragraphes est fixé à
% |0.5\baselineskip| afin d'en arriver à une disposition agréable à
% l'œil. Le retrait de première ligne est supprimé puisque plus
% nécessaire suite à l'ajout de l'espacement entre les paragraphes.
@@ -1968,11 +1696,15 @@
% utilisées dans la classe sont toutes quelques points inférieures à
% celles des gabarits Word.}%
% et les graisses présentées au \autoref{tab:polices}. La
-% déclaration |\fontencoding{T1}| est nécessaire avec {\XeLaTeX} pour
-% explicitement charger la même police que sous {\LaTeX}.
+% déclaration |\fontencoding{T1}| est nécessaire avec les moteurs
+% modernes pour explicitement charger la même police qu'avec
+% pdf{\LaTeX}.
%
% \begin{table}
% \centering
+% \caption{Tailles et graisses de la police Helvetica des éléments
+% de la page de titre}
+% \label{tab:polices}
% \begin{tabular}{ll}
% \toprule
% Élément & Police \\
@@ -1984,9 +1716,6 @@
% Autres éléments & 12~points normal \\
% \bottomrule
% \end{tabular}
-% \caption{Tailles et graisses de la police Helvetica des éléments
-% de la page de titre}
-% \label{tab:polices}
% \end{table}
%
% \begin{macrocode}
@@ -2435,22 +2164,30 @@
\setsecnumdepth{subsection}
%</class>
% \end{macrocode}
-% ^^A Fin du code de la classe
+% ^^A <<<<< Fin du code de la classe
%
-% ^^A Il faut placer ces notes de changement relatives aux gabarits
+% ^^A Les notes de versions relatives aux gabarits doivent se trouver
% ^^A avant \Finale
% \changes{5.0}{2018-06-08}{Gabarits: meilleure indication du texte à
-% remplacer.}
+% remplacer.}
% \changes{5.0}{2018-06-08}{Gabarits: bonification de la structure
-% d'un chapitre de thèse ou de mémoire par articles.}
+% d'un chapitre de thèse ou de mémoire par articles.}
% \changes{5.0}{2018-04-25}{Gabarits: ajout d'étiquettes et de renvois
-% dans les gabarits des parties du document.}
+% dans les gabarits des parties du document.}
% \changes{5.0}{2018-04-25}{Gabarits: automatisation de l'ajout
-% d'entrées dans la table des matières à l'aide d'étiquettes et de
-% renvois.}
+% d'entrées dans la table des matières à l'aide d'étiquettes et de
+% renvois.}
% \changes{4.4}{2017-05-16}{Gabarits: nouveau gabarit pour une thèse
-% par articles.}
+% par articles.}
% \changes{4.2}{2016-03-29}{Gabarits: nouvelles options de babel.}
+% \changes{6.0}{2024-05-22}{Gabarits: gabarits pour une thèse par
+% articles révisés suite aux changements aux règles de présentation.}
+% \changes{6.0}{2024-05-22}{Gabarits: meilleure sélection automatique
+% des paquetages pour les polices et pour le codage selon le moteur
+% {\TeX}.}
+% \changes{6.0}{2024-06-20}{Gabarits: seul l'exemple de changement
+% pour les polices STIX Two est maintenant fourni, et ce, dans une
+% version qui fonctionne avec les polices livrées avec TeX Live.}
%
% \Finale
%
@@ -2473,60 +2210,57 @@
%% description détaillée de la classe, de ce gabarit et des options
%% disponibles.
%%
+%% Vous devez obligatoirement enregistrer tout fichier contenant des
+%% caractères non-ASCII (comme des lettres accentuées) dans le codage
+%% de caractères UTF-8.
+%%
%% [Ne pas hésiter à supprimer les commentaires après les avoir lus.]
%%
%% Déclaration de la classe avec le type de grade
%<phd>%% [l'un de LLD, DMus, DPsy, DThP, PhD]
-%<m>%% [l'un de MATDR, MArch, MA, LLM, MErg, MMus, MPht, MSc, MScGeogr,
-%<m>%% MServSoc, MPsEd]
+%<m>%% [l'un de MATDR, MArch, LLM, MErg, MMus, MPsEd, MScGeogr,
+%<m>%% MServSoc, MTravSoc, MA, MSc]
%% et les langues les plus courantes. Le français sera la langue par
-%<!articles>%% défaut du document.
-%<articles>%% défaut du document. L'option 'bibsection' permet de créer des
-%<articles>%% bibliographies par chapitre présentées sous forme de section
-%<articles>%% numérotée.
-%<phd&standard>\documentclass[PhD,english,french]{ulthese}
-%<phd&articles>\documentclass[PhD,bibsection,english,french]{ulthese}
+%% défaut du document.
+%<phd&(standard|articles)>\documentclass[PhD,english,french]{ulthese}
%<phd&cotutelle>\documentclass[PhD,cotutelle,english,french]{ulthese}
-%<m&standard>\documentclass[MSc,english,french]{ulthese}
-%<m&articles>\documentclass[MSc,bibsection,english,french]{ulthese}
+%<m&(standard|articles)>\documentclass[MSc,english,french]{ulthese}
%<m&bidiplomation>\documentclass[MA,bidiplomation,english,french]{ulthese}
- %% Encodage utilisé pour les caractères accentués dans les fichiers
- %% source du document. Les gabarits sont encodés en UTF-8. Inutile
- %% avec XeLaTeX, qui gère Unicode nativement.
- \ifxetex\else \usepackage[utf8]{inputenc} \fi
-
%% Charger ici les autres paquetages nécessaires pour le document.
%% Quelques exemples; décommenter au besoin.
%\usepackage{amsmath} % recommandé pour les mathématiques
%\usepackage{icomma} % gestion de la virgule dans les nombres
- %% Utilisation d'une autre police de caractères pour le document.
- %% - Sous LaTeX
- %\usepackage{mathpazo} % texte et mathématiques en Palatino
- %\usepackage{mathptmx} % texte et mathématiques en Times
- %% - Sous XeLaTeX
- %\setmainfont{TeX Gyre Pagella} % texte en Pagella (Palatino)
- %\setmathfont{TeX Gyre Pagella Math} % mathématiques en Pagella (Palatino)
- %\setmainfont{TeX Gyre Termes} % texte en Termes (Times)
- %\setmathfont{TeX Gyre Termes Math} % mathématiques en Termes (Times)
+ %% Utilisation d'une autre police de caractères pour le document
+ %% (exemple pour les polices STIX Two incluses dans TeX Live).
+ %% - Avec pdfLaTeX
+ %\usepackage{stix2}
+ %% - Avec XeLaTeX
+ %\setmainfont{STIXTwoText}
+ %[
+ % Extension = .otf,
+ % UprightFont = *-Regular,
+ % BoldFont = *-SemiBold,
+ % ItalicFont = *-Italic,
+ % BoldItalicFont = *-SemiBoldItalic,
+ %]
+ %\setmathfont{STIXTwoMath-Regular}
+ %[
+ % Extension = .otf,
+ %]
%% Options de mise en forme du mode français de babel. Consulter la
- %% documentation du paquetage babel pour les options disponibles.
- %% Désactiver (effacer ou mettre en commentaire) si l'option
- %% 'nobabel' est spécifiée au chargement de la classe.
- \frenchbsetup{%
+ %% documentation du paquetage babel-french pour les options
+ %% disponibles. Désactiver (effacer ou mettre en commentaire) si
+ %% l'option 'nobabel' est spécifiée au chargement de la classe.
+ \frenchsetup{%
StandardItemizeEnv=true, % format standard des listes
ThinSpaceInFrenchNumbers=true, % espace fine dans les nombres
og=«, fg=» % caractères « et » sont les guillemets
}
-%<!articles> %% Style de la bibliographie.
-%<!articles> \bibliographystyle{}
-%<articles> %% Suppression du numéro de section de la bibliographie. Utilisation
-%<articles> %% de \extrasfrench parce que c'est la dernière langue déclarée dans
-%<articles> %% \documentclass, ci-dessus.
-%<articles> %\addto\extrasfrench{%
-%<articles> % \renewcommand{\bibsection}{\section*{\bibname}\prebibhook}}
+ %% Style de la bibliographie.
+ \bibliographystyle{}
%% Composition de la page frontispice. Remplacer les éléments entre < >.
%% Supprimer les caractères < >. Couper un long titre ou un long
@@ -2561,19 +2295,19 @@
\frontmatter % pages liminaires
-\frontispice % production de la page frontispice
+\frontispice % page frontispice (obligatoire)
-\include{resume} % résumé français
-\include{abstract} % résumé anglais
+\include{resume} % résumé français (obligatoire)
+\include{abstract} % résumé anglais (optionnel)
\cleardoublepage
-\tableofcontents % production de la TdM
+\tableofcontents % table des matières (obligatoire)
\cleardoublepage
-\listoftables % production de la liste des tableaux
+\listoftables % liste des tableaux
\cleardoublepage
-\listoffigures % production de la liste des figures
+\listoffigures % liste des figures
\cleardoublepage
\dedicace{<Dédicace si désiré>}
@@ -2583,7 +2317,8 @@
\cleardoublepage
\include{remerciements} % remerciements
-\include{avantpropos} % avant-propos
+%<!articles>\include{avantpropos} % avant-propos (optionnel)
+%<articles>\include{avantpropos} % avant-propos (obligatoire)
\mainmatter % corps du document
@@ -2598,8 +2333,7 @@
\include{annexe} % annexe A
-%<!articles>\bibliography{} % production de la bibliographie
-%<!articles>
+\bibliography{} % production de la bibliographie
\end{document}
%</gabarit>
%
@@ -2637,8 +2371,8 @@
\label{chap-avantpropos} % étiquette pour renvois
\phantomsection\addcontentsline{toc}{chapter}{\nameref{chap-avantpropos}} % inclure dans TdM
-<Texte de l'avant-propos. Obligatoire dans une thèse ou un mémoire par
-articles.>
+<Texte de l'avant-propos. Obligatoire seulement pour une thèse ou un
+mémoire par intégration d'articles.>
%</avantpropos>
%
%<*introduction>
@@ -2669,8 +2403,6 @@ normal, sauf qu'elle n'est pas numérotée.>
%<articles>
<Texte du chapitre ou de l'article.>
%<articles>
-%<articles>\bibliographystyle{} % style de la bibliographie
-%<articles>\bibliography{} % production de la bibliographie
%</chapitre>
%
%<*conclusion>
diff --git a/Master/texmf-dist/source/latex/ulthese/ulthese.ins b/Master/texmf-dist/source/latex/ulthese/ulthese.ins
index 7987a0f368c..59e03576625 100644
--- a/Master/texmf-dist/source/latex/ulthese/ulthese.ins
+++ b/Master/texmf-dist/source/latex/ulthese/ulthese.ins
@@ -1,44 +1,34 @@
-%%
-%% Copyright (C) 2017 Universite Laval
-%%
-%% This file 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:
-%%
-%% http://www.latex-project.org/lppl.txt
-%%
-%% and version 1.3c or later is part of all distributions of LaTeX
-%% version 2006/05/20 or later.
-%%
+%% Procédure d'installation de la classe ulthese.cls et des gabarits à
+%% partir de ulthese.dtx
\input docstrip.tex
\keepsilent
\askforoverwritefalse
+\nopostamble
\preamble
This is a generated file.
-Copyright (C) 2017 Universite Laval
+Copyright (C) 2012-2024 Universite Laval
This file 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:
- http://www.latex-project.org/lppl.txt
+ https://www.latex-project.org/lppl.txt
and version 1.3c or later is part of all distributions of LaTeX
version 2006/05/20 or later.
This work has the LPPL maintenance status `maintained'.
-The Current Maintainer of this work is Universite Laval
-<ulthese-dev@bibl.ulaval.ca>.
+The Current Maintainer of this work is Vincent Goulet for
+Universite Laval <ulthese-dev@bibl.ulaval.ca>.
-This work consists of the files ulthese.dtx and ulthese.ins and the
-derived files listed in the README.md file.
+This work consists of the files ulthese.dtx, ulthese.ins, and the
+derived files listed in the file README.md.
\endpreamble
@@ -83,17 +73,18 @@ derived files listed in the README.md file.
\obeyspaces
\Msg{*************************************************************}
\Msg{* *}
-\Msg{* La classe ulthese est maintenant prete a l'emploi. *}
+\Msg{* La classe ulthese est maintenant prête à l'emploi! *}
\Msg{* *}
-\Msg{* Utiliser un gabarit comme base pour votre fichier maitre. *}
-\Msg{* Vous pouvez effacer les gabarits inutiles. Composer le *}
-\Msg{* document dans des fichiers .tex distincts; quelques *}
-\Msg{* gabarits sont fournis avec la classe. *}
+\Msg{* Utilisez un des gabarits fournis avec la classe comme *}
+\Msg{* base pour votre fichier maitre. Vous pouvez effacer les *}
+\Msg{* gabarits inutiles. Composez le document dans des fichiers *}
+\Msg{* .tex distincts; quelques gabarits sont aussi fournis avec *}
+\Msg{* la classe. *}
\Msg{* *}
\Msg{* Pour produire la documentation de la classe, compiler le *}
-\Msg{* fichier ulthese.dtx avec LaTeX. *}
+\Msg{* fichier ulthese.dtx avec XeLaTeX. *}
\Msg{* *}
-\Msg{* Bonne redaction! *}
+\Msg{* Bonne rédaction! *}
\Msg{* *}
\Msg{*************************************************************}
diff --git a/Master/texmf-dist/source/latex/ut-thesis/ut-thesis.dtx b/Master/texmf-dist/source/latex/ut-thesis/ut-thesis.dtx
index 873f0bd2c59..9d6a7041485 100644
--- a/Master/texmf-dist/source/latex/ut-thesis/ut-thesis.dtx
+++ b/Master/texmf-dist/source/latex/ut-thesis/ut-thesis.dtx
@@ -5,7 +5,7 @@
%<class>\NeedsTeXFormat{LaTeX2e}[1999/12/01]
%<class>\ProvidesClass{ut-thesis}
%<*class>
-[2023/02/08 v3.1.7 University of Toronto thesis class]
+[2024/07/26 v3.1.8 University of Toronto thesis class]
%</class>
%
%<*driver>
@@ -33,15 +33,15 @@
% \GetFileInfo{ut-thesis.dtx}
%
% \title{The \textit{ut-thesis} class
-% \thanks{\fileversion~[\filedate] CTAN repository:
-% \href{https://ctan.org/pkg/ut-thesis}
-% {\texttt{https://ctan.org/pkg/ut-thesis}}}}
+% \thanks{\fileversion~[\filedate]\hfill
+% \href{https://ctan.org/pkg/ut-thesis}{\texttt{https://ctan.org/pkg/ut-thesis}}\hfill
+% \href{https://github.com/jessexknight/ut-thesis}{\texttt{github.com/jessexknight/ut-thesis}}}}
% \author{
% Francois Pitt,
% Jesse Knight
% \thanks{maintainer, contact:
-% \href{mailto:jesse.knight@mail.utoronto.ca}
-% {\texttt{jesse.knight@mail.utoronto.ca}}}
+% \href{mailto:jesse.x.knight@protonmail.com}
+% {\texttt{jesse.x.knight@protonmail.com}}}
% }
%
% \maketitle
@@ -79,7 +79,7 @@
%
% The default options produce a final copy, ready for submission to
% the University of Toronto School of Graduate Studies (SGS).
-% Some examples are available on
+% There is some example code on
% \href{https://github.com/jessexknight/ut-thesis/tree/master/test}{GitHub}.
%
% \subsection{Options}\label{use:opt}
@@ -616,4 +616,4 @@
\setlength\belowcaptionskip{1ex}
% \end{macrocode}
%
-\endinput \ No newline at end of file
+\endinput
diff --git a/Master/texmf-dist/source/latex/ut-thesis/ut-thesis.ins b/Master/texmf-dist/source/latex/ut-thesis/ut-thesis.ins
index db350551150..80df67d81ee 100644
--- a/Master/texmf-dist/source/latex/ut-thesis/ut-thesis.ins
+++ b/Master/texmf-dist/source/latex/ut-thesis/ut-thesis.ins
@@ -11,8 +11,8 @@ as of Fall 2020:
[https://www.sgs.utoronto.ca/academic-progress/program-completion/formatting]
Copyright (c) 1998-2013 Francois Pitt <fpitt@cs.utoronto.ca>,
- 2020-2021 Jesse Knight <jesse.knight@mail.utoronto.ca>
-last updated at 23:30 (EST) on Tue 20 July 2021
+ 2020-2024 Jesse Knight <jesse.x.knight@protonmail.com>
+last updated at 09:00 (BST) on Fri 26 July 2024
This work may be distributed and/or modified under the conditions of
the LaTeX Project Public Licence, either version 1.3c of this licence
@@ -28,7 +28,7 @@ and is not covered by the licence.
This work has the LPPL maintenance status "maintained".
The Current Maintainer of this work is
-Jesse Knight <jesse.knight@mail.utoronto.ca>.
+Jesse Knight <jesse.x.knight@protonmail.com>.
This work consists of the files:
- README
@@ -37,12 +37,13 @@ This work consists of the files:
- ut-thesis.pdf (derived user manual)
- ut-thesis.cls (derived class file)
-To generate ut-thesis.cls (class file), run: pdflatex ut-thesis.ins
-To generate ut-thesis.pdf (documentation), run: pdflatex ut-thesis.dtx
-To use the class, make ut-thesis.cls visible to your LaTeX distribution,
-by placing ut-thesis.cls either in your working directory,
-or in your texmf tree, perhaps: $texmf/tex/latex/ut-thesis/ut-thesis.cls
-and the documentation: $texmf/doc/latex/ut-thesis/ut-thesis.pdf
+Install ut-thesis from your favourite LaTeX distribution.
+Alternatively, or to use the latest version:
+- generate ut-thesis.cls (class file) using: pdflatex ut-thesis.ins
+ and copy to: $texmf/tex/latex/ut-thesis/ut-thesis.cls
+- generate ut-thesis.pdf (documentation) using: pdflatex ut-thesis.dtx
+ and copy to: $texmf/doc/latex/ut-thesis/ut-thesis.pdf
+or simply copy ut-thesis.cls to your working directory.
See version history on GitHub:
[https://github.com/jessexknight/ut-thesis]
@@ -51,4 +52,4 @@ See version history on GitHub:
\generate{\file{ut-thesis.cls}{\from{ut-thesis.dtx}{class}}}
-\endbatchfile \ No newline at end of file
+\endbatchfile
diff --git a/Master/texmf-dist/source/latex/zref-clever/zref-clever.dtx b/Master/texmf-dist/source/latex/zref-clever/zref-clever.dtx
index 9c1d73a5a2b..155d7141eee 100644
--- a/Master/texmf-dist/source/latex/zref-clever/zref-clever.dtx
+++ b/Master/texmf-dist/source/latex/zref-clever/zref-clever.dtx
@@ -171,7 +171,7 @@
%
% Identify the package.
% \begin{macrocode}
-\ProvidesExplPackage {zref-clever} {2024-05-20} {0.4.5}
+\ProvidesExplPackage {zref-clever} {2024-08-23} {0.4.6}
{Clever LaTeX cross-references based on zref}
% \end{macrocode}
%
@@ -374,19 +374,34 @@
% there is no possible verification mechanism for this.
%
%
-% \begin{macro}[EXP]{\@@_get_enclosing_counters_value:n}
-% Recursively generate a \emph{sequence} of ``enclosing counters'' values,
-% for a given \meta{counter} and leave it in the input stream. This
-% function must be expandable, since it gets called from \cs{zref@newprop}
-% and is the one responsible for generating the desired information when
-% the label is being set. Note that the order in which we are getting this
-% information is reversed, since we are navigating the counter reset chain
-% bottom-up. But it is very hard to do otherwise here where we need
-% expandable functions, and easy to handle at the reading side.
+% \begin{macro}[EXP]
+% {
+% \@@_get_enclosing_counters:n ,
+% \@@_get_enclosing_counters_value:n ,
+% }
+% Recursively generate a \emph{sequence} of ``enclosing counters'' and
+% values, for a given \meta{counter} and leave it in the input stream.
+% These functions must be expandable, since they get called from
+% \cs{zref@newprop} and are the ones responsible for generating the desired
+% information when the label is being set. Note that the order in which we
+% are getting this information is reversed, since we are navigating the
+% counter reset chain bottom-up. But it is very hard to do otherwise here
+% where we need expandable functions, and easy to handle at the reading
+% side.
% \begin{syntax}
+% \cs{@@_get_enclosing_counters:n} \Arg{counter}
% \cs{@@_get_enclosing_counters_value:n} \Arg{counter}
% \end{syntax}
% \begin{macrocode}
+\cs_new:Npn \@@_get_enclosing_counters:n #1
+ {
+ \cs_if_exist:cT { c@ \@@_counter_reset_by:n {#1} }
+ {
+ { \@@_counter_reset_by:n {#1} }
+ \@@_get_enclosing_counters:e
+ { \@@_counter_reset_by:n {#1} }
+ }
+ }
\cs_new:Npn \@@_get_enclosing_counters_value:n #1
{
\cs_if_exist:cT { c@ \@@_counter_reset_by:n {#1} }
@@ -406,16 +421,18 @@
% Gregorio}, aka `egreg' at
% \url{https://tex.stackexchange.com/q/611370/#comment1529282_611385}).
% \begin{macrocode}
+\cs_generate_variant:Nn \@@_get_enclosing_counters:n { e }
\cs_generate_variant:Nn \@@_get_enclosing_counters_value:n { e }
% \end{macrocode}
% \end{macro}
%
%
% \begin{macro}[EXP]{\@@_counter_reset_by:n}
-% Auxiliary function for \cs{@@_get_enclosing_counters_value:n}, and useful
-% on its own standing. It is broken in parts to be able to use the
-% expandable mapping functions. \cs{@@_counter_reset_by:n} leaves in the
-% stream the ``enclosing counter'' which resets \meta{counter}.
+% Auxiliary function for \cs{@@_get_enclosing_counters:n} and
+% \cs{@@_get_enclosing_counters_value:n}, and useful on its own standing.
+% It is broken in parts to be able to use the expandable mapping functions.
+% \cs{@@_counter_reset_by:n} leaves in the stream the ``enclosing counter''
+% which resets \meta{counter}.
% \begin{syntax}
% \cs{@@_counter_reset_by:n} \Arg{counter}
% \end{syntax}
@@ -461,6 +478,14 @@
\zref@addprop \ZREF@mainlist { zc@enclval }
% \end{macrocode}
%
+% The \texttt{zc@enclcnt} property is provided for the purpose of easing the
+% debugging of counter reset chains, thus it is not added \texttt{main}
+% property list by default.
+% \begin{macrocode}
+\zref@newprop { zc@enclcnt }
+ { \@@_get_enclosing_counters:e \l_@@_current_counter_tl }
+% \end{macrocode}
+%
%
% Another piece of information we need is the page numbering format being used
% by \cs{thepage}, so that we know when we can (or not) group a set of page
@@ -3883,37 +3908,70 @@
%
% \cs{l_@@_counter_resetters_seq} is used by \cs{@@_counter_reset_by:n} to
% populate the \texttt{zc@enclval} property, and stores the list of counters
-% which are potential ``enclosing counters'' for other counters. This option
-% is constructed such that users can only \emph{add} items to the variable.
-% There would be little gain and some risk in allowing removal, and the syntax
-% of the option would become unnecessarily more complicated. Besides, users
-% can already override, for any particular counter, the search done from the
-% set in \cs{l_@@_counter_resetters_seq} with the \opt{counterresetby} option.
+% which are potential ``enclosing counters'' for other counters.
+%
+% Note that, as far as \LaTeX{} is concerned, a given counter can be reset by
+% \emph{any number of counters}. \cs{counterwithin} just adds a new
+% ``within-counter'' for ``counter'' without removing any other existing ones.
+% However, the data structure of \pkg{zref-clever} can only account for
+% \emph{one} enclosing counter. In a way, this is hard to circumvent, because
+% the underlying counter reset behavior works ``top-down'', but when looking
+% to a label built from a given counter we need to infer the enclosing
+% counters ``bottom-up''. As a result, the reset chain we find is path
+% dependent or, more formally, what \cs{@@_counter_reset_by:n} returns depends
+% on the order in which it searches the list of
+% \cs{l_@@_counter_resetters_seq}, since it stops on the first match. This
+% representation mismatch should not be a problem in most cases. But one
+% should be aware of the limits it imposes.
+%
+% Consider the following case: the \cls{book} class sets, by default
+% \texttt{figure} and \texttt{table} counters to be reset every
+% \texttt{chapter}, \texttt{section} is also reset every \texttt{chapter}, of
+% course. Suppose now we say
+% \cs{counterwithin}\texttt{\{figure\}\{section\}}. Technically,
+% \texttt{figure} is being reset every \texttt{section} and every
+% \texttt{chapter}, but since \texttt{section} is also reset every
+% \texttt{chapter}, the original ``\texttt{chapter} resets \texttt{figure}''
+% behavior is now redundant. Innocuous, but is still there. Now, suppose we
+% want to find which counter is resetting \texttt{figure} using
+% \cs{@@_counter_reset_by:n}. If \texttt{chapter} comes before
+% \texttt{section} in \cs{l_@@_counter_resetters_seq}, \texttt{chapter} will
+% be returned, and that's not what we want. That's the reason
+% \opt{counterresetters} initial value goes bottom-up in the sectioning level,
+% since we'd expect the nesting of the reset chain to \emph{typically} work
+% top-down.
+%
+% If, despite all this, unexpected results still ensue, users can take care to
+% ``clean'' redundant resetting settings with \cs{counterwithout}. Besides,
+% users can already override, for any particular counter, the search done from
+% the set in \cs{l_@@_counter_resetters_seq} with the \opt{counterresetby}
+% option.
+%
+% For the above reasons, since order matters, the \opt{counterresetters}
+% option can only be set by the full list of counters. In other words, users
+% wanting to change this should take the initial value as their starting base.
+%
+% The \texttt{zc@enclcnt} \pkg{zref} property, not included by default in the
+% \texttt{main} property list, is provided for the purpose of easing the
+% debugging of counter reset chains. So, by adding
+% \cs{zref@addprop}\texttt{\{main\}\{zc@enclcnt\}} you can inspect what the
+% values in the \texttt{zc@enclval} property correspond to.
%
% \begin{macrocode}
\seq_new:N \l_@@_counter_resetters_seq
\keys_define:nn { zref-clever/label }
{
counterresetters .code:n =
- {
- \clist_map_inline:nn {#1}
- {
- \seq_if_in:NnF \l_@@_counter_resetters_seq {##1}
- {
- \seq_put_right:Nn
- \l_@@_counter_resetters_seq {##1}
- }
- }
- } ,
+ { \seq_set_from_clist:Nn \l_@@_counter_resetters_seq {#1} } ,
counterresetters .initial:n =
{
- part ,
- chapter ,
- section ,
- subsection ,
- subsubsection ,
- paragraph ,
subparagraph ,
+ paragraph ,
+ subsubsection ,
+ subsection ,
+ section ,
+ chapter ,
+ part ,
},
counterresetters .value_required:n = true ,
}
@@ -7754,11 +7812,45 @@
% appendix to ``end'', but in this case, of course, we can hook into the
% environment instead.
%
+% For the record, \url{https://tex.stackexchange.com/a/724742} is of
+% interest.
+%
% \begin{macrocode}
\@@_compat_module:nn { appendix }
{
+ \newcounter { zc@appendix }
+ \cs_if_exist:cTF { chapter }
+ {
+ \@@_zcsetup:e
+ {
+ counterresetby =
+ {
+% \end{macrocode}
+% In case someone did something like
+% \texttt{\textbackslash{}counterwithin\{chapter\}\{part\}}. Harmless
+% otherwise.
+% \begin{macrocode}
+ zc@appendix = \@@_counter_reset_by:n { chapter } ,
+ chapter = zc@appendix ,
+ } ,
+ }
+ }
+ {
+ \cs_if_exist:cT { section }
+ {
+ \@@_zcsetup:e
+ {
+ counterresetby =
+ {
+ zc@appendix = \@@_counter_reset_by:n { section } ,
+ section = zc@appendix ,
+ } ,
+ }
+ }
+ }
\AddToHook { cmd / appendix / before }
{
+ \setcounter { zc@appendix } { 1 }
\@@_zcsetup:n
{
countertype =
@@ -7797,26 +7889,28 @@
{
\@@_if_package_loaded:nT { appendix }
{
- \newcounter { zc@appendix }
- \newcounter { zc@save@appendix }
- \setcounter { zc@appendix } { 0 }
- \setcounter { zc@save@appendix } { 0 }
- \cs_if_exist:cTF { chapter }
- {
- \@@_zcsetup:n
- { counterresetby = { chapter = zc@appendix } }
- }
- {
- \cs_if_exist:cT { section }
- {
- \@@_zcsetup:n
- { counterresetby = { section = zc@appendix } }
- }
- }
\AddToHook { env / appendices / begin }
{
- \stepcounter { zc@save@appendix }
- \setcounter { zc@appendix } { \value { zc@save@appendix } }
+% \end{macrocode}
+% Technically, the \env{appendices} environment can be called multiple times.
+% By default, successive calls keep track of numbering and start where the
+% previous one left off. Which means just setting the \texttt{zc@appendix}
+% counter to 1 is enough for things to work, since the distinction between the
+% calls and the sorting of their respective references will depend on the
+% underlying sectioning. \pkg{appendix}'s documentation however, provides a
+% way to restart from A at each call (by redefining \cs{restoreapp} to do
+% nothing). In this case, the references inside different calls to
+% \env{appendices} get to be identical in every way, including printed form,
+% counter value, enclosing counters, etc., despite being different. We could
+% keep track of different calls to \env{appendices} by having the
+% \texttt{zc@appendix} counter be ``stepped'' at each call. Doing so would
+% mean though that \cs{zcref} would distingish things which are typeset
+% identically, granting some arguably weird results. True, the user
+% \emph{can} change the printed form for each \env{appendices} call,
+% e.g. redefining \cs{thechapter}, but in this case, they are responsible for
+% keeping track of this.
+% \begin{macrocode}
+ \setcounter { zc@appendix } { 1 }
\@@_zcsetup:n
{
countertype =
@@ -7832,13 +7926,36 @@
}
\AddToHook { env / appendices / end }
{ \setcounter { zc@appendix } { 0 } }
- \AddToHook { cmd / appendix / before }
+ \newcounter { zc@subappendix }
+ \cs_if_exist:cTF { chapter }
{
- \stepcounter { zc@save@appendix }
- \setcounter { zc@appendix } { \value { zc@save@appendix } }
+ \@@_zcsetup:e
+ {
+ counterresetby =
+ {
+ zc@subappendix = \@@_counter_reset_by:n { section } ,
+ section = zc@subappendix ,
+ } ,
+ }
+ }
+ {
+ \@@_zcsetup:e
+ {
+ counterresetby =
+ {
+ zc@subappendix = \@@_counter_reset_by:n { subsection } ,
+ subsection = zc@subappendix ,
+ } ,
+ }
}
\AddToHook { env / subappendices / begin }
{
+% \end{macrocode}
+% The \env{subappendices} environment, on the other hand, appears not to
+% support multiple calls inside the same chapter/section (the counter is reset
+% by default). Either way, the same reasoning applies.
+% \begin{macrocode}
+ \setcounter { zc@subappendix } { 1 }
\@@_zcsetup:n
{
countertype =
@@ -7851,6 +7968,8 @@
} ,
}
}
+ \AddToHook { env / subappendices / end }
+ { \setcounter { zc@subappendix } { 0 } }
\msg_info:nnn { zref-clever } { compat-package } { appendix }
}
}
@@ -7977,10 +8096,13 @@
}
% \end{macrocode}
% \pkg{amsmath} does use \cs{refstepcounter} for the \texttt{equation} counter
-% throughout and does set \cs{@currentcounter} for \cs{tag}s. But we still
-% have to manually reset \opt{currentcounter} to default because, since we had
-% to manually set \opt{currentcounter} to \texttt{parentequation} in
-% \env{subequations}, we also have to manually set it to \env{equation} in
+% throughout and supposedly sets \cs{@currentcounter} for \cs{tag}s (I'm not
+% sure if it works in all environments, though. Once I tried to remove the
+% explicit \opt{currentcounter} setting and several labels to \cs{tag}s ended
+% up with type \texttt{section}. But I didn't investigate this further). But
+% we still have to manually reset \opt{currentcounter} to default because,
+% since we had to manually set \opt{currentcounter} to \texttt{parentequation}
+% in \env{subequations}, we also have to manually set it to \env{equation} in
% environments which may be used within it. The \env{xxalignat} environment
% is not included, because it is ``starred'' by default (i.e.\ unnumbered),
% and does not display or accepts labels or tags anyway. The \env{-ed}
@@ -8041,6 +8163,18 @@
% doing special handling inside \cs{zcref}, but the feature is very cool, so
% it's worth it.
%
+% Note that this support comes at a little cost. \opt{showonlyrefs} works by
+% setting a special \cs{MT@newlabel} for each label referenced with
+% \cs{eqref}. Now, \cs{eqref} is a specialized reference command, only used
+% to refer to equations, so it sets \cs{MT@newlabel} unconditionally on the
+% first run. \cs{zcref}, on the other hand, is a general purpose reference
+% command, used to reference labels of any type. But we wouldn't want to set
+% \cs{MT@newlabel} indiscriminately for all referenced labels in the document,
+% so we need to test for its type. Alas, the label must exist before its type
+% can be tested, thus we cannot set \cs{MT@newlabel} on the first run, only on
+% the second. In sum, since \cs{eqref} requires 3 runs to work, \cs{zcref}
+% needs 4.
+%
% \begin{macrocode}
\bool_new:N \l_@@_mathtools_loaded_bool
\@@_compat_module:nn { mathtools }
diff --git a/Master/texmf-dist/source/lualatex/innerscript/innerscript_code.dtx b/Master/texmf-dist/source/lualatex/innerscript/innerscript_code.dtx
index 6c900172b69..196a2285141 100644
--- a/Master/texmf-dist/source/lualatex/innerscript/innerscript_code.dtx
+++ b/Master/texmf-dist/source/lualatex/innerscript/innerscript_code.dtx
@@ -1,9 +1,9 @@
% \iffalse ---!!! FIRST META-COMMENT !!!---
%
%
-% This file is innerscript_code.dtx from version 1.2
+% This file is innerscript_code.dtx from version 1.3
% of the free and open-source LaTeX package "innerscript,"
-% released November 2023, to be used with the LuaTeX engine.
+% released August 2024, to be used with the LuaTeX engine.
%
% Running Plain TeX on innerscript_code.dtx will
% produce the following files:
@@ -37,11 +37,11 @@
% \iffalse ---!!! SECOND META-COMMENT !!!---
%
%
-% This file is from version 1.2 of the free and open-source
-% LaTeX package "innerscript," released November 2023, to be
+% This file is from version 1.3 of the free and open-source
+% LaTeX package "innerscript," released August 2024, to be
% used with the LuaTeX engine.
%
-% Copyright 2021, 2023 by Conrad Kosowsky
+% Copyright 2021, 2023, 2024 Conrad Kosowsky
%
% This file may be distributed and modified under the terms
% of the LaTeX Public Project License, version 1.3c or any
@@ -122,11 +122,11 @@
\askforoverwritefalse
\preamble
-This file is from version 1.2 of the free and open-source
-LaTeX package "innerscript," released November 2023, to be
+This file is from version 1.3 of the free and open-source
+LaTeX package "innerscript," released August 2024, to be
used with the LuaTeX engine.
-Copyright 2021, 2023 by Conrad Kosowsky
+Copyright 2021, 2023, 2024 Conrad Kosowsky
This file may be distributed and modified under the terms
of the LaTeX Public Project License, version 1.3c or any
@@ -249,7 +249,7 @@ Happy TeXing!
% We begin the implementation by declaring the package. The counts |\IS@script| and |\IS@scriptscript| and the conditionals |\ifIS@inner|, |\ifIS@close|, and |\ifIS@cover| encode package option information. For the counts, a value of 0 means no changes, a value of 1 means default spacing, and a value of 2 means legacy spacing.
% \begin{macrocode}
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{innerscript}[2023/11/06 v. 1.2 Package innerscript]
+\ProvidesPackage{innerscript}[2024/08/19 v. 1.3 Package innerscript]
\newcount\IS@script
\newcount\IS@scriptscript
\newif\ifIS@inner
@@ -284,7 +284,7 @@ Happy TeXing!
% \begin{macrocode}
\ifx\Umathordordspacing\@undefined
\bgroup
-\catcode`\+=12\relax
+\catcode`\ =12\relax
\def\IS@LuaTeXError{\GenericError{}%
{\MessageBreak\MessageBreak
Package innerscript error:%
@@ -364,8 +364,8 @@ press return.}}%
% \end{figure}
% \begin{macrocode}
\ifcase\IS@script % Case 0: No changes
- \IS@info{No changes to space for \string\scriptstyle\space atoms.}
- \IS@info{No changes to space for \string\crampedscriptstyle\space atoms.}
+ \IS@info{No space changes for \string\scriptstyle\space atoms.}
+ \IS@info{No space changes for \string\crampedscriptstyle\space atoms.}
\or % Case 1: Default changes
\IS@info{Adjusting space for \string\scriptstyle\space atoms.}
\IS@info{Adjusting space for \string\crampedscriptstyle\space atoms.}
@@ -575,8 +575,8 @@ press return.}}%
% \end{figure}
% \begin{macrocode}
\ifcase\IS@scriptscript % Case 0: No changes
- \IS@info{No changes to space for \string\scriptscriptstyle\space atoms.}
- \IS@info{No changes to space for
+ \IS@info{No space changes for \string\scriptscriptstyle\space atoms.}
+ \IS@info{No space changes for
\string\crampedscriptscriptstyle\space atoms.}
\or % Case 1: Default changes
\IS@info{Adjusting space for \string\scriptscriptstyle\space atoms.}
@@ -788,7 +788,7 @@ press return.}}%
% or the same with the \meta{atom} appearing after the |inner| or |ord|. The \meta{style} is one of the eight math style commands: |\displaystyle|, |\textstyle|, |\scriptstyle|, |\scriptscriptstyle|, and the cramped versions. Section~4 comes after Sections~2 and 3 because we make sure to capture all spacing changes in superscripts and subscripts.
% \begin{macrocode}
\ifIS@inner
- \IS@info{Adjusting space for \string\mathinner\space subformulas.}
+ \IS@info{Adjusting space around \string\mathinner\space subformulas.}
% \end{macrocode}
% First, we handle the cases where the first subformula is not |\mathinner| and the second subformula is |\mathinner|. We start with |\displaystyle|.
% \begin{macrocode}
@@ -1111,7 +1111,7 @@ press return.}}%
\IS@info{Adding space after closing delimiters.}
\Umathcloseordspacing\displaystyle=\scalemu{\thinmuskip}{0.5}
\Umathcloseordspacing\textstyle=\scalemu{\thinmuskip}{0.5}
- \Umathcloseordspacing\crampedisplaystyle=\scalemu{\thinmuskip}{0.5}
+ \Umathcloseordspacing\crampeddisplaystyle=\scalemu{\thinmuskip}{0.5}
\Umathcloseordspacing\crampedtextstyle=\scalemu{\thinmuskip}{0.5}
\ifnum\IS@script>0
\Umathcloseordspacing\scriptstyle=\scalemu{\thinmuskip}{0.3}
@@ -1130,7 +1130,7 @@ press return.}}%
%
% \section{Delimiter Heights}
%
-% Finally, filling out the delimiter heights is easy. We simply set |\delimiterfactor| to 1000.
+% Finally, filling out the delimiter heights is easy. We set |\delimiterfactor| to 1000.
% \begin{macrocode}
\ifIS@cover
\IS@info{Setting delimiters to full height.}
@@ -1144,7 +1144,8 @@ press return.}}%
% \vfil\eject
% \section*{Version History}
% \begin{multicols*}{2}
-% \bgroup\raggedright\parskip\z@\parindent\z@\leftskip1em\obeylines
+%
+% \raggedright\parskip\z@\parindent\z@\leftskip1em\obeylines
% \setbox0\hbox{\hskip 1pt.\hskip 1pt}
% \def\version#1#2{\bigskip\hbox to \hsize{\textbf{#1} \cleaders\copy0\hfill\ #2}\par}
% \def\item{---\kern0.2ex\relax}
@@ -1163,7 +1164,9 @@ press return.}}%
% \item added option |cover|
% \item separated implementation and user guide
%
-% \egroup
+% \version{1.3}{August 2024}
+% \item bug fix involving |\cramedisplaystyle| typo
+%
% \end{multicols*}
%
%
@@ -1266,7 +1269,7 @@ Package Option & Meaning\\
\begin{figure}[t!]
-\centerline{\bfseries\strut Table~3: Space Inserted by \textsf{innerscript}}
+\centerline{\bfseries\strut Table~3: Space Inserted by \textsf{innerscript} bewteen Math-Mode Characters}
\begin{tabular*}{\textwidth}{@{\extracolsep{\fill}}lll}\toprule
Consecutive Atom Types & Option |script| & Option |scriptscript|\\\midrule
|\mathord||\mathop| & 0.6|\thinmuskip| & 0.4|\thinmuskip| \\
@@ -1306,7 +1309,7 @@ Consecutive Atom Types & Option |script| & Option |scriptscript|\\\midrule
\end{tabular*}
\end{figure}
-\iffalse % ignore
+\iffalse %%% ignore %%%
\begin{figure}[t!]
\centerline{\bfseries\strut Table~4: Legacy Space Inserted by \textsf{innerscript}}
\begin{tabularx}{\hsize}{p{2in}Xl}\toprule
@@ -1365,10 +1368,9 @@ Skip Used in Current Version & For Option |script| & For Option |scriptscript|\\
-The |inner|, |close|, and |cover| options are straightforward, but the options |script| and |scriptscript| warrant more explanation. With its usual math formatting, \TeX\ adds small amounts of space between different math-mode characters depending on what types of symbols they represent, and \TeX's fine-tuned math spacing is part of what makes it a great program for typesetting equations.\footnote{\TeX\ classifies math symbols into eight categories: \vrb\mathord\ (ordinary), \vrb\mathop\ (big operator), \vrb\mathbin\ (binary operation), \vrb\mathrel\ (relation), \vrb\mathopen\ (opening delimiter), \vrb\mathclose\ (closing delimiter), \vrb\mathpunct\ (punctuation), and \vrb\mathinner\ (``inner'' subformula). As part of its definition, every math-mode character is assigned a math class.\vadjust{\bigskip} See Donald Knuth, \textit{The \TeX book} (Addison Wesley, 1986), 170; David Salomon, \textit{The Advanced \TeX book} (Springer, 1995), 256--258.} However, some spacing additions from inline and display math don't appear inside superscripts and subscripts. The |script| and |scriptscript| options address this situation by changing the space in superscripts and subscripts to scaled-down versions of the standard spacing rules.\footnote{Technically, \textsf{innerscript} scales down the standard spacing twice. The exact length of a \vrb\muskip\ register varries proportionally with the surrounding font size, so, for example, a \vrb\thinmuskip\ inside a superscript or subscript will be about two-thirds the size of a \vrb\thinmuskip\ in regular inline math. If \textsf{innerscript} always inserted the same amounts of muglue between math characters as with inline math, the spacing in superscripts and subscripts would be proportional to inline and display spacing. However, doing so produces math where the symbols appear too far apart, so \textsf{innerscript} scales the muglue by a factor of 0.6 in superscripts and subscripts and by a factor of 0.4 in second-order superscripts and subscripts.} Table~3 lists the spacing that \textsf{innerscript} adds under both options.
-
-Finally, in version 1.2, I redesigned the extra space amounts in the |script| and |scriptscript| options, and for backwards compatibility, the |legacy-| options implement the old spacing. In legacy spacing, all space additions are multiples of |\thinmuskip|, and Table~4 lists the factors of |\thinmuskip| from version 1.1. The factors correspond to whether a given row of Table~3 uses |\thinmuskip|, |\medmuskip|, or |\thickmuskip|. For example, the current version of \textsf{innerscript} adds a multiple of |\thinmuskip| between an ordinary math symbol and a large operator, so under legacy spacing, \textsf{innerscript} inserts 0.6|\thinmuskip| in superscripts and subscripts and 0.4|\thinmuskip| in second-order superscripts and subscripts. I changed the package this way so that superscripts and subscripts will parallel inline and display spacing. Now if you set the value of |\thinmuskip|, |\medmuskip|, or |\thickmuskip| before loading \textsf{innerscript}, the adjustment will have the same effect in all parts of your equation.
+The |inner|, |close|, and |cover| options are straightforward, but the options |script| and |scriptscript| warrant more explanation. With its usual math formatting, \TeX\ adds small amounts of space between different math-mode characters depending on what types of symbols they represent, and \TeX's fine-tuned math spacing is part of what makes it a great program for typesetting equations.\footnote{\TeX\ classifies math symbols into eight categories: \vrb\mathord\ (ordinary), \vrb\mathop\ (big operator), \vrb\mathbin\ (binary operation), \vrb\mathrel\ (relation), \vrb\mathopen\ (opening delimiter), \vrb\mathclose\ (closing delimiter), \vrb\mathpunct\ (punctuation), and \vrb\mathinner\ (``inner'' subformula). As part of its definition, every math-mode character is assigned a math class. See Donald Knuth, \textit{The \TeX book} (Addison Wesley, 1986), 170; David Salomon, \textit{The Advanced \TeX book} (Springer, 1995), 256--258.} However, some spacing additions from inline and display math don't appear inside superscripts and subscripts. The |script| and |scriptscript| options address this situation by changing the space in superscripts and subscripts to scaled-down versions of the standard spacing rules.\footnote{Technically, \textsf{innerscript} scales down the standard spacing twice. The exact length of a \vrb\muskip\ register varries proportionally with the surrounding font size, so, for example, a \vrb\thinmuskip\ inside a superscript or subscript will be about two-thirds the size of a \vrb\thinmuskip\ in regular inline math. If \textsf{innerscript} always inserted the same amounts of muglue between math characters as with inline math, the spacing in superscripts and subscripts would be proportional to inline and display spacing. However, doing so produces math where the symbols appear too far apart, so \textsf{innerscript} scales the muglue by a factor of 0.6 in superscripts and subscripts and by a factor of 0.4 in second-order superscripts and subscripts.} Table~3 lists the spacing that \textsf{innerscript} adds under both options.
+Finally, in version 1.2, I redesigned the extra space amounts in the |script| and |scriptscript| options, and for backwards compatibility, the |legacy-| options implement the old spacing. In legacy spacing, all space additions are multiples of |\thinmuskip|, and Table~4 lists the factors of |\thinmuskip| from version 1.1. The factors correspond to whether a given row of Table~3 uses |\thinmuskip|, |\medmuskip|, or |\thickmuskip|. For example, the current version of \textsf{innerscript} adds a multiple of |\thinmuskip| between an ordinary math symbol and a large operator, so under legacy spacing, \textsf{innerscript} inserts 0.6|\thinmuskip| in superscripts and subscripts and 0.4|\thinmuskip| in second-order superscripts and subscripts. I changed the package this way so that superscripts and subscripts will parallel inline and display spacing. If you set the value of |\thinmuskip|, |\medmuskip|, or |\thickmuskip| before loading \textsf{innerscript}, the adjustment will have the same effect in all parts of your equation. Changing these three internal quantities after you load \textsf{innerscript} will have no effect on the default spacing between math-mode characters.
@@ -1382,8 +1384,8 @@ Finally, in version 1.2, I redesigned the extra space amounts in the |script| an
\makeatletter
% identifying macros
-\def\packageversion{1.2}
-\def\packagedate{November 2023}
+\def\packageversion{1.3}
+\def\packagedate{August 2024}
% general macros
\MacroIndent=1.3em
@@ -1449,7 +1451,7 @@ Finally, in version 1.2, I redesigned the extra space amounts in the |script| an
\leftskip=0pt plus 1 fil
\rightskip=0pt plus 1fil
\parfillskip=0pt
-{\strut\Large Package \textsf{innerscript} v.\ 1.2 \documentname}\par
+{\strut\Large Package \textsf{innerscript} v.\ \packageversion\ \documentname}\par
\strut Conrad Kosowsky\par
\strut \packagedate\par
\strut\texttt{kosowsky.latex@gmail.com}\par}
diff --git a/Master/texmf-dist/source/lualatex/luamml/luamml.dtx b/Master/texmf-dist/source/lualatex/luamml/luamml.dtx
new file mode 100644
index 00000000000..7815ac58e0e
--- /dev/null
+++ b/Master/texmf-dist/source/lualatex/luamml/luamml.dtx
@@ -0,0 +1,531 @@
+% \iffalse meta-comment
+%
+%% Copyright (C) 2020-2024 by Marcel Krueger
+%%
+%% This file 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:
+%%
+%% http://www.latex-project.org/lppl.txt
+%%
+%% and version 1.3 or later is part of all distributions of
+%% LaTeX version 2005/12/01 or later.
+%
+%<*batch>
+%<*gobble>
+\ifx\jobname\relax\let\documentclass\undefined\fi
+\ifx\documentclass\undefined
+\csname fi\endcsname
+%</gobble>
+\input docstrip.tex
+\keepsilent
+\generate{
+ \file{luamml.sty}{\from{luamml.dtx}{package,luatex}}
+ \file{luamml-pdf.sty}{\from{luamml.dtx}{package,pdftex}}
+}
+\endbatchfile
+%</batch>
+%<*gobble>
+\fi
+\expandafter\ifx\csname @currname\endcsname\empty
+\csname fi\endcsname
+%</gobble>
+%<*driver>
+\documentclass{l3doc}
+\usepackage{luamml}
+\usepackage{csquotes,luacolor}
+\MakeShortVerb{\|}
+\RecordChanges
+\begin{document}
+\tracingmathml2
+\DocInput{luamml.dtx}
+\PrintIndex
+\PrintChanges
+\end{document}
+%</driver>
+%<*gobble>
+\fi
+%</gobble>
+% \fi
+%
+% \GetFileInfo{luamml.sty}
+% \title{The \pkg{luamml} package%
+% \thanks{This document corresponds to \pkg{luamml}~\fileversion, dated~\filedate.}%
+% }
+% \author{Marcel Krüger}
+%
+% \maketitle
+%
+% \begin{documentation}
+% \section{Use case}
+% When generating output for the web or tagged output, mathematical content should often be represented as MathML.
+% This uses Lua\TeX~callbacks to automatically attempt to convert Lua\TeX~math mode output into MathML.
+%
+% \section{Usage}
+% The \pkg{luamml} package is designed to be used in automated ways by other packages and usually should not be invoked directly by the end user.
+% For experiments, \texttt{luamml-demo} is included which provides easier to use interfaces.
+%
+% Add in your preamble
+% \begin{verbatim}
+% \usepackage[files]{luamml-demo}
+% \end{verbatim}
+% This will trigger the output of individual files for each block of math output containing corresponding MathML.
+%
+% Alternatively
+% \begin{verbatim}
+% \usepackage[l3build]{luamml-demo}
+% \end{verbatim}
+% will generate a single file with a concatenation of all MathML blocks.
+%
+% For automated use, the \pkg{luamml} package can be included directly, followed by enclosing blocks which should generate files with \cmd{luamml_begin_single_file:} and \cmd{luamml_end_single_file:}.
+% The filename can be set with \cmd{luamml_set_filename:n}.
+%
+% \section{Improving MathML conversion}
+% When using constructs which do not automatically get converted in acceptable form, conversion hints can be provided with \cmd{luamml_annotate:en}.
+% This allows to provide a replacement MathML structure in Lua table form, for example
+% \begin{verbatim}
+% \luamml_annotate:en {
+% nucleus = true,
+% core = {[0] = 'mi', 'TeX'},
+% }{
+% \hbox{\TeX}
+% }
+% \end{verbatim}
+% produces a |<mi>TeX</mi>| element in the output instead of trying to import \TeX~as a mathematical expression.
+% The table structure is explained in an appendix.
+%
+% \section{Features \& Limitations}
+% Currently all mathematical expressions which purely contain Unicode encoded math mode material without embedded non-math should get converted successfully.
+% Usage with non-Unicode math (\TeX's 8-bit math fonts) is highly experimental and undocumented.
+% Any attempt to build complicated structures by embedding arbitrary \TeX\ code in the middle of math mode needs to have a MathML replacement specified.
+% We try to automate more cases in the future.
+%
+% \appendix
+% \input{luamml-algorithm}
+% \end{documentation}
+%
+% \begin{implementation}
+% \section{Package Implementation}
+% \subsection{Initialization}
+% \iffalse
+%<*package>
+% \fi
+% \begin{macrocode}
+%<@@=luamml>
+%<*luatex>
+\ProvidesExplPackage {luamml} {2024-08-14} {0.1.0}
+ {Automatically generate presentational MathML from LuaTeX math expressions}
+%</luatex>
+%<*pdftex>
+\ProvidesExplPackage {luamml-pdf} {2024-08-14} {0.1.0}
+ {MathML generation for L̶u̶a̶pdfLaTeX}
+%</pdftex>
+% \end{macrocode}
+%
+% \subsection{Initialization}
+% These variable have to appear before the Lua module is loaded and will be used to
+% communicate information to the callback.
+%
+% Here \cs{tracingmathml} does not use a expl3 name since it is not intended for
+% programming use but only as a debugging helper for the user.
+% The other variables are internal, but we provide public interfaces for setting
+% them later.
+% \begin{macrocode}
+\int_new:N \l__luamml_flag_int
+\int_new:N \l__luamml_pretty_int
+%<luatex>\tl_new:N \l__luamml_filename_tl
+\tl_new:N \l__luamml_root_tl
+\tl_set:Nn \l__luamml_root_tl { mrow }
+\tl_new:N \l__luamml_label_tl
+%<pdftex>\int_new:N \g__luamml_formula_id_int
+%<luatex>\int_new:N \tracingmathml
+
+\int_set:Nn \l__luamml_pretty_int { 1 }
+% \end{macrocode}
+%
+% Now we can load the Lua module which defines the callback.
+% Of course until pdf\TeX starts implementing \cs{directlua} this is only
+% done in Lua\TeX.
+% \begin{macrocode}
+%<luatex>\lua_now:n { require'luamml-tex' }
+% \end{macrocode}
+%
+% \subsection{Hook}
+% We also call a hook with arguments at the end of every MathML conversion with the result.
+% Currently only implemented in Lua\TeX{} since it immediately provides the output.
+% \begin{macrocode}
+%<*luatex>
+\hook_new_with_args:nn { luamml / converted } { 1 }
+
+\cs_new_protected:Npn \__luamml_output_hook:n {
+ \hook_use:nnw { luamml / converted } { 1 }
+}
+\__luamml_register_output_hook:N \__luamml_output_hook:n
+%</luatex>
+% \end{macrocode}
+
+%
+% \subsection{Flags}
+% The most important interface is for setting the flag which controls how the
+% formulas should be converted.
+%
+% \begin{macro}{\luamml_flag_process:}
+% Consider the current formula to be a complete, free-standing mathematical
+% expression which should be converted to MathML. Additionally, the formula
+% is also saved in the \texttt{start\_math} node as with
+% \cs{luamml_flag_save:}.
+% \begin{macrocode}
+\cs_new_protected:Npn \luamml_flag_process: {
+ \tl_set:Nn \l__luamml_label_tl {}
+ \int_set:Nn \l__luamml_flag_int { 3 }
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\__luamml_maybe_structelem:}
+% A internal helper which can be added to a tag to preserve the external state
+% of the structelem flag.
+% \begin{macrocode}
+\cs_new:Npn \__luamml_maybe_structelem: {
+ (
+ 8 * \int_mod:nn {
+ \int_div_truncate:nn { \l__luamml_flag_int } {8}
+ } {2}
+ ) +
+}
+% \end{macro}
+%
+% \begin{macro}{\__luamml_style_to_num:N}
+% \begin{macrocode}
+\cs_new:Npn \__luamml_style_to_num:N #1 {
+%<luatex> 32 * #1
+%<*pdftex>
+ \token_case_meaning:NnF #1 {
+ \displaystyle {0}
+ \textstyle {32}
+ \scriptstyle {64}
+ \scriptscriptstyle {96}
+ } {
+ \Invalid_mathstyle
+ }
+%</pdftex>
+}
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \begin{macro}{\luamml_flag_save:n,
+% \luamml_flag_save:nN,
+% \luamml_flag_save:nn,
+% \luamml_flag_save:nNn}
+% Convert the current formula but only save it's representation in the math
+% node without emitting it as a complete formula. This is useful when the
+% expression forms part of a bigger formula and will be intergrated into it's
+% MathML tables later by special code.
+% It optinally accepts three parameters: A label, one math style command
+% (\cs{displaystyle}, \cs{textstyle}, etc.) which is the implicit math style
+% (so the style which the surrounding code expects this style to have) and a
+% name for the root element (defaults to \texttt{mrow}).
+% If the root element name is \texttt{mrow}, it will get suppressed in some
+% cases.
+% \begin{macrocode}
+\cs_new_protected:Npn \luamml_flag_save:n #1 {
+ \tl_set:Nn \l__luamml_label_tl {#1}
+ \int_set:Nn \l__luamml_flag_int { \__luamml_maybe_structelem: 1 }
+}
+\cs_new_protected:Npn \luamml_flag_save:nN #1#2 {
+ \tl_set:Nn \l__luamml_label_tl {#1}
+ \int_set:Nn \l__luamml_flag_int { \__luamml_maybe_structelem: 17 + \__luamml_style_to_num:N #2 }
+}
+\cs_new_protected:Npn \luamml_flag_save:nn #1 {
+ \tl_set:Nn \l__luamml_label_tl {#1}
+ \int_set:Nn \l__luamml_flag_int { \__luamml_maybe_structelem: 5 }
+ \tl_set:Nn \l__luamml_root_tl
+}
+\cs_new_protected:Npn \luamml_flag_save:nNn #1#2 {
+ \tl_set:Nn \l__luamml_label_tl {#1}
+ \int_set:Nn \l__luamml_flag_int { \__luamml_maybe_structelem: 21 + \__luamml_style_to_num:N #2 }
+ \tl_set:Nn \l__luamml_root_tl
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\luamml_flag_ignore:}
+% Completely ignore the math mode material.
+% \begin{macrocode}
+\cs_new_protected:Npn \luamml_flag_ignore: {
+ \int_set:Nn \l__luamml_flag_int { 0 }
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\luamml_flag_structelem:}
+% Like \cs{luamml_flag_process:}, but additionally add PDF structure
+% elements. This only works in Lua\TeX\ and requires that the \pkg{tagpdf} package
+% has been loaded \emph{before} \texttt{luamml}.
+% \begin{macrocode}
+%<*luatex>
+\cs_new_protected:Npn \luamml_flag_structelem: {
+ \tl_set:Nn \l__luamml_label_tl {}
+ \int_set:Nn \l__luamml_flag_int { 11 }
+}
+%</luatex>
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\luamml_set_filename:n}
+% Allows to set a filename to which the generated MathML gets written.
+% Previous content from the file will get overwritten. This includes results
+% written by a previous formula. Therefore this has to be called separately
+% for every formula or it must expand to different values to be useful.
+% The value is fully expanded when the file is written.
+%
+% Only complete formulas get written into files (so formulas where
+% \cs{luamml_flag_process:} or \cs{luamml_flag_structelem:} are in effect).
+%
+% Only implemented in Lua\TeX, in pdf\TeX\ the arguments for \texttt{pdfmml}
+% determine the output location.
+% \begin{macrocode}
+%<*luatex>
+\cs_new_protected:Npn \luamml_set_filename:n {
+ \tl_set:Nn \l__luamml_filename_tl
+}
+%</luatex>
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\luamml_begin_single_file:, \luamml_end_single_file:}
+% Everything between these two commands gets written into the same XML file.
+% The filename is expanded when \cs{luamml_begin_single_file:} gets executed.
+%
+% (Implemented in Lua)
+% \end{macro}
+%
+% By default, the flag is set to assume complete formulas.
+% \begin{macrocode}
+\luamml_flag_process:
+% \end{macrocode}
+%
+% \subsection{Annotations}
+% These are implemented very differently depending on the engine, but the interface
+% should be the same.
+% \subsubsection{Lua\TeX}
+% \begin{macrocode}
+%<*luatex>
+% \end{macrocode}
+% \begin{macro}{\luamml_annotate:nen, \luamml_annotate:en}
+% A simple annotation scheme: The first argument is the number of top level
+% noads to be annotated, the second parameter the annotation and the third
+% parameter the actual list of math tokens. The first argument can be omitted to
+% let Lua\TeX determine the number itself.
+%
+% Passing the first parameter explicitly is useful for any annotations which
+% should be compatible with fututre pdf\TeX versions of this functionality.
+% \begin{macrocode}
+\cs_new_protected:Npn \luamml_annotate:nen #1#2#3 {
+ \__luamml_annotate_begin:
+ #3
+ \__luamml_annotate_end:we \tex_numexpr:D #1 \scan_stop: {#2}
+}
+
+\cs_new_protected:Npn \luamml_annotate:en #1#2 {
+ \__luamml_annotate_begin:
+ #2
+ \__luamml_annotate_end:e {#1}
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+%</luatex>
+% \end{macrocode}
+
+% \subsubsection{pdf\TeX}
+% \begin{macrocode}
+%<*pdftex>
+% \end{macrocode}
+% \begin{macro}{\__luamml_pdf_showlists:}
+% Here and in many other locations the \pdfTeX{} implementation is based on \cs{showlists},
+% so we define a internal wrapper which sets all relevant parameters.
+% \begin{macrocode}
+\cs_if_exist:NTF \showstream {
+ \iow_new:N \l__luamml_pdf_stream
+ \iow_open:Nn \l__luamml_pdf_stream { \jobname .tml }
+ \cs_new_protected:Npn \__luamml_pdf_showlists: {
+ \group_begin:
+ \int_set:Nn \tex_showboxdepth:D { \c_max_int }
+ \int_set:Nn \tex_showboxbreadth:D { \c_max_int }
+ \showstream = \l__luamml_pdf_stream
+ \tex_showlists:D
+ \group_end:
+ }
+} {
+ \cs_set_eq:NN \l__luamml_pdf_stream \c_log_iow
+ \cs_set_eq:NN \__luamml_pdf_set_showstream: \scan_stop:
+ \cs_new_protected:Npn \__luamml_pdf_showlists: {
+ \group_begin:
+ \int_set:Nn \l_tmpa_int { \tex_interactionmode:D }
+ \int_set:Nn \tex_interactionmode:D { 0 }
+ \int_set:Nn \tex_showboxdepth:D { \c_max_int }
+ \int_set:Nn \tex_showboxbreadth:D { \c_max_int }
+ \tex_showlists:D
+ \int_set:Nn \tex_interactionmode:D { \l_tmpa_int }
+ \group_end:
+ }
+}
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \begin{macro}{\luamml_annotate:nen, \luamml_annotate:en}
+% Now we can define the annotation commands for pdf\TeX.
+% \begin{macrocode}
+\cs_generate_variant:Nn \tl_to_str:n { e }
+\int_new:N \g__luamml_annotation_id_int
+\cs_new_protected:Npn \luamml_annotate:nen #1#2#3 {
+ \int_gincr:N \g__luamml_annotation_id_int
+ \iow_shipout_x:Nx \l__luamml_pdf_stream {
+ LUAMML_MARK_REF:
+ \int_use:N \g__luamml_annotation_id_int
+ :
+ }
+ \iow_now:Nx \l__luamml_pdf_stream {
+ LUAMML_MARK:
+ \int_use:N \g__luamml_annotation_id_int
+ :
+ count = \int_eval:n {#1},
+ #2
+ \iow_newline:
+ LUAMML_MARK_END
+ }
+ #3
+}
+\cs_new_protected:Npn \luamml_annotate:en #1#2 {
+ \int_gincr:N \g__luamml_annotation_id_int
+ \iow_shipout_x:Nx \l__luamml_pdf_stream {
+ LUAMML_MARK_REF:
+ \int_use:N \g__luamml_annotation_id_int
+ :
+ }
+ \iow_now:Nx \l__luamml_pdf_stream {
+ LUAMML_MARK:
+ \int_use:N \g__luamml_annotation_id_int
+ :
+ count = data.count[\int_use:N \g__luamml_annotation_id_int],
+ #1
+ \iow_newline:
+ LUAMML_MARK_END
+ }
+ \use:x {
+ \iow_now:Nn \l__luamml_pdf_stream {
+ LUAMML_COUNT:
+ \int_use:N \g__luamml_annotation_id_int
+ }
+ \__luamml_pdf_showlists:
+ \exp_not:n {#2}
+ \iow_now:Nn \l__luamml_pdf_stream {
+ LUAMML_COUNT_END:
+ \int_use:N \g__luamml_annotation_id_int
+ }
+ \__luamml_pdf_showlists:
+ }
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+%</pdftex>
+% \end{macrocode}
+%
+% \subsection{Trigger for specific formula}
+% This only applies for pdf\TeX\ since in Lua\TeX\ everything is controlled by the callback,
+% but for compatibility the function is defined anyway.
+%
+% \begin{macro}{\luamml_pdf_write:}
+% We could accept parameters for the flag and tag here, but for compatibility
+% with Lua\TeX they are passed in macros instead.
+% \begin{macrocode}
+%<*pdftex>
+\cs_new_protected:Npn \luamml_pdf_write: {
+ \int_gincr:N \g__luamml_formula_id_int
+ \iow_now:Nx \l__luamml_pdf_stream {
+ LUAMML_FORMULA_BEGIN:
+ \int_use:N \g__luamml_formula_id_int
+ :
+ \int_use:N \l__luamml_flag_int
+ :
+ \l__luamml_root_tl
+ :
+ \l__luamml_label_tl
+ }
+ \__luamml_pdf_showlists:
+ \iow_now:Nx \l__luamml_pdf_stream {
+ LUAMML_FORMULA_END
+ }
+}
+%</pdftex>
+%<luatex>\cs_new_eq:NN \luamml_pdf_write: \scan_stop:
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+% \end{macrocode}
+%
+% \subsection{Further helpers}
+%
+% \begin{macro}{\RegisterFamilyMapping}
+% The Lua version of this is defined in the Lua module.
+% \begin{macrocode}
+%<*pdftex>
+\NewDocumentCommand \RegisterFamilyMapping {m m} {
+ \iow_now:Nx \l__luamml_pdf_stream {
+ LUAMML_INSTRUCTION:REGISTER_MAPPING: \int_use:N #1 : #2
+ }
+}
+%</pdftex>
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \subsection{Patching}
+% For some packages, we ship with patches to make them more compatible and to
+% demonstrate how other code can be patched to work with \texttt{luamml}.
+%
+% These are either loaded directly if the packages are loaded or delayed using
+% \LaTeX's hook system otherwise.
+% \begin{macro}{\__luamml_patch_package:nn, \__luamml_patch_package:n}
+% For this, we use two helpers: First a wrapper which runs arbitrary code either
+% now (if the package is already loaded) or as soon as the package loads, second
+% an application of the first one to load packages following \texttt{luamml}'s
+% naming scheme for these patch packages.
+% \begin{macrocode}
+\cs_new_protected:Npn \__luamml_patch_package:nn #1 #2 {
+ \@ifpackageloaded {#1} {#2} {
+ \hook_gput_code:nnn {package/#1/after} {luamml} {#2}
+ }
+}
+\cs_new_protected:Npn \__luamml_patch_package:n #1 {
+ \__luamml_patch_package:nn {#1} {
+ \RequirePackage { luamml-patches-#1 }
+ }
+}
+% \end{macrocode}
+% \end{macro}
+%
+% We currently provide minimal patching for the kernel, \pkg{amsmath} and \pkg{array}.
+% Currently only the kernel code supports pdf\TeX, but it's planned to extend this.
+% \begin{macrocode}
+\RequirePackage { luamml-patches-kernel }
+%<*luatex>
+\__luamml_patch_package:n {amstext}
+\__luamml_patch_package:n {amsmath}
+\__luamml_patch_package:n {array}
+%</luatex>
+% \end{macrocode}
+
+% \iffalse
+%</package>
+% \fi
+% \end{implementation}
+% \Finale
diff --git a/Master/texmf-dist/source/lualatex/piton/piton.dtx b/Master/texmf-dist/source/lualatex/piton/piton.dtx
index ec18e80eaa6..0174f405615 100644
--- a/Master/texmf-dist/source/lualatex/piton/piton.dtx
+++ b/Master/texmf-dist/source/lualatex/piton/piton.dtx
@@ -44,7 +44,7 @@
end-escape = ! ,
begin-escape-math = \( ,
end-escape-math = \) ,
- detected-commands = highLight
+ detected-commands = { highLight, footnote }
}
\parindent 0pt
@@ -79,12 +79,12 @@
% \iffalse
%<*STY>
% \fi
-\def\PitonFileVersion{3.0b}
-\def\PitonFileDate{2024/05/23}
+\def\PitonFileVersion{3.1b}
+\def\PitonFileDate{2024/08/29}
% \iffalse
%</STY>
%<*LUA>
-piton_version = "3.0b" -- 2024/05/23
+piton_version = "3.1b" -- 2024/08/29
%</LUA>
%\fi
%
@@ -113,8 +113,9 @@ piton_version = "3.0b" -- 2024/05/23
% listings and typesets them with syntactic highlighting. Since it uses the Lua
% of LuaLaTeX, it works with |lualatex| only (and won't work with the other
% engines: |latex|, |pdflatex| and |xelatex|). It does not use external program
-% and the compilation does not require |--shell-escape|. The compilation is very
-% fast since all the parsing is done by the library LPEG, written in C.
+% and the compilation does not require |--shell-escape| (except when the key
+% |write| is used). The compilation is very fast since all the parsing is done
+% by the library LPEG, written in C.
%
% \bigskip
% Here is an example of code typeset by \pkg{piton}, with the environment |{Piton}|.
@@ -361,8 +362,12 @@ piton_version = "3.0b" -- 2024/05/23
%
% \begin{itemize}
% \item The key \Definition{language} specifies which computer language is
-% considered (that key is case-insensitive). Five values are allowed :
-% |Python|, |OCaml|, |C|, |SQL| and |minimal|. The initial value is |Python|.
+% considered (that key is case-insensitive). It's possible to use the name of
+% the five built-in languages (|Python|, |OCaml|, |C|, |SQL| and |minimal|) or
+% the name of the language defined by the user with |\NewPitonLanguage|
+% (cf.~part~\ref{NewPitonLanguage}, p.~\pageref{NewPitonLanguage}.
+%
+% The initial value is |Python|.
%
% \item \index{path} The key \Definition{path} specifies a path where the files
% included by |\PitonInputFile| will be searched.
@@ -395,6 +400,9 @@ piton_version = "3.0b" -- 2024/05/23
% the part~\ref{API}, p.~\pageref{API}).} of the current environment in
% that file. At the first use of a file by \pkg{piton}, it is erased.
%
+% {\bfseries This key requires a compilation with {\ttfamily lualatex
+% -shell-escape}}.
+%
% \item \index{path-write} The key \Definition{path-write} specifies a path
% where the files written by the key |write| will be written.
%
@@ -431,6 +439,13 @@ piton_version = "3.0b" -- 2024/05/23
% \item The key \Definition{line-numbers/sep} is the horizontal distance between
% the numbers of lines (inserted by |line-numbers|) and the beginning of the
% lines of code. The initial value is 0.7~em.
+% \item \colorbox{yellow!50}{\bfseries New 3.1}\enskip The key
+% \Definition{line-numbers/format} is a list of tokens which are inserted before
+% the number of line in order to format it. It's possible to put, \emph{at the
+% end} of the list, a LaTeX command with one argument, such as, for example,
+% |\fbox|.
+%
+% The initial value is |\footnotesize\color{gray}|.
% \end{itemize}
%
% For convenience, a mechanism of factorisation of the prefix |line-numbers| is
@@ -442,7 +457,8 @@ piton_version = "3.0b" -- 2024/05/23
% {
% skip-empty-lines = false ,
% label-empty-lines = false ,
-% sep = 1 em
+% sep = 1 em ,
+% line-format = \footnotesize \color{blue}
% }
% }
% \end{Verbatim}
@@ -473,6 +489,12 @@ piton_version = "3.0b" -- 2024/05/23
% The key |background-color| accepts a color defined «on the fly». For example,
% it's possible to write |background-color = [cmyk]{0.1,0.05,0,0}|.
%
+% \smallskip
+% When the key |split-on-empty-lines| is in force (see the part ``Page breaks'',
+% p.~\pageref{page breaks}), the empty lines generated by that key don't have
+% any background color (at least with the initial value of the parameter
+% |split-separation|).
+%
% \item \index{prompt-background-color} With the key
% \Definition{prompt-background-color}, \pkg{piton} adds a
% color background to the lines beginning with the prompt ``|>>>|'' (and its
@@ -664,7 +686,7 @@ piton_version = "3.0b" -- 2024/05/23
% \bigskip
% For example, with the command
% \begin{Verbatim}
-% \SetPitonStyle~emphase#[SQL]@{Keywords = \color[HTML]{006699} \bfseries \MakeUppercase}
+% \SetPitonStyle~emphase#[SQL]@{Keyword = \color[HTML]{006699} \bfseries \MakeUppercase}
% \end{Verbatim}
% the keywords in the SQL listings will be composed in capital letters, even if
% they appear in lower case in the LaTeX source (we recall that, in SQL, the
@@ -976,6 +998,7 @@ piton_version = "3.0b" -- 2024/05/23
% \label{breakable}
%
% \subsubsection{Page breaks}
+% \label{page breaks}
% \index{splittable}
%
% By default, the listings produced by the environment |{Piton}| and the command
@@ -994,10 +1017,17 @@ piton_version = "3.0b" -- 2024/05/23
% In fact, when the key |split-on-empty-lines| is in force, the work goes a
% little further than merely allowing page breaks: several successive empty lines
% are deleted and replaced by the content of the parameter corresponding to the
-% key \Definition{split-separation}. The initial value of this parameter is
-% |\vspace{\baselineskip}\vspace{-1.25pt}| which corresponds eventually to an
+% key \Definition{split-separation}.
+% \begin{itemize}
+% \item That parameter must contain elements allowed to be inserted in
+% \emph{vertical mode} of TeX. For example, it's possible to put |\hrule|.
+%
+% \item The initial value of this parameter is
+% |\vspace{\baselineskip}\vspace{-1.25pt}| which corresponds eventually to an
% empty line in the final PDF (this vertical space is deleted if it occurs on a
-% page break).
+% page break). If the key |background-color| is in force, no background color is
+% added to that empty line.
+% \end{itemize}
%
% \item Of course, the key |split-on-empty-lines| may not be sufficient and
% that's why \pkg{piton} provides the key \Definition{splittable}.
@@ -1012,6 +1042,9 @@ piton_version = "3.0b" -- 2024/05/23
% When used without value, the key |splittable| is equivalent to
% |splittable = 1| and the listings may be broken anywhere (it's probably
% not recommandable).
+%
+% The initial value of the key |splittable| is equal to 100 (by default, the
+% listings are not breakable at all).
% \end{itemize}
%
%
@@ -1654,6 +1687,8 @@ piton_version = "3.0b" -- 2024/05/23
%
% \subsubsection{Commands of Beamer allowed in \{Piton\} and \textbackslash PitonInputFile}
%
+% \index{detected-beamer-commands}
+%
% When \pkg{piton} is used in the class \cls{beamer} , the following commands of
% \cls{beamer} (classified upon their number of arguments) are automatically
% detected in the environments |{Piton}| (and in the listings processed by
@@ -1663,17 +1698,23 @@ piton_version = "3.0b" -- 2024/05/23
% also possible to use the command \texttt{\textbackslash pause} in a ``LaTeX
% comment'', that is to say by writing \texttt{\#> \textbackslash pause}. By
% this way, if the Python code is copied, it's still executable by Python}. ;
-% \item one mandatory argument : |\action|, |\alert|, |\invisible|, |\only|, |\uncover| and |\visible| ;
+% \item one mandatory argument : |\action|, |\alert|, |\invisible|, |\only|,
+% |\uncover| and |\visible| ; \newline
+% \colorbox{yellow!50}{\bfseries New 3.1}\newline
+% It's possible to add new commands to that list with the key
+% \Definition{detected-beamer-commands} (the names of the commands must
+% \emph{not} be preceded by a backslash).
% \item two mandatory arguments : |\alt| ;
% \item three mandatory arguments : |\temporal|.
% \end{itemize}
-% \medskip
-% In the mandatory arguments of these commands, the braces must be balanced.
-% However, the braces included in short strings\footnote{The short strings of
-% Python are the strings delimited by characters \texttt{'} or the characters
-% \texttt{"} and not \texttt{'''} nor \texttt{"""}. In Python, the short strings
-% can't extend on several lines.} of Python are not considered.
+% \medskip
+% These commands must be used preceded and following by a space. In the
+% mandatory arguments of these commands, the braces must be balanced. However,
+% the braces included in short strings\footnote{The short strings of Python are
+% the strings delimited by characters \texttt{'} or the characters \texttt{"}
+% and not \texttt{'''} nor \texttt{"""}. In Python, the short strings can't
+% extend on several lines.} of Python are not considered.
%
% \medskip
% Regarding the functions |\alt| and |\temporal| there should be no carriage
@@ -1713,8 +1754,18 @@ piton_version = "3.0b" -- 2024/05/23
% listings processed by |\PitonInputFile|): |{actionenv}|, |{alertenv}|,
% |{invisibleenv}|, |{onlyenv}|, |{uncoverenv}| and |{visibleenv}|.
%
+% \smallskip
+% \index{detected-beamer-environments}
+% \colorbox{yellow!50}{\bfseries New 3.1}
+%
+% It's possible to add new environments to that list with the key
+% \Definition{detected-beamer-environments}.
+%
+% \smallskip
+%
% However, there is a restriction: these environments must contain only \emph{whole
-% lines of Python code} in their body.
+% lines of Python code} in their body. The instructions |\begin{...}| and
+% |\end{...}| must be alone on their lines.
%
%\medskip
% Here is an example:
@@ -1810,10 +1861,98 @@ piton_version = "3.0b" -- 2024/05/23
% in particular: it must be loaded after the package \pkg{xcolor} and it is not
% perfectly compatible with \pkg{hyperref}.
%
+%
+% \medskip
+% \textbf{Important remark} : If you use Beamer, you should know taht Beamer has
+% its own system to extract the footnotes. Therefore, \pkg{piton} must be loaded
+% in that class without the option |footnote| nor the option |footnotehyper|.
+%
+%
+% \bigskip
+% By default, in an environment |{Piton}|, a command |\footnote| may appear only
+% within a ``LaTeX comment''. But it's also possible to add the command
+% |\footnote| to the list of the ``\emph{detected-commands}''
+% (cf.~part~\ref{detected-commands}, p.~\pageref{detected-commands}).
+
% \medskip
% In this document, the package \pkg{piton} has been loaded with the
-% option |footnotehyper|. For examples of notes, cf. \ref{notes-examples},
-% p.~\pageref{notes-examples}.
+% option |footnotehyper| dans we added the command |\footnote| to the list of
+% the ``\emph{detected-commands}'' with the following instruction in the
+% preamble of the LaTeX document.
+%
+% \qquad \verb|\PitonOptions{detected-commands = footnote}|
+%
+%
+% \begingroup
+% \fvset{commandchars=\~\&\@,formatcom=\small\color{gray}}
+% \begin{Verbatim}
+% \PitonOptions{background-color=gray!10}
+% \begin{Piton}
+% def arctan(x,n=10):
+% if x < 0:
+% return -arctan(-x)~emphase&\footnote{First recursive call.}]@
+% elif x > 1:
+% return pi/2 - arctan(1/x)~emphase&\footnote{Second recursive call.}@
+% else:
+% return sum( (-1)**k/(2*k+1)*x**(2*k+1) for k in range(n) )
+% \end{Piton}
+% \end{Verbatim}
+% \endgroup
+%
+% \begingroup
+% \PitonOptions{background-color=gray!10}
+% \begin{Piton}
+% def arctan(x,n=10):
+% if x < 0:
+% return -arctan(-x)\footnote{First recursive call.}
+% elif x > 1:
+% return pi/2 - arctan(1/x)\footnote{Second recursive call.}
+% else:
+% return sum( (-1)**k/(2*k+1)*x**(2*k+1) for k in range(n) )
+% \end{Piton}
+% \endgroup
+%
+%
+% \vspace{1cm}
+%
+% If an environment |{Piton}| is used in an environment |{minipage}| of LaTeX,
+% the notes are composed, of course, at the foot of the environment
+% |{minipage}|. Recall that such |{minipage}| can't be broken by a page break.
+%
+%
+% \begingroup
+% \fvset{commandchars=\~\&\@,formatcom=\small\color{gray}}
+% \begin{Verbatim}
+% \PitonOptions{background-color=gray!10}
+% \emphase\begin{minipage}{\linewidth}
+% \begin{Piton}
+% def arctan(x,n=10):
+% if x < 0:
+% return -arctan(-x)~emphase&\footnote{First recursive call.}@
+% elif x > 1:
+% return pi/2 - arctan(1/x)~emphase&\footnote{Second recursive call.}@
+% else:
+% return sum( (-1)**k/(2*k+1)*x**(2*k+1) for k in range(n) )
+% \end{Piton}
+% \end{minipage}
+% \end{Verbatim}
+% \endgroup
+%
+% \begingroup
+% \PitonOptions{background-color=gray!10}
+% \begin{minipage}{\linewidth}
+% \begin{Piton}
+% def arctan(x,n=10):
+% if x < 0:
+% return -arctan(-x)\footnote{First recursive call.}
+% elif x > 1:
+% return pi/2 - arctan(1/x)\footnote{Second recursive call.}
+% else:
+% return sum( (-1)**k/(2*k+1)*x**(2*k+1) for k in range(n) )
+% \end{Piton}
+% \end{minipage}
+% \endgroup
+%
%
% \subsection{Tabulations}
%
@@ -1835,6 +1974,8 @@ piton_version = "3.0b" -- 2024/05/23
% course). Hence, that key is similar to the key |auto-gobble| but acts on
% U+0009 instead of U+0020 (spaces).
%
+% The key |env-gobble| is not compatible with the tabulations.
+%
%
% \bigskip
% \section{API for the developpers}
@@ -1882,7 +2023,7 @@ piton_version = "3.0b" -- 2024/05/23
% \index{numbers of the lines de code|emph}
%
% We remind that it's possible to have an automatic numbering of the lines in
-% the Python listings by using the key |line-numbers|.
+% the Python listings by using the key |line-numbers| (used without value).
%
% By default, the numbers of the lines are composed by \pkg{piton} in an
% overlapping position on the left (by using internally the command |\llap| of LaTeX).
@@ -2015,94 +2156,7 @@ piton_version = "3.0b" -- 2024/05/23
% \endgroup
%
%
-% \bigskip
-% \subsection{Notes in the listings}
-%
-% \label{notes-examples}
-% \index{notes in the listings}
%
-% In order to be able to extract the notes (which are typeset with the command
-% |\footnote|), the extension \pkg{piton} must be loaded with the key |footnote|
-% or the key |footenotehyper| as explained in the section \ref{footnote}
-% p.~\pageref{footnote}. In this document, the extension \pkg{piton} has been
-% loaded with the key |footnotehyper|.
-%
-% Of course, in an environment |{Piton}|, a command |\footnote| may appear only
-% within a LaTeX comment (which begins with |#>|). It's possible to have comments
-% which contain only that command |\footnote|. That's the case in the following example.
-%
-%
-%
-% \begingroup
-% \fvset{commandchars=\~\&\@,formatcom=\small\color{gray}}
-% \begin{Verbatim}
-% \PitonOptions{background-color=gray!10}
-% \begin{Piton}
-% def arctan(x,n=10):
-% if x < 0:
-% return -arctan(-x)~emphase&#>\footnote{First recursive call.}]@
-% elif x > 1:
-% return pi/2 - arctan(1/x)~emphase&#>\footnote{Second recursive call.}@
-% else:
-% return sum( (-1)**k/(2*k+1)*x**(2*k+1) for k in range(n) )
-% \end{Piton}
-% \end{Verbatim}
-% \endgroup
-%
-% \begingroup
-% \PitonOptions{background-color=gray!10}
-% \begin{Piton}
-% def arctan(x,n=10):
-% if x < 0:
-% return -arctan(-x)#>\footnote{First recursive call.}
-% elif x > 1:
-% return pi/2 - arctan(1/x)#>\footnote{Second recursive call.}
-% else:
-% return sum( (-1)**k/(2*k+1)*x**(2*k+1) for k in range(n) )
-% \end{Piton}
-% \endgroup
-%
-%
-% \vspace{1cm}
-%
-% If an environment |{Piton}| is used in an environment |{minipage}| of LaTeX,
-% the notes are composed, of course, at the foot of the environment
-% |{minipage}|. Recall that such |{minipage}| can't be broken by a page break.
-%
-%
-% \begingroup
-% \fvset{commandchars=\~\&\@,formatcom=\small\color{gray}}
-% \begin{Verbatim}
-% \PitonOptions{background-color=gray!10}
-% \emphase\begin{minipage}{\linewidth}
-% \begin{Piton}
-% def arctan(x,n=10):
-% if x < 0:
-% return -arctan(-x)~emphase&#>\footnote{First recursive call.}@
-% elif x > 1:
-% return pi/2 - arctan(1/x)~emphase&#>\footnote{Second recursive call.}@
-% else:
-% return sum( (-1)**k/(2*k+1)*x**(2*k+1) for k in range(n) )
-% \end{Piton}
-% \end{minipage}
-% \end{Verbatim}
-% \endgroup
-%
-% \begingroup
-% \PitonOptions{background-color=gray!10}
-% \begin{minipage}{\linewidth}
-% \begin{Piton}
-% def arctan(x,n=10):
-% if x < 0:
-% return -arctan(-x)#>\footnote{First recursive call.}
-% elif x > 1:
-% return pi/2 - arctan(1/x)#>\footnote{Second recursive call.}
-% else:
-% return sum( (-1)**k/(2*k+1)*x**(2*k+1) for k in range(n) )
-% \end{Piton}
-% \end{minipage}
-% \endgroup
-%
%
%
% \bigskip
@@ -2256,7 +2310,7 @@ piton_version = "3.0b" -- 2024/05/23
% \vspace{1cm}
%
% \begin{center}
-% \begin{tabularx}{0.9\textwidth}{@{}>{\ttfamily}l>{\raggedright\arraybackslash}X@{}}
+% \begin{tabularx}{\textwidth}{@{}>{\ttfamily}l>{\raggedright\arraybackslash}X@{}}
% \toprule
% \normalfont Style & Use \\
% \midrule
@@ -2297,9 +2351,10 @@ piton_version = "3.0b" -- 2024/05/23
% Keyword & the following keywords:
% \ttfamily assert, break, case, continue, del,
% elif, else, except, exec, finally, for, from,
-% global, if, import, lambda, non local,
+% global, if, import, in, lambda, non local,
% pass, raise, return, try, while,
% with, yield et yield from.\\
+% Identifier & the identifiers. \\
% \bottomrule
% \end{tabularx}
% \end{center}
@@ -2336,7 +2391,7 @@ piton_version = "3.0b" -- 2024/05/23
% String.Long & the strings, between |"| but also the \emph{quoted-strings} \\
% String & that key fixes both |String.Short| and |String.Long| \\
% Operator & les opérateurs, en particulier |+|, |-|, |/|, |*|, |@|, |!=|, |==|, |&&| \\
-% Operator.Word & les opérateurs suivants : |and|, |asr|, |land|, |lor|, |lsl|, |lxor|, |mod| et |or| \\
+% Operator.Word & les opérateurs suivants : |asr|, |land|, |lor|, |lsl|, |lxor|, |mod| et |or| \\
% Name.Builtin & les fonctions |not|, |incr|, |decr|, |fst| et |snd| \\
% Name.Type & the name of a type of OCaml \\
% Name.Field & the name of a field of a module \\
@@ -2351,15 +2406,15 @@ piton_version = "3.0b" -- 2024/05/23
% TypeParameter & the parameters of the types \\
% Comment & the comments, between |(*| et |*)|; these comments may be nested \\
% Keyword.Constant & |true| et |false| \\
-% Keyword & the following keywords:
-% |assert|, |as|, |begin|, |class|, |constraint|, |done|,
-% |downto|, |do|, |else|, |end|, |exception|, |external|,
-% |for|, |function|, |functor|, |fun| , |if|
-% |include|, |inherit|, |initializer|, |in| , |lazy|, |let|,
-% |match|, |method|, |module|, |mutable|, |new|, |object|,
-% |of|, |open|, |private|, |raise|, |rec|, |sig|,
-% |struct|, |then|, |to|, |try|, |type|,
-% |value|, |val|, |virtual|, |when|, |while| and |with| \\
+% Keyword & the following keywords: |assert|, |as|, |done|, |downto|, |do|,
+% |else|, |exception|, |for|, |function| , |fun|, |if|, |lazy|, |match|,
+% |mutable|, |new|, |of|, |private|, |raise|, |then|, |to|, |try| , |virtual|,
+% |when|, |while| and |with| \\
+% Keyword.Governing & the following keywords: |and|, |begin|, |class|, |constraint|,
+% |end|, |external|, |functor|, |include|, |inherit|, |initializer|,
+% |in|, |let|, |method|, |module|, |object|, |open|, |rec|, |sig|,
+% |struct|, |type| and |val|. \\
+% Identifier & the identifiers. \\
% \bottomrule
% \end{tabularx}
% \end{center}
@@ -2418,6 +2473,7 @@ piton_version = "3.0b" -- 2024/05/23
% |return|, |static|, |static_assert|, |struct|, |switch|, |thread_local|, |throw|,
% |typedef|, |union|, |using|, |virtual|, |volatile| and |while|
% \\
+% Identifier & the identifiers. \\
% \bottomrule
% \end{tabularx}
% \end{center}
@@ -2513,7 +2569,9 @@ piton_version = "3.0b" -- 2024/05/23
% String & the strings (between \texttt{"}) \\
% Comment & the comments (which begin with |#|) \\
% Comment.LaTeX & the comments beginning with \texttt{\#>}, which are composed by
-% \pkg{piton} as LaTeX code (merely named ``LaTeX comments'' in this document) \\
+% \pkg{piton} as LaTeX code (merely named ``LaTeX comments'' in this document)
+% \\
+% Identifier & the identifiers. \\
% \bottomrule
% \end{tabularx}
% \end{center}
@@ -2550,6 +2608,7 @@ piton_version = "3.0b" -- 2024/05/23
% |moredirectives| \\
% Tag & the ``tags'' defines by the key |tag| (the lexical units detected within
% the tag will also be formatted with their own style) \\
+% Identifier & the identifiers. \\
% \bottomrule
% \end{tabularx}
% \end{center}
@@ -2705,6 +2764,14 @@ piton_version = "3.0b" -- 2024/05/23
% \end{macrocode}
%
% \bigskip
+% The command |\text| provided by the package \pkg{amstext} will be used to
+% allow the use of the command |\pion{...}| (with the standard syntax) in
+% mathematical mode.
+% \begin{macrocode}
+\RequirePackage { amstext }
+% \end{macrocode}
+%
+% \bigskip
% \begin{macrocode}
\cs_new_protected:Npn \@@_error:n { \msg_error:nn { piton } }
\cs_new_protected:Npn \@@_warning:n { \msg_warning:nn { piton } }
@@ -2835,25 +2902,12 @@ piton_version = "3.0b" -- 2024/05/23
beamer .bool_gset:N = \g_@@_beamer_bool ,
beamer .default:n = true ,
-
- math-comments .code:n = \@@_error:n { moved~to~preamble } ,
- comment-latex .code:n = \@@_error:n { moved~to~preamble } ,
unknown .code:n = \@@_error:n { Unknown~key~for~package }
}
% \end{macrocode}
%
%
-% \bigskip
-% \begin{macrocode}
-\@@_msg_new:nn { moved~to~preamble }
- {
- The~key~'\l_keys_key_str'~*must*~now~be~used~with~
- \token_to_str:N \PitonOptions`in~the~preamble~of~your~
- document.\\
- That~key~will~be~ignored.
- }
-% \end{macrocode}
%
% \begin{macrocode}
\@@_msg_new:nn { Unknown~key~for~package }
@@ -2957,7 +3011,11 @@ piton_version = "3.0b" -- 2024/05/23
% \begin{macrocode}
\lua_now:n
{
- piton.ListCommands = lpeg.P ( false )
+ piton.BeamerCommands = lpeg.P ( "\\uncover" )
+ + "\\only" + "\\visible" + "\\invisible" + "\\alert" + "\\action"
+ piton.beamer_environments = { "uncoverenv" , "onlyenv" , "visibleenv" ,
+ "invisibleenv" , "alertenv" , "actionenv" }
+ piton.DetectedCommands = lpeg.P ( false )
piton.last_code = ''
piton.last_language = ''
}
@@ -2975,8 +3033,8 @@ piton_version = "3.0b" -- 2024/05/23
% \end{macrocode}
%
% \medskip
-% Each time the command |\PitonInputFile| of \pkg{piton} is
-% used, the code of that environment will be stored in the following global string.
+% Each time an environment of \pkg{piton} is used, the informatic code in the
+% body of that environment will be stored in the following global string.
% \begin{macrocode}
\tl_new:N \g_piton_last_code_tl
% \end{macrocode}
@@ -3006,27 +3064,31 @@ piton_version = "3.0b" -- 2024/05/23
%
%
% \medskip
-% We will compute (with Lua) the numbers of lines of the Python code and store
+% We will compute (with Lua) the numbers of lines of the listings (or
+% \emph{chunks} of listings when |split-on-empty-lines| is in force) and store
% it in the following counter.
% \begin{macrocode}
\int_new:N \l_@@_nb_lines_int
% \end{macrocode}
%
-% The same for the number of non-empty lines of the Python codes.
+% The same for the number of non-empty lines of the listings.
% \begin{macrocode}
\int_new:N \l_@@_nb_non_empty_lines_int
% \end{macrocode}
%
% The following counter will be used to count the lines during the composition.
-% It will count all the lines, empty or not empty. It won't be used to print the
-% numbers of the lines.
+% It will take into account all the lines, empty or not empty. It won't be used
+% to print the numbers of the lines but will be used to allow or disallow line
+% breaks (when |splittable| is in force) and for the color of the background
+% (when |background-color| is used with a \emph{list} of colors).
% \begin{macrocode}
\int_new:N \g_@@_line_int
% \end{macrocode}
%
% \medskip
% The following token list will contain the (potential) information to write
-% on the |aux| (to be used in the next compilation).
+% on the |aux| (to be used in the next compilation). The technic of the
+% auxiliary file will be used when the key |width| is used with the value~|min|.
% \begin{macrocode}
\tl_new:N \g_@@_aux_tl
% \end{macrocode}
@@ -3034,26 +3096,31 @@ piton_version = "3.0b" -- 2024/05/23
% \medskip
% The following counter corresponds to the key |splittable| of |\PitonOptions|.
% If the value of |\l_@@_splittable_int| is equal to $n$, then no line break can
-% occur within the first $n$~lines or the last $n$~lines of the listings.
+% occur within the first $n$~lines or the last $n$~lines of a listing (or a
+% \emph{chunk} of listings when the key |split-on-empty-lines| is in force).
% \begin{macrocode}
\int_new:N \l_@@_splittable_int
% \end{macrocode}
%
% \medskip
+% An initial value of |splittable| equal to 100 is equivalent to say that the
+% environments |{Piton}| are unbreakable.
+% \begin{macrocode}
+\int_set:Nn \l_@@_splittable_int { 100 }
+% \end{macrocode}
+%
+% \medskip
% When the key |split-on-empty-lines| will be in force, then the following token
% list will be inserted between the chunks of code (the informatic code provided
-% by the final user is split in chunks on the empty lines in the code).
+% by the final user is split in chunks on the empty lines in the code).
% \begin{macrocode}
\tl_new:N \l_@@_split_separation_tl
-\tl_set:Nn \l_@@_split_separation_tl { \vspace{\baselineskip} \vspace{-1.25pt} }
+\tl_set:Nn \l_@@_split_separation_tl
+ { \vspace { \baselineskip } \vspace { -1.25pt } }
% \end{macrocode}
+% That parameter must contain elements to be inserted in \emph{vertical} mode by
+% TeX.
%
-% \medskip
-% An initial value of |splittable| equal to 100 is equivalent to say that the
-% environments |{Piton}| are unbreakable.
-% \begin{macrocode}
-\int_set:Nn \l_@@_splittable_int { 100 }
-% \end{macrocode}
%
%
% \medskip
@@ -3213,11 +3280,6 @@ piton_version = "3.0b" -- 2024/05/23
\dim_set:Nn \l_@@_numbers_sep_dim { 0.7 em }
% \end{macrocode}
%
-% \medskip
-% The tabulators will be replaced by the content of the following token list.
-% \begin{macrocode}
-\tl_new:N \l_@@_tab_tl
-% \end{macrocode}
%
% \medskip
% Be careful. The following sequence |\g_@@_languages_seq| is not the list of
@@ -3233,30 +3295,26 @@ piton_version = "3.0b" -- 2024/05/23
%
% \medskip
% \begin{macrocode}
-\cs_new_protected:Npn \@@_set_tab_tl:n #1
- {
- \tl_clear:N \l_@@_tab_tl
- \prg_replicate:nn { #1 }
- { \tl_put_right:Nn \l_@@_tab_tl { ~ } }
- }
-\@@_set_tab_tl:n { 4 }
+\int_new:N \l_@@_tab_size_int
+\int_set:Nn \l_@@_tab_size_int { 4 }
% \end{macrocode}
%
-% \medskip
-% When the key |show-spaces| is in force, |\l_@@_tab_tl| will be replaced by an
-% arrow by using the following command.
% \begin{macrocode}
-\cs_new_protected:Npn \@@_convert_tab_tl:
- {
- \hbox_set:Nn \l_tmpa_box { \l_@@_tab_tl }
- \dim_set:Nn \l_tmpa_dim { \box_wd:N \l_tmpa_box }
- \tl_set:Nn \l_@@_tab_tl
+\cs_new_protected:Npn \@@_tab:
+ {
+ \bool_if:NTF \l_@@_show_spaces_bool
{
+ \hbox_set:Nn \l_tmpa_box
+ { \prg_replicate:nn \l_@@_tab_size_int { ~ } }
+ \dim_set:Nn \l_tmpa_dim { \box_wd:N \l_tmpa_box }
\( \mathcolor { gray }
- { \hbox_to_wd:nn \l_tmpa_dim { \rightarrowfill } \) }
+ { \hbox_to_wd:nn \l_tmpa_dim { \rightarrowfill } } \)
}
+ { \hbox:n { \prg_replicate:nn \l_@@_tab_size_int { ~ } } }
+ \int_gadd:Nn \g_@@_indentation_int \l_@@_tab_size_int
}
% \end{macrocode}
+%
%
% \medskip
% The following integer corresponds to the key |gobble|.
@@ -3284,18 +3342,6 @@ piton_version = "3.0b" -- 2024/05/23
{ \int_gincr:N \g_@@_indentation_int }
% \end{macrocode}
%
-% \medskip
-% The following command |\@@_beamer_command:n| executes the argument
-% corresponding to its argument but also stores it in |\l_@@_beamer_command_str|.
-% That string is used only in the error message ``|cr~not~allowed|'' raised when
-% there is a carriage return in the mandatory argument of that command.
-% \begin{macrocode}
-\cs_new_protected:Npn \@@_beamer_command:n #1
- {
- \str_set:Nn \l_@@_beamer_command_str { #1 }
- \use:c { #1 }
- }
-% \end{macrocode}
%
% \bigskip
% In the environment |{Piton}|, the command |\label| will be linked to the
@@ -3369,11 +3415,19 @@ piton_version = "3.0b" -- 2024/05/23
}
% \end{macrocode}
%
+%
+% \bigskip
+% The spaces at the end of a line of code are deleted by \pkg{piton}.
+% However, it's not actually true: they are replace by |\@@_trailing_space:|.
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_trailing_space: { }
+% \end{macrocode}
+% When we have to rescan some pieces of code with |\@@_piton:n|, we will set
+% |\@@_trailing_space:| equal to |\space|.
%
% \bigskip
% \subsubsection{Treatment of a line of code}
%
-% The following command is only used once.
% \begin{macrocode}
\cs_new_protected:Npn \@@_replace_spaces:n #1
{
@@ -3444,14 +3498,14 @@ piton_version = "3.0b" -- 2024/05/23
{
\bool_if:nF
{
- \str_if_eq_p:nn { #1 } { \PitonStyle {Prompt}{} }
+ \str_if_eq_p:nn { #1 } { \PitonStyle { Prompt } { } }
&&
\l_@@_skip_empty_lines_bool
}
{ \int_gincr:N \g_@@_visual_line_int }
\bool_if:nT
{
- ! \str_if_eq_p:nn { #1 } { \PitonStyle {Prompt}{} }
+ ! \str_if_eq_p:nn { #1 } { \PitonStyle { Prompt } { } }
||
( ! \l_@@_skip_empty_lines_bool && \l_@@_label_empty_lines_bool )
}
@@ -3579,24 +3633,63 @@ piton_version = "3.0b" -- 2024/05/23
% \end{macrocode}
%
% \bigskip
+% The command |\@@_newline:| will be inserted by Lua between two lines of the
+% informatic listing.
+% \begin{itemize}
+% \item In fact, it will be inserted between two commands
+% |\@@_begin_line:|...|\@@_end_of_line:|.
+% \item When the key |break-lines-in-Piton| is in force, a line of the
+% informatic code (the \emph{input}) may result in several lines in the PDF (the
+% \emph{output}).
+% \item |\@@_newline:| has a rather complex behaviour because it may close and
+% open |\vtop|s and finish and start paragraphs.
+% \end{itemize}
% \begin{macrocode}
\cs_new_protected:Npn \@@_newline:
{
+% \end{macrocode}
+% We recall that |\g_@@_line_int| is \emph{not} used for the number of line
+% printed in the PDF (when |line-numbers| is in force)...
+% \begin{macrocode}
\int_gincr:N \g_@@_line_int
+% \end{macrocode}
+% ... it will be used to allow or disallow page breaks (the final user controls
+% that behaviour with the key |splittable|).
+% \begin{macrocode}
\int_compare:nNnT \g_@@_line_int > { \l_@@_splittable_int - 1 }
{
\int_compare:nNnT
- { \l_@@_nb_lines_int - \g_@@_line_int } > \l_@@_splittable_int
+ { \l_@@_nb_lines_int - \g_@@_line_int + 1 } > \l_@@_splittable_int
+% \end{macrocode}
+% Now, we allow a page break after the current line of code.
+% \begin{macrocode}
{
\egroup
\bool_if:NT \g_@@_footnote_bool \endsavenotes
- \par \mode_leave_vertical:
+ \par
+% \end{macrocode}
+% Each non-splittable block of lines is composed in a |\vtop| of
+% TeX inserted in a paragraph of TeX.
+% \begin{itemize}
+% \item In the previous lines, we have closed a |\vtop| (with |\egroup|) and a
+% paragraph (with |\par|).
+% \item Now, we start a new paragraph (with |\mode_leave_vertical:|) and open a
+% |\vtop| (with |\vtop \bgroup|).
+% \end{itemize}
+% \begin{macrocode}
+ \mode_leave_vertical:
\bool_if:NT \g_@@_footnote_bool \savenotes
\vtop \bgroup
+% \end{macrocode}
+% And, in that |\vtop|, of course, we will put a box for each line of the
+% informatic listing (but a line of the informatic listing may be formatted as a
+% box of several lines when |break-lines-in-Piton| is in force).
+% \begin{macrocode}
}
}
}
% \end{macrocode}
+% After the command |\@@_newline:|, we will have a command |\@@_begin_line:|.
%
% \bigskip
% \begin{macrocode}
@@ -3637,6 +3730,8 @@ piton_version = "3.0b" -- 2024/05/23
\bool_new:N \l_@@_skip_empty_lines_bool
\bool_set_true:N \l_@@_skip_empty_lines_bool
\bool_new:N \l_@@_line_numbers_absolute_bool
+\tl_new:N \l_@@_line_numbers_format_bool
+\tl_set:Nn \l_@@_line_numbers_format_tl { \footnotesize \color { gray } }
\bool_new:N \l_@@_label_empty_lines_bool
\bool_set_true:N \l_@@_label_empty_lines_bool
\int_new:N \l_@@_number_lines_start_int
@@ -3667,12 +3762,8 @@ piton_version = "3.0b" -- 2024/05/23
false .code:n = \bool_set_false:N \l_@@_line_numbers_bool ,
start .code:n =
- \bool_if:NTF \l_@@_in_PitonOptions_bool
- { Invalid~key }
- {
- \bool_set_true:N \l_@@_line_numbers_bool
- \int_set:Nn \l_@@_number_lines_start_int { #1 }
- } ,
+ \bool_set_true:N \l_@@_line_numbers_bool
+ \int_set:Nn \l_@@_number_lines_start_int { #1 } ,
start .value_required:n = true ,
skip-empty-lines .code:n =
@@ -3699,11 +3790,7 @@ piton_version = "3.0b" -- 2024/05/23
{
\bool_set_true:N \l_@@_line_numbers_absolute_bool
\bool_set_false:N \l_@@_skip_empty_lines_bool
- }
- \bool_lazy_or:nnF
- \l_@@_in_PitonInputFile_bool
- \l_@@_in_PitonOptions_bool
- { \@@_error:n { Invalid~key } } ,
+ } ,
absolute .value_forbidden:n = true ,
resume .code:n =
@@ -3715,6 +3802,9 @@ piton_version = "3.0b" -- 2024/05/23
sep .dim_set:N = \l_@@_numbers_sep_dim ,
sep .value_required:n = true ,
+ format .tl_set:N = \l_@@_line_numbers_format_tl ,
+ format .value_required:n = true ,
+
unknown .code:n = \@@_error:n { Unknown~key~for~line-numbers }
}
% \end{macrocode}
@@ -3730,9 +3820,17 @@ piton_version = "3.0b" -- 2024/05/23
% First, we put keys that should be available only in the preamble.
% \begin{macrocode}
detected-commands .code:n =
- \lua_now:n { piton.addListCommands('#1') } ,
+ \lua_now:n { piton.addDetectedCommands('#1') } ,
detected-commands .value_required:n = true ,
detected-commands .usage:n = preamble ,
+ detected-beamer-commands .code:n =
+ \lua_now:n { piton.addBeamerCommands('#1') } ,
+ detected-beamer-commands .value_required:n = true ,
+ detected-beamer-commands .usage:n = preamble ,
+ detected-beamer-environments .code:n =
+ \lua_now:n { piton.addBeamerEnvironments('#1') } ,
+ detected-beamer-environments .value_required:n = true ,
+ detected-beamer-environments .usage:n = preamble ,
% \end{macrocode}
%
% Remark that the command |\lua_escape:n| is fully expandable. That's why we use
@@ -3849,11 +3947,9 @@ piton_version = "3.0b" -- 2024/05/23
} ,
left-margin .value_required:n = true ,
- tab-size .code:n = \@@_set_tab_tl:n { #1 } ,
+ tab-size .int_set:N = \l_@@_tab_size_int ,
tab-size .value_required:n = true ,
- show-spaces .code:n =
- \bool_set_true:N \l_@@_show_spaces_bool
- \@@_convert_tab_tl: ,
+ show-spaces .bool_set:N = \l_@@_show_spaces_bool ,
show-spaces .value_forbidden:n = true ,
show-spaces-in-strings .code:n = \tl_set:Nn \l_@@_space_tl { ⣠} , % U+2423
show-spaces-in-strings .value_forbidden:n = true ,
@@ -3939,7 +4035,7 @@ piton_version = "3.0b" -- 2024/05/23
% When using |\NewPitonEnvironment| a user may use |\PitonOptions| inside.
% However, the set of keys available should be different that in standard
% |\PitonOptions|. That's why we define a version of |\PitonOptions| with no
-% restrection on the set of available keys and we will link that version to
+% restriction on the set of available keys and we will link that version to
% |\PitonOptions| in such environment.
% \begin{macrocode}
\NewDocumentCommand \@@_fake_PitonOptions { }
@@ -3954,7 +4050,9 @@ piton_version = "3.0b" -- 2024/05/23
%
% \medskip
% The following counter will be used to count the lines in the code when the
-% user requires the numbers of the lines to be printed (with |line-numbers|).
+% user requires the numbers of the lines to be printed (with |line-numbers|)
+% whereas the counter |\g_@@_line_int| previously defined is \emph{not} used for
+% that functionality.
%
% \begin{macrocode}
\int_new:N \g_@@_visual_line_int
@@ -3974,9 +4072,12 @@ piton_version = "3.0b" -- 2024/05/23
\hbox_overlap_left:n
{
{
- \color { gray }
- \footnotesize
- \int_to_arabic:n \g_@@_visual_line_int
+ \l_@@_line_numbers_format_tl
+% \end{macrocode}
+% We put braces. Thus, the user may use the key |line-numbers/format| with a
+% value such as |\fbox|.
+% \begin{macrocode}
+ { \int_to_arabic:n \g_@@_visual_line_int }
}
\skip_horizontal:N \l_@@_numbers_sep_dim
}
@@ -4164,18 +4265,29 @@ piton_version = "3.0b" -- 2024/05/23
\NewDocumentCommand { \@@_piton_standard } { m }
{
\group_begin:
- \ttfamily
% \end{macrocode}
% The following tuning of LuaTeX in order to avoid all break of lines on the
% hyphens.
% \begin{macrocode}
\automatichyphenmode = 1
+% \end{macrocode}
+% Remark that the argument of |\piton| (with the normal syntax) is expanded in
+% the TeX sens, (see the |\tl_set:Nx| below) and that's why we can provide the
+% following escapes to the final user:
+% \begin{macrocode}
\cs_set_eq:NN \\ \c_backslash_str
\cs_set_eq:NN \% \c_percent_str
\cs_set_eq:NN \{ \c_left_brace_str
\cs_set_eq:NN \} \c_right_brace_str
\cs_set_eq:NN \$ \c_dollar_str
+% \end{macrocode}
+% The standard command |\â£| is \emph{not} expandable and we need here expandable
+% commands. With the following code, we define an expandable command.
+% \begin{macrocode}
\cs_set_eq:cN { ~ } \space
+% \end{macrocode}
+%
+% \begin{macrocode}
\cs_set_protected:Npn \@@_begin_line: { }
\cs_set_protected:Npn \@@_end_line: { }
\tl_set:Nx \l_tmpa_tl
@@ -4196,7 +4308,14 @@ piton_version = "3.0b" -- 2024/05/23
\bool_if:NT \l_@@_break_lines_in_piton_bool
{ \regex_replace_all:nnN { \x20 } { \x20 } \l_tmpa_tl }
}
- \l_tmpa_tl
+% \end{macrocode}
+% The command |\text| is provided by the package \pkg{amstext} (loaded by \pkg{piton}).
+% \begin{macrocode}
+ \if_mode_math:
+ \text { \ttfamily \l_tmpa_tl }
+ \else:
+ \ttfamily \l_tmpa_tl
+ \fi:
\group_end:
}
% \end{macrocode}
@@ -4229,7 +4348,7 @@ piton_version = "3.0b" -- 2024/05/23
%
% \bigskip
% The following command is not a user command. It will be used when we will
-% have to ``rescan'' some chunks of Python code. For example, it will be the
+% have to ``rescan'' some chunks of informatic code. For example, it will be the
% initial value of the Piton style |InitialValues| (the default values of the
% arguments of a Python function).
% \begin{macrocode}
@@ -4240,6 +4359,7 @@ piton_version = "3.0b" -- 2024/05/23
\cs_set_protected:Npn \@@_end_line: { }
\cs_set:cpn { pitonStyle _ \l_piton_language_str _ Prompt } { }
\cs_set:cpn { pitonStyle _ Prompt } { }
+ \cs_set_eq:NN \@@_trailing_space: \space
\bool_lazy_or:nnTF
\l_@@_break_lines_in_piton_bool
\l_@@_break_lines_in_Piton_bool
@@ -4261,50 +4381,12 @@ piton_version = "3.0b" -- 2024/05/23
}
\bool_if:NT \l_@@_show_spaces_bool
{ \regex_replace_all:nnN { \x20 } { ⣠} \l_tmpa_tl } % U+2423
- \l_tmpa_tl
+ \exp_args:No \@@_replace_spaces:n \l_tmpa_tl
\group_end:
}
% \end{macrocode}
%
-% \bigskip
-% The following command is similar to the previous one but raise a fatal error if
-% its argument contains a carriage return.
-% \begin{macrocode}
-\cs_new_protected:Npn \@@_piton_no_cr:n #1
- {
- \group_begin:
- \cs_set_protected:Npn \@@_begin_line: { }
- \cs_set_protected:Npn \@@_end_line: { }
- \cs_set:cpn { pitonStyle _ \l_piton_language_str _ Prompt } { }
- \cs_set:cpn { pitonStyle _ Prompt } { }
- \cs_set_protected:Npn \@@_newline:
- { \msg_fatal:nn { piton } { cr~not~allowed } }
- \bool_lazy_or:nnTF
- \l_@@_break_lines_in_piton_bool
- \l_@@_break_lines_in_Piton_bool
- {
- \tl_set:Nx \l_tmpa_tl
- {
- \lua_now:e
- { piton.ParseTer('\l_piton_language_str',token.scan_string()) }
- { #1 }
- }
- }
- {
- \tl_set:Nx \l_tmpa_tl
- {
- \lua_now:e
- { piton.Parse('\l_piton_language_str',token.scan_string()) }
- { #1 }
- }
- }
- \bool_if:NT \l_@@_show_spaces_bool
- { \regex_replace_all:nnN { \x20 } { ⣠} \l_tmpa_tl } % U+2423
- \l_tmpa_tl
- \group_end:
- }
-% \end{macrocode}
-%
+%
% \bigskip
% Despite its name, |\@@_pre_env:| will be used both in |\PitonInputFile| and
% in the environments such as |{Piton}|.
@@ -4347,7 +4429,7 @@ piton_version = "3.0b" -- 2024/05/23
{
\hbox_set:Nn \l_tmpa_box
{
- \footnotesize
+ \l_@@_line_numbers_format_tl
\bool_if:NTF \l_@@_skip_empty_lines_bool
{
\lua_now:n
@@ -4448,14 +4530,7 @@ piton_version = "3.0b" -- 2024/05/23
}
{
\group_end:
- \mode_if_vertical:TF \mode_leave_vertical: \newline
-% \end{macrocode}
-% We count with Lua the number of lines of the argument. The result will be
-% stored by Lua in |\l_@@_nb_lines_int|. That information will be used to allow
-% or disallow page breaks. The use of |token.scan_argument| avoids problems with
-% the delimiters of the Lua string.
-% \begin{macrocode}
- \lua_now:n { piton.CountLines(token.scan_argument()) } { ##1 }
+ \mode_if_vertical:TF { \noindent \mode_leave_vertical: } \newline
% \end{macrocode}
% The first argument of the following function is the name of the Lua function
% that will be applied to the second argument in order to count the number of lines.
@@ -4463,7 +4538,8 @@ piton_version = "3.0b" -- 2024/05/23
\@@_compute_left_margin:nn { CountNonEmptyLines } { ##1 }
\@@_compute_width:
\ttfamily
- \dim_zero:N \parskip
+ \dim_zero:N \parskip
+ \noindent % added 2024/08/07
% \end{macrocode}
%
% Now, the key |write|.
@@ -4545,7 +4621,7 @@ piton_version = "3.0b" -- 2024/05/23
% \bigskip
% The following function will be used when the key |split-on-empty-lines| is not
% in force. It will gobble the spaces at the beginning of the lines and parse
-% the code. The argument is provided by curryfication.
+% the code. The argument is provided by curryfication.
% \begin{macrocode}
\cs_new_protected:Npn \@@_gobble_parse:n
{
@@ -4726,7 +4802,6 @@ piton_version = "3.0b" -- 2024/05/23
\@@_compute_left_margin:no { CountNonEmptyLinesFile } \l_@@_file_name_str
\@@_compute_width:
\ttfamily
- % \leavevmode
\lua_now:e
{
piton.ParseFile(
@@ -4739,6 +4814,14 @@ piton_version = "3.0b" -- 2024/05/23
\bool_if:NT \l_@@_width_min_bool \@@_width_to_aux:
\group_end:
% \end{macrocode}
+%
+%
+% The following line is to allow programs such as |latexmk| to be aware that the
+% file (read by |\PitonInputFile|) is loaded during the compilation of the LaTeX
+% document.
+% \begin{macrocode}
+ \exp_args:Nx \iow_log:n {(\l_@@_file_name_str)}
+% \end{macrocode}
% We recall that, if we are in Beamer, the command |\PitonInputFile| is
% ``overlay-aware'' and that's why we close now an environment |{uncoverenv}|
% that we have opened at the beginning of the command.
@@ -4818,10 +4901,12 @@ piton_version = "3.0b" -- 2024/05/23
Discard ,
Exception ,
FormattingType ,
+ Identifier.Internal ,
Identifier ,
InitialValues ,
Interpol.Inside ,
Keyword ,
+ Keyword.Governing ,
Keyword.Constant ,
Keyword2 ,
Keyword3 ,
@@ -4854,10 +4939,14 @@ piton_version = "3.0b" -- 2024/05/23
TypeParameter ,
UserFunction ,
% \end{macrocode}
+% |TypeExpression| is an internal style for expressions which defines types in OCaml.
+% \begin{macrocode}
+ TypeExpression ,
+% \end{macrocode}
% Now, specific styles for the languages created with |\NewPitonLanguage| with
% the syntax of \pkg{listings}.
% \begin{macrocode}
- Directive
+ Directive
}
\clist_map_inline:Nn \g_@@_styles_clist
@@ -4879,18 +4968,25 @@ piton_version = "3.0b" -- 2024/05/23
\keys_define:nn { piton / Styles }
{
- String .meta:n = { String.Long = #1 , String.Short = #1 } ,
- Comment.Math .tl_set:c = pitonStyle _ Comment.Math ,
- ParseAgain .tl_set:c = pitonStyle _ ParseAgain ,
- ParseAgain .value_required:n = true ,
- ParseAgain.noCR .tl_set:c = pitonStyle _ ParseAgain.noCR ,
- ParseAgain.noCR .value_required:n = true ,
+ String .meta:n = { String.Long = #1 , String.Short = #1 } ,
+ Comment.Math .tl_set:c = pitonStyle _ Comment.Math ,
+ ParseAgain .tl_set:c = pitonStyle _ ParseAgain ,
+ ParseAgain .value_required:n = true ,
unknown .code:n =
\@@_error:n { Unknown~key~for~SetPitonStyle }
}
% \end{macrocode}
%
% \bigskip
+% \begin{macrocode}
+\SetPitonStyle[OCaml]
+ {
+ TypeExpression =
+ \SetPitonStyle { Identifier = \PitonStyle { Name.Type } } \@@_piton:n
+ }
+% \end{macrocode}
+%
+% \bigskip
% We add the word |String| to the list of the styles because we will use that
% list in the error message for an unknown key in |\SetPitonStyle|.
%
@@ -4919,44 +5015,50 @@ piton_version = "3.0b" -- 2024/05/23
% \begin{macrocode}
\SetPitonStyle
{
- Comment = \color[HTML]{0099FF} \itshape ,
- Exception = \color[HTML]{CC0000} ,
- Keyword = \color[HTML]{006699} \bfseries ,
- Keyword.Constant = \color[HTML]{006699} \bfseries ,
- Name.Builtin = \color[HTML]{336666} ,
- Name.Decorator = \color[HTML]{9999FF},
- Name.Class = \color[HTML]{00AA88} \bfseries ,
- Name.Function = \color[HTML]{CC00FF} ,
- Name.Namespace = \color[HTML]{00CCFF} ,
- Name.Constructor = \color[HTML]{006000} \bfseries ,
- Name.Field = \color[HTML]{AA6600} ,
- Name.Module = \color[HTML]{0060A0} \bfseries ,
- Name.Table = \color[HTML]{309030} ,
- Number = \color[HTML]{FF6600} ,
- Operator = \color[HTML]{555555} ,
- Operator.Word = \bfseries ,
- String = \color[HTML]{CC3300} ,
- String.Doc = \color[HTML]{CC3300} \itshape ,
- String.Interpol = \color[HTML]{AA0000} ,
- Comment.LaTeX = \normalfont \color[rgb]{.468,.532,.6} ,
- Name.Type = \color[HTML]{336666} ,
- InitialValues = \@@_piton:n ,
- Interpol.Inside = \color{black}\@@_piton:n ,
- TypeParameter = \color[HTML]{336666} \itshape ,
- Preproc = \color[HTML]{AA6600} \slshape ,
- Identifier = \@@_identifier:n ,
- Directive = \color[HTML]{AA6600} ,
- Tag = \colorbox{gray!10},
- UserFunction = ,
- Prompt = ,
- ParseAgain.noCR = \@@_piton_no_cr:n ,
- ParseAgain = \@@_piton:n ,
- Discard = \use_none:n
+ Comment = \color[HTML]{0099FF} \itshape ,
+ Exception = \color[HTML]{CC0000} ,
+ Keyword = \color[HTML]{006699} \bfseries ,
+ Keyword.Governing = \color[HTML]{006699} \bfseries ,
+ Keyword.Constant = \color[HTML]{006699} \bfseries ,
+ Name.Builtin = \color[HTML]{336666} ,
+ Name.Decorator = \color[HTML]{9999FF},
+ Name.Class = \color[HTML]{00AA88} \bfseries ,
+ Name.Function = \color[HTML]{CC00FF} ,
+ Name.Namespace = \color[HTML]{00CCFF} ,
+ Name.Constructor = \color[HTML]{006000} \bfseries ,
+ Name.Field = \color[HTML]{AA6600} ,
+ Name.Module = \color[HTML]{0060A0} \bfseries ,
+ Name.Table = \color[HTML]{309030} ,
+ Number = \color[HTML]{FF6600} ,
+ Operator = \color[HTML]{555555} ,
+ Operator.Word = \bfseries ,
+ String = \color[HTML]{CC3300} ,
+ String.Doc = \color[HTML]{CC3300} \itshape ,
+ String.Interpol = \color[HTML]{AA0000} ,
+ Comment.LaTeX = \normalfont \color[rgb]{.468,.532,.6} ,
+ Name.Type = \color[HTML]{336666} ,
+ InitialValues = \@@_piton:n ,
+ Interpol.Inside = \color{black}\@@_piton:n ,
+ TypeParameter = \color[HTML]{336666} \itshape ,
+ Preproc = \color[HTML]{AA6600} \slshape ,
+% \end{macrocode}
+% We need the command |\@@_identifier:n| because of the command
+% |\SetPitonIdentifier|. The command |\@@_identifier:n| will potentially call
+% the style |Identifier| (which is a user-style, not an internal style).
+% \begin{macrocode}
+ Identifier.Internal = \@@_identifier:n ,
+ Identifier = ,
+ Directive = \color[HTML]{AA6600} ,
+ Tag = \colorbox{gray!10},
+ UserFunction = ,
+ Prompt = ,
+ ParseAgain = \@@_piton_no_cr:n ,
+ Discard = \use_none:n
}
% \end{macrocode}
-% The last styles |ParseAgain.noCR| and |ParseAgain| should be considered as
+% The styles |ParseAgain.noCR| should be considered as
% ``internal style'' (not available for the final user). However, maybe we will
-% change that and document these styles for the final user (why not?).
+% change that and document that style for the final user.
%
% \medskip
% If the key |math-comments| has been used at load-time, we change the style
@@ -5001,7 +5103,10 @@ piton_version = "3.0b" -- 2024/05/23
\cs_new_protected:Npn \@@_identifier:n #1
{
\cs_if_exist_use:cF { PitonIdentifier _ \l_piton_language_str _ #1 }
- { \cs_if_exist_use:c { PitonIdentifier _ #1 } }
+ {
+ \cs_if_exist_use:cF { PitonIdentifier _ #1 }
+ { \PitonStyle { Identifier } }
+ }
{ #1 }
}
% \end{macrocode}
@@ -5215,9 +5320,13 @@ piton_version = "3.0b" -- 2024/05/23
}
% \end{macrocode}
%
+% We don't give the name |syntax error| for the following error because you
+% should not give a name with a space because such space could be replaced by
+% U+2423 when the key |show-spaces| is in force in the command |\piton|.
% \begin{macrocode}
-\@@_msg_new:nn { syntax~error }
+\@@_msg_new:nn { SyntaxError }
{
+ Syntax~Error.\\
Your~code~of~the~language~"\l_piton_language_str"~is~not~
syntactically~correct.\\
It~won't~be~printed~in~the~PDF~file.
@@ -5225,6 +5334,16 @@ piton_version = "3.0b" -- 2024/05/23
% \end{macrocode}
%
% \begin{macrocode}
+\@@_msg_new:nn { FileError }
+ {
+ File~Error.\\
+ It's~not~possible~to~write~on~the~file~'\l_@@_write_str'.\\
+ \sys_if_shell_unrestricted:F { Be~sure~to~compile~with~'-shell-escape'.\\ }
+ If~you~go~on,~nothing~will~be~written~on~the~file.
+ }
+% \end{macrocode}
+%
+% \begin{macrocode}
\@@_msg_new:nn { begin~marker~not~found }
{
Marker~not~found.\\
@@ -5274,6 +5393,8 @@ piton_version = "3.0b" -- 2024/05/23
break-lines-in-Piton,~
continuation-symbol,~
continuation-symbol-on-indentation,~
+ detected-beamer-commands,~
+ detected-beamer-environments,~
detected-commands,~
end-of-broken-line,~
end-range,~
@@ -5310,18 +5431,6 @@ piton_version = "3.0b" -- 2024/05/23
}
% \end{macrocode}
%
-% \bigskip
-% \begin{macrocode}
-\@@_msg_new:nn { cr~not~allowed }
- {
- You~can't~put~any~carriage~return~in~the~argument~
- of~a~command~\c_backslash_str
- \l_@@_beamer_command_str\ within~an~
- environment~of~'piton'.~You~should~consider~using~the~
- corresponding~environment.\\
- That~error~is~fatal.
- }
-% \end{macrocode}
%
% \bigskip
% \begin{macrocode}
@@ -5386,8 +5495,28 @@ piton_version = "3.0b" -- 2024/05/23
% \begin{macrocode}
F = space ^ 0 * ( ( alpha ^ 1 ) / "\\%0" ) * space ^ 0
}
- function piton.addListCommands( key_value )
- piton.ListCommands = piton.ListCommands + my_lpeg : match ( key_value )
+ function piton.addDetectedCommands( key_value )
+ piton.DetectedCommands = piton.DetectedCommands + my_lpeg : match ( key_value )
+ end
+ function piton.addBeamerCommands( key_value )
+ piton.BeamerCommands
+ = piton.BeamerCommands + my_lpeg : match ( key_value )
+ end
+% \end{macrocode}
+%
+% \begin{macrocode}
+ local function insert(...)
+ local s = piton.beamer_environments
+ for _ , x in ipairs({...}) do table.insert(s,x) end
+ return s
+ end
+ local my_lpeg_bis =
+ P { "E" ,
+ E = ( V "F" * ( "," * V "F" ) ^ 0 ) / insert ,
+ F = space ^ 0 * ( alpha ^ 1 ) * space ^ 0
+ }
+ function piton.addBeamerEnvironments( key_value )
+ piton.beamer_environments = my_lpeg_bis : match ( key_value )
end
\end{luacode*}
%</STY>
@@ -5411,23 +5540,11 @@ piton.comment_latex = "#" .. piton.comment_latex
% \end{macrocode}
%
%
-% \bigskip
-% The following functions are an easy way to safely insert braces (|{| and |}|)
-% in the TeX flow.
-% \begin{macrocode}
-function piton.open_brace ()
- tex.sprint("{")
-end
-function piton.close_brace ()
- tex.sprint("}")
-end
-% \end{macrocode}
-%
% \begin{macrocode}
local function sprintL3 ( s )
tex.sprint ( luatexbase.catcodetables.expl , s )
end
-% \end{uncoverenv}
+% \end{macrocode}
%
% \bigskip
% \subsubsection{Special functions dealing with LPEG}
@@ -5589,7 +5706,7 @@ local identifier = letter * alphanum ^ 0
% On the other hand, the \textsc{lpeg} |Identifier| (with a capital) also returns
% a \emph{capture}.
% \begin{macrocode}
-local Identifier = K ( 'Identifier' , identifier )
+local Identifier = K ( 'Identifier.Internal' , identifier )
% \end{macrocode}
%
% \bigskip
@@ -5648,12 +5765,12 @@ local SkipSpace = Q " " ^ 0
local Punct = Q ( S ".,:;!" )
-local Tab = "\t" * Lc "\\l_@@_tab_tl"
+local Tab = "\t" * Lc [[\@@_tab:]]
% \end{macrocode}
%
% \bigskip
% \begin{macrocode}
-local SpaceIndentation = Lc "\\@@_an_indentation_space:" * Q " "
+local SpaceIndentation = Lc [[\@@_an_indentation_space:]] * Q " "
% \end{macrocode}
%
% \bigskip
@@ -5668,7 +5785,18 @@ local Delim = Q ( S "[({})]" )
% However, when the key |show-spaces-in-strings| is in force, |\\l_@@_space_tl| will
% contain ⣠(U+2423) in order to visualize the spaces.
% \begin{macrocode}
-local VisualSpace = space * Lc "\\l_@@_space_tl"
+local VisualSpace = space * Lc [[\l_@@_space_tl]]
+% \end{macrocode}
+%
+% \bigskip
+% Of course, the \textsc{lpeg} |strict_braces| is for balanced braces (without the
+% question of strings of an informatic language).
+% \begin{macrocode}
+ local strict_braces =
+ P { "E" ,
+ E = ( "{" * V "F" * "}" + ( 1 - S ",{}" ) ) ^ 0 ,
+ F = ( "{" * V "F" * "}" + ( 1 - S "{}" ) ) ^ 0
+ }
% \end{macrocode}
%
% \bigskip
@@ -5687,7 +5815,8 @@ local LPEG_cleaner = { }
% present in strings of the language. However, the syntax for the strings is
% language-dependent. That's why we write a Lua function |Compute_braces| which
% will compute the pattern by taking in as argument a pattern for the strings of
-% the language (at least the shorts strings).
+% the language (at least the shorts strings). The argument of |Compute_braces|
+% must be a pattern \emph{which does no catching}.
% \begin{macrocode}
local function Compute_braces ( lpeg_string ) return
P { "E" ,
@@ -5703,16 +5832,19 @@ local function Compute_braces ( lpeg_string ) return
end
% \end{macrocode}
%
+%
+%
% \bigskip
% The following Lua function will compute the \text{lpeg} |DetectedCommands|
% which is a \textsc{lpeg} with captures).
% \begin{macrocode}
local function Compute_DetectedCommands ( lang , braces ) return
Ct ( Cc "Open"
- * C ( piton.ListCommands * P "{" )
+ * C ( piton.DetectedCommands * P "{" )
* Cc "}"
)
- * ( braces / (function ( s ) return LPEG1[lang] : match ( s ) end ) )
+ * ( braces
+ / ( function ( s ) if s ~= '' then return LPEG1[lang] : match ( s ) end end ) )
* P "}"
* Ct ( Cc "Close" )
end
@@ -5721,9 +5853,10 @@ end
% \bigskip
% \begin{macrocode}
local function Compute_LPEG_cleaner ( lang , braces ) return
- Ct ( ( piton.ListCommands * "{"
- * ( braces
- / ( function ( s ) return LPEG_cleaner[lang] : match ( s ) end ) )
+ Ct ( ( piton.DetectedCommands * "{"
+ * ( braces
+ / ( function ( s )
+ if s ~= '' then return LPEG_cleaner[lang] : match ( s ) end end ) )
* "}"
+ EscapeClean
+ C ( P ( 1 ) )
@@ -5744,28 +5877,20 @@ local BeamerBeginEnvironments = P ( true )
local BeamerEndEnvironments = P ( true )
% \end{macrocode}
%
-% \bigskip
% \begin{macrocode}
-local list_beamer_env =
- { "uncoverenv" , "onlyenv" , "visibleenv" ,
- "invisibleenv" , "alertenv" , "actionenv" }
-% \end{macrocode}
-%
-% \bigskip
-% \begin{macrocode}
-local BeamerNamesEnvironments = P ( false )
-for _ , x in ipairs ( list_beamer_env ) do
- BeamerNamesEnvironments = BeamerNamesEnvironments + x
+piton.BeamerEnvironments = P ( false )
+for _ , x in ipairs ( piton.beamer_environments ) do
+ piton.BeamerEnvironments = piton.BeamerEnvironments + x
end
% \end{macrocode}
-%
+%
% \bigskip
% \begin{macrocode}
BeamerBeginEnvironments =
( space ^ 0 *
L
(
- P "\\begin{" * BeamerNamesEnvironments * "}"
+ P "\\begin{" * piton.BeamerEnvironments * "}"
* ( "<" * ( 1 - P ">" ) ^ 0 * ">" ) ^ -1
)
* "\r"
@@ -5776,11 +5901,12 @@ BeamerBeginEnvironments =
% \begin{macrocode}
BeamerEndEnvironments =
( space ^ 0 *
- L ( P "\\end{" * BeamerNamesEnvironments * "}" )
+ L ( P "\\end{" * piton.BeamerEnvironments * "}" )
* "\r"
) ^ 0
% \end{macrocode}
%
+%
%
% \bigskip
% The following Lua function will be used to compute the \textsc{lpeg} |Beamer|
@@ -5795,14 +5921,14 @@ local function Compute_Beamer ( lang , braces )
local lpeg = L ( P "\\pause" * ( "[" * ( 1 - P "]" ) ^ 0 * "]" ) ^ -1 )
lpeg = lpeg +
Ct ( Cc "Open"
- * C ( ( P "\\uncover" + "\\only" + "\\alert" + "\\visible"
- + "\\invisible" + "\\action" )
+ * C ( piton.BeamerCommands
* ( "<" * ( 1 - P ">" ) ^ 0 * ">" ) ^ -1
* P "{"
)
* Cc "}"
)
- * ( braces / ( function ( s ) return LPEG1[lang] : match ( s ) end ) )
+ * ( braces /
+ ( function ( s ) if s ~= '' then return LPEG1[lang] : match ( s ) end end ) )
* "}"
* Ct ( Cc "Close" )
% \end{macrocode}
@@ -5814,29 +5940,38 @@ local function Compute_Beamer ( lang , braces )
% \begin{macrocode}
lpeg = lpeg +
L ( P "\\alt" * "<" * ( 1 - P ">" ) ^ 0 * ">" * "{" )
- * K ( 'ParseAgain.noCR' , braces )
+ * ( braces /
+ ( function ( s ) if s ~= '' then return LPEG1[lang] : match ( s ) end end ) )
* L ( P "}{" )
- * K ( 'ParseAgain.noCR' , braces )
+ * ( braces /
+ ( function ( s ) if s ~= '' then return LPEG1[lang] : match ( s ) end end ) )
* L ( P "}" )
% \end{macrocode}
%
% \bigskip
-% For |\\temporal|, the specification of the overlays (between angular brackets) is mandatory.
+% For |\\temporal|, the specification of the overlays (between angular brackets)
+% is mandatory.
% \begin{macrocode}
lpeg = lpeg +
L ( ( P "\\temporal" ) * "<" * ( 1 - P ">" ) ^ 0 * ">" * "{" )
- * K ( 'ParseAgain.noCR' , braces )
+ * ( braces
+ / ( function ( s )
+ if s ~= '' then return LPEG1[lang] : match ( s ) end end ) )
* L ( P "}{" )
- * K ( 'ParseAgain.noCR' , braces )
+ * ( braces
+ / ( function ( s )
+ if s ~= '' then return LPEG1[lang] : match ( s ) end end ) )
* L ( P "}{" )
- * K ( 'ParseAgain.noCR' , braces )
+ * ( braces
+ / ( function ( s )
+ if s ~= '' then return LPEG1[lang] : match ( s ) end end ) )
* L ( P "}" )
% \end{macrocode}
%
% \bigskip
% Now, the environments of Beamer.
% \begin{macrocode}
- for _ , x in ipairs ( list_beamer_env ) do
+ for _ , x in ipairs ( piton.beamer_environments ) do
lpeg = lpeg +
Ct ( Cc "Open"
* C (
@@ -5847,7 +5982,11 @@ local function Compute_Beamer ( lang , braces )
)
* (
( ( 1 - P ( "\\end{" .. x .. "}" ) ) ^ 0 )
- / ( function ( s ) return LPEG1[lang] : match ( s ) end )
+ / ( function ( s )
+ if s ~= ''
+ then return LPEG1[lang] : match ( s )
+ end
+ end )
)
* P ( "\\end{" .. x .. "}" )
* Ct ( Cc "Close" )
@@ -5900,14 +6039,14 @@ local Prompt = K ( 'Prompt' , ( ( P ">>>" + "..." ) * P " " ^ -1 ) ^ -1 )
% \bigskip
% The following \textsc{lpeg} |EOL| is for the end of lines.
% \begin{macrocode}
-local EOL =
+local EOL_without_space_indentation =
P "\r"
*
(
( space ^ 0 * -1 )
+
% \end{macrocode}
-% We recall that each line in the Python code we have to parse will be sent
+% We recall that each line of the informatic code we have to parse will be sent
% back to LaTeX between a pair |\@@_begin_line:| --
% |\@@_end_line:|\footnote{Remember that the \texttt{\textbackslash
% @@\_end\_line:} must be explicit because it will be used as marker in order to
@@ -5917,18 +6056,22 @@ local EOL =
Cc "EOL"
*
Ct (
- Lc "\\@@_end_line:"
+ Lc [[\@@_end_line:]]
* BeamerEndEnvironments
* BeamerBeginEnvironments
* PromptHastyDetection
- * Lc "\\@@_newline: \\@@_begin_line:"
+ * Lc [[\@@_newline:\@@_begin_line:]]
* Prompt
)
)
)
- * ( SpaceIndentation ^ 0 * # ( 1 - S " \r" ) ) ^ -1
% \end{macrocode}
%
+% \begin{macrocode}
+local EOL = EOL_without_space_indentation
+ * ( SpaceIndentation ^ 0 * # ( 1 - S " \r" ) ) ^ -1
+% \end{macrocode}
+%
% \bigskip
% The following \textsc{lpeg} |CommentLaTeX| is for what is called in that
% document the ``LaTeX comments''. Since the elements that will be caught must
@@ -5959,6 +6102,17 @@ local Operator =
local OperatorWord =
K ( 'Operator.Word' , P "in" + "is" + "and" + "or" + "not" )
+% \end{macrocode}
+%
+% \smallskip
+% The keyword |in| in a construction such as ``|for i in range(n)|'' must be
+% formatted as a keyword and not as an |Operator.Word|.
+% \begin{macrocode}
+local For = K ( 'Keyword' , P "for" )
+ * Space
+ * Identifier
+ * Space
+ * K ( 'Keyword' , P "in" )
local Keyword =
K ( 'Keyword' ,
@@ -6195,15 +6349,18 @@ local ShortString = SingleShortString + DoubleShortString
% \bigskip
% \paragraph{Beamer}
%
+% The argument of |Compute_braces| must be a pattern \emph{which does no
+% catching} corresponding to the strings of the language.
+%
% \begin{macrocode}
local braces =
Compute_braces
(
- Q ( P "\"" + "r\"" + "R\"" + "f\"" + "F\"" )
- * ( "\"" * ( P "\\\"" + 1 - S "\"" ) ^ 0 * "\"" )
+ ( P "\"" + "r\"" + "R\"" + "f\"" + "F\"" )
+ * ( P "\\\"" + 1 - S "\"" ) ^ 0 * "\""
+
- Q ( P '\'' + 'r\'' + 'R\'' + 'f\'' + 'F\'' )
- * ( '\'' * ( P '\\\'' + 1 - S '\'' ) ^ 0 * '\'' )
+ ( P '\'' + 'r\'' + 'R\'' + 'f\'' + 'F\'' )
+ * ( P '\\\'' + 1 - S '\'' ) ^ 0 * '\''
)
if piton.beamer then Beamer = Compute_Beamer ( 'python' , braces ) end
% \end{macrocode}
@@ -6379,8 +6536,8 @@ local DefFunction =
* SkipSpace
* ( Q "->" * SkipSpace * K ( 'Name.Type' , identifier ) ) ^ -1
% \end{macrocode}
-% Here, we need a \pkg{piton} style |ParseAgain| which will be linked to
-% |\@@_piton:n| (that means that the capture will be parsed once again by
+% Here, we need a \pkg{piton} style |ParseAgain.noCR| which will be linked to
+% |\@@_piton_no_cr:n| (that means that the capture will be parsed once again by
% \pkg{piton}). We could avoid that kind of trick by using a non-terminal of a
% grammar but we have probably here a better legibility.
% \begin{macrocode}
@@ -6413,12 +6570,16 @@ local ExceptionInConsole = Exception * Q ( ( 1 - P "\r" ) ^ 0 ) * EOL
% \bigskip
% \paragraph{The main LPEG for the language Python}
%
+% \begin{macrocode}
+local EndKeyword = Space + Punct + Delim + EOL + Beamer + DetectedCommands + -1
+% \end{macrocode}
+%
% First, the main loop :
% \begin{macrocode}
local Main =
- space ^ 1 * -1
- + space ^ 0 * EOL
- + Space
+ -- space ^ 1 * -1
+ -- + space ^ 0 * EOL
+ Space
+ Tab
+ Escape + EscapeMath
+ CommentLaTeX
@@ -6429,16 +6590,17 @@ local Main =
+ ExceptionInConsole
+ Delim
+ Operator
- + OperatorWord * ( Space + Punct + Delim + EOL + -1 )
+ + OperatorWord * EndKeyword
+ ShortString
+ Punct
+ FromImport
+ RaiseException
+ DefFunction
+ DefClass
- + Keyword * ( Space + Punct + Delim + EOL + -1 )
+ + For
+ + Keyword * EndKeyword
+ Decorator
- + Builtin * ( Space + Punct + Delim + EOL + -1 )
+ + Builtin * EndKeyword
+ Identifier
+ Number
+ Word
@@ -6461,18 +6623,25 @@ LPEG2['python'] =
( space ^ 0 * "\r" ) ^ -1
* BeamerBeginEnvironments
* PromptHastyDetection
- * Lc '\\@@_begin_line:'
+ * Lc [[\@@_begin_line:]]
* Prompt
* SpaceIndentation ^ 0
- * LPEG1['python']
+ * ( space ^ 1 * -1 + space ^ 0 * EOL + Main ) ^ 0
* -1
- * Lc '\\@@_end_line:'
+ * Lc [[\@@_end_line:]]
)
% \end{macrocode}
%
%
% \bigskip
% \subsubsection{The language Ocaml}
+%
+% The following LPEG corresponds to the balanced expressions (balanced according
+% to the parenthesis). Of course, we must write |(1 - S "()")| with outer parenthesis.
+% \begin{macrocode}
+local balanced_parens =
+ P { "E" , E = ( "(" * V "E" * ")" + ( 1 - S "()" ) ) ^ 0 }
+% \end{macrocode}
%
% \begin{macrocode}
local Delim = Q ( P "[|" + "|]" + S "[()]" )
@@ -6497,7 +6666,7 @@ local ModuleType = K ( 'Name.Type' , cap_identifier )
% elsewhere in OCaml.
% \begin{macrocode}
local identifier = ( R "az" + "_" ) * ( R "az" + R "AZ" + S "_'" + digit ) ^ 0
-local Identifier = K ( 'Identifier' , identifier )
+local Identifier = K ( 'Identifier.Internal' , identifier )
% \end{macrocode}
%
%
@@ -6524,7 +6693,7 @@ local OneFieldDefinition =
( K ( 'Keyword' , "mutable" ) * SkipSpace ) ^ -1
* K ( 'Name.Field' , identifier ) * SkipSpace
* Q ":" * SkipSpace
- * K ( 'Name.Type' , expression_for_fields )
+ * K ( 'TypeExpression' , expression_for_fields )
* SkipSpace
local OneField =
@@ -6555,7 +6724,7 @@ local DotNotation =
(
K ( 'Name.Module' , cap_identifier )
* Q "."
- * ( Identifier + Constructor + Q "(" + Q "[" + Q "{" )
+ * ( Identifier + Constructor + Q "(" + Q "[" + Q "{" ) ^ ( -1 )
+
Identifier
* Q "."
@@ -6573,21 +6742,25 @@ local Operator =
local OperatorWord =
K ( 'Operator.Word' ,
- P "and" + "asr" + "land" + "lor" + "lsl" + "lxor" + "mod" + "or" )
+ P "asr" + "land" + "lor" + "lsl" + "lxor" + "mod" + "or" )
-local Keyword =
+
+local governing_keyword = P "and" + "begin" + "class" + "constraint" +
+ "end" + "external" + "functor" + "include" + "inherit" + "initializer" +
+ "in" + "let" + "method" + "module" + "object" + "open" + "rec" + "sig" +
+ "struct" + "type" + "val"
+
+local Keyword =
K ( 'Keyword' ,
- P "assert" + "and" + "as" + "begin" + "class" + "constraint" + "done"
- + "downto" + "do" + "else" + "end" + "exception" + "external" + "for" +
- "function" + "functor" + "fun" + "if" + "include" + "inherit" + "initializer"
- + "in" + "lazy" + "let" + "match" + "method" + "module" + "mutable" + "new" +
- "object" + "of" + "open" + "private" + "raise" + "rec" + "sig" + "struct" +
- "then" + "to" + "try" + "type" + "value" + "val" + "virtual" + "when" +
- "while" + "with" )
- + K ( 'Keyword.Constant' , P "true" + "false" )
+ P "assert" + "as" + "done" + "downto" + "do" + "else" + "exception"
+ + "for" + "function" + "fun" + "if" + "lazy" + "match" + "mutable"
+ + "new" + "of" + "private" + "raise" + "then" + "to" + "try"
+ + "virtual" + "when" + "while" + "with" )
+ + K ( 'Keyword.Constant' , P "true" + "false" )
+ + K ('Keyword.Governing', governing_keyword )
local Builtin =
- K ( 'Name.Builtin' , P "not" + "incr" + "decr" + "fst" + "snd" )
+ K ( 'Name.Builtin' , P "not" + "incr" + "decr" + "fst" + "snd" + "ref" )
% \end{macrocode}
%
% \bigskip
@@ -6604,8 +6777,20 @@ local Exception =
% \paragraph{The characters in OCaml}
%
% \begin{macrocode}
-local Char =
- K ( 'String.Short' , "'" * ( ( 1 - P "'" ) ^ 0 + "\\'" ) * "'" )
+local Char =
+ K ( 'String.Short',
+ P "'" *
+ (
+ ( 1 - S "'\\" )
+ + "\\"
+ * ( S "\\'ntbr \""
+ + digit * digit * digit
+ + P "x" * ( digit + R "af" + R "AF" )
+ * ( digit + R "af" + R "AF" )
+ * ( digit + R "af" + R "AF" )
+ + P "o" * R "03" * R "07" * R "07" )
+ )
+ * "'" )
% \end{macrocode}
%
%
@@ -6613,10 +6798,13 @@ local Char =
% \paragraph{Beamer}
%
% \bigskip
+% The argument of |Compute_braces| must be a pattern \emph{which does no
+% catching} corresponding to the strings of the language.
+%
% \begin{macrocode}
-braces = Compute_braces ( "\"" * ( 1 - S "\"" ) ^ 0 * "\"" )
+local braces = Compute_braces ( "\"" * ( 1 - S "\"" ) ^ 0 * "\"" )
if piton.beamer then
- Beamer = Compute_Beamer ( 'ocaml' , "\"" * ( 1 - S "\"" ) ^ 0 * "\"" )
+ Beamer = Compute_Beamer ( 'ocaml' , braces ) -- modified 2024/07/24
end
% \end{macrocode}
%
@@ -6727,29 +6915,31 @@ local Comment =
% \paragraph{The DefFunction}
%
% \begin{macrocode}
-local balanced_parens =
- P { "E" , E = ( "(" * V "E" * ")" + 1 - S "()" ) ^ 0 }
-% \end{macrocode}
-%
-% \begin{macrocode}
local Argument =
- K ( 'Identifier' , identifier )
- + Q "(" * SkipSpace
- * K ( 'Identifier' , identifier ) * SkipSpace
- * Q ":" * SkipSpace
- * K ( 'Name.Type' , balanced_parens ) * SkipSpace
- * Q ")"
+% \end{macrocode}
+% For the labels of the labeled arguments. Maybe you will, in the future, create
+% a style for those elements.
+% \begin{macrocode}
+ ( Q "~" * Identifier * Q ":" * SkipSpace ) ^ -1
+ *
+ ( K ( 'Identifier.Internal' , identifier )
+ + Q "(" * SkipSpace
+ * K ( 'Identifier.Internal' , identifier ) * SkipSpace
+ * Q ":" * SkipSpace
+ * K ( 'TypeExpression' , balanced_parens ) * SkipSpace
+ * Q ")"
+ )
% \end{macrocode}
%
% Despite its name, then \textsc{lpeg} |DefFunction| deals also with |let open|
% which opens locally a module.
% \begin{macrocode}
local DefFunction =
- K ( 'Keyword' , "let open" )
+ K ( 'Keyword.Governing' , "let open" )
* Space
* K ( 'Name.Module' , cap_identifier )
+
- K ( 'Keyword' , P "let rec" + "let" + "and" )
+ K ( 'Keyword.Governing' , P "let rec" + "let" + "and" )
* Space
* K ( 'Name.Function.Internal' , identifier )
* Space
@@ -6761,7 +6951,7 @@ local DefFunction =
* (
SkipSpace
* Q ":"
- * K ( 'Name.Type' , ( 1 - P "=" ) ^ 0 )
+ * K ( 'TypeExpression' , ( 1 - P "=" ) ^ 0 )
) ^ -1
)
% \end{macrocode}
@@ -6774,10 +6964,10 @@ local DefFunction =
% definitions of \emph{types} of modules.
% \begin{macrocode}
local DefModule =
- K ( 'Keyword' , "module" ) * Space
+ K ( 'Keyword.Governing' , "module" ) * Space
*
(
- K ( 'Keyword' , "type" ) * Space
+ K ( 'Keyword.Governing' , "type" ) * Space
* K ( 'Name.Type' , cap_identifier )
+
K ( 'Name.Module' , cap_identifier ) * SkipSpace
@@ -6812,26 +7002,46 @@ local DefModule =
) ^ -1
)
+
- K ( 'Keyword' , P "include" + "open" )
+ K ( 'Keyword.Governing' , P "include" + "open" )
* Space * K ( 'Name.Module' , cap_identifier )
% \end{macrocode}
+%
%
% \bigskip
-% \paragraph{The parameters of the types}
-%
+% \paragraph{The DefType}\par
+%
% \begin{macrocode}
-local TypeParameter = K ( 'TypeParameter' , "'" * alpha * # ( 1 - P "'" ) )
+local TypeParameter =
+ K ( 'TypeParameter' , "'" * alpha * ( # ( 1 - P "'" ) + -1 ) )
+% \end{macrocode}
+%
+%
+% \bigskip
+% The following LPEG is for the instructions of definitions of types (which
+% begin with |type|).
+% \begin{macrocode}
+local DefType =
+ K ( 'Keyword.Governing' , "type" )
+ * Space
+ * WithStyle
+ (
+ 'TypeExpression' ,
+ ( Q ( 1 - P ";;" - P "\r" ) + EOL_without_space_indentation ) ^ 0
+ )
+ * ( # governing_keyword + Q ";;" + -1 )
% \end{macrocode}
%
% \bigskip
% \paragraph{The main LPEG for the language OCaml}
%
+% \begin{macrocode}
+local EndKeyword = Space + Punct + Delim + EOL + Beamer + DetectedCommands + -1
+% \end{macrocode}
+%
% First, the main loop :
% \begin{macrocode}
local Main =
- space ^ 1 * -1
- + space ^ 0 * EOL
- + Space
+ Space
+ Tab
+ Escape + EscapeMath
+ Beamer
@@ -6841,15 +7051,22 @@ local Main =
+ Comment
+ Delim
+ Operator
+% \end{macrocode}
+% For the labels of the labeled arguments. Maybe you will, in the future, create
+% a style for those elements.
+% \begin{macrocode}
+ + Q ( "~" ) * Identifier * ( Q ":" ) ^ -1
+ + Q ":" * # (1 - P":") * SkipSpace
+ * K ( 'TypeExpression' , balanced_parens ) * SkipSpace * Q ")"
+ Punct
- + FromImport
+ Exception
+ DefFunction
+ DefModule
+ + DefType
+ Record
- + Keyword * ( Space + Punct + Delim + EOL + -1 )
- + OperatorWord * ( Space + Punct + Delim + EOL + -1 )
- + Builtin * ( Space + Punct + Delim + EOL + -1 )
+ + Keyword * EndKeyword
+ + OperatorWord * EndKeyword
+ + Builtin * EndKeyword
+ DotNotation
+ Constructor
+ Identifier
@@ -6867,18 +7084,31 @@ LPEG1['ocaml'] = Main ^ 0
% \texttt{\textbackslash @@\_begin\_line:}}.
% \begin{macrocode}
LPEG2['ocaml'] =
- Ct (
+ Ct (
+% \end{macrocode}
+% The following lines are in order to allow, in |\piton| (and not in |{Piton}|),
+% judments of type (such as |f : my_type -> 'a list|) or single expressions of
+% type such as |my_type -> 'a list| (in that case, the argument of |\piton|
+% \emph{must} begin by a colon).
+% \begin{macrocode}
+ ( P ":" + Identifier * SkipSpace * Q ":" )
+ * SkipSpace
+ * K ( 'TypeExpression' , ( 1 - P "\r" ) ^ 0 )
+ +
+% \end{macrocode}
+% Now, the main part.
+% \begin{macrocode}
( space ^ 0 * "\r" ) ^ -1
* BeamerBeginEnvironments
- * Lc '\\@@_begin_line:'
+ * Lc [[\@@_begin_line:]]
* SpaceIndentation ^ 0
- * LPEG1['ocaml']
+ * ( ( space * Lc [[\@@_trailing_space:]] ) ^ 1 * -1 + space ^ 0 * EOL + Main ) ^ 0
* -1
- * Lc '\\@@_end_line:'
+ * Lc [[\@@_end_line:]]
)
% \end{macrocode}
%
-%
+%
% \bigskip
% \subsubsection{The language C}
%
@@ -6970,8 +7200,10 @@ String =
% \paragraph{Beamer}
%
% \bigskip
+% The argument of |Compute_braces| must be a pattern \emph{which does no
+% catching} corresponding to the strings of the language.
% \begin{macrocode}
-braces = Compute_braces ( "\"" * ( 1 - S "\"" ) ^ 0 * "\"" )
+local braces = Compute_braces ( "\"" * ( 1 - S "\"" ) ^ 0 * "\"" )
if piton.beamer then Beamer = Compute_Beamer ( 'c' , braces ) end
% \end{macrocode}
%
@@ -7015,12 +7247,14 @@ local LongComment =
% \bigskip
% \paragraph{The main LPEG for the language C}
%
+% \begin{macrocode}
+local EndKeyword = Space + Punct + Delim + EOL + Beamer + DetectedCommands + -1
+% \end{macrocode}
+%
% First, the main loop :
% \begin{macrocode}
local Main =
- space ^ 1 * -1
- + space ^ 0 * EOL
- + Space
+ Space
+ Tab
+ Escape + EscapeMath
+ CommentLaTeX
@@ -7034,9 +7268,9 @@ local Main =
+ Punct
+ DefFunction
+ DefClass
- + Type * ( Q "*" ^ -1 + Space + Punct + Delim + EOL + -1 )
- + Keyword * ( Space + Punct + Delim + EOL + -1 )
- + Builtin * ( Space + Punct + Delim + EOL + -1 )
+ + Type * ( Q "*" ^ -1 + EndKeyword )
+ + Keyword * EndKeyword
+ + Builtin * EndKeyword
+ Identifier
+ Number
+ Word
@@ -7058,11 +7292,11 @@ LPEG2['c'] =
Ct (
( space ^ 0 * P "\r" ) ^ -1
* BeamerBeginEnvironments
- * Lc '\\@@_begin_line:'
+ * Lc [[\@@_begin_line:]]
* SpaceIndentation ^ 0
- * LPEG1['c']
+ * ( space ^ 1 * -1 + space ^ 0 * EOL + Main ) ^ 0
* -1
- * Lc '\\@@_end_line:'
+ * Lc [[\@@_end_line:]]
)
% \end{macrocode}
%
@@ -7089,7 +7323,7 @@ end
% \begin{macrocode}
local identifier =
letter * ( alphanum + "-" ) ^ 0
- + '"' * ( ( alphanum + space - '"' ) ^ 1 ) * '"'
+ + P '"' * ( ( 1 - P '"' ) ^ 1 ) * '"'
local Operator =
@@ -7164,8 +7398,11 @@ local String = K ( 'String.Long' , "'" * ( 1 - P "'" ) ^ 1 * "'" )
% \paragraph{Beamer}
%
% \bigskip
+% The argument of |Compute_braces| must be a pattern \emph{which does no
+% catching} corresponding to the strings of the language.
+%
% \begin{macrocode}
-braces = Compute_braces ( String )
+local braces = Compute_braces ( "'" * ( 1 - P "'" ) ^ 1 * "'" )
if piton.beamer then Beamer = Compute_Beamer ( 'sql' , braces ) end
% \end{macrocode}
%
@@ -7203,6 +7440,9 @@ local LongComment =
% \bigskip
% \paragraph{The main LPEG for the language SQL}
%
+% \begin{macrocode}
+local EndKeyword = Space + Punct + Delim + EOL + Beamer + DetectedCommands + -1
+% \end{macrocode}
%
% \begin{macrocode}
local TableField =
@@ -7245,13 +7485,15 @@ local WeCatchTableNames =
* ( Space + EOL ) * OneTable
% \end{macrocode}
%
+% \begin{macrocode}
+local EndKeyword = Space + Punct + Delim + EOL + Beamer + DetectedCommands + -1
+% \end{macrocode}
+%
%
% First, the main loop :
% \begin{macrocode}
local Main =
- space ^ 1 * -1
- + space ^ 0 * EOL
- + Space
+ Space
+ Tab
+ Escape + EscapeMath
+ CommentLaTeX
@@ -7284,11 +7526,11 @@ LPEG2['sql'] =
Ct (
( space ^ 0 * "\r" ) ^ -1
* BeamerBeginEnvironments
- * Lc [[ \@@_begin_line: ]]
+ * Lc [[\@@_begin_line:]]
* SpaceIndentation ^ 0
- * LPEG1['sql']
+ * ( space ^ 1 * -1 + space ^ 0 * EOL + Main ) ^ 0
* -1
- * Lc [[ \@@_end_line: ]]
+ * Lc [[\@@_end_line:]]
)
% \end{macrocode}
%
@@ -7314,7 +7556,12 @@ local String =
* Q "\""
)
-braces = Compute_braces ( String )
+% \end{macrocode}
+% The argument of |Compute_braces| must be a pattern \emph{which does no
+% catching} corresponding to the strings of the language.
+% \begin{macrocode}
+local braces = Compute_braces ( P "\"" * ( P "\\\"" + 1 - P "\"" ) ^ 1 * "\"" )
+
if piton.beamer then Beamer = Compute_Beamer ( 'minimal' , braces ) end
DetectedCommands = Compute_DetectedCommands ( 'minimal' , braces )
@@ -7323,14 +7570,12 @@ LPEG_cleaner['minimal'] = Compute_LPEG_cleaner ( 'minimal' , braces )
local identifier = letter * alphanum ^ 0
-local Identifier = K ( 'Identifier' , identifier )
+local Identifier = K ( 'Identifier.Internal' , identifier )
local Delim = Q ( S "{[()]}" )
local Main =
- space ^ 1 * -1
- + space ^ 0 * EOL
- + Space
+ Space
+ Tab
+ Escape + EscapeMath
+ CommentLaTeX
@@ -7350,11 +7595,11 @@ LPEG2['minimal'] =
Ct (
( space ^ 0 * "\r" ) ^ -1
* BeamerBeginEnvironments
- * Lc [[ \@@_begin_line: ]]
+ * Lc [[\@@_begin_line:]]
* SpaceIndentation ^ 0
- * LPEG1['minimal']
+ * ( space ^ 1 * -1 + space ^ 0 * EOL + Main ) ^ 0
* -1
- * Lc [[ \@@_end_line: ]]
+ * Lc [[\@@_end_line:]]
)
% \bigskip
@@ -7373,7 +7618,7 @@ function piton.Parse ( language , code )
local t = LPEG2[language] : match ( code )
if t == nil
then
- sprintL3 [[ \@@_error_or_warning:n { syntax~error } ]]
+ sprintL3 [[ \@@_error_or_warning:n { SyntaxError } ]]
return -- to exit in force the function
end
local left_stack = {}
@@ -7394,14 +7639,14 @@ function piton.Parse ( language , code )
%
% Here is an example of an item beginning with |"Open"|.
%
-% |{ "Open" , "\begin{uncover}<2>" , "\end{cover}" }|
+% |{ "Open" , "\begin{uncover}<2>" , "\end{uncover}" }|
%
% In order to deal with the ends of lines, we have to close the environment
-% (|{cover}| in this example) at the end of each line and reopen it at the
+% (|{uncover}| in this example) at the end of each line and reopen it at the
% beginning of the new line. That's why we use two Lua stacks, called
% |left_stack| and |right_stack|. |left_stack| will be for the elements like
% |\begin{uncover}<2>| and |right_stack| will be for the elements like
-% |\end{cover}|.
+% |\end{uncover}|.
% \begin{macrocode}
if one_item[1] == "Open" then
tex.sprint( one_item[2] )
@@ -7606,20 +7851,43 @@ function piton.GobbleParse ( lang , n , code )
piton.last_code = gobble ( n , code )
piton.last_language = lang
% \end{macrocode}
+% We count the number of lines of the informatic code. The result will be stored
+% by Lua in |\l_@@_nb_lines_int|. That information will be used to allow or
+% disallow page breaks (when |splittable| is in force).
+% \begin{macrocode}
+ piton.CountLines ( piton.last_code )
+ sprintL3 [[ \bool_if:NT \g_@@_footnote_bool \savenotes ]]
+% \end{macrocode}
+% We begin a |\vtop| for an non-splittable block of lines.
% \begin{macrocode}
- sprintL3 [[ \bool_if:NT \g_@@_footnote_bool \savenotes \vtop \bgroup ]]
+ sprintL3 [[ \vtop \bgroup ]]
piton.Parse ( lang , piton.last_code )
- sprintL3
- [[\vspace{2.5pt}\egroup\bool_if:NT\g_@@_footnote_bool\endsavenotes\par]]
+% \end{macrocode}
+% We close the latest opened |\vtop| with the following |\egroup|. Be careful:
+% that |\vtop| is \emph{not} necessarily the |\vtop| opened two lines above
+% because the commands |\@@_newline:| inserted by Lua may open and close
+% |\vtop|s and start and finish paragraphs (when |splittable| is in force).
+% \begin{macrocode}
+ sprintL3 [[ \vspace{2.5pt} \egroup ]]
+ sprintL3 [[ \bool_if:NT \g_@@_footnote_bool \endsavenotes ]]
+% \end{macrocode}
+% We finish the paragraph (each block of non-splittable lines of code is
+% composed in a |\vtop| inserted in a paragraph).
+% \begin{macrocode}
+ sprintL3 [[ \par ]]
% \end{macrocode}
%
% Now, if the final user has used the key |write| to write the code of the
% environment on an external file.
% \begin{macrocode}
if piton.write and piton.write ~= '' then
- local file = assert ( io.open ( piton.write , piton.write_mode ) )
- file:write ( piton.get_last_code ( ) )
- file:close ( )
+ local file = io.open ( piton.write , piton.write_mode )
+ if file then
+ file:write ( piton.get_last_code ( ) )
+ file:close ( )
+ else
+ sprintL3 [[ \@@_error_or_warning:n { FileError } ]]
+ end
end
end
% \end{macrocode}
@@ -7628,7 +7896,9 @@ end
% The following function will be used when the key |split-on-empty-lines| is in
% force. With that key, the informatic code is split in chunks at the empty
% lines (usually between the informatic functions defined in the informatic
-% code). LaTeX will be able to change the page between the chunks.
+% code). LaTeX will be able to change the page between the chunks. The second
+% argument |n| corresponds to the value of the key |gobble| (number of spaces to
+% gobble).
% \begin{macrocode}
function piton.GobbleSplitParse ( lang , n , code )
P { "E" ,
@@ -7637,7 +7907,7 @@ function piton.GobbleSplitParse ( lang , n , code )
/ ( function ( x ) sprintL3 [[ \@@_incr_visual_line: ]] end )
) ^ 1
/ ( function ( x )
- sprintL3 [[ \l_@@_split_separation_tl \int_gzero:N \g_@@_line_int ]]
+ sprintL3 ( piton.string_between_chunks )
end )
) ^ 0 * V "F" ,
% \end{macrocode}
@@ -7645,7 +7915,7 @@ function piton.GobbleSplitParse ( lang , n , code )
% \begin{macrocode}
F = C ( V "G" ^ 0 )
% \end{macrocode}
-% The second argument of |.pitonGobbleParse| is the argument |gobble|: we put
+% The second argument of |piton.GobbleSplitParse| is the argument |gobble|: we put
% that argument to~$0$ because we will have gobbled previously the whole argument
% |code| (see below).
% \begin{macrocode}
@@ -7654,10 +7924,24 @@ function piton.GobbleSplitParse ( lang , n , code )
% The non-terminal |G| corresponds to a non-empty line of code.
% \begin{macrocode}
G = ( 1 - P "\r" ) ^ 0 * "\r" - ( P " " ^ 0 * "\r" )
+ + ( ( 1 - P "\r" ) ^ 1 * -1 - ( P " " ^ 0 * -1 ) )
} : match ( gobble ( n , code ) )
end
% \end{macrocode}
%
+% \bigskip
+% The following Lua string will be inserted between the chunks of code created
+% when the key |split-on-empty-lines| is in force. It's used only once: you have
+% given a name to that Lua string only for legibily. The token list
+% |\l_@@_split_separation_tl| corresponds to the key |split-separation|. That
+% token list must contain elements inserted in \emph{vertical mode} of TeX.
+% \begin{macrocode}
+piton.string_between_chunks =
+ [[ \par \l_@@_split_separation_tl \mode_leave_vertical: ]]
+ .. [[ \int_gzero:N \g_@@_line_int ]]
+% \end{macrocode}
+% The counter |\g_@@_line_int| will be used to control the points where the code
+% may be broken by a change of page (see the key |splittable|).
%
% \bigskip
% The following public Lua function is provided to the developer.
@@ -7672,14 +7956,23 @@ end
% \subsubsection{To count the number of lines}
%
% \medskip
+% The following function is only used once (in |piton.GobbleParse|). We have
+% written an autonomous function only for legibility. The number of lines of the
+% code will be stored in |\l_@@_nb_lines_int| and will be used to allow or
+% disallow line breaks (when |splittable| is in force).
% \begin{macrocode}
function piton.CountLines ( code )
local count = 0
for i in code : gmatch ( "\r" ) do count = count + 1 end
- sprintL3 ( [[ \int_set:Nn \l_@@_nb_lines_int { ]] .. count .. '}' )
+ sprintL3 ( string.format ( [[ \int_set:Nn \l_@@_nb_lines_int { % i } ]] , count ) )
end
% \end{macrocode}
%
+% \bigskip
+% The following function is only used once (in |piton.GobbleParse|). We have
+% written an autonomous function only for legibility. The number of lines of the
+% code will be stored in |\l_@@_nb_non_empty_lines_int|. It will be used to
+% compute the largest number of lines to write (when |line-numbers| is in force).
% \begin{macrocode}
function piton.CountNonEmptyLines ( code )
local count = 0
@@ -7690,7 +7983,8 @@ function piton.CountNonEmptyLines ( code )
* -1
) / table.getn
) : match ( code )
- sprintL3 ( [[ \int_set:Nn \l_@@_nb_non_empty_lines_int { ]] .. count .. '}' )
+ sprintL3
+ ( string.format ( [[ \int_set:Nn \l_@@_nb_non_empty_lines_int { % i } ]] , count ) )
end
% \end{macrocode}
%
@@ -7699,7 +7993,8 @@ end
function piton.CountLinesFile ( name )
local count = 0
for line in io.lines ( name ) do count = count + 1 end
- sprintL3 ( [[ \int_set:Nn \l_@@_nb_lines_int { ]] .. count .. '}' )
+ sprintL3
+ ( string.format ( [[ \int_set:Nn \l_@@_nb_lines_int { %i } ]], count))
end
% \end{macrocode}
%
@@ -7713,7 +8008,8 @@ function piton.CountNonEmptyLinesFile ( name )
count = count + 1
end
end
- sprintL3 ( [[ \int_set:Nn \l_@@_nb_non_empty_lines_int { ]] .. count .. '}' )
+ sprintL3
+ ( string.format ( [[ \int_set:Nn \l_@@_nb_non_empty_lines_int { % i } ]] , count ) )
end
% \end{macrocode}
%
@@ -7813,23 +8109,11 @@ function piton.new_language ( lang , definition )
% |tag| (mainly for the language \textsc{html}) for the character |/| in the
% closing tags |</....>|).
% \begin{macrocode}
- other = other + P "c"
+ other = other + P ( c )
end
end
% \end{macrocode}
%
-% \bigskip
-% Of course, the \textsc{lpeg} |strict_braces| is for balanced braces (without the
-% question of strings of an informatic language). In fact, it \emph{won't} be
-% used for an informatic language (as dealt by \pkg{piton}) but for LaTeX
-% instructions;
-% \begin{macrocode}
- local strict_braces =
- P { "E" ,
- E = ( "{" * V "F" * "}" + ( 1 - S ",{}" ) ) ^ 0 ,
- F = ( "{" * V "F" * "}" + ( 1 - S "{}" ) ) ^ 0
- }
-% \end{macrocode}
%
% \bigskip
% Now, the first transformation of the definition of the language, as provided
@@ -7945,7 +8229,7 @@ function piton.new_language ( lang , definition )
% \begin{macrocode}
local alphanum = letter + digit
local identifier = letter * alphanum ^ 0
- local Identifier = K ( 'Identifier' , identifier )
+ local Identifier = K ( 'Identifier.Internal' , identifier )
% \end{macrocode}
%
%
@@ -8046,6 +8330,7 @@ function piton.new_language ( lang , definition )
% the strings.
% \begin{macrocode}
local long_string = P ( false )
+ local Long_string = P ( false )
local LongString = P (false )
local central_pattern = P ( false )
for _ , x in ipairs ( def_table ) do
@@ -8072,7 +8357,15 @@ function piton.new_language ( lang , definition )
else prefix = P ( true )
end
% \end{macrocode}
-% We can write the pattern which matches the string.
+% First, a pattern \emph{without captures} (needed to compute |braces|).
+% \begin{macrocode}
+ long_string = long_string +
+ prefix
+ * arg3
+ * ( space + central_pattern ) ^ 0
+ * arg4
+% \end{macrocode}
+% Now a pattern \emph{with captures}.
% \begin{macrocode}
local pattern =
prefix
@@ -8080,18 +8373,20 @@ function piton.new_language ( lang , definition )
* ( VisualSpace + Q ( central_pattern ^ 1 ) + EOL ) ^ 0
* Q ( arg4 )
% \end{macrocode}
-% First, we create |long_string| because we need that \textsc{lpeg} in the
-% nested comments.
+% We will need |Long_string| in the nested comments.
% \begin{macrocode}
- long_string = long_string + pattern
+ Long_string = Long_string + pattern
LongString = LongString +
Ct ( Cc "Open" * Cc ( "{" .. arg2 .. "{" ) * Cc "}}" )
* pattern
* Ct ( Cc "Close" )
end
end
-
- local braces = Compute_braces ( String )
+% \end{macrocode}
+% The argument of |Compute_braces| must be a pattern \emph{which does no
+% catching} corresponding to the strings of the language.
+% \begin{macrocode}
+ local braces = Compute_braces ( long_string )
if piton.beamer then Beamer = Compute_Beamer ( lang , braces ) end
DetectedCommands = Compute_DetectedCommands ( lang , braces )
@@ -8208,12 +8503,7 @@ function piton.new_language ( lang , definition )
%
% \begin{macrocode}
local Main =
- space ^ 1 * -1
-% \end{macrocode}
-% The spaces at the end of the lines are discarded.
-% \begin{macrocode}
- + space ^ 0 * EOL
- + Space
+ Space
+ Tab
+ Escape + EscapeMath
+ CommentLaTeX
@@ -8229,7 +8519,7 @@ function piton.new_language ( lang , definition )
+ PrefixedKeyword
+ Keyword * ( -1 + # ( 1 - alphanum ) )
+ Punct
- + K ( 'Identifier' , letter * alphanum ^ 0 )
+ + K ( 'Identifier.Internal' , letter * alphanum ^ 0 )
+ Number
+ Word
% \end{macrocode}
@@ -8249,7 +8539,7 @@ function piton.new_language ( lang , definition )
* BeamerBeginEnvironments
* Lc [[\@@_begin_line:]]
* SpaceIndentation ^ 0
- * LPEG1[lang]
+ * ( space ^ 1 * -1 + space ^ 0 * EOL + Main ) ^ 0
* -1
* Lc [[\@@_end_line:]]
)
@@ -8279,7 +8569,7 @@ function piton.new_language ( lang , definition )
+ PrefixedKeyword
+ Keyword * ( -1 + # ( 1 - alphanum ) )
+ Punct
- + K ( 'Identifier' , letter * alphanum ^ 0 )
+ + K ( 'Identifier.Internal' , letter * alphanum ^ 0 )
+ Number
+ Word
LPEG0[lang] = MainWithoutTag ^ 0
@@ -8296,7 +8586,7 @@ function piton.new_language ( lang , definition )
Ct (
( space ^ 0 * P "\r" ) ^ -1
* BeamerBeginEnvironments
- * Lc [[\@@_begin_line:]]
+ * Lc [[ \@@_begin_line: ]]
* SpaceIndentation ^ 0
* LPEG1[lang]
* -1
@@ -8327,6 +8617,12 @@ end
%
% \verb|https://github.com/fpantigny/piton|
%
+% \subsection*{Changes between versions 3.0 and 3.1}
+%
+% Keys |line-numbers/format|, |detected-beamer-commands| and
+% |detected-beamer-environments|.
+%
+%
% \subsection*{Changes between versions 2.8 and 3.0}
%
% New command |\NewPitonLanguage|. Thanks to that command, it's now possible to
@@ -8396,61 +8692,6 @@ end
% The key |escape-inside| is deprecated: use |begin-escape| and |end-escape|.
%
%
-% \subsection*{Changes between versions 1.6 and 2.0}
-%
-% The extension \pkg{piton} now supports the computer languages OCaml and C
-% (and, of course, Python).
-%
-% \subsection*{Changes between versions 1.5 and 1.6}
-%
-% New key |width| (for the total width of the listing).
-%
-% New style |UserFunction| to format the names of the Python functions
-% previously defined by the user. Command |\PitonClearUserFunctions| to clear
-% the list of such functions names.
-%
-% \subsection*{Changes between versions 1.4 and 1.5}
-%
-% New key |numbers-sep|.
-%
-%
-% \subsection*{Changes between versions 1.3 and 1.4}
-%
-% New key |identifiers| in |\PitonOptions|.
-%
-% New command |\PitonStyle|.
-%
-% |background-color| now accepts as value a \emph{list} of colors.
-%
-% \subsection*{Changes between versions 1.2 and 1.3}
-%
-% When the class Beamer is used, the environment |{Piton}| and the command
-% |\PitonInputFile| are ``overlay-aware'' (that is to say, they accept a
-% specification of overlays between angular brackets).
-%
-% New key |prompt-background-color|
-%
-% It's now possible to use the command |\label| to reference a line of code in
-% an environment |{Piton}|.
-%
-% A new command |\|⣠is available in the argument of the command |\piton{...}| to
-% insert a space (otherwise, several spaces are replaced by a single space).
-%
-% \subsection*{Changes between versions 1.1 and 1.2}
-%
-% New keys |break-lines-in-piton| and |break-lines-in-Piton|.
-%
-% New key |show-spaces-in-string| and modification of the key |show-spaces|.
-%
-% When the class \cls{beamer} is used, the environments |{uncoverenv}|,
-% |{onlyenv}|, |{visibleenv}| and |{invisibleenv}|
-%
-%
-% \subsection*{Changes between versions 1.0 and 1.1}
-%
-% The extension \pkg{piton} detects the class \cls{beamer} and activates the
-% commands |\action|, |\alert|, |\invisible|, |\only|, |\uncover| and |\visible|
-% in the environments |{Piton}| when the class \cls{beamer} is used.
%
% \tableofcontents
%
diff --git a/Master/texmf-dist/source/luatex/luamplib/Makefile b/Master/texmf-dist/source/luatex/luamplib/Makefile
index 87f04f727e0..a0a22826754 100644
--- a/Master/texmf-dist/source/luatex/luamplib/Makefile
+++ b/Master/texmf-dist/source/luatex/luamplib/Makefile
@@ -40,6 +40,7 @@ world: all ctan
%.pdf: %.dtx
@$(DOLATEX)
@if( grep rerunfilecheck $(NAME).log |grep 'has changed' > /dev/null ); then $(DOLATEX); fi
+ @if( grep 'Rerun to get' $(NAME).log > /dev/null ); then $(DOLATEX); fi
$(UNPACKED): $(DTX)
luatex -interaction=batchmode $< >/dev/null
diff --git a/Master/texmf-dist/source/luatex/luamplib/luamplib.dtx b/Master/texmf-dist/source/luatex/luamplib/luamplib.dtx
index edae80ada69..625a35848c0 100644
--- a/Master/texmf-dist/source/luatex/luamplib/luamplib.dtx
+++ b/Master/texmf-dist/source/luatex/luamplib/luamplib.dtx
@@ -2,8 +2,8 @@
%
% Copyright (C) 2008-2024 by Hans Hagen, Taco Hoekwater, Elie Roux,
% Manuel Pégourié-Gonnard, Philipp Gesang and Kim Dohyun.
-% Currently maintained by the LuaLaTeX development team.
-% Support: <lualatex-dev@tug.org>
+% Currently maintained by Kim Dohyun.
+% Support: <https://github.com/lualatex/luamplib>
%
% This work is under the GPL v2.0 license.
%
@@ -85,9 +85,9 @@ See source file '\inFileName' for licencing and contact information.
%<*driver>
\NeedsTeXFormat{LaTeX2e}
\ProvidesFile{luamplib.drv}%
- [2024/06/14 v2.32.2 Interface for using the mplib library]%
+ [2024/08/03 v2.34.5 Interface for using the mplib library]%
\documentclass{ltxdoc}
-\usepackage{metalogo,multicol,mdwlist,fancyvrb,xspace}
+\usepackage{metalogo,multicol,xspace}
\usepackage[x11names]{xcolor}
%
\def\primarycolor{DodgerBlue4} %%-> rgb 16 78 139 | #104e8b
@@ -123,7 +123,9 @@ See source file '\inFileName' for licencing and contact information.
\newcommand*\email [1] {<\href{mailto:#1}{#1}>}
\newcommand \file {\nolinkurl}
-\newcommand \pk {\textsf}
+
+\newcommand*\metapost {\textsc{metapost}\xspace}
+\newcommand*\mplib {\pkg{mplib}\xspace}
\begin{document}
\DocInput{luamplib.dtx}%
@@ -149,125 +151,164 @@ See source file '\inFileName' for licencing and contact information.
% Grave accent \` Left brace \{ Vertical bar \|
% Right brace \} Tilde \~}
%
-% \title{The \textsf{luamplib} package}
+% \title{The \pkg{luamplib} package}
% \author{Hans Hagen, Taco Hoekwater, Elie Roux, Philipp Gesang and Kim Dohyun\\
-% Maintainer: LuaLaTeX Maintainers ---
-% Support: \email{lualatex-dev@tug.org}}
-% \date{2024/06/14 v2.32.2}
+% Current Maintainer: Kim Dohyun\\
+% Support: \url{https://github.com/lualatex/luamplib}}
+% \date{2024/08/03 v2.34.5}
%
% \maketitle
%
% \begin{abstract}
-% Package to have metapost code typeset directly in a document with \LuaTeX.
+% Package to have \metapost code typeset directly in a document with \LuaTeX.
% \end{abstract}
%
% \section{Documentation}
%
-% This packages aims at providing a simple way to typeset directly metapost
-% code in a document with \LuaTeX. \LuaTeX\ is built with the lua
-% \texttt{mplib} library, that runs metapost code. This package is basically a
-% wrapper (in Lua) for the Lua \texttt{mplib} functions and some \TeX\
-% functions to have the output of the \texttt{mplib} functions in the pdf.
-%
-% In the past,
-% the package required PDF mode in order to output something.
-% Starting with version 2.7 it works in DVI mode as well, though
-% DVIPDFMx is the only DVI tool currently supported.
-%
-% The metapost figures are put in a \TeX\ \texttt{hbox} with dimensions
-% adjusted to the metapost code.
+% This package aims at providing a simple way to typeset directly \metapost
+% code in a document with \LuaTeX. \LuaTeX\ is built with the Lua
+% \mplib library, that runs \metapost code. This package is basically a
+% wrapper for the Lua \mplib functions and some \TeX\
+% functions to have the output of the \mplib functions in the pdf.
%
-% Using this package is easy: in Plain, type your metapost code between the
+% Using this package is easy: in Plain, type your \metapost code between the
% macros \cs{mplibcode} and \cs{endmplibcode}, and in \LaTeX\ in the
-% \texttt{mplibcode} environment.
+% |mplibcode| environment.
%
-% The code is from the \texttt{luatex-mplib.lua} and \texttt{luatex-mplib.tex} files
-% from \ConTeXt, they have been adapted to \LaTeX\ and Plain by Elie Roux and
-% Philipp Gesang, new functionalities have been added by Kim Dohyun.
-% The changes are:
+% The resulting \metapost figures are put in a \TeX\ |hbox| with dimensions
+% adjusted to the \metapost code.
+%
+% The code of luamplib is basically from the |luatex-mplib.lua| and |luatex-mplib.tex| files
+% from \ConTeXt. They have been adapted to \LaTeX\ and Plain by Elie Roux and
+% Philipp Gesang and new functionalities have been added by Kim Dohyun.
+% The most notable changes are:
%
% \begin{itemize}
-% \item a \LaTeX\ environment
-% \item all \TeX\ macros start by |mplib|
-% \item use of our own function for errors, warnings and informations
% \item possibility to use |btex ... etex| to typeset \TeX\ code.
-% |textext()| is a more versatile macro equivalent to |TEX()| from TEX.mp.
-% |TEX()| is also allowed and is a synomym of |textext()|.\par\smallskip
-% \textsc{n.b.} Since v2.5, |btex ... etex| input from external |mp| files
-% will also be processed by \textsf{luamplib}.\par\smallskip
-% \textsc{n.b.} Since v2.20, |verbatimtex ... etex| from external |mp| files
-% will be also processed by \textsf{luamplib}. Warning: This is a change
-% from previous version.
+% |textext()| is a more versatile macro equivalent to |TEX()| from \pkg{TEX.mp}.
+% |TEX()| is also allowed and is a synonym of |textext()|.
+% The argument of
+% \mplib's primitive |maketext| will also be processed by the same routine.
+%
+% \item possibility to use |verbatimtex ... etex|, though it's behavior cannot
+% be the same as the stand-alone \pkg{mpost}.
+% Of course you cannot include \cs{documentclass}, \cs{usepackage} etc.
+% When these \TeX\ commands are found in |verbatimtex ... etex|, the entire code will be
+% ignored.
+% The treatment of |verbatimtex| command has changed a lot since v2.20:
+% see \hyperlink{mpliblegacybehavior}{below \S\,1.1}.
+%
+% \item in the past,
+% the package required PDF mode in order to have some output.
+% Starting with version 2.7 it works in DVI mode as well, though
+% DVIPDFMx is the only DVI tool currently supported.
% \end{itemize}
%
-% Some more changes and cautions are:
+% It seems to be convenient to divide the explanations of some more changes and cautions
+% into three parts: \TeX, \textsc{MetaPost}, and Lua interfaces.
+%
+% \subsection{\TeX}
%
% \paragraph{\cs{mplibforcehmode}}
-% When this macro is declared, every mplibcode figure box will be
+% When this macro is declared, every \metapost figure box will be
% typeset in horizontal mode, so \cs{centering}, \cs{raggedleft} etc
-% will have effects. |\mplibnoforcehmode|, being default, reverts this
-% setting. (Actually these commands redefine |\prependtomplibbox|. You
-% can define this command with anything suitable before a box.)
+% will have effects. \cs{mplibnoforcehmode}, being default, reverts this
+% setting. (Actually these commands redefine \cs{prependtomplibbox}; you
+% can redefine this command with anything suitable before a box.)
%
-% \paragraph{\cs{mpfig} \ldots\ \cs{endmpfig}}
-% Since v2.29 we provide unexpandable \TeX\ macros |\mpfig ... \endmpfig| and its starred version
-% |\mpfig* ... \endmpfig| to save typing toil.
-% The first is roughly the same as follows:
-% \begin{verbatim}
-% \begin{mplibcode}[@mpfig]
-% beginfig(0)
-% token list declared by \everymplib[@mpfig]
-% ...
-% token list declared by \everyendmplib[@mpfig]
-% endfig;
-% \end{mplibcode}
-% \end{verbatim}
-% and the starred version is roughly the same as follows:
-% \begin{verbatim}
-% \begin{mplibcode}[@mpfig]
-% ...
+% \paragraph{\cs{everymplib\{...\}}, \cs{everyendmplib\{...\}}}
+% \cs{everymplib} and \cs{everyendmplib} redefine
+% the lua table containing \metapost code
+% which will
+% be automatically inserted at the beginning and ending of each \metapost code chunk.
+%\begin{verbatim}
+% \everymplib{ beginfig(0); }
+% \everyendmplib{ endfig; }
+% \begin{mplibcode}
+% % beginfig/endfig not needed
+% draw fullcircle scaled 1cm;
% \end{mplibcode}
-% \end{verbatim}
-% In these macros |\mpliblegacybehavior{disable}| (see below)
-% is forcibly declared.
-% And as both share the same instance name, metapost codes are inherited among them.
-% A simple example:
-% \begin{verbatim}
-% \mpfig* input boxes \endmpfig
-% \everymplib[@mpfig]{ drawoptions(withcolor .5[red,white]); }
-% \mpfig circleit.a(btex Box 1 etex); drawboxed(a); \endmpfig
-% \end{verbatim}
-% The instance name (default: |@mpfig|) can be changed by redefining
-% \cs{mpfiginstancename}, after which a new MPlib instance will start and
-% code inheritance too will begin anew. |\let\mpfiginstancename\empty| will
-% prevent code inheritance if |\mplibcodeinherit{true}| (see below) is not declared.\footnote{%
-% As for user setting values, |enable|, |true|, |yes| are identical, and
-% |disable|, |false|, |no| are identical.}
-%
-% \paragraph{\cs{mpliblegacybehavior\{enable\}}}
-% By default, |\mpliblegacybehavior{enable}| is already declared,
-% in which case
-% a |verbatimtex ... etex| that comes just before |beginfig()|
-% is not ignored, but the \TeX\ code will be inserted before the
-% following mplib hbox. Using this command,
-% each mplib box can be freely moved horizontally and/or vertically.
-% Also, a box number might be assigned to mplib box, allowing it to be
-% reused later (see test files).
-% \begin{verbatim}
+%\end{verbatim}
+%
+% \paragraph{\cs{mplibsetformat\{plain\textbar metafun\}}}
+% There are (basically) two formats for \metapost: \emph{plain} and
+% \emph{metafun}. By default, the \emph{plain} format is used, but you can set
+% the format to be used by future figures at any time using
+% \cs{mplibsetformat\{<format name>\}}.
+%
+% \textsc{n.b.} As \emph{metafun} is such a complicated format,
+% we cannot support all the functionalities producing special effects provided by \emph{metafun}.
+% At least, however, transparency (actually opacity), transparency group, and shading (gradient colors)
+% are fully supported,
+% and outlinetext is supported by our own alternative |mpliboutlinetext|
+% (see \hyperlink{mpliboutlinetext}{below \S\,1.2}).
+%
+% \leavevmode\llap{\textcolor{red}{☞}\kern1.2\parindent}\relax
+% Among these, transparency is so simple that you can apply it to an object,
+% even with the \emph{plain} format,
+% just by appending |withprescript| |"tr_transparency=<number>"| to the sentence.
+% ($0 \le \hbox{\emph{<number>}} \le 1$)
+%
+% \hypertarget{metafunformat}{}\relax
+% As for transparency group, the current \emph{metafun} document \S\,8.8 is not correct.
+% The true syntax is:
+%\begin{verbatim}
+% draw <picture>|<path> asgroup <string>
+%\end{verbatim}
+% where \emph{<string>} should be |""| (empty), |"isolated"|, |"knockout"|, or |"isolated,knockout"|.
+% Beware that currently many of the PDF rendering applications, except Adobe Acrobat Reader,
+% cannot properly render the isolated or knockout effect.
+% Transparency group is available with \emph{plain} format as well, with extended functionality.
+% See \hyperlink{transparencygroup}{below \S\,1.2}.
+%
+% One thing worth mentioning about shading is:
+% when a color expression is given in string type,
+% it is regarded by luamplib as
+% a color expression of \TeX\ side.
+% For instance, when |withshadecolors("orange", 2/3red)| is given, the first color |"orange"| will be
+% interpreted as a \pkg{color}, \pkg{xcolor} or \pkg{l3color}'s expression.
+%
+% \paragraph{\cs{mplibnumbersystem\{scaled\textbar double\textbar decimal\}}}
+% Users can choose |numbersystem| option.
+% The default value is |scaled|, which can be changed
+% by declaring \cs{mplibnumbersystem\{double\}} or
+% \cs{mplibnumbersystem\{decimal\}}.
+%
+% \paragraph{\cs{mplibshowlog\{enable\textbar disable\}}}
+% Default: |disable|.
+% When \cs{mplibshowlog\{enable\}}\footnote{As for user's setting,
+% |enable|, |true| and |yes| are identical;
+% |disable|, |false| and |no| are identical.} is declared, log messages returned by
+% the \metapost process will be printed to the |.log| file.
+% This is the \TeX{} side interface for |luamplib.showlog|.
+%
+% \paragraph{\cs{mpliblegacybehavior\{enable\textbar disable\}}}
+% \hypertarget{mpliblegacybehavior}{}\relax
+% By default, \cs{mpliblegacybehavior\{enable\}}
+% is already declared for backward compatibility,
+% in which case \TeX\ code in
+% |verbatimtex| |...| |etex| that comes just before |beginfig()|
+% will be inserted before the
+% following \metapost figure box. In this way,
+% each figure box can be freely moved horizontally or vertically.
+% Also, a box number can be assigned to a figure box, allowing it to be
+% reused later.
+%\begin{verbatim}
% \mplibcode
% verbatimtex \moveright 3cm etex; beginfig(0); ... endfig;
% verbatimtex \leavevmode etex; beginfig(1); ... endfig;
% verbatimtex \leavevmode\lower 1ex etex; beginfig(2); ... endfig;
% verbatimtex \endgraf\moveright 1cm etex; beginfig(3); ... endfig;
% \endmplibcode
-% \end{verbatim}
+%\end{verbatim}
% \textsc{n.b.} \cs{endgraf} should be used instead of \cs{par} inside
% |verbatimtex ... etex|.
%
-% By contrast, \TeX\ code in |VerbatimTeX(...)| or |verbatimtex ... etex|
+% On the other hand, \TeX\ code in |verbatimtex ... etex|
% between |beginfig()| and |endfig| will be inserted
-% after flushing out the mplib figure.
-% \begin{verbatim}
+% after flushing out the \metapost figure.
+% As shown in the example below, |VerbatimTeX()| is a synonym of |verbatimtex| |...| |etex|.
+%\begin{verbatim}
% \mplibcode
% D := sqrt(2)**7;
% beginfig(0);
@@ -276,15 +317,15 @@ See source file '\inFileName' for licencing and contact information.
% endfig;
% \endmplibcode
% diameter: \Dia bp.
-% \end{verbatim}
+%\end{verbatim}
%
-% \paragraph{\cs{mpliblegacybehavior\{disable\}}}
-% If |\mpliblegacybehavior{disabled}| is declared by user, any
-% |verbatimtex ... etex| will be executed, along with |btex ... etex|,
+% By contrast,
+% when \cs{mpliblegacybehavior\{disable\}} is declared, any
+% |verbatimtex| |...| |etex| will be executed, along with |btex| |...| |etex|,
% sequentially one by one.
% So, some \TeX\ code in |verbatimtex ... etex| will have effects on
-% |btex ... etex| codes that follows.
-% \begin{verbatim}
+% following |btex| |...| |etex| codes.
+%\begin{verbatim}
% \begin{mplibcode}
% beginfig(0);
% draw btex ABC etex;
@@ -293,114 +334,72 @@ See source file '\inFileName' for licencing and contact information.
% draw btex GHI etex shifted (2cm,0); % bold face
% endfig;
% \end{mplibcode}
-% \end{verbatim}
-%
-% \paragraph{\cs{everymplib}, \cs{everyendmplib}}
-% Since v2.3, new macros \cs{everymplib} and \cs{everyendmplib} redefine
-% the lua table containing MetaPost code
-% which will
-% be automatically inserted at the beginning and ending of each |mplibcode|.
-% \begin{verbatim}
-% \everymplib{ beginfig(0); }
-% \everyendmplib{ endfig; }
-% \mplibcode % beginfig/endfig not needed
-% draw fullcircle scaled 1cm;
-% \endmplibcode
-% \end{verbatim}
-%
-% \paragraph{\cs{mpdim}}
-% Since v2.3, \cs{mpdim} and other raw \TeX\ commands are allowed
-% inside mplib code. This feature is inpired by gmp.sty authored by
-% Enrico Gregorio. Please refer the manual of gmp package for details.
-% \begin{verbatim}
-% \begin{mplibcode}
-% draw origin--(.6\mpdim{\linewidth},0) withpen pencircle scaled 4
-% dashed evenly scaled 4 withcolor \mpcolor{orange};
-% \end{mplibcode}
-% \end{verbatim}
-% \textsc{n.b.} Users should not use the protected variant of
-% |btex ... etex| as provided by gmp package. As \textsf{luamplib}
-% automatically protects \TeX\ code inbetween, \cs{btex} is not supported
-% here.
+%\end{verbatim}
%
-% \paragraph{\cs{mpcolor}}
-% With \cs{mpcolor} command, color names or expressions of
-% \textsf{color}/\textsf{xcolor} packages can be used inside mplibcode
-% enviroment (after |withcolor| operator),
-% though \textsf{luamplib} does not automatically load these
-% packages. See the example code above. For spot colors,
-% \textsf{colorspace}, \textsf{spotcolor}
-% (in PDF mode) and \textsf{xespotcolor} (in DVI mode) packages are supported
-% as well.
-%
-% From v2.26.1, \textsf{l3color} is also supported by the command
-% \cs{mpcolor\{color expression\}}, including spot colors.
-%
-% \paragraph{\cs{mplibnumbersystem}}
-% Users can choose |numbersystem| option since v2.4.
-% The default value |scaled| can be changed to |double| or |decimal|
-% by declaring |\mplibnumbersystem{double}| or |\mplibnumbersystem{decimal}|.
-% For details see
-% \url{http://github.com/lualatex/luamplib/issues/21}.
-%
-% \paragraph{\cs{mplibtextextlabel}}
-% Starting with v2.6, |\mplibtextextlabel{enable}| enables
-% string labels typeset via |textext()| instead of |infont| operator.
+% \paragraph{\cs{mplibtextextlabel\{enable\textbar disable\}}}
+% Default: |disable|.
+% \cs{mplibtextextlabel\{enable\}} enables
+% the labels typeset via |textext| instead of |infont| operator.
% So, |label("my text",origin)| thereafter is exactly the same as
-% |label(textext("my text"),origin)|. \textsc{n.b.} In the background,
-% \textsf{luamplib} redefines |infont| operator so that the right side
-% argument (the font part) is totally ignored. Every string label
-% therefore will be typeset with current \TeX\ font.
+% |label(textext("my text"),origin)|.
+%
+% \textsc{n.b.} In the background,
+% luamplib redefines |infont| operator so that the right side
+% argument (the font part) is totally ignored. Therefore the left side arguemnt
+% will be typeset with the current \TeX\ font.
% Also take care of |char| operator in the left side argument,
% as this might bring unpermitted characters into \TeX.
%
-% \paragraph{\cs{mplibcodeinherit}}
-% Starting with v2.9, |\mplibcodeinherit{enable}| enables the inheritance
-% of variables, constants, and macros defined by previous |mplibcode| chunks.
-% On the contrary, the default value |\mplibcodeinherit{disable}| will make
-% each code chunks being treated as an independent instance, and never
+% \paragraph{\cs{mplibcodeinherit\{enable\textbar disable\}}}
+% Default: |disable|.
+% \cs{mplibcodeinherit\{enable\}} enables the inheritance
+% of variables, constants, and macros defined by previous \metapost code chunks.
+% On the contrary, \cs{mplibcodeinherit\{disable\}} will make
+% each code chunk being treated as an independent instance, never
% affected by previous code chunks.
%
-% \paragraph{Separate instances for \LaTeX{} and plain \TeX}
-% v2.22 has added the support for several named MetaPost instances
+% \paragraph{Separate \metapost instances}
+% luamplib v2.22 has added the support for several named \metapost instances
% in \LaTeX{} |mplibcode| environment.
-% (And since v2.29 plain \TeX\ users can use this functionality as well.)
-% Syntax is like so:
-% \begin{verbatim}
+% Plain \TeX\ users also can use this functionality.
+% The syntax for \LaTeX\ is:
+%\begin{verbatim}
% \begin{mplibcode}[instanceName]
% % some mp code
% \end{mplibcode}
-% \end{verbatim}
-% Behaviour is as follows.
+%\end{verbatim}
+% The behavior is as follows.
% \begin{itemize}
% \item All the variables and functions are shared
% only among all the environments belonging to the same instance.
-% \item |\mplibcodeinherit| only affects environments
+% \item \cs{mplibcodeinherit} only affects environments
% with no instance name set (since if a name is set,
% the code is intended to be reused at some point).
-% \item From v2.27, |btex ... etex| boxes are also shared and do not
-% require |\mplibglobaltextext|.
+% \item |btex ... etex| boxes are also shared and do not
+% require \cs{mplibglobaltextext}.
% \item When an instance names is set,
-% respective |\currentmpinstancename| is set.
+% respective \cs{currentmpinstancename} is set as well.
% \end{itemize}
-% In parellel with this functionality, v2.23 and after supports
+% In parellel with this functionality, we support
% optional argument of instance name for \cs{everymplib} and
% \cs{everyendmplib}, affecting only those |mplibcode| environments
% of the same name.
% Unnamed \cs{everymplib} affects not only those instances with no name,
% but also those with name but with no corresponding \cs{everymplib}.
-% Syntax is:
-% \begin{verbatim}
+% The syntax is:
+%\begin{verbatim}
% \everymplib[instanceName]{...}
% \everyendmplib[instanceName]{...}
-% \end{verbatim}
+%\end{verbatim}
%
-% \paragraph{\cs{mplibglobaltextext}}
-% Formerly, to inherit |btex ... etex| boxes as well as metapost variables,
+% \paragraph{\cs{mplibglobaltextext\{enable\textbar disable\}}}
+% Default: |disable|.
+% Formerly, to inherit |btex| |...| |etex| boxes as well as other \metapost macros, variables and constants,
% it was necessary to declare \cs{mplibglobaltextext\{enable\}} in advance.
% But from v2.27, this is implicitly enabled when \cs{mplibcodeinherit}
-% is |true|.
-% \begin{verbatim}
+% is enabled.
+% This optional command still remains mostly for backward compatibility.
+%\begin{verbatim}
% \mplibcodeinherit{enable}
% %\mplibglobaltextext{enable}
% \everymplib{ beginfig(0);} \everyendmplib{ endfig;}
@@ -412,38 +411,92 @@ See source file '\inFileName' for licencing and contact information.
% \mplibcode
% currentpicture := pic scaled 2;
% \endmplibcode
-% \end{verbatim}
-% Generally speaking, it is recommended to turn |mplibglobaltextext|
-% always on, because it has the advantage of reusing metapost pictures
-% among code chunks.
-% But everything has its downside: it will waste more memory resources.
-%
-% \paragraph{\cs{mplibverbatim}}
-% Starting with v2.11, users can issue |\mplibverbatim{enable}|, after which
+%\end{verbatim}
+%
+% \paragraph{\cs{mplibverbatim\{enable\textbar disable\}}}
+% Default: |disable|.
+% Users can issue \cs{mplibverbatim\{enable\}}, after which
% the contents of mplibcode environment will be read verbatim. As a result,
-% except for |\mpdim| and |\mpcolor|, all other \TeX\ commands outside
-% |btex ... etex| or |verbatimtex ... etex| are not expanded and will be fed
-% literally into the mplib process.
-%
-% \paragraph{\cs{mplibshowlog}}
-% When |\mplibshowlog{enable}| is declared, log messages returned by
-% |mplib| instance will be printed into the |.log| file.
-% |\mplibshowlog{disable}| will revert this functionality.
-% This is a \TeX{} side interface for |luamplib.showlog|. (v2.20.8)
-%
-% \paragraph{Settings regarding cache files}
-% To support |btex ... etex| in external |.mp| files, \textsf{luamplib}
-% inspects the content of each and every |.mp| input files and makes caches
-% if nececcsary, before returning their paths to \LuaTeX's mplib library.
-% This would make the compilation time longer wastefully, as most |.mp| files
-% do not contain |btex ... etex| command. So \textsf{luamplib} provides
-% macros as follows, so that users can give instruction about files
+% except for \cs{mpdim} and \cs{mpcolor} (see \hyperlink{mpdim}{below}),
+% all other \TeX\ commands outside of the
+% |btex| or |verbatimtex| |...| |etex| are not expanded and will be fed
+% literally to the \mplib library.
+%
+% \paragraph{\cs{mpdim\{...\}}}
+% \hypertarget{mpdim}{}\relax
+% Besides other \TeX\ commands, \cs{mpdim} is specially allowed
+% in the mplibcode environment. This feature is inpired by \pkg{gmp} package authored by
+% Enrico Gregorio. Please refer to the manual of \pkg{gmp} package for details.
+%\begin{verbatim}
+% \begin{mplibcode}
+% beginfig(1)
+% draw origin--(.6\mpdim{\linewidth},0) withpen pencircle scaled 4
+% dashed evenly scaled 4 withcolor \mpcolor{orange};
+% endfig;
+% \end{mplibcode}
+%\end{verbatim}
+%
+% \paragraph{\cs{mpcolor[...]\{...\}}}
+% With \cs{mpcolor} command, color names or expressions of
+% \pkg{color}, \pkg{xcolor} and \pkg{l3color} module/packages can be used in the mplibcode
+% environment (after |withcolor| operator).
+% See the example \hyperlink{mpdim}{above}.
+% The optional |[...]| denotes the option of \pkg{xcolor}'s \cs{color} command.
+% For spot colors, \pkg{l3color} (in PDF/DVI mode),
+% \pkg{colorspace}, \pkg{spotcolor}
+% (in PDF mode) and \pkg{xespotcolor} (in DVI mode) packages are supported
+% as well.
+%
+% \paragraph{\cs{mpfig} \ldots\ \cs{endmpfig}}
+% Besides the |mplibcode| environment (for \LaTeX) and
+% \cs{mplibcode ...} \cs{endmplibcode} (for Plain),
+% we also provide unexpandable \TeX\ macros \cs{mpfig} |...| \cs{endmpfig} and its starred version
+% \cs{mpfig*} |...| \cs{endmpfig} to save typing toil.
+% The former is roughly the same as follows:
+%\begin{verbatim}
+% \begin{mplibcode}[@mpfig]
+% beginfig(0)
+% token list declared by \everymplib[@mpfig]
+% ...
+% token list declared by \everyendmplib[@mpfig]
+% endfig;
+% \end{mplibcode}
+%\end{verbatim}
+% and the starred version is roughly the same as follows:
+%\begin{verbatim}
+% \begin{mplibcode}[@mpfig]
+% ...
+% \end{mplibcode}
+%\end{verbatim}
+% In these macros \cs{mpliblegacybehavior\{disable\}}
+% is forcibly declared.
+% Again, as both share the same instance name, \metapost codes are inherited among them.
+% A simple example:
+%\begin{verbatim}
+% \everymplib[@mpfig]{ drawoptions(withcolor .5[red,white]); }
+% \mpfig* input boxes \endmpfig
+% \mpfig
+% circleit.a(btex Box 1 etex); drawboxed(a);
+% \endmpfig
+%\end{verbatim}
+% The instance name (default: |@mpfig|) can be changed by redefining
+% \cs{mpfiginstancename}, after which a new \mplib instance will start and
+% code inheritance too will begin anew. \cs{let}\cs{mpfiginstancename}\cs{empty} will
+% prevent code inheritance if \cs{mplibcodeinherit\{true\}} is not declared.
+%
+% \paragraph{About cache files}
+% To support |btex ... etex| in external |.mp| files, luamplib
+% inspects the content of each and every |.mp| file and makes caches
+% if nececcsary, before returning their paths to \LuaTeX's \mplib library.
+% This could waste the compilation time, as most |.mp| files
+% do not contain |btex ... etex| commands. So luamplib provides
+% macros as follows, so that users can give instructions about files
% that do not require this functionality.
% \begin{itemize}
-% \item |\mplibmakenocache{<filename>[,<filename>,...]}|
-% \item |\mplibcancelnocache{<filename>[,<filename>,...]}|
+% \item \cs{mplibmakenocache\{<filename>[,<filename>,...]\}}
+% \item \cs{mplibcancelnocache\{<filename>[,<filename>,...]\}}
% \end{itemize}
-% where |<filename>| is a file name excluding |.mp| extension.
+% where |<filename>| is a filename excluding |.mp| extension.
% Note that |.mp| files under |$TEXMFMAIN/metapost/base| and
% |$TEXMFMAIN/metapost/context/base| are already registered by default.
%
@@ -451,64 +504,96 @@ See source file '\inFileName' for licencing and contact information.
% if it's not available (mostly not writable),
% in the directory where output files are saved:
% to be specific, |$TEXMF_OUTPUT_DIRECTORY/luamplib_cache|,
-% |./luamplib_cache|, |$TEXMFOUTPUT/luamplib_cache|, and |.| in this order.
-% (|$TEXMF_OUTPUT_DIRECTORY| is normally the value of |--output-directory|
-% command-line option.)
-% This behavior however can be changed by the command
-% |\mplibcachedir{<directory path>}|, where tilde (|~|) is interpreted
+% |./luamplib_cache|, |$TEXMFOUTPUT/luamplib_cache|, and |.|, in this order.
+% |$TEXMF_OUTPUT_DIRECTORY| is normally the value of |--output-directory|
+% command-line option.
+%
+% Users can change this behavior by the command
+% \cs{mplibcachedir\{<directory path>\}}, where tilde (|~|) is interpreted
% as the user's home directory (on a windows machine as well).
-% As backslashes (|\|) should be escaped by users, it would be easier to use
+% As backslashes (\cs{}) should be escaped by users, it would be easier to use
% slashes (|/|) instead.
%
-% \paragraph{\texttt{mplibtexcolor}, \texttt{mplibrgbtexcolor}}
-% |mplibtexcolor| is a metapost operator that converts a \TeX\ color expression
-% to a MetaPost color expression. For instance:
-% \begin{verbatim}
+% \paragraph{About figure box metric}
+% Notice that, after each figure is processed, the macro \cs{MPwidth} stores
+% the width value of the latest figure; \cs{MPheight}, the height value.
+% Incidentally, also note that \cs{MPllx}, \cs{MPlly}, \cs{MPurx}, and
+% \cs{MPury} store the bounding box information of the latest figure
+% without the unit |bp|.
+%
+% \paragraph{luamplib.cfg}
+% At the end of package loading, luamplib searches
+% |luamplib.cfg| and, if found, reads the file in automatically.
+% Frequently used settings such as \cs{everymplib}, \cs{mplibforcehmode}
+% or \cs{mplibcodeinherit} are suitable for going into this file.
+%
+% \subsection{\textsc{MetaPost}}
+%
+% \paragraph{\texttt{mplibdimen(...)}, \texttt{mplibcolor(...)}}
+% These are \metapost interfaces for the \TeX\ commands
+% \cs{mpdim} and \cs{mpcolor} (see \hyperlink{mpdim}{above}). For example,
+% |mplibdimen("\linewidth")| is basically the same as \cs{mpdim\{\cs{linewidth}\}}, and
+% |mplibcolor("red!50")| is basically the same as \cs{mpcolor\{red!50\}}.
+% The difference is that these \metapost operators can also be used in external |.mp| files,
+% which cannot have \TeX\ commands outside of the |btex| or |verbatimtex| |...| |etex|.
+%
+% \paragraph{\texttt{mplibtexcolor ...}, \texttt{mplibrgbtexcolor ...}}
+% |mplibtexcolor|, which accepts a string argument, is a \metapost operator that converts a \TeX\ color expression
+% to a \metapost color expression, that can be used anywhere color expression is expected
+% as well as after the |withcolor| operator.
+% For instance:
+%\begin{verbatim}
% color col;
% col := mplibtexcolor "olive!50";
-% \end{verbatim}
-% The result may vary in its color model (gray/rgb/cmyk)
+%\end{verbatim}
+% But the result may vary in its color model (gray/rgb/cmyk)
% according to the given \TeX\ color. (Spot colors are forced to
% cmyk model, so this operator is not recommended for spot colors.)
-% Therefore the example shown above would raise a metapost error:
+% Therefore the example shown above would raise a \metapost error:
% |cmykcolor col;| should have been declared.
-% By contrast, |mplibrgbtexcolor| always returns rgb model expressions.
-%
-% \paragraph{\texttt{mplibgraphictext}}
-% For some amusement, luamplib provides its own metapost operator
-% |mplibgraphictext|, the effect of which is similar to that of
-% \ConTeXt's |graphictext|. However syntax is somewhat different.
-% \begin{verbatim}
+% By contrast, |mplibrgbtexcolor| \emph{<string>} always returns rgb model expressions.
+%
+% \paragraph{\texttt{mplibgraphictext ...}}
+% |mplibgraphictext| is a \metapost operator, the effect of which is similar to that of
+% \ConTeXt's |graphictext| or our own |mpliboutlinetext|
+% (see \hyperlink{mpliboutlinetext}{below}).
+% However the syntax is somewhat different.
+%\begin{verbatim}
% mplibgraphictext "Funny"
% fakebold 2.3 % fontspec option
% drawcolor .7blue fillcolor "red!50" % color expressions
-% \end{verbatim}
+%\end{verbatim}
% |fakebold|, |drawcolor| and |fillcolor| are optional;
% default values are |2|, |"black"| and |"white"| respectively.
-% When color expressions are given as string, they are regarded as
-% xcolor's or l3color's expressions (this is the same with shading colors).
-% From v2.30, |scale| option is deprecated and is now a synonym of |scaled|.
+% When the color expressions are given in string type, they are regarded as
+% \pkg{color}, \pkg{xcolor} or \pkg{l3color}'s expressions.
% All from |mplibgraphictext| to the end of sentence will compose an
% anonymous |picture|, which can be drawn or assigned to a variable.
% Incidentally, |withdrawcolor| and |withfillcolor| are synonyms of
% |drawcolor| and |fillcolor|, hopefully to be compatible with |graphictext|.
-% \textsc{n.b.} Because luamplib's current implementation is quite different
-% from the \ConTeXt's, there are some limitations such that you can't
-% apply shading (gradient colors) to the text (But see below).
-% In DVI mode, |unicode-math| package is needed for math formula graphictext,
+%
+% \textsc{n.b.}
+% In some cases, |mplibgraphictext| will produce better results than \ConTeXt\
+% or even than our own |mpliboutlinetext|,
+% especially when processing complicated \TeX\ code
+% such as the vertical writing in Chinese or Japanese.
+% However, because the implementation is quite different from others,
+% there are some limitations such that you can't
+% apply shading (gradient colors) to the text. Again,
+% in DVI mode, \pkg{unicode-math} package is needed for math formula,
% as we cannot embolden type1 fonts in DVI mode.
%
-% \paragraph{\texttt{mplibglyph}, \texttt{mplibdrawglyph}}
-% From v2.30, we provide a new metapost operator |mplibglyph|, which returns a metapost picture
+% \paragraph{\texttt{mplibglyph ... of ...}}
+% From v2.30, we provide a new \metapost operator |mplibglyph|, which returns a \metapost picture
% containing outline paths of a glyph in opentype, truetype or type1 fonts.
-% When a type1 font is specified, metapost primitive |glyph| will be called.
-% \begin{verbatim}
+% When a type1 font is specified, \metapost primitive |glyph| will be called.
+%\begin{verbatim}
% mplibglyph 50 of \fontid\font % slot 50 of current font
% mplibglyph "Q" of "TU/TeXGyrePagella(0)/m/n/10" % font csname
% mplibglyph "Q" of "texgyrepagella-regular.otf" % raw filename
% mplibglyph "Q" of "Times.ttc(2)" % subfont number
% mplibglyph "Q" of "SourceHanSansK-VF.otf[Regular]" % instance name
-% \end{verbatim}
+%\end{verbatim}
% Both arguments before and after of ``|of|'' can be either a number or a string.
% Number arguments are regarded as a glyph slot (GID) and a font id number, repectively.
% String argument at the left side is regarded as a glyph name in the font or a unicode character.
@@ -518,76 +603,108 @@ See source file '\inFileName' for licencing and contact information.
% subfont number (starting from zero) of a TTC font; a string within brackets denotes
% an instance name of a variable font.
%
-% The returned picture will be quite similar to the result of |glyph| primitive in its structure.
-% So, metapost's |draw| command will fill the inner path of the picture with background color.
-% In contrast, |mplibdrawglyph| command fills the paths according to the Nonzero Winding
-% Number Rule. As a result, for instance, the area surrounded by inner path of ``O''
+% \paragraph{\texttt{mplibdrawglyph ...}}
+% The picture returned by |mplibglyph| will be quite similar to the result of |glyph| primitive in its structure.
+% So, \metapost's |draw| command will fill the inner path of the picture with the background color.
+% In contrast, |mplibdrawglyph| \emph{<picture>} command fills the paths according to the nonzero winding
+% number rule. As a result, for instance, the area surrounded by inner path of ``O''
% will remain transparent.
%
-% \paragraph{\texttt{mpliboutlinetext}}
-% From v2.31, we provide a new metapost operator |mpliboutlinetext|, which mimicks
-% metafun's |outlinetext|. So the syntax is the same as metafun's. See the metafun
-% manual \textsection\,8.7 (|texdoc metafun|). A simple example:
-% \begin{verbatim}
+% \leavevmode\llap{\textcolor{red}{☞}\kern1.2\parindent}\relax
+% To apply the nonzero winding number rule to a picture containing paths,
+% luamplib appends |withpostscript| |"collect"|
+% to the paths except the last one in the picture.
+% If you want the even-odd rule instead, you can, with \emph{plain} format as well,
+% additionally declare |withpostscript| |"evenodd"| to the last path in the picture.
+%
+% \paragraph{\texttt{mpliboutlinetext (...)}}
+% \hypertarget{mpliboutlinetext}{}\relax
+% From v2.31, a new \metapost operator |mpliboutlinetext| is available, which mimicks
+% \emph{metafun}'s |outlinetext|. So the syntax is the same: see the \emph{metafun}
+% manual \S\,8.7 (|texdoc metafun|). A simple example:
+%\begin{verbatim}
% draw mpliboutlinetext.b ("$\sqrt{2+\alpha}$")
% (withcolor \mpcolor{red!50})
% (withpen pencircle scaled .2 withcolor red)
% scaled 2 ;
-% \end{verbatim}
-% After the process of |mpliboutlinetext|, |mpliboutlinepic[]|
+%\end{verbatim}
+% After the process, |mpliboutlinepic[]|
% and |mpliboutlinenum| will be preserved as global variables;
-% |mpliboutlinepic[1]| \ldots{} |mpliboutlinepic[mpliboutlinenum]|
+% |mpliboutlinepic[1]| |...| |mpliboutlinepic[mpliboutlinenum]|
% will be an array of images each of which containing a glyph or a rule.
+%
% \textsc{n.b.} As Unicode grapheme cluster is not considered in the array, a unit that must be
% a single cluster might be separated apart.
%
-% \paragraph{\cs{mppattern} \ldots\ \cs{endmppattern}, \texttt{withpattern}}
-% |\mppattern{<name>}| \ldots\ |\endmppattern| defines a tiling pattern
+% \paragraph{\cs{mppattern\{...\} ...} \cs{endmppattern}, \texttt{... withpattern ...}}
+% \hypertarget{mppattern}{}\relax
+% \TeX\ macros
+% \cs{mppattern\{<name>\}} |...| \cs{endmppattern} define a tiling pattern
% associated with the |<name>|.
-% MetaPost operator |withpattern|, the syntax being
-% \textit{path} |withpattern| \textit{string}, will return a metapost picture which fills
-% the given path with a tiling pattern of the |<name>|.
-% \begin{verbatim}
-% \mppattern{mypatt} % or \begin{mppattern}{mypatt}
-% [ % options: see below
-% xstep = 10, ystep = 12,
-% matrix = {0,1,-1,0}, % or "0 1 -1 0"
-% ]
-% \mpfig % or any other TeX code,
-% picture q;
-% q := btex Q etex;
-% fill bbox q withcolor .8[red,white];
-% draw q withcolor .8red;
-% \endmpfig
-% \endmppattern % or \end{mppattern}
+% \metapost operator |withpattern|, the syntax being
+% \emph{<path>}\,\textbar\,\emph{<textual picture>} |withpattern| \emph{<string>},
+% will return a \metapost picture which fills
+% the given path or text with a tiling pattern of the |<name>|
+% by replicating it horizontally and vertically.
+% The \emph{textual picture} here means any text typeset by \TeX, mostly the result
+% of the |btex| command (though technically this is not a true textual picture)
+% or the |infont| operator.
%
-% \mpfig
-% fill fullcircle scaled 100 withpostscript "collect";
-% draw unitsquare shifted - center unitsquare scaled 45
-% withpattern "mypatt"
-% withpostscript "evenodd" ;
-% \endmpfig
-% \end{verbatim}
-% The available options are:
-% \begin{center}
+% An example:
+%\begin{verbatim}
+% \mppattern{mypatt} % or \begin{mppattern}{mypatt}
+% [ % options: see below
+% xstep = 10,
+% ystep = 12,
+% matrix = {0, 1, -1, 0}, % or "0 1 -1 0"
+% ]
+% \mpfig % or any other TeX code,
+% draw (origin--(1,1))
+% scaled 10
+% withcolor 1/3[blue,white]
+% ;
+% draw (up--right)
+% scaled 10
+% withcolor 1/3[red,white]
+% ;
+% \endmpfig
+% \endmppattern % or \end{mppattern}
+%
+% \mpfig
+% draw fullcircle scaled 90
+% withpostscript "collect"
+% ;
+% draw fullcircle scaled 200
+% withpattern "mypatt"
+% withpen pencircle scaled 1
+% withcolor \mpcolor{red!50!blue!50}
+% withpostscript "evenodd"
+% ;
+% \endmpfig
+%\end{verbatim}
+%
+% The available options are listed in Table~\ref{tab:mppatternoptions}.
+% \begin{table}
+% \centering
+% \caption{options for \cs{mppattern}}\label{tab:mppatternoptions}
% \begin{tabular}{lll}\hline
% Key & Value Type & Explanation\\\hline
-% |xstep| &\textit{number} & horizontal spacing between pattern cells\\
-% |ystep| &\textit{number} & vertical spacing between pattern cells\\
-% |xshift| &\textit{number} & horizontal shifting of pattern cells\\
-% |yshift| &\textit{number} & vertical shifting of pattern cells\\
-% |matrix| &\textit{table} or \textit{string} & |xx|, |yx|, |xy|, |yy| values\kern1pt* or MP transformation code\\
-% |bbox| &\textit{table} or \textit{string} & |llx|, |lly|, |urx|, |ury| values\kern1pt*\\
-% |resources|&\textit{string} & PDF resources if needed\\
-% |colored| &\textit{boolean}& |false| for uncolored pattern. default: |true|\\\hline
+% |xstep| &\emph{number} & horizontal spacing between pattern cells\\
+% |ystep| &\emph{number} & vertical spacing between pattern cells\\
+% |xshift| &\emph{number} & horizontal shifting of pattern cells\\
+% |yshift| &\emph{number} & vertical shifting of pattern cells\\
+% |bbox| &\emph{table} or \emph{string} & |llx|, |lly|, |urx|, |ury| values\kern1pt*\\
+% |matrix| &\emph{table} or \emph{string} & |xx|, |yx|, |xy|, |yy| values\kern1pt* or MP transform code\\
+% |resources|&\emph{string} & PDF resources if needed\\
+% |colored| or |coloured| &\emph{boolean}& |false| for uncolored pattern. default: |true|\\\hline
% & & \small *\,in string type, numbers are separated by spaces\\
% \end{tabular}
-% \end{center}
+% \end{table}
%
-% For the sake of convenience, width and height values of tiling patterns will be written down
+% For the sake of convenience, the width and height values of tiling patterns will be written down
% into the log file. (depth is always zero.) Users can refer to them for option setting.
%
-% As for |matrix| option, metapost code such as `|rotated 30 slanted .2|' is allowed as well
+% As for |matrix| option, \metapost code such as `|rotated 30 slanted .2|' is allowed as well
% as string or table of four numbers. You can also set |xshift| and |yshift|
% values by using `|shifted|' operator. But when |xshift| or |yshift| option is explicitly
% given, they have precedence over the effect of `|shifted|' operator.
@@ -597,58 +714,307 @@ See source file '\inFileName' for licencing and contact information.
% However, as luamplib automatically includes the resources of the current page, this option
% is not needed in most cases.
%
-% Option |colored=false| will generate an uncolored pattern which shall have no color at all.
-% Uncolored pattern will be painted later by the color of a metapost object.
+% Option |colored=false| (|coloured| is a synonym of |colored|) will generate an uncolored pattern which shall have no color at all.
+% Uncolored pattern will be painted later by the color of a \metapost object.
% An example:
-% \begin{verbatim}
-% \begin{mppattern}{pattuncolored}
+%\begin{verbatim}
+% \begin{mppattern}{pattnocolor}
% [
% colored = false,
-% matrix = "rotated 30",
+% matrix = "slanted .3 rotated 30",
% ]
% \tiny\TeX
% \end{mppattern}
%
% \begin{mplibcode}
% beginfig(1)
-% picture tex; tex := mpliboutlinetext.p ("\bfseries \TeX");
-% i:=0;
-% for item within tex:
-% i:=i+1;
-% if i < length tex:
-% fill pathpart item scaled 10
-% withpostscript "collect";
-% else:
+% picture tex;
+% tex = mpliboutlinetext.p ("\bfseries \TeX");
+% for i=1 upto mpliboutlinenum:
+% j:=0;
+% for item within mpliboutlinepic[i]:
+% j:=j+1;
% draw pathpart item scaled 10
-% withpattern "pattuncolored"
-% withpen pencircle scaled 0.5
-% withcolor 0.7 blue % paints the pattern
-% ;
-% fi
+% if j < length mpliboutlinepic[i]:
+% withpostscript "collect"
+% else:
+% withpattern "pattnocolor"
+% withpen pencircle scaled 1/2
+% withcolor (i/4)[red,blue] % paints the pattern
+% fi;
+% endfor
% endfor
% endfig;
% \end{mplibcode}
-% \end{verbatim}
-%
-% \paragraph{About figure box metrics}
-% Notice that, after each figure is processed, macro \cs{MPwidth} stores
-% the width value of latest figure; \cs{MPheight}, the height value.
-% Incidentally, also note that \cs{MPllx}, \cs{MPlly}, \cs{MPurx}, and
-% \cs{MPury} store the bounding box information of latest figure
-% without the unit |bp|.
-%
-% \paragraph{luamplib.cfg}
-% At the end of package loading, \textsf{luamplib} searches
-% |luamplib.cfg| and, if found, reads the file in automatically.
-% Frequently used settings such as \cs{everymplib}, \cs{mplibforcehmode}
-% or \cs{mplibcodeinherit} are suitable for going into this file.
+%\end{verbatim}
+% A much simpler and efficient way to obtain a similar result
+% (without colorful characters in this example)
+% is to give a \emph{textual picture} as the operand of |withpattern|:
+%\begin{verbatim}
+% \begin{mplibcode}
+% beginfig(2)
+% picture pic;
+% pic = mplibgraphictext "\bfseries\TeX"
+% fakebold 1/2
+% fillcolor 1/3[red,blue] % paints the pattern
+% drawcolor 2/3[red,blue]
+% scaled 10 ;
+% draw pic withpattern "pattnocolor" ;
+% endfig;
+% \end{mplibcode}
+%\end{verbatim}
+%
+% \paragraph{\texttt{... withfademethod ...}}
+% This is a \metapost operator which makes the color of an object gradiently transparent.
+% The syntax is \emph{<path>}\texttt{\textbar}\emph{<picture>} |withfademethod| \emph{<string>},
+% the latter being either |"linear"| or |"circular"|.
+% Though it is similar to the |withshademethod| from \emph{metafun},
+% the differences are: (1) the operand of |withfademethod| can be a picture as well as a path;
+% (2) you cannot make gradient colors, but can only make gradient opacity.
+%
+% Related macros to control optional values are:
+% \begin{description}
+% \let\bfseries\relax
+% \item [|withfadeopacity (|\emph{number, number}|)|]
+% sets the starting opacity and the ending opacity, default value being |(1,0)|.
+% `|1|' denotes full color; `|0|' full transparency.
+% \item [|withfadevector (|\emph{pair, pair}|)|]
+% sets the starting and ending points. Default value in the linear mode is
+% |(llcorner p, lrcorner p)|, where |p| is the operand,
+% meaning that fading starts from the left edge and ends at the right edge.
+% Default value in the circular mode is |(center p, center p)|, which means
+% centers of both starting and ending circles are the center of the bounding box.
+% \item [|withfadecenter|] is a synonym of |withfadevector|.
+% \item [|withfaderadius (|\emph{number, number}|)|]
+% sets the radii of starting and ending circles. This is no-op in the linear mode.
+% Default value is |(0, abs(center p - urcorner p))|, meaning that fading starts from the
+% center and ends at the four corners of the bounding box.
+% \item [|withfadebbox (|\emph{pair, pair}|)|]
+% sets the bounding box of the fading area, default value being |(llcorner p, urcorner p)|.
+% Though this option is not needed in most cases, there could be cases when users want to
+% explicitly control the bounding box.
+% Particularly, see the description \hyperlink{withgroupbbox}{below}
+% on the analogous macro |withgroupbbox|.
+% \end{description}
+% An example:
+%\begin{verbatim}
+% \mpfig
+% picture mill;
+% mill = btex \includegraphics[width=100bp]{mill} etex;
+% draw mill
+% withfademethod "circular"
+% withfadecenter (center mill, center mill)
+% withfaderadius (20, 50)
+% withfadeopacity (1, 0)
+% ;
+% \endmpfig
+%\end{verbatim}
+%
+% \paragraph{\texttt{... asgroup ...}}
+% \hypertarget{transparencygroup}{}\relax
+% As said \hyperlink{metafunformat}{before},
+% transparency group is available with \emph{plain} as well as \emph{metafun} format.
+% The syntax is exactly the same:
+% \emph{<picture>} \textbar\ \emph{<path>} |asgroup|
+% |""| \textbar\ |"isolated"| \textbar\ |"knockout"| \textbar\ |"isolated,knockout"|,
+% which will return a \metapost picture.
+% It is called \emph{Transparency Group} because the objects contained in the group are composited
+% to produce a single object, so that outer transparency effect, if any,
+% will be applied to the group as a whole, not to the individual objects cumulatively.
+%
+% The additional feature provided by luamplib is that
+% you can reuse the group as many times as you want
+% in the \TeX{} code or in other \metapost code chunks,
+% with infinitesimal increase in the size of PDF file.
+% For this functionality we provide \TeX{} and \metapost macros as follows:
+% \begin{description}
+% \let\bfseries\relax
+% \item[|withgroupname| \emph{<string>}] associates a transparency group with the given name.
+% When this is not appended to the sentense with |asgroup| operator,
+% the default group name `|lastmplibgroup|' will be used.
+%
+% \item[\cs{usemplibgroup\{...\}}]
+% \hypertarget{usemplibgroup}{}\relax
+% is a \TeX\ command to reuse a transparency group of the name
+% once used.
+% Note that the position of the group will be origin-based:
+% in other words, lower-left corner of the group will be shifted to the origin.
+%
+% \item[|usemplibgroup| \emph{<string>}] is a \metapost command which will add
+% a transparency group of the name to the |currentpicture|.
+% Contrary to the \TeX\ command just mentioned,
+% the position of the group is the same as the original transparency group.
+%
+% \item[|withgroupbbox (|\emph{pair}|,|\emph{pair}|)|]
+% \hypertarget{withgroupbbox}{}\relax
+% sets the bounding box of the transparency group,
+% default value being |(llcorner p, urcorner p)|.
+% This option might be needed especially when you draw with a thick pen
+% a path that touches the boundary;
+% you would probably want to append to the sentense
+% `|withgroupbbox| |(bot| |lft| |llcorner| |p,| |top| |rt| |urcorner| |p)|',
+% supposing that the pen was selected by the |pickup| command.
+%
+% \end{description}
+% An example showing the difference between the \TeX\ and \metapost commands:
+%\begin{verbatim}
+% \mpfig
+% draw image(
+% fill fullcircle scaled 100 shifted 25right withcolor .5[blue,white];
+% fill fullcircle scaled 100 withcolor .5[red,white] ;
+% ) asgroup ""
+% withgroupname "mygroup";
+% draw (left--right) scaled 10;
+% draw (up--down) scaled 10;
+% \endmpfig
+%
+% \noindent
+% \clap{\vrule width 20pt height .25pt depth .25pt}%
+% \clap{\vrule width .5pt height 10pt depth 10pt}%
+% \usemplibgroup{mygroup}
+%
+% \mpfig
+% usemplibgroup "mygroup" rotated 15;
+% draw (left--right) scaled 10;
+% draw (up--down) scaled 10;
+% \endmpfig
+%\end{verbatim}
+%
+% Also note that normally the reused transparency groups are not affected by outer color commands.
+% However, if you have made the original transparency group using |withoutcolor| command,
+% colors will have effects on the uncolored objects in the group.
+%
+% \paragraph{\cs{mplibgroup\{...\} ...} \cs{endmplibgroup}}
+% These \TeX\ macros are described here in this subsection, as they are
+% deeply related to the |asgroup| operator.
+% Users can define a transparency group or a normal \emph{form XObject}
+% with these macros from \TeX\ side.
+% The syntax is similar to the \cs{mppattern} command (see \hyperlink{mppattern}{above}).
+% An example:
+%\begin{verbatim}
+% \mplibgroup{mygrx} % or \begin{mplibgroup}{mygrx}
+% [ % options: see below
+% asgroup="",
+% ]
+% \mpfig % or any other TeX code
+% pickup pencircle scaled 10;
+% draw (left--right) scaled 30 rotated 45 ;
+% draw (left--right) scaled 30 rotated -45 ;
+% \endmpfig
+% \endmplibgroup % or \end{mplibgroup}
+%
+% \usemplibgroup{mygrx}
+%
+% \mpfig
+% usemplibgroup "mygrx"
+% scaled 1.5
+% withprescript "tr_transparency=0.5" ;
+% \endmpfig
+%\end{verbatim}
+%
+% Availabe options, much fewer than those for \cs{mppattern},
+% are listed in Table~\ref{tab:mplibgroupoptions}.
+% Again, the width/height/depth values of the mplibgroup will be written down into the log file.
+% \begin{table}
+% \centering
+% \caption{options for \cs{mplibgroup}}\label{tab:mplibgroupoptions}
+% \begin{tabular}{lll}
+% \hline
+% Key & Value Type & Explanation\\
+% \hline
+% |asgroup| &\emph{string} & |""|, |"isolated"|, |"knockout"|, or |"isolated,knockout"|\\
+% |bbox| &\emph{table} or \emph{string} & |llx|, |lly|, |urx|, |ury| values\kern1pt*\\
+% |matrix| &\emph{table} or \emph{string} & |xx|, |yx|, |xy|, |yy| values\kern1pt*
+% or MP transform code\\
+% |resources| &\emph{string} & PDF resources if needed\\
+% \hline
+% & & \small *\,in string type, numbers are separated by spaces\\
+% \end{tabular}
+% \end{table}
+%
+% When |asgroup| option, including empty string, is not given,
+% a normal form XObject will be generated rather than a transparency group.
+% Thus the individual objects, not the XObject as a whole, will be affected
+% by outer transparency command.
+%
+% As shown in the example, you can reuse the mplibgroup once defined
+% using the \TeX\ command \cs{usemplibgroup} or
+% the \metapost command |usemplibgroup|.
+% The behavior of these commands is the same as that described \hyperlink{usemplibgroup}{above}.
+%
+%
+% \subsection{Lua}
+%
+% \paragraph{\texttt{runscript ...}}
+% Using the primitive |runscript| \emph{<string>}, you can run a Lua code chunk from \metapost side
+% and get some \metapost code returned by Lua if you want.
+% As the functionality is provided by the \mplib library itself,
+% luamplib does not have much to say about it.
+%
+% One thing is worth mentioning, however:
+% if you return a Lua \emph{table} to the \metapost process,
+% it is automatically converted to a relevant \metapost value type
+% such as pair, color, cmykcolor or transform.
+% So users can save some extra toil of converting a table to a string, though it's not a big deal.
+% For instance, |runscript "return {1,0,0}"| will give you the \metapost color expression |(1,0,0)|
+% automatically.
+%
+% \paragraph{Lua table \texttt{luamplib.instances}}
+% Users can access the Lua table containing \mplib instances, |luamplib.instances|,
+% through which \metapost variables are also easily accessible from Lua side,
+% as documented in Lua\TeX{} manual \S\,11.2.8.4 (|texdoc luatex|).
+% The following will print |false|, |3.0|, |MetaPost| and
+% the knots and the cyclicity of the path |unitsquare|, consecutively.
+%\begin{verbatim}
+% \begin{mplibcode}[instance1]
+% boolean b; b = 1 > 2;
+% numeric n; n = 3;
+% string s; s = "MetaPost";
+% path p; p = unitsquare;
+% \end{mplibcode}
%
-% \bigskip
+% \directlua{
+% local instance1 = luamplib.instances.instance1
+% print( instance1:get_boolean "b" )
+% print( instance1:get_number "n" )
+% print( instance1:get_string "s" )
+% local t = instance1:get_path "p"
+% for k,v in pairs(t) do
+% print(k, type(v)=='table' and table.concat(v,' ') or v)
+% end
+% }
+%\end{verbatim}
+%
+% \paragraph{Lua function \texttt{luamplib.process\_mplibcode}}
+% Users can execute a \metapost code chunk from Lua side by using this function:
+%\begin{verbatim}
+% luamplib.process_mplibcode (<string> metapost code, <string> instance name)
+%\end{verbatim}
+% The second argument cannot be absent, but can be an empty string (|""|) which
+% means that it has no instance name.
+%
+% Some other elements in the |luamplib| namespace, listed in Table~\ref{tab:elementsinluamplib},
+% can have effects on the process of |process_mplibcode|.
+% \begin{table}
+% \centering
+% \caption{elements in \texttt{luamplib} table (partial)}\label{tab:elementsinluamplib}
+% \begin{tabular}{lll}\hline
+% Key & Type & Related \TeX\ macro \\\hline
+% |codeinherit| & \emph{boolean} & \cs{mplibcodeinherit}\\
+% |everyendmplib| & \emph{table} & \cs{everyendmplib}\\
+% |everymplib| & \emph{table} & \cs{everymplib}\\
+% |getcachedir| & \emph{function} (\emph{<string>}) & \cs{mplibcachedir}\\
+% |globaltextext| & \emph{boolean} & \cs{mplibglobaltextext}\\
+% |legacyverbatimtex| & \emph{boolean} & \cs{mpliblegacybehavior}\\
+% |noneedtoreplace| & \emph{table} & \cs{mplibmakenocache}\\
+% |numbersystem| & \emph{string} & \cs{mplibnumbersystem}\\
+% |setformat| & \emph{function} (\emph{<string>}) & \cs{mplibsetformat}\\
+% |showlog| & \emph{boolean} & \cs{mplibshowlog}\\
+% |textextlabel| & \emph{boolean} & \cs{mplibtextextlabel}\\
+% |verbatiminput| & \emph{boolean} & \cs{mplibverbatim}\\\hline
+% \end{tabular}
+% \end{table}
%
-% There are (basically) two formats for metapost: \emph{plain} and
-% \emph{metafun}. By default, the \emph{plain} format is used, but you can set
-% the format to be used by future figures at any time using
-% \cs{mplibsetformat}\marg{format name}.
%
% \section{Implementation}
%
@@ -662,14 +1028,14 @@ See source file '\inFileName' for licencing and contact information.
luatexbase.provides_module {
name = "luamplib",
- version = "2.32.2",
- date = "2024/06/14",
+ version = "2.34.5",
+ date = "2024/08/03",
description = "Lua package to typeset Metapost with LuaTeX's MPLib.",
}
% \end{macrocode}
%
-% Use the |luamplib| namespace, since |mplib| is for the metapost library
+% Use the |luamplib| namespace, since |mplib| is for the \metapost library
% itself. \ConTeXt{} uses |metapost|.
% \begin{macrocode}
luamplib = luamplib or { }
@@ -705,7 +1071,6 @@ local function termorlog (target, text, kind)
if kind == "Error" then error() end
end
end
-
local function warn (...) -- beware '%' symbol
termorlog("term and log", select("#",...) > 1 and format(...) or ...)
end
@@ -721,33 +1086,23 @@ luamplib.showlog = luamplib.showlog or false
% \end{macrocode}
%
% This module is a stripped down version of libraries that are used by
-% \ConTeXt. Provide a few ``shortcuts'' expected by the imported code.
+% \ConTeXt. Provide a few ``shortcuts'' expected by the code.
% \begin{macrocode}
local tableconcat = table.concat
local tableinsert = table.insert
+local tableunpack = table.unpack
local texsprint = tex.sprint
local texgettoks = tex.gettoks
local texgetbox = tex.getbox
local texruntoks = tex.runtoks
-% \end{macrocode}
-%
-% We don't use |tex.scantoks| anymore. See below reagrding |tex.runtoks|.
-% \begin{verbatim}
-% local texscantoks = tex.scantoks
-% \end{verbatim}
-% \begin{macrocode}
-
if not texruntoks then
err("Your LuaTeX version is too old. Please upgrade it to the latest")
end
-
local is_defined = token.is_defined
local get_macro = token.get_macro
-
local mplib = require ('mplib')
local kpse = require ('kpse')
local lfs = require ('lfs')
-
local lfsattributes = lfs.attributes
local lfsisdir = lfs.isdir
local lfsmkdir = lfs.mkdir
@@ -763,7 +1118,6 @@ local file = file or { }
local replacesuffix = file.replacesuffix or function(filename, suffix)
return (filename:gsub("%.[%a%d]+$","")) .. "." .. suffix
end
-
local is_writable = file.is_writable or function(name)
if lfsisdir(name) then
name = name .. "/_luam_plib_temp_file_"
@@ -785,14 +1139,11 @@ end
% \end{macrocode}
%
% |btex ... etex| in input |.mp| files will be replaced in finder.
-% Because of the limitation of MPLib regarding |make_text|,
+% Because of the limitation of \mplib regarding |make_text|,
% we might have to make cache files modified from input files.
% \begin{macrocode}
-local luamplibtime = kpse.find_file("luamplib.lua")
-luamplibtime = luamplibtime and lfsattributes(luamplibtime,"modification")
-
+local luamplibtime = lfsattributes(kpse.find_file"luamplib.lua", "modification")
local currenttime = os.time()
-
local outputdir, cachedir
if lfstouch then
for i,v in ipairs{'TEXMFVAR','TEXMF_OUTPUT_DIRECTORY','.','TEXMFOUTPUT'} do
@@ -829,10 +1180,9 @@ function luamplib.getcachedir(dir)
end
end
end
-
% \end{macrocode}
%
-% Some basic MetaPost files not necessary to make cache files.
+% Some basic \metapost files not necessary to make cache files.
% \begin{macrocode}
local noneedtoreplace = {
["boxes.mp"] = true, -- ["format.mp"] = true,
@@ -851,7 +1201,6 @@ local noneedtoreplace = {
["mp-tool.mpiv"] = true, ["mp-cont.mpiv"] = true,
}
luamplib.noneedtoreplace = noneedtoreplace
-
% \end{macrocode}
%
% |format.mp| is much complicated, so specially treated.
@@ -873,7 +1222,6 @@ local function replaceformatmp(file,newfile,ofmodify)
lfstouch(newfile,currenttime,ofmodify)
return newfile
end
-
% \end{macrocode}
%
% Replace |btex ... etex| and |verbatimtex ... etex| in input files,
@@ -883,7 +1231,6 @@ local name_b = "%f[%a_]"
local name_e = "%f[^%a_]"
local btex_etex = name_b.."btex"..name_e.."%s*(.-)%s*"..name_b.."etex"..name_e
local verbatimtex_etex = name_b.."verbatimtex"..name_e.."%s*(.-)%s*"..name_b.."etex"..name_e
-
local function replaceinputmpfile (name,file)
local ofmodify = lfsattributes(file,"modification")
if not ofmodify then return file end
@@ -896,23 +1243,19 @@ local function replaceinputmpfile (name,file)
return nf.size == 0 and file or newfile
end
end
-
if name == "format.mp" then return replaceformatmp(file,newfile,ofmodify) end
-
local fh = ioopen(file,"r")
if not fh then return file end
local data = fh:read("*all"); fh:close()
-
% \end{macrocode}
-% ``|etex|'' must be followed by a space or semicolon as specified in
-% \LuaTeX\ manual, which is not the case of standalone MetaPost though.
+% ``|etex|'' must be preceded by a space and followed by a space or semicolon as specified in
+% \LuaTeX\ manual, which is not the case of standalone \metapost though.
% \begin{macrocode}
local count,cnt = 0,0
data, cnt = data:gsub(btex_etex, "btex %1 etex ") -- space
count = count + cnt
data, cnt = data:gsub(verbatimtex_etex, "verbatimtex %1 etex;") -- semicolon
count = count + cnt
-
if count == 0 then
noneedtoreplace[name] = true
fh = ioopen(newfile,"w");
@@ -922,7 +1265,6 @@ local function replaceinputmpfile (name,file)
end
return file
end
-
fh = ioopen(newfile,"w")
if not fh then return file end
fh:write(data); fh:close()
@@ -932,8 +1274,8 @@ end
% \end{macrocode}
%
-% As the finder function for MPLib, use the |kpse| library and
-% make it behave like as if MetaPost was used. And replace it with
+% As the finder function for \mplib, use the |kpse| library and
+% make it behave like as if \metapost was used. And replace |.mp| files with
% cache files if needed.
% See also \#74, \#97.
% \begin{macrocode}
@@ -945,12 +1287,10 @@ do
end
mpkpse = kpse.new(arg[exe], "mpost")
end
-
local special_ftype = {
pfb = "type1 fonts",
enc = "enc files",
}
-
function luamplib.finder (name, mode, ftype)
if mode == "w" then
if name and name ~= "mpout.log" then
@@ -976,9 +1316,9 @@ end
% \end{macrocode}
%
-% Create and load MPLib instances.
-% We do not support ancient version of MPLib any more.
-% (Don't know which version of MPLib started to support
+% Create and load \mplib instances.
+% We do not support ancient version of \mplib any more.
+% (Don't know which version of \mplib started to support
% |make_text| and |run_script|; let the users find it.)
% \begin{macrocode}
local preamble = [[
@@ -987,25 +1327,23 @@ local preamble = [[
let normalfontsize = fontsize;
input %s ;
]]
-
% \end{macrocode}
%
-% |plain| or |metafun|,
-% though we cannot support |metafun| format fully.
+% \emph{plain} or \emph{metafun},
+% though we cannot support \emph{metafun} format fully.
% \begin{macrocode}
local currentformat = "plain"
function luamplib.setformat (name)
currentformat = name
end
-
% \end{macrocode}
%
% v2.9 has introduced the concept of ``code inherit''
% \begin{macrocode}
luamplib.codeinherit = false
local mplibinstances = {}
+luamplib.instances = mplibinstances
local has_instancename = false
-
local function reporterror (result, prevlog)
if not result then
err("no result object returned")
@@ -1032,7 +1370,7 @@ local function reporterror (result, prevlog)
% \end{macrocode}
% v2.6.1: now luamplib does not disregard |show| command,
% even when |luamplib.showlog| is false. Incidentally,
-% it does not raise error but just prints an info,
+% it does not raise error nor prints an info,
% even if output has no figure.
% \begin{macrocode}
local show = log:match"\n>>? .+"
@@ -1046,17 +1384,20 @@ local function reporterror (result, prevlog)
return log
end
end
-
+% \end{macrocode}
+%
+% |lualibs-os.lua| installs a randomseed. When this file is not loaded,
+% we should explicitly seed a unique integer to get random randomseed for each run.
+% \begin{macrocode}
+if not math.initialseed then math.randomseed(currenttime) end
local function luamplibload (name)
local mpx = mplib.new {
ini_version = true,
find_file = luamplib.finder,
% \end{macrocode}
% Make use of |make_text| and |run_script|, which will co-operate
-% with \LuaTeX's |tex.runtoks|. And we
-% provide |numbersystem| option since v2.4. Default value ``|scaled|''
-% can be changed by declaring |\mplibnumbersystem{double}|
-% or |\mplibnumbersystem{decimal}|.
+% with \LuaTeX's |tex.runtoks| or other Lua functions. And we
+% provide |numbersystem| option since v2.4.
% See \url{https://github.com/lualatex/luamplib/issues/21}.
% \begin{macrocode}
make_text = luamplib.maketext,
@@ -1067,12 +1408,12 @@ local function luamplibload (name)
extensions = 1,
}
% \end{macrocode}
-% Append our own MetaPost preamble to the preamble above.
+% Append our own \metapost preamble to the preamble above.
% \begin{macrocode}
local preamble = tableconcat{
format(preamble, replacesuffix(name,"mp")),
luamplib.preambles.mplibcode,
- luamplib.legacy_verbatimtex and luamplib.preambles.legacyverbatimtex or "",
+ luamplib.legacyverbatimtex and luamplib.preambles.legacyverbatimtex or "",
luamplib.textextlabel and luamplib.preambles.textextlabel or "",
}
local result, log
@@ -1084,22 +1425,12 @@ local function luamplibload (name)
log = reporterror(result)
return mpx, result, log
end
-
% \end{macrocode}
%
% Here, excute each |mplibcode| data,
% ie |\begin{mplibcode} ... \end{mplibcode}|.
% \begin{macrocode}
local function process (data, instancename)
-% \end{macrocode}
-% The workaround of issue \#70 seems to be unnecessary, as we use
-% |make_text| now.
-% \begin{verbatim}
-% if not data:find(name_b.."beginfig%s*%([%+%-%s]*%d[%.%d%s]*%)") then
-% data = data .. "beginfig(-1);endfig;"
-% end
-% \end{verbatim}
-% \begin{macrocode}
local currfmt
if instancename and instancename ~= "" then
currfmt = instancename
@@ -1109,7 +1440,7 @@ local function process (data, instancename)
currentformat,
luamplib.numbersystem or "scaled",
tostring(luamplib.textextlabel),
- tostring(luamplib.legacy_verbatimtex),
+ tostring(luamplib.legacyverbatimtex),
}
has_instancename = false
end
@@ -1143,40 +1474,30 @@ end
% |dvipdfmx| is supported, though nobody seems to use it.
% \begin{macrocode}
local pdfmode = tex.outputmode > 0
+
% \end{macrocode}
%
-% |make_text| and some |run_script| uses \LuaTeX's |tex.runtoks|,
-% which made possible running \TeX\ code snippets inside |\directlua|.
+% |make_text| and some |run_script| uses \LuaTeX's |tex.runtoks|.
% \begin{macrocode}
local catlatex = luatexbase.registernumber("catcodetable@latex")
local catat11 = luatexbase.registernumber("catcodetable@atletter")
-
% \end{macrocode}
%
% |tex.scantoks| sometimes fail to read catcode properly, especially
% |\#|, |\&|, or |\%|. After some experiment, we dropped using it.
-% Instead, a function containing |tex.script| seems to work nicely.
-% \begin{verbatim}
-% local function run_tex_code_no_use (str, cat)
-% cat = cat or catlatex
-% texscantoks("mplibtmptoks", cat, str)
-% texruntoks("mplibtmptoks")
-% end
-% \end{verbatim}
+% Instead, a function containing |tex.sprint| seems to work nicely.
% \begin{macrocode}
local function run_tex_code (str, cat)
texruntoks(function() texsprint(cat or catlatex, str) end)
end
-
% \end{macrocode}
%
-% Prepare textext box number containers,
-% locals, globals and possibly instances.
+% Prepare textext box number containers, locals and globals.
% |localid| can be any number. They are local anyway.
% The number will be reset at the start of a new code chunk.
% Global boxes will use |\newbox| command in |tex.runtoks| process.
-% This is the same when |codeinherit| is declared as true.
-% Boxes of an instance will also be global, so that
+% This is the same when |codeinherit| is true.
+% Boxes in instances with name will also be global, so that
% their tex boxes can be shared among instances of the same name.
% \begin{macrocode}
local texboxes = { globalid = 0, localid = 4096 }
@@ -1184,11 +1505,9 @@ local texboxes = { globalid = 0, localid = 4096 }
% For conversion of |sp| to |bp|.
% \begin{macrocode}
local factor = 65536*(7227/7200)
-
local textext_fmt = 'image(addto currentpicture doublepath unitsquare \z
-xscaled %f yscaled %f shifted (0,-%f) \z
-withprescript "mplibtexboxid=%i:%f:%f")'
-
+ xscaled %f yscaled %f shifted (0,-%f) \z
+ withprescript "mplibtexboxid=%i:%f:%f")'
local function process_tex_text (str)
if str then
local global = (has_instancename or luamplib.globaltextext or luamplib.codeinherit)
@@ -1200,8 +1519,7 @@ local function process_tex_text (str)
else
local boxid = texboxes.globalid + 1
texboxes.globalid = boxid
- run_tex_code(format(
- [[\expandafter\newbox\csname luamplib.box.%s\endcsname]], boxid))
+ run_tex_code(format([[\expandafter\newbox\csname luamplib.box.%s\endcsname]], boxid))
tex_box_id = tex.getcount'allocationnumber'
end
run_tex_code(format("%s\\setbox%i\\hbox{%s}", global, tex_box_id, str))
@@ -1219,7 +1537,6 @@ end
% Make |color| or |xcolor|'s color expressions usable,
% with \cs{mpcolor} or |mplibcolor|. These commands should be used
% with graphical objects.
-%
% Attempt to support l3color as well.
% \begin{macrocode}
local mplibcolorfmt = {
@@ -1235,7 +1552,6 @@ local mplibcolorfmt = {
[[\color_select:n%s\endgroup]],
},
}
-
local colfmt = is_defined'color_select:n' and "l3color" or "xcolor"
if colfmt == "l3color" then
run_tex_code{
@@ -1249,7 +1565,6 @@ if colfmt == "l3color" then
}
end
local ccexplat = luatexbase.registernumber"luamplibcctabexplat"
-
local function process_color (str)
if str then
if not str:find("%b{}") then
@@ -1310,20 +1625,18 @@ end
%
% For legacy verbatimtex process.
% |verbatimtex ... etex| before |beginfig()| is not ignored,
-% but the \TeX\ code is inserted just before the mplib box. And
-% \TeX\ code inside |beginfig() ... endfig| is inserted after the mplib box.
+% but the \TeX\ code is inserted just before the \mplib box. And
+% \TeX\ code inside |beginfig() ... endfig| is inserted after the \mplib box.
% \begin{macrocode}
local tex_code_pre_mplib = {}
luamplib.figid = 1
luamplib.in_the_fig = false
-
local function process_verbatimtex_prefig (str)
if str then
tex_code_pre_mplib[luamplib.figid] = str
end
return ""
end
-
local function process_verbatimtex_infig (str)
if str then
return format('special "postmplibverbtex=%s";', str)
@@ -1342,17 +1655,16 @@ local runscript_funcs = {
% \end{macrocode}
%
-% For |metafun| format. see issue \#79.
+% For \emph{metafun} format. see issue \#79.
% \begin{macrocode}
mp = mp or {}
local mp = mp
mp.mf_path_reset = mp.mf_path_reset or function() end
mp.mf_finish_saving_data = mp.mf_finish_saving_data or function() end
mp.report = mp.report or info
-
% \end{macrocode}
%
-% metafun 2021-03-09 changes crashes luamplib.
+% \emph{metafun} 2021-03-09 changes crashes luamplib.
% \begin{macrocode}
catcodes = catcodes or {}
local catcodes = catcodes
@@ -1386,7 +1698,6 @@ local function mpprint(buffer,...)
end
end
end
-
function luamplib.runscript (code)
local id, str = code:match("(.-){(.*)}")
if id and str then
@@ -1408,7 +1719,7 @@ function luamplib.runscript (code)
return buffer
end
buffer = {}
- mpprint(buffer, table.unpack(res))
+ mpprint(buffer, tableunpack(res))
return tableconcat(buffer)
end
return ""
@@ -1425,9 +1736,7 @@ local function protecttexcontents (str)
:gsub("%zPerCent%z", "\\%%")
:gsub("%s+", " ")
end
-
-luamplib.legacy_verbatimtex = true
-
+luamplib.legacyverbatimtex = true
function luamplib.maketext (str, what)
if str and str ~= "" then
str = protecttexcontents(str)
@@ -1436,7 +1745,7 @@ function luamplib.maketext (str, what)
not str:find("\\begin%s*{document}") and
not str:find("\\documentstyle"..name_e) and
not str:find("\\usepackage"..name_e) then
- if luamplib.legacy_verbatimtex then
+ if luamplib.legacyverbatimtex then
if luamplib.in_the_fig then
return process_verbatimtex_infig(str)
else
@@ -1455,13 +1764,13 @@ end
% \end{macrocode}
%
-% luamplib's metapost color operators
+% luamplib's \metapost color operators
% \begin{macrocode}
local function colorsplit (res)
- local t, tt = { }, res:gsub("[%[%]]",""):explode()
+ local t, tt = { }, res:gsub("[%[%]]","",2):explode()
local be = tt[1]:find"^%d" and 1 or 2
for i=be, #tt do
- if tt[i]:find"^%a" then break end
+ if not tonumber(tt[i]) then break end
t[#t+1] = tt[i]
end
return t
@@ -1495,7 +1804,7 @@ luamplib.shadecolor = function (str)
if res:find" cs " or res:find"@pdf.obj" then -- spot color shade: l3 only
% \end{macrocode}
% An example of spot color shading:
-% \begin{verbatim}
+%\begin{verbatim}
% \documentclass{article}
% \usepackage{luamplib}
% \mplibsetformat{metafun}
@@ -1541,37 +1850,64 @@ luamplib.shadecolor = function (str)
% endfig;
% \end{mplibcode}
% \end{document}
-% \end{verbatim}
+%\end{verbatim}
+% another one: user-defined DeviceN colorspace
+%\begin{verbatim}
+% \DocumentMetadata{ }
+% \documentclass{article}
+% \usepackage{luamplib}
+% \mplibsetformat{metafun}
+% \ExplSyntaxOn
+% \color_model_new:nnn { pantone1215 }
+% { Separation }
+% { name = PANTONE~1215~U ,
+% alternative-model = cmyk ,
+% alternative-values = {0, 0.15, 0.51, 0}
+% }
+% \color_model_new:nnn { pantone+black }
+% { DeviceN }
+% {
+% names = {pantone1215,black}
+% }
+% \color_set:nnn{purepantone}{pantone+black}{1,0}
+% \color_set:nnn{pureblack} {pantone+black}{0,1}
+% \ExplSyntaxOff
+% \begin{document}
+% \mpfig
+% fill unitsquare xscaled \mpdim{\textwidth} yscaled 30
+% withshademethod "linear"
+% withshadecolors ("purepantone","pureblack")
+% ;
+% \endmpfig
+% \end{document}
+%\end{verbatim}
% \begin{macrocode}
run_tex_code({
[[\color_export:nnN{]], str, [[}{backend}\mplib_@tempa]],
},ccexplat)
- local name = get_macro'mplib_@tempa':match'{(.-)}{.+}'
+ local name, value = get_macro'mplib_@tempa':match'{(.-)}{(.-)}'
local t, obj = res:explode()
if pdfmode then
- obj = t[1]:match"^/(.+)"
- if ltx.pdf and ltx.pdf.object_id then
- obj = format("%s 0 R", ltx.pdf.object_id(obj))
- else
- run_tex_code({
- [[\edef\mplib_@tempa{\pdf_object_ref:n{]], obj, "}}",
- },ccexplat)
- obj = get_macro'mplib_@tempa'
- end
+ obj = format("%s 0 R", ltx.pdf.object_id( t[1]:sub(2,-1) ))
else
obj = t[2]
end
- local value = t[3]:match"%[(.-)%]" or t[3]
- return format('(%s) withprescript"mplib_spotcolor=%s:%s"', value,obj,name)
+ return format('(1) withprescript"mplib_spotcolor=%s:%s:%s"', value,obj,name)
end
return colorsplit(res)
end
% \end{macrocode}
%
+% Remove trailing zeros for smaller PDF
+% \begin{macrocode}
+local decimals = "%.%d+"
+local function rmzeros(str) return str:gsub("%.?0+$","") end
+
+% \end{macrocode}
+%
% luamplib's mplibgraphictext operator
% \begin{macrocode}
-local running = -1073741824
local emboldenfonts = { }
local function getemboldenwidth (curr, fakebold)
local width = emboldenfonts.width
@@ -1604,13 +1940,14 @@ local function getrulewhatsit (line, wd, ht, dp)
fmt = "pdf:content "..fmt
pl = node.new("whatsit","special")
end
- pl.data = fmt:format(line, 0, -dp, wd, ht+dp, "B")
+ pl.data = fmt:format(line, 0, -dp, wd, ht+dp, "B") :gsub(decimals,rmzeros)
local ss = node.new"glue"
node.setglue(ss, 0, 65536, 65536, 2, 2)
pl.next = ss
return pl
end
local function getrulemetric (box, curr, bp)
+ local running = -1073741824
local wd,ht,dp = curr.width, curr.height, curr.depth
wd = wd == running and box.width or wd
ht = ht == running and box.height or ht
@@ -1662,7 +1999,8 @@ local function embolden (box, curr, fakebold)
head, curr = node.remove(head, curr)
elseif curr.id == node.id"glyph" and curr.font > 0 then
local f = curr.font
- local i = emboldenfonts[f]
+ local key = format("%s:%s",f,fakebold)
+ local i = emboldenfonts[key]
if not i then
local ft = font.getfont(f) or font.getcopy(f)
if pdfmode then
@@ -1678,7 +2016,7 @@ local function embolden (box, curr, fakebold)
name = format('%s;embolden=%s;',name,fakebold)
_, i = fonts.constructors.readanddefine(name,ft.size)
end
- emboldenfonts[f] = i
+ emboldenfonts[key] = i
end
curr.font = i
end
@@ -1690,6 +2028,9 @@ end
local function graphictextcolor (col, filldraw)
if col:find"^[%d%.:]+$" then
col = col:explode":"
+ for i=1,#col do
+ col[i] = format("%.3f", col[i])
+ end
if pdfmode then
local op = #col == 4 and "k" or #col == 3 and "rg" or "g"
col[#col+1] = filldraw == "fill" and op or op:upper()
@@ -1868,7 +2209,7 @@ function luamplib.glyph (f, c)
if not gid then return mperr"cannot get GID (glyph id)" end
local fac = 1000 / (shapedata.units or 1000)
local t = shapedata.glyphs[gid].segments
- if not t then return "image(fill fullcircle scaled 0;)" end
+ if not t then return "image()" end
for i,v in ipairs(t) do
if type(v) == "table" then
for ii,vv in ipairs(v) do
@@ -1887,7 +2228,7 @@ end
% mpliboutlinetext : based on mkiv's font-mps.lua
% \begin{macrocode}
local rulefmt = "mpliboutlinepic[%i]:=image(addto currentpicture contour \z
-unitsquare shifted - center unitsquare;) xscaled %f yscaled %f shifted (%f,%f);"
+ unitsquare shifted - center unitsquare;) xscaled %f yscaled %f shifted (%f,%f);"
local outline_horz, outline_vert
function outline_vert (res, box, curr, xshift, yshift)
local b2u = box.dir == "LTL"
@@ -2122,13 +2463,13 @@ function luamplib.outlinetext (text)
local id = tonumber(fmt:match"mplibtexboxid=(%d+):")
local box = texgetbox(id)
local res = outline_horz({ }, box, box.head, 0, 0)
- if #res == 0 then res = { "mpliboutlinepic[1]:=image(fill fullcircle scaled 0;);" } end
+ if #res == 0 then res = { "mpliboutlinepic[1]:=image();" } end
return tableconcat(res) .. format("mpliboutlinenum:=%i;", #res)
end
% \end{macrocode}
%
-% Our MetaPost preambles
+% Our \metapost preambles
% \begin{macrocode}
luamplib.preambles = {
mplibcode = [[
@@ -2313,7 +2654,13 @@ vardef mpliboutlinetext@# (expr t) text rest =
) mplib_do_outline_options_r; )
enddef ;
primarydef t withpattern p =
- image( fill t withprescript "mplibpattern=" & if numeric p: decimal fi p; )
+ image(
+ if cycle t:
+ fill
+ else:
+ draw
+ fi
+ t withprescript "mplibpattern=" & if numeric p: decimal fi p; )
enddef;
vardef mplibtransformmatrix (text e) =
save t; transform t;
@@ -2327,6 +2674,75 @@ vardef mplibtransformmatrix (text e) =
& decimal ypart t & ","
& "}");
enddef;
+primarydef p withfademethod s =
+ if picture p:
+ image(
+ draw p;
+ draw center p withprescript "mplibfadestate=stop";
+ )
+ else:
+ p withprescript "mplibfadestate=stop"
+ fi
+ withprescript "mplibfadetype=" & s
+ withprescript "mplibfadebbox=" &
+ decimal (xpart llcorner p -1/4) & ":" &
+ decimal (ypart llcorner p -1/4) & ":" &
+ decimal (xpart urcorner p +1/4) & ":" &
+ decimal (ypart urcorner p +1/4)
+enddef;
+def withfadeopacity (expr a,b) =
+ withprescript "mplibfadeopacity=" &
+ decimal a & ":" &
+ decimal b
+enddef;
+def withfadevector (expr a,b) =
+ withprescript "mplibfadevector=" &
+ decimal xpart a & ":" &
+ decimal ypart a & ":" &
+ decimal xpart b & ":" &
+ decimal ypart b
+enddef;
+let withfadecenter = withfadevector;
+def withfaderadius (expr a,b) =
+ withprescript "mplibfaderadius=" &
+ decimal a & ":" &
+ decimal b
+enddef;
+def withfadebbox (expr a,b) =
+ withprescript "mplibfadebbox=" &
+ decimal xpart a & ":" &
+ decimal ypart a & ":" &
+ decimal xpart b & ":" &
+ decimal ypart b
+enddef;
+primarydef p asgroup s =
+ image(
+ draw center p
+ withprescript "mplibgroupbbox=" &
+ decimal (xpart llcorner p -1/4) & ":" &
+ decimal (ypart llcorner p -1/4) & ":" &
+ decimal (xpart urcorner p +1/4) & ":" &
+ decimal (ypart urcorner p +1/4)
+ withprescript "gr_state=start"
+ withprescript "gr_type=" & s;
+ draw p;
+ draw center p withprescript "gr_state=stop";
+ )
+enddef;
+def withgroupbbox (expr a,b) =
+ withprescript "mplibgroupbbox=" &
+ decimal xpart a & ":" &
+ decimal ypart a & ":" &
+ decimal xpart b & ":" &
+ decimal ypart b
+enddef;
+def withgroupname expr s =
+ withprescript "mplibgroupname=" & s
+enddef;
+def usemplibgroup primary s =
+ draw maketext("\usemplibgroup{" & s & "}")
+ shifted runscript("return luamplib.trgroupshifts['" & s & "']")
+enddef;
]],
legacyverbatimtex = [[
def specialVerbatimTeX (text t) = runscript("luamplibprefig{"&t&"}") enddef;
@@ -2356,7 +2772,6 @@ enddef;
% When \cs{mplibverbatim} is enabled, do not expand |mplibcode| data.
% \begin{macrocode}
luamplib.verbatiminput = false
-
% \end{macrocode}
%
% Do not expand |btex ... etex|, |verbatimtex ... etex|, and
@@ -2372,7 +2787,6 @@ local function protect_expansion (str)
return format("\\unexpanded{%s}",str)
end
end
-
local function unprotect_expansion (str)
if str then
return str:gsub("!!!Control!!!", "\\")
@@ -2382,25 +2796,20 @@ local function unprotect_expansion (str)
:gsub("!!!RBrace!!!", "}")
end
end
-
luamplib.everymplib = setmetatable({ [""] = "" },{ __index = function(t) return t[""] end })
luamplib.everyendmplib = setmetatable({ [""] = "" },{ __index = function(t) return t[""] end })
-
function luamplib.process_mplibcode (data, instancename)
texboxes.localid = 4096
-
% \end{macrocode}
% This is needed for legacy behavior
% \begin{macrocode}
- if luamplib.legacy_verbatimtex then
+ if luamplib.legacyverbatimtex then
luamplib.figid, tex_code_pre_mplib = 1, {}
end
-
local everymplib = luamplib.everymplib[instancename]
local everyendmplib = luamplib.everyendmplib[instancename]
data = format("\n%s\n%s\n%s\n",everymplib, data, everyendmplib)
:gsub("\r","\n")
-
% \end{macrocode}
% These five lines are needed for |mplibverbatim| mode.
% \begin{macrocode}
@@ -2440,7 +2849,6 @@ function luamplib.process_mplibcode (data, instancename)
return format("verbatimtex %s etex", unprotect_expansion(str))
end)
end
-
process(data, instancename)
end
@@ -2448,21 +2856,12 @@ end
%
% For parsing |prescript| materials.
% \begin{macrocode}
-local further_split_keys = {
- mplibtexboxid = true,
- sh_color_a = true,
- sh_color_b = true,
-}
local function script2table(s)
local t = {}
for _,i in ipairs(s:explode("\13+")) do
local k,v = i:match("(.-)=(.*)") -- v may contain = or empty.
if k and v and k ~= "" and not t[k] then
- if further_split_keys[k] or further_split_keys[k:sub(1,10)] then
- t[k] = v:explode(":")
- else
- t[k] = v
- end
+ t[k] = v
end
end
return t
@@ -2470,144 +2869,34 @@ end
% \end{macrocode}
%
-% Codes below for inserting PDF lieterals are mostly from ConTeXt general,
-% with small changes when needed.
+% pdfliterals will be stored in |figcontents| table, and written to pdf in one go
+% at the end of the flushing figure.
+% Subtable |post| is for the legacy behavior.
% \begin{macrocode}
-local function getobjects(result,figure,f)
- return figure:objects()
-end
-
-function luamplib.convert (result, flusher)
- luamplib.flush(result, flusher)
- return true -- done
-end
-
local figcontents = { post = { } }
local function put2output(a,...)
figcontents[#figcontents+1] = type(a) == "string" and format(a,...) or a
end
-
local function pdf_startfigure(n,llx,lly,urx,ury)
put2output("\\mplibstarttoPDF{%f}{%f}{%f}{%f}",llx,lly,urx,ury)
end
-
local function pdf_stopfigure()
put2output("\\mplibstoptoPDF")
end
-
% \end{macrocode}
%
% |tex.sprint| with catcode regime -2, as sometimes |#| gets doubled
% in the argument of pdfliteral.
% \begin{macrocode}
-local function pdf_literalcode (fmt,...)
- put2output{-2, format(fmt,...)}
-end
-
-local function pdf_textfigure(font,size,text,width,height,depth)
- text = text:gsub(".",function(c)
- return format("\\hbox{\\char%i}",string.byte(c)) -- kerning happens in metapost : false
- end)
- put2output("\\mplibtextext{%s}{%f}{%s}{%s}{%s}",font,size,text,0,0)
-end
-
-local bend_tolerance = 131/65536
-
-local rx, sx, sy, ry, tx, ty, divider = 1, 0, 0, 1, 0, 0, 1
-
-local function pen_characteristics(object)
- local t = mplib.pen_info(object)
- rx, ry, sx, sy, tx, ty = t.rx, t.ry, t.sx, t.sy, t.tx, t.ty
- divider = sx*sy - rx*ry
- return not (sx==1 and rx==0 and ry==0 and sy==1 and tx==0 and ty==0), t.width
-end
-
-local function concat(px, py) -- no tx, ty here
- return (sy*px-ry*py)/divider,(sx*py-rx*px)/divider
-end
-
-local function curved(ith,pth)
- local d = pth.left_x - ith.right_x
- if abs(ith.right_x - ith.x_coord - d) <= bend_tolerance and abs(pth.x_coord - pth.left_x - d) <= bend_tolerance then
- d = pth.left_y - ith.right_y
- if abs(ith.right_y - ith.y_coord - d) <= bend_tolerance and abs(pth.y_coord - pth.left_y - d) <= bend_tolerance then
- return false
- end
- end
- return true
-end
-
-local function flushnormalpath(path,open)
- local pth, ith
- for i=1,#path do
- pth = path[i]
- if not ith then
- pdf_literalcode("%f %f m",pth.x_coord,pth.y_coord)
- elseif curved(ith,pth) then
- pdf_literalcode("%f %f %f %f %f %f c",ith.right_x,ith.right_y,pth.left_x,pth.left_y,pth.x_coord,pth.y_coord)
- else
- pdf_literalcode("%f %f l",pth.x_coord,pth.y_coord)
- end
- ith = pth
- end
- if not open then
- local one = path[1]
- if curved(pth,one) then
- pdf_literalcode("%f %f %f %f %f %f c",pth.right_x,pth.right_y,one.left_x,one.left_y,one.x_coord,one.y_coord )
- else
- pdf_literalcode("%f %f l",one.x_coord,one.y_coord)
- end
- elseif #path == 1 then -- special case .. draw point
- local one = path[1]
- pdf_literalcode("%f %f l",one.x_coord,one.y_coord)
- end
-end
-
-local function flushconcatpath(path,open)
- pdf_literalcode("%f %f %f %f %f %f cm", sx, rx, ry, sy, tx ,ty)
- local pth, ith
- for i=1,#path do
- pth = path[i]
- if not ith then
- pdf_literalcode("%f %f m",concat(pth.x_coord,pth.y_coord))
- elseif curved(ith,pth) then
- local a, b = concat(ith.right_x,ith.right_y)
- local c, d = concat(pth.left_x,pth.left_y)
- pdf_literalcode("%f %f %f %f %f %f c",a,b,c,d,concat(pth.x_coord, pth.y_coord))
- else
- pdf_literalcode("%f %f l",concat(pth.x_coord, pth.y_coord))
- end
- ith = pth
- end
- if not open then
- local one = path[1]
- if curved(pth,one) then
- local a, b = concat(pth.right_x,pth.right_y)
- local c, d = concat(one.left_x,one.left_y)
- pdf_literalcode("%f %f %f %f %f %f c",a,b,c,d,concat(one.x_coord, one.y_coord))
- else
- pdf_literalcode("%f %f l",concat(one.x_coord,one.y_coord))
- end
- elseif #path == 1 then -- special case .. draw point
- local one = path[1]
- pdf_literalcode("%f %f l",concat(one.x_coord,one.y_coord))
- end
-end
-
-local function start_pdf_code()
- if pdfmode then
- pdf_literalcode("q")
- else
- put2output"\\special{pdf:bcontent}"
- end
-end
-local function stop_pdf_code()
- if pdfmode then
- pdf_literalcode("Q")
- else
- put2output"\\special{pdf:econtent}"
- end
+local function pdf_literalcode (...)
+ put2output{ -2, format(...) :gsub(decimals,rmzeros) }
end
+local start_pdf_code = pdfmode
+ and function() pdf_literalcode"q" end
+ or function() put2output"\\special{pdf:bcontent}" end
+local stop_pdf_code = pdfmode
+ and function() pdf_literalcode"Q" end
+ or function() put2output"\\special{pdf:econtent}" end
% \end{macrocode}
%
@@ -2615,7 +2904,7 @@ end
% |textext(...)| or |TEX(...)|, all being the same internally.
% \begin{macrocode}
local function put_tex_boxes (object,prescript)
- local box = prescript.mplibtexboxid
+ local box = prescript.mplibtexboxid:explode":"
local n,tw,th = box[1],tonumber(box[2]),tonumber(box[3])
if n and tw and th then
local op = object.path
@@ -2679,32 +2968,42 @@ local pdfobjs, pdfetcs = {}, {}
pdfetcs.pgfextgs = "pgf@sys@addpdfresource@extgs@plain"
pdfetcs.pgfpattern = "pgf@sys@addpdfresource@patterns@plain"
pdfetcs.pgfcolorspace = "pgf@sys@addpdfresource@colorspaces@plain"
-
-local function update_pdfobjs (os)
- local on = pdfobjs[os]
+local function update_pdfobjs (os, stream)
+ local key = os
+ if stream then key = key..stream end
+ local on = pdfobjs[key]
if on then
return on,false
end
if pdfmode then
- on = pdf.immediateobj(os)
+ if stream then
+ on = pdf.immediateobj("stream",stream,os)
+ else
+ on = pdf.immediateobj(os)
+ end
else
on = pdfetcs.cnt or 1
- texsprint(format("\\special{pdf:obj @mplibpdfobj%s %s}",on,os))
+ if stream then
+ texsprint(format("\\special{pdf:stream @mplibpdfobj%s (%s) <<%s>>}",on,stream,os))
+ else
+ texsprint(format("\\special{pdf:obj @mplibpdfobj%s %s}",on,os))
+ end
pdfetcs.cnt = on + 1
end
- pdfobjs[os] = on
+ pdfobjs[key] = on
return on,true
end
-
+pdfetcs.resfmt = pdfmode and "%s 0 R" or "@mplibpdfobj%s"
if pdfmode then
pdfetcs.getpageres = pdf.getpageresources or function() return pdf.pageresources end
- pdfetcs.setpageres = pdf.setpageresources or function(s) pdf.pageresources = s end
- pdfetcs.initialize_resources = function (name)
+ local getpageres = pdfetcs.getpageres
+ local setpageres = pdf.setpageresources or function(s) pdf.pageresources = s end
+ local initialize_resources = function (name)
local tabname = format("%s_res",name)
pdfetcs[tabname] = { }
if luatexbase.callbacktypes.finish_pdffile then -- ltluatex
local obj = pdf.reserveobj()
- pdfetcs.setpageres(format("%s/%s %i 0 R", pdfetcs.getpageres() or "", name, obj))
+ setpageres(format("%s/%s %i 0 R", getpageres() or "", name, obj))
luatexbase.add_to_callback("finish_pdffile", function()
pdf.immediateobj(obj, format("<<%s>>", tableconcat(pdfetcs[tabname])))
end,
@@ -2712,21 +3011,38 @@ if pdfmode then
end
end
pdfetcs.fallback_update_resources = function (name, res)
+ local tabname = format("%s_res",name)
+ if not pdfetcs[tabname] then
+ initialize_resources(name)
+ end
if luatexbase.callbacktypes.finish_pdffile then
- local t = pdfetcs[format("%s_res",name)]
+ local t = pdfetcs[tabname]
t[#t+1] = res
else
- local tpr, n = pdfetcs.getpageres() or "", 0
+ local tpr, n = getpageres() or "", 0
tpr, n = tpr:gsub(format("/%s<<",name), "%1"..res)
if n == 0 then
tpr = format("%s/%s<<%s>>", tpr, name, res)
end
- pdfetcs.setpageres(tpr)
+ setpageres(tpr)
end
end
else
- texsprint("\\special{pdf:obj @MPlibTr<<>>}","\\special{pdf:obj @MPlibSh<<>>}",
- "\\special{pdf:obj @MPlibCS<<>>}","\\special{pdf:obj @MPlibPt<<>>}")
+ texsprint {
+ "\\luamplibatfirstshipout{",
+ "\\special{pdf:obj @MPlibTr<<>>}",
+ "\\special{pdf:obj @MPlibSh<<>>}",
+ "\\special{pdf:obj @MPlibCS<<>>}",
+ "\\special{pdf:obj @MPlibPt<<>>}}",
+ }
+ pdfetcs.resadded = { }
+ pdfetcs.fallback_update_resources = function (name,res,obj)
+ texsprint{"\\special{pdf:put ", obj, " <<", res, ">>}"}
+ if not pdfetcs.resadded[name] then
+ texsprint{"\\luamplibateveryshipout{\\special{pdf:put @resources <</", name, " ", obj, ">>}}"}
+ pdfetcs.resadded[name] = obj
+ end
+ end
end
% \end{macrocode}
@@ -2740,22 +3056,19 @@ local transparancy_modes = { [0] = "Normal",
"Hue", "Saturation", "Color", "Luminosity",
"Compatible",
}
-
-local function update_tr_res(mode,opaq)
- local os = format("<</BM /%s/ca %.3f/CA %.3f/AIS false>>",mode,opaq,opaq)
- local on, new = update_pdfobjs(os)
- if not new then return on end
+local function add_extgs_resources (on, new)
local key = format("MPlibTr%s", on)
- local val = format(pdfmode and "%s 0 R" or "@mplibpdfobj%s", on)
- if pdfmanagement then
- texsprint(ccexplat,
- format("\\pdfmanagement_add:nnn{Page/Resources/ExtGState}{%s}{%s}", key, val))
- else
- local tr = format("/%s %s", key, val)
- if is_defined(pdfetcs.pgfextgs) then
- texsprint(format("\\csname %s\\endcsname{%s}", pdfetcs.pgfextgs,tr))
- elseif pdfmode then
- if is_defined"TRP@list" then
+ if new then
+ local val = format(pdfetcs.resfmt, on)
+ if pdfmanagement then
+ texsprint {
+ "\\csname pdfmanagement_add:nnn\\endcsname{Page/Resources/ExtGState}{", key, "}{", val, "}"
+ }
+ else
+ local tr = format("/%s %s", key, val)
+ if is_defined(pdfetcs.pgfextgs) then
+ texsprint { "\\csname ", pdfetcs.pgfextgs, "\\endcsname{", tr, "}" }
+ elseif is_defined"TRP@list" then
texsprint(catat11,{
[[\if@filesw\immediate\write\@auxout{]],
[[\string\g@addto@macro\string\TRP@list{]],
@@ -2766,90 +3079,91 @@ local function update_tr_res(mode,opaq)
texsprint(catat11,[[\global\TRP@reruntrue]])
end
else
- if not pdfetcs.ExtGState_res then
- pdfetcs.initialize_resources"ExtGState"
- end
- pdfetcs.fallback_update_resources("ExtGState", tr)
+ pdfetcs.fallback_update_resources("ExtGState",tr,"@MPlibTr")
end
- else
- texsprint(format("\\special{pdf:put @MPlibTr<<%s>>}",tr))
- texsprint"\\special{pdf:put @resources<</ExtGState @MPlibTr>>}"
end
end
- return on
+ return key
end
-
local function do_preobj_TR(object,prescript)
if object.postscript == "collect" then return end
local opaq = prescript and prescript.tr_transparency
- local tron_no
if opaq then
+ local key, on, os, new
local mode = prescript.tr_alternative or 1
- mode = transparancy_modes[tonumber(mode)]
- tron_no = update_tr_res(mode, opaq)
- start_pdf_code()
- pdf_literalcode("/MPlibTr%i gs",tron_no)
+ mode = transparancy_modes[tonumber(mode)] or mode
+ opaq = format("%.3f", opaq) :gsub(decimals,rmzeros)
+ for i,v in ipairs{ {mode,opaq},{"Normal",1} } do
+ os = format("<</BM/%s/ca %s/CA %s/AIS false>>",v[1],v[2],v[2])
+ on, new = update_pdfobjs(os)
+ key = add_extgs_resources(on,new)
+ if i == 1 then
+ pdf_literalcode("/%s gs",key)
+ else
+ return format("/%s gs",key)
+ end
+ end
end
- return tron_no
end
% \end{macrocode}
%
-% Shading with |metafun| format.
+% Shading with \emph{metafun} format.
% \begin{macrocode}
local function sh_pdfpageresources(shtype,domain,colorspace,ca,cb,coordinates,steps,fractions)
- local fun2fmt,os = "<</FunctionType 2/Domain [%s]/C0 [%s]/C1 [%s]/N 1>>"
+ for _,v in ipairs{ca,cb} do
+ for i,vv in ipairs(v) do
+ for ii,vvv in ipairs(vv) do
+ v[i][ii] = tonumber(vvv) and format("%.3f",vvv) or vvv
+ end
+ end
+ end
+ local fun2fmt,os = "<</FunctionType 2/Domain[%s]/C0[%s]/C1[%s]/N 1>>"
if steps > 1 then
local list,bounds,encode = { },{ },{ }
for i=1,steps do
if i < steps then
- bounds[i] = fractions[i] or 1
+ bounds[i] = format("%.3f", fractions[i] or 1)
end
encode[2*i-1] = 0
encode[2*i] = 1
os = fun2fmt:format(domain,tableconcat(ca[i],' '),tableconcat(cb[i],' '))
- list[i] = format(pdfmode and "%s 0 R" or "@mplibpdfobj%s",update_pdfobjs(os))
+ :gsub(decimals,rmzeros)
+ list[i] = format(pdfetcs.resfmt, update_pdfobjs(os))
end
os = tableconcat {
"<</FunctionType 3",
- format("/Bounds [%s]", tableconcat(bounds,' ')),
- format("/Encode [%s]", tableconcat(encode,' ')),
- format("/Functions [%s]", tableconcat(list, ' ')),
- format("/Domain [%s]>>", domain),
- }
+ format("/Bounds[%s]", tableconcat(bounds,' ')),
+ format("/Encode[%s]", tableconcat(encode,' ')),
+ format("/Functions[%s]", tableconcat(list, ' ')),
+ format("/Domain[%s]>>", domain),
+ } :gsub(decimals,rmzeros)
else
os = fun2fmt:format(domain,tableconcat(ca[1],' '),tableconcat(cb[1],' '))
+ :gsub(decimals,rmzeros)
end
- local objref = format(pdfmode and "%s 0 R" or "@mplibpdfobj%s",update_pdfobjs(os))
+ local objref = format(pdfetcs.resfmt, update_pdfobjs(os))
os = tableconcat {
format("<</ShadingType %i", shtype),
format("/ColorSpace %s", colorspace),
format("/Function %s", objref),
- format("/Coords [%s]", coordinates),
- "/Extend [true true]/AntiAlias true>>",
- }
+ format("/Coords[%s]", coordinates),
+ "/Extend[true true]/AntiAlias true>>",
+ } :gsub(decimals,rmzeros)
local on, new = update_pdfobjs(os)
- if not new then return on end
- local key = format("MPlibSh%s", on)
- local val = format(pdfmode and "%s 0 R" or "@mplibpdfobj%s", on)
- if pdfmanagement then
- texsprint(ccexplat,
- format("\\pdfmanagement_add:nnn{Page/Resources/Shading}{%s}{%s}", key, val))
- else
- local res = format("/%s %s", key, val)
- if pdfmode then
- if not pdfetcs.Shading_res then
- pdfetcs.initialize_resources"Shading"
- end
- pdfetcs.fallback_update_resources("Shading", res)
+ if new then
+ local key, val = format("MPlibSh%s", on), format(pdfetcs.resfmt, on)
+ if pdfmanagement then
+ texsprint {
+ "\\csname pdfmanagement_add:nnn\\endcsname{Page/Resources/Shading}{", key, "}{", val, "}"
+ }
else
- texsprint(format("\\special{pdf:put @MPlibSh<<%s>>}", res))
- texsprint"\\special{pdf:put @resources<</Shading @MPlibSh>>}"
+ local res = format("/%s %s", key, val)
+ pdfetcs.fallback_update_resources("Shading",res,"@MPlibSh")
end
end
return on
end
-
local function color_normalize(ca,cb)
if #cb == 1 then
if #ca == 4 then
@@ -2861,7 +3175,6 @@ local function color_normalize(ca,cb)
cb[1], cb[2], cb[3], cb[4] = 1-cb[1], 1-cb[2], 1-cb[3], 0
end
end
-
pdfetcs.clrspcs = setmetatable({ }, { __index = function(t,names)
run_tex_code({
[[\color_model_new:nnn]],
@@ -2873,7 +3186,6 @@ pdfetcs.clrspcs = setmetatable({ }, { __index = function(t,names)
t[names] = colorspace
return colorspace
end })
-
local function do_preobj_SH(object,prescript)
local shade_no
local sh_type = prescript and prescript.sh_type
@@ -2881,14 +3193,14 @@ local function do_preobj_SH(object,prescript)
return
else
local domain = prescript.sh_domain or "0 1"
- local centera = prescript.sh_center_a or "0 0"; centera = centera:explode()
- local centerb = prescript.sh_center_b or "0 0"; centerb = centerb:explode()
+ local centera = (prescript.sh_center_a or "0 0"):explode()
+ local centerb = (prescript.sh_center_b or "0 0"):explode()
local transform = prescript.sh_transform == "yes"
local sx,sy,sr,dx,dy = 1,1,1,0,0
if transform then
- local first = prescript.sh_first or "0 0"; first = first:explode()
- local setx = prescript.sh_set_x or "0 0"; setx = setx:explode()
- local sety = prescript.sh_set_y or "0 0"; sety = sety:explode()
+ local first = (prescript.sh_first or "0 0"):explode()
+ local setx = (prescript.sh_set_x or "0 0"):explode()
+ local sety = (prescript.sh_set_y or "0 0"):explode()
local x,y = tonumber(setx[1]) or 0, tonumber(sety[1]) or 0
if x ~= 0 and y ~= 0 then
local path = object.path
@@ -2910,15 +3222,15 @@ local function do_preobj_SH(object,prescript)
end
end
local ca, cb, colorspace, steps, fractions
- ca = { prescript.sh_color_a_1 or prescript.sh_color_a or {0} }
- cb = { prescript.sh_color_b_1 or prescript.sh_color_b or {1} }
+ ca = { (prescript.sh_color_a_1 or prescript.sh_color_a or "0"):explode":" }
+ cb = { (prescript.sh_color_b_1 or prescript.sh_color_b or "1"):explode":" }
steps = tonumber(prescript.sh_step) or 1
if steps > 1 then
fractions = { prescript.sh_fraction_1 or 0 }
for i=2,steps do
fractions[i] = prescript[format("sh_fraction_%i",i)] or (i/steps)
- ca[i] = prescript[format("sh_color_a_%i",i)] or {0}
- cb[i] = prescript[format("sh_color_b_%i",i)] or {1}
+ ca[i] = (prescript[format("sh_color_a_%i",i)] or "0"):explode":"
+ cb[i] = (prescript[format("sh_color_b_%i",i)] or "1"):explode":"
end
end
if prescript.mplib_spotcolor then
@@ -2927,15 +3239,14 @@ local function do_preobj_SH(object,prescript)
local script = object.prescript:explode"\13+"
for i=#script,1,-1 do
if script[i]:find"mplib_spotcolor" then
- local name, value
- objref, name = script[i]:match"=(.-):(.+)"
- value = script[i+1]:match"=(.+)"
+ local t, name, value = script[i]:explode"="[2]:explode":"
+ value, objref, name = t[1], t[2], t[3]
if not names[name] then
pos = pos+1
names[name] = pos
names[#names+1] = name
end
- local t = { }
+ t = { }
for j=1,names[name] do t[#t+1] = 0 end
t[#t+1] = value
tableinsert(#ca == #cb and ca or cb, t)
@@ -2986,7 +3297,6 @@ local function do_preobj_SH(object,prescript)
else
err"unknown shading type"
end
- pdf_literalcode("q /Pattern cs")
end
return shade_no
end
@@ -2995,24 +3305,89 @@ end
%
% Patterns
% \begin{macrocode}
-patterns = { }
+pdfetcs.patterns = { }
+local function gather_resources (optres)
+ local t, do_pattern = { }, not optres
+ local names = {"ExtGState","ColorSpace","Shading"}
+ if do_pattern then
+ names[#names+1] = "Pattern"
+ end
+ if pdfmode then
+ if pdfmanagement then
+ for _,v in ipairs(names) do
+ local pp = get_macro(format("g__pdfdict_/g__pdf_Core/Page/Resources/%s_prop",v))
+ if pp and pp:find"__prop_pair" then
+ t[#t+1] = format("/%s %s 0 R", v, ltx.pdf.object_id("__pdf/Page/Resources/"..v))
+ end
+ end
+ else
+ local res = pdfetcs.getpageres() or ""
+ run_tex_code[[\mplibtmptoks\expandafter{\the\pdfvariable pageresources}]]
+ res = res .. texgettoks'mplibtmptoks'
+ if do_pattern then return res end
+ res = res:explode"/+"
+ for _,v in ipairs(res) do
+ v = v:match"^%s*(.-)%s*$"
+ if not v:find"Pattern" and not optres:find(v) then
+ t[#t+1] = "/" .. v
+ end
+ end
+ end
+ else
+ if pdfmanagement then
+ for _,v in ipairs(names) do
+ local pp = get_macro(format("g__pdfdict_/g__pdf_Core/Page/Resources/%s_prop",v))
+ if pp and pp:find"__prop_pair" then
+ run_tex_code {
+ "\\mplibtmptoks\\expanded{{",
+ format("/%s \\csname pdf_object_ref:n\\endcsname{__pdf/Page/Resources/%s}",v,v),
+ "}}",
+ }
+ t[#t+1] = texgettoks'mplibtmptoks'
+ end
+ end
+ elseif is_defined(pdfetcs.pgfextgs) then
+ run_tex_code ({
+ "\\mplibtmptoks\\expanded{{",
+ "\\ifpgf@sys@pdf@extgs@exists /ExtGState @pgfextgs\\fi",
+ "\\ifpgf@sys@pdf@colorspaces@exists /ColorSpace @pgfcolorspaces\\fi",
+ do_pattern and "\\ifpgf@sys@pdf@patterns@exists /Pattern @pgfpatterns \\fi" or "",
+ "}}",
+ }, catat11)
+ t[#t+1] = texgettoks'mplibtmptoks'
+ else
+ for _,v in ipairs(names) do
+ local vv = pdfetcs.resadded[v]
+ if vv then
+ t[#t+1] = format("/%s %s", v, vv)
+ end
+ end
+ end
+ end
+ return tableconcat(t)
+end
function luamplib.registerpattern ( boxid, name, opts )
local box = texgetbox(boxid)
local wd = format("%.3f",box.width/factor)
local hd = format("%.3f",(box.height+box.depth)/factor)
- info("w/h/d of '%s': %s %s 0.0", name, wd, hd)
+ info("w/h/d of pattern '%s': %s 0", name, format("%s %s",wd, hd):gsub(decimals,rmzeros))
if opts.xstep == 0 then opts.xstep = nil end
if opts.ystep == 0 then opts.ystep = nil end
- if opts.colored == nil then opts.colored = true end
+ if opts.colored == nil then
+ opts.colored = opts.coloured
+ if opts.colored == nil then
+ opts.colored = true
+ end
+ end
if type(opts.matrix) == "table" then opts.matrix = tableconcat(opts.matrix," ") end
if type(opts.bbox) == "table" then opts.bbox = tableconcat(opts.bbox," ") end
if opts.matrix and opts.matrix:find"%a" then
local data = format("mplibtransformmatrix(%s);",opts.matrix)
process(data,"@mplibtransformmatrix")
local t = luamplib.transformmatrix
- opts.matrix = format("%s %s %s %s", t[1], t[2], t[3], t[4])
- opts.xshift = opts.xshift or t[5]
- opts.yshift = opts.yshift or t[6]
+ opts.matrix = format("%f %f %f %f", t[1], t[2], t[3], t[4])
+ opts.xshift = opts.xshift or format("%f",t[5])
+ opts.yshift = opts.yshift or format("%f",t[6])
end
local attr = {
"/Type/Pattern",
@@ -3021,87 +3396,52 @@ function luamplib.registerpattern ( boxid, name, opts )
"/TilingType 2",
format("/XStep %s", opts.xstep or wd),
format("/YStep %s", opts.ystep or hd),
- format("/Matrix [%s %s %s]", opts.matrix or "1 0 0 1", opts.xshift or 0, opts.yshift or 0),
+ format("/Matrix[%s %s %s]", opts.matrix or "1 0 0 1", opts.xshift or 0, opts.yshift or 0),
}
+ local optres = opts.resources or ""
+ optres = optres .. gather_resources(optres)
+ local patterns = pdfetcs.patterns
if pdfmode then
- local optres, t = opts.resources or "", { }
- if pdfmanagement then
- for _,v in ipairs{"ExtGState","ColorSpace","Shading"} do
- local pp = get_macro(format("g__pdfdict_/g__pdf_Core/Page/Resources/%s_prop",v))
- if pp and pp:find"__prop_pair" then
- t[#t+1] = format("/%s %s", v, ltx.__pdf.object["__pdf/Page/Resources/"..v])
- end
- end
- else
- local res = pdfetcs.getpageres() or ""
- run_tex_code[[\mplibtmptoks\expandafter{\the\pdfvariable pageresources}]]
- res = (res .. texgettoks'mplibtmptoks'):explode()
- res = tableconcat(res," "):explode"/+"
- for _,v in ipairs(res) do
- if not v:find"Pattern" and not optres:find(v) then
- t[#t+1] = "/" .. v
- end
- end
- end
- optres = optres .. tableconcat(t)
if opts.bbox then
- attr[#attr+1] = format("/BBox [%s]", opts.bbox)
+ attr[#attr+1] = format("/BBox[%s]", opts.bbox)
end
- local index = tex.saveboxresource(boxid, tableconcat(attr), optres, true, opts.bbox and 4 or 1)
+ attr = tableconcat(attr) :gsub(decimals,rmzeros)
+ local index = tex.saveboxresource(boxid, attr, optres, true, opts.bbox and 4 or 1)
patterns[name] = { id = index, colored = opts.colored }
else
- local objname = "@mplibpattern"..name
+ local cnt = #patterns + 1
+ local objname = "@mplibpattern" .. cnt
local metric = format("bbox %s", opts.bbox or format("0 0 %s %s",wd,hd))
- local optres, t = opts.resources or "", { }
- if pdfmanagement then
- for _,v in ipairs{"ExtGState","ColorSpace","Shading"} do
- run_tex_code(format(
- [[\mplibtmptoks\expanded{{/%s \pdf_object_ref:n{__pdf/Page/Resources/%s}}}]],v,v),ccexplat)
- t[#t+1] = texgettoks'mplibtmptoks'
- end
- elseif is_defined(pdfetcs.pgfextgs) then
- run_tex_code("\\mplibtmptoks\\expanded{{\z
- \\ifpgf@sys@pdf@extgs@exists /ExtGState @pgfextgs\\fi\z
- \\ifpgf@sys@pdf@colorspaces@exists /ColorSpace @pgfcolorspaces\\fi}}",catat11)
- t[#t+1] = texgettoks'mplibtmptoks'
- else
- t[#t+1] = "/ExtGState @MPlibTr/Shading @MPlibSh/ColorSpace @MPlibCS"
- end
- optres = optres .. tableconcat(t)
texsprint {
- [[\ifvmode\nointerlineskip\fi]],
- format([[\hbox to0pt{\vbox to0pt{\hsize=\wd %i\vss\noindent]], boxid), -- force horiz mode?
- [[\special{pdf:bcontent}]],
- [[\special{pdf:bxobj ]], objname, format(" %s}", metric),
- format([[\raise\dp %i\box %i]], boxid, boxid),
- format([[\special{pdf:put @resources <<%s>>}]], optres),
- [[\special{pdf:exobj <<]], tableconcat(attr), ">>}",
- [[\special{pdf:econtent}]],
- [[\par}\hss}]],
+ "\\expandafter\\newbox\\csname luamplib.patternbox.", cnt, "\\endcsname",
+ "\\global\\setbox\\csname luamplib.patternbox.", cnt, "\\endcsname",
+ "\\hbox{\\unhbox ", boxid, "}\\luamplibatnextshipout{",
+ "\\special{pdf:bcontent}",
+ "\\special{pdf:bxobj ", objname, " ", metric, "}",
+ "\\raise\\dp\\csname luamplib.patternbox.", cnt, "\\endcsname",
+ "\\box\\csname luamplib.patternbox.", cnt, "\\endcsname",
+ "\\special{pdf:put @resources <<", optres, ">>}",
+ "\\special{pdf:exobj <<", tableconcat(attr), ">>}",
+ "\\special{pdf:econtent}}",
}
- patterns[#patterns+1] = objname
- patterns[name] = { id = #patterns, colored = opts.colored }
+ patterns[cnt] = objname
+ patterns[name] = { id = cnt, colored = opts.colored }
end
end
local function pattern_colorspace (cs)
local on, new = update_pdfobjs(format("[/Pattern %s]", cs))
if new then
- local key = format("MPlibCS%i",on)
- local val = pdfmode and format("%i 0 R",on) or format("@mplibpdfobj%i",on)
+ local key, val = format("MPlibCS%i",on), format(pdfetcs.resfmt,on)
if pdfmanagement then
- texsprint(ccexplat,format("\\pdfmanagement_add:nnn{Page/Resources/ColorSpace}{%s}{%s}",key,val))
+ texsprint {
+ "\\csname pdfmanagement_add:nnn\\endcsname{Page/Resources/ColorSpace}{", key, "}{", val, "}"
+ }
else
local res = format("/%s %s", key, val)
if is_defined(pdfetcs.pgfcolorspace) then
- texsprint(format("\\csname %s\\endcsname{%s}", pdfetcs.pgfcolorspace, res))
- elseif pdfmode then
- if not pdfetcs.ColorSpace_res then
- pdfetcs.initialize_resources"ColorSpace"
- end
- pdfetcs.fallback_update_resources("ColorSpace", res)
+ texsprint { "\\csname ", pdfetcs.pgfcolorspace, "\\endcsname{", res, "}" }
else
- texsprint(format("\\special{pdf:put @MPlibCS<<%s>>}", res))
- texsprint"\\special{pdf:put @resources<</ColorSpace @MPlibCS>>}"
+ pdfetcs.fallback_update_resources("ColorSpace",res,"@MPlibCS")
end
end
end
@@ -3110,6 +3450,7 @@ end
local function do_preobj_PAT(object, prescript)
local name = prescript and prescript.mplibpattern
if not name then return end
+ local patterns = pdfetcs.patterns
local patt = patterns[name]
local index = patt and patt.id or err("cannot get pattern object '%s'", name)
local key = format("MPlibPt%s",index)
@@ -3139,22 +3480,19 @@ local function do_preobj_PAT(object, prescript)
end
pdf_literalcode("/MPlibCS%i cs %s /%s scn", pattern_colorspace(cs), color, key)
end
- if patt.done then return end
- local val = pdfmode and format("%s 0 R",index) or patterns[index]
- if pdfmanagement then
- texsprint(ccexplat, format("\\pdfmanagement_add:nnn{Page/Resources/Pattern}{%s}{%s}",key,val))
- else
- local res = format("/%s %s", key, val)
- if is_defined(pdfetcs.pgfpattern) then
- texsprint(format("\\csname %s\\endcsname{%s}", pdfetcs.pgfpattern, res))
- elseif pdfmode then
- if not pdfetcs.Pattern_res then
- pdfetcs.initialize_resources"Pattern"
- end
- pdfetcs.fallback_update_resources("Pattern", res)
+ if not patt.done then
+ local val = pdfmode and format("%s 0 R",index) or patterns[index]
+ if pdfmanagement then
+ texsprint {
+ "\\csname pdfmanagement_add:nnn\\endcsname{Page/Resources/Pattern}{", key, "}{", val, "}"
+ }
else
- texsprint(format("\\special{pdf:put @MPlibPt<<%s>>}", res))
- texsprint"\\special{pdf:put @resources<</Pattern @MPlibPt>>}"
+ local res = format("/%s %s", key, val)
+ if is_defined(pdfetcs.pgfpattern) then
+ texsprint { "\\csname ", pdfetcs.pgfpattern, "\\endcsname{", res, "}" }
+ else
+ pdfetcs.fallback_update_resources("Pattern",res,"@MPlibPt")
+ end
end
end
patt.done = true
@@ -3162,6 +3500,305 @@ end
% \end{macrocode}
%
+% Fading
+% \begin{macrocode}
+pdfetcs.fading = { }
+local function do_preobj_FADE (object, prescript)
+ local fd_type = prescript and prescript.mplibfadetype
+ local fd_stop = prescript and prescript.mplibfadestate
+ if not fd_type then
+ return fd_stop -- returns "stop" (if picture) or nil
+ end
+ local bbox = prescript.mplibfadebbox:explode":"
+ local dx, dy = -bbox[1], -bbox[2]
+ local vec = prescript.mplibfadevector; vec = vec and vec:explode":"
+ if not vec then
+ if fd_type == "linear" then
+ vec = {bbox[1], bbox[2], bbox[3], bbox[2]} -- left to right
+ else
+ local centerx, centery = (bbox[1]+bbox[3])/2, (bbox[2]+bbox[4])/2
+ vec = {centerx, centery, centerx, centery} -- center for both circles
+ end
+ end
+ local coords = { vec[1]+dx, vec[2]+dy, vec[3]+dx, vec[4]+dy }
+ if fd_type == "linear" then
+ coords = format("%f %f %f %f", tableunpack(coords))
+ elseif fd_type == "circular" then
+ local width, height = bbox[3]-bbox[1], bbox[4]-bbox[2]
+ local radius = (prescript.mplibfaderadius or "0:"..math.sqrt(width^2+height^2)/2):explode":"
+ tableinsert(coords, 3, radius[1])
+ tableinsert(coords, radius[2])
+ coords = format("%f %f %f %f %f %f", tableunpack(coords))
+ else
+ err("unknown fading method '%s'", fd_type)
+ end
+ fd_type = fd_type == "linear" and 2 or 3
+ local opaq = (prescript.mplibfadeopacity or "1:0"):explode":"
+ local on, os, new
+ on = sh_pdfpageresources(fd_type, "0 1", "/DeviceGray", {{opaq[1]}}, {{opaq[2]}}, coords, 1)
+ os = format("<</PatternType 2/Shading %s>>", format(pdfetcs.resfmt, on))
+ on = update_pdfobjs(os)
+ bbox = format("0 0 %f %f", bbox[3]+dx, bbox[4]+dy)
+ local streamtext = format("q /Pattern cs/MPlibFd%s scn %s re f Q", on, bbox)
+ :gsub(decimals,rmzeros)
+ os = format("<</Pattern<</MPlibFd%s %s>>>>", on, format(pdfetcs.resfmt, on))
+ on = update_pdfobjs(os)
+ local resources = format(pdfetcs.resfmt, on)
+ on = update_pdfobjs"<</S/Transparency/CS/DeviceGray>>"
+ local attr = tableconcat{
+ "/Subtype/Form",
+ "/BBox[", bbox, "]",
+ "/Matrix[1 0 0 1 ", format("%f %f", -dx,-dy), "]",
+ "/Resources ", resources,
+ "/Group ", format(pdfetcs.resfmt, on),
+ } :gsub(decimals,rmzeros)
+ on = update_pdfobjs(attr, streamtext)
+ os = "<</SMask<</S/Luminosity/G " .. format(pdfetcs.resfmt, on) .. ">>>>"
+ on, new = update_pdfobjs(os)
+ local key = add_extgs_resources(on,new)
+ start_pdf_code()
+ pdf_literalcode("/%s gs", key)
+ if fd_stop then return "standalone" end
+ return "start"
+end
+
+% \end{macrocode}
+%
+% Transparency Group
+% \begin{macrocode}
+pdfetcs.tr_group = { shifts = { } }
+luamplib.trgroupshifts = pdfetcs.tr_group.shifts
+local function do_preobj_GRP (object, prescript)
+ local grstate = prescript and prescript.gr_state
+ if not grstate then return end
+ local trgroup = pdfetcs.tr_group
+ if grstate == "start" then
+ trgroup.name = prescript.mplibgroupname or "lastmplibgroup"
+ trgroup.isolated, trgroup.knockout = false, false
+ for _,v in ipairs(prescript.gr_type:explode",+") do
+ trgroup[v] = true
+ end
+ trgroup.bbox = prescript.mplibgroupbbox:explode":"
+ put2output[[\begingroup\setbox\mplibscratchbox\hbox\bgroup]]
+ elseif grstate == "stop" then
+ local llx,lly,urx,ury = tableunpack(trgroup.bbox)
+ put2output(tableconcat{
+ "\\egroup",
+ format("\\wd\\mplibscratchbox %fbp", urx-llx),
+ format("\\ht\\mplibscratchbox %fbp", ury-lly),
+ "\\dp\\mplibscratchbox 0pt",
+ })
+ local grattr = format("/Group<</S/Transparency/I %s/K %s>>",trgroup.isolated,trgroup.knockout)
+ local res = gather_resources()
+ local bbox = format("%f %f %f %f", llx,lly,urx,ury) :gsub(decimals,rmzeros)
+ if pdfmode then
+ put2output(tableconcat{
+ "\\saveboxresource type 2 attr{/Type/XObject/Subtype/Form/FormType 1",
+ "/BBox[", bbox, "]", grattr, "} resources{", res, "}\\mplibscratchbox",
+ [[\setbox\mplibscratchbox\hbox{\useboxresource\lastsavedboxresourceindex}]],
+ [[\wd\mplibscratchbox 0pt\ht\mplibscratchbox 0pt\dp\mplibscratchbox 0pt]],
+ [[\box\mplibscratchbox\endgroup]],
+ "\\expandafter\\xdef\\csname luamplib.group.", trgroup.name, "\\endcsname{",
+ "\\noexpand\\mplibstarttoPDF{",llx,"}{",lly,"}{",urx,"}{",ury,"}",
+ "\\useboxresource \\the\\lastsavedboxresourceindex\\noexpand\\mplibstoptoPDF}",
+ })
+ else
+ trgroup.cnt = (trgroup.cnt or 0) + 1
+ local objname = format("@mplibtrgr%s", trgroup.cnt)
+ put2output(tableconcat{
+ "\\special{pdf:bxobj ", objname, " bbox ", bbox, "}",
+ "\\unhbox\\mplibscratchbox",
+ "\\special{pdf:put @resources <<", res, ">>}",
+ "\\special{pdf:exobj <<", grattr, ">>}",
+ "\\special{pdf:uxobj ", objname, "}\\endgroup",
+ })
+ token.set_macro("luamplib.group."..trgroup.name, tableconcat{
+ "\\mplibstarttoPDF{",llx,"}{",lly,"}{",urx,"}{",ury,"}",
+ "\\special{pdf:uxobj ", objname, "}\\mplibstoptoPDF",
+ }, "global")
+ end
+ trgroup.shifts[trgroup.name] = { llx, lly }
+ end
+ return grstate
+end
+function luamplib.registergroup (boxid, name, opts)
+ local box = texgetbox(boxid)
+ local wd, ht, dp = node.getwhd(box)
+ local res = (opts.resources or "") .. gather_resources()
+ local attr = { "/Type/XObject/Subtype/Form/FormType 1" }
+ if type(opts.matrix) == "table" then opts.matrix = tableconcat(opts.matrix," ") end
+ if type(opts.bbox) == "table" then opts.bbox = tableconcat(opts.bbox," ") end
+ if opts.matrix and opts.matrix:find"%a" then
+ local data = format("mplibtransformmatrix(%s);",opts.matrix)
+ process(data,"@mplibtransformmatrix")
+ opts.matrix = format("%f %f %f %f %f %f",tableunpack(luamplib.transformmatrix))
+ end
+ local grtype = 3
+ if opts.bbox then
+ attr[#attr+1] = format("/BBox[%s]", opts.bbox)
+ grtype = 2
+ end
+ if opts.matrix then
+ attr[#attr+1] = format("/Matrix[%s]", opts.matrix)
+ grtype = opts.bbox and 4 or 1
+ end
+ if opts.asgroup then
+ local t = { isolated = false, knockout = false }
+ for _,v in ipairs(opts.asgroup:explode",+") do t[v] = true end
+ attr[#attr+1] = format("/Group<</S/Transparency/I %s/K %s>>", t.isolated, t.knockout)
+ end
+ local trgroup = pdfetcs.tr_group
+ trgroup.shifts[name] = { get_macro'MPllx', get_macro'MPlly' }
+ local whd
+ if pdfmode then
+ attr = tableconcat(attr) :gsub(decimals,rmzeros)
+ local index = tex.saveboxresource(boxid, attr, res, true, grtype)
+ token.set_macro("luamplib.group."..name, "\\useboxresource "..index, "global")
+ whd = format("%.3f %.3f 0", wd/factor, (ht+dp)/factor) :gsub(decimals,rmzeros)
+ else
+ trgroup.cnt = (trgroup.cnt or 0) + 1
+ local objname = format("@mplibtrgr%s", trgroup.cnt)
+ texsprint {
+ "\\expandafter\\newbox\\csname luamplib.groupbox.", trgroup.cnt, "\\endcsname",
+ "\\global\\setbox\\csname luamplib.groupbox.", trgroup.cnt, "\\endcsname",
+ "\\hbox{\\unhbox ", boxid, "}\\luamplibatnextshipout{",
+ "\\special{pdf:bcontent}",
+ "\\special{pdf:bxobj ", objname, " width ", wd, "sp height ", ht, "sp depth ", dp, "sp}",
+ "\\unhbox\\csname luamplib.groupbox.", trgroup.cnt, "\\endcsname",
+ "\\special{pdf:put @resources <<", res, ">>}",
+ "\\special{pdf:exobj <<", tableconcat(attr), ">>}",
+ "\\special{pdf:econtent}}",
+ }
+ token.set_macro("luamplib.group."..name, tableconcat{
+ "\\begingroup\\setbox\\mplibscratchbox\\hbox{\\special{pdf:uxobj ", objname, "}}",
+ "\\wd\\mplibscratchbox ", wd, "sp",
+ "\\ht\\mplibscratchbox ", ht, "sp",
+ "\\dp\\mplibscratchbox ", dp, "sp",
+ "\\box\\mplibscratchbox\\endgroup",
+ }, "global")
+ whd = format("%.3f %.3f %.3f", wd/factor, ht/factor, dp/factor) :gsub(decimals,rmzeros)
+ end
+ info("w/h/d of group '%s': %s", name, whd)
+end
+
+local function stop_special_effects(fade,opaq,over)
+ if fade then -- fading
+ stop_pdf_code()
+ end
+ if opaq then -- opacity
+ pdf_literalcode(opaq)
+ end
+ if over then -- color
+ put2output"\\special{pdf:ec}"
+ end
+end
+
+% \end{macrocode}
+%
+% Codes below for inserting PDF lieterals are mostly from ConTeXt general,
+% with small changes when needed.
+% \begin{macrocode}
+local function getobjects(result,figure,f)
+ return figure:objects()
+end
+
+function luamplib.convert (result, flusher)
+ luamplib.flush(result, flusher)
+ return true -- done
+end
+
+local function pdf_textfigure(font,size,text,width,height,depth)
+ text = text:gsub(".",function(c)
+ return format("\\hbox{\\char%i}",string.byte(c)) -- kerning happens in metapost : false
+ end)
+ put2output("\\mplibtextext{%s}{%f}{%s}{%s}{%s}",font,size,text,0,0)
+end
+
+local bend_tolerance = 131/65536
+
+local rx, sx, sy, ry, tx, ty, divider = 1, 0, 0, 1, 0, 0, 1
+
+local function pen_characteristics(object)
+ local t = mplib.pen_info(object)
+ rx, ry, sx, sy, tx, ty = t.rx, t.ry, t.sx, t.sy, t.tx, t.ty
+ divider = sx*sy - rx*ry
+ return not (sx==1 and rx==0 and ry==0 and sy==1 and tx==0 and ty==0), t.width
+end
+
+local function concat(px, py) -- no tx, ty here
+ return (sy*px-ry*py)/divider,(sx*py-rx*px)/divider
+end
+
+local function curved(ith,pth)
+ local d = pth.left_x - ith.right_x
+ if abs(ith.right_x - ith.x_coord - d) <= bend_tolerance and abs(pth.x_coord - pth.left_x - d) <= bend_tolerance then
+ d = pth.left_y - ith.right_y
+ if abs(ith.right_y - ith.y_coord - d) <= bend_tolerance and abs(pth.y_coord - pth.left_y - d) <= bend_tolerance then
+ return false
+ end
+ end
+ return true
+end
+
+local function flushnormalpath(path,open)
+ local pth, ith
+ for i=1,#path do
+ pth = path[i]
+ if not ith then
+ pdf_literalcode("%f %f m",pth.x_coord,pth.y_coord)
+ elseif curved(ith,pth) then
+ pdf_literalcode("%f %f %f %f %f %f c",ith.right_x,ith.right_y,pth.left_x,pth.left_y,pth.x_coord,pth.y_coord)
+ else
+ pdf_literalcode("%f %f l",pth.x_coord,pth.y_coord)
+ end
+ ith = pth
+ end
+ if not open then
+ local one = path[1]
+ if curved(pth,one) then
+ pdf_literalcode("%f %f %f %f %f %f c",pth.right_x,pth.right_y,one.left_x,one.left_y,one.x_coord,one.y_coord )
+ else
+ pdf_literalcode("%f %f l",one.x_coord,one.y_coord)
+ end
+ elseif #path == 1 then -- special case .. draw point
+ local one = path[1]
+ pdf_literalcode("%f %f l",one.x_coord,one.y_coord)
+ end
+end
+
+local function flushconcatpath(path,open)
+ pdf_literalcode("%f %f %f %f %f %f cm", sx, rx, ry, sy, tx ,ty)
+ local pth, ith
+ for i=1,#path do
+ pth = path[i]
+ if not ith then
+ pdf_literalcode("%f %f m",concat(pth.x_coord,pth.y_coord))
+ elseif curved(ith,pth) then
+ local a, b = concat(ith.right_x,ith.right_y)
+ local c, d = concat(pth.left_x,pth.left_y)
+ pdf_literalcode("%f %f %f %f %f %f c",a,b,c,d,concat(pth.x_coord, pth.y_coord))
+ else
+ pdf_literalcode("%f %f l",concat(pth.x_coord, pth.y_coord))
+ end
+ ith = pth
+ end
+ if not open then
+ local one = path[1]
+ if curved(pth,one) then
+ local a, b = concat(pth.right_x,pth.right_y)
+ local c, d = concat(one.left_x,one.left_y)
+ pdf_literalcode("%f %f %f %f %f %f c",a,b,c,d,concat(one.x_coord, one.y_coord))
+ else
+ pdf_literalcode("%f %f l",concat(one.x_coord,one.y_coord))
+ end
+ elseif #path == 1 then -- special case .. draw point
+ local one = path[1]
+ pdf_literalcode("%f %f l",concat(one.x_coord,one.y_coord))
+ end
+end
+
+% \end{macrocode}
+%
% Finally, flush figures by inserting PDF literals.
% \begin{macrocode}
function luamplib.flush (result,flusher)
@@ -3181,11 +3818,11 @@ function luamplib.flush (result,flusher)
% luamplib silently ignores this invalid figure for those
% that do not contain |beginfig ... endfig|. (issue \#70)
% Original code of ConTeXt general was:
-% \begin{verbatim}
+%\begin{verbatim}
% -- invalid
% pdf_startfigure(fignum,0,0,0,0)
% pdf_stopfigure()
-% \end{verbatim}
+%\end{verbatim}
% \begin{macrocode}
else
% \end{macrocode}
@@ -3203,13 +3840,16 @@ function luamplib.flush (result,flusher)
local object = objects[o]
local objecttype = object.type
% \end{macrocode}
-% The following 6 lines are part of |btex...etex| patch.
+% The following 9 lines are part of |btex...etex| patch.
% Again, colors are processed at this stage.
% \begin{macrocode}
local prescript = object.prescript
prescript = prescript and script2table(prescript) -- prescript is now a table
local cr_over = do_preobj_CR(object,prescript) -- color
local tr_opaq = do_preobj_TR(object,prescript) -- opacity
+ local fading_ = do_preobj_FADE(object,prescript) -- fading
+ local trgroup = do_preobj_GRP(object,prescript) -- transparency group
+ local pattern_ = do_preobj_PAT(object,prescript) -- pattern
if prescript and prescript.mplibtexboxid then
put_tex_boxes(object,prescript)
elseif objecttype == "start_bounds" or objecttype == "stop_bounds" then --skip
@@ -3235,7 +3875,7 @@ function luamplib.flush (result,flusher)
pdf_literalcode("%f %f %f %f %f %f cm",ot[3],ot[4],ot[5],ot[6],ot[1],ot[2])
pdf_textfigure(object.font,object.dsize,object.text,object.width,object.height,object.depth)
stop_pdf_code()
- else
+ elseif not trgroup and fading_ ~= "stop" then
local evenodd, collect, both = false, false, false
local postscript = object.postscript
if not object.istext then
@@ -3261,10 +3901,7 @@ function luamplib.flush (result,flusher)
else
% \end{macrocode}
% Removed from ConTeXt general: color stuff.
-% Added instead : shading stuff
% \begin{macrocode}
- local shade_no = do_preobj_SH(object,prescript) -- shading
- local pattern_ = do_preobj_PAT(object,prescript) -- pattern
local ml = object.miterlimit
if ml and ml ~= miterlimit then
miterlimit = ml
@@ -3306,6 +3943,14 @@ function luamplib.flush (result,flusher)
objecttype = 'fill'
end
end
+% \end{macrocode}
+% Added : shading
+% \begin{macrocode}
+ local shade_no = do_preobj_SH(object,prescript) -- shading
+ if shade_no then
+ pdf_literalcode"q /Pattern cs"
+ objecttype = false
+ end
if transformed then
start_pdf_code()
end
@@ -3326,27 +3971,25 @@ function luamplib.flush (result,flusher)
else
flushnormalpath(path,open)
end
-% \end{macrocode}
-% Shading seems to conflict with these ops
-% \begin{macrocode}
- if not shade_no then -- conflict with shading
- if objecttype == "fill" then
- pdf_literalcode(evenodd and "h f*" or "h f")
- elseif objecttype == "outline" then
- if both then
- pdf_literalcode(evenodd and "h B*" or "h B")
- else
- pdf_literalcode(open and "S" or "h S")
- end
- elseif objecttype == "both" then
+ if objecttype == "fill" then
+ pdf_literalcode(evenodd and "h f*" or "h f")
+ elseif objecttype == "outline" then
+ if both then
pdf_literalcode(evenodd and "h B*" or "h B")
+ else
+ pdf_literalcode(open and "S" or "h S")
end
+ elseif objecttype == "both" then
+ pdf_literalcode(evenodd and "h B*" or "h B")
end
end
if transformed then
stop_pdf_code()
end
local path = object.htap
+% \end{macrocode}
+% How can we generate an |htap| object? Please let us know if you have succeeded.
+% \begin{macrocode}
if path then
if transformed then
start_pdf_code()
@@ -3380,18 +4023,29 @@ function luamplib.flush (result,flusher)
end
end
% \end{macrocode}
-% Added to ConTeXt general: post-object color and shading stuff.
+% Added to ConTeXt general: post-object colors and shading stuff.
+% We should beware the |q ... Q| scope.
% \begin{macrocode}
if shade_no then -- shading
- pdf_literalcode("W n /MPlibSh%s sh Q",shade_no)
+ pdf_literalcode("W%s n /MPlibSh%s sh Q",evenodd and "*" or "",shade_no)
end
end
end
- if tr_opaq then -- opacity
- stop_pdf_code()
+ if fading_ == "start" then
+ pdfetcs.fading.specialeffects = {fading_, tr_opaq, cr_over}
+ elseif trgroup == "start" then
+ pdfetcs.tr_group.specialeffects = {fading_, tr_opaq, cr_over}
+ elseif fading_ == "stop" then
+ local se = pdfetcs.fading.specialeffects
+ if se then stop_special_effects(se[1], se[2], se[3]) end
+ elseif trgroup == "stop" then
+ local se = pdfetcs.tr_group.specialeffects
+ if se then stop_special_effects(se[1], se[2], se[3]) end
+ else
+ stop_special_effects(fading_, tr_opaq, cr_over)
end
- if cr_over then -- color
- put2output"\\special{pdf:ec}"
+ if fading_ or trgroup then -- extgs resetted
+ miterlimit, linecap, linejoin, dashed = -1, -1, -1, false
end
end
end
@@ -3444,15 +4098,34 @@ end
% First we need to load some packages.
%
% \begin{macrocode}
-\bgroup\expandafter\expandafter\expandafter\egroup
-\expandafter\ifx\csname selectfont\endcsname\relax
- \input ltluatex
-\else
+\ifcsname ProvidesPackage\endcsname
+% \end{macrocode}
+% We need \LaTeX\ 2024-06-01 as we use |ltx.pdf.object_id| when pdfmanagement is loaded.
+% But as \pkg{fp} package does not accept an option, we do not append the date option.
+% \begin{macrocode}
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{luamplib}
- [2024/06/14 v2.32.2 mplib package for LuaTeX]
- \ifx\newluafunction\@undefined
+ [2024/08/03 v2.34.5 mplib package for LuaTeX]
+\fi
+\ifdefined\newluafunction\else
\input ltluatex
+\fi
+% \end{macrocode}
+%
+% In DVI mode, a new XObject (mppattern, mplibgroup) must be encapsulated in an \cs{hbox}.
+% But this should not affect typesetting. So we use Hook mechanism provided by \LaTeX\ kernel.
+% In Plain, \pkg{atbegshi.sty} is loaded.
+% \begin{macrocode}
+\ifnum\outputmode=0
+ \ifdefined\AddToHookNext
+ \def\luamplibatnextshipout{\AddToHookNext{shipout/background}}
+ \def\luamplibatfirstshipout{\AddToHook{shipout/firstpage}}
+ \def\luamplibateveryshipout{\AddToHook{shipout/background}}
+ \else
+ \input atbegshi.sty
+ \def\luamplibatnextshipout#1{\AtBeginShipoutNext{\AtBeginShipoutAddToBox{#1}}}
+ \let\luamplibatfirstshipout\AtBeginShipoutFirst
+ \def\luamplibateveryshipout#1{\AtBeginShipout{\AtBeginShipoutAddToBox{#1}}}
\fi
\fi
% \end{macrocode}
@@ -3472,7 +4145,7 @@ end
\fi
% \end{macrocode}
%
-% Set the format for metapost.
+% Set the format for \metapost.
% \begin{macrocode}
\def\mplibsetformat#1{\directlua{luamplib.setformat("#1")}}
% \end{macrocode}
@@ -3514,6 +4187,39 @@ end
\def\mplibputtextbox#1{\vbox to 0pt{\vss\hbox to 0pt{\raise\dp#1\copy#1\hss}}}
% \end{macrocode}
%
+% use Transparency Group
+% \begin{macrocode}
+\protected\def\usemplibgroup#1{\csname luamplib.group.#1\endcsname}
+\protected\def\mplibgroup#1{%
+ \begingroup
+ \def\MPllx{0}\def\MPlly{0}%
+ \def\mplibgroupname{#1}%
+ \mplibgroupgetnexttok
+}
+\def\mplibgroupgetnexttok{\futurelet\nexttok\mplibgroupbranch}
+\def\mplibgroupskipspace{\afterassignment\mplibgroupgetnexttok\let\nexttok= }
+\def\mplibgroupbranch{%
+ \ifx [\nexttok
+ \expandafter\mplibgroupopts
+ \else
+ \ifx\mplibsptoken\nexttok
+ \expandafter\expandafter\expandafter\mplibgroupskipspace
+ \else
+ \let\mplibgroupoptions\empty
+ \expandafter\expandafter\expandafter\mplibgroupmain
+ \fi
+ \fi
+}
+\def\mplibgroupopts[#1]{\def\mplibgroupoptions{#1}\mplibgroupmain}
+\def\mplibgroupmain{\setbox\mplibscratchbox\hbox\bgroup\ignorespaces}
+\protected\def\endmplibgroup{\egroup
+ \directlua{ luamplib.registergroup(
+ \the\mplibscratchbox, '\mplibgroupname', {\mplibgroupoptions}
+ )}%
+ \endgroup
+}
+% \end{macrocode}
+%
% Patterns
% \begin{macrocode}
{\def\:{\global\let\mplibsptoken= } \: }
@@ -3552,7 +4258,7 @@ end
}
% \end{macrocode}
%
-% simple way to use mplib:
+% simple way to use \mplib:
% |\mpfig draw fullcircle scaled 10; \endmpfig|
% \begin{macrocode}
\def\mpfiginstancename{@mpfig}
@@ -3575,16 +4281,16 @@ end
\long\def\mplibdomainmpfig#1\endmpfig{%
\endgroup
\directlua{
- local legacy = luamplib.legacy_verbatimtex
+ local legacy = luamplib.legacyverbatimtex
local everympfig = luamplib.everymplib["\mpfiginstancename"] or ""
local everyendmpfig = luamplib.everyendmplib["\mpfiginstancename"] or ""
- luamplib.legacy_verbatimtex = false
+ luamplib.legacyverbatimtex = false
luamplib.everymplib["\mpfiginstancename"] = ""
luamplib.everyendmplib["\mpfiginstancename"] = ""
luamplib.process_mplibcode(
"beginfig(0) "..everympfig.." "..[===[\unexpanded{#1}]===].." "..everyendmpfig.." endfig;",
"\mpfiginstancename")
- luamplib.legacy_verbatimtex = legacy
+ luamplib.legacyverbatimtex = legacy
luamplib.everymplib["\mpfiginstancename"] = everympfig
luamplib.everyendmplib["\mpfiginstancename"] = everyendmpfig
}%
@@ -3598,14 +4304,14 @@ end
\long\def\mplibdoprempfig#1\endmpfig{%
\endgroup
\directlua{
- local legacy = luamplib.legacy_verbatimtex
+ local legacy = luamplib.legacyverbatimtex
local everympfig = luamplib.everymplib["\mpfiginstancename"]
local everyendmpfig = luamplib.everyendmplib["\mpfiginstancename"]
- luamplib.legacy_verbatimtex = false
+ luamplib.legacyverbatimtex = false
luamplib.everymplib["\mpfiginstancename"] = ""
luamplib.everyendmplib["\mpfiginstancename"] = ""
luamplib.process_mplibcode([===[\unexpanded{#1}]===],"\mpfiginstancename")
- luamplib.legacy_verbatimtex = legacy
+ luamplib.legacyverbatimtex = legacy
luamplib.everymplib["\mpfiginstancename"] = everympfig
luamplib.everyendmplib["\mpfiginstancename"] = everyendmpfig
}%
@@ -3684,9 +4390,9 @@ end
\def\mpliblegacybehavior#1{\directlua{
local s = string.lower("#1")
if s == "enable" or s == "true" or s == "yes" then
- luamplib.legacy_verbatimtex = true
+ luamplib.legacyverbatimtex = true
else
- luamplib.legacy_verbatimtex = false
+ luamplib.legacyverbatimtex = false
end
}}
\def\mplibverbatim#1{\directlua{
@@ -3758,14 +4464,13 @@ end
%
% Allow \TeX\ dimen/color macros. Now |runscript| does the job,
% so the following lines are not needed for most cases.
-% But the macros will be expanded when they are used in another macro.
% \begin{macrocode}
\def\mpdim#1{ runscript("luamplibdimen{#1}") }
\def\mpcolor#1#{\domplibcolor{#1}}
\def\domplibcolor#1#2{ runscript("luamplibcolor{#1{#2}}") }
% \end{macrocode}
%
-% MPLib's number system. Now |binary| has gone away.
+% \mplib's number system. Now |binary| has gone away.
% \begin{macrocode}
\def\mplibnumbersystem#1{\directlua{
local t = "#1"
@@ -3830,12 +4535,13 @@ end
% \end{macrocode}
%
% The followings are from ConTeXt general, mostly.
-% % We use a dedicated scratchbox.
+%
+% We use a dedicated scratchbox.
% \begin{macrocode}
\ifx\mplibscratchbox\undefined \newbox\mplibscratchbox \fi
% \end{macrocode}
%
-% We encapsulate the litterals.
+% We encapsulate the literals.
% \begin{macrocode}
\def\mplibstarttoPDF#1#2#3#4{%
\prependtomplibbox